@rongcloud/engine 5.34.0 → 5.36.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -12,4 +12,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
14
  ***************************************************************************** */
15
- var e=function(t,r){return e=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])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r,n=function(){return n=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},n.apply(this,arguments)};function i(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(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(o,s)}u((n=n.apply(e,t||[])).next())}))}function a(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function o(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 s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function u(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;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 l(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 c(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"}(r||(r={}));var _,f,d,h,g,p,E,I,b,T,v,R,m,A,y,O,S,N,C,P,M,L,w,U,D,G,V,j,k,x,F={L_IMSDK_VER_O:"L-imsdk_ver-O",A_INIT_REPEAT_O:"A_INIT_REPEAT_O",L_INIT_O:"L-init-O",A_DESTROY_O:"A_DESTROY_O",A_CONNECT_T:"A-connect-T",A_CONNECT_R:"A-connect-R",A_CONNECT_S:"A-connect-S",L_QUERY_CMP_T:"L-query_cmp-T",L_QUERY_CMP_R:"L-query_cmp-R",A_DISCONNECT_O:"A-disconnect-O",A_RECONNECT_T:"A-reconnect-T",A_RECONNECT_R:"A_RECONNECT_R",L_CONNECT_T:"L-connect-T",L_CONNECT_O:"L-connect-O",L_CONNECT_R:"L-connect-R",L_CONNECT_S:"L-connect-S",L_DB_UPGRATE_START_S:"L-db_upgrate_start-S",L_DB_UPGRATING_S:"L-db_upgrating-S",L_DB_UPGRATE_COMPLETE_S:"L-db_upgrate_complete-S",L_NOTIFY_ULTRA_ONLINE_S:"L-notify-ultra-online-S",L_ULTRA_SYNC_DONE_S:"L-ultra-sync-done-S",L_BATCH_MESSAGE_O:"L-BATCH_MESSAGE-O",A_MSG_LISTENER_E:"A-MSG_LISTENER-E",O:"L-original-O",T:"L-TEST-O",L_INSTALL_PLUGIN_T:"L-INSTALL_PLUGIN-T",L_INSTALL_PLUGIN_R:"L-INSTALL_PLUGIN-R",L_NAVI_CONF_E:"L-NAVI_CONF_ERROR-E",L_NAVI_CMP_R:"L-NAVI_CPM-R",A_SEND_MSG_T:"A-send_msg-T",A_SEND_MSG_R:"A-send_msg-R",L_SEND_MSG_T:"L-send_msg-T",L_SEND_MSG_R:"L-send_msg-R",A_SEND_TYPING_STATUS_T:"A-send_typing_status-T",A_SEND_TYPING_STATUS_R:"A-send_typing_status-R",A_SEND_READ_RECEIPT_REQ_T:"A-send_read_receipt_req-T",A_SEND_READ_RECEIPT_REQ_R:"A-send_read_receipt_req-R",L_PULL_MSG_T:"L-pull_msg-T",L_PULL_MSG_R:"L-pull_msg-R",L_PULL_MSG_E:"L-pull_msg-E",L_PULL_MSG_O:"L-pull_msg-O",L_PULL_ULTRA_MSG_T:"L-pull_ultra_msg-T",L_PULL_ULTRA_MSG_R:"L-pull_ultra_msg-R",L_PULL_UG_RELATIONS_T:"L-pull_ug_relations-T",L_PULL_UG_RELATIONS_R:"L-pull_ug_relations-R",L_PULL_CHATROOM_KV_T:"L-pull_chatroom_kv-T",L_PULL_CHATROOM_KV_R:"L-pull_chatroom_kv-R",L_PULL_CHATROOM_MSG_T:"L-pull_chatroom_msg-T",L_PULL_CHATROOM_MSG_R:"L-pull_chatroom_msg-R",L_RECV_MULTI_SYNC_MSG_O:"L-recv_multi_sync_msg-O",L_RECV_S_MSG_O:"L-recv_s_msg-O",A_DELETE_LOCAL_MSGS_T:"A-delete_local_msgs-T",A_DELETE_LOCAL_MSGS_R:"A-delete_local_msgs-R",A_RECALL_MESSAGE_T:"A-recall_msg-T",A_RECALL_MESSAGE_R:"A-recall_msg-R",A_RECALL_MESSAGE_E:"A-recall_msg-E",A_REGTYP_O:"A-regtyp-O",P_REGTYP_E:"P-regtype-E",L_GET_NAVI_T:"L-get_navi-T",L_GET_NAVI_R:"L-get_navi-R",L_REQUEST_T:"L-request-T",L_REQUEST_R:"L-request-R",L_PARSE_NAVI_E:"L-parse_navi-E",L_ENV_S:"L-Env-S",L_GET_INDEX_NAVI_S:"L-get_index_navi-S",A_JOIN_CHATROOM_T:"A-join_chatroom-T",A_JOIN_CHATROOM_R:"A-join_chatroom-R",L_REJOIN_CHATROOM_T:"L-rejoin_chatroom-T",L_REJOIN_CHATROOM_R:"L-rejoin_chatroom-R",A_QUIT_CHATROOM_T:"A-quit_chatroom-T",A_QUIT_CHATROOM_R:"A-quit_chatroom-R",A_GET_CHATROOM_INFO_T:"A-get_chatroom_info-T",A_GET_CHATROOM_INFO_R:"A-get_chatroom_info-R",A_SET_CHATROOM_ENTRY_T:"A-set_chatroom_entry-T",A_SET_CHATROOM_ENTRY_R:"A-set_chatroom_entry-R",A_SET_CHATROOM_ENTRIES_T:"A-set_chatroom_entries-T",A_SET_CHATROOM_ENTRIES_R:"A-set_chatroom_entries-R",A_REMOVE_CHATROOM_ENTRY_T:"A-remove_chatroom_entry-T",A_REMOVE_CHATROOM_ENTRY_R:"A-remove_chatroom_entry-R",A_REMOVE_CHATROOM_ENTRIES_T:"A-remove_chatroom_entries-T",A_REMOVE_CHATROOM_ENTRIES_R:"A-remove_chatroom_entries-R",A_GET_CHATROOM_ENTRY_T:"A-get_chatroom_entry-T",A_GET_CHATROOM_ENTRY_R:"A-get_chatroom_entry-R",A_GET_CHATROOM_ENTRIES_T:"A-get_chatroom_entries-T",A_GET_CHATROOM_ENTRIES_R:"A-get_chatroom_entries-R",A_BIND_RTC_FOR_CHATROOM_T:"A-bind_rtc_for_chatroom-T",A_BIND_RTC_FOR_CHATROOM_R:"A-bind_rtc_for_chatroom-R",L_MEDIA_S:"L-media-S",L_MEDIA_UPLOAD_T:"L-media_upload-T",L_MEDIA_UPLOAD_R:"L-media_upload-R",G_UPLOAD_LOG_S:"G-upload_log-S",G_REPORT_LOG_S:"G-report_log-S",G_UPLOAD_LOG_E:"G-upload_log-E",G_GET_REAL_TIMELOG_COMMAND_S:"G-get_real_timelog_command-S",L_CHECK_ALIVE_IM_T:"L-check_alive_im-T",L_CHECK_ALIVE_IM_R:"L-check_alive_im-R",L_CHECK_ALIVE_IM_S:"L-check_alive_im-S",A_GET_LOCAL_MESSAGE_T:"A-get_local_message-T",A_GET_LOCAL_MESSAGE_R:"A-get_local_message-R",A_GET_HISTORY_MSG_T:"A-get_history_msg-T",A_GET_HISTORY_MSG_R:"A-get_history_msg-R",A_GET_REMOTE_HISTORY_MSG_T:"A-get_remote_history_msg-T",A_GET_REMOTE_HISTORY_MSG_R:"A-get_remote_history_msg-R",L_CALLBACK_E:"L-callback-E",A_SEND_READ_RECEIPT_T:"A-send_read_receipt-T",A_SEND_READ_RECEIPT_R:"A-send_read_receipt-R",A_SEND_READ_RECEIPT_V2_T:"A-send_read_receipt_v2-T",A_SEND_READ_RECEIPT_V2_R:"A-send_read_receipt_v2-R",A_SYNC_READ_STATUS_T:"A-sync_read_status-T",A_SYNC_READ_STATUS_R:"A-sync_read_status-R",L_PB_ENCODE_E:"L-pb-encode-E",L_PB_DECODE_E:"L-pb-decode-E",L_NOTIFY_NAVI_CHANGE_E:"L-notify_navi_change-E",L_REPORT_FULL_LOG_O:"L-report_full_log-O",L_REPORT_FULL_LOG_T:"L-report_full_log-T",L_REPORT_FULL_LOG_R:"L-report_full_log-R",L_REPORT_LOG_POLICY_E:"L-parse_navi_logpolicy-E",L_UNSUPPORT_INDEXDB_O:"L-unsupport_IndexDB-O",L_LOGDB_OPEN_FAILED_E:"L-logDB_open_failed-E",L_LOGDB_CLOSED_S:"L-logDB_closed-S",L_LOGDB_ERROR_E:"L-logDB_error-S",L_LOGDB_ABORT_S:"L-logDB_abort-S",L_REALTIME_LOG_T:"L_REALTIME_LOG_T",L_REALTIME_LOG_R:"L_REALTIME_LOG_R",L_REALTIME_LOG_O:"L_REALTIME_LOG_O",L_SEND_RMTP_E:"L-send-rmtp-E",L_RECV_RMTP_O:"L-recv-rmtp-O",L_RECV_RMTP_E:"L-recv-rmtp-E",L_RECV_S_NTF_O:"L-recv_s_ntf_O",L_RECV_S_CMD_O:"L-recv_s_cmd_O",L_VER_REPORT_T:"L-VER_REPORT-T",L_VER_REPORT_R:"L-VER_REPORT-R",L_UNSUPPORT_NTF_FROM_MAIN_E:"L_UNSUPPORT_NTF_FROM_MAIN_E",A_REMOVE_PROXY_O:"A-remove_proxy-O",L_SET_PROXY_O:"L-set_proxy-O",L_TEST_PROXY_T:"L-test_proxy-T",L_TEST_PROXY_R:"L-test_proxy-R",L_WS_DISACCORD_E:"L-ws_disaccord-E",L_GET_STATIC_CONF_T:"L-get_static_conf-T",L_GET_STATIC_CONF_R:"L-get_static_conf-R",L_GET_STATIC_CONF_E:"L-get_static_conf-E",L_CLOUD_DISABLED:"L-cloud_disabled",L_CLOUD_OVERCLOCK:"L-cloud_overclock",L_CLOUD_APPKEY_REGION_E:"L-cloud_appkey_region_error",L_CLOUD_CONFIG_DATA_E:"L-cloud_config_data_error",L_CLOUD_SET_AREA_CODE_O:"L-cloud_set_area_code-O",L_CLOUD_SET_MRTR_O:"L-cloud_set_mrtr-O",L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S:"L-sync_subscribed_user_status_finished-S",L_PULL_SUBSCRIBED_USER_RELATION_T:"L-pull_subscribed_user_relation-T",L_PULL_SUBSCRIBED_USER_RELATION_R:"L-pull_subscribed_user_relation-R",L_PULL_SUBSCRIBED_USER_STATUS_T:"L-pull_subscribed_user_status-T",L_PULL_SUBSCRIBED_USER_STATUS_R:"L-pull_subscribed_user_status-R",L_OWN_USER_PROFILE_CHANGED_S:"L-own_user_profile_changed-S",L_QUERY_SUBSCRIBE_DATA_T:"L-query_subscribe_data-T",L_QUERY_SUBSCRIBE_DATA_R:"L-query_subscribe_data-R",L_PULL_USER_PROFILE_T:"L-pull_user_profile-T",L_PULL_USER_PROFILE_R:"L-pull_user_profile-R",L_PULL_OWN_PROFILE_T:"L-pull_own_profile-T",L_PULL_OWN_PROFILE_R:"L-pull_own_profile-R",L_QUERY_FRIEND_LIST_T:"L-query_friend_list-T",L_QUERY_FRIEND_LIST_R:"L-query_friend_list-R",L_PULL_USER_PROFILE_REQ_T:"L-pull_user_profile_req-T",L_PULL_USER_PROFILE_REQ_R:"L-pull_user_profile_req-R",L_SERVER_EVENT_NOTIFY_ONLINE_T:"L-server_event_notify_online-T",L_SERVER_EVENT_NOTIFY_ONLINE_R:"L-server_event_notify_online-R",L_PULL_EVENT_CHANGE_T:"L-pull_event_change-T",L_PULL_EVENT_CHANGE_R:"L-pull_event_change-R",L_PARSE_JSON_E:"L-parse_json-E",L_REQ_STREAM_MSG_CONTENT_T:"L-req_stream_msg_content-T",L_REQ_STREAM_MSG_CONTENT_R:"L-req_stream_msg_content-R",L_REQ_STREAM_MSG_CONTENT_O:"L-req_stream_msg_content-O",L_REQ_STREAM_MSG_CONTENT_E:"L-req_stream_msg_content-E",L_PULL_CONVERSATION_SETTINGS_T:"L-pull_conversation_settings-T",L_PULL_CONVERSATION_SETTINGS_R:"L-pull_conversation_settings-R",L_PULL_SG_RELATIONS_T:"L-pull_sg_relations-T",L_PULL_SG_RELATIONS_R:"L-pull_sg_relations-R",A_REMOVE_CONVERSATION_T:"A-remove_conversation-T",A_REMOVE_CONVERSATION_R:"A-remove_conversation-R",A_GET_CONVERSATION_T:"A-get_conversation-T",A_GET_CONVERSATION_R:"A-get_conversation-R",A_BATCH_SET_CONVERSATION_TO_TOP_T:"A-batch_set_conversation_to_top-T",A_BATCH_SET_CONVERSATION_TO_TOP_R:"A-batch_set_conversation_to_top-R",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T:"A-batch_set_convers_notification_level-T",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R:"A-batch_set_convers_notification_level-R",A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T:"A-batch_set_convers_translate_strategy-T",A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R:"A-batch_set_convers_translate_strategy-R",A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_T:"A-delete_remote_message_by_timestamp-T",A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_R:"A-delete_remote_message_by_timestamp-R",A_DEL_REMOTE_MSGS_T:"A-del_remote_msgs-T",A_DEL_REMOTE_MSGS_R:"A-del_remote_msgs-R",A_BATCH_CLEAR_REMOTE_MSG_T:"A-batch_clear_remote_msg-T",A_BATCH_CLEAR_REMOTE_MSG_R:"A-batch_clear_remote_msg-R",L_EVENT_LOOP_BLOCKING_S:"L-event_loop_blocking-S",A_E_SEARCH_CONVERSATION_BY_CONTENT_T:"A-e_search_conversation_by_content-T",A_E_SEARCH_CONVERSATION_BY_CONTENT_R:"A-e_search_conversation_by_content-R",A_LOAD_CONVERSATION_LIST_T:"A-load_conversation_list-T",A_LOAD_CONVERSATION_LIST_R:"A-load_conversation_list-R",P_GET_SYS_VERSION_E:"P-get_sys_version-E",A_CLEAR_LOCAL_CACHE_O:"A-clear_local_cache-O",A_E_SET_MESSAGE_STATUS_TO_READ_T:"A-e_set_message_status_to_read-T",A_E_SET_MESSAGE_STATUS_TO_READ_R:"A-e_set_message_status_to_read-R",A_SEARCH_MSGS_BY_PARAMS_T:"A-search_msgs_by_params-T",A_SEARCH_MSGS_BY_PARAMS_R:"A-search_msgs_by_params-R",A_GET_CHATROOM_HISTORY_MESSAGES_T:"A-get_chatroom_history_messages-T",A_GET_CHATROOM_HISTORY_MESSAGES_R:"A-get_chatroom_history_messages-R",A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T:"A-request_speech_to_text_for_message-T",A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R:"A-request_speech_to_text_for_message-R",L_SYNC_USER_SETTINGS_T:"L-sync_user_settings-T",L_SYNC_USER_SETTINGS_R:"L-sync_user_settings-R",A_ADD_TAG_T:"A-add_tag-T",A_ADD_TAG_R:"A-add_tag-R",A_REMOVE_TAG_T:"A-remove_tag-T",A_REMOVE_TAG_R:"A-remove_tag-R",A_UPDATE_TAG_T:"A-update_tag-T",A_UPDATE_TAG_R:"A-update_tag-R",A_GET_TAGS_T:"A-get_tags-T",A_GET_TAGS_R:"A-get_tags-R",A_ADD_TAG_FOR_CONVERSATIONS_T:"A-add_tag_for_conversations-T",A_ADD_TAG_FOR_CONVERSATIONS_R:"A-add_tag_for_conversations-R",A_GET_TAGS_OF_CONVERSATION_T:"A-get_tags_of_conversation-T",A_GET_TAGS_OF_CONVERSATION_R:"A-get_tags_of_conversation-R",A_SET_CONVER_TO_TOP_IN_TAG_T:"A-set_conver_to_top_in_tag-T",A_SET_CONVER_TO_TOP_IN_TAG_R:"A-set_conver_to_top_in_tag-R",A_REMOVE_TAG_FOR_CONVERS_T:"A-remove_tag_for_conversations-T",A_REMOVE_TAG_FOR_CONVERS_R:"A-remove_tag_for_conversations-R",A_REMOVE_TAGS_FOR_CONVER_T:"A-remove_tags_for_conversation-T",A_REMOVE_TAGS_FOR_CONVER_R:"A-remove_tags_for_conversation-R",A_GET_UNREAD_COUNT_BY_TAG_T:"A-get_unread_count_by_tag-T",A_GET_UNREAD_COUNT_BY_TAG_R:"A-get_unread_count_by_tag-R",A_GET_UNREAD_COUNT_T:"A-get_unread_count-T",A_GET_UNREAD_COUNT_R:"A-get_unread_count-R",A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T:"A-get_untagged_conversation_list_by_page-T",A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R:"A-get_untagged_conversation_list_by_page-R",A_SET_TRANSLATION_LANGUAGE_T:"A-set_translation_language-T",A_SET_TRANSLATION_LANGUAGE_R:"A-set_translation_language-R",A_GET_TRANSLATION_LANGUAGE_T:"A-get_translation_language-T",A_GET_TRANSLATION_LANGUAGE_R:"A-get_translation_language-R",A_SET_AUTO_TRANSLATE_ENABLED_T:"A-set_auto_translate_enabled-T",A_SET_AUTO_TRANSLATE_ENABLED_R:"A-set_auto_translate_enabled-R",A_GET_AUTO_TRANSLATE_ENABLED_T:"A-get_auto_translate_enabled-T",A_GET_AUTO_TRANSLATE_ENABLED_R:"A-get_auto_translate_enabled-R",L_PULL_OFFLINE_MESSAGE_FINISHED_S:"L-pull_offline_message_finished-S",A_MODIFY_MESSAGE_WITH_PARAMS_T:"A-modify_msg_with_params-T",A_MODIFY_MESSAGE_WITH_PARAMS_R:"A-modify_msg_with_params-R",A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T:"A-refresh_refer_msg_with_params-T",A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R:"A-refresh_refer_msg_with_params-R",L_PULL_MODIFY_MSG_T:"L-pull_modify_msg-T",L_PULL_MODIFY_MSG_R:"L-pull_modify_msg-R",A_BATCH_DEL_CONVERS_T:"A-batch_del_conversation-T",A_BATCH_DEL_CONVERS_R:"A-batch_del_conversation-R",A_SYNC_REMOTE_CONVERSATIONS_T:"A-e_sync_remote_conversations-T",A_SYNC_REMOTE_CONVERSATIONS_R:"A-e_sync_remote_conversations-R",L_UPDATE_MSG_BOX_TIME_O:"L-update_msg_box_time-O",A_SEND_UG_TYPING_T:"A-send_ug_typing-T",A_SEND_UG_TYPING_R:"A-send_ug_typing-R",A_GET_UG_LIST_T:"A-get_ug_list-T",A_GET_UG_LIST_R:"A-get_ug_list-R",A_GET_UG_MSGS_BY_UID_T:"A-get_ug_msgs_by_uid-T",A_GET_UG_MSGS_BY_UID_R:"A-get_ug_msgs_by_uid-R",A_GET_UG_UNREAD_MENTIONED_DIGEST_T:"A-get_ug_unread_mentioned_digest-T",A_GET_UG_UNREAD_MENTIONED_DIGEST_R:"A-get_ug_unread_mentioned_digest-R",A_GET_HIS_MSGS_BY_OBJ_NAMES_T:"A-get_his_msgs_by_obj_names-T",A_GET_HIS_MSGS_BY_OBJ_NAMES_R:"A-get_his_msgs_by_obj_names-R",A_GET_CONTINUOUS_MSGS_T:"A-get_continuous_msgs-T",A_GET_CONTINUOUS_MSGS_R:"A-get_continuous_msgs-R",A_GET_MSGS_AROUND_TIMESTAMP_T:"A-get_msgs_around_timestamp-T",A_GET_MSGS_AROUND_TIMESTAMP_R:"A-get_msgs_around_timestamp-R",A_CLEAR_LOCAL_MSG_T:"A-clear_local_msg-T",A_CLEAR_LOCAL_MSG_R:"A-clear_local_msg-R",A_DEL_LOCAL_MSGS_BY_TIME_T:"A-del_local_msgs_by_time-T",A_DEL_LOCAL_MSGS_BY_TIME_R:"A-del_local_msgs_by_time-R",A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T:"A-batch_clear_local_msgs_by_time-T",A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R:"A-batch_clear_local_msgs_by_time-R",A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T:"A-del_local_ug_msgs_for_all_channel-T",A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R:"A-del_local_ug_msgs_for_all_channel-R",A_UPDATE_MSG_EXPANSION_T:"A-update_msg_expansion-T",A_UPDATE_MSG_EXPANSION_R:"A-update_msg_expansion-R",A_REMOVE_MSG_EXPANSION_T:"A-remove_msg_expansion-T",A_REMOVE_MSG_EXPANSION_R:"A-remove_msg_expansion-R",A_REMOVE_ALL_MSG_EXPANSION_T:"A-remove_all_msg_expansion-T",A_REMOVE_ALL_MSG_EXPANSION_R:"A-remove_all_msg_expansion-R",A_INSERT_MSG_T:"A-insert_msg-T",A_INSERT_MSG_R:"A-insert_msg-R",A_BATCH_INSERT_MSGS_T:"A-batch_insert_msgs-T",A_BATCH_INSERT_MSGS_R:"A-batch_insert_msgs-R",A_SET_MSG_CONTENT_T:"A-set_msg_content-T",A_SET_MSG_CONTENT_R:"A-set_msg_content-R",A_SET_UG_DEFAULT_NTF_LEVEL_T:"A-set_ug_default_ntf_level-T",A_SET_UG_DEFAULT_NTF_LEVEL_R:"A-set_ug_default_ntf_level-R",A_GET_UG_DEFAULT_NTF_LEVEL_T:"A-get_ug_default_ntf_level-T",A_GET_UG_DEFAULT_NTF_LEVEL_R:"A-get_ug_default_ntf_level-R",A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T:"A-get_ug_unread_count_for_all_channels-T",A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R:"A-get_ug_unread_count_for_all_channels-R",A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T:"A-get_total_unread_count_by_levels-T",A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R:"A-get_total_unread_count_by_levels-R",A_GET_TOTAL_UNREAD_COUNT_T:"A-get_total_unread_count-T",A_GET_TOTAL_UNREAD_COUNT_R:"A-get_total_unread_count-R",A_GET_FIRST_UNREAD_MEG_T:"A-get_first_unread_msg-T",A_GET_FIRST_UNREAD_MSG_R:"A-get_first_unread_msg-R",A_GET_FIRST_UNREAD_MSG_DIGEST_T:"A-get_first_unread_msg_digest-T",A_GET_FIRST_UNREAD_MSG_DIGEST_R:"A-get_first_unread_msg_digest-R",A_GET_UNREAD_MENTIONED_MSGS_T:"A-get_unread_mentioned_msgs-T",A_GET_UNREAD_MENTIONED_MSGS_R:"A-get_unread_mentioned_msgs-R",A_GET_UG_UNREAD_INFO_LIST_T:"A-get_ug_unread_info_list-T",A_GET_UG_UNREAD_INFO_LIST_R:"A-get_ug_unread_info_list-R",A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T:"A-get_ug_first_unread_msg_digest-T",A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R:"A-get_ug_first_unread_msg_digest-R",A_GET_LOCAL_MSG_COUNT_T:"A-get_local_msg_count-T",A_GET_LOCAL_MSG_COUNT_R:"A-get_local_msg_count-R",A_GET_CONVERSATIONS_T:"A-get_conversations-T",A_GET_CONVERSATIONS_R:"A-get_conversations-R",A_GET_BLOCKED_UG_LIST_T:"A-get_blocked_ug_list-T",A_GET_BLOCKED_UG_LIST_R:"A-get_blocked_ug_list-R",A_CLEAR_UNREAD_COUNT_T:"A-clear_unread_count-T",A_CLEAR_UNREAD_COUNT_R:"A-clear_unread_count-R",A_CLEAR_ALL_UNREAD_COUNT_T:"A-clear_all_unread_count-T",A_CLEAR_ALL_UNREAD_COUNT_R:"A-clear_all_unread_count-R",A_GET_TOP_CONVERSATION_LIST_T:"A-get_top_conversation_list-T",A_GET_TOP_CONVERSATION_LIST_R:"A-get_top_conversation_list-R",A_GET_UNREAD_CONVERSATION_LIST_T:"A-get_unread_conversation_list-T",A_GET_UNREAD_CONVERSATION_LIST_R:"A-get_unread_conversation_list-R",A_GET_BLOCKED_CONVERSATION_LIST_T:"A-get_blocked_conversation_list-T",A_GET_BLOCKED_CONVERSATION_LIST_R:"A-get_blocked_conversation_list-R",A_GET_ALL_CONVERSATION_LIST_T:"A-get_all_conversation_list-T",A_GET_ALL_CONVERSATION_LIST_R:"A-get_all_conversation_list-R",A_GET_CONVERSATION_LIST_BY_TIME_T:"A-get_conversation_list_by_time-T",A_GET_CONVERSATION_LIST_BY_TIME_R:"A-get_conversation_list_by_time-R",A_GET_CONVERSATION_LIST_OLD_T:"A-get_conversation_list_old-T",A_GET_CONVERSATION_LIST_OLD_R:"A-get_conversation_list_old-R",A_GET_UNREAD_MENTIONED_COUNT_T:"A-get_unread_mentioned_count-T",A_GET_UNREAD_MENTIONED_COUNT_R:"A-get_unread_mentioned_count-R",A_GET_ALL_UNREAD_MENTIONED_COUNT_T:"A-get_all_unread_mentioned_count-T",A_GET_ALL_UNREAD_MENTIONED_COUNT_R:"A-get_all_unread_mentioned_count-R",A_GET_REALTIME_CONVERSATIONS_T:"A-get_realtime_conversations-T",A_GET_REALTIME_CONVERSATIONS_R:"A-get_realtime_conversations-R",A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T:"A-get_realtime_con_total_unread_count-T",A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_R:"A-get_realtime_con_total_unread_count-R",A_CLEAR_REALTIME_CON_UNREAD_COUNT_T:"A-clear_realtime_con_unread_count-T",A_CLEAR_REALTIME_CON_UNREAD_COUNT_R:"A-clear_realtime_con_unread_count-R",A_REMOVE_REALTIME_CONVERSATIONS_T:"A-remove_realtime_conversations-T",A_REMOVE_REALTIME_CONVERSATIONS_R:"A-remove_realtime_conversations-R",A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T:"A-batch_get_realtime_con_unread_count-T",A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R:"A-batch_get_realtime_con_unread_count-R",A_GET_SUB_USERS_STATUS_T:"A-get_sub_users_status-T",A_GET_SUB_USERS_STATUS_R:"A-get_sub_users_status-R",A_GET_SUB_USERS_ONLINE_STATUS_T:"A-get_sub_users_online_status-T",A_GET_SUB_USERS_ONLINE_STATUS_R:"A-get_sub_users_online_status-R",A_SAVE_EDITED_MSG_DRAFT_T:"A-save_edited_msg_draft-T",A_SAVE_EDITED_MSG_DRAFT_R:"A-save_edited_msg_draft-R",A_GET_EDITED_MSG_DRAFT_T:"A-get_edited_msg_draft-T",A_GET_EDITED_MSG_DRAFT_R:"A-get_edited_msg_draft-R",A_CLEAR_EDITED_MSG_DRAFT_T:"A-clear_edited_msg_draft-T",A_CLEAR_EDITED_MSG_DRAFT_R:"A-clear_edited_msg_draft-R",A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T:"A-get_unread_mention_me_conversation_list-T",A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R:"A-get_unread_mention_me_conversation_list-R",A_GET_USER_PROFILES_T:"A-get_user_profiles-T",A_GET_USER_PROFILES_R:"A-get_user_profiles-R",A_ADD_TO_BLACKLIST_T:"A-add_to_blacklist-T",A_ADD_TO_BLACKLIST_R:"A-add_to_blacklist-R",A_REMOVE_FROM_BLACKLIST_T:"A-remove_from_blacklist-T",A_REMOVE_FROM_BLACKLIST_R:"A-remove_from_blacklist-R",A_GET_BLACKLIST_T:"A-get_blacklist-T",A_GET_BLACKLIST_R:"A-get_blacklist-R",A_GET_BLACKLIST_STATUS_T:"A-get_blacklist_status-T",A_GET_BLACKLIST_STATUS_R:"A-get_blacklist_status-R",A_E_SET_MSG_RECEIVED_STATUS_T:"A-e_set_msg_received_status-T",A_E_SET_MSG_RECEIVED_STATUS_R:"A-e_set_msg_received_status-R",A_E_SET_MSG_SENT_STATUS_T:"A-e_set_msg_sent_status-T",A_E_SET_MSG_SENT_STATUS_R:"A-e_set_msg_sent_status-R",A_E_SET_CHECK_DUPLICATE_MSG_T:"A-e_set_check_duplicate_msg-T",A_E_SET_CHECK_DUPLICATE_MSG_R:"A-e_set_check_duplicate_msg-R",A_SET_PROXY_T:"A-set_proxy-T",A_SET_PROXY_R:"A-set_proxy-R",A_GET_PROXY_T:"A-get_proxy-T",A_GET_PROXY_R:"A-get_proxy-R",A_TEST_PROXY_T:"A-test_proxy-T",A_TEST_PROXY_R:"A-test_proxy-R",A_CLEAR_UNREAD_COUNT_BY_TIME_T:"A-clear_unread_count_by_time-T",A_CLEAR_UNREAD_COUNT_BY_TIME_R:"A-clear_unread_count_by_time-R",A_GET_MSG_READER_T:"A-get_msg_reader-T",A_GET_MSG_READER_R:"A-get_msg_reader-R",A_SEND_READ_RECEIPT_V4_T:"A-send_read_receipt_v4-T",A_SEND_READ_RECEIPT_V4_R:"A-send_read_receipt_v4-R",A_GET_READ_RECEIPT_V4_T:"A-get_read_receipt_V4-T",A_GET_READ_RECEIPT_V4_R:"A-get_read_receipt_V4-R",A_BATCH_GET_READ_RECEIPT_INFO_V4_T:"A-batch_get_read_receipt_info_V4-T",A_BATCH_GET_READ_RECEIPT_INFO_V4_R:"A-batch_get_read_receipt_info_V4-R",A_GET_ALL_ROBOTS_T:"A-get_all_robots-T",A_GET_ALL_ROBOTS_R:"A-get_all_robots-R",A_GET_ROBOT_BY_ID_T:"A-get_robot_by_id-T",A_GET_ROBOT_BY_ID_R:"A-get_robot_by_id-R",A_ADD_FRIEND_T:"A-add_friend-T",A_ADD_FRIEND_R:"A-add_friend-R",A_DELETE_FRIENDS_T:"A-delete_friends-T",A_DELETE_FRIENDS_R:"A-delete_friends-R",A_ACCEPT_FRIEND_REQUEST_T:"A-accept_friend_request-T",A_ACCEPT_FRIEND_REQUEST_R:"A-accept_friend_request-R",A_REFUSE_FRIEND_REQUEST_T:"A-refuse_friend_request-T",A_REFUSE_FRIEND_REQUEST_R:"A-refuse_friend_request-R",A_SET_FRIEND_INFO_T:"A-set_friend_info-T",A_SET_FRIEND_INFO_R:"A-set_friend_info-R",A_CHECK_FRIENDS_T:"A-check_friends-T",A_CHECK_FRIENDS_R:"A-check_friends-R",A_GET_FRIENDS_T:"A-get_friends-T",A_GET_FRIENDS_R:"A-get_friends-R",A_GET_FRIEND_APPLICATIONS_T:"A-get_friend_applications-T",A_GET_FRIEND_APPLICATIONS_R:"A-get_friend_applications-R",A_GET_FRIENDS_INFO_T:"A-get_friends_info-T",A_GET_FRIENDS_INFO_R:"A-get_friends_info-R",A_SEARCH_FRIENDS_INFO_T:"A-search_friends_info-T",A_SEARCH_FRIENDS_INFO_R:"A-search_friends_info-R",A_SET_FRIEND_ADD_PERMISSION_T:"A-set_friend_add_permission-T",A_SET_FRIEND_ADD_PERMISSION_R:"A-set_friend_add_permission-R",A_GET_FRIEND_ADD_PERMISSION_T:"A-get_friend_add_permission-T",A_GET_FRIEND_ADD_PERMISSION_R:"A-get_friend_add_permission-R",A_CREATE_GROUP_T:"A-create_group-T",A_CREATE_GROUP_R:"A-create_group-R",A_UPDATE_GROUP_INFO_T:"A-update_group_info-T",A_UPDATE_GROUP_INFO_R:"A-update_group_info-R",A_GET_GROUPS_INFO_T:"A-get_groups_info-T",A_GET_GROUPS_INFO_R:"A-get_groups_info-R",A_KICK_GROUP_MEMBERS_T:"A-kick_group_members-T",A_KICK_GROUP_MEMBERS_R:"A-kick_group_members-R",A_QUIT_GROUP_T:"A-quit_group-T",A_QUIT_GROUP_R:"A-quit_group-R",A_DISMISS_GROUP_T:"A-dismiss_group-T",A_DISMISS_GROUP_R:"A-dismiss_group-R",A_TRANSFER_GROUP_OWNER_T:"A-transfer_group_owner-T",A_TRANSFER_GROUP_OWNER_R:"A-transfer_group_owner-R",A_ADD_GROUP_MANAGERS_T:"A-add_group_managers-T",A_ADD_GROUP_MANAGERS_R:"A-add_group_managers-R",A_REMOVE_GROUP_MANAGERS_T:"A-remove_group_managers-T",A_REMOVE_GROUP_MANAGERS_R:"A-remove_group_managers-R",A_GET_GROUP_MEMBERS_T:"A-get_group_members-T",A_GET_GROUP_MEMBERS_R:"A-get_group_members-R",A_SET_GROUP_MEMBER_INFO_T:"A-set_group_member_info-T",A_SET_GROUP_MEMBER_INFO_R:"A-set_group_member_info-R",A_SEARCH_GROUP_MEMBERS_T:"A-search_group_members-T",A_SEARCH_GROUP_MEMBERS_R:"A-search_group_members-R",A_JOIN_GROUP_T:"A-join_group-T",A_JOIN_GROUP_R:"A-join_group-R",A_INVITE_USERS_TO_GROUP_T:"A-invite_users_to_group-T",A_INVITE_USERS_TO_GROUP_R:"A-invite_users_to_group-R",A_ADD_GROUP_FOLLOWS_T:"A-add_group_follows-T",A_ADD_GROUP_FOLLOWS_R:"A-add_group_follows-R",A_REMOVE_GROUP_FOLLOWS_T:"A-remove_group_follows-T",A_REMOVE_GROUP_FOLLOWS_R:"A-remove_group_follows-R",A_GET_GROUP_FOLLOWS_T:"A-get_group_follows-T",A_GET_GROUP_FOLLOWS_R:"A-get_group_follows-R",A_SET_GROUP_REMARK_T:"A-set_group_remark-T",A_SET_GROUP_REMARK_R:"A-set_group_remark-R",A_GET_GROUP_MEMBERS_BY_ROLE_T:"A-get_group_members_by_role-T",A_GET_GROUP_MEMBERS_BY_ROLE_R:"A-get_group_members_by_role-R",A_ACCEPT_GROUP_INVITE_T:"A-accept_group_invite-T",A_ACCEPT_GROUP_INVITE_R:"A-accept_group_invite-R",A_REFUSE_GROUP_INVITE_T:"A-refuse_group_invite-T",A_REFUSE_GROUP_INVITE_R:"A-refuse_group_invite-R",A_ACCEPT_GROUP_APPLICATION_T:"A-accept_group_application-T",A_ACCEPT_GROUP_APPLICATION_R:"A-accept_group_application-R",A_REFUSE_GROUP_APPLICATION_T:"A-refuse_group_application-T",A_REFUSE_GROUP_APPLICATION_R:"A-refuse_group_application-R",A_GET_GROUP_APPLICATIONS_T:"A-get_group_applications-T",A_GET_GROUP_APPLICATIONS_R:"A-get_group_applications-R",A_GET_JOINED_GROUPS_BY_ROLES_T:"A-get_joined_groups_by_roles-T",A_GET_JOINED_GROUPS_BY_ROLES_R:"A-get_joined_groups_by_roles-R",A_SEARCH_JOINED_GROUPS_T:"A-search_joined_groups-T",A_SEARCH_JOINED_GROUPS_R:"A-search_joined_groups-R",A_GET_JOINED_GROUPS_T:"A-get_joined_groups-T",A_GET_JOINED_GROUPS_R:"A-get_joined_groups-R",A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T:"A-search_user_profile_by_unique_id-T",A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R:"A-search_user_profile_by_unique_id-R",A_UPDATE_MY_USER_PROFILE_VISIBILITY_T:"A-update_my_user_profile_visibility-T",A_UPDATE_MY_USER_PROFILE_VISIBILITY_R:"A-update_my_user_profile_visibility-R",A_GET_MY_USER_PROFILE_VISIBILITY_T:"A-get_my_user_profile_visibility-T",A_GET_MY_USER_PROFILE_VISIBILITY_R:"A-get_my_user_profile_visibility-R",A_SUBSCRIBE_USER_STATUS_T:"A-subscribe_user_status-T",A_SUBSCRIBE_USER_STATUS_R:"A-subscribe_user_status-R",A_UNSUBSCRIBE_USER_STATUS_T:"A-unsubscribe_user_status-T",A_UNSUBSCRIBE_USER_STATUS_R:"A-unsubscribe_user_status-R",A_GET_SUBSCRIBE_USER_STATUS_LIST_T:"A-get_subscribe_user_status_list-T",A_GET_SUBSCRIBE_USER_STATUS_LIST_R:"A-get_subscribe_user_status_list-R",A_GET_MY_USER_PROFILE_T:"A-get_my_user_profile-T",A_GET_MY_USER_PROFILE_R:"A-get_my_user_profile-R",A_UPDATE_MY_USER_PROFILE_T:"A-update_my_user_profile-T",A_UPDATE_MY_USER_PROFILE_R:"A-update_my_user_profile-R",A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T:"A-get_conversations_including_robots-T",A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R:"A-get_conversations_including_robots-R",L_PULL_SG_UNREAD_COUNT_T:"L-pull_sg_unread_count-T",L_PULL_SG_UNREAD_COUNT_R:"L-pull_sg_unread_count-R",A_MARK_REMOTE_CONVERSATION_AS_READ_T:"A-mark_remote_conversation_as_read-T",A_MARK_REMOTE_CONVERSATION_AS_READ_R:"A-mark_remote_conversation_as_read-R"};!function(e){e[e.BOTH=2]="BOTH"}(_||(_={})),function(e){e[e.BOTH=2]="BOTH"}(f||(f={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(d||(d={})),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"}(h||(h={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(g||(g={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(p||(p={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(E||(E={})),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"}(I||(I={})),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"}(b||(b={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(T||(T={})),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"}(v||(v={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(R||(R={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(m||(m={})),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"}(A||(A={})),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"}(y||(y={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(O||(O={})),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"}(S||(S={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(N||(N={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}(C||(C={})),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"}(P||(P={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(M||(M={})),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"}(L||(L={})),function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(w||(w={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(U||(U={})),function(e){e[e.LeaveOnMyOwn=0]="LeaveOnMyOwn",e[e.OtherDeviceLogin=1]="OtherDeviceLogin"}(D||(D={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(G||(G={})),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"}(V||(V={})),function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}(j||(j={})),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.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_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.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",e[e.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",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_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_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.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.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.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.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"}(k||(k={})),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"}(x||(x={}));var B,H,Y,W=0,J=1,q=2,K=3,Q=4,X=5,Z=6,z=7,$=function(e){var t=[x.PRIVATE,x.GROUP,x.SYSTEM,x.PUBLIC_SERVICE,x.APP_PUBLIC_SERVICE];switch(e){case W:return t;case J:return[x.PRIVATE,x.GROUP];case q:return u(u([],s(t),!1),[x.ULTRA_GROUP],!1);case K:return u(u([],s(t),!1),[x.ULTRA_GROUP,x.CHATROOM],!1);case Q:return u(u([],s(t),!1),[x.ULTRA_GROUP,x.CHATROOM,x.RTC_ROOM,x.CUSTOMER_SERVICE,x.DISCUSSION],!1);case X:return[x.PRIVATE,x.GROUP,x.ULTRA_GROUP];case Z:return[x.GROUP];case z:return[x.PRIVATE]}},ee=function(e,t){return $(t).includes(e)};!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"}(B||(B={})),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"}(H||(H={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(Y||(Y={}));var te,re,ne,ie,ae,oe,se,ue,le,ce,_e,fe,de,he,ge,pe,Ee,Ie,be,Te,ve,Re={TextMessage:"RC:TxtMsg",TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL:"RC:RcCmd",RECALL_MESSAGE_TYPE:"RC:RcCmd",RECALL_NOTIFICATION_MESSAGE:"RC:RcNtf",READ_RECEIPT:"RC:ReadNtf",READ_RECEIPT_REQUEST:"RC:RRReqMsg",READ_RECEIPT_RESPONSE:"RC:RRRspMsg",SYNC_READ_STATUS:"RC:SRSMsg",GROUP_READ_RECEIPT_REQUEST:"RC:RRMsg",READ_STATE:"RC:RSMsg",DELIVERED:"RC:Delivered",DELIVERED_MSG:"RC:DRMsg",CHATROOM_MERGE_CHANGE:"RC:ChrmMemChange",CHATROOM_SYNC_MSG:"RC:ChrmSyncMsg",CHATROOM_MERGE_BLOCK:"RC:ChrmBlockMsg",CHATROOM_MERGE_BAN:"RC:ChrmBanMsg",TYPING_STATUS:"RC:TypSts",INTERCEPT:"RC:InterceptMsg",CLOUD_CONTROL:"RC:CCConfigChangeRequestMsg",STREAM_MESSAGE:"RC:StreamMsg"};!function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(te||(te={})),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"}(re||(re={})),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"}(ne||(ne={})),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"}(ie||(ie={})),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"}(ae||(ae={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(oe||(oe={})),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"}(se||(se={})),function(e){e[e.typing=0]="typing"}(ue||(ue={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(le||(le={})),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"}(ce||(ce={})),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"}(_e||(_e={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(fe||(fe={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(de||(de={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(he||(he={})),function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(ge||(ge={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(pe||(pe={})),function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(Ee||(Ee={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(Ie||(Ie={})),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"}(be||(be={})),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"}(Te||(Te={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(ve||(ve={}));var me,Ae,ye,Oe,Se,Ne,Ce,Pe,Me,Le=function(e){return e===ve.OPEN?Te.AT_MESSAGE_NOTIFICATION:Te.NOT_SET},we=function(e){return e<=Te.NOT_SET?ve.CLOSE:ve.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"}(me||(me={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(Ae||(Ae={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(ye||(ye={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Oe||(Oe={})),function(e){e[e.CURRENT=2]="CURRENT"}(Se||(Se={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Ne||(Ne={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(Ce||(Ce={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(Pe||(Pe={})),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"}(Me||(Me={}));var Ue,De,Ge={ALL:0,EXCLUDE_ROBOT:1,ROBOT_ONLY:2},Ve={DISALLOW:0,ALLOW:1},je={NOT_CONVERTED:0,CONVERTING:1,SUCCESS:2,FAILED:3},ke={NORMAL:0,ROBOT:1},xe={UNKNOWN:-1,V1:0,V2:1,V4:3,V5:4};!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"}(Ue||(Ue={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(De||(De={}));var Fe=72e5,Be=6e4,He=131072,Ye="5.34.0".replace(/-.+$/,""),We=5368709120,Je=10485760,qe="rongcloudsystem",Ke=864e5,Qe="RCDeviceId",Xe=function(e){return"navi_".concat(e)},Ze=function(e,t){return"RC-con-stat-ver-".concat(e,"-").concat(t)},ze=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},$e=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},et=function(e,t){return"RC-con-type-settings-".concat(e,"-").concat(t)},rt=function(e,t){return"outbox_".concat(e,"_").concat(t)},nt=function(e,t){return"inbox_".concat(e,"_").concat(t)},it=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},at=function(e,t){return"send_msg_".concat(e,"_").concat(t)},ot=function(e,t){return"RC-us-".concat(e,"-").concat(t)},st=function(e){return"rc-static-config-".concat(e)},ut=function(e){return"RC-cc-".concat(e)},lt=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},ct=function(e){return"RC-LI-".concat(e)},_t=Math.pow(2,31)-1,ft="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};ft.engine="5.34.0";var dt=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)&&(ft[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 ft.engine.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 ft}}),e}();var ht={gen: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)}))},genWithLen:function(e){void 0===e&&(e=22);var t,r=Date.now(),n=r.toString(36),i=Math.floor(Math.random()*r).toString(36),a=e-n.length-i.length;return[i,n,a>0?(t=a,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},gt=ht.genWithLen(22),pt=Date.now(),Et=function(e){return"string"==typeof e},It=function(e){return"boolean"==typeof e},bt=function(e){return"number"==typeof e&&!Number.isNaN(e)},Tt=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},vt=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},Rt=function(e){return function(t){return Et(t)&&(void 0===e.isTrim||0===t.length||t.trim().length>0)&&(void 0===e.minLength||t.length>=e.minLength)&&(void 0===e.maxLength||t.length<=e.maxLength)&&(void 0===e.validator||e.validator(t))}},mt=function(e){return Et(e)&&e.length>0},At=function(e){return vt(e)&&e.length>0},yt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Ot=function(e){return"function"==typeof e},St=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},Nt=function(e){return Et(e)&&/https?:\/\//.test(e)},Ct=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},Pt=function(e){return bt(e)&&Object.prototype.hasOwnProperty.call(x,e)},Mt=function(e){return bt(e)&&Object.prototype.hasOwnProperty.call(Te,e)},Lt=function(e){var t=!1;return Et(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},wt=function(e){return Object.values(e.type).includes(e.value)},Ut=function(e){return Rt({minLength:1,maxLength:64})(e)},Dt=function(e){return Rt({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},Gt=function(e){return bt(e)&&Object.prototype.hasOwnProperty.call(H,e)},Vt=function(){return"undefined"!=typeof RCCppEngine},jt=function(e){return{isRead:(e&me.READ)===me.READ,isListened:(e&me.LISTENED)===me.LISTENED,isDownload:(e&me.DOWNLOADED)===me.DOWNLOADED,isRetrieved:(e&me.RETRIEVED)===me.RETRIEVED}},kt=function(e){var t=me.UNREAD;return(null==e?void 0:e.isRead)&&(t|=me.READ),(null==e?void 0:e.isListened)&&(t|=me.LISTENED),(null==e?void 0:e.isDownload)&&(t|=me.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=me.RETRIEVED),t},xt=function(e){return[ce.iOS,ce.Android,ce.Web,ce.PC,ce.Mini,ce.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]}))},Ft=function(e,t,r){var n=t.reduce((function(e,t){return["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e}),{});return n.userId=e,r.forEach((function(e){n.extraProfile=n.extraProfile||{},n.extraProfile[e.key]=e.value})),n},Bt=function(e,t,r){return t?1===r?B.TLS:B.RMTP:"http"===e?B.WS:B.WSS},Ht=function(e,t){var r=e.server,n=e.backupServer,i=e.bs,a=e.serverAddr,o=e.protocol,l=e.openTLS;if(a)return u([],s(a.filter((function(e){return e.addr}))),!1);var c=[],_=[];return r&&_.push(r),(n||i||"").split(",").forEach((function(e){_.indexOf(e)<0&&_.push(e)})),_.forEach((function(e,n){e&&c.push({addr:e,protocol:Bt(o,t,l),weight:r.length-n,race:!1})})),u([],s(c),!1)},Yt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Kt(e.settingProfile),r=e.extProfile||[],i=e.targetId,a=e.baseInfo,o=e.userInfo;return JSON.parse(JSON.stringify(n(n({groupId:i},Jt(t)),{extProfile:r.length>0?Kt(r):void 0,creatorId:null==a?void 0:a.creatorId,ownerId:null==a?void 0:a.ownerId,createTime:null==a?void 0:a.createTime,membersCount:null==a?void 0:a.memberCount,remark:null==o?void 0:o.remarkName})))}))},Wt=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},Jt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Wt(e.joinPerm),removeMemberPermission:Wt(e.removePerm),invitePermission:Wt(e.memInvitePerm),inviteHandlePermission:Wt(e.invitePerm),groupInfoEditPermission:Wt(e.profilePerm),memberInfoEditPermission:Wt(e.memProfilePerm)}))},qt=function(e){return void 0===e&&(e=[]),e.map(Qt)},Kt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Qt=function(e){var t=e.userId,r=e.name,n=e.portraitUrl,i=e.ext||{},a=i.role,o=i.joinTime,s=i.channelNickName,u=i.additional,l=i.isBot;return{userId:t,name:r||"",portraitUri:n||"",nickname:s||"",extra:u||"",role:a||m.UNDEF,joinedTime:o||0,isRobot:!!l}},Xt=function(e){var t=e.joinUserInfo,r=e.inviterInfo,n=e.processInfo;return{groupId:e.targetId,joinMemberInfo:Qt(t),inviterInfo:r&&r.userId?Qt(r):void 0,operatorInfo:n&&n.userId?Qt(n):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},Zt=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},zt=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};function $t(e){for(var t=null===window||void 0===window?void 0:window.atob(e),r=new Uint8Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r.buffer}var er,tr=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=ht.gen(),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)}(),a=(new Date).getTime(),o="";if(t){var s=t.split(".");o=".".concat(s[s.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(r,"_").concat(a).concat(n).concat(o)},rr=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.channelIdMi,i=t.channelIdHW,a=t.channelIdOPPO,o=t.typeVivo,s=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,_=t.importanceHonor,f=t.imageUrlHonor,d=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var r=e.threadId,n=e.apnsCollapseId,i=e.category,a=e.richMediaUri,o=e.interruptionLevel,s=t.googleConfig,u={};u["thread-id"]=r||"",u["apns-collapse-id"]=n||"",u.category=i||"",u.richMediaUri=a||"",u["interruption-level"]=o||"active";var l={};l.collapse_key=null==s?void 0:s.collapseKey,l.imageUrl=null==s?void 0:s.imageUrl;var c=null==s?void 0:s.priority;return c&&!["high","normal"].includes(c)&&(c="normal"),l.priority=c,{APNS:u,FCM:l}}(e,t),h=[{HW:{channelId:i||"",importance:s||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:a||""}},{VIVO:{classification:o||"",category:c||""}},{APNS:d.APNS},{FCM:d.FCM},{HONOR:{importance:_||Ie.NORMAL,image:f||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(h)},nr=function(e,t){var r={},n={notificationId:t||""},i={};if(!e)return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i};try{var a=JSON.parse(e);null==a||a.forEach((function(e){var t,a,o,s,u,l,c,_,f,d,h,g,p=Object.keys(e);if(0!==p.length){var E=p[0];switch(E){case"HW":return n.channelIdHW=null===(t=e[E])||void 0===t?void 0:t.channelId,n.importanceHW=null===(a=e[E])||void 0===a?void 0:a.importance,n.imageUrlHW=null===(o=e[E])||void 0===o?void 0:o.image,void(n.categoryHW=null===(s=e[E])||void 0===s?void 0:s.category);case"MI":return void(n.channelIdMi=null===(u=e[E])||void 0===u?void 0:u.channelId);case"OPPO":return void(n.channelIdOPPO=null===(l=e[E])||void 0===l?void 0:l.channelId);case"VIVO":return n.typeVivo=null===(c=e[E])||void 0===c?void 0:c.classification,void(n.categoryVivo=null===(_=e[E])||void 0===_?void 0:_.category);case"APNS":return r.threadId=e[E]["thread-id"],r.apnsCollapseId=e[E]["apns-collapse-id"],r.category=e[E].category,r.richMediaUri=e[E].richMediaUri,void(r.interruptionLevel=e[E]["interruption-level"]);case"FCM":return void(n.googleConfig={collapseKey:e[E].collapse_key||"",imageUrl:e[E].imageUrl||"",priority:e[E].priority||""});case"HONOR":return n.importanceHonor=null===(f=e[E])||void 0===f?void 0:f.importance,void(n.imageUrlHonor=null===(d=e[E])||void 0===d?void 0:d.image);case"OHOS":i.category=null===(h=e[E])||void 0===h?void 0:h.category,i.image=null===(g=e[E])||void 0===g?void 0:g.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}},ir=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),r=e.length;return t&&(r<=128&&r>=1)},ar=function(e){var t=e.length;return t<=4096&&t>=1},or=(er=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),r=e+er.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return er=2047&++er,parseInt(r,2)}),sr=function(){var e=dt.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t},ur=function(e,t,r){return i(void 0,void 0,void 0,(function(){var n,i;return a(this,(function(a){switch(a.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return n=a.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(r)},n,$t(e))];case 2:return i=a.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function lr(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!==B.HTTP||n?"https://".concat(e):"http://".concat(e)}var cr=function(e,t){if(!e)return"";var r=e.ossConfig,n=void 0===r?"":r,i="";try{var a=JSON.parse(n);if(a.length>0){var o=a.find((function(e){return e.minio}));o&&(i=o.minio)}}catch(e){t.warn(F.L_PARSE_JSON_E,JSON.stringify({ossConfig:n,error:e}))}return i};var _r,fr=function(e,t){return t&&0!==t.length?[x.GROUP,x.ULTRA_GROUP,x.APP_PUBLIC_SERVICE,x.PUBLIC_SERVICE].includes(e)?t:[]:t||[]},dr=function(e){function r(t){var r=e.call(this,t)||this;return r.name="RCError",r}return t(r,e),Object.defineProperty(r,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new r("Invalid parameter -> ".concat(e)):new r("Invalid parameters.")}}),Object.defineProperty(r,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new r("Wrong parameter type")}}),r}(Error),hr=function(){function e(){_r.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,_r,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return l(this,_r,"f")},enumerable:!1,configurable:!0}),e}();_r=new WeakMap;var gr=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 a=Symbol(),o=this._map.get(e)||this._map.set(e,[]).get(e),s={symbol:a,priority:Math.min(i,100),listener:t.bind(n),once:r},u=o.findIndex((function(e){return e.priority>i}));return-1===u?o.push(s):o.splice(u,0,s),a}}),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=o(this._map),i=n.next();!i.done;i=n.next()){var a=s(i.value,2),u=(a[0],a[1]),l=u.findIndex((function(t){return t.symbol===e}));if(-1!==l)return void u.splice(l,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,a=0;a<n.length;a+=1){var o=n[a],l=o.once,c=o.listener;l&&n.splice(a,1);try{c.apply(void 0,u([i],s(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}u([],s(this._piped.entries()),!1).forEach((function(r){var n=s(r,2),i=n[0],a=n[1];(0===a.length||a.includes(e))&&i.emit.apply(i,u([e],s(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}(),pr=function(e){function r(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}return t(r,e),Object.defineProperty(r.prototype,"length",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(r.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(r.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e<this._dataVersion||(this._versionQueue.push(e),-1!==this._dataVersion&&this._execPulling())}}),Object.defineProperty(r.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r,n,i,o;return a(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=u([],s(o),!1),this._dataVersion=n,i?[2,this._execPulling()]:this._versionQueue.length>0?(this._versionQueue.length=0,[2,this._execPulling()]):[2]}}))}))}}),Object.defineProperty(r.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(r.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(r.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}}),r}(gr),Er=function(){function e(e,t){var r=this;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,"_onCancel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(t){r._resolve=t,e(r._onResolve.bind(r))})),this._onCancel=t}return Object.defineProperty(e.prototype,"_onResolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),Object.defineProperty(e.prototype,"abort",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._onCancel(this._onResolve.bind(this))}}),e}(),Ir=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.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(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 i(this,void 0,void 0,(function(){return a(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?br(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?br(void 0,this.msg):Tr(this.code,this.msg)}}),e}(),br=function(e,t){return new Ir(0,t||"success",e)},Tr=function(e,t,r){return new Ir(e,t||"fail: ".concat(e),r)},vr=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})}return 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?Tr(this._code,this._errmsg):br()}}),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 dr.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,a){return void 0===i&&(i=!1),void 0===a&&(a=1),this.isLimitedArray(e,t,r,i,a).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,a){return void 0===i&&(i=!1),void 0===a&&(a=1),this.assertLimitedArray(e,t,r,i,a),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)}}),e}(),Rr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function mr(e){var t,r,n,i,a,o,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=Rr.indexOf(e.charAt(u++))<<2|(i=Rr.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(a=Rr.indexOf(e.charAt(u++)))>>2,n=(3&a)<<6|(o=Rr.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==a&&(s+=String.fromCharCode(r)),64!==o&&(s+=String.fromCharCode(n));return s}var Ar,yr=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},Or=1732584193,Sr=4023233417,Nr=2562383102,Cr=271733878,Pr=[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],Mr=[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 Lr(e,t){return e<<t|e>>>32-t}function wr(e,t,r){return e&r|t&~r}function Ur(e,t,r){return e^t^r}function Dr(e,t,r){return t^(e|~r)}function Gr(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 Vr(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 jr(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 a=new Uint8Array(8),o=4294967295&t,s=4294967295&Math.floor(t/4294967296);a.set(Vr(o),0),a.set(Vr(s),4),n.set(a,e.length+r);var u,l=Or,c=Sr,_=Nr,f=Cr;for(i=0;i<n.length;i+=64){for(var d=Gr(n.slice(i,i+64)),h=l,g=c,p=_,E=f,I=0;I<64;I++){var b=void 0,T=void 0;I<16?(b=(u=c)&_|~u&f,T=I):I<32?(b=wr(c,_,f),T=(5*I+1)%16):I<48?(b=Ur(c,_,f),T=(3*I+5)%16):(b=Dr(c,_,f),T=7*I%16);var v=f;f=_,_=c,c+=Lr(l+b+Mr[I]+d[T]&4294967295,Pr[I]),l=v}l=l+h&4294967295,c=c+g&4294967295,_=_+p&4294967295,f=f+E&4294967295}var R=new Uint8Array(16);return R.set(Vr(l),0),R.set(Vr(c),4),R.set(Vr(_),8),R.set(Vr(f),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(R)}function kr(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 jr(t)}function xr(e){var t=e.method||De.GET,r=e.timeout||Be,n=e.headers,i=e.query,a=e.body,o=e.onProgress,s=zt(e.url,i),u=new XMLHttpRequest;if(u.open(t,s),n&&u.setRequestHeader)for(var l in n)u.setRequestHeader(l,n[l]);return function(e,t,r,n){return new Er((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},n&&(e.upload.onprogress=function(e){return n(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(r)}),(function(t){e.abort(),t({status:-1})}))}(u,r,a,o)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(Ar||(Ar={}));var Fr,Br,Hr=0,Yr={DEFAULT:0,MODIFIED:1,RECALLED:2,DELETE:3},Wr={TranslationLanguage:0,AutoTranslateEnable: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"}(Br||(Br={}));var Jr=((Fr={})[Br.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:B.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},Fr[Br.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:B.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},Fr[Br.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:B.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},Fr[Br.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:B.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},Fr[Br.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:B.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},Fr[Br.OM]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5vbS1saWdodC1lZGdlLmNvbQ==","bmF2LWIub20tbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ub20tbGlnaHQtZWRnZS5jb20=",protocol:B.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLm9tLWxpZ2h0LWVkZ2UuY29t","d3MtYi5vbS1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5vbS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIub20tbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9kdWFsc3RhY2stc3RhdHMub20tbGlnaHQtZWRnZS5jb20="]},Fr);function qr(e){return Br[e]?e:Br.BJ}var Kr,Qr=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,a=n.navigators,o=(r=i,void 0===r&&(r=Br.BJ),Jr[qr(r)].naviUrlBase64).map((function(e){return mr(e)})),l=[],c=s(e.split("@"),2)[1];t&&(l=c?c.split(";"):[]);var _=a&&a.length>0?u(u([],s(l),!1),s(a),!1):u(u([],s(l),!1),s(o),!1);return _.filter((function(e,t){return _.indexOf(e)===t})).map((function(e){return lr(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,i=e||{},a=i.log,o=i.logPolicy,l=this.initOption||{},c=l.areaCode,_=l.logServerUrl,f=(r=c,void 0===r&&(r=Br.BJ),Jr[qr(r)].logUrlBase64).map((function(e){return n(n({},e),{addr:mr(e.addr)})})),d=[],h={level:1,itv:6,times:5};if(a)d.push.apply(d,u([],s(a.addrs),!1)),Object.assign(h,a.policy);else if(o)try{var g=JSON.parse(o);d.push({addr:g.url,protocol:B.HTTPS,weight:1}),h.level=g.level,h.itv=g.itv,h.times=g.times}catch(r){t.warn(F.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var p=_?u([{addr:_,protocol:B.HTTPS,weight:101}],s(d),!1):u(u([],s(d),!1),s(f),!1);return{policy:h,addrs:p.filter((function(e,t){return p.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return n(n({},e),{addr:lr(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=Br.BJ),Jr[qr(t)].miniCmpBase64).map((function(e){return mr(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=Br.BJ),Jr[qr(t)].staticConfigUrlBase64).map((function(e){return mr(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=Br.BJ),Jr[qr(r)].cloudControllerUrlBase64).map((function(e){return mr(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:Br.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!Br[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,a=n.activeServer,o=(null==i?void 0:i.addrs)||[],l=(r=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===r&&(r=Br.BJ),Jr[qr(r)].statsUrlBase64).map((function(e){return mr(e)})),c=[];return 0!==o.length?c.push.apply(c,u([],s(o.sort((function(e,t){return t.weight-e.weight})).map((function(e){return lr(e.addr,e.protocol)}))),!1)):a&&c.push(lr(a,B.HTTPS)),l.forEach((function(e){c.includes(e)||c.push(e)})),c}}),e}(),Xr=new Qr,Zr=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 i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:if(!(t=this.getCache()))return[3,6];a.label=1;case 1:return a.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=a.sent(),(i=n.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return lr(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=a.sent(),this.logger.error(F.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),a.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=a.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(u=a.sent())?void 0:u.areaCode)!==Xr.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==u?void 0:u.bootstrap)||[],(l=null===(e=null==u?void 0:u.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:l.map((function(e){return lr(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r,n,i,l,c,_,f,d,h;return a(this,(function(a){switch(a.label){case 0:e=(e=u(u([],s(this.staticUrls),!1),s(Xr.getStaticConfigUrl()),!1).map((function(e){return lr(e)}))).filter((function(t,r){return e.indexOf(t)===r})),a.label=1;case 1:a.trys.push([1,6,7,8]),t=o(e),r=t.next(),a.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(F.L_GET_STATIC_CONF_T,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(l=a.sent(),c=l.code,_=l.data,200===c)return this.logger.info(F.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),[2,_];this.logger.warn(F.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),a.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return f=a.sent(),d={error:f},[3,8];case 7:try{r&&!r.done&&(h=t.return)&&h.call(t)}finally{if(d)throw d.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"}(Kr||(Kr={}));var zr,$r,en=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:Kr.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kr.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kr.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kr.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kr.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kr.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!==Kr.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 gt}}),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,a=e.level,o=e.loggerId;if(console&&!(a<=Kr.FATAL||a>this.outputLevel)){var s=["error","warn","info","debug"][a-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=o?o: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[Kr.DEBUG,Kr.INFO,Kr.WARN,Kr.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,i,a,o){if(void 0===i&&(i={}),t.isOk){var s=null==a?void 0:a(t.data);this.info(e,JSON.stringify(n(n({isOk:!0},i),s)),r)}else{s=null==o?void 0:o(t.data);this.warn(e,JSON.stringify(n(n({code:t.code,msg:t.msg},i),s)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),tn=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,o,s){return i(this,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:i=[],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.logDB.read(e,t,r,n,s)];case 2:return o=a.sent(),vt(o.logs)&&(i=o.logs.filter((function(e){return!(!e||"object"!=typeof e)}))),[3,4];case 3:return a.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 i(this,void 0,void 0,(function(){var r,n,i;return a(this,(function(a){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=Xr.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 i(this,void 0,void 0,(function(){var i,o,s,u,l,c,_,f,d,h;return a(this,(function(a){switch(a.label){case 0:return[4,this.compressLogs(e)];case 1:return i=a.sent(),o=i.success,s=i.data,o?(u=Nt(r)?r:"https://".concat(r),u+="?version=".concat("5.34.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.getDeviceId(),"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:u,body:s,method:"POST"})]):[2,{isOk:!1,itv:n}];case 2:if(l=a.sent(),c=l.status,_=l.data,200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(n+=n),this.reportFailedNumber++,[2,{isOk:!1,itv:n}];if(this.reportFailedNumber=0,_)try{(h=JSON.parse(_)).nextTime&&(n=h.nextTime),f=h.level,d=h.logSwitch}catch(e){this.logger.warn(F.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:f,logSwitch:d}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,l,c,_,f,d,h,g,p,E=this;return a(this,(function(a){switch(a.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||pt,l=Math.max(i-3e4,o+1),c=this.logger.createTraceId(),[4,this._getLogs(o,l,t,!0,c,n)];case 1:return 0!==(_=a.sent().logs).length?[3,2]:[3,4];case 2:return _.length>0?[4,this._sendLogs2Realtime(_,c,e,r)]:[3,4];case 3:f=a.sent(),d=f.itv,h=f.level,g=f.logSwitch,f.isOk&&(p=Math.max.apply(Math,u([],s(_.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(p+1),0===g&&(this.started=!1),void 0!==h&&(t=h)),r=d,a.label=4;case 4:return this.started&&(r>=60&&this.itvByNavi<60&&(r=60),this.timer=setTimeout((function(){return E.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,o,s,u){return void 0===u&&(u=!1),i(this,void 0,void 0,(function(){var i,l,c,_,f,d,h,g;return a(this,(function(a){switch(a.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(i=this.logger.createTraceId(),this.logger.info(F.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:o,messageUId:s,isCloudControl:u}),i),[4,this._getLogs(e,t,Kr.DEBUG,!1,i)]);case 1:return l=a.sent().logs,this.logger.info(F.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),i),c=Nt(n)?n:"https://".concat(n),c+="?version=".concat("5.34.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.getDeviceId(),"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(o),l.length>0?[4,this.compressLogs(l)]:[3,3];case 2:return f=a.sent(),d=f.success,h=f.data,_=d?h:"compress failed",[3,4];case 3:_="no data or no database",a.label=4;case 4:return this.logger.debug(F.L_REPORT_FULL_LOG_O,"compress done",i),u&&(c+="&source=cloud"),[4,this.send({url:c,body:_,method:"POST"})];case 5:return g=a.sent().status,this.logger.info(F.L_REPORT_FULL_LOG_R,JSON.stringify({status:g}),i),[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}(),rn=function(e){var t=e.sessionId,r=e.level,n=e.loggerId,i=e.traceId,a=e.time,o=e.tag,s=e.type,u=e.content;Et(u)||(u=JSON.stringify(u));var l=r<0?u||"":JSON.stringify({content:u,traceId:i,from:n});return l='"'.concat(l.replace(/"/g,'""'),'"'),"".concat(t,",").concat(a,",").concat(s,",").concat(r,",").concat(o,",").concat(l,"\n")};function nn(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 an(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{logs:[]}]}))}))}function on(){}var sn=function(){function e(e,t){zr.set(this,void 0),$r.set(this,void 0),c(this,zr,e,"f"),c(this,$r,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,l(this,zr,"f").call(this,e,t,r,n,o)];case 1:return(i=a.sent())&&Array.isArray(i.logs)?[2,{logs:i.logs.filter(nn)}]:[2,{logs:[]}];case 2:return s=a.sent(),console.error("[LogDBProxy] read error",s),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{l(this,$r,"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&&c(this,zr,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&c(this,$r,e,"f"),this}}),e}();function un(){return new sn(an,on)}zr=new WeakMap,$r=new WeakMap;var ln=function(){function e(){}var t,r,n,i,a,o;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){l(this,t,"f",r)||(c(this,t,e,"f",r),e.info(F.L_EVENT_LOOP_BLOCKING_S,"start"),l(this,t,"m",o).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){l(this,t,"f",r)&&(l(this,t,"f",r).info(F.L_EVENT_LOOP_BLOCKING_S,"stop"),c(this,t,null,"f",r),l(this,t,"f",n)&&(clearTimeout(l(this,t,"f",n)),c(this,t,null,"f",n)))}}),t=e,o=function e(){var o=this,s=Date.now();c(this,t,setTimeout((function(){var n=Date.now()-s;n>=l(o,t,"f",a)&&l(o,t,"f",r).warn(F.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(n,"ms")),l(o,t,"m",e).call(o)}),l(this,t,"f",i)),"f",n)},r={value:null},n={value:null},i={value:30},a={value:1500},e}(),cn=1,_n=2,fn=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,a=this;this.taskLock=!1;var o=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:"",l=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==l&&(this.logId=e.logId,this.reporter.report(o,s,u,l,e.logId,"",!0).finally((function(){a.taskLock=!0,a.uploadTask.length>0&&a.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 hn,gn,pn,En,In=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===Re.LOG_COMMAND&&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,Ct(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 i(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,_,f,d;return a(this,(function(a){switch(a.label){case 0:return!this.isEable&&t===cn&&this.isExire()?(this.logger.info(F.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===_n&&this.isOverclock()?(this.logger.info(F.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=lr(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),s={platform:"web",version:"5.34.0",timestamp:this.timestamp},this.logger.record(be.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,De.POST,o,s)]);case 1:return u=a.sent(),l=u.code,c=u.data,this.logger.record(be.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===k.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(_=c.targetRegion,this.changeAreaCode===_?[2,this.timestamp]:(f=Xr.setAreaCode(_),this.logger.info(F.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:f,originAreaCode:Xr.getAreaCode(),newAreaCode:_})),this.changeAreaCode=_,(d=Xr.getCloudControllerUrl(_))[0]?[2,this.request(d[0],fn)]:(this.logger.info(F.L_CLOUD_APPKEY_REGION_E,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}(),bn=function(e){return e===k.RC_CONN_REDIRECTED},Tn=function(e){function r(t,r,n){var i=e.call(this)||this;return hn.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:""}),En.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:Ue.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:he.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 t(r,e),Object.defineProperty(r.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(r.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(r.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===he.DISCONNECTED&&e===he.CONNECTING&&(this._doConnectReason=Ce.CONNECT,l(this,hn,"m",pn).call(this)),this._crtConnectionStatus===he.CONNECTED&&e===he.SUSPENDED&&(t===k.RC_PING_EXCEED_LIMIT?this._doConnectReason=Ce.TIMEOUT:t===k.RC_CONN_REDIRECTED?this._doConnectReason=Ce.REDIRECTED:this._doConnectReason=Ce.RECONNECT),this._crtConnectionStatus===he.CONNECTED){var r={bid:sr(),cod:t,net:this.getNetwork().type,dur:Date.now()-l(this,En,"f"),cid:this.cid};this.logger.record(be.IM_CONNECTION_DURATION,JSON.stringify(r)),e===he.SUSPENDED&&l(this,hn,"m",pn).call(this)}switch(this._crtConnectionStatus=e,e){case he.CONNECTED:this.logger.info(F.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),l(this,hn,"m",gn).call(this).emit("onConnected",this._fromSuspend);break;case he.CONNECTING:this.logger.warn(F.L_CONNECT_S,"status: ".concat(e)),l(this,hn,"m",gn).call(this).emit("onConnecting");break;case he.SUSPENDED:this._fromSuspend=!0,this.logger.warn(F.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),bn(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),l(this,hn,"m",gn).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(F.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),l(this,hn,"m",gn).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(r.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===he.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(r.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(be.IM_NETWORK_CHANGE,JSON.stringify(r))}this._network=e}}),Object.defineProperty(r.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(r.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus===he.CONNECTED?[2,br(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(he.CONNECTING),[4,this.try2Connect(e,t,!1,n,!0)]);case 1:return i=a.sent(),o=i.code,s=i.data,o!==k.SUCCESS?(this.setConnectionStatus(he.DISCONNECTED,o),[2,Tr(o)]):(this.setConnectionStatus(he.CONNECTED),[2,br(s)])}}))}))}}),Object.defineProperty(r.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,r,n,o),[4,this._crtConnectionTask]);case 1:return i=a.sent(),this._crtConnectionTask=null,[2,i]}}))}))}}),Object.defineProperty(r.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s,u,l,_,f,d,h,g,p;return a(this,(function(a){switch(a.label){case 0:return i={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0},this.logger.record(be.IM_STATS_CS,JSON.stringify(i)),s={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,r,!1,n,s)];case 1:return u=a.sent(),l=u.code,_=u.data,l!==k.SUCCESS?[2,Tr(l)]:1===(f=_).type?[2,Tr(k.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(F.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),f,t,n)]);case 2:return d=a.sent(),h=d.code,g=d.data,o||h===k.SUCCESS||(this.retryCount+=1),bn(h)?(this.logger.warn(F.L_CONNECT_R,"redirect code: ".concat(h),n),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,n,o)]):[k.RC_TCP_RESET,k.RC_CONN_ACK_TIMEOUT,k.RC_TCP_DISCONNECTED_NO_RMTP,k.CONNECTION_REFUSED].includes(h)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),p=this.cmpWeightCache.every((function(e){return e.failed})),o&&p?(this.logger.warn(F.L_CONNECT_R,"cpp code:".concat(h,",reture code:").concat(k.SERVER_UNAVAILABLE),n),[2,Tr(k.SERVER_UNAVAILABLE)]):(this.logger.warn(F.L_CONNECT_R,"cmp ack timeout, code: ".concat(h),n),this.setConnectionStatus(he.SUSPENDED,h),this.setConnectionStatus(he.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,o)])):h!==k.SUCCESS?(this.logger.warn(F.L_CONNECT_R,"code: ".concat(h),n),[2,Tr(h)]):(this.logger.info(F.L_CONNECT_R,"userId: ".concat(g),n),c(this,En,Date.now(),"f"),this._crtUserId=g,[2,br(g)])}}))}))}}),Object.defineProperty(r.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,o=this;return a(this,(function(s){return r=this.logger.createTraceId(),this.logger.debug(F.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return i(o,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus!==he.SUSPENDED?[2]:(this.setConnectionStatus(he.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=a.sent(),o=i.code,s=i.isOk,this.reconnectTimer=null,s?(this.setConnectionStatus(he.CONNECTED),[2]):[k.SERVER_UNAVAILABLE,k.TIMEOUT,k.RC_SOCKET_DISCONNECTED,k.RC_SOCKET_NOT_CREATED,k.RC_CONN_ACK_TIMEOUT,k.RC_TCP_RESET,k.RC_NAVI_REQ_FAILED,k.RC_NETWORK_DOWN,k.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==he.CONNECTING||(this.setConnectionStatus(he.SUSPENDED,o),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(he.DISCONNECTED,o),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(r.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return bn(e)?(this.setConnectionStatus(he.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===k.RC_UDP_DISCONNECTED?(this.setConnectionStatus(he.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(he.DISCONNECTED,e)}}),Object.defineProperty(r.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(he.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(r.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==he.CONNECTED?(this._failedCount=0,this.logger.debug(F.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(F.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===k.SUCCESS?(this.logger.debug(F.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==he.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(F.L_CHECK_ALIVE_IM_R,"code: ".concat(t,", count: ").concat(this._failedCount),e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(F.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(he.SUSPENDED,k.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,k.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(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(he.DISCONNECTED,k.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(r.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(r.prototype,"getCmpList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return u([],s(this.cmpWeightCache),!1);var r=Ht(e,t);return this.cmpWeightCache=u([],s(r),!1),u([],s(r),!1)}}),Object.defineProperty(r.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===B.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,u([],s(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var a=Math.min.apply(Math,u([],s(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==a&&(n.weight=a-1),n.failed=!0}}}}),Object.defineProperty(r.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(r.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this.token=e,this._openCallPlus=r,this.onDisconenctUnusual(n)}}),r}(gr);En=new WeakMap,hn=new WeakSet,gn=function(){return this},pn=function(){this.uuid=ht.gen(),this.retryCount=0};var vn=function(e){return e.replace(/@.+$/,"@")},Rn=function(){function e(e,t,r,n,i,a){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===a&&(a=!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:a}),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,o){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,r,n,o),[4,this.crtRequest]);case 1:return i=a.sent(),this.crtRequest=null,[2,i]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){var s;return i(this,void 0,void 0,(function(){var i,u,l,c,_,f,d,h,g,p,E,I,b,T,v,R,m;return a(this,(function(a){switch(a.label){case 0:return i=vn(e),u=this.getNaviCache(i),!t&&u&&(l=u.timestamp,c=u.naviInfo,r||Date.now()-l<Fe)?(this.logger.info(F.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),n),o&&(_=o.uuid,f=o.retryCount,d=o.reason,h={bid:sr(),ptc:ye.NAVI,cod:k.SUCCESS,net:o.type,dur:0,spr:0,pr:null!==(s=c.type)&&void 0!==s?s:0,hos:"",cache:Oe.LOCAL,v:Se.CURRENT,rsn:d,cid:"".concat(_,"_").concat(f),count:f},this.logger.record(be.IM_NAVI,JSON.stringify(h),n)),[2,br(c)]):(g=Xr.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(F.L_GET_NAVI_T,JSON.stringify({token:e,uris:g}),n),[4,this.requestHandler(g,e,n,o)]);case 1:return p=a.sent(),E=p.code,I=p.data,E===k.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(b=a.sent())?void 0:b.navi)&&(null==b?void 0:b.navi.length)>0?(T=b.navi,[4,this.requestHandler(T,e,n,o)]):[3,4];case 3:v=a.sent(),E=v.code,I=v.data,a.label=4;case 4:return E!==k.SUCCESS?(this.logger.warn(F.L_GET_NAVI_R,E,n),[2,Tr(E)]):(R=I).code&&200!==R.code?(this.logger.warn(F.L_GET_NAVI_R,R.code,n),[2,Tr(this.transHttpCode(R.code))]):Ht(R).length>0?(this.logger.info(F.L_GET_NAVI_R,JSON.stringify({naviInfo:R}),n),this.setNaviCache(i,R),[2,br(R)]):(m={server:R.server,backupServer:R.backupServer,serverAddr:R.serverAddr,bs:R.bs},this.logger.warn(F.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(m)),n),[2,Tr(k.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u,l,c,_,f,d;return a(this,(function(a){switch(a.label){case 0:i=0,o=e.length,a.label=1;case 1:return i<o?(s=i===e.length-1,u=this.useV2Navi()?this.httpRequestV2:this.httpRequest,l=Date.now(),[4,u.call(this,e[i],this.appkey,t,r,s)]):[3,4];case 2:if(c=a.sent(),_=c.code,f=c.data,d={bid:sr(),ptc:ye.NAVI,cod:_,net:null==n?void 0:n.type,dur:Date.now()-l,spr:0,pr:(null==f?void 0:f.type)||0,hos:e[i],cache:Oe.REQUEST,v:Se.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(be.IM_NAVI,JSON.stringify(d),r),[k.SUCCESS,k.RC_CONN_TOKEN_INCORRECT,k.RC_LICENSE_EXPIRED].includes(_))return[2,_===k.SUCCESS?br(f):Tr(_)];a.label=3;case 3:return i+=1,[3,1];case 4:return[2,Tr(k.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 k.RC_CONN_TOKEN_INCORRECT;case 416:return k.RC_LICENSE_EXPIRED;default:return k.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(vn(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(vn(e),n(n({},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,a=e.protocol,o=e.mac;t="".concat(r,"/v2/navi.json?cloud=").concat(0);var s="token=".concat(encodeURIComponent(n),"&v=").concat(Ye,"&platfrom=").concat(i);return o&&(s+="&m=".concat(o)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(a,";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}(),mn=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 An(e){return mn.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}function yn(e){return mn.has(e)}var On,Sn,Nn,Cn={MECHANICAL:0,INTELLIGENT:1},Pn=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}(),Mn=function(e){function r(t,r,n,i){return e.call(this,t,r,n,i)||this}return t(r,e),r}(Pn),Ln=function(e){function r(t,r,n){return e.call(this,kr(t),r,n,t)||this}return t(r,e),r}(Pn),wn={NONE:0,TRANSLATING:1,SUCCESS:2,FAILED:3},Un={DEFAULT:0,AUTO_ON:1,AUTO_OFF:2},Dn=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),Gn=48,Vn=64,jn=80,kn=96,xn=112,Fn="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Bn=function(e){for(var t={},r=0;r<e.length-1;r++){var n=e.charAt(r)+e.charAt(r+1);t.hasOwnProperty(n)?t[n].push(r):t[n]=[r]}for(var i=[],a=[],o=function(){if(a.length>0){var e=a.join("");if(a=[],e.length>26){var t=Yn(e.length),r=String.fromCharCode(jn|t.length);i.push(r+t)}else{var n=String.fromCharCode(kn|e.length);i.push(n)}i.push(e)}},s=0;s<e.length;){var u=Hn(t,e,s);if(u.length<2)a.push(e.charAt(s++));else if(u.length<4)a.push(e.substr(s,u.length)),s+=u.length;else{var l=Yn(s-u.offset),c=Yn(u.length);if(l.length+c.length>=u.length)a.push(e.substr(s,u.length)),s+=u.length;else{o();var _=String.fromCharCode(Vn|l.length<<2|c.length);i.push(_+l+c),s+=u.length}}}o();var f=Yn(e.length),d=String.fromCharCode(Gn|f.length);return i.push(d+f),i.join("")},Hn=function(e,t,r){var n={length:0,offset:-1};if(t.length,r>=t.length-1)return n;var i=e[t.charAt(r)+t.charAt(r+1)];if(i[0]===r)return n;for(var a=t.length-r,o=0,s=i.length;o<s;o++){var u=i[o],l=r-u;if(!(l>238327)){var c=Math.min(a,l);if(c<=n.length)break;if(!(n.length>2&&t.charAt(u+n.length-1)!==t.charAt(r+n.length-1))){for(var _=2,f=_;f<c&&t.charAt(u+f)===t.charAt(r+f);f++)_++;_>=n.length&&(n.length=_,n.offset=u)}}}return n},Yn=function(e){var t=[],r=0;do{r=e%62,t.push(Fn.charAt(r)),e=(e-r)/62}while(e>0);return t.join("")},Wn=function(e){for(var t=0,r=0,n=e.length-1;n>=0;n--){if(-1===(r=Fn.indexOf(e.charAt(n))))throw new Error('decode number error, data is "'+e+'"');t=62*t+r}return t},Jn=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],r=0,n=t.length;r<n;r++)if(!e[t[r]])return!1;return!0}(uni))},qn=function(e){return["setItem","getItem","removeItem"].forEach((function(t){var r=e[t];e[t]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return r.apply(e,t)}catch(e){null===console||void 0===console||console.error(e)}}})),e},Kn=function(){function e(e){On.add(this),Sn.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c(this,Sn,e,"f"),this._logger=e.logger}return Object.defineProperty(e.prototype,"open",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,l(this,On,"m",Nn).call(this,e,l(this,Sn,"f"))]}))}))}}),e}();Sn=new WeakMap,On=new WeakSet,Nn=function e(t,r){return i(this,void 0,void 0,(function(){var n,o,s,u=this;return a(this,(function(c){switch(c.label){case 0:return 0===t.length?[2,Tr(k.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(n=t.shift(),o=lr(n.addr,n.protocol),o="".concat(o,"/v3/message/get_stream.json?sdkVersion=").concat("5.34.0","&platform=Websocket&messageUID=").concat(r.msgUId),this._logger.info(F.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(o)),[4,this._openHandler(o,r)]);case 1:return[2,(s=c.sent()).or((function(n){return i(u,void 0,void 0,(function(){return a(this,(function(i){return-1===n?[2,l(this,On,"m",e).call(this,t,r)]:[2,s]}))}))}))]}}))}))};var Qn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s=this;return a(this,(function(a){return r=yr(),n=r.resolve,i=r.promise,(o=new XMLHttpRequest).open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){s._logger.warn(F.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),n(Tr(-1,"timeout"))},o.onreadystatechange=function(r){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var i=o.getResponseHeader("Content-Type"),a=null==i?void 0:i.startsWith("text/event-stream");if(200===o.status&&a){n(br());var u=0;o.onprogress=function(e){var r=o.response.slice(u);u=o.response.length,t.onRawContent(r)},o.onerror=function(r){s._logger.warn(F.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(k.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);n(Tr(e.code,e.message))}}},o.onerror=function(t){s._logger.warn(F.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),n(Tr(-1))},o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("App-Key",t.appkey),o.setRequestHeader("Authorization","Bearer ".concat(t.token)),o.send(),[2,i]}))}))}}),r}(Kn),Xn=Jn();var Zn=null,zn=function(e){return i(void 0,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return[4,ei.getNetworkType()];case 1:return t=r.sent(),Zn({status:"online"===e.type,type:t}),[2]}}))}))};var $n,ei={tag:"browser",httpReq:function(e){return xr(e).result()},get localStorage(){return localStorage},get sessionStorage(){return sessionStorage},useNavi:!0,connectPlatform:"",isFromUniapp:Xn,createWebSocket:function(e,t){var r=new WebSocket(e,t);return r.binaryType="arraybuffer",Promise.resolve(br({id:Date.now(),onClose:function(e){r.onclose=function(t){var r=t.code,n=t.reason;e(r,n)}},onError:function(e){r.onerror=e},onMessage:function(e){r.onmessage=function(t){e(t.data)}},onOpen:function(e){r.onopen=e},send:function(e){r.send(e)},close:function(e,t){r.close()}}))},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:Ue.UNKONWN},t=e.type,r=e.effectiveType,n=t||r||Ue.UNKONWN;return Promise.resolve(n)},setNetworkStatusListener:function(e){Zn=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",zn),window.addEventListener("online",zn))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",zn),window.removeEventListener("online",zn)),Zn=null},createSSEClient:function(e){return br(new Qn(e))},getApiVer:function(){var e=ei.runtimeInfo,t=e.type,r=e.version;return"|".concat(t,"|").concat(r)},get runtimeInfo(){var e,t,r=navigator.userAgent,n={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var i in n)if(n.hasOwnProperty(i)){var a=r.match(n[i]);if(a){t=i,e=a[1]||a[2];break}}return{type:t||"Unknown",version:e||"Unknown"}}};!function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgS=2]="ppMsgS",e[e.pgMsgS=3]="pgMsgS",e[e.pgMsgP=4]="pgMsgP",e[e.chatMsg=5]="chatMsg",e[e.pcMsgP=6]="pcMsgP",e[e.prMsgS=7]="prMsgS",e[e.pbMsgP=8]="pbMsgP",e[e.qryPMsg=9]="qryPMsg",e[e.qryGMsg=10]="qryGMsg",e[e.qryCHMsg=11]="qryCHMsg",e[e.qryCMsg=12]="qryCMsg",e[e.qrySMsg=13]="qrySMsg",e[e.qryMCMsg=14]="qryMCMsg",e[e.qryMPMsg=15]="qryMPMsg",e[e.recallMsg=16]="recallMsg",e[e.rrMsg=17]="rrMsg",e[e.rrList=18]="rrList",e[e.s_ntf=19]="s_ntf",e[e.s_msg=20]="s_msg",e[e.s_stat=21]="s_stat",e[e.s_cmd=22]="s_cmd",e[e.s_us=23]="s_us",e[e.transLan=24]="transLan",e[e.autoTrans=25]="autoTrans",e[e.pullUS=26]="pullUS",e[e.sendMsgRead=27]="sendMsgRead",e[e.qryMsgRead=28]="qryMsgRead",e[e.qryMsgReadCntBatch=29]="qryMsgReadCntBatch",e[e.updRTime=30]="updRTime",e[e.qryRLBatch=31]="qryRLBatch",e[e.chatMsgS=32]="chatMsgS",e[e.qrySessionsAtt=33]="qrySessionsAtt",e[e.pullMsg=34]="pullMsg",e[e.qrySessions=35]="qrySessions",e[e.delSessions=36]="delSessions",e[e.delMsg=37]="delMsg",e[e.delUgMsg=38]="delUgMsg",e[e.delUgSe=39]="delUgSe",e[e.updRRTime=40]="updRRTime",e[e.qrySessionsUnread=41]="qrySessionsUnread",e[e.setTypeUnpush=42]="setTypeUnpush",e[e.chrmPull=43]="chrmPull",e[e.joinChrm=44]="joinChrm",e[e.joinChrmR=45]="joinChrmR",e[e.exitChrm=46]="exitChrm",e[e.queryChrmI=47]="queryChrmI",e[e.setKV=48]="setKV",e[e.delKV=49]="delKV",e[e.setKVS=50]="setKVS",e[e.delKVS=51]="delKVS",e[e.pullKV=52]="pullKV",e[e.qryRelation=53]="qryRelation",e[e.qryRelationR=54]="qryRelationR",e[e.qryRelationFilter=55]="qryRelationFilter",e[e.delRelation=56]="delRelation",e[e.delRelationBatch=57]="delRelationBatch",e[e.pullSe=58]="pullSe",e[e.pullSeAtts=59]="pullSeAtts",e[e.setSeAtt=60]="setSeAtt",e[e.qnTkn=61]="qnTkn",e[e.qnUrl=62]="qnUrl",e[e.aliUrl=63]="aliUrl",e[e.s3Url=64]="s3Url",e[e.stcUrl=65]="stcUrl",e[e.minioUrl=66]="minioUrl",e[e.cleanPMsg=67]="cleanPMsg",e[e.cleanGMsg=68]="cleanGMsg",e[e.cleanCMsg=69]="cleanCMsg",e[e.cleanSMsg=70]="cleanSMsg",e[e.cleanMCMsg=71]="cleanMCMsg",e[e.cleanMPMsg=72]="cleanMPMsg",e[e.cleanMsgBatch=73]="cleanMsgBatch",e[e.rtcPing=74]="rtcPing",e[e.rtc_ntf=75]="rtc_ntf",e[e.rtcSetOutData=76]="rtcSetOutData",e[e.rtcQryUserOutData=77]="rtcQryUserOutData",e[e.addSeTag=78]="addSeTag",e[e.delSeTag=79]="delSeTag",e[e.addTag=80]="addTag",e[e.delTag=81]="delTag",e[e.reportsdk=82]="reportsdk",e[e.pullUgSes=83]="pullUgSes",e[e.pullUgMsg=84]="pullUgMsg",e[e.ugMsg=85]="ugMsg",e[e.qryUgMsg=86]="qryUgMsg",e[e.updUgRTime=87]="updUgRTime",e[e.upMsgEx=88]="upMsgEx",e[e.modifyMsg=89]="modifyMsg",e[e.qryMsgChange=90]="qryMsgChange",e[e.qryMsg=91]="qryMsg",e[e.operate=92]="operate",e[e.s_opNtf=93]="s_opNtf",e[e.ugUnpushQuery=94]="ugUnpushQuery",e[e.ugUnpushSet=95]="ugUnpushSet",e[e.setRtcRoomId=96]="setRtcRoomId",e[e.qryUgUal=97]="qryUgUal",e[e.updUserSub=98]="updUserSub",e[e.pullUserSub=99]="pullUserSub",e[e.pullSubData=100]="pullSubData",e[e.qrySubData=101]="qrySubData",e[e.pullUserProfile=102]="pullUserProfile",e[e.pullOwnProfile=103]="pullOwnProfile",e[e.updProfilePermiss=104]="updProfilePermiss",e[e.qProfilePermiss=105]="qProfilePermiss",e[e.searchUserProfile=106]="searchUserProfile",e[e.updUserProfile=107]="updUserProfile",e[e.pullEventChange=108]="pullEventChange",e[e.channelCreate=109]="channelCreate",e[e.upChannelInfo=110]="upChannelInfo",e[e.qChannelInfo=111]="qChannelInfo",e[e.channelMemKick=112]="channelMemKick",e[e.channelMemQuit=113]="channelMemQuit",e[e.channelDismiss=114]="channelDismiss",e[e.channelTransfer=115]="channelTransfer",e[e.upChannelManager=116]="upChannelManager",e[e.qChannelMem=117]="qChannelMem",e[e.qChannelSpeMem=118]="qChannelSpeMem",e[e.upChannelMem=119]="upChannelMem",e[e.channelMemJoin=120]="channelMemJoin",e[e.channelMemInvite=121]="channelMemInvite",e[e.channelApplyResp=122]="channelApplyResp",e[e.qChannelApplyList=123]="qChannelApplyList",e[e.qChannelMemJoin=124]="qChannelMemJoin",e[e.qChannelMemSpeJoin=125]="qChannelMemSpeJoin",e[e.upChannelRemark=126]="upChannelRemark",e[e.qChannelRemark=127]="qChannelRemark",e[e.upChannelFollow=128]="upChannelFollow",e[e.qChannelFollow=129]="qChannelFollow",e[e.qSimpleUserProfile=130]="qSimpleUserProfile",e[e.friendAdd=131]="friendAdd",e[e.friendDel=132]="friendDel",e[e.friendHandle=133]="friendHandle",e[e.friendSetPf=134]="friendSetPf",e[e.friendCheck=135]="friendCheck",e[e.friendsQuery=136]="friendsQuery",e[e.friendApplyDel=137]="friendApplyDel",e[e.friendsInfoQry=138]="friendsInfoQry",e[e.friendAuthSet=139]="friendAuthSet",e[e.friendAuthGet=140]="friendAuthGet",e[e.addUnpush=141]="addUnpush",e[e.qryUnpush=142]="qryUnpush",e[e.delUnpush=143]="delUnpush",e[e.s_pubCall=144]="s_pubCall",e[e.reqCall=145]="reqCall",e[e.pullKvMsg=146]="pullKvMsg",e[e.readReceipt=147]="readReceipt",e[e.qryReceipt=148]="qryReceipt",e[e.qryReceiptBatch=149]="qryReceiptBatch",e[e.upConvertMsg=150]="upConvertMsg",e[e.pullModifyMsg=151]="pullModifyMsg",e[e.qAppBot=152]="qAppBot",e[e.qBot=153]="qBot"}($n||($n={}));var ti=function(e){var t=$n[e];return t},ri=function(e){return $n[e]},ni=0,ii=1,ai=2,oi=3,si=4,ui=5,li=6,ci=7,_i=12,fi=13,di=14,hi=4,gi=3,pi="rtcRJoin_data",Ei="rtcRExit",Ii="rtcUPut",bi="rtcUDel",Ti="rtcSetData",vi="userSetData",Ri="rtcQryData",mi="rtcDelData",Ai="rtcToken",yi="rtcUserState",Oi="rtcUList",Si="viewerJoinR",Ni="viewerExitR",Ci="rtcPullKv",Pi="rtcIdentityChange",Mi="rtcInvite",Li="rtcCancelInvite",wi="rtcInviteAnswer",Ui="rtcEndInvite",Di="rtcQueryJoined",Gi=0,Vi=1,ji=2,ki=3,xi=4,Fi=5,Bi=6,Hi=7,Yi=8,Wi=9,Ji=10,qi=11,Ki=12,Qi=13,Xi=14,Zi=15,zi=16,$i=17,ea=18,ta=19,ra=20,na=1,ia=2,aa=4,oa=5,sa=6,ua=7,la=8,ca=9,_a=function(){function e(){}return Object.defineProperty(e,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this._getBackAndByteSize(e),r=t.back,n=t.byteSize,i=0,a=r.length;i<a;i++)r[i]>255&&(r[i]&=255);return n<=255?[0,n].concat(r):[n>>8,255&n].concat(r)}}),Object.defineProperty(e,"_getBackAndByteSize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],r=0;if("string"==typeof e)for(var n=0,i=e.length;n<i;n++){var a=e.charCodeAt(n);a>=0&&a<=127?(r+=1,t.push(a)):a>=128&&a<=2047?(r+=2,t.push(192|31&a>>6),t.push(128|63&a)):a>=2048&&a<=65535&&(r+=3,t.push(224|15&a>>12),t.push(128|63&a>>6),t.push(128|63&a))}return{byteSize:r,back:t}}}),Object.defineProperty(e,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r,n=[],i=-1,a=e,o="";++i<a.length;){var s=Number(a[i]);if(s===(127&s)||(240&~s?224&~s?192&~s||(s=(s^=192)<<6|128^a[++i]):s=(s=(s^=224)<<6|128^a[++i])<<6|128^a[++i]:s=(s=(s=(s^=240)<<6|128^a[++i])<<6|128^a[++i])<<6|128^a[++i]),!Number.isFinite(s)||s<0||s>1114111||Math.floor(s)!==s)throw RangeError("Invalid code point: ".concat(s));s<=65535?n.push(s):(t=(s-=65536)>>10|55296,r=s%1024|56320,n.push(t,r)),(i+1===a.length||n.length>16384)&&(o+=String.fromCharCode.apply(null,n),n.length=0)}return o}}),e}(),fa=function(){function e(e){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_position",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_poolLen",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._pool=e,this._poolLen=e.length}return Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._position>=this._pool.length}}),Object.defineProperty(e.prototype,"read2Byte",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",r=0;r<2;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n.toString()}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readInt32",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(this.readByte()<<24)+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()}}),Object.defineProperty(e.prototype,"readLong",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",r=0;r<8;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readByte",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e}}),Object.defineProperty(e.prototype,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var r=this._pool.subarray(t,this._position);return _a.readUTF(r)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),da=function(){function e(){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"writeByte",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>=0&&(e>255&&(e&=255),this._pool.push(e))}}),Object.defineProperty(e.prototype,"writeBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pool=this._pool.concat(u([],s(new Int8Array(e)),!1))}}),Object.defineProperty(e.prototype,"writeArr",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pool=this._pool.concat(e)}}),Object.defineProperty(e.prototype,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=_a.writeUTF(e);this._pool=this._pool.concat(t)}}),Object.defineProperty(e.prototype,"getBytesArray",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool}}),e}(),ha=function(){function e(e,t,r,n){void 0===t&&(t=ii),void 0===r&&(r=!1),void 0===n&&(n=!1),Object.defineProperty(this,"command",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"qos",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_retain",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"dup",{enumerable:!0,configurable:!0,writable:!0,value:n})}return Object.defineProperty(e,"parse",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t>>4,(6&t)>>1,!(1&~t),(8&t)>0)}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.command<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this.dup?8:0}}),e}(),ga=function(){function e(e){Object.defineProperty(this,"header",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.readMessage(e,t,r)}}),Object.defineProperty(e.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return{stream:e,length:t}}}),e}(),pa=function(){function e(e){Object.defineProperty(this,"_header",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._header=new ha(e,ni)}return Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getHeaderFlag();e.writeByte(t),this.writeMessage(e)}}),Object.defineProperty(e.prototype,"setHeaderQos",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._header.qos=e}}),Object.defineProperty(e.prototype,"getHeaderFlag",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._header.encode()}}),Object.defineProperty(e.prototype,"getArrayBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new da;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),Ea=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"userId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"sessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(e.readByte(),this.status=e.readByte(),t<=r.MESSAGE_LENGTH)return{stream:e,length:t};if(n===hi){var i=e.readByte();1&i&&(this.userId=e.readUTF()),2&i&&(this.sessionId=e.readUTF()),4&i&&(this.timestamp=e.readLong()),8&i&&(this.messageId=e.read2Byte())}else this.userId=e.readUTF(),this.sessionId=e.readUTF(),this.timestamp=e.readLong();return{stream:e,length:t}}}),Object.defineProperty(r,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),r}(ga),Ia=function(e){function r(t){var r=e.call(this,di)||this;return Object.defineProperty(r,"status",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.writeArr([0,this.status])}}),r}(pa),ba=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return e.readByte(),this.status=e.readByte(),this.data=e.readAll(),{stream:e,length:t}}}),Object.defineProperty(r,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),r}(ga),Ta=function(e){function r(){return e.call(this,_i)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),r}(pa),va=function(e){function r(t){return e.call(this,t)||this}return t(r,e),r}(ga),Ra=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=256*e.readByte()+e.readByte();return this.messageId=parseInt(r.toString(),10),{stream:e,length:t}}}),r}(ga),ma=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.messageId,r=255&t,n=(65280&t)>>8;e.writeByte(n),e.writeByte(r)}}),r}(pa),Aa=function(e){function r(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"topic",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(r,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r.syncMsg=t.dup,r}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,r),this.pbData=t.readAll(),{stream:t,length:r}}}),r}(Ra),ya=function(e){function r(t,r,n,i){var a=e.call(this,t)||this;return Object.defineProperty(a,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"topic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a.topic="string"==typeof r?r:ri(r),a}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.writeBuffer(this.pbData)}}),r}(ma),Oa=function(e){function r(t,r,n){return e.call(this,ui,t,n,r)||this}return t(r,e),r}(ya),Sa=function(e){function r(t,r,n){return e.call(this,oi,t,n,r)||this}return t(r,e),r}(ya),Na=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"millisecond",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageUId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.millisecond=256*t.readByte()+t.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=t.readUTF(),{stream:t,length:r}}}),r}(Ra),Ca=function(e){function r(t){var r=e.call(this,si)||this;return r.messageId=t,r}return t(r,e),r}(ma),Pa=function(e){function r(t){var r=e.call(this,ci)||this;return r.messageId=t,r}return t(r,e),r}(ma),Ma=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:r}}}),r}(Ra),La=function(e,t){var r=new Uint8Array(e),n=new fa(r),i=n.readByte(),a=function(e){var t,r=e.command;switch(r){case ai:t=new Ea(e);break;case oi:t=new Aa(e);break;case si:t=new Na(e);break;case li:t=new Ma(e);break;case fi:t=new va(e);break;case di:t=new ba(e);break;default:console.error("No support for deserializing ".concat(r," messages"))}return t}(ha.parse(i));return a&&a.read(n,r.length-1,t),a},wa=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=yr(),n=r.resolve,i=r.promise,a=this._logger,o=wx.request({url:e,enableChunked:!0,method:"GET",timeout:t.timeout,header:{"Content-Type":"application/json;charset=UTF-8","App-Key":t.appkey,Authorization:"Bearer ".concat(t.token)},success:function(e){var t;if(200===e.statusCode&&(null===(t=e.header["Content-Type"])||void 0===t?void 0:t.startsWith("text/event-stream")))n(br());else{var r=JSON.parse(e.data),i=r.code,a=r.message;n(Tr(i,a))}},fail:function(t){var r=t.errMsg,i=t.errno;a.warn(F.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:r,errno:i})),n(Tr(-1,t.errMsg))},complete:function(){a.debug(F.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return o.onChunkReceived((function(e){var r=_a.readUTF(new Uint8Array(e.data));a.debug(F.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(r)),t.onRawContent(r)})),i}}),r}(Kn),Ua=Jn(),Da=qn({setItem:function(e,t){wx.setStorage({key:e,data:t})},getItem:function(e){return wx.getStorageSync(e)},removeItem:function(e){wx.removeStorage({key:e})}}),Ga=null,Va=function(e){var t=e.isConnected,r=e.networkType;Ga({status:t,type:r})};var ja={tag:"wechat",httpReq:function(e){var t=e.method||De.GET,r=e.timeout||Be,n=e.headers,i=e.query,a=e.body,o=zt(e.url,i);return new Promise((function(e){wx.request({url:o,method:t,header:n,timeout:r,data:a,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:k.RC_HTTP_REQ_FAIL})}})}))},localStorage:Da,sessionStorage:Da,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ua,createWebSocket:function(e,t){var r=wx.connectSocket({url:e,protocols:t});return Promise.resolve(br({id:Date.now(),onClose:function(e){r.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){e(t.errMsg),r.close()}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ga=e,wx.onNetworkStatusChange(Va)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(Va),Ga=null},createSSEClient:function(e){return br(new wa(e))},get runtimeInfo(){return{type:ja.tag,version:"Unknown"}}},ka=Jn(),xa=qn({setItem:function(e,t){my.setStorage({key:e,data:t})},getItem:function(e){return my.getStorageSync({key:e}).data},removeItem:function(e){my.removeStorage({key:e})}}),Fa=null,Ba=function(e){var t=e.isConnected,r=e.networkType;Fa({status:t,type:r})};var Ha={tag:"alipay",httpReq:function(e){var t=e.method||De.GET,r=e.timeout||Be,n=e.headers,i=e.query,a=e.body,o=zt(e.url,i),s=e.dataType||"json";return new Promise((function(e){my.request({url:o,method:t,headers:n,timeout:r,data:a,dataType:s,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:k.RC_HTTP_REQ_FAIL})}})}))},localStorage:xa,sessionStorage:xa,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ka,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return Promise.resolve(br({id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}))},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){Fa=e,my.onNetworkStatusChange(Ba)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Ba),Fa=null},createSSEClient:function(e){return Tr(k.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:Ha.tag,version:"Unknown"}}},Ya=Jn(),Wa=qn({setItem:function(e,t){tt.setStorage({key:e,data:t})},getItem:function(e){return tt.getStorageSync(e)},removeItem:function(e){tt.removeStorage({key:e})}}),Ja=null,qa=function(e){var t=e.isConnected,r=e.networkType;Ja({status:t,type:r})};var Ka={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ya,localStorage:Wa,sessionStorage:Wa,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:k.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){return new Promise((function(r){var n=tt.connectSocket({url:e,protocols:t,fail:function(e){return r(Tr(k.RC_SOCKET_DISCONNECTED,e.errMsg))}});r(br({id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){n.close(),e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}))}))},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ja=e,tt.onNetworkStatusChange(qa)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(qa),Ja=null},createSSEClient:function(e){return Tr(k.NOT_SUPPORT)},get runtimeInfo(){return{type:Ka.tag,version:"Unknown"}}},Qa=Jn(),Xa=qn({setItem:function(e,t){swan.setStorage({key:e,data:t})},getItem:function(e){return swan.getStorageSync(e)},removeItem:function(e){swan.removeStorage({key:e})}}),Za=null,za=function(e){var t=e.isConnected,r=e.networkType;Za({status:t,type:r})};var $a={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Qa,localStorage:Xa,sessionStorage:Xa,httpReq:function(e){return new Promise((function(t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:k.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=swan.connectSocket({url:e,protocols:t});return Promise.resolve(br({id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Za=e,swan.onNetworkStatusChange(za)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(za),Za=null},createSSEClient:function(e){return Tr(k.NOT_SUPPORT)},get runtimeInfo(){return{type:$a.tag,version:"Unknown"}}},eo=Jn(),to=qn({setItem:function(e,t){jd.setStorage({key:e,data:t})},getItem:function(e){return jd.getStorageSync(e)},removeItem:function(e){jd.removeStorage({key:e})}}),ro=null,no=function(e){var t=e.isConnected,r=e.networkType;ro({status:t,type:r})};var io={tag:"jingdong",httpReq:function(e){var t=e.method||De.GET,r=e.timeout||Be,n=e.headers,i=e.query,a=e.body,o=zt(e.url,i);return new Promise((function(e){jd.request({url:o,method:t,header:n,timeout:r,data:a,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:k.RC_HTTP_REQ_FAIL})}})}))},localStorage:to,sessionStorage:to,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:eo,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),Promise.resolve(br({id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){ro=e,jd.onNetworkStatusChange(no)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(no),ro=null},createSSEClient:function(e){return Tr(k.NOT_SUPPORT)},get runtimeInfo(){return{type:io.tag,version:"Unknown"}}},ao=Jn(),oo=qn({setItem:function(e,t){ks.setStorage({key:e,data:t})},getItem:function(e){return ks.getStorageSync(e)},removeItem:function(e){ks.removeStorage({key:e})}}),so=null,uo=function(e){var t=e.isConnected,r=e.networkType;so({status:t,type:r})};var lo={tag:"kuaishou",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ao,localStorage:oo,sessionStorage:oo,httpReq:function(e){return new Promise((function(t){ks.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:k.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=ks.connectSocket({url:e,protocols:t});return Promise.resolve(br({id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){ks.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){so=e,ks.onNetworkStatusChange(uo)},removeNetworkStatusListener:function(){ks.offNetworkStatusChange(uo),so=null},createSSEClient:function(e){return Tr(k.NOT_SUPPORT)},get runtimeInfo(){return{type:lo.tag,version:"Unknown"}}},co=qn({setItem:function(e,t){uni.setStorage({key:e,data:t})},getItem:function(e){return uni.getStorageSync(e)},removeItem:function(e){uni.removeStorage({key:e,success:function(){}})}}),_o=null,fo=function(e){var t=e.isConnected,r=e.networkType;_o({status:t,type:r})};var ho={tag:"uniapp",httpReq:function(e){var t=e.method||De.GET,r=e.timeout||Be,n=e.headers,i=e.query,a=e.body,o=zt(e.url,i);return new Promise((function(e){uni.request({url:o,method:t,header:n,timeout:r,data:a,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:k.RC_HTTP_REQ_FAIL})}})}))},localStorage:co,sessionStorage:co,useNavi:!0,get connectPlatform(){var e=uni.getSystemInfoSync(),t=e.uniPlatform,r=e.osName;return["app","app-plus"].includes(t)&&r||""},isFromUniapp:!0,createWebSocket:function(e,t){var r={complete:function(){},url:e,protocols:t},n=uni.connectSocket(r);return Promise.resolve(br({id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){_o=e,uni.onNetworkStatusChange(fo)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(fo),_o=null},createSSEClient:function(e){return Tr(k.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,r=e.deviceModel,n=e.deviceBrand,i=e.osVersion,a="android"===e.osName?t:i;return"".concat(n||"","|").concat(r||"","|").concat(a||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:ho.tag,version:"Unknown"}}},go=function(e){return e&&e.request&&e.getSystemInfo},po="undefined"!=typeof uni&&go(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return ho;case"mp-jd":return io;case"mp-baidu":return $a;case"mp-toutiao":return Ka;case"mp-alipay":return Ha;case"mp-weixin":return ja;case"mp-kuaishou":return lo;default:return ei}}():"undefined"!=typeof jd&&go(jd)?io:"undefined"!=typeof my&&go(my)?Ha:"undefined"!=typeof tt&&go(tt)?Ka:"undefined"!=typeof ks&&go(ks)?lo:"undefined"!=typeof swan&&go(swan)?$a:"undefined"!=typeof wx&&go(wx)?ja:ei;const Eo=function(){var e,t={},r=function(e){var t=function(e,r,i){if(void 0===e&&(e=t.DEFAULT_CAPACITY),void 0===r&&(r=t.DEFAULT_ENDIAN),void 0===i&&(i=t.DEFAULT_NOASSERT),!i){if((e|=0)<0)throw RangeError("Illegal capacity");r=!!r,i=!!i}this.buffer=0===e?n:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=r,this.noAssert=i};t.VERSION="5.0.1",t.LITTLE_ENDIAN=!0,t.BIG_ENDIAN=!1,t.DEFAULT_CAPACITY=16,t.DEFAULT_ENDIAN=t.BIG_ENDIAN,t.DEFAULT_NOASSERT=!1,t.Long=e||null;var r=t.prototype;r.__isByteBuffer__,Object.defineProperty(r,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var n=new ArrayBuffer(0),i=String.fromCharCode;function a(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function o(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+i.apply(String,e);e.length+arguments.length>1024&&(t.push(i.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function s(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,_=r?i-1:0,f=r?-1:1,d=e[t+_];for(_+=f,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+e[t+_],_+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+_],_+=f,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=l}return(d?-1:1)*o*Math.pow(2,a-n)}function u(e,t,r,n,i,a){var o,s,u,l=8*a-i-1,c=(1<<l)-1,_=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,h=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+_>=1?f/u:f*Math.pow(2,1-_))*u>=2&&(o++,u/=2),o+_>=c?(s=0,o=c):o+_>=1?(s=(t*u-1)*Math.pow(2,i),o+=_):(s=t*Math.pow(2,_-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=h,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[r+d]=255&o,d+=h,o/=256,l-=8);e[r+d-h]|=128*g}t.accessor=function(){return Uint8Array},t.allocate=function(e,r,n){return new t(e,r,n)},t.concat=function(e,r,n,i){"boolean"!=typeof r&&"string"==typeof r||(i=n,n=r,r=void 0);for(var a,o=0,s=0,u=e.length;s<u;++s)t.isByteBuffer(e[s])||(e[s]=t.wrap(e[s],r)),(a=e[s].limit-e[s].offset)>0&&(o+=a);if(0===o)return new t(0,n,i);var l,c=new t(o,n,i);for(s=0;s<u;)(a=(l=e[s++]).limit-l.offset)<=0||(c.view.set(l.view.subarray(l.offset,l.limit),c.offset),c.offset+=a);return c.limit=c.offset,c.offset=0,c},t.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},t.type=function(){return ArrayBuffer},t.wrap=function(e,n,i,a){if("string"!=typeof n&&(a=i,i=n,n=void 0),"string"==typeof e)switch(void 0===n&&(n="utf8"),n){case"base64":return t.fromBase64(e,i);case"hex":return t.fromHex(e,i);case"binary":return t.fromBinary(e,i);case"utf8":return t.fromUTF8(e,i);case"debug":return t.fromDebug(e,i);default:throw Error("Unsupported encoding: "+n)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var o;if(t.isByteBuffer(e))return(o=r.clone.call(e)).markedOffset=-1,o;if(e instanceof Uint8Array)o=new t(0,i,a),e.length>0&&(o.buffer=e.buffer,o.offset=e.byteOffset,o.limit=e.byteOffset+e.byteLength,o.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)o=new t(0,i,a),e.byteLength>0&&(o.buffer=e,o.offset=0,o.limit=e.byteLength,o.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(o=new t(e.length,i,a)).limit=e.length;for(var s=0;s<e.length;++s)o.view[s]=e[s]}return o},r.writeBitSet=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var n,i=t,a=e.length,o=a>>3,s=0;for(t+=this.writeVarint32(a,t);o--;)n=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(n,t++);if(s<a){var u=0;for(n=0;s<a;)n|=(1&!!e[s++])<<u++;this.writeByte(n,t++)}return r?(this.offset=t,this):t-i},r.readBitSet=function(e){var t=void 0===e;t&&(e=this.offset);var r,n=this.readVarint32(e),i=n.value,a=i>>3,o=0,s=[];for(e+=n.length;a--;)r=this.readByte(e++),s[o++]=!!(1&r),s[o++]=!!(2&r),s[o++]=!!(4&r),s[o++]=!!(8&r),s[o++]=!!(16&r),s[o++]=!!(32&r),s[o++]=!!(64&r),s[o++]=!!(128&r);if(o<i){var u=0;for(r=this.readByte(e++);o<i;)s[o++]=!!(r>>u++&1)}return t&&(this.offset=e),s},r.readBytes=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var n=this.slice(t,t+e);return r&&(this.offset+=e),n},r.writeBytes=r.append,r.writeInt8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view[e];return 128&~r||(r=-(255-r+1)),t&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeUInt8=r.writeUint8,r.readUint8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view[e];return t&&(this.offset+=1),r},r.readUInt8=r.readUint8,r.writeInt16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},r.writeShort=r.writeInt16,r.readInt16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),32768&~r||(r=-(65535-r+1)),t&&(this.offset+=2),r},r.readShort=r.readInt16,r.writeUint16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},r.writeUInt16=r.writeUint16,r.readUint16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),t&&(this.offset+=2),r},r.readUInt16=r.readUint16,r.writeInt32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeInt=r.writeInt32,r.readInt32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),r|=0,t&&(this.offset+=4),r},r.readInt=r.readInt32,r.writeUint32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeUInt32=r.writeUint32,r.readUint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),t&&(this.offset+=4),r},r.readUInt32=r.readUint32,e&&(r.writeInt64=function(t,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var i=this.buffer.byteLength;r>i&&this.resize((i*=2)>r?i:r),r-=8;var a=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=a>>>24&255,this.view[r+2]=a>>>16&255,this.view[r+1]=a>>>8&255,this.view[r]=255&a,r+=4,this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o):(this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o,r+=4,this.view[r]=a>>>24&255,this.view[r+1]=a>>>16&255,this.view[r+2]=a>>>8&255,this.view[r+3]=255&a),n&&(this.offset+=8),this},r.writeLong=r.writeInt64,r.readInt64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var n=0,i=0;this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0);var a=new e(n,i,!1);return r&&(this.offset+=8),a},r.readLong=r.readInt64,r.writeUint64=function(t,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var i=this.buffer.byteLength;r>i&&this.resize((i*=2)>r?i:r),r-=8;var a=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=a>>>24&255,this.view[r+2]=a>>>16&255,this.view[r+1]=a>>>8&255,this.view[r]=255&a,r+=4,this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o):(this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o,r+=4,this.view[r]=a>>>24&255,this.view[r+1]=a>>>16&255,this.view[r+2]=a>>>8&255,this.view[r+3]=255&a),n&&(this.offset+=8),this},r.writeUInt64=r.writeUint64,r.readUint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var n=0,i=0;this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0);var a=new e(n,i,!0);return r&&(this.offset+=8),a},r.readUInt64=r.readUint64),r.writeFloat32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,u(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},r.writeFloat=r.writeFloat32,r.readFloat32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=s(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),r},r.readFloat=r.readFloat32,r.writeFloat64=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=8,u(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},r.writeDouble=r.writeFloat64,r.readFloat64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var r=s(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),r},r.readDouble=r.readFloat64,t.MAX_VARINT32_BYTES=5,t.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},t.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},t.zigZagDecode32=function(e){return e>>>1^-(1&e)},r.writeVarint32=function(e,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var i,a=t.calculateVarint32(e);r+=a;var o=this.buffer.byteLength;for(r>o&&this.resize((o*=2)>r?o:r),r-=a,e>>>=0;e>=128;)i=127&e|128,this.view[r++]=i,e>>>=7;return this.view[r++]=e,n?(this.offset=r,this):a},r.writeVarint32ZigZag=function(e,r){return this.writeVarint32(t.zigZagEncode32(e),r)},r.readVarint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,n=0,i=0;do{if(!this.noAssert&&e>this.limit){var a=Error("Truncated");throw a.truncated=!0,a}r=this.view[e++],n<5&&(i|=(127&r)<<7*n),++n}while(128&r);return i|=0,t?(this.offset=e,i):{value:i,length:n}},r.readVarint32ZigZag=function(e){var r=this.readVarint32(e);return"object"==typeof r?r.value=t.zigZagDecode32(r.value):r=t.zigZagDecode32(r),r},e&&(t.MAX_VARINT64_BYTES=10,t.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,n=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==n?r<16384?r<128?1:2:r<1<<21?3:4:n<16384?n<128?5:6:n<1<<21?7:8:i<128?9:10},t.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},t.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},r.writeVarint64=function(r,n){var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"==typeof r)r=e.fromNumber(r);else if("string"==typeof r)r=e.fromString(r);else if(!(r&&r instanceof e))throw TypeError("Illegal value: "+r+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof r?r=e.fromNumber(r,!1):"string"==typeof r?r=e.fromString(r,!1):!1!==r.unsigned&&(r=r.toSigned());var a=t.calculateVarint64(r),o=r.toInt()>>>0,s=r.shiftRightUnsigned(28).toInt()>>>0,u=r.shiftRightUnsigned(56).toInt()>>>0;n+=a;var l=this.buffer.byteLength;switch(n>l&&this.resize((l*=2)>n?l:n),n-=a,a){case 10:this.view[n+9]=u>>>7&1;case 9:this.view[n+8]=9!==a?128|u:127&u;case 8:this.view[n+7]=8!==a?s>>>21|128:s>>>21&127;case 7:this.view[n+6]=7!==a?s>>>14|128:s>>>14&127;case 6:this.view[n+5]=6!==a?s>>>7|128:s>>>7&127;case 5:this.view[n+4]=5!==a?128|s:127&s;case 4:this.view[n+3]=4!==a?o>>>21|128:o>>>21&127;case 3:this.view[n+2]=3!==a?o>>>14|128:o>>>14&127;case 2:this.view[n+1]=2!==a?o>>>7|128:o>>>7&127;case 1:this.view[n]=1!==a?128|o:127&o}return i?(this.offset+=a,this):a},r.writeVarint64ZigZag=function(e,r){return this.writeVarint64(t.zigZagEncode64(e),r)},r.readVarint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var n=t,i=0,a=0,o=0,s=0;if(i=127&(s=this.view[t++]),128&s&&(i|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(a=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(a|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(a|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(a|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(o=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[t++]))<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|a<<28,a>>>4|o<<24,!1);return r?(this.offset=t,u):{value:u,length:t-n}},r.readVarint64ZigZag=function(r){var n=this.readVarint64(r);return n&&n.value instanceof e?n.value=t.zigZagDecode64(n.value):n=t.zigZagDecode64(n),n}),r.writeCString=function(e,t){var r=void 0===t;r&&(t=this.offset);var n,i=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(n=0;n<i;++n)if(0===e.charCodeAt(n))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}i=c.calculateUTF16asUTF8(a(e))[1],t+=i+1;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=i+1,c.encodeUTF16toUTF8(a(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,r?(this.offset=t,this):i},r.readCString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,n=e,i=-1;return c.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view[e++])?null:i}.bind(this),r=o(),!0),t?(this.offset=e,r()):{string:r(),length:e-n}},r.writeIString=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var n,i=t;n=c.calculateUTF16asUTF8(a(e),this.noAssert)[1],t+=4+n;var o=this.buffer.byteLength;if(t>o&&this.resize((o*=2)>t?o:t),t-=4+n,this.littleEndian?(this.view[t+3]=n>>>24&255,this.view[t+2]=n>>>16&255,this.view[t+1]=n>>>8&255,this.view[t]=255&n):(this.view[t]=n>>>24&255,this.view[t+1]=n>>>16&255,this.view[t+2]=n>>>8&255,this.view[t+3]=255&n),t+=4,c.encodeUTF16toUTF8(a(e),function(e){this.view[t++]=e}.bind(this)),t!==i+4+n)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+n));return r?(this.offset=t,this):t-i},r.readIString=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=e,i=this.readUint32(e),a=this.readUTF8String(i,t.METRICS_BYTES,e+=4);return e+=a.length,r?(this.offset=e,a.string):{string:a.string,length:e-n}},t.METRICS_CHARS="c",t.METRICS_BYTES="b",r.writeUTF8String=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i=t;r=c.calculateUTF16asUTF8(a(e))[1],t+=r;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=r,c.encodeUTF16toUTF8(a(e),function(e){this.view[t++]=e}.bind(this)),n?(this.offset=t,this):t-i},r.writeString=r.writeUTF8String,t.calculateUTF8Chars=function(e){return c.calculateUTF16asUTF8(a(e))[0]},t.calculateUTF8Bytes=function(e){return c.calculateUTF16asUTF8(a(e))[1]},t.calculateString=t.calculateUTF8Bytes,r.readUTF8String=function(e,r,n){"number"==typeof r&&(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),void 0===r&&(r=t.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var a,s=0,u=n;if(r===t.METRICS_CHARS){if(a=o(),c.decodeUTF8(function(){return s<e&&n<this.limit?this.view[n++]:null}.bind(this),(function(e){++s,c.UTF8toUTF16(e,a)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=n,a()):{string:a(),length:n-u}}if(r===t.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+"+e+") <= "+this.buffer.byteLength)}var l=n+e;if(c.decodeUTF8toUTF16(function(){return n<l?this.view[n++]:null}.bind(this),a=o(),this.noAssert),n!==l)throw RangeError("Illegal range: Truncated data, "+n+" == "+l);return i?(this.offset=n,a()):{string:a(),length:n-u}}throw TypeError("Unsupported metrics: "+r)},r.readString=r.readUTF8String,r.writeVString=function(e,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var i,o,s=r;i=c.calculateUTF16asUTF8(a(e),this.noAssert)[1],o=t.calculateVarint32(i),r+=o+i;var u=this.buffer.byteLength;if(r>u&&this.resize((u*=2)>r?u:r),r-=o+i,r+=this.writeVarint32(i,r),c.encodeUTF16toUTF8(a(e),function(e){this.view[r++]=e}.bind(this)),r!==s+i+o)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+i+o));return n?(this.offset=r,this):r-s},r.readVString=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,i=this.readVarint32(e),a=this.readUTF8String(i.value,t.METRICS_BYTES,e+=i.length);return e+=a.length,r?(this.offset=e,a.string):{string:a.string,length:e-n}},r.append=function(e,r,n){"number"!=typeof r&&"string"==typeof r||(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var a=e.limit-e.offset;if(a<=0)return this;n+=a;var o=this.buffer.byteLength;return n>o&&this.resize((o*=2)>n?o:n),n-=a,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=a,i&&(this.offset+=a),this},r.appendTo=function(e,t){return e.append(this,t),this},r.assert=function(e){return this.noAssert=!e,this},r.capacity=function(){return this.buffer.byteLength},r.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},r.clone=function(e){var r=new t(0,this.littleEndian,this.noAssert);return e?(r.buffer=new ArrayBuffer(this.buffer.byteLength),r.view=new Uint8Array(r.buffer)):(r.buffer=this.buffer,r.view=this.view),r.offset=this.offset,r.markedOffset=this.markedOffset,r.limit=this.limit,r},r.compact=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var r=t-e;if(0===r)return this.buffer=n,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var i=new ArrayBuffer(r),a=new Uint8Array(i);return a.set(this.view.subarray(e,t)),this.buffer=i,this.view=a,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=r,this},r.copy=function(e,r){if(void 0===e&&(e=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(e===r)return new t(0,this.littleEndian,this.noAssert);var n=r-e,i=new t(n,this.littleEndian,this.noAssert);return i.offset=0,i.limit=n,i.markedOffset>=0&&(i.markedOffset-=e),this.copyTo(i,0,e,r),i},r.copyTo=function(e,r,n,i){var a,o;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(o=void 0===r)?e.offset:0|r,n=(a=void 0===n)?this.offset:0|n,i=void 0===i?this.limit:0|i,r<0||r>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+r+" <= "+e.buffer.byteLength);if(n<0||i>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var s=i-n;return 0===s?e:(e.ensureCapacity(r+s),e.view.set(this.view.subarray(n,i),r),a&&(this.offset+=s),o&&(e.offset+=s),this)},r.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},r.fill=function(e,t,r){var n=void 0===t;if(n&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;t<r;)this.view[t++]=e;return n&&(this.offset=t),this},r.flip=function(){return this.limit=this.offset,this.offset=0,this},r.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},r.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},r.LE=function(e){return this.littleEndian=void 0===e||!!e,this},r.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},r.prepend=function(e,r,n){"number"!=typeof r&&"string"==typeof r||(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var a=e.limit-e.offset;if(a<=0)return this;var o=a-n;if(o>0){var s=new ArrayBuffer(this.buffer.byteLength+o),u=new Uint8Array(s);u.set(this.view.subarray(n,this.buffer.byteLength),a),this.buffer=s,this.view=u,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,n+=o}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),n-a),e.offset=e.limit,i&&(this.offset-=a),this},r.prependTo=function(e,t){return e.prepend(this,t),this},r.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},r.remaining=function(){return this.limit-this.offset},r.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},r.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),r=new Uint8Array(t);r.set(this.view),this.buffer=t,this.view=r}return this},r.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},r.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},r.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=e,r.limit=t,r},r.toBuffer=function(e){var t=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(!e&&0===t&&r===this.buffer.byteLength)return this.buffer;if(t===r)return n;var i=new ArrayBuffer(r-t);return new Uint8Array(i).set(new Uint8Array(this.buffer).subarray(t,r),0),i},r.toArrayBuffer=r.toBuffer,r.toString=function(e,t,r){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(r=t=e="utf8"),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var l=function(){for(var e={},t=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],r=[],n=0,i=t.length;n<i;++n)r[t[n]]=n;return e.encode=function(e,r){for(var n,i;null!==(n=e());)r(t[n>>2&63]),i=(3&n)<<4,null!==(n=e())?(r(t[63&((i|=n>>4&15)|n>>4&15)]),i=(15&n)<<2,null!==(n=e())?(r(t[63&(i|n>>6&3)]),r(t[63&n])):(r(t[63&i]),r(61))):(r(t[63&i]),r(61),r(61))},e.decode=function(e,t){var n,i,a;function o(e){throw Error("Illegal character code: "+e)}for(;null!==(n=e());)if(void 0===(i=r[n])&&o(n),null!==(n=e())&&(void 0===(a=r[n])&&o(n),t(i<<2>>>0|(48&a)>>4),null!==(n=e()))){if(void 0===(i=r[n])){if(61===n)break;o(n)}if(t((15&a)<<4>>>0|(60&i)>>2),null!==(n=e())){if(void 0===(a=r[n])){if(61===n)break;o(n)}t((3&i)<<6>>>0|a)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();r.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return l.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=o()),r()},t.fromBase64=function(e,r){if("string"!=typeof e)throw TypeError("str");var n=new t(e.length/4*3,r),i=0;return l.decode(a(e),(function(e){n.view[i++]=e})),n.limit=i,n},t.btoa=function(e){return t.fromBinary(e).toBase64()},t.atob=function(e){return t.fromBase64(e).toBinary()},r.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var r=[],n=[];e<t;)r.push(this.view[e++]),r.length>=1024&&(n.push(String.fromCharCode.apply(String,r)),r=[]);return n.join("")+String.fromCharCode.apply(String,r)},t.fromBinary=function(e,r){if("string"!=typeof e)throw TypeError("str");for(var n,i=0,a=e.length,o=new t(a,r);i<a;){if((n=e.charCodeAt(i))>255)throw RangeError("illegal char code: "+n);o.view[i++]=n}return o.limit=a,o},r.toDebug=function(e){for(var t,r=-1,n=this.buffer.byteLength,i="",a="",o="";r<n;){if(-1!==r&&(i+=(t=this.view[r])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(a+=t>32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==n){for(;i.length<51;)i+=" ";o+=i+a+"\n",i=a=""}r===this.offset&&r===this.limit?i+=r===this.markedOffset?"!":"|":r===this.offset?i+=r===this.markedOffset?"[":"<":r===this.limit?i+=r===this.markedOffset?"]":">":i+=r===this.markedOffset?"'":e||0!==r&&r!==n?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";o+=i+a+"\n"}return e?o:i},t.fromDebug=function(e,r,n){for(var i,a,o=e.length,s=new t((o+1)/3|0,r,n),u=0,l=0,c=!1,_=!1,f=!1,d=!1,h=!1;u<o;){switch(i=e.charAt(u++)){case"!":if(!n){if(_||f||d){h=!0;break}_=f=d=!0}s.offset=s.markedOffset=s.limit=l,c=!1;break;case"|":if(!n){if(_||d){h=!0;break}_=d=!0}s.offset=s.limit=l,c=!1;break;case"[":if(!n){if(_||f){h=!0;break}_=f=!0}s.offset=s.markedOffset=l,c=!1;break;case"<":if(!n){if(_){h=!0;break}_=!0}s.offset=l,c=!1;break;case"]":if(!n){if(d||f){h=!0;break}d=f=!0}s.limit=s.markedOffset=l,c=!1;break;case">":if(!n){if(d){h=!0;break}d=!0}s.limit=l,c=!1;break;case"'":if(!n){if(f){h=!0;break}f=!0}s.markedOffset=l,c=!1;break;case" ":c=!1;break;default:if(!n&&c){h=!0;break}if(a=parseInt(i+e.charAt(u++),16),!n&&(isNaN(a)||a<0||a>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[l++]=a,c=!0}if(h)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!n){if(!_||!d)throw TypeError("Illegal str: Missing offset or limit");if(l<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+o)}return s},r.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var r,n=new Array(t-e);e<t;)(r=this.view[e++])<16?n.push("0",r.toString(16)):n.push(r.toString(16));return n.join("")},t.fromHex=function(e,r,n){if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var i,a=e.length,o=new t(a/2|0,r),s=0,u=0;s<a;s+=2){if(i=parseInt(e.substring(s,s+2),16),!n&&(!isFinite(i)||i<0||i>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[u++]=i}return o.limit=u,o};var c=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<128?t(127&r):r<2048?(t(r>>6&31|192),t(63&r|128)):r<65536?(t(r>>12&15|224),t(r>>6&63|128),t(63&r|128)):(t(r>>18&7|240),t(r>>12&63|128),t(r>>6&63|128),t(63&r|128)),r=null},decodeUTF8:function(e,t){for(var r,n,i,a,o=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(r=e());)if(128&r)if(192==(224&r))null===(n=e())&&o([r,n]),t((31&r)<<6|63&n);else if(224==(240&r))(null===(n=e())||null===(i=e()))&&o([r,n,i]),t((15&r)<<12|(63&n)<<6|63&i);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(n=e())||null===(i=e())||null===(a=e()))&&o([r,n,i,a]),t((7&r)<<18|(63&n)<<12|(63&i)<<6|63&a)}else t(r)},UTF16toUTF8:function(e,t){for(var r,n=null;null!==(r=null!==n?n:e());)r>=55296&&r<=57343&&null!==(n=e())&&n>=56320&&n<=57343?(t(1024*(r-55296)+n-56320+65536),n=null):t(r);null!==n&&t(n)},UTF8toUTF16:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<=65535?t(r):(t(55296+((r-=65536)>>10)),t(r%1024+56320)),r=null},encodeUTF16toUTF8:function(t,r){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,r)}))},decodeUTF8toUTF16:function(t,r){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,r)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,r=0;null!==(t=e());)r+=t<128?1:t<2048?2:t<65536?3:4;return r},calculateUTF16asUTF8:function(t){var r=0,n=0;return e.UTF16toUTF8(t,(function(e){++r,n+=e<128?1:e<2048?2:e<65536?3:4})),[r,n]}};return e}();return r.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{c.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),r=o())}catch(r){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},t.fromUTF8=function(e,r,n){if(!n&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new t(c.calculateUTF16asUTF8(a(e),!0)[1],r,n),o=0;return c.encodeUTF16toUTF8(a(e),(function(e){i.view[o++]=e})),i.limit=o,i},t}(function(){function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},n={};function i(e,t){var i,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=n[e])?a:(i=o(e,(0|e)<0?-1:0,!0),s&&(n[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(a=r[e])?a:(i=o(e,e<0?-1:0,!1),s&&(r[e]=i),i)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?g:h;if(t){if(e<0)return g;if(e>=_)return T}else{if(e<=-f)return v;if(e+1>=f)return b}return e<0?a(-e,t).neg():o(e%c|0,e/c|0,t)}function o(t,r,n){return new e(t,r,n)}e.fromInt=i,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return h;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return u(e.substring(1),t,r).neg();for(var i=a(s(r,8)),o=h,l=0;l<e.length;l+=8){var c=Math.min(8,e.length-l),_=parseInt(e.substring(l,l+c),r);if(c<8){var f=a(s(r,c));o=o.mul(f).add(a(_))}else o=(o=o.mul(i)).add(a(_))}return o.unsigned=t,o}function l(t){return t instanceof e?t:"number"==typeof t?a(t):"string"==typeof t?u(t):o(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=l;var c=4294967296,_=c*c,f=_/2,d=i(1<<24),h=i(0);e.ZERO=h;var g=i(0,!0);e.UZERO=g;var p=i(1);e.ONE=p;var E=i(1,!0);e.UONE=E;var I=i(-1);e.NEG_ONE=I;var b=o(-1,2147483647,!1);e.MAX_VALUE=b;var T=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=T;var v=o(0,-2147483648,!1);e.MIN_VALUE=v;var R=e.prototype;return R.toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},R.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(v)){var t=a(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=a(s(e,6),this.unsigned),o=this,u="";;){var l=o.div(i),c=(o.sub(l.mul(i)).toInt()>>>0).toString(e);if((o=l).isZero())return c+u;for(;c.length<6;)c="0"+c;u=""+c+u}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(v)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},R.isZero=function(){return 0===this.high&&0===this.low},R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return!(1&~this.low)},R.isEven=function(){return!(1&this.low)},R.equals=function(e){return t(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},R.eq=R.equals,R.notEquals=function(e){return!this.eq(e)},R.neq=R.notEquals,R.lessThan=function(e){return this.comp(e)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(e){return this.comp(e)<=0},R.lte=R.lessThanOrEqual,R.greaterThan=function(e){return this.comp(e)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(e){return this.comp(e)>=0},R.gte=R.greaterThanOrEqual,R.compare=function(e){if(t(e)||(e=l(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(v)?v:this.not().add(p)},R.neg=R.negate,R.add=function(e){t(e)||(e=l(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,c=e.low>>>16,_=0,f=0,d=0,h=0;return d+=(h+=a+(65535&e.low))>>>16,f+=(d+=i+c)>>>16,_+=(f+=n+u)>>>16,_+=r+s,o((d&=65535)<<16|(h&=65535),(_&=65535)<<16|(f&=65535),this.unsigned)},R.subtract=function(e){return t(e)||(e=l(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){if(this.isZero())return h;if(t(e)||(e=l(e)),e.isZero())return h;if(this.eq(v))return e.isOdd()?v:h;if(e.eq(v))return this.isOdd()?v:h;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=e.high>>>16,c=65535&e.high,_=e.low>>>16,f=65535&e.low,g=0,p=0,E=0,I=0;return E+=(I+=s*f)>>>16,p+=(E+=i*f)>>>16,E&=65535,p+=(E+=s*_)>>>16,g+=(p+=n*f)>>>16,p&=65535,g+=(p+=i*_)>>>16,p&=65535,g+=(p+=s*c)>>>16,g+=r*f+n*_+i*c+s*u,o((E&=65535)<<16|(I&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},R.mul=R.multiply,R.divide=function(e){if(t(e)||(e=l(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:h;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return E;i=g}else{if(this.eq(v))return e.eq(p)||e.eq(I)?v:e.eq(v)?p:(r=this.shr(1).div(e).shl(1)).eq(h)?e.isNegative()?p:I:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(v))return this.unsigned?g:h;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=h}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),u=o<=48?1:s(2,o-48),c=a(r),_=c.mul(e);_.isNegative()||_.gt(n);)_=(c=a(r-=u,this.unsigned)).mul(e);c.isZero()&&(c=p),i=i.add(c),n=n.sub(_)}return i},R.div=R.divide,R.modulo=function(e){return t(e)||(e=l(e)),this.sub(this.div(e).mul(e))},R.mod=R.modulo,R.not=function(){return o(~this.low,~this.high,this.unsigned)},R.and=function(e){return t(e)||(e=l(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return t(e)||(e=l(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return t(e)||(e=l(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},R.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(0,this.low<<e-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var r=this.high;return e<32?o(this.low>>>e|r<<32-e,r>>>e,this.unsigned):o(32===e?r:r>>>e-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},R.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e}());return t.ByteBuffer=r,t.Long=r.Long||null,t.VERSION="5.0.3",t.WIRE_TYPES={},t.WIRE_TYPES.VARINT=0,t.WIRE_TYPES.BITS64=1,t.WIRE_TYPES.LDELIM=2,t.WIRE_TYPES.STARTGROUP=3,t.WIRE_TYPES.ENDGROUP=4,t.WIRE_TYPES.BITS32=5,t.PACKABLE_WIRE_TYPES=[t.WIRE_TYPES.VARINT,t.WIRE_TYPES.BITS64,t.WIRE_TYPES.BITS32],t.TYPES={int32:{name:"int32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.ZERO:void 0},uint64:{name:"uint64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.UZERO:void 0},sint64:{name:"sint64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.ZERO:void 0},bool:{name:"bool",wireType:t.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:t.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:t.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:t.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:t.WIRE_TYPES.BITS64,defaultValue:t.Long?t.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:t.WIRE_TYPES.BITS64,defaultValue:t.Long?t.Long.ZERO:void 0},float:{name:"float",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:t.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:t.WIRE_TYPES.STARTGROUP,defaultValue:null}},t.MAP_KEY_TYPES=[t.TYPES.int32,t.TYPES.sint32,t.TYPES.sfixed32,t.TYPES.uint32,t.TYPES.fixed32,t.TYPES.int64,t.TYPES.sint64,t.TYPES.sfixed64,t.TYPES.uint64,t.TYPES.fixed64,t.TYPES.bool,t.TYPES.string,t.TYPES.bytes],t.ID_MIN=1,t.ID_MAX=536870911,t.convertFieldsToCamelCase=!1,t.populateAccessors=!0,t.populateDefaults=!0,t.Util=((e={}).IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e),t.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,FQTYPEREF:/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},t.DotProto=function(e,t){var r={},n=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},i=n.prototype;i._readString=function(){var e='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;e.lastIndex=this.index-1;var r=e.exec(this.source);if(!r)throw Error("unterminated string");return this.index=e.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,r[1]},i.next=function(){if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var e,r,n;do{for(e=!1;t.WHITESPACE.test(n=this.source.charAt(this.index));)if("\n"===n&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(n=this.source.charAt(this.index)))return"/";do{if("\n"===n&&++this.line,++this.index===this.source.length)return null;r=n,n=this.source.charAt(this.index)}while("*"!==r||"/"!==n);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;var i=this.index;if(t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(i++)))for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;var a=this.source.substring(this.index,this.index=i);return'"'!==a&&"'"!==a||(this._stringOpen=a),a},i.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},i.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},i.omit=function(e){return this.peek()===e&&(this.next(),!0)},i.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},r.Tokenizer=n;var a=function(e){this.tn=new n(e),this.proto3=!1},o=a.prototype;function s(e,r){var n=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))n=parseInt(e);else if(t.NUMBER_HEX.test(e))n=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);n=parseInt(e.substring(1),8)}if(n=i*n|0,!r&&n<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return n}function u(e){var r=1;if("-"==e.charAt(0)&&(r=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return r*parseInt(e,10);if(t.NUMBER_HEX.test(e))return r*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return r*parseInt(e.substring(1),8);if("inf"===e)return r*(1/0);if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return r*parseFloat(e);throw Error("illegal number value: "+(r<0?"-":"")+e)}function l(e,t,r){void 0===e[t]?e[t]=r:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(r))}return o.parse=function(){var e,r,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},i=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!i||null!==n.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),n.package=e;break;case"import":if(!i)throw Error("unexpected 'import'");("public"===(e=this.tn.peek())||(r="weak"===e))&&this.tn.next(),e=this._readString(),this.tn.skip(";"),r||n.imports.push(e);break;case"syntax":if(!i)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),i=!1;break;case"enum":this._parseEnum(n),i=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete n.name,n},a.parse=function(e){return new a(e).parse()},o._readString=function(){var e,t,r="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);r+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return r},o._readValue=function(e){var r=this.tn.peek();if('"'===r||"'"===r)return this._readString();if(this.tn.next(),t.NUMBER.test(r))return u(r);if(t.BOOL.test(r))return"true"===r.toLowerCase();if(e&&t.TYPEREF.test(r))return r;throw Error("illegal value: "+r)},o._parseOption=function(e,r){var n=this.tn.next(),i=!1;if("("===n&&(i=!0,n=this.tn.next()),!t.TYPEREF.test(n))throw Error("illegal option name: "+n);var a=n;i&&(this.tn.skip(")"),a="("+a+")",n=this.tn.peek(),t.FQTYPEREF.test(n)&&(a+=n,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,a),r||this.tn.skip(";")},o._parseOptionValue=function(e,r){var n=this.tn.peek();if("{"!==n)l(e.options,r,this._readValue(!0));else for(this.tn.skip("{");"}"!==(n=this.tn.next());){if(!t.NAME.test(n))throw Error("illegal option name: "+r+"."+n);this.tn.omit(":")?l(e.options,r+"."+n,this._readValue(!0)):this._parseOptionValue(e,r+"."+n)}},o._parseService=function(e){var r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal service name at line "+this.tn.line+": "+r);var n={name:r,rpc:{},options:{}};for(this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(n);else{if("rpc"!==r)throw Error("illegal service token: "+r);this._parseServiceRPC(n)}this.tn.omit(";"),e.services.push(n)},o._parseServiceRPC=function(e){var r="rpc",n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal rpc service method name: "+n);var i=n,a={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),"stream"===(n=this.tn.next()).toLowerCase()&&(a.request_stream=!0,n=this.tn.next()),!t.TYPEREF.test(n))throw Error("illegal rpc service request type: "+n);if(a.request=n,this.tn.skip(")"),"returns"!==(n=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+n);if(this.tn.skip("("),"stream"===(n=this.tn.next()).toLowerCase()&&(a.response_stream=!0,n=this.tn.next()),a.response=n,this.tn.skip(")"),"{"===(n=this.tn.peek())){for(this.tn.next();"}"!==(n=this.tn.next());){if("option"!==n)throw Error("illegal rpc service token: "+n);this._parseOption(a)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[r]&&(e[r]={}),e[r][i]=a},o._parseMessage=function(e,r){var n=!!r,i=this.tn.next(),a={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(i))throw Error("illegal "+(n?"group":"message")+" name: "+i);for(a.name=i,n&&(this.tn.skip("="),r.id=s(this.tn.next()),a.isGroup=!0),"["===(i=this.tn.peek())&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(i=this.tn.next());)if(t.RULE.test(i))this._parseMessageField(a,i);else if("oneof"===i)this._parseMessageOneOf(a);else if("enum"===i)this._parseEnum(a);else if("message"===i)this._parseMessage(a);else if("option"===i)this._parseOption(a);else if("service"===i)this._parseService(a);else if("extensions"===i)a.hasOwnProperty("extensions")?a.extensions=a.extensions.concat(this._parseExtensionRanges()):a.extensions=this._parseExtensionRanges();else if("reserved"===i)this._parseIgnored();else if("extend"===i)this._parseExtend(a);else{if(!t.TYPEREF.test(i))throw Error("illegal message token: "+i);if(!this.proto3)throw Error("illegal field rule: "+i);this._parseMessageField(a,"optional",i)}return this.tn.omit(";"),e.messages.push(a),a},o._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},o._parseMessageField=function(e,r,n){if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);var i,a={rule:r,type:"",name:"",options:{},id:0};if("map"===r){if(n)throw Error("illegal type: "+n);if(this.tn.skip("<"),i=this.tn.next(),!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(a.keytype=i,this.tn.skip(","),i=this.tn.next(),!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field: "+i);if(a.type=i,this.tn.skip(">"),i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);a.name=i,this.tn.skip("="),a.id=s(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(a),this.tn.skip(";")}else if("group"===(n=void 0!==n?n:this.tn.next())){var o=this._parseMessage(e,a);if(!/^[A-Z]/.test(o.name))throw Error("illegal group name: "+o.name);a.type=o.name,a.name=o.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(n)&&!t.TYPEREF.test(n))throw Error("illegal message field type: "+n);if(a.type=n,i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);a.name=i,this.tn.skip("="),a.id=s(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(a),this.tn.skip(";")}return e.fields.push(a),a},o._parseMessageOneOf=function(e){var r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal oneof name: "+r);var n,i=r,a=[];for(this.tn.skip("{");"}"!==(r=this.tn.next());)(n=this._parseMessageField(e,"optional",r)).oneof=i,a.push(n.id);this.tn.omit(";"),e.oneofs[i]=a},o._parseFieldOptions=function(e){this.tn.skip("[");for(var t=!0;"]"!==this.tn.peek();)t||this.tn.skip(","),this._parseOption(e,!0),t=!1;this.tn.next()},o._parseEnum=function(e){var r={name:"",values:[],options:{}},n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal name: "+n);for(r.name=n,this.tn.skip("{");"}"!==(n=this.tn.next());)if("option"===n)this._parseOption(r);else{if(!t.NAME.test(n))throw Error("illegal name: "+n);this.tn.skip("=");var i={name:n,id:s(this.tn.next(),!0)};"["===(n=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),r.values.push(i)}this.tn.omit(";"),e.enums.push(r)},o._parseExtensionRanges=function(){var t,r,n,i=[];do{for(r=[];;){switch(t=this.tn.next()){case"min":n=e.ID_MIN;break;case"max":n=e.ID_MAX;break;default:n=u(t)}if(r.push(n),2===r.length)break;if("to"!==this.tn.peek()){r.push(n);break}this.tn.next()}i.push(r)}while(this.tn.omit(","));return this.tn.skip(";"),i},o._parseExtend=function(e){var r=this.tn.next();if(!t.TYPEREF.test(r))throw Error("illegal extend reference: "+r);var n={ref:r,fields:[]};for(this.tn.skip("{");"}"!==(r=this.tn.next());)if(t.RULE.test(r))this._parseMessageField(n,r);else{if(!t.TYPEREF.test(r))throw Error("illegal extend token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(n,"optional",r)}return this.tn.omit(";"),e.messages.push(n),n},o.toString=function(){return"Parser at line "+this.tn.line},r.Parser=a,r}(t,t.Lang),t.Reflect=function(e){var t={},n=function(e,t,r){this.builder=e,this.parent=t,this.name=r,this.className},i=n.prototype;i.fqn=function(){for(var e=this.name,t=this;;){if(null==(t=t.parent))break;e=t.name+"."+e}return e},i.toString=function(e){return(e?this.className+" ":"")+this.fqn()},i.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},t.T=n;var a=function(e,t,r,i,a){n.call(this,e,t,r),this.className="Namespace",this.children=[],this.options=i||{},this.syntax=a||"proto2"},o=a.prototype=Object.create(n.prototype);o.getChildren=function(e){if(null==(e=e||null))return this.children.slice();for(var t=[],r=0,n=this.children.length;r<n;++r)this.children[r]instanceof e&&t.push(this.children[r]);return t},o.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof c.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof c.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},o.getChild=function(e){for(var t="number"==typeof e?"id":"name",r=0,n=this.children.length;r<n;++r)if(this.children[r][t]===e)return this.children[r];return null},o.resolve=function(e,r){var n,i="string"==typeof e?e.split("."):e,a=this,o=0;if(""===i[o]){for(;null!==a.parent;)a=a.parent;o++}do{do{if(!(a instanceof t.Namespace)){a=null;break}if(!(n=a.getChild(i[o]))||!(n instanceof t.T)||r&&!(n instanceof t.Namespace)){a=null;break}a=n,o++}while(o<i.length);if(null!=a)break;if(null!==this.parent)return this.parent.resolve(e,r)}while(null!=a);return a},o.qn=function(e){var r=[],n=e;do{r.unshift(n.name),n=n.parent}while(null!==n);for(var i=1;i<=r.length;i++){var a=r.slice(r.length-i);if(e===this.resolve(a,e instanceof t.Namespace))return a.join(".")}return e.fqn()},o.build=function(){for(var e,t={},r=this.children,n=0,i=r.length;n<i;++n)(e=r[n])instanceof a&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},o.buildOpt=function(){for(var e={},t=Object.keys(this.options),r=0,n=t.length;r<n;++r){var i=t[r],a=this.options[t[r]];e[i]=a}return e},o.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},t.Namespace=a;var s=function(t,r,n,i,a){if(this.type=t,this.resolvedType=r,this.isMapKey=n,this.syntax=i,this.name=a,n&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=s.prototype;function l(t,r){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===r?t.unsigned:r);if("string"==typeof t)return e.Long.fromString(t,r||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,r||!1);throw Error("not convertible to Long")}s.defaultFieldValue=function(t){if("string"==typeof t&&(t=e.TYPES[t]),void 0===t.defaultValue)throw Error("default value for type "+t.name+" is not supported");return t==e.TYPES.bytes?new r(0):t.defaultValue},u.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"},u.verifyValue=function(t){var n=this;function i(e,t){throw Error("Illegal value for "+n.toString(!0)+" of type "+n.type.name+": "+e+" ("+t+")")}switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),t>4294967295?0|t:t;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),t<0?t>>>0:t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return l(t,!1)}catch(e){i(typeof t,e.message)}else i(typeof t,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return l(t,!0)}catch(e){i(typeof t,e.message)}else i(typeof t,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof t&&i(typeof t,"not a boolean"),t;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof t&&i(typeof t,"not a number"),t;case e.TYPES.string:return"string"==typeof t||t&&t instanceof String||i(typeof t,"not a string"),""+t;case e.TYPES.bytes:return r.isByteBuffer(t)?t:r.wrap(t,"base64");case e.TYPES.enum:var a=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(s=0;s<a.length;s++){if(a[s].name==t)return a[s].id;if(a[s].id==t)return a[s].id}if("proto3"===this.syntax)return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),(t>4294967295||t<0)&&i(typeof t,"not in range for uint32"),t;i(t,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(t&&"object"==typeof t||i(typeof t,"object expected"),t instanceof this.resolvedType.clazz)return t;if(t instanceof e.Builder.Message){var o={};for(var s in t)t.hasOwnProperty(s)&&(o[s]=t[s]);t=o}return new this.resolvedType.clazz(t)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+t+" (undefined type "+this.type+")")},u.calculateLength=function(t,n){if(null===n)return 0;var i;switch(this.type){case e.TYPES.int32:return n<0?r.calculateVarint64(n):r.calculateVarint32(n);case e.TYPES.uint32:return r.calculateVarint32(n);case e.TYPES.sint32:return r.calculateVarint32(r.zigZagEncode32(n));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return r.calculateVarint64(n);case e.TYPES.sint64:return r.calculateVarint64(r.zigZagEncode64(n));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return r.calculateVarint32(n);case e.TYPES.double:return 8;case e.TYPES.string:return i=r.calculateUTF8Bytes(n),r.calculateVarint32(i)+i;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");return r.calculateVarint32(n.remaining())+n.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(n),r.calculateVarint32(i)+i;case e.TYPES.group:return(i=this.resolvedType.calculate(n))+r.calculateVarint32(t<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")},u.encodeValue=function(t,n,i){if(null===n)return i;switch(this.type){case e.TYPES.int32:n<0?i.writeVarint64(n):i.writeVarint32(n);break;case e.TYPES.uint32:i.writeVarint32(n);break;case e.TYPES.sint32:i.writeVarint32ZigZag(n);break;case e.TYPES.fixed32:i.writeUint32(n);break;case e.TYPES.sfixed32:i.writeInt32(n);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(n);break;case e.TYPES.sint64:i.writeVarint64ZigZag(n);break;case e.TYPES.fixed64:i.writeUint64(n);break;case e.TYPES.sfixed64:i.writeInt64(n);break;case e.TYPES.bool:"string"==typeof n?i.writeVarint32("false"===n.toLowerCase()?0:!!n):i.writeVarint32(n?1:0);break;case e.TYPES.enum:i.writeVarint32(n);break;case e.TYPES.float:i.writeFloat32(n);break;case e.TYPES.double:i.writeFloat64(n);break;case e.TYPES.string:i.writeVString(n);break;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");var a=n.offset;i.writeVarint32(n.remaining()),i.append(n),n.offset=a;break;case e.TYPES.message:var o=(new r).LE();this.resolvedType.encode(n,o),i.writeVarint32(o.offset),i.append(o.flip());break;case e.TYPES.group:this.resolvedType.encode(n,i),i.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")}return i},u.decode=function(t,r,n){if(r!=this.type.wireType)throw Error("Unexpected wire type for element");var i,a;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(a=t.readVarint32(),t.remaining()<a)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+a+" required but got only "+t.remaining());return(i=t.clone()).limit=i.offset+a,t.offset+=a,i;case e.TYPES.message:return a=t.readVarint32(),this.resolvedType.decode(t,a);case e.TYPES.group:return this.resolvedType.decode(t,-1,n)}throw Error("[INTERNAL] Illegal decode type")},u.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return r.fromBinary(t)}},u.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},t.Element=s;var c=function(e,t,r,n,i,o){a.call(this,e,t,r,n,o),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},_=c.prototype=Object.create(a.prototype);function f(t,r){var n=r.readVarint32(),i=7&n,a=n>>>3;switch(i){case e.WIRE_TYPES.VARINT:do{n=r.readUint8()}while(!(128&~n));break;case e.WIRE_TYPES.BITS64:r.offset+=8;break;case e.WIRE_TYPES.LDELIM:n=r.readVarint32(),r.offset+=n;break;case e.WIRE_TYPES.STARTGROUP:f(a,r);break;case e.WIRE_TYPES.ENDGROUP:if(a===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+a+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:r.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+i)}return!0}_.build=function(t){if(this.clazz&&!t)return this.clazz;var n=function(e,t){var n=t.getChildren(e.Reflect.Message.Field),i=t.getChildren(e.Reflect.Message.OneOf),a=function(o,s){e.Builder.Message.call(this);for(var u=0,l=i.length;u<l;++u)this[i[u].name]=null;for(u=0,l=n.length;u<l;++u){var c=n[u];this[c.name]=c.repeated?[]:c.map?new e.Map(c):null,!c.required&&"proto3"!==t.syntax||null===c.defaultValue||(this[c.name]=c.defaultValue)}var _;if(arguments.length>0)if(1!==arguments.length||null===o||"object"!=typeof o||!("function"!=typeof o.encode||o instanceof a)||Array.isArray(o)||o instanceof e.Map||r.isByteBuffer(o)||o instanceof ArrayBuffer||e.Long&&o instanceof e.Long)for(u=0,l=arguments.length;u<l;++u)void 0!==(_=arguments[u])&&this.$set(n[u].name,_);else this.$set(o)},o=a.prototype=Object.create(e.Builder.Message.prototype);o.add=function(r,n,i){var a=t._fieldsByName[r];if(!i){if(!a)throw Error(this+"#"+r+" is undefined");if(!(a instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+a.toString(!0));if(!a.repeated)throw Error(this+"#"+r+" is not a repeated field");n=a.verifyValue(n,!0)}return null===this[r]&&(this[r]=[]),this[r].push(n),this},o.$add=o.add,o.set=function(r,n,i){if(r&&"object"==typeof r){for(var a in i=n,r)r.hasOwnProperty(a)&&void 0!==(n=r[a])&&void 0===t._oneofsByName[a]&&this.$set(a,n,i);return this}var o=t._fieldsByName[r];if(i)this[r]=n;else{if(!o)throw Error(this+"#"+r+" is not a field: undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+o.toString(!0));this[o.name]=n=o.verifyValue(n)}if(o&&o.oneof){var s=this[o.oneof.name];null!==n?(null!==s&&s!==o.name&&(this[s]=null),this[o.oneof.name]=o.name):s===r&&(this[o.oneof.name]=null)}return this},o.$set=o.set,o.get=function(r,n){if(n)return this[r];var i=t._fieldsByName[r];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+i.toString(!0));return this[i.name]},o.$get=o.get;for(var s=0;s<n.length;s++){var u=n[s];u instanceof e.Reflect.Message.ExtensionField||t.builder.options.populateAccessors&&function(e){var r=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));r=r.substring(0,1).toUpperCase()+r.substring(1);var n=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),i=function(t,r){return this[e.name]=r?t:e.verifyValue(t),this},a=function(){return this[e.name]};null===t.getChild("set"+r)&&(o["set"+r]=i),null===t.getChild("set_"+n)&&(o["set_"+n]=i),null===t.getChild("get"+r)&&(o["get"+r]=a),null===t.getChild("get_"+n)&&(o["get_"+n]=a)}(u)}function l(t,n,i,a){if(null===t||"object"!=typeof t){if(a&&a instanceof e.Reflect.Enum){var o=e.Reflect.Enum.getName(a.object,t);if(null!==o)return o}return t}if(r.isByteBuffer(t))return n?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return i?t.toString():e.Long.fromValue(t);var s;if(Array.isArray(t))return s=[],t.forEach((function(e,t){s[t]=l(e,n,i,a)})),s;if(s={},t instanceof e.Map){for(var u=t.entries(),c=u.next();!c.done;c=u.next())s[t.keyElem.valueToString(c.value[0])]=l(c.value[1],n,i,t.valueElem.resolvedType);return s}var _=t.$type,f=void 0;for(var d in t)t.hasOwnProperty(d)&&(_&&(f=_.getChild(d))?s[d]=l(t[d],n,i,f.resolvedType):s[d]=l(t[d],n,i));return s}return o.encode=function(e,n){"boolean"==typeof e&&(n=e,e=void 0);var i=!1;e||(e=new r,i=!0);var a=e.littleEndian;try{return t.encode(this,e.LE(),n),(i?e.flip():e).LE(a)}catch(t){throw e.LE(a),t}},a.encode=function(e,t,r){return new a(e).encode(t,r)},o.calculate=function(){return t.calculate(this)},o.encodeDelimited=function(e,n){var i=!1;e||(e=new r,i=!0);var a=(new r).LE();return t.encode(this,a,n).flip(),e.writeVarint32(a.remaining()),e.append(a),i?e.flip():e},o.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},o.toArrayBuffer=o.encodeAB,o.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},o.toBuffer=o.encodeNB,o.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},o.toBase64=o.encode64,o.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},o.toHex=o.encodeHex,o.toRaw=function(e,t){return l(this,!!e,!!t,this.$type)},o.encodeJSON=function(){return JSON.stringify(l(this,!0,!0,this.$type))},a.decode=function(e,n,i){"string"==typeof n&&(i=n,n=-1),"string"==typeof e?e=r.wrap(e,i||"base64"):r.isByteBuffer(e)||(e=r.wrap(e));var a=e.littleEndian;try{var o=t.decode(e.LE(),n);return e.LE(a),o}catch(t){throw e.LE(a),t}},a.decodeDelimited=function(e,n){if("string"==typeof e?e=r.wrap(e,n||"base64"):r.isByteBuffer(e)||(e=r.wrap(e)),e.remaining()<1)return null;var i=e.offset,a=e.readVarint32();if(e.remaining()<a)return e.offset=i,null;try{var o=t.decode(e.slice(e.offset,e.offset+a).LE());return e.offset+=a,o}catch(t){throw e.offset+=a,t}},a.decode64=function(e){return a.decode(e,"base64")},a.decodeHex=function(e){return a.decode(e,"hex")},a.decodeJSON=function(e){return new a(JSON.parse(e))},o.toString=function(){return t.toString()},Object.defineProperty&&(Object.defineProperty(a,"$options",{value:t.buildOpt()}),Object.defineProperty(o,"$options",{value:a.$options}),Object.defineProperty(a,"$type",{value:t}),Object.defineProperty(o,"$type",{value:t})),a}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={},this._oneofsByName={};for(var i,a=0,o=this.children.length;a<o;a++)if((i=this.children[a])instanceof p||i instanceof c||i instanceof b){if(n.hasOwnProperty(i.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+i.toString(!0)+" cannot override static property '"+i.name+"'");n[i.name]=i.build()}else if(i instanceof c.Field)i.build(),this._fields.push(i),this._fieldsById[i.id]=i,this._fieldsByName[i.name]=i;else if(i instanceof c.OneOf)this._oneofsByName[i.name]=i;else if(!(i instanceof c.OneOf||i instanceof I))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[a].toString(!0));return this.clazz=n},_.encode=function(e,t,r){for(var n,i,a=null,o=0,s=this._fields.length;o<s;++o)i=e[(n=this._fields[o]).name],n.required&&null===i?null===a&&(a=n):n.encode(r?i:n.verifyValue(i),t,e);if(null!==a){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+a);throw u.encoded=t,u}return t},_.calculate=function(e){for(var t,r,n=0,i=0,a=this._fields.length;i<a;++i){if(r=e[(t=this._fields[i]).name],t.required&&null===r)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);n+=t.calculate(r,e)}return n},_.decode=function(t,r,n){"number"!=typeof r&&(r=-1);for(var i,a,o,s,u=t.offset,l=new this.clazz;t.offset<u+r||-1===r&&t.remaining()>0;){if(o=(i=t.readVarint32())>>>3,(a=7&i)===e.WIRE_TYPES.ENDGROUP){if(o!==n)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+o+" ("+(n?n+" expected":"not a group")+")");break}if(s=this._fieldsById[o]){if(s.repeated&&!s.options.packed)l[s.name].push(s.decode(a,t));else if(s.map){var c=s.decode(a,t);l[s.name].set(c[0],c[1])}else if(l[s.name]=s.decode(a,t),s.oneof){var _=l[s.oneof.name];null!==_&&_!==s.name&&(l[_]=null),l[s.oneof.name]=s.name}}else switch(a){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:var d=t.readVarint32();t.offset+=d;break;case e.WIRE_TYPES.STARTGROUP:for(;f(o,t););break;default:throw Error("Illegal wire type for unknown field "+o+" in "+this.toString(!0)+"#decode: "+a)}}for(var h=0,g=this._fields.length;h<g;++h)if(null===l[(s=this._fields[h]).name])if("proto3"===this.syntax)l[s.name]=s.defaultValue;else{if(s.required){var p=Error("Missing at least one required field for "+this.toString(!0)+": "+s.name);throw p.decoded=l,p}e.populateDefaults&&null!==s.defaultValue&&(l[s.name]=s.defaultValue)}return l},t.Message=c;var d=function(t,r,i,a,o,s,u,l,_,f){n.call(this,t,r,s),this.className="Message.Field",this.required="required"===i,this.repeated="repeated"===i,this.map="map"===i,this.keyType=a||null,this.type=o,this.resolvedType=null,this.id=u,this.options=l||{},this.defaultValue=null,this.oneof=_||null,this.syntax=f||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof c.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},h=d.prototype=Object.create(n.prototype);h.build=function(){this.element=new s(this.type,this.resolvedType,!1,this.syntax,this.name),this.map&&(this.keyElement=new s(this.keyType,void 0,!0,this.syntax,this.name)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=s.defaultFieldValue(this.type)},h.verifyValue=function(t,r){r=r||!1;var n,i=this;function a(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}if(null===t)return this.required&&a(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&a(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!r){Array.isArray(t)||(t=[t]);var o=[];for(n=0;n<t.length;n++)o.push(this.element.verifyValue(t[n]));return o}return this.map&&!r?t instanceof e.Map?t:(t instanceof Object||a(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&a(typeof t,"no array expected"),this.element.verifyValue(t))},h.hasWirePresence=function(t,r){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&r[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},h.encode=function(t,n,i){if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return n;try{var a;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.ensureCapacity(n.offset+=1);var o=n.offset;for(a=0;a<t.length;a++)this.element.encodeValue(this.id,t[a],n);var s=n.offset-o,u=r.calculateVarint32(s);if(u>1){var l=n.slice(o,n.offset);o+=u-1,n.offset=o,n.append(l)}n.writeVarint32(s,o-u)}else for(a=0;a<t.length;a++)n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[a],n);else this.map?t.forEach((function(t,i,a){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.writeVarint32(o),n.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,n),n.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,n)}),this):this.hasWirePresence(t,i)&&(n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,n))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return n},h.calculate=function(t,n){if(t=this.verifyValue(t),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return 0;var i=0;try{var a,o;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),o=0,a=0;a<t.length;a++)o+=this.element.calculateLength(this.id,t[a]);i+=r.calculateVarint32(o),i+=o}else for(a=0;a<t.length;a++)i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[a]);else this.map?t.forEach((function(t,n,a){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,n)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);i+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=r.calculateVarint32(o),i+=o}),this):this.hasWirePresence(t,n)&&(i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},h.decode=function(t,r,n){var i,a;if(!(!this.map&&t==this.type.wireType||!n&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!n){a=r.readVarint32(),a=r.offset+a;for(var o=[];r.offset<a;)o.push(this.decode(this.type.wireType,r,!0));return o}if(this.map){var u=s.defaultFieldValue(this.keyType);if(i=s.defaultFieldValue(this.type),a=r.readVarint32(),r.remaining()<a)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+a+" required but got only "+r.remaining());var l=r.clone();for(l.limit=l.offset+a,r.offset+=a;l.remaining()>0;){var c=l.readVarint32();t=7&c;var _=c>>>3;if(1===_)u=this.keyElement.decode(l,t,_);else{if(2!==_)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(l,t,_)}}return[u,i]}return this.element.decode(r,t,this.id)},t.Message.Field=d;var g=function(e,t,r,n,i,a,o){d.call(this,e,t,r,null,n,i,a,o),this.extension};g.prototype=Object.create(d.prototype),t.Message.ExtensionField=g;t.Message.OneOf=function(e,t,r){n.call(this,e,t,r),this.fields=[]};var p=function(e,t,r,n,i){a.call(this,e,t,r,n,i),this.className="Enum",this.object=null};p.getName=function(e,t){for(var r,n=Object.keys(e),i=0;i<n.length;++i)if(e[r=n[i]]===t)return r;return null},(p.prototype=Object.create(a.prototype)).build=function(t){if(this.object&&!t)return this.object;for(var r=new e.Builder.Enum,n=this.getChildren(p.Value),i=0,a=n.length;i<a;++i)r[n[i].name]=n[i].id;return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=r},t.Enum=p;var E=function(e,t,r,i){n.call(this,e,t,r),this.className="Enum.Value",this.id=i};E.prototype=Object.create(n.prototype),t.Enum.Value=E;var I=function(e,t,r,i){n.call(this,e,t,r),this.field=i};I.prototype=Object.create(n.prototype),t.Extension=I;var b=function(e,t,r,n){a.call(this,e,t,r,n),this.className="Service",this.clazz=null};(b.prototype=Object.create(a.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){for(var n=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,r){setTimeout(r.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},i=n.prototype=Object.create(e.Builder.Service.prototype),a=t.getChildren(e.Reflect.Service.RPCMethod),o=0;o<a.length;o++)!function(e){i[e.name]=function(n,i){try{try{n=e.resolvedRequestType.clazz.decode(r.wrap(n))}catch(e){if(!(e instanceof TypeError))throw e}if(null===n||"object"!=typeof n)throw Error("Illegal arguments");n instanceof e.resolvedRequestType.clazz||(n=new e.resolvedRequestType.clazz(n)),this.rpcImpl(e.fqn(),n,(function(r,n){if(r)i(r);else{null===n&&(n="");try{n=e.resolvedResponseType.clazz.decode(n)}catch(e){}n&&n instanceof e.resolvedResponseType.clazz?i(null,n):i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}}))}catch(e){setTimeout(i.bind(this,e),0)}},n[e.name]=function(t,r,i){new n(t)[e.name](r,i)},Object.defineProperty&&(Object.defineProperty(n[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(i[e.name],"$options",{value:n[e.name].$options}))}(a[o]);return Object.defineProperty&&(Object.defineProperty(n,"$options",{value:t.buildOpt()}),Object.defineProperty(i,"$options",{value:n.$options}),Object.defineProperty(n,"$type",{value:t}),Object.defineProperty(i,"$type",{value:t})),n}(e,this)},t.Service=b;var T=function(e,t,r,i){n.call(this,e,t,r),this.className="Service.Method",this.options=i||{}};(T.prototype=Object.create(n.prototype)).buildOpt=o.buildOpt,t.Service.Method=T;var v=function(e,t,r,n,i,a,o,s){T.call(this,e,t,r,s),this.className="Service.RPCMethod",this.requestName=n,this.responseName=i,this.requestStream=a,this.responseStream=o,this.resolvedRequestType=null,this.resolvedResponseType=null};return v.prototype=Object.create(T.prototype),t.Service.RPCMethod=v,t}(t),t.Builder=function(e,t,r){var n=function(e){this.ns=new r.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},i=n.prototype;function a(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,a(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}return n.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},n.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},n.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},n.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},n.isExtend=function(e){return"string"==typeof e.ref},i.reset=function(){return this.ptr=this.ns,this},i.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach((function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new r.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},i.create=function(t){if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(var i=[t];i.length>0;){if(t=i.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){var a=t.shift();if(n.isMessage(a)){var o=new r.Message(this,this.ptr,a.name,a.options,a.isGroup,a.syntax),s={};a.oneofs&&Object.keys(a.oneofs).forEach((function(e){o.addChild(s[e]=new r.Message.OneOf(this,o,e))}),this),a.fields&&a.fields.forEach((function(e){if(null!==o.getChild(0|e.id))throw Error("duplicate or invalid field id in "+o.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+o.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=s[e.oneof]))throw Error("illegal oneof in "+o.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,a.syntax),t&&t.fields.push(e),o.addChild(e)}),this);var u=[];if(a.enums&&a.enums.forEach((function(e){u.push(e)})),a.messages&&a.messages.forEach((function(e){u.push(e)})),a.services&&a.services.forEach((function(e){u.push(e)})),a.extensions&&("number"==typeof a.extensions[0]?o.extensions=[a.extensions]:o.extensions=a.extensions),this.ptr.addChild(o),u.length>0){i.push(t),t=u,u=null,this.ptr=o,o=null;continue}u=null}else if(n.isEnum(a))o=new r.Enum(this,this.ptr,a.name,a.options,a.syntax),a.values.forEach((function(e){o.addChild(new r.Enum.Value(this,o,e.name,e.id))}),this),this.ptr.addChild(o);else if(n.isService(a))o=new r.Service(this,this.ptr,a.name,a.options),Object.keys(a.rpc).forEach((function(e){var t=a.rpc[e];o.addChild(new r.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(o);else{if(!n.isExtend(a))throw Error("not a valid definition: "+JSON.stringify(a));if(o=this.ptr.resolve(a.ref,!0))a.fields.forEach((function(t){if(null!==o.getChild(0|t.id))throw Error("duplicate extended field id in "+o.name+": "+t.id);if(o.extensions){var n=!1;if(o.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)})),!n)throw Error("illegal extended field id in "+o.name+": "+t.id+" (not within valid ranges)")}var i=t.name;this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i));var a=new r.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),s=new r.Extension(this,this.ptr,t.name,a);a.extension=s,this.ptr.addChild(s),o.addChild(a)}),this);else if(!/\.?google\.protobuf\./.test(a.ref))throw Error("extended message "+a.ref+" is not defined")}a=null,o=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},i.import=function(t,r){var n="/";if("string"==typeof r){if(e.Util.IS_NODE&&(r=require("path").resolve(r)),!0===this.files[r])return this.reset();this.files[r]=!0}else if("object"==typeof r){var i,o=r.root;if(e.Util.IS_NODE&&(o=require("path").resolve(o)),(o.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(n="\\"),i=e.Util.IS_NODE?require("path").join(o,r.file):o+n+r.file,!0===this.files[i])return this.reset();this.files[i]=!0}if(t.imports&&t.imports.length>0){var s,u=!1;"object"==typeof r?(this.importRoot=r.root,u=!0,s=this.importRoot,r=r.file,(s.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(n="\\")):"string"==typeof r?this.importRoot?s=this.importRoot:r.indexOf("/")>=0?""===(s=r.replace(/\/[^\/]*$/,""))&&(s="/"):r.indexOf("\\")>=0?(s=r.replace(/\\[^\\]*$/,""),n="\\"):s=".":s=null;for(var l=0;l<t.imports.length;l++)if("string"==typeof t.imports[l]){if(!s)throw Error("cannot determine import root");var c=t.imports[l];if("google/protobuf/descriptor.proto"===c)continue;if(c=e.Util.IS_NODE?require("path").join(s,c):s+n+c,!0===this.files[c])continue;/\.proto$/i.test(c)&&!e.DotProto&&(c=c.replace(/\.proto$/,".json"));var _=e.Util.fetch(c);if(null===_)throw Error("failed to import '"+c+"' in '"+r+"': file not found");/\.json$/i.test(c)?this.import(JSON.parse(_+""),c):this.import(e.DotProto.Parser.parse(_),c)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[l],r.replace(/^(.+)\.(\w+)$/,(function(e,t,r){return t+"_import"+l+"."+r}))):this.import(t.imports[l],r+"_import"+l):this.import(t.imports[l]);u&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&a(t);var f=this.ptr;return t.options&&Object.keys(t.options).forEach((function(e){f.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=f),t.enums&&(this.create(t.enums),this.ptr=f),t.services&&(this.create(t.services),this.ptr=f),t.extends&&this.create(t.extends),this.reset()},i.resolveAll=function(){var n;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof r.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof r.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(n=(this.ptr instanceof r.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=n,n instanceof r.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==n.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(n instanceof r.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=n.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}"proto3"===this.ptr.syntax&&this.ptr.repeated&&void 0===this.ptr.options.packed&&-1!==e.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType)&&(this.ptr.options.packed=!0)}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((n=this.ptr.parent.resolve(this.ptr.requestName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=n,!((n=this.ptr.parent.resolve(this.ptr.responseName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=n}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},i.build=function(e){if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(var t="string"==typeof e?e.split("."):e,r=this.result,n=0;n<t.length;n++){if(!r[t[n]]){r=null;break}r=r[t[n]]}return r},i.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},i.toString=function(){return"Builder"},n.Message=function(){},n.Enum=function(){},n.Service=function(){},n}(t,t.Lang,t.Reflect),t.Map=function(e,t){var r=function(e,r){if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),r)for(var n=Object.keys(r),i=0;i<n.length;i++){var a=this.keyElem.valueFromString(n[i]),o=this.valueElem.verifyValue(r[n[i]]);this.map[this.keyElem.valueToString(a)]={key:a,value:o}}},n=r.prototype;function i(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}return n.clear=function(){this.map={}},n.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),r=t in this.map;return delete this.map[t],r},n.entries=function(){for(var e,t=[],r=Object.keys(this.map),n=0;n<r.length;n++)t.push([(e=this.map[r[n]]).key,e.value]);return i(t)},n.keys=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].key);return i(e)},n.values=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].value);return i(e)},n.forEach=function(e,t){for(var r,n=Object.keys(this.map),i=0;i<n.length;i++)e.call(t,(r=this.map[n[i]]).value,r.key,this)},n.set=function(e,t){var r=this.keyElem.verifyValue(e),n=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(r)]={key:r,value:n},this},n.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},n.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},r}(0,t.Reflect),t.loadProto=function(e,r,n){return("string"==typeof r||r&&"string"==typeof r.file&&"string"==typeof r.root)&&(n=r,r=void 0),t.loadJson(t.DotProto.Parser.parse(e),r,n)},t.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=t.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=t.populateAccessors),new t.Builder(e)},t.loadJson=function(e,r,n){return("string"==typeof r||r&&"string"==typeof r.file&&"string"==typeof r.root)&&(n=r,r=null),r&&"object"==typeof r||(r=t.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),r.import(e,n),r.resolveAll(),r},t}();var Io,bo,To,vo,Ro,mo,Ao,yo,Oo,So="NotifyMsg",No="SyncRequestMsg",Co="UpStreamMessage",Po="DownStreamMessages",Mo="ChrmDownStreamMessages",Lo="DownStreamMessage",wo="ExtMsgData",Uo="GetQNupTokenInput",Do="GetDownloadUrlInput",Go="GetQNupTokenOutput",Vo="GetDownloadUrlOutput",jo="ChrmInput",ko="ChrmOutput",xo="ChrmPullMsg",Fo="RelationQryInput",Bo="RelationQryFilter",Ho="RelationsOutput",Yo="QryRemindListReq",Wo="QryRemindListResp",Jo="CleanHisMsgInput",qo="CleanMsgBatchReq",Ko="QueryChatRoomInfoInput",Qo="QueryChatRoomInfoOutput",Xo="HistoryMsgInput",Zo="HistoryMsgOuput",zo="SessionsAttQryInput",$o="SessionsAttOutput",es="SessionMsgReadInput",ts="DeleteSessionsInput",rs="QuerySessionsInput",ns="QuerySessionsOutPut",is="RelationDelBatchReq",as="DeleteMsgInput",os="SetChrmKV",ss="SetChrmKVS",us="ChrmKVOutput",ls="ChrmKVSOutput",cs="QueryChrmKV",_s="SetUserSettingInput",fs="SetUserSettingOutput",ds="PullUserSettingInput",hs="PullUserSettingOutput",gs="SessionReq",ps="SessionStates",Es="SessionStateModifyReq",Is="GroupUnpushQuery",bs="GroupUnpushSet",Ts="GroupUnpushResult",vs="SessionStateModifyResp",Rs="TypeUnpushInput",ms="TypeUnpushOutput",As="GrpReadReceiptMsg",ys="ReadReceipt",Os="QueryReceiptReq",Ss="QueryReceiptBatchReq",Ns="ReceiptResp",Cs="QueryReceiptBatchResp",Ps="GrpReadReceiptQryResp",Ms="SessionTagAddInput",Ls="SessionTagDelInput",ws="UserSettingNotification",Us="ReportSDKInput",Ds="UltraGrpPullSes",Gs="UltraGrpPullMsg",Vs="MsgChangeReq",js="ModifyMsgResp",xs="QueryMsgChange",Fs="EventChangeList",Bs="MsgChangeList",Hs="MsgQuery",Ys="MsgQueryAck",Ws="OperateStatus",Js="OperateStatusNotify",qs="SetRtcRoomIdInput",Ks="CallInfoUpStream",Qs="CallInfoDownStream",Xs="KvInput",Zs="KvOutput",zs="ReadReceiptMsg",$s="ReceiptQryReq",eu="QueryReceiptResp",tu="ReceiptCntQryReq",ru="ReceiptCntQryResp",nu="UpdateUserSubReq",iu="UpdateUserSubResp",au="PullUserSubReq",ou="PUllUserSubResp",su="PullSubDataReq",uu="PullSubDataResp",lu="SubDataDetail",cu="QrySubDataReq",_u="UserProfile",fu="SetUserProfileResp",du="PullUserProfileReq",hu="UserProfiles",gu="UserProfileInput",pu="UserProfilePermission",Eu="SearchUserProfile",Iu="ChannelsInput",bu="ChannelsOutput",Tu="MultiChannels",vu="ModifyChannelsInput",Ru="ChannelsQueryInput",mu="ChannelsListResult",Au="ChannelsInviteStatusInfos",yu="ChannelsUserInfos",Ou="ChannelsJoinedInfos",Su="ChannelsMemberUpdateInput",Nu="ChannelsMemberResponseInput",Cu="ChannelsMembersInput",Pu="FriendInput",Mu="FriendsInput",Lu="FriendsCheckOutput",wu="FriendProfileInput",Uu="FriendProfileOutput",Du="FriendQueryInput",Gu="FriendsListInput",Vu="FriendLevelSet",ju="FriendUserInfos",ku="FriendInviteInfos",xu="ChannelApplyInfo",Fu="AddUnpushPeriodInput",Bu="DeleteUnpushPeriodInput",Hu="QueryUnpushPeriodInput",Yu="QueryUnpushPeriodOutput",Wu="MsgReadEvent",Ju="ConvertMsgInput",qu="SpeechToTextInfo",Ku="ConvertMsgOutput",Qu="SpeechToTextResult",Xu="TransReq",Zu="TransResp",zu="PullModifyMsgReq",$u="PullModifyMsgResp",el="SessionQryInput",tl="SessionsOutput",rl="SetUserStatusInput",nl="MCFollowInput",il="RtcQueryListInput",al="RtcKeyDeleteInput",ol="RtcValueInfo",sl="RtcUserListOutput",ul="RtcInput",ll="RtcQryOutput",cl="RtcDataInput",_l="RtcSetDataInput",fl="RtcUserSetDataInput",dl="RtcOutput",hl="RtcTokenOutput",gl="RtcNotifyMsg",pl="RtcPullKV",El="RtcKVOutput",Il="RtcQueryUserJoinedInput",bl="RtcQueryUserJoinedOutput",Tl="RtcViewerJoinedOutput",vl="RtcInviteInput",Rl="RtcCancelInviteInput",ml="RtcInviteAnswerInput",Al="RtcEndInviteInput",yl="BotInput",Ol="BotOutput",Sl=function(e){var t=0,r="";e:do{var n=e.charCodeAt(t++),i=n&xn,a=15&n,o=void 0;switch(i){case Vn:var s=a>>2,u=3&a;if(0===s||0===u)throw new Error("Data parsing error,at "+t);var l=Wn(e.substr(t,s)),c=Wn(e.substr(t+=s,u));if((l=r.length-l)+c>r.length)throw new Error("Data parsing error,at "+t);t+=u,r+=r.substr(l,c);break;case Gn:if((o=Wn(e.substr(t,a)))!==r.length)throw console.log(r.length),console.log(o),new Error("Data parsing error,at "+t);t+=a;break e;case jn:o=Wn(e.substr(t,a)),r+=e.substr(t+=a,o),t+=o;break;case kn:r+=e.substr(t,a),t+=a;break;case xn:if(a>10)throw new Error("Data parsing error,at "+t);r+=e.substr(t,16+a),t+=16+a;break;default:throw new Error("Data parsing error,at "+t+" header:"+i)}}while(t<e.length);return r}("upackage Modules;\nmessEH4kprobuf {\n EJ8sSetUserStatusOutputEW5QV optional int32 nothing=1;\n }I41BaGI41CbInJ3111I72Mistring stEZ4I416EUJbubIA14dId=2Ib1GaSER6Ie2IhrepeatedI618guserid If2II41DIm4rkVoipDynamicI62Egquired I116n engineType = Im37Ea9Ig27jchannelNamEb4Iq35IN4IEb7iExtra = 3IK2RIM3DIl1GadEa6cKeyIQ3IjNotifyMsg IJ3LatIC3DIn4Ce64 tiI43UermId=Iw2HkSyncRequestIv1Mh64 syncTIW16IB5Gkbool ispollIe14I32IEX7cwebI026ERIjPullSend=4EWMdKeepIH84a5Iy3LgsendBoxID34Id24b=6EcLibroadcastEe9a7EeLcendIl37a8IH2KucompressioEnabled = 9IS5GiUpStreamMEG7IO7LbseI814cnIdIfARglassnamIZ7BEZHfontentIYA8I68IkpushText = Ie5GEY7fappDatIdB4Ig57IWFGbtoIbG6ds = Id5MfdelMsgI257IY5GIDC8Ea5Ir35Ia5GIP46iconfigFlaIN94IU55Ig1HlclientUniqueI356a0Il1MfextraCIa49a1IADGdPushIbF6Ie44cExtEb4IIDNdbusCIPG6Eb4In5NhsystemIdEZ4Ii4GEZ8lenderPortraiIp14a2IaFMEF6cBitIw54a2IbMHI13AI2OMetitleI5HMIrK4otemplateIdNoUseIGHPIW44IL35Ig9RfConfigIh24Ij9NIl1AIm98IG3CdDownI3DDbs IrPFEYHe listIBDJICJHIfILffinishIIF5IS3GI7HNIX3JIj18I084EZ7IyIMmcredibleStartEg7IPDMEg8bEnIWI8IUDGIWIPIBJHeytes Eg8bedIuF7I9JHdChrmIC6YIG16I06zIv2KItOHIv2MI665I39TISUNdfromIPJ6Ix2JIgF7IHX5IAU7IRCNegroupISCCIENSIt87IENQI9M9I95DddataIi8EIg5GIfb5IZ8JIbR7IIZ7IO8GI327amIUM7IvLJh32 direcEI4IqLKEZ6lplantform =1IqHMgisRemovId75IjLOesourcIvI5IKEMI8OIIpHNI8OGIMEGI3JEEc8IIEJIaQGa1If5GIKPLIm5NIKPEInRMcextI4j6I4A4Is57IbUSIFPKc32 IeA5bUnIO24IGP9IqPVIlNNgconvertIW36a2Iw5GfExtMsgIbE5cextEB8c= 2IqNHEgBIUmIIjd5aqIaECIDeJIXHCIS14eenum I5FCIQ16fPERSONIC1AEG6aSIUFAeGROUPICFAdTEMPEJ8Ib37oCUSTOMERSERVICEIoEAfNOTIFYIXEAbMCInf8cMP=I687eULTRAIJ18I9D6IyLDkreateDiscusIfe5IeuKI867IMH7IVnHI61GIgoTI3t4I51JI256gInvitatIC2FICuKIq84I81HeLeaveID19I9tPIAu7IC2RcEviI6I5I71LIA2BI51KbReIm44IA2SIP5WEx8bfoIB3zI314IN6MI1QJINxUIZC5IimOIwxDIeQNeadminILS9IgQ9Ic7EhfirstTenInHAIoQJg32 openIwI9IJC5I64NMa31FI71Depage I6hOdnumbIi75IWiHIW1CId5FIJ37IA6IIg47I9B9MR01Ieotal Im1JbMeIC24ID14IPARIwtSEW4MY41EEYKI0nBIE7NeextenIwF4IfaKaGIEO4Il26Jy5L1IW1CIy5MIk4BbmeEe5Iq5oMKE17IHEwI31BIeKTJ07O1IE2FbSeMc217II3vI419IJ3MMH41NI2T9dFileIzSBdIMAGIkR4Iw37eAUDIOId3AdVIDEEF4IGA7cFILEi4I7H7eSIGHTIhGAlCOMBINE_HTMLIUGKlGetQNupTokenI54LIU29MiE1NIl57ckeyI1lQjhttpMethodIWxQhqueryStrIj56IhfNburIXA4IXfNMB816IgtMcsizIVtKIqi7bpTIY36I5X5Ic4HkdownloadUrlIg4iIRAGIg4Te fileI5PCIA2FI0s4J82Y1I72GIi5OMd01NIi56MX01JIi5CIKATILDPMKE15eadlinIY3RetokenIa3QcbosId15Ia3QfbosDatMH41KIMp8batIjl4c5;\nEVLfosskeyIxF5MmC1NhossPolicIH64MUH1NfossSigIg24IipNiossBucketIt67c9;\nIxtMi3CredentiIlN5MXH1Oms3Algorithm =MWH1IEc9IY47IjvPa3IV39MQH1Pa3IV34eatureIjvRbs3Ia3DIjv4MUe1NicAuthorizIQj5MoI1SbtcIQw7fSha256IwvKEhAIl38IB6NcstcIb2EIC6OeminioId2GI7w8EjLIf2GIGwHEjCIh27IFwHEaCIj2DILw4MaR1MIzH7Im24IMX5ISwJIGAAMnK16INwLINLGMhf1UEeAIEUNIRKBIC1ymAdd2BlackListI8qWIOVEIAqAhmoveFromJB111aQISS4I61UImYXI61EIneMID2DIivLI319M0r1KIL3eiBlockPushI11SgblockeeI41MkModifyPermiMC11HIjqSI29IMdJ15M001KEQ7cfo MDK16IuB6I31MICeSIHfSIR19M531WIFzPIcmMcHasIc5TIsjWIu35I714dCodeIe1TI24MEV9IyV5eresulMPT19IJi9EbEI416ME915n_SUCCESS = 0x0IYK7EQ6fFAILURIEi4c0x0MG21JcrmIIrCfMbL1NI5yMbrmIo7hMni1KIXmAMrI1MdjoinM6G17MnO1NMHC15M0d1Qc32 I5u6cCouMAU1CM3O1GjhatroomBanIkC4M0d1Nh32 whiteIAG8IUj9IU4GdPullMF02qMKQ18Il26IR4JI2z4IU16IKf7ML02LM7c1KMp01HIi2BcNewIG7MIE28MIe1nM052VkRelationQryMMK1LMsC1QM9V1HIp4PMDb16MTk19IH9JIlK4drderIC9JM6527hEraseMsgMLX1AMIm1MM2R1AI89GIS6PIesMcqryIfsCMgB1IEU5MaB17Eg7Mnd1MdbotTI457McQ1HIB6BgFilter MRD1MIC6zIe5BMeB19MyZ1FbagMrv1KI867fTagTopIOyQdpageIfp8I26TI3FKIA48MbB1NEV8IwQ5binISSAIh2IbFiMFw19IPAMIEF4IOANIBFRa MJr1bIZ4eI34KIUUKMCR1gIcT9Ix3GMPt1Iemsg =IiNMdreadMKC27M501ObunEb4IiN5Is3PMZk1DMw61McverIVQ4MY02NII28cminIj16M4E2PIj1AIQENbUnIR37MrK16E87MJs1PIs16bMeIu18IdwHIv97bBoM2E2AMOL2DIn1DIWaMMyu18IqNMcmsgIC66IYFMIb26Ip34Mi31PM8z15I4s7IRQHiQryRemindIlT4cReqIe2NMl02AIlXOIp7DI7EMIH37IUOPMZ917Ie2WbspImGGIZ7PItDSdReadIJ25I1EoIsCJM0R1NgtargetIMkK19IYWDgleanHisIy25IEKAI71TIE27Mr52SIE27MJ02KI2E4I845I29DIQ7VIWZIIy24hMsgBatchI59AIMRCIW3GbinE64IT6JgHistoryImI7IWnSID4IIB4PIO6GIm9BIK6AI92PcsOuIdQJNSN231II2FbhaIc44IKkSMCM2HIjMMMCM2IIoMGIzRPb6;IzRcITVHMM215hChatRoomMZf1VI9Z5IcZOI8Z5IZq9Ia1SMms2SIbS4iTotalNumsIV6CIvb9brmMSj16IIT6dnfosITsOEe7IynLMfp27IlUNIoz5M8q1IgPFollowInBSMp32CExJIqusaMMa216Ieb6Ih5IbMCJV1U1Ma41SdmpidMK238Ma41SIZGJI2tDIf6JMIt2HIzc8Mkn17cUrlMMt2HM411EITd7My73DdarchIO34Im4PIS24IO3Ocid=Ie4IIM18I96ZIQ1AMxu18I76CIKDJIew5Io2PIn48Io2NIe65IM1OMIr1TMv93DIn2UIbMIIvSEM7l2HIgOHMV43cIjrCIOxnI4TKI5MhItfKggnoreCmMDv2AIvQLbsgIqQhIM7HIoQEI4TNImQ6IMnNJkQf1IjQsMo127dsAttMa61FMgN1gI61BMbp1SeinboxMSC1QMVW27EaAIr5JIlA4IDR4Irh6Ido8MyE3IIL26cMsgIfh4IR3LIghfI1lAMqM2UMuz2SIGfUIo2EM7O3rgDeleteSIK67M4W1LMh928IRH4MlM17M8X1LEeCNrR2E1IWzQI25uIQa5Jw371IC1DeOutPuID1vIM6EIR7rI1t8cDelIpnFM1B1HaOIDR7breEG6M8B1ObclI7p6IbPKIE1GIeYMIMrCMb03XI5sGMO52RIm7CIcFHIN56I5SOMMJ1ZI33OIfF9IyO8Ih18IFG4Ic74IbArI81AIpUMMV61FME31IIJN4MOU1NM323CIrzLlhrmKVEntity IH7MMJF26IGFNevalueIw1PMT539IQSMInX4estampMUM2RInl5M5U1MM5F17MUJ1KcSetIW36ImIIIs3BeentryIKCOabMof36IY3JMvY3GgnotificIaD8Io3GI4AJIwNJIq27bS MQU1HJr2P2IAB6Ju2o2IR26Men2OIt2FbieIvyBIv2FiFullUpdatIICNMz51EN9W1O1IV3IbSVIeC6IhFDIDDPMKc2YIljDIb17I75SET7IE58grrorKeyMB41OIq2HdkeysEI7MN41OIc1GIPLMIMJDIrIFIQ25MI22OMr717IPHKIMJIIgTMIa7JMI34IMt447fettingIKwRIv67INwOIdM5Izo8ICrKIO5AI4jJI82CISlSI92OIg15greserveI92MbupIwC4I92RI7z4II4rIg1EI92OMDf2FI32WInBMIa2Chtem itemMdy2NIi2BM8d1II91FMAQ1UMNc3iIiVMMkb3GIiH6IhV8Mhb3MI338Meb3JMU51AMdj17IuiGcTagIU35dtagsMmq2JEc7MYe1JMoJ1IEuJMD925MFk3AIqAUIT2EMAA26I334MXb18IY1OJUqU1Ic37MLz1GI32CI955Ii25EA5MK81hIN3OIx9KEWCIW35Iwp7EHAIweeII8SI3fTIOVCMlN25IO2HMC637esSileMeD2CbIsMc326I627cTagIi1BgAutoTraICt5Md01OIb15MqW26IVAPIY9nIeMnMdR25Mjg36IcQ5IzRNM5j3EI71RcSetI41eIqFHbunI414dLeveM6I3MIe1AgResult M1u1WM0u1hIF2TMiA1OIH7DMgt1BIXPgIDRGIx3HIOA4Iw36NMC101IucAIt3fIU9WIlBHIm2AI4WZIyZOIQ4XmGrpReadReceipMrV4DM6J2EIXy5Mke4OIGLHIa1QMX125M771HJd131Ia1BMTW1rMRb4AM2e4UMrJ1LMvK47dreadIKM6b4 MLO2MIc35ds= 5EW7M5H3HcromMtB3AIOiHId37IA5AIg3hIBFJIXcMMMj1GI83KMpg2PMnV2AMlg2MMFb17MPR2bMQE2JIg58MqI2NMRO25MkI28b EZObSiMIC25MHF3OMZP2CMcI28Mbv3PIFpMIr67MDJ1OEaCIChGIS4PIi1TJW871MxB1NIX8iIlEEI4B7MbH2IIaBEbspIYY5cresIhtXMEP4KM711DM5117MlY4OIf7BMoT1MI87EI03UEb9IYo9J53F1Ml62IIw1LJA8q1IC7LMXa25IV5UIt2VMtO1XMpO1TMQj15aCM2c1LMpP2AEW6Mn34GIZ27Iuu4Ec5E95Miq4PMmd16dListMic2PMLe17Il15I3tGIl1CEe6In17Mtj3IIoTIIVbLI548MdD26cNumMcA1JcGrpMak17Im15MuL27IfVKEdCIrYLIoM5MuE2TMfj2EIveJfTagAddMg81iIAyRMn81uIC1DMq21OILZRdnameIzTKMOA39Ik45Mn65OcTopMQD26IP2McDelJd482fDisTagI0eQIf4BMU81NMuS15MFS18NTE111IHQEgportSDKMxl1SgsdkInfoMlo1KI017Mlp1rhUltraGrpM5E56M6718MrF3ZMY93aMrD1IIm1BMbH3hMdN1pIC24ehangeM2q2QMwr4TIlQII9sGIEtJM5K4NfmsgUIDMAG1JI0PGM203qM0t4HMJC2HIyx6IqK5IWM9I7RGEZ5I16NMx33NILeNI569Ih7nI0B7eeedCoIdYPMhm47fnlineTM4e1MI97II3JHeEventIh26IrS5IoGFEVBNf3501ehasNeML845a3IIsNIg2GInDIIL4BIPt6IF3NMlA1QeinessILZLMaM3QM6L1aMhY3IcngeI217MAw3OjriginalId MVw1PEa8MfQ3NMhc39hcondaryIMbQ3KI657eAdminMlV5OdaddiEG6dMarkIMt6Iv2MgperatorMCQ5MMlU17bubIJ66M7N18IqBMIw29Ed8MTb5NM0736bMeMm84BIcRGcextMXu37ItyMMoB3AMN45KIBm6eeventI8m7MV846IkLLIyCKI8GAIwCzIxCHI52LMS33oMJd1ZMlW1MMvx2EIfBJIEONMvd1PIFOAIWBNIFODIVBqeisDelMSN3JJLBK1MJP3HIMBxIsk4MA046ISBlIo8FMMV1CJn891MQn49Id15IZ15MBT25M2d45Iz85c //Mts4HEjFItSLIT8AMqs2OIW99MyP2rIO48cAckMWE3oIi6EhnotExistMvl58IlWHbOpIg94heStatus Mx21XInQTMQN1NMXB48M4w3NMaR2bIh2DMTF27I0j8MWU2ZILRHMtF25IkN8MXP39I859In17Msy2CIyW8EcIjSummary suE86c= 4IjKHIJ1CNi81N1IazGMfz2NIH68M5v2MEF4ISiAI634Eb4IJ6JIm37NyB1T1Mu23WIF3DMi93FdtRtcMVL35MK31MMap48brtEc7M402LI71AMBL4tcCalMoB55M8Q28Mna2QIgHPddataItt7IdxIIY18IpGAJa161ILKIaaMTz25Mk84IbKvML41RI6oGEvEMNk1SIo17IvJJIp14MaD3REV7MZg2RMc12UMMi1SIXzJIJRyI1PYMyR6LbrtIrN8MRk5OcndMEY7IXUHMCn1MMrt3TMAx1jMGn3ZMhQ1GMm71NMML1LMGN1CMJL1CMch1LMcQ1BIB4JMmL1BM4R1HEX5ILzNMU54WM1W3EMra1OMqI5AIVwLimentionedIH7QcCntIK7DMQx2qMVH2RIeARMxg1LMwg1RIk28M2e1IM9S17Ir64Mkc46MGf3LEbAMZZ1nIrP4MSK4RbtmMEM1LMyk26MKL15bubIi5JI6l9MSJ2GMtV2ChubDetailMlg68ME81NIUbSMCg27cxpiIKY6MwN1LIg19MHj6NMni68ImMKIl3FMM54JIG3OMQv5NcubTMPv5FMwa2HIS5OM6o2aM8o1CIa1IbUlIa1AIH3PIwz5IAkEIA2PMSC1WMnq1dMyQ4JcullICNKIe2CIM6xInADMOw2NIs69I9AaI9BQI93HMrU15fubDataIs7WMFT1SgneedAllMO668Iq5YM1l2LID29IV8IER7IQ57IX8aM3L1dJb8J1Ik2EMNz6ScStrMmu4RIfGBMKc2HIb16IQf5MzM4QIb99IClJI317IJLLhplatformMqM4CEbHMlJ3RIF6HINYIcrySI8ASISNxIxEGgProfileIdJtIuXGI929IP17Ih45MPq55If17InUIEgGcExtEjAILPHEkCMx63iMNl2KM733JIX17MOd1QM9C3iIUYIpcensorFailedFielMqD15MB13PIH29Mzr1OMnJ5QI11BMjf6HI68CII8CI91UM3u3sI31BM0L5AImDNEWAIB1UInytMhA46IBCRM4A29MKa6AMIC6NMyJ7MMi41YMwJ1ZIsBCbseMHz15ILDccextIHDFIx1IdBaseEj5abE98MIE2QIMH7MLH4IIE1GIE4MMV625MCS18MmS1NbwnIPpNMyH5JInNMMyH5EIrNIIy68Mv12PMoC15MHC15MVr1TafM1h66Mph5OMpa4OIiB4hrocessCoMLP35Ia6NgsJoinedIP55Iiq8Ig6MEn8M3E68MpW4DM8a1GkFriendInvitIt66bfrEHFMOa1IEq6IX19Eo6EF9MkC5II1KSMpy67IbrCdultiIA38IQvgI74HISE6M2M2EMG12HJBFR1EZ9dQuitIe18MSE27IJF8It47Mec1RMrm2QIcA8IehDMt51DIv1IIb3FIHd7Eg4MKD5QMR345IwnPEW5eWhiteMG13PEY4cAttMU316ITETM5d17JL6Q1If18jPageParam MbU67IC6NbidIA6QbroMJE67M2t2OM9O5AI7LPID2BIDeMMyr27IAwdM172hMZW6EMK038MPX4NMu628I73JML657M1F3AI51FIOE4IMhEMpy1FMwk59Iu6kIgU4IjULIQJ4MFv58INK4MhT5MEfHIqrDIV1NI7K8IN1PIeK9IF1ZIvNAIH1PIUOBIJ1EIW2RIpZOMEP2FIm5HI214cExtIbX8MKJ2QbpTMGJ2TMAH7EMfp4RIOJLII2KIf9LIPE4ImyPMop5BMBD3UdNickMkS6UMoD2AIR3QfremarkIA17MFf4LcisBIgL5MKm7NbanMDT7VMAQ58Mnp27Iv4JMAp26MnF16JfLS1M8p1WIe5PMol7OIe5CMnE3NISSDMvy6OI5DCI14eIdkcIMlSIdkDMjC4NIdkKIkeOIECCI0e8M7A4MIgJNI48uIWHAILD4IMeBI2NOEZ9binI724El8ME91NMzQ48I4UMMTV79I9UTIoF5IL8BMet7KMI715M8g5OdapplMef28MUI2GIT3HIil7IT37MZS7MEa7Ion8MKL7IItEDgResponsJvET1IAD8IhU8Mo02OIjV8IoEPIK89M0X4KIZb8I887MBj6RIS6EIY4QNX01T1M6T6HMH91HIbr8M8A5uMfd3XMHD28Ix1MMGz5NET6ES7IGYGI41EMZO8TIsWPICzKMEw6OIDz6I73OMqU7SI55jIU1JeCheckIg4SEXCIibPEhIIt7tIkJ9Iq2NMTG1JMqG2oIHYDInQkIM2PMxf6TMI21LI1ANIEuQM0l37EW4IGnNIlmPIkJMMN516M6q5BII2IIDjuMh328M1156MtV3TIA2AIxLPIuC7IkfqIFkEInLNIFkEMmV3GIY8PIRS7INKNMhB19I55lMhd5LIs2UI05MMBo4CI5EQMI13NITJDI15NIaM7MTu3MIb7DMaa3HIYI7MNu6IJ6KF1MGA45cSetMp01NMkA47IrJOMy41GM051VMC12lIwDEIOyHIREFIcMVI2AAIB1NIZABMq01REi6aAIMe4MzC35I25MIse6M7X6SIC8DIpVZJTz71M6A2GIrK5MmR18MBO1MMWS1QIbmXIWoBMlq1IMAC29I02SID1AEl5MDS1CI22XcoptIcoGIFfJIN75MmZ2DMnA1WIsG6MoJ6OM9289MPC38IW3WIh2EIS3OIH6PIPVGMnY1TIGwNIW1JdFullIQwCIoEIIGB4Mf736IVCLMMb39IqD5I3JQIVCIIXGJID85If1SINS6MX68CIIRaIn1HcAddM5U46ePerioMNq2TMIs6CMZc4MispanMinutMRD55IOWMIBM8MlY3OgimezoneMTI5QIp2XMkJ7cJ9191I91CMav1SbisM4Q89MzC2OIf5BMFU5NIf5DIUWMIf58MGo8OIf5AMje2JMPg59J7wU1MHp2TMHh5GIK8HMWd27IoCSN7D4U1M1n2DIFcMMuB4CM4s1GMfD4GM5D46MvH1IMuX86MUi5OMpP39Mah35Mda1TMBi39I5PNmSpeechToTextIEa4IU5lMW028ebjectMwJ9VMJ99PIqB7fampleRMnr7MM8Y3AdnelNMPE88IsmNfformatIthQMJN78Mg81II469M544SI56jM6C19I76TMRi1MIQO9MrS7CIe6JIJ17M6v4KdransMvI2JEO5I085ctraEA6MWe2QcmodM5H3LMm396dorceM9658IYwHI427MDb2IEP8IV34Ic36I42dIW1HIusREe7Mr446IDoNI514IehUbteMfc2SI315dFileIBh6MHx7OMBu85aLMKd15IBBNI8M6EZ6MBU7MMaq65aSMNv86IKBKIU5CIP4pIN3CICBEIM3UMu44TEZ6IiFNM5E26M9B8NIp3BM7d1JMIG45MTA4Acq {Mxq4IMoH77MvN4AMMh4dIvA9IJA9MhZ3AM3X2LMgC4KMk53AET8MWI27ICRMdnextMI65FMsH9hIF3GM8n2HMno5dIm2AIXKLII4DMrF4vMwT47MNa7OMCe2WM8U7UII4DMbY4HM121GMhY4PMJT1NEU7ET7MwT57Mj82xI17BMGJ9uIN2ENTf3N1MGR4QI37MMdr6HMxY66IBu6EB5Mx12LEcBIIALMhH36ILPNM0K26I3d6IeeMEZ7cMeCMpr4RIGh4brTMnu6KEW7eutOffEX5ITJGMVK7EMGw85EJ9IeJCM2b55Iqx4Mua5BhKICK = 0IL16eREFUSMLh8BgCOEXISTMFB9HbTaIb74I91BgROOM =1MhH27MSB99Myx5PMu3AWMus6CI9HDMp277IXwVMtN86ICpHbtcIbs5M8K1GMXA7LI01KcKeyIxv6M8L1Sdkey=EzKeValueMuh3UMo16ZIN1FMbB1FMcv4MMup4HII2DEa4I3G4IY1PMII8QI52CMpZ25M6u4OMmd85MVr4HMb58GIVL8Ii2MdroomMD52EEeCMaH6JM81ANM1q3AIqaMkofflineKickMoE2CIX4FMqI7UIRk8Mpw35Mbi3KIV3GMMK3NM0K7AMMl6FIF6LMA075MPd3IbtcMh51RI124M2h15MHL4NMHo98Ea5IZ2GID3DI5r5eInnerMIK5NMEO39bSyIZO4MRB85IqXJbIdIPL4btyMqN4BbidEJHIj7II1K9Mz82II46MbinIm27MOW5BEgMeouterEg8M2c1HIvH4bryIwCPI91DMpz4NMJh85caInIp6JMpO26fnterioIwI7EUBIrMBIdU6M734AIwIIIQZNM011AMYL7OMy017IjQ6Iz2FcSetJ23K1I4LIM9y4NI4L6M3m4OIV3AIarNIV38My18IInD6IZ3LIf7KIC25MEU1EIl2GMn61KIF1MMt61FI0AIIt5RcsInJx8B1ItAGbelIL4PIwRRIS2GIp7GIS2II12KMdC5fIjfPINSKM569RInN8Eb7IJFLfSetOutINCPIW3IIuOTIM99IZTOIcBBMQr9QIcB5IrOKcQryIfB4Ir2LMdT3eIlC7I617INXcIA1NMAbAZMeW7SMa41PImU6IM9LdPullMrg6hIR8HIEW8IS9KI6Z9ND37Z2Ix2HIJ7PN4u6R1MhA28Iko5IkWJIF26mAnchorToVieweM7r3BEG6bToEW6IQ6NMkf16cserMEp18M149rbtcMzo2HMzX4HdevicMDb3BI89WMQo8XIF3UIv6PIj2BM6X8CIfpGI655ID1LIUKSIe8XM927cIhhHM9826MC08REY5M3226M7j5IMmaA8fimeoutM1j7LIA1EM2j47IEYNEb6IhM5Mh85NEY6M5j99IhDMdCancMY6A7IY3oIz2UIa3TIz25IX3TIz2AI7oMEa4hAnswerInIy2WIx2NIV67janswerCodeIu2UIT6aIw2FMrUAPIoeOIOZ4MUh1NIGg6IFvKcEndIG7eIA37IF7TIA3AIN4TMfp48M8V3OIo19dKeysIJ7IcBotILWSM9W36MiJ9IbotIgG6EsFIG15ffo botEuOEW4IozMMZF87MyU5MM3Y2yMLC8EMB41GeMetadIaa5MU3A5ED6MNmASMCY2QMw867IES5MA41OIn1CMl94UIH4MMm94Fb}\n3bMB"),Nl=function(){function e(e){Io.add(this),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0});var t=Eo.loadProto(e);this.pbModules=t.build("Modules").probuf}return Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.pbModules[e].encode(t).toArrayBuffer()}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{var r=this.pbModules[e].decode(t);return l(this,Io,"m",bo).call(this,r)}catch(t){var n="name: ".concat(e,", stack: ").concat(t.stack);throw null===console||void 0===console||console.error("pb decode error!",n),t}}}),e}();Io=new WeakSet,bo=function e(t,r){var n,i=this;if(t instanceof Array)return t.map((function(t){return l(i,Io,"m",e).call(i,t)}));if(n=t,"[object Object]"!==Object.prototype.toString.call(n))return t;if(t instanceof Eo.ByteBuffer)return t.toArrayBuffer();if(t instanceof Eo.Long)return r?t.toString():t.toNumber();var a={};return Object.keys(t).forEach((function(r){var n=t[r],o=t.$type.name===wo&&"seqId"===r;a[r]=l(i,Io,"m",e).call(i,n,o)})),a},function(e){e[e.PERSON=1]="PERSON",e[e.PERSONS=2]="PERSONS",e[e.GROUP=3]="GROUP",e[e.TEMPGROUP=4]="TEMPGROUP",e[e.CUSTOMERSERVICE=5]="CUSTOMERSERVICE",e[e.NOTIFY=6]="NOTIFY",e[e.MC=7]="MC",e[e.MP=8]="MP",e[e.ULTRAGROUP=10]="ULTRAGROUP"}(To||(To={})),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"}(vo||(vo={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(Ro||(Ro={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags",e[e.AutoTrans=4]="AutoTrans"}(mo||(mo={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(Ao||(Ao={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(yo||(yo={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Oo||(Oo={}));var Cl,Pl,Ml,Ll,wl,Ul,Dl,Gl,Vl,jl=new Nl(Sl);!function(e){e[e.LOG=0]="LOG",e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.FATAL=4]="FATAL",e[e.STATISTICS=6]="STATISTICS",e[e.NONE=1e3]="NONE"}(Cl||(Cl={})),function(e){e.IM="IM",e.RTC="RTC"}(Pl||(Pl={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",e[e.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",e[e.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",e[e.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",e[e.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",e[e.BLOCKED=9]="BLOCKED",e[e.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",e[e.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",e[e.REDIRECT=14]="REDIRECT",e[e.USER_LOGOUT=19]="USER_LOGOUT",e[e.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",e[e.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",e[e.ULTRALIMIT=1101]="ULTRALIMIT",e[e.REQUEST_NAVI=201]="REQUEST_NAVI",e[e.RESPONSE_NAVI=202]="RESPONSE_NAVI",e[e.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",e[e.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR"}(Ml||(Ml={})),function(e){e[e.RTC=0]="RTC",e[e.LIVE=2]="LIVE",e[e.SIP=4]="SIP",e[e.CALL=5]="CALL",e[e.MEETING=6]="MEETING",e[e.CROSS_MUTI=7]="CROSS_MUTI",e[e.CROSS_LIVE=8]="CROSS_LIVE"}(Ll||(Ll={})),function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(wl||(wl={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(Ul||(Ul={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(Dl||(Dl={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Gl||(Gl={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(Vl||(Vl={}));var kl,xl,Fl,Bl,Hl,Yl,Wl,Jl,ql,Kl,Ql,Xl=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r})}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r,once:!0})}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e];n&&((n=n.filter((function(e){return e.listener!==t||e.target!==r}))).length?this._map[e]=n:delete this._map[e])}}),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[e];if(n)for(var i=0;i<n.length;i+=1){var a=n[i],o=a.target,l=a.once,c=a.listener;l&&(n.splice(i,1),i-=1);try{c.call.apply(c,u([o],s(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._map[e]}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){Object.keys(this._map).forEach(this.removeAll,this)}}),e}(),Zl=function(e,t,r){var n=null==r?void 0:r.isReverse;yt(e)&&function(){for(var r in e)t(e[r],r,e)}(),(vt(e)||Et(e))&&function(){if(n)for(var r=e.length-1;r>=0;r--)t(e[r],r);else for(var i=0,a=e.length;i<a;i++)t(e[i],i)}()},zl=function(e,t){return Zl(e,(function(r,n){e[n]=t(r,n)})),e},$l=function(e){return"[object Null]"===Object.prototype.toString.call(e)},ec=function(){return ht.gen()},tc=function(){return ht.genWithLen(22)},rc=function(){function e(e){Object.defineProperty(this,"pbCodec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbCodec=new Nl(e)}return Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return r?t:this.pbCodec.encode(e,t)}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.pbCodec.decode(e,t)}}),e}(),nc=function(e,t,r,n,i){var a=n?Object.keys(n).map((function(e){return{key:e,value:n[e]}})):void 0,o=i?Object.keys(i).map((function(e){return{key:e,value:i[e]}})):void 0;return jl.encode(ul,{roomType:e,broadcastType:t,joinType:r,innerDatas:a,outerDatas:o})},ic=function(e){var t=jl.decode(sl,e),r=t.users,n=t.token,i=t.sessionId,a=t.roomInfo,o=t.entries,s=t.offlineKickTime,u={};return Zl(r,(function(e){var t=e.userId,r=e.userData,n={};Zl(r,(function(e){var t=e.key,r=e.value;n[t]=r})),u[t]=n})),{users:u,token:n,sessionId:i,roomInfo:a,kvEntries:o,offlineKickTime:s}},ac=function(){function e(e){Object.defineProperty(this,"_pullQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPulling",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pullTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._engine=e}return Object.defineProperty(e.prototype,"_startPull",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,r=e.timestamp,(n=this._pullTime)>r?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,n)]);case 1:return i=a.sent(),o=i.code,s=i.data,o===k.SUCCESS?(this._isPulling=!1,this._pullTime=s||0,this._startPull()):this._startPull(),[2]}}))}))}}),Object.defineProperty(e.prototype,"pullEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._pullTime=0,this._isPulling=!1}}),e}(),oc=function(){function e(e,t){Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcKVManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rtcSignalingListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._appkey=this._options.appkey,this._rtcKVManager=new ac(this)}return Object.defineProperty(e.prototype,"appkey",{get:function(){return this._appkey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"initOption",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._rtcSignalingListener=e}}),Object.defineProperty(e.prototype,"pullRTCRoomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var t,r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=jl.encode(pl,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,Ci,!0,t)];case 1:return(r=a.sent()).isOk?(i=jl.decode(El,r.data),o=i.entries,s=i.syncTime,o=(o||[]).map((function(e){return n(n({},e),{timestamp:e.timestamp})})),this._watcher.onRTCDataChange(o,e),[2,br(s)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"_receiveRtcKv",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=jl.decode(gl,e),r=t.time,n=t.type,i=t.roomId;1===n&&this._rtcKVManager.pullEntry(i,r)}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){}}),e}();!function(e){e.INIT="INIT",e.DATA="DATA",e.END="END"}(kl||(kl={}));var sc=function(e){function r(t,r){var n=e.call(this)||this;return xl.add(n),Fl.set(n,void 0),Bl.set(n,new Map),Hl.set(n,void 0),c(n,Fl,t,"f"),c(n,Hl,r,"f"),n}return t(r,e),Object.defineProperty(r.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=l(this,xl,"a",Yl).createTraceId(),l(this,xl,"a",Yl).info(F.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,vr.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(l(this,Fl,"f").validateConnected).tryTrans((function(e){var t,r;return(null===(r=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===r?void 0:r.length)?br(e.streamServer.addrs):Tr(k.STREAM_MESSAGE_DISABLE)})).next((function(t){return l(n,xl,"m",Ql).call(n,e,t)}))];case 1:return r=i.sent(),l(this,xl,"a",Yl).summary(F.L_REQ_STREAM_MSG_CONTENT_R,r,t,{messageUId:e}),[2,r.wipe()]}}))}))}}),r}(gr);Fl=new WeakMap,Bl=new WeakMap,Hl=new WeakMap,xl=new WeakSet,Yl=function(){return l(this,Fl,"f").logger},Wl=function(e,t,r){var n=l(this,Bl,"f").get(e);n&&(l(this,Bl,"f").delete(e),l(this,xl,"m",Jl).call(this,e,kl.END,t,n.msg))},Jl=function(e,t,r,n,i){this.emit("message",{code:r,messageUId:e,type:t,chunk:i,message:n})},ql=function(e,t){e.content=n(n({},e.content),t),l(this,Fl,"f")._innerSetMessageContent(e.messageId,JSON.stringify(e.content),e.messageType)},Kl=function(e,t,r){var n,i,a=l(this,Bl,"f").get(t);switch(e){case"init":a.msg&&l(this,xl,"m",ql).call(this,a.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),l(this,xl,"m",Jl).call(this,t,kl.INIT,k.SUCCESS,a.msg);break;case"complete":i=(n=r.length?JSON.parse(r):{}).complete||!1,a.msg&&l(this,xl,"m",ql).call(this,a.msg,{stopReason:n.stopReason||0,completeReason:n.completeReason||0,complete:i,isSynced:i}),l(this,xl,"m",Wl).call(this,t,n.stopReason||0,i);break;default:n=JSON.parse(r),a.cached+=n.content,a.msg&&l(this,xl,"m",ql).call(this,a.msg,{content:a.cached}),l(this,xl,"m",Jl).call(this,t,kl.DATA,k.SUCCESS,a.msg,{content:n.content,fullContent:a.cached})}},Ql=function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c,_=this;return a(this,(function(a){switch(a.label){case 0:return l(this,Bl,"f").has(e)?[2,Tr(k.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:l(this,Bl,"f").size>=3?[2,Tr(k.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(r=po.createSSEClient({logger:l(this,xl,"a",Yl),msgUId:e,appkey:l(this,Fl,"f").appkey,token:l(this,Fl,"f").token,timeout:3e4,onRawContent:function(t){t.split("\n\n").forEach((function(t){if(0!==t.length){t.startsWith("data:")&&(t="event:delta\n".concat(t));var r=t.indexOf("\n"),n=t.slice(0,r).replace("event:",""),i=t.slice(r+1+5);l(_,xl,"m",Kl).call(_,n,e,i.trim())}}))},onNetworkError:function(t){l(_,xl,"m",Wl).call(_,e,t,!1)}}),r.isOk?(n=r.data,i={client:n,cached:"",msg:void 0},l(this,Bl,"f").set(e,i),l(this,Hl,"f")?[4,l(this,Fl,"f").getLocalMessage(e)]:[3,2]):[2,r.wipe()]);case 1:if(o=a.sent(),s=o.code,!(u=o.data))return l(this,Bl,"f").delete(e),[2,Tr(s,"message not found, msgUId: ".concat(e))];if(u.content.isSynced)return l(this,Bl,"f").delete(e),[2,Tr(k.STREAM_MESSAGE_SYNCED,"synced")];i.msg=u,a.label=2;case 2:return[4,n.open(t.slice())];case 3:return(c=a.sent()).isOk||l(this,Bl,"f").delete(e),[2,c.wipe()]}}))}))};var uc,lc,cc=function(){function e(e){Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"__getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"createCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new rc(t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new Nl(e)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._context.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"getNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getNaviInfoFromCache()}}),Object.defineProperty(e.prototype,"getCoreVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.34.0"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.34.0"}}),Object.defineProperty(e.prototype,"getAppkey",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.appkey}}),Object.defineProperty(e.prototype,"getCurrentId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getCurrentUserId()}}),Object.defineProperty(e.prototype,"getUserToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.token}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getConnectionStatus()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getDeviceId()}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.setPushConfig(e)}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return console.warn('[PluginContext] sendMessage is deprecated, please use "sendMessageTo" instead'),this.sendMessageTo({conversationType:e,targetId:t,channelId:r.channelId},r)}}),Object.defineProperty(e.prototype,"sendMessageTo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.sendMessageByPlugin(e,t)}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){void 0===n&&(n=[]),this._context.registerMessageType(e,t,r,n)}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getServerTime()}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.setCallInfo(e,t,r)}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getStatsUrlList()}}),e}(),_c=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"joinRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o,s){return i(this,void 0,void 0,(function(){var i,u,l,c,_;return a(this,(function(a){switch(a.label){case 0:return i=nc(t,r,n,o,s),[4,this.rtcSignaling(e,pi,!0,i)];case 1:return u=a.sent(),l=u.code,c=u.buffer,l===k.SUCCESS&&c&&(_=ic(c)),[2,{code:l,data:_}]}}))}))}}),Object.defineProperty(r.prototype,"quitRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=jl.encode(rl,{status:0}),[4,this.rtcSignaling(e,Ei,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,this._context.rtcPing(e,t,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcPingResVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.rtcPing(e,t,r)}}),Object.defineProperty(r.prototype,"getRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){throw new Error("Method not implemented.")}}),Object.defineProperty(r.prototype,"setRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=jl.encode(ol,{key:t,value:r}),[4,this.rtcSignaling(e,Ii,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=jl.encode(al,{key:t}),[4,this.rtcSignaling(e,bi,!1,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o,s){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return i=jl.encode(_l,{interior:n,target:o,key:t,value:r,objectName:null==s?void 0:s.name,content:null==s?void 0:s.content}),[4,this.rtcSignaling(e,Ti,!1,i)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return void 0===o&&(o=""),i(this,void 0,void 0,(function(){var i,s;return a(this,(function(a){switch(a.label){case 0:return i={objectName:n,content:[{key:t.name,value:t.content}],valueInfo:[{key:"uris",value:r},{key:"mcu_uris",value:o}]},s=jl.encode(fl,i),[4,this.rtcSignaling(e,vi,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=jl.encode(fl,{objectName:t,valueInfo:[{key:"cdn_uris",value:r}]}),[4,this.rtcSignaling(e,vi,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=jl.encode(cl,{interior:r,target:n,key:t}),[4,this.rtcSignaling(e,Ri,!0,i)];case 1:return o=a.sent(),s=o.code,u=o.buffer,s===k.SUCCESS&&u?(l=jl.decode(ll,u).outInfo,c={},l.forEach((function(e){c[e.key]=e.value})),[2,{code:s,data:c}]):[2,{code:s}]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return i=jl.encode(cl,{interior:r,target:n,key:t,objectName:null==o?void 0:o.name,content:null==o?void 0:o.content}),[4,this.rtcSignaling(e,mi,!1,i)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(r.prototype,"getRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(r.prototype,"getRTCToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=nc(t,r),[4,this.rtcSignaling(e,Ai,!0,n)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===k.SUCCESS&&s?(u=jl.decode(hl,s).rtcToken,[2,{code:o,data:{rtcToken:u}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"setRTCState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=jl.encode(nl,{state:t}),[4,this.rtcSignaling(e,yi,!0,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=jl.encode(il,{order:2}),[4,this.rtcSignaling(e,Oi,!0,t)];case 1:return r=a.sent(),n=r.code,i=r.buffer,n===k.SUCCESS&&i?(o=ic(i),[2,{code:n,data:o}]):[2,{code:n}]}}))}))}}),Object.defineProperty(r.prototype,"joinLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return n=nc(t,r),[4,this.rtcSignaling(e,Si,!0,n)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===k.SUCCESS&&s?(u=jl.decode(Tl,s),l=u.rtcToken,c=u.entries,[2,{code:o,data:{token:l,kvEntries:c}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"quitLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=jl.encode(rl,{status:0}),[4,this.rtcSignaling(e,Ni,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcIdentityChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=jl.encode(ul,{roomType:Ll.LIVE,broadcastType:r,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,Pi,!0,n)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===k.SUCCESS&&s?(u=ic(s),[2,{code:o,data:u}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,s=e.roomId,u=jl.encode(vl,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(s,Mi,!0,u)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,s=jl.encode(Rl,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,inviteInfo:i}),[4,this.rtcSignaling(o,Li,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return t=e.inviteUserId,r=e.inviteRoomId,n=e.inviteSessionId,i=e.content,o=e.key,s=e.value,u=e.agree,l=e.roomId,c=jl.encode(ml,{inviteUserId:t,inviteRoomId:r,inviteSessionId:n,content:i,key:o,value:s,answerCode:u?1:0}),[4,this.rtcSignaling(l,wi,!0,c)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.endRoomId,r=e.sessionId,n=e.content,i=e.keys,o=e.roomId,s=jl.encode(Al,{inviteRoomId:t,inviteSessionId:r,inviteContent:n,inviteRoomKeys:i}),[4,this.rtcSignaling(o,Ui,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"registerRTCSignalListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.registerRTCSignalingListener(e)}}),Object.defineProperty(r.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return[4,this._context.rtcSignaling(e,t,r,n)];case 1:return[2,{code:(i=a.sent()).code,buffer:i.data}]}}))}))}}),Object.defineProperty(r.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=jl.encode(Il,{userId:e}),[4,this.rtcSignaling("",Di,!0,t)];case 1:return r=a.sent(),n=r.code,i=r.buffer,n===k.SUCCESS&&i?(o=jl.decode(bl,i).info,[2,{code:n,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:n}]}}))}))}}),r}(cc);!function(e){e[e.STRING=0]="STRING",e[e.ONLY_STRING=1]="ONLY_STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.OBJECT=4]="OBJECT",e[e.ARRAY=5]="ARRAY",e[e.CALLBACK=6]="CALLBACK",e[e.CHANNEL_ID=7]="CHANNEL_ID"}(lc||(lc={}));var fc=((uc={})[lc.STRING]=mt,uc[lc.ONLY_STRING]=Et,uc[lc.NUMBER]=bt,uc[lc.BOOLEAN]=function(e){return"boolean"==typeof e},uc[lc.OBJECT]=yt,uc[lc.ARRAY]=vt,uc[lc.CALLBACK]=function(e){var t=!0;return yt(e)||(t=!1),(e=e||{}).onSuccess&&!Ot(e.onSuccess)&&(t=!1),e.onError&&!Ot(e.onError)&&(t=!1),t},uc[lc.CHANNEL_ID]=Lt,uc),dc=function(e){function r(t){var r=e.call(this,t)||this;return r.name="RCAssertError",r}return t(r,e),r}(Error),hc=function(e,t,r,n){if(void 0===n&&(n=!1),!gc(e,t,r,n))throw new dc("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},gc=function(e,t,r,n){void 0===n&&(n=!1),r=fc[r]||r;var i=n?r(t):St(t)||null==t||r(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},pc=function(e,t){var r=An(e).searchProps;return r&&0!==r.length?r.every((function(e){return void 0!==t[e]}))?br():Tr(k.SEARCH_PROPS_LIMIT_ERROR):br()},Ec=function(e,t,r){return Ic(vr.create(e),t,r)},Ic=function(e,t,r){return e.isFailed||e.isObject("conversation",t,!0).fail(k.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return ee(null==t?void 0:t.conversationType,r)}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID),e},bc=function(e,t,r){return e.check((function(e){return Ic(e,t,X)})).check((function(e){var n=null==t?void 0:t.messageType;mt(n)?n===Re.STREAM_MESSAGE&&r.includes("RC_Ext_StreamMsgSummary")&&e.setFailed(k.STREAM_MESSAGE_EXPANSION_KEY_ERROR):e.setFailed(k.INVALID_PARAMETER_MESSAGE_TYPE)})).check((function(e){(null==t?void 0:t.canIncludeExpansion)||e.setFailed(k.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isNotEmptyString("messageUId",null==t?void 0:t.messageUId,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isTimestamp("sentTime",null==t?void 0:t.sentTime,!0).fail(k.INVALID_PARAMETER_TIMESTAMP),e},Tc=function(e,t,r){return e.check((function(e){r||e.setFailed(k.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isObject("expansion",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_EXPANSION).check((function(e){var r=Object.keys(t);if(r.length>20||0===r.length)e.setFailed(k.EXPANSION_LIMIT_EXCEET);else if(r.some((function(e){return!/^[A-Za-z0-9_=+-]+$/.test(e)||"string"!=typeof t[e]})))e.setFailed(k.INVALID_PARAMETER_MESSAGE_EXPANSION);else{r.some((function(e){return e.length>32||t[e].length>4096}))&&e.setFailed(k.EXPANSION_LIMIT_EXCEET)}})),e},vc=function(e,t){return t?(e.isObject("proxy",t,!0).isString("socketHost",t.socksHost,!0).isNumber("socketPort",t.socksPort,!0).isString("socketUsername",t.socksUsername).isString("socketPassword",t.socksPassword).fail(k.INVALID_PARAMETER_PROXY),e):e};var Rc=function(e){return 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).byteLength},mc=function(e,t,r,n,i){var a=0;return e&&(a|=16),t&&(a|=32),r&&(a|=64),n&&(a|=512),i&&(a|=1024),a},Ac=function(e){var t;try{t=JSON.parse(e)}catch(r){t=e}if(null==t?void 0:t.user){var r=t.user,n=r.portrait,i=r.portraitUri,a=n||i;a&&(t.user.portrait=t.user.portraitUri=a)}return t},yc=function(e){var t={};try{var r=JSON.parse(e);Object.entries(r).forEach((function(e){var r=s(e,2),n=r[0],i=r[1];t[n]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},Oc=function(e,t,r,n){var i,a,o=jl.decode(Co,e.pbData),s=ti(e.topic);if(s===$n.recallMsg){var u=JSON.parse(o.content);i=u.conversationType,a=u.targetId}else i=function(e){var t;return((t={})[$n.ppMsgP]=x.PRIVATE,t[$n.pgMsgP]=x.GROUP,t[$n.chatMsg]=x.CHATROOM,t[$n.ugMsg]=x.ULTRA_GROUP,t[$n.pcMsgP]=x.CUSTOMER_SERVICE,t[$n.pbMsgP]=x.SYSTEM,t)[e]||x.PRIVATE}(s),a=e.targetId;var l=![x.GROUP,x.CHATROOM,x.RTC_ROOM,x.ULTRA_GROUP].includes(i),c=l?a:t,_=l?"":a,f=Pc(o.sessionId),d=f.isPersited,h=f.isCounted,g=f.isMentioned,p=f.disableNotification,E=f.canIncludeExpansion;return{fromUserId:c,type:i,groupId:_,classname:o.classname,content:o.content,dataTime:r,status:mc(d,h,g,p,E),msgId:n,direction:Ee.SEND,clientUniqueId:o.clientUniqueId,extraContent:o.extraContent,pushContent:o.pushText,configFlag:o.configFlag,pushExt:o.pushExt,busChannel:o.busChannel,toUserIds:o.toUserIds,optionBits:o.optionBits}},Sc=function(e,t,r,i){void 0===r&&(r=!1);var a,o,s,u=e.type,l=e.classname,c=![x.GROUP,x.CHATROOM,x.RTC_ROOM,x.ULTRA_GROUP].includes(u)?i||e.fromUserId:e.groupId||i,_={isPersited:!!(16&(a=e.status)),isCounted:!!(32&a),isMentioned:!!(64&a),disableNotification:!!(512&a),receivedStatus:2&a?me.RETRIEVED:me.UNREAD,canIncludeExpansion:!!(1024&a)},f=_.isMentioned,d=_.disableNotification,h=_.receivedStatus,g=_.canIncludeExpansion,p=e.direction===Ee.SEND?Ee.SEND:Ee.RECEIVE,E=function(e,t,r){void 0===e&&(e=0);var i=function(e){return{isVoipPush:!!(1&e),isFilerWhiteBlacklist:!!(2&e),disablePushTitle:!!(4&e),forceShowDetailContent:!!(8&e)}}(e),a=i.disablePushTitle,o=i.forceShowDetailContent,s=nr(null==r?void 0:r.pushConfigs,null==r?void 0:r.pushId);return n({pushTitle:(null==r?void 0:r.title)||"",pushContent:t||"",pushData:"",disablePushTitle:a,forceShowDetailContent:o,templateId:null==r?void 0:r.templateId},s)}(e.configFlag||0,e.pushContent,e.pushExt),I=(o=e.extStatus,{isInterrupt:!!(2&(s=o||0)),isModifyMessage:!!(4&s),isPrivateChannel:!!(8&s),isStatusMessage:!!(64&s)}),b=I.isInterrupt,T=I.isModifyMessage,v=I.isPrivateChannel,R=I.isStatusMessage,m=An(e.classname),A=m.isCounted,y=m.isPersited,O=m.isStatusMessage;return{conversationType:u,targetId:c,senderUserId:p===Ee.SEND?t:e.fromUserId,messageType:l,messageUId:e.msgId,isPersited:y,isCounted:A,isMentioned:f,sentTime:e.dataTime,messageDirection:p,receivedTime:Date.now(),disableNotification:d,receivedStatus:h,receivedStatusInfo:jt(h),canIncludeExpansion:g,content:Ac(e.content),expansion:e.extraContent?yc(e.extraContent):null,pushConfig:E,channelId:e.busChannel||"",isInterrupt:b,isModifyMessage:T,messageId:e.clientUniqueId||0,sentStatus:se.SENT,isOffLineMessage:r,channelType:v?te.PRIVATE:te.PUBLIC,isStatusMessage:R||!!O,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:!!(1&(e.optionBits||0)),needReceipt:!!(2&(e.optionBits||0)),sendReceipt:!!(4&(e.optionBits||0))||void 0,modifyInfo:Mc(e.convertExt),extraData:e.extMsgData?{seqId:e.extMsgData.seqId,sentTime:e.extMsgData.sendTime}:void 0}},Nc=function(e,t,r,n,i){void 0===n&&(n=!1);var a=Sc(t,r,n,i);return a.messageType===Re.RECALL&&e.serverSaveUnread?(a.__innerData__={keepUnreadCount:!(16&t.optionBits)},a):a},Cc=function(e,t,r,n,i){var a=0,o=An(e),s=o.isPersited,u=o.isCounted,l=o.isStatusMessage,c=i||l;return s&&!c&&(a|=1),u&&!c&&(a|=2),t&&(a|=4),r&&(a|=32),n&&(a|=64),a},Pc=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}},Mc=function(e){if(e)try{var t=JSON.parse(e).modify;if(t.time)return{timestamp:t.time,content:{},status:Hr}}catch(t){console.error("parse message modify info error: ".concat(e),t)}},Lc=function(e,t){var r=e.content,i=r.sentTime,a=r.messageUId,o=r.isDelete,s=r.isAdmin,u=r.directionalUserIdList,l=r.extra,c={recallTime:i,recallActionTime:e.sentTime,admin:!!s,delete:!!o,isDelete:!!o,operatorId:e.senderUserId,extra:l},_=n(n({},e),{content:c,messageType:Re.RECALL_NOTIFICATION_MESSAGE});return t&&(_.messageUId=a,_.sentTime=i,_.directedUserIds=u),_};function wc(e){return 1&~((null==e?void 0:e.sessionMode)||0)?Tr(k.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):br()}function Uc(e){return Math.min(e,999)}var Dc,Gc,Vc=function(){function e(e){var t;Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"subscribeData",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[_e.ONLINE_STATUS]={},t[_e.USER_PROFILE]={},t)}),Object.defineProperty(this,"_ownProfile",{enumerable:!0,configurable:!0,writable:!0,value:null})}return Object.defineProperty(e.prototype,"clearSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;this.subscribeData=((e={})[_e.ONLINE_STATUS]={},e[_e.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===_e.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].statusMap={}})):e===_e.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].profile=void 0}))}}),Object.defineProperty(e.prototype,"getSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.subscribeData[e][t];return r?n({},r):void 0}}),Object.defineProperty(e.prototype,"removeSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){delete this.subscribeData[e][t]}}),Object.defineProperty(e.prototype,"updateSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.subscribeData[e][t]=r}}),Object.defineProperty(e.prototype,"clearExpiredData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t in this.subscribeData[e]){var r=this.subscribeData[e][t];r.expiry<(Date.now()+this._delayTime-r.subscribeTime)/1e3&&delete this.subscribeData[e][t]}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return u([],s(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(r,r+t)}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=n(n({},null===(t=this._ownProfile)||void 0===t?void 0:t.extraProfile),e.extraProfile);this._ownProfile=n(n(n({},this._ownProfile),e),{extraProfile:r})}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ownProfile?n(n({},this._ownProfile),{extraProfile:n({},this._ownProfile.extraProfile)}):null}}),e}(),jc=function(){function e(e){Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_relationshipStatusVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subUserStatusVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_ownProfileVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subStore=new Vc(e)}return Object.defineProperty(e.prototype,"updateRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)}}),Object.defineProperty(e.prototype,"getRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._relationshipStatusVersion}}),Object.defineProperty(e.prototype,"updateSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)}}),Object.defineProperty(e.prototype,"getSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subUserStatusVersion}}),Object.defineProperty(e.prototype,"_filterSubscribeRelationData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.reduce((function(e,t){return t.subUsers.forEach((function(r){var n=e.find((function(e){return e.subscribeType===t.subType&&e.userId===r.subUserId}));n?n.subscribeTime<t.subTime&&(n.expiry=t.expiry,n.operationType=t.opType,n.subscribeTime=t.subTime):e.push({userId:r.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e}),[])}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=!1);var n=[],i=[],a=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,o,s=e.userId,u=e.subscribeTime,l=e.subscribeType,c=e.expiry;if(e.operationType===fe.UNSUBSCRIBE)return r._subStore.removeSubscribeUserData(l,s),void a.push(e);var _=r._subStore.getSubscribeUserData(l,s);if(!(_&&_.subscribeTime>=u)){if(l===_e.ONLINE_STATUS){n.push(s);var f=(null===(t=_)||void 0===t?void 0:t.statusMap)||{};r._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,statusMap:f})}else{i.push(s);var d=null===(o=_)||void 0===o?void 0:o.profile;r._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,profile:d,isSubscribed:!0})}a.push(e)}})),{newSubscribeOnlineStatusList:n,newSubscribeUserProfileList:i,subscribeUserChangeList:a}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(_e.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(_e.USER_PROFILE)}}),Object.defineProperty(e.prototype,"updateSubscribeUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var i=e.subUserId,a=e.data,o=t._subStore.getSubscribeUserData(_e.ONLINE_STATUS,i);if(o){var s=[],u=n({},o.statusMap);a.forEach((function(e){var t=e.platformInfo,r=e.versionTime,i=u[t];if(!(i&&i.changeTime>r)){var a={eventValue:e.value,changeTime:r};u[t]=a,s.push(n(n({},a),{platform:t}))}})),t._subStore.updateSubscribeUserData(_e.ONLINE_STATUS,i,{subscribeTime:o.subscribeTime,expiry:o.expiry,userId:i,subscribeType:_e.ONLINE_STATUS,statusMap:u}),r.push({userId:i,subscribeType:_e.ONLINE_STATUS,subscribeTime:o.subscribeTime,expiry:o.expiry,details:s})}})),r}}),Object.defineProperty(e.prototype,"updateSubscribeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var i=e.userId,a=e.version,o=e.userProfile,s=e.userExtProfile,u=t._subStore.getSubscribeUserData(_e.USER_PROFILE,i),l=Ft(i,o,s);u?u.profile&&u.profile.version>=a||(t._subStore.updateSubscribeUserData(_e.USER_PROFILE,i,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:i,subscribeType:_e.USER_PROFILE,profile:{info:l,version:a},isSubscribed:u.isSubscribed}),u.isSubscribed&&r.push({userId:i,subscribeType:_e.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:n({},l)})):t._subStore.updateSubscribeUserData(_e.USER_PROFILE,i,{subscribeTime:0,expiry:0,userId:i,subscribeType:_e.USER_PROFILE,profile:{info:l,version:a},isSubscribed:!1})})),r}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,i=[];return t.forEach((function(t){var a=r._subStore.getSubscribeUserData(e,t);if(!a||a.expiry<(Date.now()+r._delayTime-a.subscribeTime)/1e3)r._subStore.removeSubscribeUserData(e,t);else{var o={subscribeTime:a.subscribeTime,expiry:a.expiry,userId:a.userId,subscribeType:a.subscribeType};if(e===_e.ONLINE_STATUS){var s=a.statusMap,u=Object.keys(s).map((function(e){return n({platform:~~e},s[~~e])}));o.details=xt(u)}else if(e===_e.USER_PROFILE&&!a.isSubscribed)return;i.push(o)}})),i}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[],i=[];return e.forEach((function(e){var a=t._subStore.getSubscribeUserData(_e.USER_PROFILE,e);if(a&&a.profile){var o=a.profile,s=o.version,u=o.info;if(a.isSubscribed)return t._delayTime+Date.now()-s>6048e5?void i.push(e):void r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}));t._delayTime+Date.now()-s>6e5?i.push(e):r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}))}else i.push(e)})),{list:r,needQueryUserIds:i}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,r).map((function(t){var r={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===_e.ONLINE_STATUS){var i=Object.keys(t.statusMap).map((function(e){return n({platform:~~e},t.statusMap[~~e])}));r.details=xt(i)}return r}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subStore.getOwnProfile()}}),e}(),kc=function(){function e(e,t,r,n,i,a,o){Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_event",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_currentUserId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_isOpenUserProfile",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_subDriven",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_isPullingRelationship",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullRelationshipQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullRelationshipFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_isPullingSubUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullSubUserStatusQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullSubUserStatusFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subscribeService",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subscribeService=new jc(n)}return Object.defineProperty(e.prototype,"syncData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return this._subDriven?[4,this._syncSubscribeRelationship(!1)]:[3,3];case 1:return e.sent(),[4,this._syncSubscribeUserStatus(!0)];case 2:e.sent(),e.label=3;case 3:return this._isOpenUserProfile?[4,this.syncOwnProfile()]:[3,5];case 4:e.sent(),e.label=5;case 5:return 1&this._subDriven&&this._event.syncSubscribeUserStatusFinished(_e.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(_e.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(_e.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(_e.FRIEND_USER_PROFILE),[2]}}))}))}}),Object.defineProperty(e.prototype,"startSyncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this._pullRelationshipQueue.push(e),this._syncSubscribeRelationship(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!0),i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this._isPullingRelationship?[2]:(this._isPullingRelationship=!0,[4,this._pullSubscribeRelationship(e)]);case 1:return t.sent(),this._isPullingRelationship=!1,this._pullRelationshipQueue.length>0?(this._pullRelationshipQueue.length=0,[4,this._syncSubscribeRelationship(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,_,f,d,h,g;return a(this,(function(a){switch(a.label){case 0:return r=this._subscribeService.getRelationshipStatusVersion(),n=this._logger.createTraceId(),this._logger.info(F.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:r,_pageToken:t}),n),i=jl.encode(au,{version:r,pageToken:t}),[4,this._ctx.query($n.pullUserSub,this._currentUserId,i,ou)];case 1:return o=a.sent(),this._logger.summary(F.L_PULL_SUBSCRIBED_USER_RELATION_R,o,n),o.isOk?(this._pullRelationshipFailTime=0,s=o.data,u=s.list,l=s.version,c=s.hasNext,_=s.pageToken,e?(f=this._subscribeService.updateSubscribeRelation(u),d=f.newSubscribeOnlineStatusList,h=f.newSubscribeUserProfileList,(g=f.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(g),d.length>0&&this._queryAndUpdateUserOnlineStatus(d),h.length>0&&this._queryAndUpdateUserProfile(h)):this._subscribeService.updateSubscribeRelation(u,!t),this._subscribeService.updateRelationshipStatusVersion(l),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>l})),c?[4,this._pullSubscribeRelationship(e,_)]:[3,3]):(this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:a.sent(),a.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"startsyncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this._pullSubUserStatusQueue.push(e),this._syncSubscribeUserStatus(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this._isPullingSubUserStatus?[2]:(this._isPullingSubUserStatus=!0,[4,this._pullSubscribeUserStatus(e)]);case 1:return t.sent(),this._isPullingSubUserStatus=!1,this._pullSubUserStatusQueue.length>0?(this._pullSubUserStatusQueue.length=0,[4,this._syncSubscribeUserStatus(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=""),i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,_,f,d,h;return a(this,(function(a){switch(a.label){case 0:return r=this._subscribeService.getSubscribeUserStatusVersion(),n=this._logger.createTraceId(),this._logger.info(F.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:r,_pageToken:t,needAllData:e}),n),i=jl.encode(su,{versionTime:r,needAllData:e,pageToken:t}),[4,this._ctx.query($n.pullSubData,this._currentUserId,i,uu)];case 1:return(o=a.sent()).isOk?(this._pullSubUserStatusFailTime=0,s=o.data,u=s.list,l=s.versionTime,c=s.hasNext,_=s.pageToken,f=s.isFull,this._logger.info(F.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code}),n),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>l})),this._subscribeService.updateSubscribeUserStatusVersion(l),d=[],h=[],u.forEach((function(e){switch(e.subType){case _e.ONLINE_STATUS:d.push(e);break;case _e.USER_PROFILE:h.push(e.subUserId);case _e.FRIEND_ONLINE_STATUS:case _e.FRIEND_USER_PROFILE:}})),f&&""===t&&this._subscribeService.clearSubscribeStatus(),d.length>0&&this._updateUserOnlineStatus(d,!f),h.length>0?[4,this._queryAndUpdateUserProfile(h,!f)]:[3,3]):(this._logger.warn(F.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code,failTime:this._pullSubUserStatusFailTime}),n),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:a.sent(),a.label=3;case 3:return c?[4,this._pullSubscribeUserStatus(e,_)]:[3,5];case 4:a.sent(),a.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return t=this._logger.createTraceId(),this._logger.info(F.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),r=jl.encode(cu,{subType:_e.ONLINE_STATUS,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._ctx.query($n.qrySubData,this._currentUserId,r,uu)];case 1:return n=i.sent(),this._logger.summary(F.L_QUERY_SUBSCRIBE_DATA_R,n,t),n.isOk?(this._updateUserOnlineStatus(n.data.list),[2]):[2]}}))}))}}),Object.defineProperty(e.prototype,"_updateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!0);var r=this._subscribeService.updateSubscribeUserOnlineStatus(e);r=r.filter((function(e){return e.details&&e.details.length>0})),t&&r.length>0&&this._event.subscribeUserStatusChanged(r)}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!0),i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return r=this._logger.createTraceId(),this._logger.info(F.L_PULL_USER_PROFILE_T,JSON.stringify(e),r),n=jl.encode(du,{userId:e}),i=new Oa($n.pullUserProfile,n,this._currentUserId),[4,this._ctx.send(i,hu)];case 1:return o=a.sent(),s=o.code,u=o.data,this._logger.info(F.L_PULL_USER_PROFILE_R,JSON.stringify({code:s,data:u}),r),s!==k.SUCCESS?[2,Tr(s)]:(l=this._subscribeService.updateSubscribeUserProfile(u.UserProfile),t&&l.length>0&&this._event.subscribeUserStatusChanged(l),[2,br(u.UserProfile)])}}))}))}}),Object.defineProperty(e.prototype,"updateUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return(t=jl.decode(lu,e.pbData)).subType!==_e.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==_e.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==_e.FRIEND_ONLINE_STATUS?[3,3]:(r=t.data.map((function(e){return{changeTime:e.versionTime,eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:r}]),[3,5]);case 3:return t.subType!==_e.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:n=a.sent(),(i=n.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Ft(t.subUserId,i[0].userProfile,i[0].userExtProfile)}]),a.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subscribeService.getSubscribeUserList(e,t,r)}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),i(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=jl.encode(nu,{subType:t,opType:r,expiry:n,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._ctx.query($n.updUserSub,this._currentUserId,i,iu)];case 1:return o=a.sent(),s=o.code,u=o.data,l=o.isOk,s===k.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT?[2,Tr(s,"",u.subUsers.map((function(e){return e.subUserId})))]:l?(c=u.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:n,opType:r,subUsers:e.map((function(e){return{subUserId:e}}))}]),r===fe.SUBSCRIBE&&(t===_e.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===_e.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,o.wipe()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._subscribeService.getUserProfiles(e),r=t.needQueryUserIds,n=t.list,0===r.length?[2,br(n)]:[4,this._queryAndUpdateUserProfile(r,!1)];case 1:return(i=a.sent()).isOk?(o=i.data.map((function(e){return Ft(e.userId,e.userProfile,e.userExtProfile)})),[2,br(u(u([],s(n),!1),s(o),!1))]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"syncOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(F.L_PULL_OWN_PROFILE_T,"",t),r=jl.encode(gu,{nothing:1}),[4,this._ctx.query($n.pullOwnProfile,this._currentUserId,r,_u)]):[2,Tr(k.RC_USER_PROFILE_SERVICE_UNAVAILABLE)];case 1:return n=a.sent(),this._logger.summary(F.L_PULL_OWN_PROFILE_R,n,t),n.isOk?(i=n.data,o=i.userExtProfile,s=i.userProfile,u=i.version,l=i.userId,c=Ft(l,s,o),this._subscribeService.updateOwnProfile(c,u),e&&this._event.ownUserProfileChanged(c),[2,br(c)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,br(e)]:[2,this.syncOwnProfile()]}))}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),xc=function(e){function r(t,r,n,i){var a=e.call(this,t,r,n,i)||this;return Dc.set(a,pt),a}return t(r,e),Object.defineProperty(r.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,Dc,e,"f")}}),Object.defineProperty(r.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,Dc,"f")}}),r}(en);Dc=new WeakMap;var Fc=null,Bc="RC_LOGS",Hc="RC_STATISTICS",Yc=((Gc={})[Bc]=["level","time"],Gc[Hc]=["level","time"],Gc),Wc=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),a=IDBKeyRange.upperBound(Date.now()-r),o=i.openCursor(a);o.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},o.onerror=function(){n()}}))},Jc=null,qc=function(e){return i(void 0,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return[4,Fc];case 1:return(t=n.sent())?(r=t.db,[4,Wc(r,Bc,e)]):[2];case 2:return n.sent(),[4,Wc(r,Hc,e)];case 3:return n.sent(),Jc=setTimeout((function(){return qc(e)}),6e5),[2]}}))}))},Kc=function(e,t,r){void 0===r&&(r=168),Fc||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==po.runtimeInfo.type?Fc=new Promise((function(n){var i=window.indexedDB;!function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(r){r.forEach((function(r){r.name&&e.includes(r.name)&&t.deleteDatabase(r.name)}))}))}(["RC_ENGINE_DB","RC_STATISTIC_".concat(e)]);var a="RC_LOGS_".concat(e),o=i.open(a,2);o.onerror=function(e){t.error(F.L_LOGDB_OPEN_FAILED_E,e.target.error),n(null)},o.onsuccess=function(i){var a=i.target.result;a?(a.onclose=function(e){Fc=null,t.warn(F.L_LOGDB_CLOSED_S)},a.onerror=function(e){Fc=null,t.error(F.L_LOGDB_ERROR_E,e.target.error)},a.onabort=function(e){t.info(F.L_LOGDB_ABORT_S,e.target.error)},qc(3600*Math.max(24,Math.min(168,r))*1e3),n({appkey:e,db:a})):n(null)},o.onupgradeneeded=function(e){var t=e.target.result;Object.keys(Yc).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var r=t.createObjectStore(e,{autoIncrement:!0});Yc[e].forEach((function(e){return r.createIndex(e,e,{unique:!1})}))}))}})):t.warn(F.L_UNSUPPORT_INDEXDB_O))},Qc=[],Xc=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite");i.oncomplete=n,i.onabort=n;var a=i.objectStore(t);r.forEach((function(e){try{a.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},Zc=[],zc=!1,$c=function(e){return i(void 0,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return zc||0===Zc.length?[2]:(zc=!0,t=Zc.filter((function(e){return e.level<Kr.FATAL})),r=Zc.filter((function(e){return e.level>=Kr.FATAL})),Zc.length=0,[4,Xc(e,Bc,r)]);case 1:return n.sent(),[4,Xc(e,Hc,t)];case 2:return n.sent(),zc=!1,0===Zc.length&&Qc.length>0&&(Qc.forEach((function(e){return e.close()})),Qc.length=0),setTimeout((function(){return $c(e)})),[2]}}))}))},e_=function(){var e=un();return e.setLogReader((function(e,t,r,n,o){return void 0===o&&(o=Bc),i(void 0,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return[4,Fc];case 1:return(i=a.sent())?[2,new Promise((function(a){var s=i.db.transaction(o,"readonly").objectStore(o),u=[],l=IDBKeyRange.bound(e,t),c=s.index("time").openCursor(l);c.onsuccess=function(e){var t=e.target.result;if(t){var i=t.value;i.level<=r&&(n?i.sessionId===gt:i.level>=0)&&u.push(i),t.continue()}else a({logs:u})},c.onerror=function(){a({logs:[]})}}))]:[2,{logs:[]}]}}))}))})),e.setLogWriter((function(e){!function(e){i(void 0,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return[4,Fc];case 1:if(!(t=r.sent()))return[2];if(e.content&&Et(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return Zc.push(e),$c(t.db),[2]}}))}))}(e)})),e},t_=function(e,t){return i(void 0,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=t.get("logReporter"))["REPORT_SESSION_".concat(e)]={sessionId:gt},t.set("logReporter",r),[2]}))}))},r_=function(e,t){return i(void 0,void 0,void 0,(function(){var r,n;return a(this,(function(i){return r=t.get("logReporter"),[2,(null==(n=r["REPORT_SESSION_".concat(e)])?void 0:n.sessionId)===gt]}))}))},n_=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,r){return void 0===t&&(t=Date.now()-n_),void 0===r&&(r=Date.now()),i(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=t<0?Date.now()+t:t,(r=r<=0?Date.now():r)-t>n_&&(t=r-n_),n=un(),(i=new xc(e,"RC-IM","IM",n)).debug(F.T,"get logs: startTime ".concat(t," endTime ").concat(r)),Kc(e,i),[4,n.read(t,r,Kr.DEBUG,!1)];case 1:return o=a.sent().logs,i.debug(F.T,"get logs ".concat(o.length)),function(e,t){var r=t.map((function(e){var t=e.sessionId,r=e.time,n=e.type,i=e.level,a=e.tag,o=e.traceId,s=e.loggerId,u=e.content;return"".concat(t,",").concat(r,",").concat(n,",").concat(i,",").concat(a,",").concat(o,",").concat(s,',"').concat(u,'"\n')})),n=new Blob(r,{type:"text/csv"}),i=URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download="".concat(e,".csv"),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}("".concat(e,"-").concat(t,"-").concat(r),o),[2]}}))}))}}}}var i_,a_,o_,s_,u_,l_=function(e){function r(t,r,n,i,a){var o,s=po.runtimeInfo,u=s.type,l=s.version,c="".concat(u,"|").concat(l,"|").concat(r.getSessionId(),"|").concat(po.connectPlatform);return o=e.call(this,t,c,i,r)||this,Object.defineProperty(o,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"appStorage",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return t(r,e),Object.defineProperty(r.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.appStorage.deviceId}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return po.httpReq(e)}}),Object.defineProperty(r.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return i(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,t_(t.userId,this.appStorage)];case 1:return r.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))}}),Object.defineProperty(r.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,{success:!0,data:Bn(e.map(rn).join(""))}]}))}))}}),Object.defineProperty(r.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return i(this,void 0,void 0,(function(){return a(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,r,n,this.tableName)]}))}))}}),r}(tn),c_=function(e){function r(t,r,n){return e.call(this,t,r,Bc,r.proxy,n)||this}return t(r,e),Object.defineProperty(r.prototype,"isReporter",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,r_(this.userId,this.appStorage)];case 1:return[2,e.sent()]}}))}))}}),Object.defineProperty(r.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n,o,s,u,l){return void 0===l&&(l=!1),i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return[4,this.isReporter()];case 1:return i=a.sent(),this.userId&&!i?[2]:[2,e.prototype.report.call(this,t,r,n,o,s,u,l)]}}))}))}}),r}(l_),__=function(e){function r(t,r,n){return e.call(this,t,r,Hc,r.proxy,n)||this}return t(r,e),r}(l_),f_=function(e){function r(t,r,n){var i=e.call(this,"WebConversationSettings")||this;return i_.add(i),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:n}),a_.set(i,!1),i._ctx.on("sCmd",l(i,i_,"m",s_),i),i._ctx.on("onConnected",l(i,i_,"m",o_),i),i}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t=this;return a(this,(function(r){switch(r.label){case 0:return[4,l(this,i_,"m",u_).call(this,e)];case 1:return[2,r.sent().trans((function(){return{version:t._storage.get("conversationStatusVersion")}}))]}}))}))}}),Object.defineProperty(r.prototype,"syncDataFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=this._storage.get("conversationStatusVersion"),[4,l(this,i_,"m",u_).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),r}(pr);a_=new WeakMap,i_=new WeakSet,o_=function(){c(this,a_,!0,"f")},s_=function(e,t){var r=t.type,n=t.time;if(3===r)this.push(n),e.stopPropagation()},u_=function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),t.info(F.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),r),n=jl.encode(gs,{time:e}),[4,this._ctx.query($n.pullSeAtts,this._ctx.currentUserId,n,ps)];case 1:return(i=a.sent()).isOk&&(o=this._storage.updateBySessionStates(i.data.state)).length&&this._emitter.emit("conversationStatusChanged",o),s=this._storage.get("conversationStatusVersion"),t.summary(F.L_PULL_CONVERSATION_SETTINGS_R,i,r,{version:e,nextVersion:s},(function(e){return{respVer:e.version}})),l(this,a_,"f")&&(c(this,a_,!1,"f"),this._emitter.emit("conversationStatusSynced",i.code)),[2,i.wipe()]}}))}))};var d_,h_,g_,p_,E_,I_=function(){function e(){Object.defineProperty(this,"_memData",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._memData=this._syncDataHandler(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._memData[e].value}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._memData[e],n=r.key,i=r.stringify;r.value=t;var a=i?JSON.stringify(t):t;po.localStorage.setItem(n,a)}}),Object.defineProperty(e.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._memData[e];delete this._memData[e];var r=t.key;po.localStorage.removeItem(r)}}),e}(),b_=function(e){var t;return"".concat(null!==(t=e.channelId)&&void 0!==t?t:"","_").concat(e.conversationType,"_").concat(e.targetId)},T_=function(e){var t=s(e.split("_")),r=t[0],n=t[1],i=t.slice(2);return{channelId:r,conversationType:parseInt(n,10),targetId:i.join("_")}};function v_(e){if(e){if(Array.isArray(e))return e;var t=Object.entries(e).map((function(e){var t=s(e,2);return{tagId:t[0],isTop:t[1].isTop}}));return t}}var R_=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:Te.NOT_SET,translateStrategy:Un.DEFAULT,tags:[],channelType:te.PUBLIC,operationTime:0,draft:"",hidden:!1,includeRobot:!1,version:0}},m_=function(){function e(e){d_.set(this,void 0),h_.set(this,void 0),g_.set(this,void 0),p_.set(this,R_()),E_.set(this,[]),c(this,d_,e.conversationType,"f"),c(this,h_,e.targetId,"f"),c(this,g_,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return l(this,d_,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return l(this,h_,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return l(this,g_,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return l(this,p_,"f").version||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return l(this,p_,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!l(this,p_,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!l(this,p_,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return l(this,p_,"f").notificationLevel||Te.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateStrategy",{get:function(){return l(this,p_,"f").translateStrategy||Un.DEFAULT},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(l(this,p_,"f").tags||[]).map((function(e){return{tagId:e.tagId,isTop:e.isTop}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadCount",{get:function(){return l(this,p_,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return l(this,p_,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return l(this,p_,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!l(this,p_,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return l(this,p_,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return l(this,p_,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return l(this,p_,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return l(this,p_,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return l(this,p_,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return l(this,p_,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return l(this,p_,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return l(this,p_,"f").draft||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessage",{get:function(){return this.firstUnreadTime?{sentTime:this.firstUnreadTime,messageType:this.firstUnreadMessageType,messageUId:this.firstUnreadMessageUId}:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return{conversationType:l(this,d_,"f"),targetId:l(this,h_,"f"),channelId:l(this,g_,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return b_(this.identifier)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"includeRobot",{get:function(){return!!l(this,p_,"f").includeRobot},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){return n(n({},this.identifier),{latestMessage:this.latestMessage,unreadMessageCount:this.unreadCount,unreadMentionedCount:this.unreadMentionedCount,unreadMentionedMeCount:this.unreadMentionedMeCount,hasMentioned:this.hasMentioned,mentionedInfo:this.mentionedInfo,lastUnreadTime:0,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,notificationStatus:we(this.notificationLevel),isTop:this.isTop,operationTime:this.operationTime,firstUnreadMessage:this.firstUnreadMessage,versionTime:0,draft:this.draft,includeRobot:this.includeRobot})}}),Object.defineProperty(e.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};return this.isTop&&(e.to=!0),this.notificationLevel!==Te.NOT_SET&&(e.nl=this.notificationLevel),this.tags.length>0&&(e.tg=this.tags),this.translateStrategy!==Un.DEFAULT&&(e.ts=this.translateStrategy),this.hidden&&(e.h=!0),e}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.updateAttrs(n(n({},R_()),{tags:this.tags,isTop:this.isTop,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,hidden:!0}))}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:e,firstUnreadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0};return t.version=Math.max(this.version,e),this.updateAttrs(t,e)}}),Object.defineProperty(e.prototype,"updateAttrs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=0);var n={},i={latestMessage:"latestMessage",unreadCount:"unreadMessageCount",hasMentioned:"hasMentioned",mentionedInfo:"mentionedInfo",notificationLevel:"notificationLevel",tags:"tags",isTop:"isTop",translateStrategy:"translateStrategy",lastReadTime:void 0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0,firstUnreadTime:void 0,unreadMentionedCount:void 0,unreadMentionedMeCount:void 0,channelType:void 0,operationTime:void 0,draft:void 0,includeRobot:void 0,hidden:void 0,version:void 0};return Object.entries(i).forEach((function(i){var a=s(i,2),o=a[0],u=a[1],c=o;if(Object.prototype.hasOwnProperty.call(e,c)){var _=e[c];l(r,p_,"f")[c]!==_&&(l(r,p_,"f")[c]=_,u&&(n[u]={time:t,val:_}))}})),Object.keys(n).length>0?n:null}}),Object.defineProperty(e.prototype,"addRecvMessageRecord",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){l(this,E_,"f").push([e,t,r]),this.removeRecvMessageRecords(e-12e4)}}),Object.defineProperty(e.prototype,"removeRecvMessageRecords",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,E_,l(this,E_,"f").filter((function(t){return s(t,1)[0]<=e})),"f")}}),Object.defineProperty(e.prototype,"calibrateUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.mentionCnt,r=e.mentionMeCnt,n=e.clearTime,i=e.firstUnreadMsg,a=e.cnt,o=e.cutOffTime,u=t>0,c=u?{type:r>0?Y.SINGAL:Y.ALL}:void 0,_={unreadCount:a,unreadMentionedCount:t,unreadMentionedMeCount:r,lastReadTime:n,firstUnreadTime:null==i?void 0:i.msgTime,firstUnreadMessageType:null==i?void 0:i.className,firstUnreadMessageUId:null==i?void 0:i.msgId,hasMentioned:u,mentionedInfo:c,version:o};l(this,E_,"f").forEach((function(e){var t=s(e,3),r=t[0],n=t[1],i=t[2];r<=o||(_.version=Math.max(_.version,r),_.unreadCount+=n,i===Y.SINGAL?_.unreadMentionedMeCount+=n:i===Y.ALL&&(_.unreadMentionedCount+=n))}));var f=this.updateAttrs(_,n);return this.removeRecvMessageRecords(o),f}}),e}();d_=new WeakMap,h_=new WeakMap,g_=new WeakMap,p_=new WeakMap,E_=new WeakMap;var A_,y_,O_,S_=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toStoragItem.call(this);return this.unreadCount>0&&(t.c=this.unreadCount),this.unreadMentionedCount>0&&(t.mc=this.unreadMentionedCount),this.unreadMentionedMeCount>0&&(t.mmc=this.unreadMentionedMeCount),this.hasMentioned&&(t.hm=!0),this.mentionedInfo&&(t.m=this.mentionedInfo),this.firstUnreadMessageUId&&(t.fuid=this.firstUnreadMessageUId),this.firstUnreadMessageType&&(t.fumt=this.firstUnreadMessageType),this.firstUnreadTime&&(t.fut=this.firstUnreadTime),this.lastReadTime&&(t.rt=this.lastReadTime),this.version&&(t.v=this.version),t}}),r}(m_),N_=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toIReceivedConversation.call(this);return t.channelType=this.channelType,t}}),Object.defineProperty(r.prototype,"isDefaultChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!this.channelId||"RCDefault"===this.channelId}}),r}(m_),C_=function(e){return"".concat(e.targetId,"_").concat(e.channelId)},P_=function(e){function r(t){var r=e.call(this)||this;return A_.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"models",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(r,"ugSentRecord",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),r}return t(r,e),Object.defineProperty(r.prototype,"enableReadReceiptStorage",{get:function(){return this._ctx.initOptions.enableReadReceiptStorage},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=po.localStorage,n=e.appkey,i=e.currentUserId,a=e.isDisableEmptyUGChannelId;r.removeItem("RC-con-s-ver-".concat(n,"-").concat(i)),this.ugSentRecord.clear();var o=nt(n,i),u=rt(n,i),c=it(n,i),_=ze(n,i),f=Ze(n,i),d=$e(n,i),h=et(n,i),g=at(n,i),p=lt(n,i),E=r.getItem(o)||"0",I=r.getItem(u)||"0",b=r.getItem(c)||"1",T=r.getItem(f)||"0",v=JSON.parse(r.getItem(h)||"{}"),R=JSON.parse(r.getItem(_)||"{}"),m=JSON.parse(r.getItem(d)||"{}"),A=JSON.parse(r.getItem(g)||"{}"),y=JSON.parse(r.getItem(p)||"{}");l(this,A_,"m",y_).call(this,R,m,v,a);var O=Object.entries(y);return O.length>0&&O.forEach((function(e){var r=s(e,2),n=r[0],i=r[1];Object.entries(i).forEach((function(e){var r=s(e,2),n=r[0],a=r[1];delete a.d,a.t<t._ctx.serverTime-Ke&&delete i[n]})),0===Object.keys(i).length&&delete y[n]})),{inboxTime:{value:parseInt(E,10)||0,key:o},outboxTime:{value:parseInt(I,10)||0,key:u},broadcastTime:{value:parseInt(b,10)||0,key:c},conversationStatus:{value:R,key:_,stringify:!0},ultraGroupStatus:{value:m,key:d,stringify:!0},conversationStatusVersion:{value:parseInt(T,10)||0,key:f},conversationTypeGlobalSettings:{value:v,key:h,stringify:!0},sentRecord:{value:A,key:g,stringify:!0},readReceiptRecord:{value:y,key:p,stringify:!0}}}}),Object.defineProperty(r.prototype,"addUGSentRecord",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.ugSentRecord.set(e,t)}}),Object.defineProperty(r.prototype,"removeUGSentRecordByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;Array.from(this.ugSentRecord.entries()).forEach((function(r){var n=s(r,2),i=n[0];n[1]<=e&&t.ugSentRecord.delete(i)}))}}),Object.defineProperty(r.prototype,"isLocalSentUGMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.ugSentRecord.has(e)}}),Object.defineProperty(r.prototype,"addSentRecord",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("sentRecord");r[e]=t,this.set("sentRecord",r)}}),Object.defineProperty(r.prototype,"removeSentRecord",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("sentRecord");delete t[e],this.set("sentRecord",t)}}),Object.defineProperty(r.prototype,"removeSentRecordByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("sentRecord");Object.keys(t).forEach((function(r){t[r]<=e&&delete t[r]})),this.set("sentRecord",t)}}),Object.defineProperty(r.prototype,"isLocalSent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.get("sentRecord")[e]}}),Object.defineProperty(r.prototype,"addReadReceiptRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.content,i=e.senderUserId,a=e.sentTime,o=n.messageUId;if(r!==x.GROUP||!o)return!1;if(!this.enableReadReceiptStorage)return!0;if(a<this._ctx.serverTime-Ke)return!1;var u=this.get("readReceiptRecord"),l=C_(e),c=u[l]=u[l]||{};c[o]={t:e.sentTime,sId:i===t?void 0:i};var _=Object.entries(c);if(_.length>30){var f=s(_.sort((function(e,t){return e[1].t-t[1].t})).pop(),2),d=f[0];f[1],delete c[d]}return this.set("readReceiptRecord",u),!0}}),Object.defineProperty(r.prototype,"handleReadReceiptResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.content,i=e.senderUserId;if(e.sentTime,r!==x.GROUP||!n.receiptMessageDic)return!1;if(!this.enableReadReceiptStorage)return!0;var a=i===t,o=n.receiptMessageDic,u=C_(e),l=this.get("readReceiptRecord"),c=l[u]=l[u]||{};a?(Object.entries(o).forEach((function(e){var t=s(e,2);t[0],t[1].forEach((function(e){delete c[e]}))})),0===Object.keys(c).length&&delete l[u]):(o[t]||[]).forEach((function(e){var t=c[e];t&&(t.us=(t.us||[]).concat(i))}));return this.set("readReceiptRecord",l),!0}}),Object.defineProperty(r.prototype,"getReadReceiptResponseUsers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return(null===(r=(this.get("readReceiptRecord")[C_(e)]||{})[t])||void 0===r?void 0:r.us)||[]}}),Object.defineProperty(r.prototype,"createReadReceiptResponseContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("readReceiptRecord")[C_(e)]||{},r={receiptMessageDic:{}};return Object.entries(t).forEach((function(e){var t=s(e,2),n=t[0],i=t[1];i.sId&&(r.receiptMessageDic[i.sId]=r.receiptMessageDic[i.sId]||[],r.receiptMessageDic[i.sId].push(n))})),r}}),Object.defineProperty(r.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),this.models.clear(),l(this,A_,"m",O_).call(this)}}),Object.defineProperty(r.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("conversationTypeGlobalSettings");t===Te.NOT_SET?delete r[e]:r[e]={nl:t},this.set("conversationTypeGlobalSettings",r)}}),Object.defineProperty(r.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return(null===(t=this.get("conversationTypeGlobalSettings")[e])||void 0===t?void 0:t.nl)||Te.NOT_SET}}),Object.defineProperty(r.prototype,"getOrCreateModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.targetId;e.channelId;var i=this.getModel(e);if(!i){i=e.conversationType===x.ULTRA_GROUP?new N_(e):new S_(e);var a=(r===x.PRIVATE||r===x.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===n}));i.updateAttrs({includeRobot:a}),t&&this.models.set(i.key,i)}return i}}),Object.defineProperty(r.prototype,"updateConversationStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("ultraGroupStatus"),r=this.get("conversationStatus");e.forEach((function(e){var n=e.conversationType,i=e.key,a=e.toStoragItem(),o=Object.keys(a),s=0===o.length||1===o.length&&"h"===o[0],u=n===x.ULTRA_GROUP?t:r;s?delete u[i]:u[i]=a})),this.set("conversationStatus",r),this.set("ultraGroupStatus",t)}}),Object.defineProperty(r.prototype,"updateBySessionStates",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(!(null==e?void 0:e.length))return[];var r=this.get("conversationStatusVersion"),n=new Map,i=new Set;e.forEach((function(e){var a=e.channelId,o=e.busChannel,s=e.type,u=e.stateItem,l=e.time;r=Math.max(r,l);var c={};if(null==u||u.forEach((function(e){var t=e.tags,r=e.sessionStateType,n=e.value;switch(r){case mo.IsSilent:c.notificationLevel=parseInt(n,10);break;case mo.IsTop:c.isTop="1"===n;break;case mo.Tags:c.tags=t;break;case mo.AutoTrans:c.translateStrategy=parseInt(n,10)}})),a){var _={conversationType:s,targetId:a,channelId:o},f=t.getOrCreateModel(_,!0);i.add(f);var d=f.updateAttrs(c,l);if(d)if(n.has(f)){var h=n.get(f);Object.assign(h,d)}else n.set(f,d)}else void 0!==c.notificationLevel&&t.setConversationTypeNotificationLevel(s,c.notificationLevel)})),this.set("conversationStatusVersion",r),this.updateConversationStorage(Array.from(i));var a=Array.from(n.entries()).map((function(e){var t=s(e,2),r=t[0],n=t[1];return{conversation:r.toIReceivedConversation(),updatedItems:n}}));return a}}),Object.defineProperty(r.prototype,"addRelations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;e.forEach((function(e){var n=e.userId,i=e.type,a={conversationType:i,targetId:n,channelId:e.busChannel},o=r.getOrCreateModel(a,!0),s=function(e,t){var r,n,i,a=e.msg,o=e.isBot;return{latestMessage:a?Sc(a,t,!1,e.userId):void 0,lastReadTime:e.readMsgTime,unreadCount:e.unreadCount,operationTime:e.versionTime,unreadMentionedCount:e.remindCount,unreadMentionedMeCount:e.remindMeCount,firstUnreadMessageType:null===(r=e.msgInfo)||void 0===r?void 0:r.className,firstUnreadMessageUId:null===(n=e.msgInfo)||void 0===n?void 0:n.msgId,firstUnreadTime:null===(i=e.msgInfo)||void 0===i?void 0:i.msgTime,includeRobot:!!o}}(e,t);i===x.ULTRA_GROUP?o.updateAttrs(s):o.updateAttrs({latestMessage:s.latestMessage,operationTime:s.operationTime,includeRobot:s.includeRobot,hidden:!1})}))}}),Object.defineProperty(r.prototype,"getDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);return(null==t?void 0:t.draft)||""}}),Object.defineProperty(r.prototype,"setDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.getOrCreateModel(e,!0).updateAttrs({draft:t})}}),Object.defineProperty(r.prototype,"deleteDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);t&&t.updateAttrs({draft:""})}}),Object.defineProperty(r.prototype,"getCachedUGConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r={conversationType:x.ULTRA_GROUP,targetId:e,channelId:t},n=this.getModel(r);return(null==n?void 0:n.toIReceivedConversation())||null}}),Object.defineProperty(r.prototype,"getAllUGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.models.values();return Array.from(e).filter((function(e){return e.conversationType===x.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(r.prototype,"getAllSGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.models.values();return Array.from(e).filter((function(e){return e.conversationType!==x.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(r.prototype,"getAllModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Array.from(this.models.values())}}),Object.defineProperty(r.prototype,"getModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=b_(e),i=this.models.get(n);if(!i)return null;var a=(t===x.PRIVATE||t===x.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===r}));return i.updateAttrs({includeRobot:a}),i}}),Object.defineProperty(r.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);t&&(t.remove(),this.updateConversationStorage([t]))}}),Object.defineProperty(r.prototype,"getAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=0;return this.getAllSGModels().forEach((function(n){var i,a=n.conversationType;e.includes(a)&&(n.notificationLevel>Te.NOT_SET&&!t||(r+=null!==(i=n.unreadCount)&&void 0!==i?i:0))})),r}}),Object.defineProperty(r.prototype,"getTagConversationCountMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new Map;return this.getAllModels().forEach((function(t){var r=t.tags;r.length>0&&r.forEach((function(r){e.set(r.tagId,(e.get(r.tagId)||[]).concat(t.identifier))}))})),e}}),Object.defineProperty(r.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getModel(e);if(!r)return null;var n=r.clearUnreadCount(t);return this.updateConversationStorage([r]),n?{conversation:r.toIReceivedConversation(),updatedItems:n}:null}}),r}(I_);A_=new WeakSet,y_=function(e,t,r,n){Object.keys(e).forEach((function(t){var n=T_(t);ee(n.conversationType,W)?n.targetId||(r[n.conversationType]={nl:e[t].nl||Te.NOT_SET},delete e[t]):delete e[t]})),Object.keys(t).forEach((function(e){var i=T_(e);if(i.conversationType===x.ULTRA_GROUP)return i.targetId?void(n&&!i.channelId&&delete t[e]):(r[i.conversationType]={nl:t[e].nl||Te.NOT_SET},void delete t[e]);delete t[e]}))},O_=function(){var e=this,t=Object.entries(this.get("conversationStatus")),r=Object.entries(this.get("ultraGroupStatus"));u(u([],s(t),!1),s(r),!1).forEach((function(t){var r,n,i,a,o,u,l,c,_,f,d,h,g,p,E,I,b=s(t,2),T=b[0],v=b[1],R=T_(T);ee(R.conversationType,q)&&e.getOrCreateModel(R,!0).updateAttrs((n=(r=v).c,i=r.mc,a=r.mmc,o=r.hm,u=r.m,l=r.fut,c=r.fuid,_=r.fumt,f=r.nl,d=r.to,h=r.tg,g=r.rt,p=r.h,E=r.ts,I=r.v,{isTop:d,notificationLevel:f,tags:v_(h),unreadCount:n,unreadMentionedCount:i,unreadMentionedMeCount:a,hasMentioned:o,mentionedInfo:u,firstUnreadTime:l,firstUnreadMessageUId:c,firstUnreadMessageType:_,lastReadTime:g,hidden:p,translateStrategy:E,version:I||g}),0)}))};function M_(e){let t=e.length;for(;--t>=0;)e[t]=0}const L_=256,w_=286,U_=30,D_=15,G_=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),V_=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),j_=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),k_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),x_=new Array(576);M_(x_);const F_=new Array(60);M_(F_);const B_=new Array(512);M_(B_);const H_=new Array(256);M_(H_);const Y_=new Array(29);M_(Y_);const W_=new Array(U_);function J_(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let q_,K_,Q_;function X_(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}M_(W_);const Z_=e=>e<256?B_[e]:B_[256+(e>>>7)],z_=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},$_=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,z_(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},ef=(e,t,r)=>{$_(e,r[2*t],r[2*t+1])},tf=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},rf=(e,t,r)=>{const n=new Array(16);let i,a,o=0;for(i=1;i<=D_;i++)o=o+r[i-1]<<1,n[i]=o;for(a=0;a<=t;a++){let t=e[2*a+1];0!==t&&(e[2*a]=tf(n[t]++,t))}},nf=e=>{let t;for(t=0;t<w_;t++)e.dyn_ltree[2*t]=0;for(t=0;t<U_;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},af=e=>{e.bi_valid>8?z_(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},of=(e,t,r,n)=>{const i=2*t,a=2*r;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]},sf=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&of(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!of(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},uf=(e,t,r)=>{let n,i,a,o,s=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+s++],n+=(255&e.pending_buf[e.sym_buf+s++])<<8,i=e.pending_buf[e.sym_buf+s++],0===n?ef(e,i,t):(a=H_[i],ef(e,a+L_+1,t),o=G_[a],0!==o&&(i-=Y_[a],$_(e,i,o)),n--,a=Z_(n),ef(e,a,r),o=V_[a],0!==o&&(n-=W_[a],$_(e,n,o)))}while(s<e.sym_next);ef(e,256,t)},lf=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems;let o,s,u,l=-1;for(e.heap_len=0,e.heap_max=573,o=0;o<a;o++)0!==r[2*o]?(e.heap[++e.heap_len]=l=o,e.depth[o]=0):r[2*o+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,r[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=n[2*u+1]);for(t.max_code=l,o=e.heap_len>>1;o>=1;o--)sf(e,r,o);u=a;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],sf(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[2*u]=r[2*o]+r[2*s],e.depth[u]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[2*o+1]=r[2*s+1]=u,e.heap[1]=u++,sf(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,_,f,d,h,g=0;for(f=0;f<=D_;f++)e.bl_count[f]=0;for(r[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],f=r[2*r[2*c+1]+1]+1,f>u&&(f=u,g++),r[2*c+1]=f,c>n||(e.bl_count[f]++,d=0,c>=s&&(d=o[c-s]),h=r[2*c],e.opt_len+=h*(f+d),a&&(e.static_len+=h*(i[2*c+1]+d)));if(0!==g){do{for(f=u-1;0===e.bl_count[f];)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(f=u;0!==f;f--)for(c=e.bl_count[f];0!==c;)_=e.heap[--l],_>n||(r[2*_+1]!==f&&(e.opt_len+=(f-r[2*_+1])*r[2*_],r[2*_+1]=f),c--)}})(e,t),rf(r,l,e.bl_count)},cf=(e,t,r)=>{let n,i,a=-1,o=t[1],s=0,u=7,l=4;for(0===o&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s<u&&i===o||(s<l?e.bl_tree[2*i]+=s:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,a=i,0===o?(u=138,l=3):i===o?(u=6,l=3):(u=7,l=4))},_f=(e,t,r)=>{let n,i,a=-1,o=t[1],s=0,u=7,l=4;for(0===o&&(u=138,l=3),n=0;n<=r;n++)if(i=o,o=t[2*(n+1)+1],!(++s<u&&i===o)){if(s<l)do{ef(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==a&&(ef(e,i,e.bl_tree),s--),ef(e,16,e.bl_tree),$_(e,s-3,2)):s<=10?(ef(e,17,e.bl_tree),$_(e,s-3,3)):(ef(e,18,e.bl_tree),$_(e,s-11,7));s=0,a=i,0===o?(u=138,l=3):i===o?(u=6,l=3):(u=7,l=4)}};let ff=!1;const df=(e,t,r,n)=>{$_(e,0+(n?1:0),3),af(e),z_(e,r),z_(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};var hf=(e,t,r,n)=>{let i,a,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<L_;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),lf(e,e.l_desc),lf(e,e.d_desc),o=(e=>{let t;for(cf(e,e.dyn_ltree,e.l_desc.max_code),cf(e,e.dyn_dtree,e.d_desc.max_code),lf(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*k_[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?df(e,t,r,n):4===e.strategy||a===i?($_(e,2+(n?1:0),3),uf(e,x_,F_)):($_(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for($_(e,t-257,5),$_(e,r-1,5),$_(e,n-4,4),i=0;i<n;i++)$_(e,e.bl_tree[2*k_[i]+1],3);_f(e,e.dyn_ltree,t-1),_f(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),uf(e,e.dyn_ltree,e.dyn_dtree)),nf(e),n&&af(e)},gf={_tr_init:e=>{ff||((()=>{let e,t,r,n,i;const a=new Array(16);for(r=0,n=0;n<28;n++)for(Y_[n]=r,e=0;e<1<<G_[n];e++)H_[r++]=n;for(H_[r-1]=n,i=0,n=0;n<16;n++)for(W_[n]=i,e=0;e<1<<V_[n];e++)B_[i++]=n;for(i>>=7;n<U_;n++)for(W_[n]=i<<7,e=0;e<1<<V_[n]-7;e++)B_[256+i++]=n;for(t=0;t<=D_;t++)a[t]=0;for(e=0;e<=143;)x_[2*e+1]=8,e++,a[8]++;for(;e<=255;)x_[2*e+1]=9,e++,a[9]++;for(;e<=279;)x_[2*e+1]=7,e++,a[7]++;for(;e<=287;)x_[2*e+1]=8,e++,a[8]++;for(rf(x_,287,a),e=0;e<U_;e++)F_[2*e+1]=5,F_[2*e]=tf(e,5);q_=new J_(x_,G_,257,w_,D_),K_=new J_(F_,V_,0,U_,D_),Q_=new J_(new Array(0),j_,0,19,7)})(),ff=!0),e.l_desc=new X_(e.dyn_ltree,q_),e.d_desc=new X_(e.dyn_dtree,K_),e.bl_desc=new X_(e.bl_tree,Q_),e.bi_buf=0,e.bi_valid=0,nf(e)},_tr_stored_block:df,_tr_flush_block:hf,_tr_tally:(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(H_[r]+L_+1)]++,e.dyn_dtree[2*Z_(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{$_(e,2,3),ef(e,256,x_),(e=>{16===e.bi_valid?(z_(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var pf=(e,t,r,n)=>{let i=65535&e,a=e>>>16&65535,o=0;for(;0!==r;){o=r>2e3?2e3:r,r-=o;do{i=i+t[n++]|0,a=a+i|0}while(--o);i%=65521,a%=65521}return i|a<<16};const Ef=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var If=(e,t,r,n)=>{const i=Ef,a=n+r;e^=-1;for(let r=n;r<a;r++)e=e>>>8^i[255&(e^t[r])];return~e},bf={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Tf={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:vf,_tr_stored_block:Rf,_tr_flush_block:mf,_tr_tally:Af,_tr_align:yf}=gf,{Z_NO_FLUSH:Of,Z_PARTIAL_FLUSH:Sf,Z_FULL_FLUSH:Nf,Z_FINISH:Cf,Z_BLOCK:Pf,Z_OK:Mf,Z_STREAM_END:Lf,Z_STREAM_ERROR:wf,Z_DATA_ERROR:Uf,Z_BUF_ERROR:Df,Z_DEFAULT_COMPRESSION:Gf,Z_FILTERED:Vf,Z_HUFFMAN_ONLY:jf,Z_RLE:kf,Z_FIXED:xf,Z_DEFAULT_STRATEGY:Ff,Z_UNKNOWN:Bf,Z_DEFLATED:Hf}=Tf,Yf=258,Wf=262,Jf=42,qf=113,Kf=666,Qf=(e,t)=>(e.msg=bf[t],t),Xf=e=>2*e-(e>4?9:0),Zf=e=>{let t=e.length;for(;--t>=0;)e[t]=0},zf=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do{r=e.head[--n],e.head[n]=r>=i?r-i:0}while(--t);t=i,n=t;do{r=e.prev[--n],e.prev[n]=r>=i?r-i:0}while(--t)};let $f=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const ed=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},td=(e,t)=>{mf(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ed(e.strm)},rd=(e,t)=>{e.pending_buf[e.pending++]=t},nd=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},id=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=pf(e.adler,t,i,r):2===e.state.wrap&&(e.adler=If(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},ad=(e,t)=>{let r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-Wf?e.strstart-(e.w_size-Wf):0,l=e.window,c=e.w_mask,_=e.prev,f=e.strstart+Yf;let d=l[a+o-1],h=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,l[r+o]===h&&l[r+o-1]===d&&l[r]===l[a]&&l[++r]===l[a+1]){a+=2,r++;do{}while(l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&a<f);if(n=Yf-(f-a),a=f-Yf,n>o){if(e.match_start=t,o=n,n>=s)break;d=l[a+o-1],h=l[a+o]}}}while((t=_[t&c])>u&&0!=--i);return o<=e.lookahead?o:e.lookahead},od=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Wf)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),zf(e),n+=t),0===e.strm.avail_in)break;if(r=id(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=$f(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=$f(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Wf&&0!==e.strm.avail_in)},sd=(e,t)=>{let r,n,i,a=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,o=0,s=e.strm.avail_in;do{if(r=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>i&&(r=i),r<a&&(0===r&&t!==Cf||t===Of||r!==n+e.strm.avail_in))break;o=t===Cf&&r===n+e.strm.avail_in?1:0,Rf(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,ed(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&(id(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(0===o);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?4:t!==Of&&t!==Cf&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(id(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,a=i>e.w_size?e.w_size:i,n=e.strstart-e.block_start,(n>=a||(n||t===Cf)&&t!==Of&&0===e.strm.avail_in&&n<=i)&&(r=n>i?i:n,o=t===Cf&&0===e.strm.avail_in&&r===n?1:0,Rf(e,e.block_start,r,o),e.block_start+=r,ed(e.strm)),o?3:1)},ud=(e,t)=>{let r,n;for(;;){if(e.lookahead<Wf){if(od(e),e.lookahead<Wf&&t===Of)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=$f(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-Wf&&(e.match_length=ad(e,r)),e.match_length>=3)if(n=Af(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=$f(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=$f(e,e.ins_h,e.window[e.strstart+1]);else n=Af(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(td(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Cf?(td(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(td(e,!1),0===e.strm.avail_out)?1:2},ld=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<Wf){if(od(e),e.lookahead<Wf&&t===Of)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=$f(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-Wf&&(e.match_length=ad(e,r),e.match_length<=5&&(e.strategy===Vf||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=Af(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=$f(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(td(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=Af(e,0,e.window[e.strstart-1]),n&&td(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Af(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Cf?(td(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(td(e,!1),0===e.strm.avail_out)?1:2};function cd(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const _d=[new cd(0,0,0,0,sd),new cd(4,4,8,4,ud),new cd(4,5,16,8,ud),new cd(4,6,32,32,ud),new cd(4,4,16,16,ld),new cd(8,16,32,32,ld),new cd(8,16,128,128,ld),new cd(8,32,128,256,ld),new cd(32,128,258,1024,ld),new cd(32,258,258,4096,ld)];function fd(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Hf,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Zf(this.dyn_ltree),Zf(this.dyn_dtree),Zf(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Zf(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Zf(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const dd=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Jf&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==qf&&t.status!==Kf?1:0},hd=e=>{if(dd(e))return Qf(e,wf);e.total_in=e.total_out=0,e.data_type=Bf;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Jf:qf,e.adler=2===t.wrap?0:1,t.last_flush=-2,vf(t),Mf},gd=e=>{const t=hd(e);var r;return t===Mf&&((r=e.state).window_size=2*r.w_size,Zf(r.head),r.max_lazy_match=_d[r.level].max_lazy,r.good_match=_d[r.level].good_length,r.nice_match=_d[r.level].nice_length,r.max_chain_length=_d[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},pd=(e,t,r,n,i,a)=>{if(!e)return wf;let o=1;if(t===Gf&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>9||r!==Hf||n<8||n>15||t<0||t>9||a<0||a>xf||8===n&&1!==o)return Qf(e,wf);8===n&&(n=9);const s=new fd;return e.state=s,s.strm=e,s.status=Jf,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=t,s.strategy=a,s.method=r,gd(e)};var Ed={deflateInit:(e,t)=>pd(e,t,Hf,15,8,Ff),deflateInit2:pd,deflateReset:gd,deflateResetKeep:hd,deflateSetHeader:(e,t)=>dd(e)||2!==e.state.wrap?wf:(e.state.gzhead=t,Mf),deflate:(e,t)=>{if(dd(e)||t>Pf||t<0)return e?Qf(e,wf):wf;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===Kf&&t!==Cf)return Qf(e,0===e.avail_out?Df:wf);const n=r.last_flush;if(r.last_flush=t,0!==r.pending){if(ed(e),0===e.avail_out)return r.last_flush=-1,Mf}else if(0===e.avail_in&&Xf(t)<=Xf(n)&&t!==Cf)return Qf(e,Df);if(r.status===Kf&&0!==e.avail_in)return Qf(e,Df);if(r.status===Jf&&0===r.wrap&&(r.status=qf),r.status===Jf){let t=Hf+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=jf||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=n<<6,0!==r.strstart&&(t|=32),t+=31-t%31,nd(r,t),0!==r.strstart&&(nd(r,e.adler>>>16),nd(r,65535&e.adler)),e.adler=1,r.status=qf,ed(e),0!==r.pending)return r.last_flush=-1,Mf}if(57===r.status)if(e.adler=0,rd(r,31),rd(r,139),rd(r,8),r.gzhead)rd(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),rd(r,255&r.gzhead.time),rd(r,r.gzhead.time>>8&255),rd(r,r.gzhead.time>>16&255),rd(r,r.gzhead.time>>24&255),rd(r,9===r.level?2:r.strategy>=jf||r.level<2?4:0),rd(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(rd(r,255&r.gzhead.extra.length),rd(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=If(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(rd(r,0),rd(r,0),rd(r,0),rd(r,0),rd(r,0),rd(r,9===r.level?2:r.strategy>=jf||r.level<2?4:0),rd(r,3),r.status=qf,ed(e),0!==r.pending)return r.last_flush=-1,Mf;if(69===r.status){if(r.gzhead.extra){let t=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=If(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=i,ed(e),0!==r.pending)return r.last_flush=-1,Mf;t=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>t&&(e.adler=If(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=If(e.adler,r.pending_buf,r.pending-n,n)),ed(e),0!==r.pending)return r.last_flush=-1,Mf;n=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,rd(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=If(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=If(e.adler,r.pending_buf,r.pending-n,n)),ed(e),0!==r.pending)return r.last_flush=-1,Mf;n=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,rd(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=If(e.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(ed(e),0!==r.pending))return r.last_flush=-1,Mf;rd(r,255&e.adler),rd(r,e.adler>>8&255),e.adler=0}if(r.status=qf,ed(e),0!==r.pending)return r.last_flush=-1,Mf}if(0!==e.avail_in||0!==r.lookahead||t!==Of&&r.status!==Kf){let n=0===r.level?sd(r,t):r.strategy===jf?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(od(e),0===e.lookahead)){if(t===Of)return 1;break}if(e.match_length=0,r=Af(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(td(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Cf?(td(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(td(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===kf?((e,t)=>{let r,n,i,a;const o=e.window;for(;;){if(e.lookahead<=Yf){if(od(e),e.lookahead<=Yf&&t===Of)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=e.strstart+Yf;do{}while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);e.match_length=Yf-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=Af(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Af(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(td(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Cf?(td(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(td(e,!1),0===e.strm.avail_out)?1:2})(r,t):_d[r.level].func(r,t);if(3!==n&&4!==n||(r.status=Kf),1===n||3===n)return 0===e.avail_out&&(r.last_flush=-1),Mf;if(2===n&&(t===Sf?yf(r):t!==Pf&&(Rf(r,0,0,!1),t===Nf&&(Zf(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),ed(e),0===e.avail_out))return r.last_flush=-1,Mf}return t!==Cf?Mf:r.wrap<=0?Lf:(2===r.wrap?(rd(r,255&e.adler),rd(r,e.adler>>8&255),rd(r,e.adler>>16&255),rd(r,e.adler>>24&255),rd(r,255&e.total_in),rd(r,e.total_in>>8&255),rd(r,e.total_in>>16&255),rd(r,e.total_in>>24&255)):(nd(r,e.adler>>>16),nd(r,65535&e.adler)),ed(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Mf:Lf)},deflateEnd:e=>{if(dd(e))return wf;const t=e.state.status;return e.state=null,t===qf?Qf(e,Uf):Mf},deflateSetDictionary:(e,t)=>{let r=t.length;if(dd(e))return wf;const n=e.state,i=n.wrap;if(2===i||1===i&&n.status!==Jf||n.lookahead)return wf;if(1===i&&(e.adler=pf(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(Zf(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,od(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=$f(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,od(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,n.wrap=i,Mf},deflateInfo:"pako deflate (from Nodeca project)"};const Id=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var bd={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)Id(r,t)&&(e[t]=r[t])}}return e},flattenChunks:e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,i=e.length;t<i;t++){let i=e[t];r.set(i,n),n+=i.length}return r}};let Td=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Td=!1}const vd=new Uint8Array(256);for(let e=0;e<256;e++)vd[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;vd[254]=vd[254]=1;var Rd={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<o&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<o&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},buf2string:(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,i;const a=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){a[i++]=t;continue}let o=vd[t];if(o>4)a[i++]=65533,n+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&n<r;)t=t<<6|63&e[n++],o--;o>1?a[i++]=65533:t<65536?a[i++]=t:(t-=65536,a[i++]=55296|t>>10&1023,a[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Td)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r})(a,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+vd[e[r]]>t?r:t}};var md=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Ad=Object.prototype.toString,{Z_NO_FLUSH:yd,Z_SYNC_FLUSH:Od,Z_FULL_FLUSH:Sd,Z_FINISH:Nd,Z_OK:Cd,Z_STREAM_END:Pd,Z_DEFAULT_COMPRESSION:Md,Z_DEFAULT_STRATEGY:Ld,Z_DEFLATED:wd}=Tf;function Ud(e){this.options=bd.assign({level:Md,method:wd,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ld},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new md,this.strm.avail_out=0;let r=Ed.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Cd)throw new Error(bf[r]);if(t.header&&Ed.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Rd.string2buf(t.dictionary):"[object ArrayBuffer]"===Ad.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=Ed.deflateSetDictionary(this.strm,e),r!==Cd)throw new Error(bf[r]);this._dict_set=!0}}Ud.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,a;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Nd:yd,"string"==typeof e?r.input=Rd.string2buf(e):"[object ArrayBuffer]"===Ad.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===Od||a===Sd)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Ed.deflate(r,a),i===Pd)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Ed.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Cd;if(0!==r.avail_out){if(a>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Ud.prototype.onData=function(e){this.chunks.push(e)},Ud.prototype.onEnd=function(e){e===Cd&&(this.result=bd.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Dd=16209;var Gd=function(e,t){let r,n,i,a,o,s,u,l,c,_,f,d,h,g,p,E,I,b,T,v,R,m,A,y;const O=e.state;r=e.next_in,A=e.input,n=r+(e.avail_in-5),i=e.next_out,y=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=O.dmax,u=O.wsize,l=O.whave,c=O.wnext,_=O.window,f=O.hold,d=O.bits,h=O.lencode,g=O.distcode,p=(1<<O.lenbits)-1,E=(1<<O.distbits)-1;e:do{d<15&&(f+=A[r++]<<d,d+=8,f+=A[r++]<<d,d+=8),I=h[f&p];t:for(;;){if(b=I>>>24,f>>>=b,d-=b,b=I>>>16&255,0===b)y[i++]=65535&I;else{if(!(16&b)){if(64&b){if(32&b){O.mode=16191;break e}e.msg="invalid literal/length code",O.mode=Dd;break e}I=h[(65535&I)+(f&(1<<b)-1)];continue t}for(T=65535&I,b&=15,b&&(d<b&&(f+=A[r++]<<d,d+=8),T+=f&(1<<b)-1,f>>>=b,d-=b),d<15&&(f+=A[r++]<<d,d+=8,f+=A[r++]<<d,d+=8),I=g[f&E];;){if(b=I>>>24,f>>>=b,d-=b,b=I>>>16&255,16&b){if(v=65535&I,b&=15,d<b&&(f+=A[r++]<<d,d+=8,d<b&&(f+=A[r++]<<d,d+=8)),v+=f&(1<<b)-1,v>s){e.msg="invalid distance too far back",O.mode=Dd;break e}if(f>>>=b,d-=b,b=i-a,v>b){if(b=v-b,b>l&&O.sane){e.msg="invalid distance too far back",O.mode=Dd;break e}if(R=0,m=_,0===c){if(R+=u-b,b<T){T-=b;do{y[i++]=_[R++]}while(--b);R=i-v,m=y}}else if(c<b){if(R+=u+c-b,b-=c,b<T){T-=b;do{y[i++]=_[R++]}while(--b);if(R=0,c<T){b=c,T-=b;do{y[i++]=_[R++]}while(--b);R=i-v,m=y}}}else if(R+=c-b,b<T){T-=b;do{y[i++]=_[R++]}while(--b);R=i-v,m=y}for(;T>2;)y[i++]=m[R++],y[i++]=m[R++],y[i++]=m[R++],T-=3;T&&(y[i++]=m[R++],T>1&&(y[i++]=m[R++]))}else{R=i-v;do{y[i++]=y[R++],y[i++]=y[R++],y[i++]=y[R++],T-=3}while(T>2);T&&(y[i++]=y[R++],T>1&&(y[i++]=y[R++]))}break}if(64&b){e.msg="invalid distance code",O.mode=Dd;break e}I=g[(65535&I)+(f&(1<<b)-1)]}}break}}while(r<n&&i<o);T=d>>3,r-=T,d-=T<<3,f&=(1<<d)-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<o?o-i+257:257-(i-o),O.hold=f,O.bits=d};const Vd=15,kd=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),xd=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Fd=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Bd=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Hd=(e,t,r,n,i,a,o,s)=>{const u=s.bits;let l,c,_,f,d,h,g=0,p=0,E=0,I=0,b=0,T=0,v=0,R=0,m=0,A=0,y=null;const O=new Uint16Array(16),S=new Uint16Array(16);let N,C,P,M=null;for(g=0;g<=Vd;g++)O[g]=0;for(p=0;p<n;p++)O[t[r+p]]++;for(b=u,I=Vd;I>=1&&0===O[I];I--);if(b>I&&(b=I),0===I)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(E=1;E<I&&0===O[E];E++);for(b<E&&(b=E),R=1,g=1;g<=Vd;g++)if(R<<=1,R-=O[g],R<0)return-1;if(R>0&&(0===e||1!==I))return-1;for(S[1]=0,g=1;g<Vd;g++)S[g+1]=S[g]+O[g];for(p=0;p<n;p++)0!==t[r+p]&&(o[S[t[r+p]]++]=p);if(0===e?(y=M=o,h=20):1===e?(y=kd,M=xd,h=257):(y=Fd,M=Bd,h=0),A=0,p=0,g=E,d=a,T=b,v=0,_=-1,m=1<<b,f=m-1,1===e&&m>852||2===e&&m>592)return 1;for(;;){N=g-v,o[p]+1<h?(C=0,P=o[p]):o[p]>=h?(C=M[o[p]-h],P=y[o[p]-h]):(C=96,P=0),l=1<<g-v,c=1<<T,E=c;do{c-=l,i[d+(A>>v)+c]=N<<24|C<<16|P}while(0!==c);for(l=1<<g-1;A&l;)l>>=1;if(0!==l?(A&=l-1,A+=l):A=0,p++,0==--O[g]){if(g===I)break;g=t[r+o[p]]}if(g>b&&(A&f)!==_){for(0===v&&(v=b),d+=E,T=g-v,R=1<<T;T+v<I&&(R-=O[T+v],!(R<=0));)T++,R<<=1;if(m+=1<<T,1===e&&m>852||2===e&&m>592)return 1;_=A&f,i[_]=b<<24|T<<16|d-a}}return 0!==A&&(i[d+A]=g-v<<24|64<<16),s.bits=b,0};const{Z_FINISH:Yd,Z_BLOCK:Wd,Z_TREES:Jd,Z_OK:qd,Z_STREAM_END:Kd,Z_NEED_DICT:Qd,Z_STREAM_ERROR:Xd,Z_DATA_ERROR:Zd,Z_MEM_ERROR:zd,Z_BUF_ERROR:$d,Z_DEFLATED:eh}=Tf,th=16180,rh=16190,nh=16191,ih=16192,ah=16194,oh=16199,sh=16200,uh=16206,lh=16209,ch=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function _h(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const fh=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<th||t.mode>16211?1:0},dh=e=>{if(fh(e))return Xd;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=th,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,qd},hh=e=>{if(fh(e))return Xd;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,dh(e)},gh=(e,t)=>{let r;if(fh(e))return Xd;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Xd:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,hh(e))},ph=(e,t)=>{if(!e)return Xd;const r=new _h;e.state=r,r.strm=e,r.window=null,r.mode=th;const n=gh(e,t);return n!==qd&&(e.state=null),n};let Eh,Ih,bh=!0;const Th=e=>{if(bh){Eh=new Int32Array(512),Ih=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Hd(1,e.lens,0,288,Eh,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Hd(2,e.lens,0,32,Ih,0,e.work,{bits:5}),bh=!1}e.lencode=Eh,e.lenbits=9,e.distcode=Ih,e.distbits=5},vh=(e,t,r,n)=>{let i;const a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(t.subarray(r-n,r-n+i),a.wnext),(n-=i)?(a.window.set(t.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0};var Rh={inflateReset:hh,inflateReset2:gh,inflateResetKeep:dh,inflateInit:e=>ph(e,15),inflateInit2:ph,inflate:(e,t)=>{let r,n,i,a,o,s,u,l,c,_,f,d,h,g,p,E,I,b,T,v,R,m,A=0;const y=new Uint8Array(4);let O,S;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(fh(e)||!e.output||!e.input&&0!==e.avail_in)return Xd;r=e.state,r.mode===nh&&(r.mode=ih),o=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,c=r.bits,_=s,f=u,m=qd;e:for(;;)switch(r.mode){case th:if(0===r.wrap){r.mode=ih;break}for(;c<16;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(2&r.wrap&&35615===l){0===r.wbits&&(r.wbits=15),r.check=0,y[0]=255&l,y[1]=l>>>8&255,r.check=If(r.check,y,2,0),l=0,c=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=lh;break}if((15&l)!==eh){e.msg="unknown compression method",r.mode=lh;break}if(l>>>=4,c-=4,R=8+(15&l),0===r.wbits&&(r.wbits=R),R>15||R>r.wbits){e.msg="invalid window size",r.mode=lh;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&l?16189:nh,l=0,c=0;break;case 16181:for(;c<16;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(r.flags=l,(255&r.flags)!==eh){e.msg="unknown compression method",r.mode=lh;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=lh;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&4&r.wrap&&(y[0]=255&l,y[1]=l>>>8&255,r.check=If(r.check,y,2,0)),l=0,c=0,r.mode=16182;case 16182:for(;c<32;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}r.head&&(r.head.time=l),512&r.flags&&4&r.wrap&&(y[0]=255&l,y[1]=l>>>8&255,y[2]=l>>>16&255,y[3]=l>>>24&255,r.check=If(r.check,y,4,0)),l=0,c=0,r.mode=16183;case 16183:for(;c<16;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&4&r.wrap&&(y[0]=255&l,y[1]=l>>>8&255,r.check=If(r.check,y,2,0)),l=0,c=0,r.mode=16184;case 16184:if(1024&r.flags){for(;c<16;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&4&r.wrap&&(y[0]=255&l,y[1]=l>>>8&255,r.check=If(r.check,y,2,0)),l=0,c=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(d=r.length,d>s&&(d=s),d&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+d),R)),512&r.flags&&4&r.wrap&&(r.check=If(r.check,n,d,a)),s-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===s)break e;d=0;do{R=n[a+d++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R))}while(R&&d<s);if(512&r.flags&&4&r.wrap&&(r.check=If(r.check,n,d,a)),s-=d,a+=d,R)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===s)break e;d=0;do{R=n[a+d++],r.head&&R&&r.length<65536&&(r.head.comment+=String.fromCharCode(R))}while(R&&d<s);if(512&r.flags&&4&r.wrap&&(r.check=If(r.check,n,d,a)),s-=d,a+=d,R)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;c<16;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(4&r.wrap&&l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=lh;break}l=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=nh;break;case 16189:for(;c<32;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}e.adler=r.check=ch(l),l=0,c=0,r.mode=rh;case rh:if(0===r.havedict)return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=c,Qd;e.adler=r.check=1,r.mode=nh;case nh:if(t===Wd||t===Jd)break e;case ih:if(r.last){l>>>=7&c,c-=7&c,r.mode=uh;break}for(;c<3;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}switch(r.last=1&l,l>>>=1,c-=1,3&l){case 0:r.mode=16193;break;case 1:if(Th(r),r.mode=oh,t===Jd){l>>>=2,c-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=lh}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=lh;break}if(r.length=65535&l,l=0,c=0,r.mode=ah,t===Jd)break e;case ah:r.mode=16195;case 16195:if(d=r.length,d){if(d>s&&(d=s),d>u&&(d=u),0===d)break e;i.set(n.subarray(a,a+d),o),s-=d,a+=d,u-=d,o+=d,r.length-=d;break}r.mode=nh;break;case 16196:for(;c<14;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(r.nlen=257+(31&l),l>>>=5,c-=5,r.ndist=1+(31&l),l>>>=5,c-=5,r.ncode=4+(15&l),l>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=lh;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;c<3;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}r.lens[N[r.have++]]=7&l,l>>>=3,c-=3}for(;r.have<19;)r.lens[N[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},m=Hd(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,m){e.msg="invalid code lengths set",r.mode=lh;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;A=r.lencode[l&(1<<r.lenbits)-1],p=A>>>24,E=A>>>16&255,I=65535&A,!(p<=c);){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(I<16)l>>>=p,c-=p,r.lens[r.have++]=I;else{if(16===I){for(S=p+2;c<S;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(l>>>=p,c-=p,0===r.have){e.msg="invalid bit length repeat",r.mode=lh;break}R=r.lens[r.have-1],d=3+(3&l),l>>>=2,c-=2}else if(17===I){for(S=p+3;c<S;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}l>>>=p,c-=p,R=0,d=3+(7&l),l>>>=3,c-=3}else{for(S=p+7;c<S;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}l>>>=p,c-=p,R=0,d=11+(127&l),l>>>=7,c-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=lh;break}for(;d--;)r.lens[r.have++]=R}}if(r.mode===lh)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=lh;break}if(r.lenbits=9,O={bits:r.lenbits},m=Hd(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,m){e.msg="invalid literal/lengths set",r.mode=lh;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},m=Hd(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,m){e.msg="invalid distances set",r.mode=lh;break}if(r.mode=oh,t===Jd)break e;case oh:r.mode=sh;case sh:if(s>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=c,Gd(e,f),o=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,c=r.bits,r.mode===nh&&(r.back=-1);break}for(r.back=0;A=r.lencode[l&(1<<r.lenbits)-1],p=A>>>24,E=A>>>16&255,I=65535&A,!(p<=c);){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(E&&!(240&E)){for(b=p,T=E,v=I;A=r.lencode[v+((l&(1<<b+T)-1)>>b)],p=A>>>24,E=A>>>16&255,I=65535&A,!(b+p<=c);){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}l>>>=b,c-=b,r.back+=b}if(l>>>=p,c-=p,r.back+=p,r.length=I,0===E){r.mode=16205;break}if(32&E){r.back=-1,r.mode=nh;break}if(64&E){e.msg="invalid literal/length code",r.mode=lh;break}r.extra=15&E,r.mode=16201;case 16201:if(r.extra){for(S=r.extra;c<S;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;A=r.distcode[l&(1<<r.distbits)-1],p=A>>>24,E=A>>>16&255,I=65535&A,!(p<=c);){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(!(240&E)){for(b=p,T=E,v=I;A=r.distcode[v+((l&(1<<b+T)-1)>>b)],p=A>>>24,E=A>>>16&255,I=65535&A,!(b+p<=c);){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}l>>>=b,c-=b,r.back+=b}if(l>>>=p,c-=p,r.back+=p,64&E){e.msg="invalid distance code",r.mode=lh;break}r.offset=I,r.extra=15&E,r.mode=16203;case 16203:if(r.extra){for(S=r.extra;c<S;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=lh;break}r.mode=16204;case 16204:if(0===u)break e;if(d=f-u,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=lh;break}d>r.wnext?(d-=r.wnext,h=r.wsize-d):h=r.wnext-d,d>r.length&&(d=r.length),g=r.window}else g=i,h=o-r.offset,d=r.length;d>u&&(d=u),u-=d,r.length-=d;do{i[o++]=g[h++]}while(--d);0===r.length&&(r.mode=sh);break;case 16205:if(0===u)break e;i[o++]=r.length,u--,r.mode=sh;break;case uh:if(r.wrap){for(;c<32;){if(0===s)break e;s--,l|=n[a++]<<c,c+=8}if(f-=u,e.total_out+=f,r.total+=f,4&r.wrap&&f&&(e.adler=r.check=r.flags?If(r.check,i,f,o-f):pf(r.check,i,f,o-f)),f=u,4&r.wrap&&(r.flags?l:ch(l))!==r.check){e.msg="incorrect data check",r.mode=lh;break}l=0,c=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;c<32;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(4&r.wrap&&l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=lh;break}l=0,c=0}r.mode=16208;case 16208:m=Kd;break e;case lh:m=Zd;break e;case 16210:return zd;default:return Xd}return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=c,(r.wsize||f!==e.avail_out&&r.mode<lh&&(r.mode<uh||t!==Yd))&&vh(e,e.output,e.next_out,f-e.avail_out),_-=e.avail_in,f-=e.avail_out,e.total_in+=_,e.total_out+=f,r.total+=f,4&r.wrap&&f&&(e.adler=r.check=r.flags?If(r.check,i,f,e.next_out-f):pf(r.check,i,f,e.next_out-f)),e.data_type=r.bits+(r.last?64:0)+(r.mode===nh?128:0)+(r.mode===oh||r.mode===ah?256:0),(0===_&&0===f||t===Yd)&&m===qd&&(m=$d),m},inflateEnd:e=>{if(fh(e))return Xd;let t=e.state;return t.window&&(t.window=null),e.state=null,qd},inflateGetHeader:(e,t)=>{if(fh(e))return Xd;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,qd):Xd},inflateSetDictionary:(e,t)=>{const r=t.length;let n,i,a;return fh(e)?Xd:(n=e.state,0!==n.wrap&&n.mode!==rh?Xd:n.mode===rh&&(i=1,i=pf(i,t,r,0),i!==n.check)?Zd:(a=vh(e,t,r,r),a?(n.mode=16210,zd):(n.havedict=1,qd)))},inflateInfo:"pako inflate (from Nodeca project)"};var mh=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Ah=Object.prototype.toString,{Z_NO_FLUSH:yh,Z_FINISH:Oh,Z_OK:Sh,Z_STREAM_END:Nh,Z_NEED_DICT:Ch,Z_STREAM_ERROR:Ph,Z_DATA_ERROR:Mh,Z_MEM_ERROR:Lh}=Tf;function wh(e){this.options=bd.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new md,this.strm.avail_out=0;let r=Rh.inflateInit2(this.strm,t.windowBits);if(r!==Sh)throw new Error(bf[r]);if(this.header=new mh,Rh.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Rd.string2buf(t.dictionary):"[object ArrayBuffer]"===Ah.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Rh.inflateSetDictionary(this.strm,t.dictionary),r!==Sh)))throw new Error(bf[r])}function Uh(e,t){const r=new wh(t);if(r.push(e),r.err)throw r.msg||bf[r.err];return r.result}wh.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Oh:yh,"[object ArrayBuffer]"===Ah.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=Rh.inflate(r,o),a===Ch&&i&&(a=Rh.inflateSetDictionary(r,i),a===Sh?a=Rh.inflate(r,o):a===Mh&&(a=Ch));r.avail_in>0&&a===Nh&&r.state.wrap>0&&0!==e[r.next_in];)Rh.inflateReset(r),a=Rh.inflate(r,o);switch(a){case Ph:case Mh:case Ch:case Lh:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(0===r.avail_out||a===Nh))if("string"===this.options.to){let e=Rd.utf8border(r.output,r.next_out),t=r.next_out-e,i=Rd.buf2string(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(a!==Sh||0!==s){if(a===Nh)return a=Rh.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},wh.prototype.onData=function(e){this.chunks.push(e)},wh.prototype.onEnd=function(e){e===Sh&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=bd.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Dh={Inflate:wh,inflate:Uh,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Uh(e,t)},ungzip:Uh,constants:Tf};const{Inflate:Gh,inflate:Vh,inflateRaw:jh,ungzip:kh}=Dh;var xh=kh;function Fh(e){return Object.keys(e).map((function(t){var r=e[t];return"string"!=typeof r&&(r="".concat(r)),{key:t,value:r}}))}function Bh(e,t,r,n){return jl.encode(Iu,{targetId:e,type:x.GROUP,users:n,extProfile:r?Fh(r):void 0,settingProfile:Fh(t)})}var Hh,Yh,Wh,Jh,qh,Kh,Qh,Xh,Zh,zh,$h,eg=function(e,t){return jl.encode(es,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},tg=function(e){var t=jl.decode(Ho,e),r=t.compressioEnabled,n=t.compressedData,i=t.info,a=t.pullTime,o=t.isFinished,s=t.pageToken;if(r){var u=xh(n);return tg(u)}return{info:i,pullTime:a,isFinished:o,pageToken:s}},rg=function(e){var t=jl.decode(Po,e);if(t.compressioEnabled){var r=xh(t.compressedData);return rg(r)}return t},ng=function(e){var t=jl.decode(Mo,e);if(t.compressioEnabled){var r=xh(t.compressedData);return ng(r)}return{syncTime:t.syncTime,list:t.list.map((function(e){return jl.decode(Lo,new Uint8Array(e))}))}},ig=function(e){return jl.encode(Os,n(n({},e),{compress:Dn.enable()}))},ag=function(e){var t=jl.decode(Ns,e);if(t.compress){var r=xh(t.compressData);return ag(r)}return t},og=function(e){var t=jl.decode(Cs,e);if(t.compress){var r=xh(t.compressData);return og(r)}return t},sg=function(e){var t=e.listType,r=e.result,i=e.page,a=new Uint8Array(r),o=[];switch(t){case 1:o=jl.decode(yu,a).list;break;case 2:o=jl.decode(Au,a).list;break;case 3:o=jl.decode(Ou,a).list;break;case 11:o=jl.decode(ju,a).list;break;case 12:o=jl.decode(ku,a).list}return n(n({},i),{list:o})},ug=function(e){return jl.encode(Xo,n(n({},e),{compressioEnabled:Dn.enable(),ignoreCmd:!0}))},lg=function(e){var t=jl.decode(Zo,e);if(t.compressioEnabled){var r=xh(t.compressedData);return lg(r)}return t},cg=function(e,t){return jl.encode(Es,{ignoreVersion:!0,version:e,state:t})},_g=function(e){var t=jl.decode($u,e);if(t.compress){var r=xh(t.compressedData);return _g(r)}return t},fg=function(e){return jl.encode(cs,{timestamp:e,compressioEnabled:Dn.enable()})},dg=function(e){var t=jl.decode(us,e);if(t.compressioEnabled){var r=xh(t.compressedData);return dg(r)}return t},hg=function(e,t){var r,n,i,a,u=e.targetId,l=e.conversationType,c=e.channelId,_=t.messageType,f=t.isMentioned,d=t.disableNotification,h=t.canIncludeExpansion,g=t.pushConfig,p=t.directionalUserIdList,E=t.isVoipPush,I=t.isFilerWhiteBlacklist,b=t.content,T=t.pushContent,v=t.pushData,R=t.expansion,m=t.messageId,A=t.needReceipt,y=t.disableUpdateLastMessage,O=t.isStatusMessage,S=An(_).isPersited,N=Cc(_,f,d,h,O),C=function(e,t,r,n){var i=0;return e&&(i|=1),t&&(i|=2),r&&(i|=4),n&&(i|=8),i}(!!E,!I,!!(null==g?void 0:g.disablePushTitle),!!(null==g?void 0:g.forceShowDetailContent));if(b.user&&b.user.portraitUri&&(b.user.portrait=b.user.portraitUri),h&&R){i={};try{for(var P=o(Object.entries(R)),M=P.next();!M.done;M=P.next()){var L=s(M.value,2),w=L[0],U=L[1];i[w]={v:U}}}catch(e){r={error:e}}finally{try{M&&!M.done&&(n=P.return)&&n.call(P)}finally{if(r)throw r.error}}}if(g){var D=g.pushTitle,G=g.iOSConfig,V=g.androidConfig,j=g.templateId,k=g.harmonyOSConfig;a={title:D,pushConfigs:rr(G,V,k),pushId:null==V?void 0:V.notificationId,templateId:j}}var F=l===x.SYSTEM?u:void 0,B=0;return S&&y&&(B|=1),A&&(B|=2),jl.encode(Co,{sessionId:N,pushText:(null==g?void 0:g.pushContent)||T,appData:(null==g?void 0:g.pushData)||v,toUserIds:p,configFlag:C,classname:_,content:JSON.stringify(b),extraContent:i?JSON.stringify(i):void 0,pushExt:a,clientUniqueId:m,busChannel:c,systemId:F,optionBits:B})},gg=function(e){return jl.encode(Ru,n(n({},e),{type:x.GROUP}))},pg=function(e){return jl.encode(Su,n(n({},e),{type:x.GROUP}))},Eg=function(e){return jl.encode(vu,n(n({},e),{type:x.GROUP}))},Ig=function(e){var t=jl.decode(tl,e);if(t.compress){var r=xh(t.compressedData);return Ig(r)}return t},bg=((Hh={})[na]=k.RC_DISCONN_KICK,Hh[ia]=k.RC_DISCONN_EXCEPTION,Hh[oa]=k.RC_DISCONN_EXCEPTION,Hh[sa]=k.RC_CONN_REDIRECTED,Hh[ua]=k.RC_CONN_TOKEN_EXPIRED,Hh[la]=k.RC_CONN_PROTO_VERSION_ERROR,Hh[ca]=k.RC_ACCOUNT_CANCELLATION,Hh),Tg=((Yh={})[Gi]=k.SUCCESS,Yh[Vi]=k.RC_CONN_PROTO_VERSION_ERROR,Yh[ji]=k.RC_CONN_IDENTIFIER_REJECTED,Yh[ki]=k.RC_CONN_SERVER_UNAVAILABLE,Yh[xi]=k.RC_CONN_TOKEN_INCORRECT,Yh[Fi]=k.RC_CONN_NOT_AUTHRORIZED,Yh[Bi]=k.RC_CONN_REDIRECTED,Yh[Hi]=k.RC_CONN_PACKAGE_NAME_INVALID,Yh[Yi]=k.RC_CONN_APP_BLOCKED_OR_DELETED,Yh[Wi]=k.RC_CONN_USER_BLOCKED,Yh[Ji]=k.RC_CONN_TOKEN_EXPIRED,Yh[qi]=k.RC_CONN_DEVICE_ERROR,Yh[Ki]=k.RC_CONN_HOSTNAME_ERROR,Yh[Qi]=k.RC_DISCONN_SAME_CLIENT_ON_LINE,Yh[Xi]=k.RC_LISCENSE_COUNT_OUT_OF_LIMIT,Yh[Zi]=k.RC_CONN_WRONG_CLUSTER,Yh[zi]=k.RC_APP_AUTH_NOT_PASS,Yh[$i]=k.RC_OTP_USED,Yh[ea]=k.RC_PLATFORM_ERROR,Yh[ta]=k.RC_ACCOUNT_CANCELLATION,Yh[ra]=k.RC_LICENSE_EXPIRED,Yh),vg=function(e){return[$n.ppMsgS,$n.pgMsgS,$n.chatMsgS,$n.prMsgS].includes(e)},Rg=function(e){function r(t,r,n){var i=e.call(this,"WebSGMsgReceiver")||this;return Wh.add(i),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:n}),i._ctx.on("sMsg",l(i,Wh,"m",qh),i),i._ctx.on("syncMsg",l(i,Wh,"m",Jh),i),i}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c,_,f,d,h,g,p,E,I,b,T,v,R,m,A,y=this;return a(this,(function(a){switch(a.label){case 0:return r=this._ctx,n=r.logger,i=r.currentUserId,o=r.connectedTime,s=this._ctx.getNaviInfoFromCache(),u=this._storage.get("inboxTime"),c=this._storage.get("outboxTime"),_=this._storage.get("broadcastTime"),f=n.createTraceId(),n.info(F.L_PULL_MSG_T,JSON.stringify({inboxTime:u,outboxTime:c,broadcastTime:_}),f),d=jl.encode(No,{ispolling:!1,isPullSend:!0,syncTime:u,sendBoxSyncTime:c,broadcastSyncTime:_,compressioEnabled:Dn.enable()}),[4,this._ctx.query($n.pullMsg,this._ctx.currentUserId,d)];case 1:return(h=a.sent()).isOk?(g=rg(h.data.pbData),E=(p=g).list,I=p.finished,b=p.syncTime,T=p.broadcastSyncTime,v=c,R=E.map((function(e){var t=Nc(s,e,i,e.dataTime<o);return t.messageDirection===Ee.SEND&&(v=Math.max(v,t.sentTime)),t})),m=R.filter((function(e){var t=e.messageType===Re.RECALL?"Cmd:".concat(e.content.messageUId):e.messageUId;return!y._storage.isLocalSent(t)})),this._storage.removeSentRecordByTimestamp(v),this._storage.set("inboxTime",b),this._storage.set("broadcastTime",T||1),this._storage.set("outboxTime",v),n.info(F.L_PULL_MSG_R,JSON.stringify({code:0,inboxTime:b,broadcastTime:T,outboxTime:v,msgCount:R.length,afterFilteredCount:m.length,hasNext:!I}),f),A=Math.max(b,T||1,v),0===e&&this._emitter.emit("__firstOfflineMessageTime__",(null===(t=m[0])||void 0===t?void 0:t.sentTime)||0),l(this,Wh,"m",Kh).call(this,"pullMsg",m,!!I),[2,br({version:A,hasNext:!I})]):(n.warn(F.L_PULL_MSG_R,JSON.stringify({code:h.code}),f),[2,h.wipe()])}}))}))}}),r}(pr);Wh=new WeakSet,Jh=function(e,t,r){var n=t.conversationType,i=t.sentTime;n!==x.ULTRA_GROUP&&n!==x.CHATROOM&&(n===x.RTC_ROOM||vg(r)?l(this,Wh,"m",Kh).call(this,"syncMsg",[t],!0):(e.stopPropagation(),this.push(i)))},qh=function(e,t){var r=t.conversationType,n=t.sentTime,i=t.isStatusMessage;r!==x.CHATROOM&&(e.stopPropagation(),i||r===x.RTC_ROOM?l(this,Wh,"m",Kh).call(this,"smsg",[t],!0):this.push(n))},Kh=function(e,t,r){this._emitter.emit("messages",e,t,r)};var mg,Ag,yg=function(e){function r(t,r){var n=e.call(this,"WebUGMsgReceiver")||this;return Qh.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),n._ctx.on("syncMsg",l(n,Qh,"m",Zh),n),n._ctx.on("sCmd",l(n,Qh,"m",Xh),n),n}return t(r,e),Object.defineProperty(r.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,l(this,Qh,"m",$h).call(this,0)];case 1:return(e=a.sent()).isOk?(this._ctx.logger.info(F.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,l(this,Qh,"m",zh).call(this,0,[])]):(this._ctx.logger.warn(F.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(r=a.sent()).isOk?(n=r.data,i=n.length>0?n[n.length-1].versionTime:0,o=Math.max(t,i),[2,br({relations:n,msgVersion:o})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,c=this;return a(this,(function(a){switch(a.label){case 0:return[4,l(this,Qh,"m",$h).call(this,e)];case 1:return(t=a.sent()).isOk?(r=t.data,n=r.syncTime,i=r.finished,(null==(o=r.list)?void 0:o.length)&&(s=this._ctx.currentUserId,(u=o.filter((function(e){return!c._storage.isLocalSentUGMessage(e.msgId)})).map((function(e){return Sc(e,s,!1)}))).length>0&&this._ctx.emit("messagesFromUG",u,n)),this._storage.removeUGSentRecordByTimestamp(n),[2,br({version:n,hasNext:!i})]):[2,t.wipe()]}}))}))}}),r}(pr);Qh=new WeakSet,Xh=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},Zh=function(e,t){t.conversationType===x.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},zh=function e(t,r){return i(this,void 0,void 0,(function(){var n,i,o,c,_,f,d,h,g,p;return a(this,(function(a){switch(a.label){case 0:return n=this._ctx,i=n.currentUserId,o=n.logger,c=o.createTraceId(),o.info(F.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),c),_=jl.encode(Ds,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query($n.pullUgSes,i,_,void 0)];case 1:return f=a.sent(),o.summary(F.L_PULL_UG_RELATIONS_R,f,c,{ver:t}),f.isOk?(d=tg(f.data.pbData),h=d.info,g=d.isFinished,r.push.apply(r,u([],s(h),!1)),g?[2,br(r)]:(p=h[h.length-1].versionTime,[2,l(this,Qh,"m",e).call(this,p,r)])):[2,f.wipe()]}}))}))},$h=function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=n.createTraceId(),n.info(F.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),l=e,o=jl.encode(Gs,{syncTime:l,compressioEnabled:Dn.enable()}),[4,this._ctx.query($n.pullUgMsg,r,o)];case 1:return s=a.sent(),n.summary(F.L_PULL_ULTRA_MSG_R,s,i,{version:e}),s.isOk?(u=s.data,[2,br(rg(u.pbData))]):[2,s.wipe()]}var l}))}))};var Og,Sg,Ng,Cg=13,Pg=36,Mg=41,Lg=function(e){function r(t,r){var n=e.call(this,"WebServerEventHandler")||this;return mg.add(n),Object.defineProperty(n,"_con",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,u,c,_=this;return a(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(F.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,l(this,mg,"m",Ag).call(this,e)];case 1:return r=a.sent(),this._logger.summary(F.L_PULL_EVENT_CHANGE_R,r,t,{version:e}),r.isOk?(n=r.data,i=n.list,o=n.syncTime,u=n.hasNext,i.length&&(c=new Map,i.forEach((function(e){var t=e.changeType;c.has(t)?c.get(t).push(e):c.set(t,[e])})),Array.from(c.entries()).forEach((function(e){var t=s(e,2),r=t[0],n=t[1];_.emit("serverEvent",r,n)}))),[2,br({version:o,hasNext:u})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"noticeOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return e=this._logger.createTraceId(),this._logger.info(F.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,l(this,mg,"m",Ag).call(this,0)];case 1:return t=r.sent(),this._logger.summary(F.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),r}(pr);mg=new WeakSet,Ag=function(e){var t=jl.encode(xs,{syncTime:e});return this._con.query($n.pullEventChange,this._con.getCurrentUserId(),t,Fs)};var wg=function(e){function r(t){var r=e.call(this,"WebUGServerEventHandler")||this;return Og.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=jl.encode(xs,{syncTime:e}),[4,this._ctx.query($n.qryMsgChange,this._ctx.currentUserId,t,Bs)];case 1:return(r=a.sent()).isOk?(n=r.data,i=n.list,o=n.syncTime,s=n.hasNext,i&&i.length&&l(this,Og,"m",Sg).call(this,i),[2,br({version:o,hasNext:s})]):[2,r.wipe()]}}))}))}}),r}(pr);Og=new WeakSet,Sg=function(e){var t=[],r=[],n=[],i=[],a=[];e.forEach((function(e){switch(e.changeType){case 1:r.push(e);break;case 2:t.push(e);break;case 3:n.push(e);break;case 4:i.push(e);break;case 5:a.push(e)}})),r.length&&l(this,Og,"m",Ng).call(this,r,1),t.length&&l(this,Og,"m",Ng).call(this,t,2),n.length&&this.emit("ugMsgRecalled",e),i.length&&this._ctx.emit("ugChannelChanged",i),a.length&&this._ctx.emit("ugUserGroupChanged",a)},Ng=function(e,t){var r=this,n=new Map;e.forEach((function(e){var t=e.targetId,r=e.busChannel,i=e.msgUID,a="".concat(t,"-").concat(r),o=n.get(a);o?o.messageUIds.push(i):n.set(a,{conversationIdentifier:{conversationType:x.ULTRA_GROUP,targetId:t,channelId:r},messageUIds:[i]})})),Array.from(n.entries()).forEach((function(e){var n=s(e,2);n[0];var i=n[1];1===t?r.emit("ugMsgExpansion",i.conversationIdentifier,i.messageUIds):r.emit("ugMsgModify",i.conversationIdentifier,i.messageUIds)}))};var Ug,Dg,Gg,Vg,jg,kg,xg,Fg,Bg,Hg,Yg,Wg,Jg,qg,Kg,Qg,Xg,Zg,zg,$g,ep,tp,rp,np,ip,ap,op,sp,up,lp,cp,_p,fp,dp,hp,gp,pp,Ep,Ip,bp,Tp,vp,Rp,mp,Ap,yp,Op,Sp,Np=function(){return i(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,k.NOT_SUPPORT]}))}))},Cp=function(){return i(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,Tr(k.NOT_SUPPORT,"Not support")]}))}))},Pp=function(e){function r(t,r){var n=e.call(this,"WebSGMsgModifyReceiver")||this;return Ug.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),Dg.set(n,!0),n._ctx.on("onConnected",l(n,Ug,"m",Gg),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i,o,s,u,_;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger.createTraceId(),this._ctx.logger.info(F.L_PULL_MODIFY_MSG_T,JSON.stringify({time:e}),t),f={pullVersion:e},r=jl.encode(zu,n(n({},f),{modifyType:[1],compress:Dn.enable()})),[4,this._ctx.query($n.pullModifyMsg,this._ctx.currentUserId,r,void 0)];case 1:return i=a.sent(),this._ctx.logger.summary(F.L_PULL_MODIFY_MSG_R,i,t),i.isOk?(o=_g(i.data.pbData),s=o.msg,u=o.nextVersion,_=o.finished,s&&s.length&&l(this,Ug,"m",Vg).call(this,s),l(this,Dg,"f")&&(this._ctx.emit("messageModifiedSyncCompleted",!_),c(this,Dg,!1,"f")),[2,br({version:u,hasNext:!_})]):[2,i.wipe()]}var f}))}))}}),r}(pr);Dg=new WeakMap,Ug=new WeakSet,Gg=function(e,t){c(this,Dg,!0,"f"),t||this.reset()},Vg=function(e){var t=this,r=[],n=this._ctx.currentUserId;e.forEach((function(e){var i=e.msg;if(1===e.modifyType){var a=Sc(i,n,!1);r.push(a);var o=a.conversationType,s=a.targetId,u=a.channelId,l=t.storage.getModel({conversationType:o,targetId:s,channelId:u});if(l&&l.latestMessage){var c=l.latestMessage,_=c.messageUId,f=c.messageType,d=c.content;if(_!==a.messageUId){if(f===Re.REFERENCE){if(d.referMsgUid!==a.messageUId)return;d.referMsg=a.content}}else l.updateAttrs({latestMessage:a})}}})),r.length&&this._ctx.emit("messageModified",r)};var Mp=18e4,Lp=function(e){function r(t,r,n){var i=e.call(this)||this;return kg.add(i),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_userSettins",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),xg.set(i,void 0),Fg.set(i,void 0),Bg.set(i,void 0),Hg.set(i,void 0),Yg.set(i,void 0),Wg.set(i,!1),Jg.set(i,void 0),qg.set(i,!1),sp.set(i,1),Object.defineProperty(i,"getConversationListByPageIndex",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"getUntaggedConversationListByPage",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Rp.set(i,new Set),Object.defineProperty(i,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"setMessageSpeechToTextVisible",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"syncRemoteConversations",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"getMessagesAroundTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"deleteLocalUGMessagesForAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"getUnreadMentionedMessages",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"saveEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"getEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"clearEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(i,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),c(i,Jg,new gr,"f"),c(i,Yg,n,"f"),i.storage=new P_(t),i.settings=new f_(i._ctx,i.storage,i),c(i,xg,new yg(i._ctx,i.storage),"f"),c(i,Fg,new Rg(i._ctx,i.storage,l(i,Jg,"f")),"f"),c(i,Bg,new wg(i._ctx),"f"),c(i,Hg,new Pp(i._ctx,i.storage),"f"),l(i,Jg,"f").on("messages",l(i,kg,"m",tp),i),l(i,Jg,"f").on("__firstOfflineMessageTime__",(function(e,t){l(i,Hg,"f").setInitVersion(t||i._ctx.connectedTime)}),i),l(i,Bg,"f").on("ugMsgModify",l(i,kg,"m",cp),i),l(i,Bg,"f").on("ugMsgExpansion",l(i,kg,"m",_p),i),l(i,Bg,"f").on("ugMsgRecalled",l(i,kg,"m",fp),i),i._ctx.on("onConnected",l(i,kg,"m",op),i),i._ctx.on("onDisconnected",l(i,kg,"m",gp),i),i._ctx.on("onSuspend",l(i,kg,"m",gp),i),i._ctx.on("sCmd",l(i,kg,"m",pp),i),i._ctx.on("sNtf",l(i,kg,"m",Ep),i),i._ctx.on("signal",l(i,kg,"m",Ip),i),i._ctx.on("serverEvent",l(i,kg,"m",rp),i),i._ctx.on("robotsSynced",l(i,kg,"m",Kg),i),i}return t(r,e),Object.defineProperty(r.prototype,"ugSynced",{get:function(){return l(this,Wg,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c,_;return a(this,(function(a){return r=e.count,n=e.startTime,i=e.order,o=e.conversationTypes,t?(s=0!==n||i?n:Number.MAX_SAFE_INTEGER,u=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==x.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>s:e.operationTime<s)})).sort((function(e,t){return e.operationTime-t.operationTime})),c=Math.min(u.length,r),_=i?u.slice(0,c):u.slice(u.length-c),i||_.reverse(),[2,br(_.map((function(e){return e.toIReceivedConversation()})))]):[2,l(this,kg,"m",bp).call(this,n,r,i||0,o)]}))}))}}),Object.defineProperty(r.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){return n=((null==t?void 0:t.length)||0)>0?t:$(e?q:W),i="string"==typeof r&&""!==r,o=this.storage.getAllModels().filter((function(t){return t.isTop&&!t.hidden&&n.includes(t.conversationType)&&(t.conversationType!==x.ULTRA_GROUP&&(!i||t.channelId===r)||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,l(this,kg,"m",Tp).call(this,o)]}))}))}}),Object.defineProperty(r.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>Te.NOT_SET&&(t.conversationType!==x.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,l(this,kg,"m",Tp).call(this,t)]}))}))}}),Object.defineProperty(r.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){return r=((null==t?void 0:t.length)||0)>0?t:$(e?q:W),n=this.storage.getAllModels().filter((function(t){return t.unreadCount>0&&r.includes(t.conversationType)&&(t.conversationType!==x.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,l(this,kg,"m",Tp).call(this,n)]}))}))}}),Object.defineProperty(r.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return r="string"==typeof t,e?(n=this.storage.getAllModels().filter((function(e){return!(e.hidden||(e.conversationType===x.ULTRA_GROUP||r&&e.channelId!==t)&&e.channelId&&"RCDefault"!==e.channelId)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,br(n)]):[4,l(this,kg,"m",bp).call(this,0,1e3,0)];case 1:return[2,i.sent().trans((function(e){return e.filter((function(e){return!r||e.channelId===t}))}))]}}))}))}}),Object.defineProperty(r.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){return n=0,this.storage.getAllModels().forEach((function(i){i.unreadCount>0&&e.includes(i.conversationType)&&(i.conversationType!==x.ULTRA_GROUP&&(!r&&!i.channelId||i.channelId===r)||i.conversationType===x.ULTRA_GROUP&&(""===i.channelId||"RCDefault"===i.channelId))&&(t||i.notificationLevel<=Te.NOT_SET)&&(n+=i.unreadCount)})),[2,br(n)]}))}))}}),Object.defineProperty(r.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return t=this.storage.getOrCreateModel(e,!1),r=t.toIReceivedConversation(),[4,l(this,kg,"m",Tp).call(this,[r])];case 1:return(n=i.sent()).isOk?[2,n.trans((function(e){return e[0]}))]:[2,br(r)]}}))}))}}),Object.defineProperty(r.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var r,i,o,s,u,c,_=this;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,l(this,kg,"m",vp).call(this,e,r,t)];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.version,u=o.updateVersion,c=e.map((function(e){var r=_.storage.getOrCreateModel(e,!0);return r.updateAttrs({isTop:t,hidden:!n&&r.hidden,operationTime:r.hidden&&n?Date.now():r.operationTime}),r})),this.storage.updateConversationStorage(c),u&&this.storage.set("conversationStatusVersion",s),[2,br()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c=this;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,l(this,kg,"m",vp).call(this,e,r,void 0,t)];case 1:return(n=a.sent()).isOk?(i=n.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var r=c.storage.getOrCreateModel(e,!0);return r.updateAttrs({notificationLevel:t}),r})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,br()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c=this;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,l(this,kg,"m",vp).call(this,e,r,void 0,void 0,t)];case 1:return(n=a.sent()).isOk?(i=n.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var r=c.storage.getOrCreateModel(e,!0);return r.updateAttrs({translateStrategy:t}),r})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,br()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this.storage.getOrCreateModel(e,!1),[2,br(t.notificationLevel)]}))}))}}),Object.defineProperty(r.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this.storage.getConversationTypeNotificationLevel(e),[2,br(t)]}))}))}}),Object.defineProperty(r.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=this._ctx.currentUserId,i=jl.encode(Rs,{type:e,unpushLevel:t,version:r,ignoreVersion:!0}),[4,this._ctx.query($n.setTypeUnpush,n,i,ms)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,this.storage.setConversationTypeNotificationLevel(e,t),l&&this.storage.set("conversationStatusVersion",u),[2,br()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){return e=this.storage.getAllSGModels(),t=this._ctx.serverTime,e.forEach((function(e){return e.clearUnreadCount(t)})),this.storage.updateConversationStorage(e),[2,br()]}))}))}}),Object.defineProperty(r.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),n=jl.encode(as,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:r}),i=e.conversationType===x.ULTRA_GROUP?$n.delUgMsg:$n.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,n)];case 1:return(o=a.sent()).isOk?this._ctx.includeUg?((s=this.storage.getModel(e))&&(u=s.latestMessage)&&t.some((function(e){return e.messageUId===u.messageUId}))&&s.updateAttrs({latestMessage:null}),[2,br()]):[2,br()]:[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=jl.encode(Jo,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),n=wp[e.conversationType],[4,this._ctx.query(n,this._ctx.currentUserId,r)];case 1:return(i=a.sent()).isOk?this._ctx.includeUg?((o=this.storage.getModel(e))&&(s=o.latestMessage)&&(0===t||s.sentTime<=t)&&o.updateAttrs({latestMessage:null}),[2,br()]):[2,br()]:[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=jl.encode(qo,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query($n.cleanMsgBatch,this._ctx.currentUserId,t)];case 1:return(r=i.sent()).isOk?(e.forEach((function(e){var t=n.storage.getModel(e);if(t){var r=t.latestMessage;r&&(!e.timestamp||r.sentTime<=e.timestamp)&&t.updateAttrs({latestMessage:null})}})),[2,br()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return r=jl.encode(ys,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),n=t[0],[4,this._ctx.query($n.readReceipt,n,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,u,l;return a(this,(function(a){switch(a.label){case 0:return t=new Map,e.forEach((function(e){var r=b_(e.identifier),n=t.get(r)||new Set;n.add(e.messageUId),t.set(r,n)})),r=Array.from(t.entries()).map((function(e){var t=s(e,2),r=t[0],n=t[1],i=T_(r);return{targetId:i.targetId,type:i.conversationType,busChannel:i.channelId,msgIds:Array.from(n)}})),n=function(e){return jl.encode(Ss,{items:e,compress:Dn.enable()})}(r),[4,this._ctx.query($n.qryReceiptBatch,e[0].messageUId,n)];case 1:return(i=a.sent()).isOk?(o=i.data,u=og(o.pbData).item,l=[],u.forEach((function(e){var t,r={conversationType:e.type,targetId:e.targetId,channelId:e.busChannel};null===(t=e.msg)||void 0===t||t.forEach((function(e){var t=e.msgId,n=e.unreadCnt,i=e.readCnt,a=e.totalCnt;l.push({identifier:r,messageUId:t,unreadCount:n,readCount:i,totalCount:a})}))})),[2,br(l)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,_;return a(this,(function(a){switch(a.label){case 0:return n=0===r.readStatus?1:2,i=ig({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:1,pageType:1,pageToken:r.pageToken,pageSize:r.pageCount,readType:n,order:r.order?0:1}),[4,this._ctx.query($n.qryReceipt,t,i)];case 1:return(o=a.sent()).isOk?(s=o.data,u=ag(s.pbData),l=u.resp,c=u.pageToken,_=l[0],[2,br({pageToken:c||"",totalCount:1===n?_.readCnt:_.unreadCnt,users:(1===n?_.readUser:_.unreadUser).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,l,c;return a(this,(function(a){switch(a.label){case 0:return n=ig({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:r}),[4,this._ctx.query($n.qryReceipt,t,n)];case 1:return(i=a.sent()).isOk?(o=i.data,l=ag(o.pbData).resp,c=l[0],[2,br({pageToken:"",totalCount:0,users:u(u([],s(c.readUser),!1),s(c.unreadUser),!1).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=vr.create("requestSpeechToTextForMessage").isObject("option",t,!0).fail(k.BIZ_ERROR_INVALID_PARAMETER,"option type error").validate("messageType",null==t?void 0:t.messageType,(function(e){return e===Re.HQ_VOICE||e===Re.VOICE}),!0).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){if(t.messageType===Re.HQ_VOICE)e.validate("numberOfChannels",t.numberOfChannels,(function(e){return 1===e}),!0).fail(k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"numberOfChannels invalid").validate("sampleRate",t.sampleRate,(function(e){return 16e3===e||8e3===e}),!0).fail(k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"sampleRate invalid").isString("format",t.format).fail(k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"format invalid").isHttpUrl("remoteUrl",t.remoteUrl,!0).fail(k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"remoteUrl invalid");else{var r=t.content;e.isNotEmptyString("content",r,!0).fail(k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"content invalid")}})).isLimitedInteger("duration",t.duration,1,60,!0).fail(k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"duration invalid").result()).isOk?l(this,Rp,"f").has(e)?[2,Tr(k.SPEECH_TO_TEXT_REQUEST_IN_PROCESS,"speech to text request in process")]:(l(this,kg,"m",mp).call(this,e,t),[2,br()]):[2,r.wipe()]}))}))}}),Object.defineProperty(r.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=e.messageUId,r=e.messageContent,n=e.conversation,i=jl.encode(Vs,{targetId:n.targetId,type:n.conversationType,busChannel:n.channelId,msgUID:t,msgTime:0,content:JSON.stringify(r),fromUserId:""}),[4,this._ctx.query($n.modifyMsg,this._ctx.currentUserId,i,js)];case 1:return(o=a.sent()).isOk?((s=this.storage.getModel(n))&&(u=s.latestMessage,l=s.conversationType,u&&u.messageUId===t&&(u.content=r,u.isModifyMessage=!0,u.modifyInfo=l===x.ULTRA_GROUP?void 0:{timestamp:o.data.modifyTime,status:Hr,content:{}},s.updateAttrs({latestMessage:u}))),[2,br()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s=this;return a(this,(function(a){return(i=vr.create("refreshReferenceMessageWithParams").validate("messageInfoMap",o,(function(t){return t&&e.every((function(e){return t[e]&&mt(t[e])}))}),!0).fail(k.INVALID_PARAMETER_MESSAGE_INFO_MAP).result()).isOk?(setTimeout((function(){n([]),l(s,kg,"m",yp).call(s,e,t,r,o)}),0),[2,br()]):[2,i.wipe()]}))}))}}),Object.defineProperty(r.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,u,l,c,_,f,d,h,g,p=this;return a(this,(function(a){switch(a.label){case 0:return this._userSettins.hasTag(e)?(r=this.storage.get("conversationStatusVersion"),n=Date.now(),i=this._ctx.currentUserId,o=t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:n,stateItem:[{sessionStateType:mo.Tags,value:"",tags:[{tagId:e}]}]}})),u=cg(r,o),[4,this._ctx.query($n.addTag,i,u,vs)]):[2,Tr(k.TAG_NOT_EXIST)];case 1:return(l=a.sent()).isOk?(c=l.data,_=c.version,f=c.updateVersion,d=new Map,t.forEach((function(t){var r=p.storage.getOrCreateModel(t,!0),n={},i=r.tags;i.some((function(t){return t.tagId===e}))||(n.tags=i.concat({tagId:e}),d.set(r,n))})),h=[],g=[],Array.from(d.entries()).forEach((function(e){var t=s(e,2),r=t[0],n=t[1];g.push(r);var i=r.updateAttrs(n,_);i&&h.push({conversation:r.toIReceivedConversation(),updatedItems:i})})),this.storage.updateConversationStorage(g),f&&this.storage.set("conversationStatusVersion",_),h.length>0&&this.emit("conversationStatusChanged",h),[2,br()]):[2,l.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){return t=this.storage.getOrCreateModel(e,!1),r=this._userSettins.getTags(),n=t.tags.map((function(e){var t;return{tagId:e.tagId,tagName:null===(t=r[e.tagId])||void 0===t?void 0:t.tagName}})),[2,br(n)]}))}))}}),Object.defineProperty(r.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,_,f,d,h;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),i=r.isTop,o=this.storage.getOrCreateModel(t,!1),s=o.tags,(u=s.find((function(t){return t.tagId===e})))?(l=cg(n,[{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:mo.Tags,value:"",tags:[{tagId:e,isTop:i}]}]}]),c=this._ctx.currentUserId,[4,this._ctx.query($n.addTag,c,l,vs)]):[2,Tr(k.NO_TAG_IN_CONVER)];case 1:return(_=a.sent()).isOk?(f=_.data,d=f.version,h=f.updateVersion,u.isTop=i,o.updateAttrs({tags:s},d),this.storage.updateConversationStorage([o]),h&&this.storage.set("conversationStatusVersion",d),[2,br()]):[2,_.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,_=this;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=cg(r,t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:mo.Tags,value:"",tags:[{tagId:e}]}]}}))),i=this._ctx.currentUserId,[4,this._ctx.query($n.delTag,i,n,vs)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=t.map((function(t){var r=_.storage.getOrCreateModel(t,!0),n={tags:r.tags.filter((function(t){return t.tagId!==e}))};return r.updateAttrs(n,u),r})),this.storage.updateConversationStorage(c),l&&this.storage.set("conversationStatusVersion",u),[2,br()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,_,f;return a(this,(function(a){switch(a.label){case 0:return r=this._ctx.currentUserId,n=this.storage.get("conversationStatusVersion"),i=cg(n,[{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:Date.now(),stateItem:[{sessionStateType:mo.Tags,value:"",tags:t.map((function(e){return{tagId:e}}))}]}]),[4,this._ctx.query($n.delTag,r,i,vs)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=this.storage.getOrCreateModel(e,!0),_=c.tags,f={tags:_.filter((function(e){return!t.includes(e.tagId)}))},c.updateAttrs(f,u),this.storage.updateConversationStorage([c]),l&&this.storage.set("conversationStatusVersion",u),[2,br()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){return this._userSettins.hasTag(e)?(i=t||Number.MAX_SAFE_INTEGER,0===(o=this.storage.getAllSGModels().filter((function(t){return t.operationTime<i&&t.tags.some((function(t){return t.tagId===e}))})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r)).length?[2,br([])]:(s=o.map((function(t){return n(n({},t.toIReceivedConversation()),{isTopInTag:t.tags.some((function(t){return t.tagId===e&&t.isTop}))})})),[2,l(this,kg,"m",Tp).call(this,s)])):[2,br([])]}))}))}}),Object.defineProperty(r.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){return r=0,this.storage.getAllSGModels().forEach((function(n){var i;if(n.tags.some((function(t){return t.tagId===e}))){if(n.notificationLevel>Te.NOT_SET&&!t)return;r+=null!==(i=n.unreadCount)&&void 0!==i?i:0}})),[2,br(r)]}))}))}}),Object.defineProperty(r.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=e.identifiers,r=e.deleteMessages,n=jl.encode(is,{relation:t.map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),cleanMsg:r}),[4,this._ctx.query($n.delRelationBatch,this._ctx.currentUserId,n,void 0)];case 1:return(i=a.sent()).isOk&&t.forEach((function(e){var t=o.storage.getModel(e);t&&o.storage.removeConversation(t)})),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=jl.encode(As,{msgId:t,channelId:r}),[4,this._ctx.query($n.rrMsg,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.channelId,n=e.targetId,i=jl.encode(Ws,{targetId:n,type:t,busChannel:r||"",opType:0}),(o=new Sa($n.operate,i,n)).setHeaderQos(ii),[4,this._ctx.send(o)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){return t=e.targetId,r=e.channelType,n=this.storage.getAllUGModels().filter((function(e){return!(void 0!==t&&t!==e.targetId||void 0!==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})).map((function(e){var t=e.toIReceivedConversation();return t.unreadMentionedCount=Uc(t.unreadMentionedCount||0),t.unreadMessageCount=Uc(t.unreadMessageCount||0),t.unreadMentionedMeCount=Uc(t.unreadMentionedMeCount||0),t})),[2,br(n)]}))}))}}),Object.defineProperty(r.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=this._ctx.currentUserId,[4,l(this,kg,"m",Ap).call(this,e,t)];case 1:return(n=a.sent()).isOk?(i=n.data,o=i.list,i.notExistMsgId,s=o.map((function(t){return Sc(t,r,!1,e.targetId)})),[2,br(s)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.targetId,r=e.channelId,n=e.sentTime,i=e.count,o=jl.encode(Yo,{groupId:t,busChannel:r,msgTime:n,size:i}),[4,this._ctx.query($n.qryUgUal,this._ctx.currentUserId,o,Wo)];case 1:return(s=a.sent()).isOk?(u=s.data.msgInfo,[2,br(u.map((function(e){return{messageUId:e.msgId,sentTime:e.msgTime,messageType:e.className,mentionedType:e.remindType}})))]):[2,s.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var o;return i(this,void 0,void 0,(function(){var i,s,u,l,c,_,f,d;return a(this,(function(a){switch(a.label){case 0:return i=this._ctx.currentUserId,s=t.mid,u=t.put,l=t.del,c=t.clear,_=jl.encode(Vs,{fromUserId:i,targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgUID:s,msgTime:r,content:JSON.stringify(t)}),[4,this._ctx.query($n.upMsgEx,e.targetId,_)];case 1:return(f=a.sent()).isOk&&(null==(d=null===(o=this.storage.getModel(e))||void 0===o?void 0:o.latestMessage)?void 0:d.messageUId)===s&&(c?d.expansion={}:u?d.expansion=n(n({},d.expansion),u):l&&d.expansion&&l.forEach((function(e){delete d.expansion[e]}))),[2,f.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=jl.encode(bs,{unpushLevel:t,busChannel:r}),[4,this._ctx.query($n.ugUnpushSet,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i;return a(this,(function(a){switch(a.label){case 0:return r=jl.encode(Is,{busChannel:t}),[4,this._ctx.query($n.ugUnpushQuery,e,r,Ts)];case 1:return(n=a.sent()).isOk?(i=n.data.unpushLevel,[2,br(i)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){return r=this.storage.getModel(e),[2,br(null!==(t=null==r?void 0:r.unreadMentionedCount)&&void 0!==t?t:0)]}))}))}}),Object.defineProperty(r.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){return e=this.storage.getAllSGModels().reduce((function(e,t){return e+t.unreadMentionedCount}),0),[2,br(e)]}))}))}}),Object.defineProperty(r.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){return n=0,this.storage.getAllModels().forEach((function(i){if(e.includes(i.conversationType)){var a=i.notificationLevel,o=i.unreadCount,s=i.unreadMentionedCount;(0===t.length||t.includes(a))&&(n+=r?s:o)}})),[2,br(n)]}))}))}}),Object.defineProperty(r.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this.storage.getModel(e),[2,br(t?t.unreadCount:0)]}))}))}}),Object.defineProperty(r.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){return(t=this.storage.getModel(e))?(r=t.firstUnreadMessage,[2,br(r?{messageUId:r.messageUId||"",sentTime:r.sentTime}:null)]):[2,br(null)]}))}))}}),Object.defineProperty(r.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i;return a(this,(function(a){return n=this.storage.getAllUGModels(),i=n.reduce((function(n,i){var a=r?i.unreadMentionedCount:i.unreadCount;if(!a||i.targetId!==e)return n;var o=i.notificationLevel||Te.NOT_SET;return!t.length||t.includes(o)?n+a:n}),0),[2,br(Uc(i))]}))}))}}),Object.defineProperty(r.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this.storage.getAllUGModels().filter((function(t){return e.includes(t.targetId)})).map((function(e){return{conversationType:e.conversationType,type:e.conversationType,targetId:e.targetId,channelId:e.channelId,unreadMessageCount:Uc(e.unreadCount||0),mentionedCount:Uc(e.unreadMentionedCount||0),mentionedMeCount:Uc(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||Te.NOT_SET}})),[2,br(t)]}))}))}}),Object.defineProperty(r.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){return t=this.storage.getModel(e),(r=null==t?void 0:t.firstUnreadMessage)?[2,br(r)]:[2,Tr(k.RC_DB_DATA_NOT_FOUND)]}))}))}}),Object.defineProperty(r.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){return e=this.storage.getAllUGModels().filter((function(e){return e.notificationLevel>Te.NOT_SET})).map((function(e){return e.toIReceivedConversation()})),[2,br(e)]}))}))}}),Object.defineProperty(r.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.serverTime,e.conversationType!==x.ULTRA_GROUP?[3,2]:(r=eg(e,t),(n=new Sa($n.updUgRTime,r,this._ctx.currentUserId)).setHeaderQos(ii),[4,this._ctx.send(n)]);case 1:if(!(i=a.sent()).isOk)return[2,i.wipe()];a.label=2;case 2:return this.storage.clearConversationUnreadCount(e,t),[2,br()]}}))}))}}),Object.defineProperty(r.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return[4,l(this,kg,"m",Sp).call(this,t,r,e,[],Ge.ALL,$n.qrySessions)];case 1:return(i=a.sent()).isOk?(o=this._ctx.currentUserId,s=i.data.info.map((function(e){var t=e.unreadCount,r=e.busChannel,i=e.type,a=e.userId,s=e.versionTime,l=e.msg,c=u.storage.getOrCreateModel({conversationType:i,targetId:a,channelId:r||""},!1);return n(n({},c.toIReceivedConversation()),{unreadMessageCount:t,operationTime:s,latestMessage:l?Sc(l,o,!1,a):null})})).sort((function(e,t){var n,i,a=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0,o=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===r?o-a:a-o})),[2,br(s)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=jl.encode(zo,{nothing:1}),[4,this._ctx.query($n.qrySessionsAtt,this._ctx.currentUserId,e,$o)];case 1:return[2,t.sent().trans((function(e){return e.totalUnreadCount}))]}}))}))}}),Object.defineProperty(r.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return t=this._ctx.serverTime,this.storage.clearConversationUnreadCount(e,this._ctx.serverTime),r=eg(e,t),n=new Sa($n.updRRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=jl.encode(ts,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query($n.delSessions,this._ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=jl.encode(rs,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query($n.qrySessionsUnread,this._ctx.currentUserId,t,ns)];case 1:return[2,r.sent().trans((function(e){return e.sessions.map((function(e){return{conversationType:e.type,targetId:e.channelId,channelId:e.busChannel||"",unreadCount:e.unreadCount||0}}))}))]}}))}))}}),Object.defineProperty(r.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){return r=e.count,n=e.conversationTypes,i=e.timestamp||Number.MAX_SAFE_INTEGER,t?(o=this.storage.getAllModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&n.includes(e.conversationType)&&(e.conversationType!==x.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r),[2,br(o.map((function(e){return e.toIReceivedConversation()})))]):(s=this.storage.getAllSGModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&n.includes(e.conversationType)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r),u=s.map((function(e){return e.toIReceivedConversation()})),[2,l(this,kg,"m",Tp).call(this,u)])}))}))}}),Object.defineProperty(r.prototype,"loadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var i,o,s,u,l,c,_,f=this;return a(this,(function(a){switch(a.label){case 0:return i=function(e,t,r){var n=r.conversationTypes,i=r.tagFilter,a=void 0===i?{}:i,o=r.order;r.channelId;var s=a.tagIds,u=a.topPriority;return jl.encode(Bo,{type:n,count:t,order:o,tags:s,isTagTop:!!u,pageToken:e,compress:Dn.enable()})}(e,t,r),[4,this._ctx.query($n.qryRelationFilter,this._ctx.currentUserId,i,void 0)];case 1:return(o=a.sent()).isOk?(s=tg(o.data.pbData),u=s.pageToken,l=s.isFinished,c=s.info,_=c.map((function(e){var t=e.busChannel,r=e.type,i=e.userId,a={conversationType:r,targetId:i,channelId:t||""},o=f.storage.getOrCreateModel(a,!1);return n(n({},o.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?Sc(e.msg,f._ctx.currentUserId,!1,i):null})})),[2,br({pageToken:u||"",finished:!!l,list:_})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return r=eg(e,t),n=new Sa($n.updRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=jl.encode(As,{msgId:[t],channelId:r}),[4,this._ctx.query($n.rrList,e,n,Ps)];case 1:return[2,i.sent().trans((function(e){return{totalMemberCount:e.totalMemberNum,list:e.list}}))]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=e.conversationType,i=e.targetId,o=e.channelId,s=jl.encode(zs,{targetId:i,type:n,busChannel:o,startMsgId:t,endMsgId:r}),u=new Sa($n.sendMsgRead,s,i),[4,this._ctx.send(u)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return r=e.targetId,n=e.channelId,i=void 0===n?"":n,o=jl.encode($s,{targetId:r,busChannel:i,msgId:t}),[4,this._ctx.query($n.qryMsgRead,r,o,eu)];case 1:return[2,a.sent().trans((function(e){var t=e.list,r=e.num,n=e.readCnt;return{list:t.map((function(e){return{userId:e.userId,readTime:e.receiptTime}})),totalCount:r,readCount:n}}))]}}))}))}}),Object.defineProperty(r.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=e.targetId,i=e.conversationType,o=e.channelId,s=jl.encode(tu,{type:i,busChannel:o,msgId:t}),[4,this._ctx.query($n.qryMsgReadCntBatch,r,s,ru)];case 1:return[2,a.sent().trans((function(t){return t.result.map((function(t){return n({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}))]}}))}))}}),Object.defineProperty(r.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){return t=e.count,r=e.conversationTypes,this._ctx.includeUg?(n=e.timestamp||Number.MAX_SAFE_INTEGER,i=this.storage.getAllSGModels().filter((function(e){return e.includeRobot&&e.operationTime<n&&r.includes(e.conversationType)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,t),[2,br(i.map((function(e){return e.toIReceivedConversation()})))]):[2,l(this,kg,"m",bp).call(this,e.timestamp,t,0,r,Ge.ROBOT_ONLY)]}))}))}}),Object.defineProperty(r.prototype,"markRemoteConversationAsRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,l(this,Yg,"f").sendMessage(e,t,r)];case 1:return(n=a.sent()).isOk?(i=n.data.sentTime,(o=this.storage.getModel(e))&&(o.clearUnreadCount(i),this.storage.updateConversationStorage([o])),[2,n.wipe()]):[2,n.wipe()]}}))}))}}),r}(gr);xg=new WeakMap,Fg=new WeakMap,Bg=new WeakMap,Hg=new WeakMap,Yg=new WeakMap,Wg=new WeakMap,Jg=new WeakMap,qg=new WeakMap,sp=new WeakMap,Rp=new WeakMap,kg=new WeakSet,Kg=function(e,t,r){if(t===k.SUCCESS&&this._ctx.includeUg&&0!==r.length){var n=[x.PRIVATE,x.SYSTEM];this.storage.getAllSGModels().filter((function(e){return n.includes(e.conversationType)&&r.some((function(t){return t.robotId===e.targetId}))})).forEach((function(e){return e.updateAttrs({includeRobot:!0})}))}},Qg=function(e,t){var r=e.conversationType,i=e.targetId,a=e.channelId,o=e.senderUserId;if(e.messageType,r!==x.PRIVATE||o!==this._ctx.currentUserId)return!1;var s={conversationType:r,targetId:i,channelId:a},u=this.storage.getOrCreateModel(s,!0),l=u.clearUnreadCount(e.sentTime);return l&&t.set(u,n(n({},t.get(u)),l)),!0},Xg=function(e,t,r,i){var a=t.conversationType,o=t.targetId,s=t.channelId,u=t.senderUserId;t.messageType;var l=t.content;if(u!==this._ctx.currentUserId)return!1;var c={conversationType:a,targetId:o,channelId:s},_=this.storage.getOrCreateModel(c,!0),f=_.clearUnreadCount(t.sentTime);return f&&r.set(_,n(n({},r.get(_)),f)),_.removeRecvMessageRecords(t.sentTime),1!==e.sesDriven||(t.isOffLineMessage&&i.push(n(n({},c),{timestamp:l.lastMessageSendTime})),!1)},Zg=function(e,t){var r=e.conversationType,i=e.targetId,a=e.channelId,o=e.content,s={conversationType:r,targetId:i,channelId:a},u=r===x.PRIVATE?{privateReadReceipt:n(n({},s),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:n(n({},s),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})};t.push(u)},zg=function(e,t,r,i){var a,o=e.content,s=e.conversationType,u=e.targetId,l=e.channelId,c=e.isPersited,_=e.isStatusMessage,f=e.isCounted,d=e.messageType,h=e.isMentioned,g=e.senderUserId,p=e.disableUpdateLastMessage;if(ee(s,q)&&!_&&c&&!wc(r).isOk){var E={conversationType:s,targetId:u,channelId:l},I=this.storage.getOrCreateModel(E,!0),b=g===i,T=d===Re.RECALL,v={hidden:!1},R=function(){var r=I.updateAttrs(v,e.sentTime);r&&t.set(I,n(n({},t.get(I)),r))};if(T&&!I.hidden||(v.operationTime=e.sentTime),p||(v.latestMessage=r.supportRecallRefactor&&T?Lc(e,!0):e),b||I.version>=e.sentTime)R();else{if(v.version=e.sentTime,d===Re.RECALL){var m=o.sentTime;return m&&m>I.lastReadTime&&!(null===(a=e.__innerData__)||void 0===a?void 0:a.keepUnreadCount)&&(v.unreadCount=I.unreadCount-1,0===v.unreadCount&&(v.firstUnreadMessageUId="",v.firstUnreadTime=0,v.firstUnreadMessageType="",v.unreadMentionedCount=0,v.unreadMentionedMeCount=0,v.hasMentioned=!1,v.mentionedInfo=void 0),I.addRecvMessageRecord(m,-1)),void R()}if(f){var A;if(v.unreadCount=I.unreadCount+1,0===I.unreadCount&&(v.firstUnreadMessageUId=e.messageUId,v.firstUnreadTime=e.sentTime,v.firstUnreadMessageType=e.messageType),h&&o.mentionedInfo){var y=o.mentionedInfo,O=y.type,S=y.userIdList;O===Y.SINGAL&&(null==S?void 0:S.includes(i))?(A=Y.SINGAL,v.unreadMentionedMeCount=I.unreadMentionedMeCount+1,v.hasMentioned=!0,v.mentionedInfo=I.mentionedInfo||{type:O,userIdList:S}):O===Y.ALL&&(A=Y.ALL,v.unreadMentionedCount=I.unreadMentionedCount+1,v.hasMentioned=!0,v.mentionedInfo=I.mentionedInfo||{type:O,userIdList:S})}I.addRecvMessageRecord(e.sentTime,1,A),R()}else R()}}},$g=function(e,t){var r=e.conversationType,i=e.targetId,a=e.channelId,o=e.content,s={conversationType:r,targetId:i,channelId:a||""},u=o.put,l=o.del,c=o.mid,_=o.clear;if(u?t.push({updatedExpansion:n(n({},s),{messageUId:c,expansion:u})}):l&&t.push({deletedExpansion:n(n({},s),{messageUId:c,deletedKeys:l})}),this._ctx.includeUg){var f=this.storage.getModel(s);f&&f.latestMessage&&f.latestMessage.messageUId===c&&(_?f.latestMessage.expansion={}:u?f.latestMessage.expansion=n(n({},f.latestMessage.expansion),u):l&&f.latestMessage.expansion&&l.forEach((function(e){delete f.latestMessage.expansion[e]})))}},ep=function(e){var t=this,r=this._ctx.currentUserId,n=this._ctx.getNaviInfoFromCache(),i={v4ReadReceipts:[],v4SyncNotify:[],expansions:[],logCmdMessages:[],cloudControllerMessages:[],messages:[],updateModels:new Map};return i.messages=e.filter((function(e){switch(e.messageType){case Re.DELIVERED:case Re.DELIVERED_MSG:return!1;case Re.LOG_COMMAND:return i.logCmdMessages.push(e),!1;case Re.CLOUD_CONTROL:return i.cloudControllerMessages.push(e),!1;case Re.READ_RECEIPT:return l(t,kg,"m",Qg).call(t,e,i.updateModels);case Re.SYNC_READ_STATUS:return l(t,kg,"m",Xg).call(t,n,e,i.updateModels,i.v4SyncNotify);case Re.READ_STATE:return l(t,kg,"m",Zg).call(t,e,i.v4ReadReceipts),!1;case Re.READ_RECEIPT_REQUEST:return t.storage.addReadReceiptRequest(e,r);case Re.READ_RECEIPT_RESPONSE:return t.storage.handleReadReceiptResponse(e,r);case Re.EXPANSION_NOTIFY:return l(t,kg,"m",$g).call(t,e,i.expansions),!1;default:return l(t,kg,"m",zg).call(t,e,i.updateModels,n,r),!0}})),i},tp=function(e,t,r,n){e.stopPropagation(),this._ctx.recordReceivedMessagesForStatistics(r);var i=l(this,kg,"m",ep).call(this,r),a=i.messages,o=i.v4ReadReceipts,u=i.v4SyncNotify,_=i.expansions,f=i.logCmdMessages,d=i.cloudControllerMessages,h=i.updateModels;if(u.length&&this.emit("syncReadStatusV4",u),a.length&&this.emit("messages",t,a,n),!l(this,qg,"f")&&"pullMsg"===t&&n&&(c(this,qg,!0,"f"),this.emit("offlineFinished"),l(this,Hg,"f").startInterval(Mp,!0)),_.length&&this.emit("expansions",_),o.length&&this.emit("readReceiptV4",o),h.size){var g=[],p=[];Array.from(h.entries()).forEach((function(e){var t=s(e,2),r=t[0],n=t[1];p.push(r),g.push({conversation:r.toIReceivedConversation(),updatedItems:n})})),this.storage.updateConversationStorage(p),this.emit("conversationStatusChanged",g)}this._ctx.handleLogCmdMessages(f),this._ctx.handleCloudControllerMessage(d)},rp=function(e,t,r){if(t===Pg){e.stopPropagation();var n=[];r.forEach((function(e){if(0===e.subChangeType){var t=jl.decode(Wu,new Uint8Array(e.eventData)),r=t.msgId,i=t.unreadCnt,a=t.readCnt,o=t.readList,s=t.totalCnt;n.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:r,users:o.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}})),readCount:a,unreadCount:i,totalCount:s})}})),this._ctx.emit("readReceiptResponseV5",n)}},np=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return c(this,qg,!1,"f"),e||(l(this,Fg,"f").setInitVersion(0),this._ctx.includeUg&&l(this,kg,"m",up).call(this)),this._ctx.svrUnread?(e||this.storage.getAllSGModels().forEach((function(e){return e.clearUnreadCount(0)})),[4,l(this,kg,"m",ip).call(this,0)]):[3,2];case 1:t.sent(),t.label=2;case 2:return l(this,Fg,"f").startInterval(Mp,!0),[2]}}))}))},ip=function e(t,r,o){return void 0===r&&(r=new Map),i(this,void 0,void 0,(function(){var i,s,u,c,_,f,d,h,g,p=this;return a(this,(function(a){switch(a.label){case 0:return i=this._ctx,s=i.logger,u=i.currentUserId,c=s.createTraceId(),s.info(F.L_PULL_SG_UNREAD_COUNT_T,JSON.stringify({version:t,pageToken:o}),c),_=function(e,t){return jl.encode(el,{version:e,compress:Dn.enable(),pageToken:t})}(t,o),[4,this._ctx.query($n.pullSe,u,_,void 0)];case 1:return(f=a.sent()).isOk?(d=Ig(f.data.pbData),h=d.session,g=d.pageToken,s.summary(F.L_PULL_SG_UNREAD_COUNT_R,f,c,{nextPageToken:g}),h.forEach((function(e){var t=e.targetId,i=e.type,a=e.busChannel,o=e.unread,s=o;s.cnt,s.mentionCnt,s.mentionMeCnt,s.clearTime,s.cutOffTime,s.firstUnreadMsg;var u={conversationType:i,targetId:t,channelId:a},l=p.storage.getOrCreateModel(u,!0),c=l.calibrateUnreadCount(o);c&&r.set(l,n(n({},r.get(l)),c))})),g?[2,l(this,kg,"m",e).call(this,t,r,g)]:(this.storage.updateConversationStorage(Array.from(r.keys())),[2])):(s.warn(F.L_PULL_SG_UNREAD_COUNT_R,f.errmsg(),c),[2])}}))}))},ap=function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return e?[3,2]:(this.settings.reset(),[4,this.settings.syncDataFromServer()]);case 1:t=r.sent(),this.settings.setInitVersion(t),r.label=2;case 2:return this._ctx.isConnected&&this.settings.startInterval(Mp,!0),[2]}}))}))},op=function(e,t){c(this,Wg,!1,"f"),t||this.storage.syncDataFromLocalStorage(this._ctx),l(this,kg,"m",ap).call(this,t),l(this,kg,"m",np).call(this,t),this._ctx.ugEnabel&&l(this,kg,"m",hp).call(this,t)},up=function e(){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,_,f=this;return a(this,(function(a){switch(a.label){case 0:return this._ctx.isConnected?(t=this._ctx.logger,r=t.createTraceId(),n=l(this,sp,"f"),t.info(F.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:n}),r),[4,l(this,kg,"m",Sp).call(this,n,1,1e3)]):[2];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.info,u=o.isFinished,_=o.pullTime,c(this,sp,_,"f"),t.info(F.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:n,isFinished:u,pullTime:_}),r),this.storage.addRelations(s,this._ctx.currentUserId),u?(this.emit("sgRelationsSynced",k.SUCCESS),[2]):[2,l(this,kg,"m",e).call(this)]):(t.warn(F.L_PULL_SG_RELATIONS_R,i.errmsg(),r),setTimeout((function(){return l(f,kg,"m",e).call(f)}),1e3),[2])}}))}))},lp=function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return[4,l(this,kg,"m",Ap).call(this,e,t)];case 1:return(n=a.sent()).isOk?(i=n.data.list.map((function(t){return Sc(t,u._ctx.currentUserId,!1,e.targetId)})),(o=this.storage.getModel(e))&&o.latestMessage&&(s=i.find((function(e){return e.messageUId===o.latestMessage.messageUId})))&&o.updateAttrs({latestMessage:s}),2===r?this._ctx.emit("messageModified",i):1===r&&this._ctx.emit("ugMsgExpansionUpdated",i),[2]):[2]}}))}))},cp=function(e,t,r){l(this,kg,"m",lp).call(this,t,r,2)},_p=function(e,t,r){l(this,kg,"m",lp).call(this,t,r,1)},fp=function(e,t){var r=this,i=t.map((function(e){var t=e.targetId,i=e.busChannel,a=e.msgUID,o=e.msgTime,s=e.operatorId,u=e.remindType,c={conversationType:x.ULTRA_GROUP,targetId:t,channelId:i||""},_=n(n({},c),{messageUId:a,sentTime:o}),f=n(n({},c),{sentTime:o,messageUId:a,senderUserId:s,content:_,messageDirection:1,messageType:Re.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:me.UNREAD,receivedStatusInfo:jt(me.UNREAD)}),d=r.storage.getModel(c);return d&&l(r,kg,"m",dp).call(r,d,f,u),f}));this._ctx.emit("ugMsgRecalled",i)},dp=function(e,t,r){var n={},i=t.content,a=i.messageUId,o=i.sentTime,s=e.latestMessage;s&&s.messageUId===a&&(n.latestMessage=Lc(t,!0)),o&&e.lastReadTime<o&&e.unreadCount&&(n.unreadCount=e.unreadCount-1,r!==Y.ALL&&r!==Y.SINGAL||!e.unreadMentionedCount||(n.unreadMentionedCount=e.unreadMentionedCount-1),r===Y.SINGAL&&e.unreadMentionedCount&&(n.unreadMentionedMeCount=e.unreadMentionedMeCount-1));var u=e.updateAttrs(n,o);this.storage.updateConversationStorage([e]),u&&this.emit("conversationStatusChanged",[{conversation:e.toIReceivedConversation(),updatedItems:u}])},hp=function(e){return i(this,void 0,void 0,(function(){var e,t,r,n;return a(this,(function(i){switch(i.label){case 0:return[4,l(this,xg,"f").markOnline()];case 1:return(e=i.sent()).isOk?(t=e.data,r=t.relations,n=t.msgVersion,this.storage.addRelations(r,this._ctx.currentUserId),c(this,Wg,!0,"f"),this.emit("ultraGroupEnable"),l(this,xg,"f").setInitVersion(n),l(this,xg,"f").startInterval(Mp,!0),l(this,Bg,"f").setInitVersion(n),l(this,Bg,"f").startInterval(Mp,!0),[2]):[2]}}))}))},gp=function(){c(this,Wg,!1,"f"),this.settings.stopInterval(),l(this,xg,"f").reset(),l(this,Fg,"f").reset(),l(this,Bg,"f").reset()},pp=function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return 3===t.type?(e.stopPropagation(),this.settings.push(t.time),[2]):7===t.type?(e.stopPropagation(),l(this,Bg,"f").push(t.time),[2]):12===t.type?(e.stopPropagation(),l(this,Hg,"f").push(t.time),[2]):13!==t.type?[3,2]:(e.stopPropagation(),r=new Map,[4,l(this,kg,"m",ip).call(this,t.time,r)]);case 1:i.sent(),r.size>0&&(n=Array.from(r.entries()).map((function(e){var t=s(e,2),r=t[0],n=t[1];return{conversation:r.toIReceivedConversation(),updatedItems:n}})),this.emit("conversationStatusChanged",n)),i.label=2;case 2:return[2]}}))}))},Ep=function(e,t){1===t.type&&(e.stopPropagation(),l(this,Fg,"f").push(t.time))},Ip=function(e,t,r){var n=t.syncMsg,i=ti(t.topic);if(n&&i===$n.updUgRTime){e.stopPropagation();var a=jl.decode(es,t.pbData),o=a.channelId,s=a.busChannel,u=a.msgTime,l=this.storage.clearConversationUnreadCount({conversationType:x.ULTRA_GROUP,targetId:o,channelId:s||""},u);l&&this.emit("conversationStatusChanged",[l])}},bp=function(e,t,r,o,s){return i(this,void 0,void 0,(function(){var i,u,c,_,f,d=this;return a(this,(function(a){switch(a.label){case 0:return i=this._ctx.currentUserId,[4,l(this,kg,"m",Sp).call(this,e,r||0,t,o,s)];case 1:return(u=a.sent()).isOk?(c=u.data,_=c.info,c.isFinished,c.pullTime,f=_.map((function(e){var t=e.userId,r=e.type,a=e.busChannel,o=d.storage.getOrCreateModel({conversationType:r,targetId:t,channelId:a},!1);return n(n({},o.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?Sc(e.msg,i,!1,t):null})})),[2,br(f)]):[2,u.wipe()]}}))}))},Tp=function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return this._ctx.includeUg?[2,br(e)]:(t=this._ctx.currentUserId,r=e.filter((function(e){return e.conversationType!==x.ULTRA_GROUP})).map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),0===r.length?[2,br(e)]:(n=jl.encode(is,{relation:r}),[4,this._ctx.query($n.qryRLBatch,this._ctx.currentUserId,n,void 0)]));case 1:return(i=a.sent()).isOk?(l(this,kg,"m",Op).call(this,i.data.pbData).info.forEach((function(r){if(r.msg){var n=e.find((function(e){return(e.channelId||"")===(r.busChannel||"")&&e.targetId===r.userId&&e.conversationType===r.type}));n.latestMessage=Sc(r.msg,t,!1,r.userId),n.includeRobot=!!r.isBot}})),[2,br(e)]):[2,i.wipe()]}}))}))},vp=function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s;return a(this,(function(a){return i=[],void 0!==r&&i.push({sessionStateType:mo.IsTop,value:r?"1":"0"}),void 0!==n&&i.push({sessionStateType:mo.IsSilent,value:n.toString()}),void 0!==o&&i.push({sessionStateType:mo.AutoTrans,value:o.toString()}),s=cg(t,e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:i}}))),[2,this._ctx.query($n.setSeAtt,this._ctx.currentUserId,s,vs)]}))}))},mp=function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return l(this,Rp,"f").add(e),r=t.messageType===Re.HQ_VOICE?{msgId:e,objectName:t.messageType,content:t.remoteUrl,sampleRate:t.sampleRate,channelNumber:t.numberOfChannels,format:t.format}:{msgId:e,objectName:t.messageType,content:t.content},n=jl.encode(Ju,{businessType:1,businessInfo:jl.encode(qu,r)}),[4,this._ctx.query($n.upConvertMsg,e,n,Ku)];case 1:return i=a.sent(),l(this,Rp,"f").delete(e),o=i.code,i.isOk?(u=jl.decode(Qu,new Uint8Array(i.data.businessResult)),s={status:je.SUCCESS,text:u.result}):s={status:je.FAILED,text:""},this._ctx.emit("speechToTextResponse",{code:o,messageUId:e,sttInfo:s}),[2]}}))}))},Ap=function(e,t){var r=e.targetId,n=e.conversationType,i=e.channelId,a=jl.encode(Hs,{targetId:r,type:n,query:t.map((function(e){return{msgTime:0,msgUID:e,busChannel:i}}))});return this._ctx.query($n.qryMsg,this._ctx.currentUserId,a,Ys)},yp=function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,c,_,f,d,h,g,p,E,I,b=this;return a(this,(function(a){switch(a.label){case 0:return i=Object.values(n),o=u([],s(new Set(u(u([],s(e),!1),s(i),!1))),!1),[4,l(this,kg,"m",Ap).call(this,t,o)];case 1:return c=a.sent(),_=c.isOk,f=c.code,d=c.data,_?(g=(h=d).list,p=h.notExistMsgId,E=new Map(g.map((function(e){var r=Sc(e,b._ctx.currentUserId,!1,t.targetId);return[r.messageUId,r]}))),I=e.map((function(e){var t=E.get(e);if(!t)return p.includes(e)?{messageUId:e,code:k.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:k.SERVER_DATA_ERROR};if(t.messageType!==Re.REFERENCE)return{messageUId:e,code:k.INVALID_PARAMETER_MESSAGE_TYPE};var r=n[e],i=E.get(r),a=t.content;return i?(a.referMsg=i.content,a.referMsgStatus=i.isModifyMessage?Yr.MODIFIED:Yr.DEFAULT,{messageUId:e,message:t,code:k.SUCCESS}):p.includes(r)?(a.referMsgStatus=Yr.DELETE,{messageUId:e,code:k.RC_DB_DATA_NOT_FOUND,message:t}):(a.referMsgStatus=Yr.DEFAULT,{messageUId:e,code:k.SERVER_DATA_ERROR,message:t})})),r(I),[2]):(r(e.map((function(e){return{messageUId:e,code:f}}))),[2])}}))}))},Op=function(e){var t=tg(e);return this._ctx.getNaviInfoFromCache().supportRecallRefactor&&t.info.forEach((function(e){var t=e.msg;if(t&&t.classname===Re.RECALL){var r=JSON.parse(t.content),n=r.messageUId,i=r.sentTime,a=r.extra,o={recallTime:i,recallActionTime:t.dataTime,admin:!!r.isAdmin,delete:!!r.isDelete,isDelete:!!r.isDelete,operatorId:t.fromUserId,extra:a};t.classname=Re.RECALL_NOTIFICATION_MESSAGE,t.content=JSON.stringify(o),t.msgId=n,t.dataTime=i||t.dataTime}})),t},Sp=function(e,t,r,n,o,s){return void 0===s&&(s=$n.qryRelationR),i(this,void 0,void 0,(function(){var i,u,c=this;return a(this,(function(a){switch(a.label){case 0:return i=this._ctx.currentUserId,u=function(e,t,r,n,i){return jl.encode(Fo,{startTime:e,order:t,count:r,compressioEnabled:Dn.enable(),channelType:n,botType:i})}(e,t,r,n,o),[4,this._ctx.query(s,i,u)];case 1:return[2,a.sent().trans((function(e){return l(c,kg,"m",Op).call(c,e.pbData)}))]}}))}))};var wp=((jg={})[x.PRIVATE]=$n.cleanPMsg,jg[x.GROUP]=$n.cleanGMsg,jg[x.CUSTOMER_SERVICE]=$n.cleanCMsg,jg[x.SYSTEM]=$n.cleanSMsg,jg[x.APP_PUBLIC_SERVICE]=$n.cleanMCMsg,jg[x.PUBLIC_SERVICE]=$n.cleanMPMsg,jg[x.ULTRA_GROUP]=$n.cleanGMsg,jg),Up=function(e){function r(t,r,n,i){var a=e.call(this,t,r,n)||this;return Object.defineProperty(a,"appStorage",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"_socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(a,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(a,"_socketIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(a,"_serverSessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(a,"_localConnectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(a,"_idCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(a,"_generateMessageId",{enumerable:!0,configurable:!0,writable:!0,value:function(){return a._idCount>=65535&&(a._idCount=0),++a._idCount}}),Object.defineProperty(a,"_pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_messageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(a,"_syncMessageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),a}return t(r,e),Object.defineProperty(r.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(r.prototype,"getLocalConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime}}),Object.defineProperty(r.prototype,"getCrtServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-this._localConnectedTime+this._connectedTime}}),Object.defineProperty(r.prototype,"getDelayTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime-this._connectedTime}}),Object.defineProperty(r.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,_,f,d;return a(this,(function(h){switch(h.label){case 0:if(r=t.openAnti,i=t.type,o=t.baggageEnabled,s=this.getCmpList(t),this.logger.debug(F.L_NAVI_CMP_R,JSON.stringify(s),n),0===(u=s.filter((function(e,t){return s.findIndex((function(t){return t.addr===e.addr}))===t})).sort((function(e,t){return e.weight>t.weight?-1:1}))).length)return this.logger.error(F.L_NAVI_CONF_E,"no service available",n),[2,Tr(k.SERVER_UNAVAILABLE)];l=1===r?hi:gi,c=function(t){var r,s,c,f,d,h,g,p,E,I,b;return a(this,(function(a){switch(a.label){case 0:return r=u[t],s=r.protocol,c=r.addr,f=r.weight,d=function(e,t,r,n,i,a,o,s,u,l){var c,_=u?"&protocolVer=".concat(u):"";return"".concat(r,"://").concat(n,"/websocket?appId=").concat(i,"&token=").concat(encodeURIComponent(a),"&sdkVer=").concat(Ye,"&pid=").concat(s,"&deviceId=").concat(encodeURIComponent(e)).concat(1===l?"&baggage=".concat(encodeURIComponent("cid=".concat(o))):"","&apiVer=").concat(encodeURIComponent((null===(c=po.getApiVer)||void 0===c?void 0:c.call(po))||"||")).concat(po.connectPlatform?"&platform=".concat(po.connectPlatform):"").concat(_).concat(po.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(t)):"")}(_.appStorage.deviceId,_.appStorage.packageName,s===B.WS?"ws":"wss",c,_.appkey,e,_.cid,"",l,o),h=Date.now(),[4,_.connectWebSocket(d,l,n)];case 1:return g=a.sent(),p=g.code,E=g.data,I=_.cmpWeightCache.findIndex((function(e){return e.addr===c})),b={bid:sr(),ptc:ye.WS,cod:p,net:_.getNetwork().type,dur:Date.now()-h,spr:0,pr:i||0,hos:c,idx:I,rct:_.retryCount?Ne.RECONNECT:Ne.CONNECT,cid:_.cid,v:Se.CURRENT,rsn:_._doConnectReason,count:_.retryCount,weight:f,ssid:_._serverSessionId},_.logger.record(be.IM_WEBSOCKET,JSON.stringify(b),n),p===k.RC_SOCKET_DISCONNECTED||p===k.TIMEOUT?[2,"continue"]:p!==k.SUCCESS?[2,{value:Tr(p)}]:(_._localConnectedTime=Math.floor((Date.now()+h)/2),_._socket=E.socket,_.updateCmpWeight(u[t].addr,!0),_.curCmpUrl=u[t].addr,[2,{value:br(E.userId)}])}}))},_=this,f=0,h.label=1;case 1:return f<u.length?[5,c(f)]:[3,4];case 2:if("object"==typeof(d=h.sent()))return[2,d.value];h.label=3;case 3:return f+=1,[3,1];case 4:return[2,Tr(k.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(r.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,_,f,d=this;return a(this,(function(a){switch(a.label){case 0:return this.logger.info(F.L_CONNECT_O,"connect start: ".concat(e),r),n=yr(),i=n.resolve,o=n.promise,[4,po.createWebSocket(e)];case 1:return s=a.sent(),u=s.data,l=s.code,c=s.msg,l===k.SUCCESS&&u?(this._socketIndex=u.id,_=k.SUCCESS,f=setTimeout((function(){d.logger.warn(F.L_CONNECT_S,"timeout",r),_=k.TIMEOUT,"wechat"===po.tag?u.close():(i(Tr(k.TIMEOUT)),d.onSocketEnd(u,k.TIMEOUT,r))}),5e3),u.onOpen((function(){d.logger.info(F.L_CONNECT_S,"socket opened",r),clearTimeout(f)})),u.onError((function(e){d.logger.info(F.L_CONNECT_S,"socket error",r),clearTimeout(f);var t=k.RC_SOCKET_DISCONNECTED;i(Tr(t)),d.onSocketEnd(u,t,r)})),u.onClose((function(){d.logger.info(F.L_CONNECT_S,"socket close",r);var e=_===k.SUCCESS?k.RC_SOCKET_DISCONNECTED:_;i(Tr(e)),d.onSocketEnd(u,e,r)})),u.onMessage((function(e){if(d._socketIndex===u.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var n=La(e,t);if(n){if(n instanceof Ea){var a=n.status;if(a!==Gi)return d.logger.warn(F.L_CONNECT_O,"connect failed: ".concat(a),r),_=Tg[a],u.close(),void i(Tr(_));d.logger.info(F.L_CONNECT_O,"connect success",r);var o=n.timestamp,s=n.userId,l=n.messageId,c=n.sessionId;return d._serverSessionId=c,d._connectedTime=o,d._idCount=l,void i(br({userId:s,socket:u}))}if(n instanceof ba){var f=n.status;return d.logger.info(F.T,"recv disconnect signal -> status: ".concat(f)),void d.onRecvDisconnect(f,u)}d._onReceiveSignal(n)}}}else d.logger.warn(F.L_WS_DISACCORD_E,JSON.stringify({socketIndex:d._socketIndex,curSocketId:u.id}))})),[2,o]):[2,Tr(l,c)]}}))}))}}),Object.defineProperty(r.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==ni)return e instanceof Aa&&!e.syncMsg?(this.logger.debug(F.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new Ca(e.messageId))):void(e instanceof Ma&&this._messageIds[e.messageId]&&(this.logger.debug(F.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new Pa(e.messageId))))}}),Object.defineProperty(r.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=e.syncMsg,r=e.topic,n=e.messageId,this.logger.debug(F.O,"recv PublishReader -> messageId: ".concat(n," ").concat(r)),r===vi?[2]:!t||vg(ti(r))?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[n]=e}))];case 1:return i=a.sent(),delete this._syncMessageIds[n],this.emit("signal",e,i),[2]}}))}))}}),Object.defineProperty(r.prototype,"_onReceiveSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return e instanceof va&&this._pingResolve?(this._pingResolve(k.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof Na||e instanceof Ma)&&(t=e.messageId,this.logger.debug(F.O,"recv ack -> messageId: ".concat(t)),(r=this._messageIds[t])&&(r(e),delete this._messageIds[t]),(n=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],n(e))),e instanceof Aa?[4,this._publishReader(e)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(r.prototype,"onRecvDisconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(function(e){return bg[e]}(e)))}}),Object.defineProperty(r.prototype,"onSocketEnd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this._socket&&this._socket===e?(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0)):this.logger.warn(F.L_CONNECT_S,"socket end but not the current socket",r)}}),Object.defineProperty(r.prototype,"clearResolves",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(k.RC_SOCKET_DISCONNECTED)}}}),Object.defineProperty(r.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._pingResolve=r,setTimeout((function(){return r(k.TIMEOUT)}),e),t.sendOnly(new Ta)}))}}),Object.defineProperty(r.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof Sa||e instanceof Oa)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(r.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return this._socket?(t=this._generateMessageId(),e.messageId=t,this._socket.send(e.getArrayBuffer()),[4,new Promise((function(e){i._messageIds[t]=e,setTimeout((function(){i._messageIds[t]&&delete i._messageIds[t],e(k.TIMEOUT)}),3e4)}))]):[2,Tr(k.RC_NET_CHANNEL_INVALID)];case 1:return r=a.sent(),n="number"==typeof r?r:r.status,k.SUCCESS,"number"==typeof r?[2,Tr(r)]:[2,n===k.SUCCESS?br(r):Tr(n,"",r)]}}))}))}}),Object.defineProperty(r.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s,u;return a(this,(function(a){switch(a.label){case 0:return this.logger.createTraceId(),ri(e),i=new Oa(e,r,t),o&&i.setHeaderQos(o),[4,this._sendHandler(i)];case 1:return s=a.sent(),u=s.data,s.isOk&&void 0!==n?[2,br(jl.decode(n,u.pbData))]:[2,s]}}))}))}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,this._sendHandler(e)];case 1:return(r=a.sent()).data?r.data instanceof Na?[2,r]:(n=r.data,i=t&&n.pbData&&[k.SUCCESS,k.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,k.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,k.RC_USER_PROFILE_KEY_NOT_EXIST,k.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,k.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,k.RC_USER_PROFILE_VALUE_EXCEED_RANGE,k.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(n.status)>=0,o=i?jl.decode(t,n.pbData):n,0!==n.status?[2,Tr(n.status,void 0,t&&n.pbData?o:null)]:[2,br(o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return r?[4,this.sendOnly(new Ia(aa))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),r}(Tn),Dp={};function Gp(){return{code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:1,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:Xr.getMiniCmpUrlList().join(",")}}var Vp=function(e){function r(t,r,n,i,a,o){void 0===a&&(a="default");var s=e.call(this,t,r,n,po.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),po.useNavi,o)||this;return Object.defineProperty(s,"_appStorage",{enumerable:!0,configurable:!0,writable:!0,value:i}),s._environment=a,s}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s,u,l;return a(this,(function(a){switch(a.label){case 0:return i="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(r),"&callBack=x&v=").concat(Ye,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(po.tag),this.logger.debug(F.L_REQUEST_T,"req navi => ".concat(i),n),[4,po.httpReq({url:i,timeout:1e4,dataType:"text"})];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(F.L_REQUEST_R,"request navi failed: ".concat(s.status),n),!po.useNavi&&o?[2,br(Gp())]:[2,Tr(this.transHttpCode(s.status))];try{return 0===(u=s.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(u=JSON.parse('"'.concat(u,'"'))),(l=JSON.parse(u)).protocol=/^https/.test(i)?"https":"http",l.code&&200!==l.code?[2,Tr(this.transHttpCode(l.code))]:(po.useNavi||(l.server="",l.backupServer=Xr.getMiniCmpUrlList().join(","),l.logSwitch=0),[2,br(l)])}catch(e){this.logger.error(F.L_PARSE_NAVI_E,s.data,n)}return[2,Tr(k.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:po.tag,protocol:(/^https/.test(e)?B.WSS:B.WS).toString()}),this.logger.debug(F.L_REQUEST_T,"req navi => ".concat(i.url),n),[4,po.httpReq(i)];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(F.L_REQUEST_R,"request navi failed: ".concat(s.status),n),!po.useNavi&&o?[2,br(Gp())]:[2,Tr(this.transHttpCode(s.status))];try{return u=s.data,(l="object"!=typeof u?JSON.parse(u):u).protocol=/^https/.test(i.url)?"https":"http",po.useNavi||(l.logSwitch=0,c=Xr.getMiniCmpUrlList(),l.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(i.url)?B.WSS:B.WS,weight:c.length-t}}))),[2,br(l)]}catch(e){this.logger.error(F.L_PARSE_NAVI_E,s.data,n)}return[2,Tr(k.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=this.getCatchKey(e);if(Dp[r])return Dp[r];var n,i=this._appStorage.get("naviInfo");if(!i)return null;try{n=JSON.parse(i)}catch(e){n=[]}if(0===n.length)return null;var a=n.find((function(r){return r.token===e&&r.environment===t._environment}))||null;return Dp[r]=a,a}}),Object.defineProperty(r.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],i=Date.now(),a=this._appStorage.get("naviInfo");if(a){try{n=JSON.parse(a)}catch(e){n=[]}n.length>0&&(n=n.filter((function(t){return i-t.timestamp<Fe&&(e!==t.token||r._environment!==t.environment)})))}var o={timestamp:i,naviInfo:t,token:e,environment:this._environment};n.push(o),this._appStorage.set("naviInfo",JSON.stringify(n)),Dp[this.getCatchKey(e)]=o}}),r}(Rn),jp=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})};function kp(e){var t=!(1&~(e.ugMsg||0)),r=!(1&~(e.sessionCfg||0));return t&&r}var xp,Fp,Bp,Hp,Yp,Wp,Jp,qp,Kp,Qp,Xp,Zp,zp,$p=function(e){function r(t,r,n,i){var a=e.call(this,r,t,n)||this;Object.defineProperty(a,"_appStorage",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_mrtr",{enumerable:!0,configurable:!0,writable:!0,value:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}});var o=po.runtimeInfo,s=o.type,u=o.version;return a.model="Web|".concat(s,"|").concat(u),a.init(),a}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u,l,c,_,f,d;return a(this,(function(a){switch(a.label){case 0:return(i=n).deviceId=this._appStorage.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},s=this.logger.createTraceId(),this.logger.info(F.L_REQUEST_T,JSON.stringify(o),s),[4,po.httpReq(o)];case 1:u=a.sent(),l=u.status,c=u.data,_=void 0===c?"":c,this.logger.info(F.L_REQUEST_R,JSON.stringify({status:l,data:_}),s);try{return f=JSON.parse(_),d=f.data,[2,{code:parseInt(f.code,10),data:d}]}catch(e){return this.logger.warn(F.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:l,data:_,error:e})),[2,{code:l,msg:e}]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._appStorage.set("cloudControllerData",JSON.stringify(e))}}),Object.defineProperty(r.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._appStorage.get("cloudControllerData")}}),Object.defineProperty(r.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(F.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e}}),Object.defineProperty(r.prototype,"getMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mrtr}}),r}(In),eE=function(e){function r(t,r,n){var i=e.call(this,t,r)||this;return Object.defineProperty(i,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_appStorage",{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return t(r,e),Object.defineProperty(r.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._appStorage.get("staticConf")}}),Object.defineProperty(r.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._appStorage.set("staticConf",e)}}),Object.defineProperty(r.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._appStorage.delete("staticConf")}}),Object.defineProperty(r.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return[4,po.httpReq({url:e})];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 i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,ur(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(F.L_GET_STATIC_CONF_E,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),r}(Zr),tE=function(e){function r(){var t=e.call(this)||this;Object.defineProperty(t,"_deviceId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"_customDeviceId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"_packageName",{enumerable:!0,configurable:!0,writable:!0,value:""});var r="",n=po.localStorage;return"browser"!==po.tag?(r=n.getItem(Qe)||"")||(r=ht.genWithLen(22),n.setItem(Qe,r)):r=gt,t._deviceId=r,t}return t(r,e),Object.defineProperty(r.prototype,"setPackageName",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._packageName=e}}),Object.defineProperty(r.prototype,"deviceId",{get:function(){return this._customDeviceId||this._deviceId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"packageName",{get:function(){return this._packageName},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setCustomDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._customDeviceId=e}}),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.appkey,r=po.localStorage,n=ut(t),i=r.getItem(n),a=st(t),o=r.getItem(a),s=Xe(t),u=r.getItem(s),l=ct(t),c=r.getItem(l);return{cloudControllerData:{value:i,key:n},staticConf:{value:o,key:a},naviInfo:{value:u,key:s},logReporter:{value:c?JSON.parse(c):{},key:l,stringify:!0}}}}),r}(I_),rE=[$n.chatMsg,$n.ugMsg,$n.recallMsg,$n.ppMsgS,$n.pgMsgS,$n.ppMsgP,$n.pgMsgP,$n.pcMsgP,$n.prMsgS,$n.pbMsgP,$n.chatMsgS],nE=function(e){function r(t){var r,n,i=e.call(this)||this;xp.add(i),Object.defineProperty(i,"_initOptions",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_connection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"send",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"query",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"sendOnly",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"connect",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"disconnect",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"appStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"userStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Fp.set(i,void 0),Bp.set(i,void 0),Hp.set(i,void 0),Yp.set(i,void 0),Wp.set(i,void 0),Object.defineProperty(i,"_robots",{enumerable:!0,configurable:!0,writable:!0,value:{robots:[],isSynced:!1}}),i.appStorage=new tE,i.appStorage.syncDataFromLocalStorage(i);var a=t.appkey,o=t.loggerProxy,u=t.environment,_=t.useNaviV2,f=t.logOutputLevel,d=t.logExpireTime,h=t.areaCode,g=t.navigators,p=t.logServerUrl,E=t.miniCMPProxy,I=o||e_(),b=i.logger=new xc(t.appkey,"IMLib","IM",I);b.setOutputLevel(f),o||Kc(a,i.logger,d),Xr.init({areaCode:h,navigators:g,logServerUrl:p,miniCMPProxy:E}),i.navi=new Vp(a,i.logger,new eE(a,i.logger,i.appStorage),i.appStorage,u||"default",!!_);var T=i._connection=new Up(a,i.navi,i.logger,i.appStorage);return i.send=i._connection.send.bind(i._connection),i.query=i._connection.query.bind(i._connection),i.sendOnly=i._connection.sendOnly.bind(i._connection),i.connect=i._connection.connect.bind(i._connection),i.disconnect=i._connection.disconnect.bind(i._connection),T.on("onConnected",l(i,xp,"m",Jp),i),T.on("onDisconnected",l(i,xp,"m",Kp),i),T.on("onSuspend",l(i,xp,"m",qp),i),T.on("signal",l(i,xp,"m",Qp),i),T.pipe(i),c(i,Bp,new c_(a,b,i.appStorage),"f"),c(i,Hp,new __(a,b,i.appStorage),"f"),c(i,Yp,new $p(a,b,l(i,Bp,"f"),i.appStorage),"f"),n=i,r=s(Xr.getCloudControllerUrl(),1),{set value(e){c(n,Wp,e,"f")}}.value=r[0],i.userStorage=new jp,c(i,Fp,new Lg(T,b),"f"),l(i,Fp,"f").pipe(i),"browser"===po.tag&&l(i,Yp,"f").request(l(i,Wp,"f"),cn),i}return t(r,e),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._connection.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectionStatus",{get:function(){return this._connection.getConnectionStatus()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connection.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentToken",{get:function(){return this._connection.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"serverTime",{get:function(){return this._connection.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"delayTime",{get:function(){return this._connection.getDelayTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectedTime",{get:function(){return this._connection.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ugEnabel",{get:function(){return!(1&~(this.getNaviInfoFromCache().ugMsg||0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isDisableEmptyUGChannelId",{get:function(){return!(2&~(this.getNaviInfoFromCache().ugDriven||0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"includeUg",{get:function(){return kp(this.getNaviInfoFromCache())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"svrUnread",{get:function(){return 1===this.getNaviInfoFromCache().serverSaveUnread},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"logReporter",{get:function(){return l(this,Bp,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"statisticReporter",{get:function(){return l(this,Hp,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"appkey",{get:function(){return this.initOptions.appkey},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"initOptions",{get:function(){return this._initOptions},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.getNaviInfoFromCache(this.currentToken)}}),Object.defineProperty(r.prototype,"robots",{get:function(){return this._robots.robots.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,l,c;return a(this,(function(a){switch(a.label){case 0:return t=this._robots.robots.slice(),!e&&this._robots.isSynced?[2,br(t)]:(r=jl.encode(yl,{ids:[]}),[4,this._connection.query($n.qAppBot,this.currentUserId,r,Ol)]);case 1:return(n=a.sent()).isOk?(i=Math.max.apply(Math,u([],s(t.map((function(e){return e.updateTime}))),!1)),o=[],l=n.data.bots.map((function(e){var t={robotId:e.id,name:e.name,portraitUri:e.portraitUrl,robotType:e.type||"",metadata:Object.fromEntries(e.metadata.map((function(e){return[e.key,e.value]}))),createTime:e.createTime,updateTime:e.updateTime};return t.updateTime>i&&o.push(t),t})),c=t.filter((function(e){return!l.some((function(t){return t.robotId===e.robotId}))})),this._robots.isSynced=!0,this._robots.robots=l,e&&this.emit("robotsSynced",n.code,l.slice(),o,c),[2,br(l.slice())]):(e&&this.emit("robotsSynced",n.code,[],[],[]),[2,Tr(n.code,n.msg,t)])}}))}))}}),Object.defineProperty(r.prototype,"handleCloudControllerMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return 0===e.length?[2]:e.shift().senderUserId!==qe?[2,this.handleCloudControllerMessage(e)]:(t=this._connection.getToken(),[4,l(this,Yp,"f").request(l(this,Wp,"f"),fn,t)]);case 1:return r=i.sent()||0,n=e.filter((function(e){return e.sentTime>r})),[2,this.handleCloudControllerMessage(n)]}}))}))}}),Object.defineProperty(r.prototype,"handleLogCmdMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){if(e.senderUserId===qe){var r=e.content,n=r.startTime,i=r.endTime,a=r.platform,o=r.logId,s=r.uri;l(t,Bp,"f").report(parseInt(n,10),parseInt(i,10),a,s,o,e.messageUId)}}))}}),Object.defineProperty(r.prototype,"handleNetworkChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._connection.setNetwork(e,t),e.status&&l(this,Wp,"f")){var r=this._connection.getToken();l(this,Yp,"f").request(l(this,Wp,"f"),_n,r)}}}),Object.defineProperty(r.prototype,"checkIfNeedRecordMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=l(this,Yp,"f").getMRTRConfig();if(!r)return!1;var n=function(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(t),i=0;switch(e){case x.PRIVATE:i=r.private;break;case x.GROUP:i=r.group;break;case x.CHATROOM:i=r.chatroom;break;case x.ULTRA_GROUP:i=r.ultraGroup}return!!i&&n%(1/i)==0}}),Object.defineProperty(r.prototype,"recordReceivedMessagesForStatistics",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(0!==e.length){var r=this.connectedTime,n=e.filter((function(e){return e.sentTime>=r&&t.checkIfNeedRecordMessageUId(e.conversationType,e.messageUId)})).map((function(e){return e.messageUId}));if(0!==n.length){var i=Date.now();this.logger.record(be.IM_MSG_RECEIVE,JSON.stringify({client_ts:i,server_deltatime:i-this.serverTime,msg_ids:n.join(",")}))}}}}),r}(gr);Fp=new WeakMap,Bp=new WeakMap,Hp=new WeakMap,Yp=new WeakMap,Wp=new WeakMap,xp=new WeakSet,Jp=function(e,t){return i(this,void 0,void 0,(function(){var e,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t||this.getAllRobots(!0),[4,l(this,Fp,"f").noticeOnline()];case 1:return(e=a.sent()).isOk?(t?l(this,Fp,"f").startInterval(18e4,!0):(r=e.data,n=r.syncTime,i=r.hasNext,l(this,Fp,"f").setInitVersion(n),l(this,Fp,"f").startInterval(18e4,!!i)),o=this.getNaviInfoFromCache(),l(this,Bp,"f").checkStart(o),l(this,Hp,"f").checkStart(o),[2]):[2]}}))}))},qp=function(e,t){l(this,Fp,"f").stopInterval()},Kp=function(e){this._robots.isSynced=!1,this._robots.robots=[],l(this,Fp,"f").reset(),l(this,Bp,"f").stop(),l(this,Hp,"f").stop()},Qp=function(e,t,r){var n=t.topic,i=t.syncMsg,a=ti(n),o=this.getNaviInfoFromCache();if(a||(this.logger.warn(F.L_RECV_RMTP_E,"unknown topic: ".concat(n)),e.stopPropagation()),this.logger.debug(F.L_RECV_RMTP_O,n),i&&rE.includes(a)){e.stopPropagation();var s=r||{},u=s.timestamp,c=void 0===u?this.serverTime:u,_=s.messageUId,f=void 0===_?"":_,d=Oc(t,this.currentUserId,c,f),h=Nc(o,d,this.currentUserId,!1,t.targetId);this.emit("syncMsg",h,a)}else{if(a===$n.s_ntf){e.stopPropagation();var g=(I=jl.decode(So,t.pbData)).type,p=I.chrmId,E=I.time;return this.logger.info(F.L_RECV_S_NTF_O,"type: ".concat(g,", chrmId: ").concat(p,", time: ").concat(E)),void this.emit("sNtf",I)}if(a===$n.s_cmd){e.stopPropagation();var I;g=(I=jl.decode(So,t.pbData)).type,p=I.chrmId,E=I.time;if(this.logger.info(F.L_RECV_S_CMD_O,"type: ".concat(g,", chrmId: ").concat(p,", time: ").concat(E)),11===g)return void l(this,Fp,"f").push(E);this.emit("sCmd",I)}if(a===$n.s_msg){e.stopPropagation();d=jl.decode(Lo,t.pbData),h=Nc(o,d,this.currentUserId,!1);this.emit("sMsg",h)}}};var iE,aE=function(e,t,r){var n=0;return e&&(n|=1),t&&(n|=2),r&&(n|=4),n},oE=function(e,t,r){return{chatroomId:e,key:t.key,value:t.value,timestamp:t.version,type:r?w.DELETE:w.UPDATE}},sE=function(e){function r(t,r,n){var i=e.call(this,"WebChatroomKVStore")||this;return Xp.add(i),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:n}),Zp.set(i,new Map),Object.defineProperty(i,"_emittedEntriesSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),i}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i,o,s,u,c,_,f,d,h=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),i=this._chatroomId,o={chatroomId:i,timestamp:e},t.info(F.L_PULL_CHATROOM_KV_T,JSON.stringify(o),r),[4,this._ctx.query($n.pullKV,i,fg(e),void 0)];case 1:return(s=a.sent()).isOk?(u=dg(s.data.pbData),c=u.bFullUpdate,_=u.entries,f=u.syncTime,t.info(F.L_PULL_CHATROOM_KV_R,JSON.stringify(n(n({},o),{newVersion:f})),r),d=new Map,c&&(Array.from(l(this,Zp,"f").values()).forEach((function(e){d.set(e.key,oE(i,e,!0))})),l(this,Zp,"f").clear()),Array.from(_.values()).forEach((function(e){var t,r=(t=e.status,{isAutoDelete:!!(1&t),isOverwrite:!!(2&t),isDelete:!!(4&t)}).isDelete,n=function(e){var t=e.key,r=e.value;return e.timestamp,{key:t,value:r,userId:e.uid,version:e.version}}(e);r?l(h,Zp,"f").delete(n.key):l(h,Zp,"f").set(n.key,n),d.set(n.key,oE(i,n,r))})),this._emittedEntriesSynced||(this._emittedEntriesSynced=!0,this._emitter.emit("chatroom",{entriesSynced:i})),d.size>0&&this._emitter.emit("chatroom",{updatedEntries:Array.from(d.values())}),[2,br({version:f})]):(t.warn(F.L_PULL_CHATROOM_KV_R,JSON.stringify(n(n({},o),{code:s.code})),r),[2,s.wipe()])}}))}))}}),Object.defineProperty(r.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return[4,l(this,Xp,"m",zp).call(this,e,t,!1)];case 1:return(r=n.sent()).isOk&&l(this,Zp,"f").set(e.key,{key:e.key,value:e.value,userId:this._ctx.currentUserId,version:this._ctx.serverTime}),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return[4,l(this,Xp,"m",zp).call(this,{key:e.key,value:"",isAutoDelete:!1,isSendNotification:e.isSendNotification,notificationExtra:e.notificationExtra},t,!0)];case 1:return(r=n.sent()).isOk&&l(this,Zp,"f").delete(e.key),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,c=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.serverTime,r=e.entries.map((function(r){var n,i=l(c,Zp,"f").get(r.key);return{key:r.key,value:r.value,uid:c._ctx.currentUserId,version:null!==(n=null==i?void 0:i.version)&&void 0!==n?n:t,status:aE(!!e.isAutoDelete,e.isForce||!1,!1)}})),n=jl.encode(ss,{entry:r}),[4,this._ctx.query($n.setKVS,this._chatroomId,n,ls)];case 1:return(i=a.sent()).isOk||i.code===k.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?((o=i.data).errorKeys,s=o.keysVersion,u=new Map,null==s||s.forEach((function(e){u.set(e.key,e.version)})),e.entries.forEach((function(e){var t=e.key,r=u.get(t);r&&l(c,Zp,"f").set(t,{key:t,value:e.value,userId:c._ctx.currentUserId,version:r})})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return t=aE(!1,!1,!0),r=this._ctx.serverTime,n=jl.encode(ss,{entry:e.keys.map((function(e){var n,i=l(u,Zp,"f").get(e);return{key:e,status:t,value:"",uid:u._ctx.currentUserId,version:null!==(n=null==i?void 0:i.version)&&void 0!==n?n:r}}))}),[4,this._ctx.query($n.delKVS,this._chatroomId,n,ls)];case 1:return(i=a.sent()).isOk||i.code===k.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?(o=i.data.errorKeys,s=new Set,null==o||o.forEach((function(e){return s.add(e.key)})),e.keys.forEach((function(e){s.has(e)||l(u,Zp,"f").delete(e)})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,Zp,"f").has(e)?l(this,Zp,"f").get(e).value:null}}),Object.defineProperty(r.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Array.from(l(this,Zp,"f").entries()).map((function(e){var t=s(e,2);return[t[0],t[1].value]}));return Object.fromEntries(e)}}),r}(pr);Zp=new WeakMap,Xp=new WeakSet,zp=function(e,t,r){var n;return i(this,void 0,void 0,(function(){var i,o,s,u,c;return a(this,(function(a){switch(a.label){case 0:return i=this._ctx.serverTime,o=l(this,Zp,"f").get(e.key),s=aE(!!e.isAutoDelete,t,r),u={entry:{key:e.key,value:e.value,uid:this._ctx.currentUserId,version:null!==(n=null==o?void 0:o.version)&&void 0!==n?n:i,status:s}},e.isSendNotification&&(u.type=x.CHATROOM,u.bNotify=!0,u.notification={sessionId:Cc(Re.CHRM_KV_NOTIFY,!1,!1,!1),classname:Re.CHRM_KV_NOTIFY,content:JSON.stringify({key:e.key,value:e.value,extra:e.notificationExtra,type:r?w.DELETE:w.UPDATE})}),c=jl.encode(os,u),[4,this._ctx.query(r?$n.delKV:$n.setKV,this._chatroomId,c)];case 1:return[2,a.sent().wipe()]}}))}))};var uE,lE,cE,_E,fE=function(e){function r(t,r,n,i){var a=e.call(this,"WebChatroomMessageReceiver")||this;return Object.defineProperty(a,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(a,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:i}),iE.set(a,0),c(a,iE,n,"f"),a}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,c,_,f,d=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),n={chatroomId:this._chatroomId,version:e},t.info(F.L_PULL_CHATROOM_MSG_T,JSON.stringify(n),r),i=function(e,t){return jl.encode(xo,{syncTime:e,count:t,compressioEnabled:Dn.enable()})}(e,l(this,iE,"f")),[4,this._ctx.query($n.chrmPull,this._chatroomId,i,void 0)];case 1:return o=a.sent(),t.summary(F.L_PULL_CHATROOM_MSG_R,o,r,n),o.isOk?(s=this._ctx.currentUserId,u=ng(o.data.pbData),c=u.list,_=u.syncTime,c.length>0&&(f=c.map((function(e){return Sc(e,s,!1,d._chatroomId)})),this._emitter.emit("message",f,this._chatroomId)),[2,br({version:_})]):[2,o.wipe()]}}))}))}}),r}(pr);iE=new WeakMap;var dE,hE,gE,pE,EE,IE,bE,TE,vE,RE,mE,AE,yE,OE,SE,NE,CE,PE=function(){function e(e,t,r,n,i){uE.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"roomId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"initCount",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"extra",{enumerable:!0,configurable:!0,writable:!0,value:i}),lE.set(this,void 0),cE.set(this,void 0),c(this,lE,new fE(this._ctx,this.roomId,r,n),"f"),c(this,cE,new sE(this._ctx,this.roomId,n),"f")}return Object.defineProperty(e.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;l(this,lE,"f").setInitVersion(0),l(this,lE,"f").startInterval(e,!0),l(this,uE,"a",_E)&&(l(this,cE,"f").setInitVersion(0),l(this,cE,"f").startInterval(e,!0))}}),Object.defineProperty(e.prototype,"restartInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;this.stopInterval(),l(this,cE,"f").startInterval(e,!0),l(this,lE,"f").startInterval(e,!0)}}),Object.defineProperty(e.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){l(this,lE,"f").stopInterval(),l(this,cE,"f").stopInterval()}}),Object.defineProperty(e.prototype,"handleMessageNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){l(this,lE,"f").push(e)}}),Object.defineProperty(e.prototype,"handleKVNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){l(this,cE,"f").push(e)}}),Object.defineProperty(e.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return[2,l(this,cE,"f").setEntry(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,l(this,cE,"f").setEntries(e)]}))}))}}),Object.defineProperty(e.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return[2,l(this,cE,"f").removeEntry(e,t)]}))}))}}),Object.defineProperty(e.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,l(this,cE,"f").removeEntries(e)]}))}))}}),Object.defineProperty(e.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,cE,"f").getEntry(e)}}),Object.defineProperty(e.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,cE,"f").getAllEntries()}}),e}();lE=new WeakMap,cE=new WeakMap,uE=new WeakSet,_E=function(){var e;return!!(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.kvStorage)};var ME,LE,wE,UE,DE=function(e){var t=e.joinTime,r=e.createTime,n=e.memberCount,i=e.chatroomBanState;return{createTime:r,joinTime:t,memberCount:n,isAllChatroomBanned:!(1&~(i||0)),isCurrentUserBanned:!(2&~(i||0)),isCurrentChatroomBanned:!(4&~(i||0)),isCurrentChatroomInWhitelist:!(1&~(e.whiteListState||0))}},GE=function(e){function r(t){var r=e.call(this)||this;return dE.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),hE.set(r,new Map),Object.defineProperty(r,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),gE.set(r,void 0),Object.defineProperty(r,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),r.logger=t.logger,c(r,gE,new gr,"f"),l(r,gE,"f").on("message",l(r,dE,"m",EE),r),l(r,gE,"f").on("chatroom",l(r,dE,"m",pE),r),r._ctx.on("onConnected",l(r,dE,"m",TE),r),r._ctx.on("onDisconnected",l(r,dE,"m",IE),r),r._ctx.on("onSuspend",l(r,dE,"m",bE),r),r._ctx.on("sNtf",l(r,dE,"m",RE),r),r._ctx.on("sCmd",l(r,dE,"m",mE),r),r._ctx.on("syncMsg",l(r,dE,"m",vE),r),r._ctx.on("sMsg",l(r,dE,"m",vE),r),r}return t(r,e),Object.defineProperty(r.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:return[4,l(this,dE,"m",OE).call(this,e,r,n)];case 1:return(i=a.sent()).isOk?((o=l(this,hE,"f").get(e))||(o=new PE(this._ctx,e,t,l(this,gE,"f"),n),l(this,hE,"f").set(e,o),o.startInterval()),[2,i.trans(DE)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return l(this,hE,"f").get(e)?(l(this,dE,"m",SE).call(this,e),r=jl.encode(jo,{nothing:1,extra:t}),[4,this._ctx.query($n.exitChrm,e,r)]):[2,br()];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=jl.encode(Ko,{count:t,order:r}),[4,this._ctx.query($n.queryChrmI,e,n,Qo)];case 1:return[2,i.sent().trans((function(e){return{userCount:e.userTotalNums,userInfos:e.userInfos.map((function(e){return{id:e.id,time:e.time}}))}}))]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){return[2,l(this,dE,"m",NE).call(this,e).next((function(e){return e.setEntry(t,r)}))]}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return[2,l(this,dE,"m",NE).call(this,e).next((function(e){return e.setEntries(t)}))]}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){return[2,l(this,dE,"m",NE).call(this,e).next((function(e){return e.removeEntry(t,r)}))]}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return[2,l(this,dE,"m",NE).call(this,e).next((function(e){return e.removeEntries(t)}))]}))}))}}),Object.defineProperty(r.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return(r=l(this,hE,"f").get(e))?null===(n=r.getEntry(t))?[2,Tr(k.CHATROOM_KEY_NOT_EXIST)]:[2,br(n)]:[4,l(this,dE,"m",CE).call(this,e)];case 1:return[2,i.sent().tryTrans((function(e){var r=e[t];return void 0===r?Tr(k.CHATROOM_KEY_NOT_EXIST):br(r)}))]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return(t=l(this,hE,"f").get(e))?[2,br(t.getAllEntries())]:[2,l(this,dE,"m",CE).call(this,e)]}))}))}}),Object.defineProperty(r.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return i=ug({targetId:e,time:t,count:r,order:n}),o=this._ctx.currentUserId,[4,this._ctx.query($n.qryCHMsg,e,i)];case 1:return(s=a.sent()).isOk?(u=lg(s.data.pbData),[2,br({hasMore:!!u.hasMsg,list:u.list.map((function(t){return Sc(t,o,!1,e)}))})]):[2,s.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=jl.encode(qs,{rtcRoomId:e.rtcRoomId}),[4,this._ctx.query($n.setRtcRoomId,e.chatRoomId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),r}(gr);hE=new WeakMap,gE=new WeakMap,dE=new WeakSet,pE=function(e,t){e.stopPropagation(),this.emit("chatroom",t)},EE=function(e,t,r){e.stopPropagation(),this._ctx.recordReceivedMessagesForStatistics(t),l(this,dE,"m",AE).call(this,t,r)},IE=function(){var e,t;try{for(var r=o(l(this,hE,"f").values()),n=r.next();!n.done;n=r.next()){n.value.stopInterval()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}l(this,hE,"f").clear()},bE=function(){var e,t;try{for(var r=o(l(this,hE,"f").values()),n=r.next();!n.done;n=r.next()){n.value.stopInterval()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},TE=function(e,t){var r,n;if(t)try{for(var i=o(l(this,hE,"f").values()),a=i.next();!a.done;a=i.next()){var s=a.value;l(this,dE,"m",yE).call(this,s)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},vE=function(e,t){t.conversationType===x.CHATROOM&&(e.stopPropagation(),l(this,dE,"m",AE).call(this,[t],t.targetId))},RE=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r){e.stopPropagation();var a=l(this,hE,"f").get(n);a&&a.handleMessageNotify(i)}},mE=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r||4===r){e.stopPropagation();var a=l(this,hE,"f").get(n);if(a)return 4===r?(l(this,hE,"f").delete(n),void this.emit("chatroom",{chatroomDestroyed:n})):void a.handleKVNotify(i)}},AE=function(e,t){var r=this;if(l(this,hE,"f").get(t)){var n=e.filter((function(e){var n,i=e.messageType;if(i===Re.CHATROOM_MERGE_CHANGE){var a=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 r.emit("chatroom",{userChange:a}),!1}if(i===Re.CHATROOM_MERGE_BAN){var o=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 r.emit("chatroom",{chatroomNotifyBan:o}),!1}if(i===Re.CHATROOM_SYNC_MSG){var s=function(e){var t=e.content;return{chatroomId:t.chatroomId,status:t.status,reason:t.reason,time:t.time,extra:t.extra||""}}(e);return r.emit("chatroom",{chatroomNotifyMultiLoginSync:s}),!1}if(i===Re.CHATROOM_MERGE_BLOCK){var u=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 u.operateType===j.Blocked&&(null===(n=null==u?void 0:u.userIdList)||void 0===n?void 0:n.includes(r._ctx.currentUserId))&&l(r,dE,"m",SE).call(r,t),r.emit("chatroom",{chatroomNotifyBlock:u}),!1}return!0}));n.length>0&&this.emit("message",n,t)}},yE=function(e){return i(this,void 0,void 0,(function(){var t,r,i,o,s,u,c,_;return a(this,(function(a){switch(a.label){case 0:return t=e.roomId,r=e.extra,i=this.logger.createTraceId(),this.logger.info(F.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:t}),i),[4,l(this,dE,"m",OE).call(this,t,!1,r)];case 1:return o=a.sent(),this.logger.summary(F.L_REJOIN_CHATROOM_R,o,i,{chatroomId:t}),s=o.code,u=o.isOk,c=o.data,u?(e.restartInterval(),_=DE(c),this.emit("chatroom",{rejoinedRoom:n(n({chatroomId:t},_),{count:e.initCount})}),[2]):(s!==k.RC_CHATROOM_USER_KICKED&&s!==k.RC_CHATROOM_NOT_EXIST||l(this,hE,"f").delete(t),this.emit("chatroom",{rejoinedRoom:{chatroomId:t,errorCode:s}}),[2])}}))}))},OE=function(e,t,r){var n=jl.encode(jo,{extra:r,nothing:1}),i=t?$n.joinChrm:$n.joinChrmR;return this._ctx.query(i,e,n,ko)},SE=function(e){var t=l(this,hE,"f").get(e);t&&(t.stopInterval(),l(this,hE,"f").delete(e))},NE=function(e){var t=l(this,hE,"f").get(e);return t?br(t):Tr(k.NOT_IN_CHATROOM)},CE=function(e){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return[4,this._ctx.query($n.pullKV,e,fg(0),void 0)];case 1:return(t=n.sent()).isOk?(r=dg(t.data.pbData).entries,[2,br(r.reduce((function(e,t){return e[t.key]=t.value,e}),{}))]):[2,t.wipe()]}}))}))};var VE=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=po.localStorage,r=e.appkey,n=e.currentUserId,i=ot(r,n),a=t.getItem(i)||"{}",o=JSON.parse(a);return{value:{value:{version:o.version||0,tags:o.tags||{},transLan:o.transLan||"zh",autoTrans:o.autoTrans||!1},key:i,stringify:!0}}}}),Object.defineProperty(r.prototype,"version",{get:function(){return this.get("value").version||0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tags",{get:function(){return this.get("value").tags||{}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"forceUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.set("value",e)}}),Object.defineProperty(r.prototype,"addTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("value"),n=r.tags,i=r.autoTrans,a=r.transLan;n[e.tagId]={tagName:e.tagName,createdTime:t},this.set("value",{version:t,tags:n,autoTrans:i,transLan:a})}}),Object.defineProperty(r.prototype,"deleteTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("value"),n=r.tags,i=r.autoTrans,a=r.transLan;delete n[e],this.set("value",{version:t,tags:n,autoTrans:i,transLan:a})}}),r}(I_),jE=function(e){function r(t){var r=e.call(this,"UserSettings")||this;return ME.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),LE.set(r,!1),r.storage=new VE,r._ctx.on("onConnected",r._handleConnected,r),r._ctx.on("onDisconnected",r._handleDisconnected,r),r._ctx.on("onSuspend",r._handleDisconnected,r),r._ctx.on("signal",r._handleSignal,r),r}return t(r,e),Object.defineProperty(r.prototype,"_handleConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.storage.syncDataFromLocalStorage(this._ctx),c(this,LE,!0,"f");var e=this.storage.version;this.setInitVersion(e),this.push(e)}}),Object.defineProperty(r.prototype,"_handleDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reset()}}),Object.defineProperty(r.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(ti(t.topic)===$n.s_us){var r=jl.decode(ws,t.pbData).version;this.push(r),e.stopPropagation()}}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,c,_,f,d,h,g,p,E,I,b,T,v;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=this._ctx.getNaviInfoFromCache(),o=n.createTraceId(),n.info(F.L_SYNC_USER_SETTINGS_T,"version: ".concat(e),o),s=jl.encode(ds,{version:e,ipType:i.ipType||0}),[4,this._ctx.query($n.pullUS,r,s,hs)];case 1:return u=a.sent(),n.summary(F.L_SYNC_USER_SETTINGS_R,u,o),u.isOk?(c=u.data,_=c.version,f=c.items,d=!1,h=!1,g=!1,p="",E=this.storage.get("value"),I=E.transLan,b=E.autoTrans,T=E.tags,v={version:_,transLan:I,autoTrans:b,tags:T},null==f||f.forEach((function(e){var t=e.key,r=e.value;switch(t){case"Tag":v.tags={},e.tags.forEach((function(e){v.tags[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),d=!0;break;case"transLan":g=!0,v.transLan=_a.readUTF(new Uint8Array(r));break;case"autoTrans":h=!0,v.autoTrans="1"===_a.readUTF(new Uint8Array(r));break;case"VoipInfo":p=_a.readUTF(new Uint8Array(r))}})),this.storage.set("value",v),d&&this.emit("tagsChanged"),g&&this.emit("userSettingsChanged",{key:Wr.TranslationLanguage,value:v.transLan}),h&&this.emit("userSettingsChanged",{key:Wr.AutoTranslateEnable,value:v.autoTrans}),p&&this.emit("voipInfoChanged",p),l(this,ME,"m",wE).call(this,u.code),[2,br({version:_})]):(l(this,ME,"m",wE).call(this,u.code),[2,u.wipe()])}}))}))}}),Object.defineProperty(r.prototype,"hasTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.storage.tags[e]}}),Object.defineProperty(r.prototype,"getTags",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.storage.tags}}),Object.defineProperty(r.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=jl.encode(Ms,{version:t,tags:[{tagId:e.tagId,name:e.tagName}],ignoreVersion:!0}),[4,this._ctx.query($n.addSeTag,r,n,fs)];case 1:return(i=a.sent()).isOk&&(o=i.data,s=o.version,u=o.updateVersion,this.storage.addTag(e,u?s:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=jl.encode(Ls,{version:t,tags:[{tagId:e}],ignoreVersion:!0}),[4,this._ctx.query($n.delSeTag,r,n,fs)];case 1:return(i=a.sent()).isOk&&(o=i.data,s=o.version,u=o.updateVersion,this.storage.deleteTag(e,u?s:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,l(this,ME,"m",UE).call(this,$n.transLan,e)]}))}))}}),Object.defineProperty(r.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,br(this.storage.get("value").transLan||"zh")]}))}))}}),Object.defineProperty(r.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,l(this,ME,"m",UE).call(this,$n.autoTrans,e?"1":"0")]}))}))}}),Object.defineProperty(r.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,br(this.storage.get("value").autoTrans)]}))}))}}),r}(pr);LE=new WeakMap,ME=new WeakSet,wE=function(e){l(this,LE,"f")&&(c(this,LE,!1,"f"),this.emit("userSettingsSynced",e))},UE=function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,_,f,d,h,g;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.version,n=this._ctx.currentUserId,i=jl.encode(_s,{version:r,value:t,ignoreVersion:!0}),[4,this._ctx.query(e,n,i,fs)];case 1:if((o=a.sent()).isOk){switch(s=o.data,u=s.version,l=s.updateVersion,c=this.storage.get("value"),_=c.transLan,f=c.autoTrans,d=c.tags,h=c.version,g={version:l?u:h,transLan:_,autoTrans:f,tags:d},e){case $n.transLan:g.transLan=t;break;case $n.autoTrans:g.autoTrans="1"===t}this.storage.set("value",g)}return[2,o.wipe()]}}))}))};var kE,xE,FE,BE,HE,YE,WE,JE,qE,KE,QE,XE,ZE,zE,$E=function(e){var t;return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,remark:null!==(t=e.remarkName)&&void 0!==t?t:"",directionType:e.friendType,extProfile:Object.fromEntries(e.extProfile.map((function(e){return[e.key,e.value]}))),addTime:e.relationTime,inBlackList:!!e.flag}},eI=function(e){var t,r,n=e.targetId,i=e.settingProfile,a=e.extProfile,o=e.baseInfo,s=e.userInfo,u=Zt(i||[]),l=Zt(a||[]);return{groupId:n,groupName:u.name||"",portraitUri:u.portraitUrl||"",introduction:u.introduction||"",notice:u.announcement||"",extProfile:l,joinPermission:~~u.joinPerm,removeMemberPermission:~~u.removePerm,invitePermission:~~u.memInvitePerm,inviteHandlePermission:~~u.invitePerm,groupInfoEditPermission:~~u.profilePerm,memberInfoEditPermission:~~u.memProfilePerm,creatorId:(null==o?void 0:o.creatorId)||"",ownerId:(null==o?void 0:o.ownerId)||"",createTime:(null==o?void 0:o.createTime)||0,membersCount:(null==o?void 0:o.memberCount)||0,remark:null!==(t=null==s?void 0:s.remarkName)&&void 0!==t?t:"",joinedTime:(null==s?void 0:s.joinTime)||0,role:null!==(r=null==s?void 0:s.role)&&void 0!==r?r:m.UNDEF}},tI=function(){function e(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"searchFriendsInfo",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(this,"searchGroupMembers",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(this,"searchJoinedGroups",{enumerable:!0,configurable:!0,writable:!0,value:Cp})}return Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=jl.encode(pu,{permission:e}),[4,this.ctx.query($n.updProfilePermiss,this.ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=jl.encode(gu,{nothing:1}),[4,this.ctx.query($n.qProfilePermiss,this.ctx.currentUserId,e,pu)];case 1:return[2,t.sent().trans((function(e){return e.permission}))]}}))}))}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=jl.encode(Eu,{uniqueId:e}),[4,this.ctx.query($n.searchUserProfile,this.ctx.currentUserId,t,_u)];case 1:return(r=a.sent()).isOk?(n=r.data,i=n.userId,o=n.userProfile,s=n.userExtProfile,u=Ft(i,o,s),[2,br(u)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return i=Bh(e,t,r,n),[4,this.ctx.query($n.channelCreate,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,o.wipe()]:(s=jl.decode(bu,o.data.pbData),u={errorKeys:s.censorFailedFields,processCode:s.processCode||0},[2,Tr(o.code,o.msg,u)])}}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return n=Bh(e,t,r),[4,this.ctx.query($n.upChannelInfo,e,n,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=jl.decode(bu,i.data.pbData),[2,Tr(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return t=jl.encode(Tu,{type:x.GROUP,list:e.map((function(e){return{targetId:e}}))}),[4,this.ctx.query($n.qChannelInfo,e[0],t,mu)];case 1:return(r=i.sent()).isOk?(n=sg(r.data).list,[2,br(n.map(eI))]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Eg({targetId:e,users:t,settingInfo:{isQuit:!0,isDelBan:r.removeMuteStatus,isDelAttention:r.removeFollow,isDelWhite:r.removeWhiteList}}),[4,this.ctx.query($n.channelMemKick,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Eg({targetId:e,settingInfo:{isQuit:!0,isDelBan:t.removeMuteStatus,isDelAttention:t.removeFollow,isDelWhite:t.removeWhiteList}}),[4,this.ctx.query($n.channelMemQuit,e,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Eg({targetId:e}),[4,this.ctx.query($n.channelDismiss,e,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return i=Eg({targetId:e,settingInfo:{isQuit:r,isDelBan:n.removeMuteStatus,isDelAttention:n.removeFollow,isDelWhite:n.removeWhiteList},users:[t]}),[4,this.ctx.query($n.channelTransfer,e,i)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=jl.encode(vu,{targetId:t,type:x.GROUP,users:r,operateType:e}),[4,this.ctx.query($n.upChannelManager,t,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=jl.encode(vu,{targetId:t,type:x.GROUP,users:r,operateType:e}),[4,this.ctx.query($n.upChannelFollow,t,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return t=gg({targetId:e}),[4,this.ctx.query($n.qChannelFollow,this.ctx.currentUserId,t,mu)];case 1:return(r=a.sent()).isOk?(n=sg(r.data).list,i=n.map((function(e){return{userId:e.userId,time:e.opTime}})),[2,br(i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=pg({targetId:e,operateType:t?O.ADD:O.REMOVE,channelNickName:t}),[4,this.ctx.query($n.upChannelRemark,e,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=jl.encode(Pu,{targetId:e,type:t,info:r}),[4,this.ctx.query($n.friendAdd,this.ctx.currentUserId,n,bu)];case 1:return[2,i.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=jl.encode(Mu,{targetId:e,type:t}),[4,this.ctx.query($n.friendDel,this.ctx.currentUserId,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=jl.encode(Pu,{targetId:e,type:1}),[4,this.ctx.query($n.friendHandle,this.ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=jl.encode(Pu,{targetId:e,type:2,info:t}),[4,this.ctx.query($n.friendHandle,this.ctx.currentUserId,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return n=jl.encode(wu,{targetId:e,remarkName:t,extProfile:Object.entries(r).map((function(e){var t=s(e,2);return{key:t[0],value:t[1]}}))}),[4,this.ctx.query($n.friendSetPf,this.ctx.currentUserId,n,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=jl.decode(Uu,i.data.pbData),[2,Tr(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=jl.encode(Mu,{targetId:e,type:t}),[4,this.ctx.query($n.friendCheck,this.ctx.currentUserId,r,Lu)];case 1:return[2,n.sent().trans((function(e){return e.list.map((function(e){return{userId:e.targetId,relationType:e.status}}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return r=jl.encode(Du,{queryType:11,friendType:e,page:{size:t.count,order:t.order?0:1,pageToken:t.pageToken}}),[4,this.ctx.query($n.friendsQuery,this.ctx.currentUserId,r,mu)];case 1:return(n=a.sent()).isOk?(i=n.data.page,o=i.pageToken,s=i.hasNext,u=sg(n.data).list,l={pageToken:s&&o?o:"",data:u.map($E)},[2,br(l)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=jl.encode(Du,{queryType:12,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query($n.friendsQuery,this.ctx.currentUserId,t,mu)];case 1:return(r=a.sent()).isOk?(n=r.data.page,i=n.pageToken,o=n.hasNext,s=sg(r.data).list,u={pageToken:o&&i?i:"",data:s.map((function(e){return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,applicationType:e.type,applicationStatus:e.status,operationTime:e.operateTime,extra:e.info||""}}))},[2,br(u)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=jl.encode(Gu,{targetId:e}),[4,this.ctx.query($n.friendsInfoQry,this.ctx.currentUserId,t,ju)];case 1:return[2,r.sent().trans((function(e){return e.list.map($E)}))]}}))}))}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=jl.encode(Vu,{level:e}),[4,this.ctx.query($n.friendAuthSet,this.ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return e=this.ctx.currentUserId,t=jl.encode(Pu,{targetId:e}),[4,this.ctx.query($n.friendAuthGet,e,t,Vu)];case 1:return[2,r.sent().trans((function(e){return e.level}))]}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return r=gg({targetId:e,ids:t}),[4,this.ctx.query($n.qChannelSpeMem,e,r,mu)];case 1:return(n=a.sent()).isOk?(i=sg(n.data).list,o=i.map(Qt),[2,br(o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return i=pg({targetId:e,userId:t,channelNickName:r,additional:n}),[4,this.ctx.query($n.upChannelMem,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,o.wipe()]:(s=jl.decode(bu,o.data.pbData),[2,Tr(o.code,o.msg,{errorKeys:s.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return n=gg({targetId:e,roleType:t,botType:r.filterRobotType,page:{size:r.count,order:r.order?0:1,pageToken:r.pageToken}}),[4,this.ctx.query($n.qChannelMem,e,n,mu)];case 1:return(i=a.sent()).isOk?(o=i.data.page,s=o.pageToken,u=o.hasNext,l=sg(i.data).list,c={pageToken:u&&s?s:"",data:l.map(Qt)},[2,br(c)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=jl.encode(Cu,{targetId:e,type:x.GROUP}),[4,this.ctx.query($n.channelMemJoin,e,t,bu)];case 1:return[2,r.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=jl.encode(Cu,{targetId:e,type:x.GROUP,userIds:t}),[4,this.ctx.query($n.channelMemInvite,e,r,bu)];case 1:return[2,n.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.groupId,r=e.inviterId,n=e.optType,i=e.optResult,o=e.joinUserId,s=e.reason,u=jl.encode(Nu,{targetId:t,type:x.GROUP,optType:n,optResult:i,inviterId:r,joinUserId:o,detail:s}),[4,this.ctx.query($n.channelApplyResp,t,u,bu)];case 1:return[2,a.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=gg({page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query($n.qChannelApplyList,this.ctx.currentUserId,t,mu)];case 1:return(r=a.sent()).isOk?(n=sg(r.data),i=n.pageToken,o=n.hasNext,s=n.list,u=s.map(Xt),[2,br({data:u,pageToken:o&&i?i:""})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return r=gg({roleType:e,page:{size:t.count,pageToken:t.pageToken,order:t.order?1:0}}),[4,this.ctx.query($n.qChannelMemJoin,this.ctx.currentUserId,r,mu)];case 1:return(n=a.sent()).isOk?(i=n.data.page,o=i.pageToken,s=i.hasNext,u=sg(n.data).list,l=u.map(eI),[2,br({data:l,pageToken:s&&o?o:""})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return t=jl.encode(Ru,{type:x.GROUP,ids:e}),[4,this.ctx.query($n.qChannelMemSpeJoin,this.ctx.currentUserId,t,mu)];case 1:return(r=a.sent()).isOk?(n=sg(r.data).list,i=n.map(eI),[2,br(i)]):[2,r.wipe()]}}))}))}}),e}(),rI=((kE={})[P.GROUP_OPERATION]=function(e){return"ChannelEventData"},kE[P.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},kE[E.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},kE),nI=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"decodeByPBName",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=e,i={}[t];try{n=e.length>0&&jl.decode(t,e),Ot(i)&&(n=i.call(this,n,r))}catch(e){this.logger.error(F.L_PB_DECODE_E,t)}return n}}),Object.defineProperty(e.prototype,"formatEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return e.map((function(e){var r,n=e.businessId,i=e.time,a=e.changeType,o=e.originalId,s=e.originalTime,u=e.secondaryId,l=e.isAdmin,c=e.additionalMark,_=e.operatorId,f=e.subChangeType,d=e.secondaryType,h=e.remindType,g=e.isRemindMe,p=e.extIds,E=e.eventData;return E&&(r=t._formatEventData(E,a,f)),{businessId:n,changeType:a,originalId:o,time:i,originalTime:s,secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:_,subChangeType:f,userGroupIds:p,secondaryType:d,remindType:h,isRemindMe:g,eventData:r}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n={};return e&&rI[t]&&rI[t](r)&&(n=jl.decode(rI[t](r),e)||{}),n}}),e}(),iI=((xE={})[x.PRIVATE]=$n.qryPMsg,xE[x.GROUP]=$n.qryGMsg,xE[x.CHATROOM]=$n.qryCHMsg,xE[x.CUSTOMER_SERVICE]=$n.qryCMsg,xE[x.SYSTEM]=$n.qrySMsg,xE[x.APP_PUBLIC_SERVICE]=$n.qryMCMsg,xE[x.PUBLIC_SERVICE]=$n.qryMPMsg,xE[x.ULTRA_GROUP]=$n.qryUgMsg,xE),aI=function(e,t,r,n,i,a){var o=An(t.messageType),s=o.isCounted,u=o.isPersited,l=o.isStatusMessage;return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:i,messageDirection:Ee.SEND,isCounted:s,isMentioned:!!t.isMentioned,content:t.content,messageType:t.messageType,isOffLineMessage:!1,isPersited:u,messageUId:r,sentTime:n,receivedTime:0,disableNotification:!!t.disableNotification,isStatusMessage:!!l,canIncludeExpansion:!!t.canIncludeExpansion,expansion:t.canIncludeExpansion?t.expansion:null,receivedStatus:me.UNREAD,receivedStatusInfo:jt(me.UNREAD),pushConfig:t.pushConfig,isInterrupt:t.isInterrupt,messageId:a||0,sentStatus:se.SENT,directedUserIds:t.directionalUserIdList,disableUpdateLastMessage:t.disableUpdateLastMessage,needReceipt:t.needReceipt}},oI=[P.GROUP_OPERATION,P.GROUP_PROFILE_CHANGE,P.GROUP_APPLICATION_INVITATION,P.GROUP_FOLLOW_USER_CHANGE],sI=[E.FRIEND_APPLICATION],uI=function(e){function o(t,r){var n=e.call(this,t,r)||this;FE.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_subscribeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(n,"_chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_dataHosting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_codec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_latestPullKVMsgTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(n,"_handleInnerMsgOptions",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t){var r=t.messageType;return r===Re.SYNC_READ_STATUS&&(t.directionalUserIdList=fr(e.conversationType,[n.currentUserId])),r===Re.READ_RECEIPT_RESPONSE&&(t.content.receiptMessageDic&&0!==Object.keys(t.content.receiptMessageDic).length||(t.content=n._chat.storage.createReadReceiptResponseContent(e)),t.directionalUserIdList=Object.keys(t.content.receiptMessageDic)),t}}),Object.defineProperty(n,"getOSInfo",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"getProcessInfo",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"getMainProcessInfo",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"setProxy",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"getProxy",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"testProxy",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Np}),Object.defineProperty(n,"subscribeUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Np}),Object.defineProperty(n,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"getLocalMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"deleteLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"deleteLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"batchClearLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"clearLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:Np}),Object.defineProperty(n,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:Cp}),Object.defineProperty(n,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Cp});var i=n._ctx=new nE(r),a=i.logger;return n._codec=new nI(a),n._userSettings=new jE(i),n._chat=new Lp(i,n._userSettings,n),n._chatroom=new GE(i),n._dataHosting=new tI(i),n._chat.on("messages",n._handleChatMessages,n),n._chat.on("offlineFinished",(function(){return n._watcher.pullFinished()}),n),n._chat.on("syncReadStatusV4",n._handleSyncReadStatusV4,n),n._chat.on("expansions",n._handleExpansions,n),n._chat.on("readReceiptV4",n._handleReadReceiptV4,n),n._chat.on("conversationStatusChanged",n._conversationStatusChanged,n),n._chat.on("conversationStatusSynced",(function(e,t){return n._watcher.conversationStatusSynced(t)}),n),n._chat.on("sgRelationsSynced",(function(e,t){return n._watcher.sgRelationsSynced(t)}),n),n._chat.on("ultraGroupEnable",(function(){return n._watcher.ultraGroupEnable()}),n),n._chatroom.on("message",n._handleChatroomMessages,n),n._chatroom.on("chatroom",n._handlerChatroomEvent,n),i.on("sCmd",n._handleSCmdNotify,n),i.on("signal",n._handleSignal,n),i.on("onConnected",n.onConnected,n),i.on("onDisconnected",n.onDisconnected,n),i.on("onConnecting",n.onConnecting,n),i.on("onSuspend",n.onSuspend,n),i.on("messagesFromUG",n._handleMessagesFromUltraGroup,n),i.on("serverEvent",l(n,FE,"m",QE),n),i.on("readReceiptResponseV5",l(n,FE,"m",HE),n),i.on("speechToTextResponse",l(n,FE,"m",YE),n),i.on("ugUserGroupChanged",n._handleUserGroupStatus,n),i.on("ugChannelChanged",n._handleUltraChannelChange,n),i.on("messageModified",l(n,FE,"m",WE),n),i.on("messageModifiedSyncCompleted",l(n,FE,"m",JE),n),i.on("ugMsgExpansionUpdated",l(n,FE,"m",qE),n),i.on("ugMsgRecalled",l(n,FE,"m",KE),n),i.on("robotsSynced",l(n,FE,"m",BE),n),n._userSettings.on("voipInfoChanged",n._naviChangeHandler,n),n._userSettings.on("tagsChanged",(function(){return n._watcher.tag()}),n),n._userSettings.on("userSettingsSynced",(function(e,t){return n._watcher.userSettingsSynced(t)}),n),n._userSettings.on("userSettingsChanged",(function(e,t){return n._watcher.userSettingsChanged(t)}),n),n}return t(o,e),Object.defineProperty(o.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"userSettings",{get:function(){return this._userSettings},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"dataHosting",{get:function(){return this._dataHosting},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"usingCppEngine",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"logger",{get:function(){return this._ctx.logger},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._ctx.getNaviInfoFromCache();this._initSubscribeManager(r),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(t)}}),Object.defineProperty(o.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resetMemoryState(),this._watcher.onDisconnected(t)}}),Object.defineProperty(o.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.onSuspend(t)}}),Object.defineProperty(o.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(o.prototype,"_handleSyncReadStatusV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;t.forEach((function(e){return r._watcher.syncReadStatus(e)}))}}),Object.defineProperty(o.prototype,"_handleReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;t.forEach((function(e){return r._watcher.messageReadReceipt(e)}))}}),Object.defineProperty(o.prototype,"_handleExpansions",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;t.forEach((function(e){return r._watcher.expansion(e)}))}}),Object.defineProperty(o.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));this._watcher.conversation(t),r&&this._watcher.conversationTag()}}),Object.defineProperty(o.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new kc(this._ctx,{syncSubscribeUserStatusFinished:function(e){var r,n;null===(n=(r=t._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(r,e)},subscribeUserStatusChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedUserStatusChange)||void 0===n||n.call(r,e)},subscribeRelationChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedRelationChange)||void 0===n||n.call(r,e)},ownUserProfileChanged:function(e){var r,n;null===(n=(r=t._watcher).ownUserProfileChanged)||void 0===n||n.call(r,e)}},this.currentUserId,this._ctx.delayTime,this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(o.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new xc(this._appkey,e,t,this.logger.proxy)}}),Object.defineProperty(o.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ctx.navi.request(this._ctx.currentToken,!0,!0,this.logger.createTraceId())}}),Object.defineProperty(o.prototype,"naviInfo",{get:function(){return this._ctx.getNaviInfoFromCache()},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"connectedTime",{get:function(){return this._ctx.connectedTime},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"connectionStatus",{get:function(){return this._ctx.connectionStatus},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){return a(this,(function(i){return this._openCallPlus=r,[2,this._ctx.connect(e,t,r,n)]}))}))}}),Object.defineProperty(o.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=new Map,a=[];t.forEach((function(e){var t,r,o,s=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,_=e.isMentioned,f=e.isCounted,d=e.senderUserId,h=e.messageType,g=e.sentTime,p=e.channelType,E=e.isPersited,I={conversationType:x.ULTRA_GROUP,targetId:s,channelId:c||""},b=n._chat.storage.getOrCreateModel(I,!0),T=i.get(b)||{params:{channelType:p},time:g};i.set(b,T),T.time=g;var v=T.params;if(E&&(v.hidden=!1,v.latestMessage=e,v.operationTime=g),f&&d!==n.currentUserId&&h!==Re.RECALL_NOTIFICATION_MESSAGE){v.unreadCount=(v.unreadCount||b.unreadCount)+1;var R=(null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===Y.ALL;_&&(R||(null===(o=null===(r=null==u?void 0:u.mentionedInfo)||void 0===r?void 0:r.userIdList)||void 0===o?void 0:o.includes(n.currentUserId)))&&(v.unreadMentionedCount=(v.unreadMentionedCount||b.unreadMentionedCount)+1,R||(v.unreadMentionedMeCount=(v.unreadMentionedMeCount||b.unreadMentionedMeCount)+1),v.hasMentioned=!0,v.mentionedInfo=null==u?void 0:u.mentionedInfo),b.firstUnreadMessage||v.firstUnreadMessageUId||(v.firstUnreadMessageType=h,v.firstUnreadMessageUId=l,v.firstUnreadTime=g)}a.push(e)}));var o=[],u=[];Array.from(i.entries()).forEach((function(e){var t=s(e,2),r=t[0],n=t[1],i=n.params,a=n.time;o.push(r);var l=r.updateAttrs(i,a);l&&u.push({conversation:r.toIReceivedConversation(),updatedItems:l})})),this._chat.storage.updateConversationStorage(o),u.length>0&&this._watcher.conversation(u),this._batchMessage(a)}}),Object.defineProperty(o.prototype,"_handleChatroomMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this._watcher.batchMessage(t)}}),Object.defineProperty(o.prototype,"_handlerChatroomEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.chatroom(t)}}),Object.defineProperty(o.prototype,"_handleChatMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this._watcher.batchMessage(r)}}),Object.defineProperty(o.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=t.syncMsg,a=t.topic;if(i)this._receiveSyncMsg(t,r);else switch(ti(a)){case $n.rtc_ntf:this._receiveRtcKv(t.pbData);break;case $n.s_opNtf:this._pullOperateStatusNotify(t);break;case $n.s_pubCall:this._pubCallInfo(t);break;case $n.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(t)}}}),Object.defineProperty(o.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n,i,a=t.time;switch(t.type){case 8:null===(r=this._subscribeManager)||void 0===r||r.startsyncSubscribeUserStatus(a);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(a);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(o.prototype,"_receiveMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,r=e.channelId,n=void 0===r?"":r,i=e.conversationType,a=e.targetId,o=t.put,s=t.del,u=t.mid;o&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:o,channelId:n,conversationType:i,targetId:a}}),s&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:s,channelId:n,conversationType:i,targetId:a}})}}),Object.defineProperty(o.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var a=this._chat.storage.clearConversationUnreadCount({conversationType:e,targetId:t,channelId:r},i);n&&a&&this._watcher.conversation([a])}}),Object.defineProperty(o.prototype,"_updateSGModelCacheAfterSent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.isPersited,i=e.targetId,a=e.channelId,o=e.sentTime,s=e.disableUpdateLastMessage,u=e.messageType,l=e.messageUId,c=e.content;if(ee(t,W)){var _=this.naviInfo,f={conversationType:t,targetId:i,channelId:a},d=this._chat.storage.getOrCreateModel(f,!0),h={},g=u===Re.RECALL;if(r){g&&!d.hidden||(h.operationTime=o),h.hidden=!1;var p=g?c.sentTime:o;s||d.latestMessage&&!(d.latestMessage.sentTime<=p)||(h.latestMessage=_.supportRecallRefactor&&g?Lc(e,!0):e)}if(this._ctx.includeUg&&u===Re.EXPANSION_NOTIFY&&d.latestMessage&&d.latestMessage.messageUId===l){var E=c,I=E.put,b=E.del;E.clear?d.latestMessage.expansion={}:I?d.latestMessage.expansion=n(n({},d.latestMessage.expansion),I):b&&d.latestMessage.expansion&&b.forEach((function(e){delete d.latestMessage.expansion[e]}))}var T=d.updateAttrs(h,e.sentTime);this._chat.storage.updateConversationStorage([d]),T&&this._watcher.conversation([{conversation:d.toIReceivedConversation(),updatedItems:T}])}}}),Object.defineProperty(o.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;switch(ti(e.topic)){case $n.updRTime:this._receivesyncReadStatus(e);break;case $n.updUserSub:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(o.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.batchMessage(e)}}),Object.defineProperty(o.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=jl.decode(Qs,e.pbData),r=t.key,n=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:r,value:n}]}))}}),Object.defineProperty(o.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=jl.decode(es,e.pbData),r=t.type,n=t.channelId,i=t.msgTime,a=t.busChannel;this._clearConversationUnreadCount(r,n,a||"",!0,i),this._watcher.syncReadStatus({conversationType:r,targetId:n,channelId:a,timestamp:i})}}),Object.defineProperty(o.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r,n;return a(this,(function(i){switch(i.label){case 0:return this._ctx.isConnected?(e=jl.encode(Xs,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._ctx.query($n.pullKvMsg,this.currentUserId,e,Zs)]):[2];case 1:return t=i.sent(),r=t.isOk,n=t.data,r&&n?(this._latestPullKVMsgTimestamp=n.maxTime,this._watcher.callInfo(JSON.stringify({list:n.info})),[2]):[2]}}))}))}}),Object.defineProperty(o.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,_,f,d,h,g,p=this;return a(this,(function(a){switch(a.label){case 0:return r=e.conversationType,n=e.targetId,i=e.channelId,o=t.timestamp,s=t.count,u=t.order,l=iI[r],c=this.currentUserId,_=ug({targetId:n,busChannel:i,time:o||(1===u?1:this._ctx.serverTime+6e4),count:s,order:u}),f=r===x.CHATROOM?n:c,[4,this._ctx.query(l,f,_,void 0)];case 1:return(d=a.sent()).isOk?(h=lg(d.data.pbData),g=h.list.map((function(e){var t=Sc(e,c,!1,n);if(t.messageDirection===Ee.SEND){var r=p._chat.storage.getReadReceiptResponseUsers(t,t.messageUId);t.readReceiptInfo={isReceiptRequestMessage:!0,readerList:r}}return t})),[2,br({hasMore:!!h.hasMsg,list:0===u?g.reverse():g})]):[2,d.wipe()]}}))}))}}),Object.defineProperty(o.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),r=JSON.stringify(e),this.logger.info(F.L_VER_REPORT_T,r,t),n=jl.encode(Us,{sdkInfo:r}),[4,this._ctx.query($n.reportsdk,this._ctx.currentUserId,n)];case 1:return i=a.sent(),this.logger.summary(F.L_VER_REPORT_R,i,t),[2]}}))}))}}),Object.defineProperty(o.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return this._chat.storage.setDrafts(e,t),[2,br()]}))}))}}),Object.defineProperty(o.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this._chat.storage.getDrafts(e),[2,br(t)]}))}))}}),Object.defineProperty(o.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this._chat.storage.deleteDrafts(e),[2,br()]}))}))}}),Object.defineProperty(o.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,o){return i(this,void 0,void 0,(function(){var r,i,s,u,l,c,_,f,d,h,g,p,E,I,b,T,v,R;return a(this,(function(a){switch(a.label){case 0:return r=e.conversationType,i=e.targetId,t=this._handleInnerMsgOptions(e,t),s=!1,[x.PRIVATE,x.GROUP].includes(r)&&(t.isStatusMessage||An(t.messageType).isStatusMessage)&&(s=!0),u=s?function(e){var t;return(t={},t[x.PRIVATE]=$n.ppMsgS,t[x.GROUP]=$n.pgMsgS,t)[e]}(r):function(e){var t;return(t={},t[x.PRIVATE]=$n.ppMsgP,t[x.GROUP]=$n.pgMsgP,t[x.CHATROOM]=$n.chatMsg,t[x.CUSTOMER_SERVICE]=$n.pcMsgP,t[x.RTC_ROOM]=$n.prMsgS,t[x.SYSTEM]=$n.pbMsgP,t)[e]}(r)||$n.ppMsgP,t.messageId||(t.messageId=or()),l=t.messageId,c=hg(e,t),(_=new Sa($n[u],c,r===x.SYSTEM?this.currentUserId:i)).setHeaderQos(ii),s?(this._ctx.sendOnly(_),[2,br(aI(e,n(n({},t),{isStatusMessage:s}),"",0,this.currentUserId,l))]):(f=this._ctx.serverTime,d=aI(e,n(n({},t),{isStatusMessage:s}),"",f,this.currentUserId,l),null==o||o(l),h=Date.now(),[4,this._ctx.send(_)]);case 1:return g=a.sent(),p=g.code,E=g.isOk,I=g.msg,b=g.data,E?(v=(T=b).timestamp,R=T.messageUId,d.sentTime=v,d.messageUId=R,this._sendMessageSuccessHandle(d),this._ctx.checkIfNeedRecordMessageUId(r,R)&&this.logger.record(be.IM_MSG_SEND,JSON.stringify({msg_id:R,channel:r,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:p})),[2,br(d)]):(this._ctx.checkIfNeedRecordMessageUId(r)&&this.logger.record(be.IM_MSG_SEND,JSON.stringify({channel:r,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:p})),d.sentStatus=se.FAILED,[2,Tr(p,I,d)])}}))}))}}),Object.defineProperty(o.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.conversationType!==x.CHATROOM&&this._chat.storage.addSentRecord(e.messageUId,e.sentTime),this._updateSGModelCacheAfterSent(e);var t=e.messageType;t===Re.READ_RECEIPT_REQUEST&&this._chat.storage.addReadReceiptRequest(e,this.currentUserId),t===Re.READ_RECEIPT_RESPONSE&&this._chat.storage.handleReadReceiptResponse(e,this.currentUserId)}}),Object.defineProperty(o.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,_,f,d,h,g,p,E,I,b,T,v,R,m;return a(this,(function(a){switch(a.label){case 0:return r=e.targetId,n=e.conversationType,i=e.channelId||"",o=t.user,s=t.extra,u=t.isDelete,l=t.directionalUserIdList,c=t.disableUpdateLastMessage,_=t.messageUId,f=t.sentTime,d=t.disableNotification,h=t.pushConfig,g=t.pushContent,p=t.isAdmin,E={conversationType:n,targetId:r,messageUId:_,sentTime:f,channelId:i,isDelete:!!u,isAdmin:!!p},o&&(E.user=o),s&&(E.extra=s),I={content:E,messageType:Re.RECALL,disableNotification:d,pushConfig:h,pushContent:(null==h?void 0:h.pushContent)||g,disableUpdateLastMessage:c,directionalUserIdList:fr(n,l)},b=hg(e,I),(T=new Sa($n.recallMsg,b,this.currentUserId)).setHeaderQos(ii),[4,this._ctx.send(T)];case 1:return(v=a.sent()).isOk?(R=v.data,n!==x.ULTRA_GROUP&&(R.messageUId="Cmd:".concat(_)),m=aI(e,I,R.messageUId,R.timestamp,this.currentUserId),n===x.ULTRA_GROUP?(this._chat.storage.addUGSentRecord(R.messageUId,R.timestamp),this._updateUltraGroupWhenRecallMsg(m)):(this._chat.storage.addSentRecord(R.messageUId,R.timestamp),this._updateSGModelCacheAfterSent(m)),[2,br(m)]):[2,v.wipe()]}}))}))}}),Object.defineProperty(o.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ctx.navi.updateVoipCallInfo(this._ctx.currentToken,t);var r=this._ctx.getNaviInfoFromCache();this._watcher.onNaviDataChange(n({},r))}}),Object.defineProperty(o.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,o,s,u){return i(this,void 0,void 0,(function(){var i,l,c,_,f;return a(this,(function(a){switch(a.label){case 0:return i=o&&"uploads"!==o?t||"":tr(e,t),l=this.naviInfo,c=cr(l,this.logger),_="",c||(_=JSON.stringify({uploadDomain:c})),f=jl.encode(Uo,{type:e,key:i,httpMethod:r||"",queryString:o||"",url:s||"",ext:_,size:u?Math.ceil(u):0,ipType:l.ipType||0}),[4,this._ctx.query($n.qnTkn,this.currentUserId,f,Go)];case 1:return[2,a.sent().trans((function(e){return n(n({},e),{fileName:i,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(o.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,o){return i(this,void 0,void 0,(function(){var i,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=this.naviInfo,u="",l="",t===r.QINIU?s=$n.qnUrl:t===r.AWS?s=$n.s3Url:t===r.STC?s=$n.stcUrl:t===r.MINIO?(s=$n.minioUrl,u=cr(i,this.logger),l=JSON.stringify({url:u})):s=$n.aliUrl,c=jl.encode(Do,{type:e,key:n,fileName:o,ext:l,size:-1,ipType:i.ipType||0}),[4,this._ctx.query(s,this.currentUserId,c,Vo)];case 1:return[2,a.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(o.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this._ctx.disconnect(e,t)];case 1:return r.sent(),this._resetMemoryState(),[2,br()]}}))}))}}),Object.defineProperty(o.prototype,"_resetMemoryState",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subscribeManager&&delete this._subscribeManager}}),Object.defineProperty(o.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(o.prototype,"serverTime",{get:function(){return this._ctx.serverTime},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"userId",{get:function(){return this._ctx.currentUserId},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"currentUserId",{get:function(){return this._ctx.currentUserId},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,Tr(k.TAG_EXISTS)]:[2,this._userSettings.createTag(e)]}))}))}}),Object.defineProperty(o.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e)?[2,this._userSettings.removeTag(e)]:[2,Tr(k.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(o.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,this._userSettings.createTag(e)]:[2,Tr(k.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(o.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){for(i in t=this._userSettings.getTags(),r=this._chat.storage.getTagConversationCountMap(),n=[],t)n.push({tagId:i,tagName:t[i].tagName,createdTime:t[i].createdTime,conversationCount:(null===(e=r.get(i))||void 0===e?void 0:e.length)||0});return[2,br(n)]}))}))}}),Object.defineProperty(o.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,o){return i(this,void 0,void 0,(function(){var r,i,s,u,l,c,_,f,d,h,g,p,E,I,b;return a(this,(function(a){switch(a.label){case 0:return r=e.targetId,t.messageId||(t.messageId=or()),i=t.messageId,s=hg(e,t),(u=new Sa($n.ugMsg,s,r)).setHeaderQos(ii),l=this._ctx.serverTime,c=aI(e,n({},t),"",l,this.currentUserId,i),o&&o(i),_=Date.now(),[4,this._ctx.send(u)];case 1:return f=a.sent(),d=f.code,h=f.data,d!==k.SUCCESS?(this._ctx.checkIfNeedRecordMessageUId(x.ULTRA_GROUP)&&this.logger.record(be.IM_MSG_SEND,JSON.stringify({channel:x.ULTRA_GROUP,start_ts:_,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:d})),c.sentStatus=se.FAILED,[2,Tr(d,void 0,c)]):(p=(g=h).timestamp,E=g.messageUId,c.sentTime=p,c.messageUId=E,this._ctx.checkIfNeedRecordMessageUId(x.ULTRA_GROUP,E)&&this.logger.record(be.IM_MSG_SEND,JSON.stringify({msg_id:E,channel:x.ULTRA_GROUP,start_ts:_,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:d})),this._chat.storage.addUGSentRecord(E,p),I=this._chat.storage.getOrCreateModel(e,!0),(b=I.updateAttrs({operationTime:p,latestMessage:n({},c)},p))&&this._watcher.conversation([{conversation:I.toIReceivedConversation(),updatedItems:b}]),[2,br(c)])}}))}))}}),Object.defineProperty(o.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._ctx.isConnected){var t=function(e){var t=e,r=t.type,n=t.notifyType,i=t.info,a=t.summary,o=[],s=[],u=!(2&~n),l=!(1&~n);return l&&Array.isArray(i)&&i.forEach((function(e){var t=e,r=t.targetId,n=t.busChannel,i=t.userId,a=t.opType,s=t.optime;o.push({targetId:r,channelId:n,userId:i,operationType:a,operationTime:s})})),u&&Array.isArray(a)&&a.forEach((function(e){var t=e,r=t.targetId,n=t.busChannel,i=t.count,a=t.opType;s.push({targetId:r,channelId:n,count:i,operationType:a})})),{conversationType:r,info:o,summary:s,hasInfo:l,hasSummary:u}}(jl.decode(Js,e.pbData));this._watcher.operateStatus(t)}}}),Object.defineProperty(o.prototype,"_handleConvertEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=[];e.filter((function(e){return 0===e.subChangeType})).forEach((function(e){var t=jl.decode(Zu,new Uint8Array(e.eventData)).results;n.push.apply(n,u([],s(t.map((function(e){return{identifier:e.messageUID,from:e.inputSource,code:e.code,translateInfo:{targetLanguage:e.targetLan,translatedText:e.transResult||"",status:e.code===k.SUCCESS?wn.SUCCESS:wn.FAILED}}}))),!1))})),n.length&&(null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,n))}}),Object.defineProperty(o.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:oI},Friend:{map:{},types:sI}},r=function(e,t,r){e[t]||(e[t]=[]),e[t].push(r)};e.forEach((function(e){var n=e.changeType;for(var i in t)if(t[i].types.includes(n)){r(t[i].map,n,e);break}}));var n={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&n[i](t[i].map)}}),Object.defineProperty(o.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=P.GROUP_OPERATION,r=P.GROUP_PROFILE_CHANGE,n=P.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[r]&&this._handleGroupProfileChange(e[r]),e[n]&&this._handleFollowUserChange(e[n])}}),Object.defineProperty(o.prototype,"_processChangeMapFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e[E.FRIEND_APPLICATION]||[]).forEach((function(e){var r,n,i,a,o,s,u,l,c,_,f=e.subChangeType,d=e.businessId,h=e.time,g=e.eventData,E=I.FRIEND_APPLY,b=I.FRIEND_REFUSE,T=I.FRIEND_USER_INFO,v=I.FRIENDS_INPUT,R=I.FRIEND_CLEAR,m=I.FRIEND_INFO_CHANGE,A=I.FRIEND_INFO_CHANGE_SYNC;switch(f){case E:case b:var y=f===E?p.UNHANDLED:p.REFUSED;null===(n=(r=t._watcher).friendApplicationStatusChanged)||void 0===n||n.call(r,{userId:d,applicationType:g.applyType,applicationStatus:y,directionType:g.friendType,operationTime:h,extra:g.info||""});break;case T:null===(a=(i=t._watcher).friendAdd)||void 0===a||a.call(i,{userId:d,name:g.name,portraitUri:g.portraitUrl,directionType:g.friendType,operationTime:h});break;case v:null===(s=(o=t._watcher).friendDelete)||void 0===s||s.call(o,{userIds:g.targetId,directionType:g.type,operationTime:h});break;case R:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,h);break;case m:break;case A:null===(_=(c=t._watcher).friendInfoChangedSync)||void 0===_||_.call(c,{userId:d,remark:g.remarkname,extProfile:g.extProfile,operationTime:h})}}))}}),Object.defineProperty(o.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,a,o=e.subChangeType,u=e.businessId,l=e.time,c=e.eventData,_=c.optUserInfo,f=c.channelInfo,d=c.userInfos,h={groupId:u,operation:o,operationTime:l};_&&(r=s(qt([_]),1),h.operatorInfo=r[0]),o===A.CREATE&&(n=s(function(e){return void 0===e&&(e=[]),e.map((function(e){var t,r,n,i,a,o,s,u,l,c=Kt(e.settingProfile)||{},_=e.extProfile||[],f=e.targetId,d=e.baseInfo,h=e.userInfo;return{groupId:f,groupName:null!==(t=c.name)&&void 0!==t?t:"",portraitUri:null!==(r=c.portraitUrl)&&void 0!==r?r:"",introduction:null!==(n=c.introduction)&&void 0!==n?n:"",notice:null!==(i=c.announcement)&&void 0!==i?i:"",extProfile:Kt(_),joinPermission:~~c.joinPerm,removeMemberPermission:~~c.removePerm,invitePermission:~~c.memInvitePerm,inviteHandlePermission:~~c.invitePerm,groupInfoEditPermission:~~c.profilePerm,memberInfoEditPermission:~~c.memProfilePerm,creatorId:null!==(a=null==d?void 0:d.creatorId)&&void 0!==a?a:"",ownerId:null!==(o=null==d?void 0:d.ownerId)&&void 0!==o?o:"",createTime:(null==d?void 0:d.createTime)||0,membersCount:null!==(s=null==d?void 0:d.memberCount)&&void 0!==s?s:0,remark:null!==(u=null==h?void 0:h.remarkName)&&void 0!==u?u:"",joinedTime:(null==h?void 0:h.joinTime)||0,role:null!==(l=null==h?void 0:h.role)&&void 0!==l?l:m.UNDEF}}))}([f]),1),h.groupInfo=n[0]),[A.CREATE,A.DISMISS].includes(o)||(h.memberInfos=qt(d)),null===(a=(i=t._watcher).groupOperation)||void 0===a||a.call(i,h)}))}}),Object.defineProperty(o.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,a,o,u,l=e.businessId,c=e.time,_=e.eventData,f=e.subChangeType,d=e.secondaryId;switch(f){case y.GROUP_INFO_CHANGE:var h=s(qt([_.optUserInfo]),1)[0],g=s(Yt([_.channelInfo]),1)[0],p=s(_.channelFullInfo?Yt([_.channelFullInfo]):[void 0],1)[0];null===(n=(r=t._watcher).groupInfoChanged)||void 0===n||n.call(r,{operatorInfo:h,groupInfo:g,changedGroupInfo:g,operationTime:c,fullGroupInfo:p});break;case y.MEMBER_PROFILE_CHANGE:h=s(qt([_.optUserInfo]),1)[0];var E=qt(_.userInfos)[0];null===(a=(i=t._watcher).groupMemberInfoChanged)||void 0===a||a.call(i,{groupId:l,operatorInfo:h,memberInfo:E,operationTime:c});break;case y.GROUP_REMARK_DELETE:case y.GROUP_REMARK_SET:var I=f===y.GROUP_REMARK_SET?O.ADD:O.REMOVE;null===(u=(o=t._watcher).groupRemarkChangedSync)||void 0===u||u.call(o,{groupId:l,operationType:I,operationTime:c,groupRemark:d})}}))}}),Object.defineProperty(o.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i=e.subChangeType,a=e.businessId,o=e.time,s=e.userGroupIds,u=1===i?O.ADD:O.REMOVE;null===(n=(r=t._watcher).groupFollowsChangedSync)||void 0===n||n.call(r,{groupId:a,operationType:u,operationTime:o,userIds:s})}))}}),Object.defineProperty(o.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],i=[],a=[];t.forEach((function(e){var t=e.subChangeType,o=e.targetId;e.msgTime;var s=e.operatorId,u=e.busChannelType,l=e.time,c=e.busChannel||"",_={conversationType:x.ULTRA_GROUP,targetId:o,channelId:c},f=r._chat.storage.getModel(_);switch(t){case ie.PRIVATE_TO_PUBLIC:null==f||f.updateAttrs({channelType:te.PUBLIC}),n.push({targetId:o,channelId:c,changeType:re.PRIVATE_TO_PUBLIC,channelType:te.PUBLIC});break;case ie.PUBLIC_TO_PRIVATE:null==f||f.updateAttrs({channelType:te.PRIVATE}),n.push({targetId:o,channelId:c,changeType:re.PUBLIC_TO_PRIVATE,channelType:te.PRIVATE});break;case ie.PUBLIC_TO_PRIVATE_USER_NOT_IN:f&&r._chat.storage.removeConversation(f),n.push({targetId:o,channelId:c,changeType:re.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:u});break;case ie.CHANNEL_DELETE:f&&r._chat.storage.removeConversation(f),i.push({targetId:o,channelId:c,channelType:u,deleteTime:l});break;case ie.CHANNEL_USER_KICKED:a.push({targetId:o,channelId:c,userId:s,channelType:te.PRIVATE}),s===r.currentUserId&&f&&r._chat.storage.removeConversation(f);case ie.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),i.length>0&&this._watcher.ultraGroupChannelDelete(i),a.length>0&&this._watcher.ultraGroupChannelUserKicked(a)}}),Object.defineProperty(o.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var e,r,n,i,o,s;return a(this,(function(a){return e=[],r=[],n=[],i=[],o=[],t.forEach((function(t){var a=t.type,s=t.targetId,u=t.busChannelType,l=t.busChannel,c=t.userGroupIds;switch(t.subChangeType){case ae.REMOVE_USER_GROUP:e.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.JOIN_USER_GROUP:r.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.EXIT_USER_GROUP:n.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.CHANNEL_BIND_USER_GROUP:i.push({conversation:{conversationType:a,targetId:s,channelId:l},channelType:u,userGroupIds:c});break;case ae.CHANNEL_UNBIND_USER_GROUP:o.push({conversation:{conversationType:a,targetId:s,channelId:l},channelType:u,userGroupIds:c})}})),s={},e.length>0&&(s.userGroupDisband=e),r.length>0&&(s.userAdded=r),n.length>0&&(s.userRemoved=n),i.length>0&&(s.userGroupBindChannel=i),o.length>0&&(s.userGroupUnBindChannel=o),this._watcher.userGroupStatus(s),[2]}))}))}}),Object.defineProperty(o.prototype,"_updateUltraGroupWhenRecallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._chat.storage.getModel(e);if(r){var n={},i=e.content,a=i.messageUId,o=i.sentTime,s=r.latestMessage;s&&s.messageUId===a&&(n.latestMessage=Lc(e,!0)),o&&r.lastReadTime<o&&r.unreadCount&&(n.unreadCount=r.unreadCount-1,t!==oe.ALL&&t!==oe.ME||!r.unreadMentionedCount||(n.unreadMentionedCount=r.unreadMentionedCount-1),t===oe.ME&&r.unreadMentionedCount&&(n.unreadMentionedMeCount=r.unreadMentionedMeCount-1));var u=r.updateAttrs(n,e.sentTime);this._chat.storage.updateConversationStorage([r]),u&&this._watcher.conversation([{conversation:r.toIReceivedConversation(),updatedItems:u}])}}}),Object.defineProperty(o.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._subscribeManager.updateSubscribeRelation(e,t,fe.SUBSCRIBE,r)]}))}))}}),Object.defineProperty(o.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this._subscribeManager.updateSubscribeRelation(e,t,fe.UNSUBSCRIBE)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(o.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){return i=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserList(e,t,r),[2,br(i)]}))}))}}),Object.defineProperty(o.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){return n=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserStatus(e,t),[2,br(n||[])]}))}))}}),Object.defineProperty(o.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return i(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=jl.encode(_u,l(this,FE,"m",XE).call(this,e)),[4,this._ctx.query($n.updUserProfile,this.currentUserId,r,void 0)];case 1:return(n=a.sent()).data?(i=jl.decode(fu,n.data.pbData),n.isOk?(o=i.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,o),[2,n.wipe()]):(s=i.censorFailedFields,[2,Tr(n.code,"",s&&0!==s.length?{errorKeys:s,errorKey:s[0]}:void 0)])):[2,n.wipe()]}}))}))}}),Object.defineProperty(o.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subscribeManager.getOwnProfile()}}),Object.defineProperty(o.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._subscribeManager.getUserProfiles(e)]}))}))}}),Object.defineProperty(o.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){return a(this,(function(i){switch(i.label){case 0:return r?[3,2]:[4,this._ctx.send(new Sa(t,n,e))];case 1:return[2,i.sent().wipe()];case 2:return[4,this._ctx.query(t,e,n,void 0)];case 3:return[2,i.sent().trans((function(e){return e.pbData}))]}}))}))}}),Object.defineProperty(o.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return n=nc(t,r),[4,this.rtcSignaling(e,$n[$n.rtcPing],!0,n)];case 1:return(i=a.sent()).isOk?(o=jl.decode(dl,i.data),[2,br(o)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(o.prototype,"deviceId",{get:function(){return this._ctx.appStorage.deviceId},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._ctx.appStorage.setCustomDeviceId(e.deviceId),this._ctx.appStorage.setPackageName(e.packageName)}}),Object.defineProperty(o.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){i(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return Fc?(Jc&&(clearTimeout(Jc),Jc=null),[4,Fc]):[2];case 1:return(e=r.sent())&&(t=e.db,Qc.push(t)),Fc=null,[2]}}))}))}}),Object.defineProperty(o.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ctx.handleNetworkChange(e,t)}}),Object.defineProperty(o.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i;return a(this,(function(a){switch(a.label){case 0:return n=jl.encode(Ks,{key:t,dataContent:r}),[4,this._ctx.query($n.reqCall,e,n,Ks)];case 1:return(i=a.sent()).isOk?[2,i.trans((function(e){return{key:e.key,value:e.dataContent}}))]:[2,i.wipe()]}}))}))}}),Object.defineProperty(o.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=jl.encode(Fu,e),[4,this._ctx.query($n.addUnpush,this.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(o.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=jl.encode(Bu,{nothing:0}),[4,this._ctx.query($n.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(o.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=jl.encode(Hu,{nothing:0}),[4,this._ctx.query($n.qryUnpush,this.currentUserId,e,Yu)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,r=e.spanMinutes,n=e.startTime,i=e.level,a=e.timezone;return t?{spanMinutes:r,startTime:n,level:i,timezone:a}:{spanMinutes:0,startTime:"",level:Me.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(o.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,br(Xr.getStatsUrlList(this.naviInfo))]}))}))}}),Object.defineProperty(o.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u,l,c,_,f=this;return a(this,(function(a){switch(a.label){case 0:return i=0===n?e[0].identifier:this.currentUserId,o=this.userSettings.storage.get("value").transLan,s=[],u=[],e.forEach((function(e){var t=e.sourceLanguage,r=e.content,i=e.targetLanguage||o;t!==i?r?s.push({messageUID:e.identifier,sourceLan:e.sourceLanguage,targetLan:e.targetLanguage||o,text:e.content,inputSource:n,transType:1}):u.push({identifier:e.identifier,from:n,code:k.TRANSLATION_TEXT_INVALID,translateInfo:{targetLanguage:i,translatedText:"",status:wn.NONE}}):u.push({identifier:e.identifier,from:n,code:k.TRANSLATION_LANGUAGE_SAME,translateInfo:{targetLanguage:i,translatedText:"",status:wn.NONE}})})),0!==s.length?[3,1]:(l=br(),[3,3]);case 1:return c=jl.encode(Ju,{businessType:3,businessInfo:jl.encode(Xu,{forceTrans:r,transInfos:s,model:t})}),[4,this._ctx.query($n.upConvertMsg,i,c,Ku)];case 2:_=a.sent(),l=_.wipe(),a.label=3;case 3:return u.length>0&&setTimeout((function(){return f._watcher.translateResponse(u)}),0),[2,l]}}))}))}}),Object.defineProperty(o.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return this._subscribeManager?(t=[],r=new Set,this._subscribeManager.getSubscribeUserStatus(_e.ONLINE_STATUS,e).forEach((function(e){var n=e.userId,i=e.details,a=(void 0===i?[]:i).map((function(e){return{platform:e.platform,isOnline:!!e.eventValue,updateTime:e.changeTime}})),o=a.some((function(e){return e.isOnline})),s={userId:n,isOnline:o,details:a};t.push(s),r.add(n)})),0===(n=e.filter((function(e){return!r.has(e)}))).length?[2,br(t)]:[4,l(this,FE,"m",ZE).call(this,_e.FRIEND_ONLINE_STATUS,n)]):[2,br([])];case 1:return(i=a.sent()).isOk?(i.data.list.forEach((function(e){var r,n=e.subUserId,i=e.data.map((function(e){return{platform:e.platformInfo,isOnline:!!e.value,updateTime:e.versionTime}})),a=i.some((function(e){return e.isOnline}));t.push((r={userId:n,isOnline:a,details:i},[ce.iOS,ce.Android,ce.Web,ce.PC,ce.Mini,ce.HarmonyOS].forEach((function(e){r.details.some((function(t){return t.platform===e}))||r.details.push({platform:e,isOnline:!1,updateTime:0})})),r))})),[2,br(t)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(o.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._ctx.getAllRobots(!1)]}))}))}}),o}(oc);FE=new WeakSet,BE=function(e,t,r,n,i){this._watcher.robotsSynced(t,n)},HE=function(e,t){this._watcher.readReceiptResponseV5(t)},YE=function(e,t){this._watcher.speechToTextResponse(t)},WE=function(e,t){this._watcher.messagesModified(t)},JE=function(e){this._watcher.messageModifiedSyncCompleted()},qE=function(e,t){this._watcher.ultraGroupMessageExpansionUpdated(t)},KE=function(e,t){this._watcher.ultraGroupMessageRecalled(t)},QE=function(e,t,r){var n=this;t!==Cg?t!==Mg?this._handleEventChangeList(this._codec.formatEventChangeList(r)):this._handleConvertEvent(r):r.forEach((function(e){jl.decode(xu,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,r,i=Xt(e);null===(r=(t=n._watcher).groupApplicationEvent)||void 0===r||r.call(t,i)}))}))},XE=function(e){var t={},r=e.extraProfile;return r&&(delete e.extraProfile,t.userExtProfile=Fh(r)),t.userProfile=Fh(e),t},ZE=function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=jl.encode(cu,{subType:e,subUsers:t.map((function(e){return{subUserId:e}}))}),[4,this._ctx.query($n.qrySubData,this.currentUserId,r,uu)];case 1:return[2,n.sent()]}}))}))};var lI=function(){function e(e){zE.set(this,void 0),c(this,zE,e,"f")}return Object.defineProperty(e.prototype,"isSpeechToTextEnabled",{get:function(){return!!(1&(l(this,zE,"f").AIBusinessSub||0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConversationListIncludeUltraGroup",{get:function(){return kp(l(this,zE,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messageModifiableMinutes",{get:function(){return l(this,zE,"f").msgModifyMinute||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readReceiptVersion",{get:function(){return e=(e=l(this,zE,"f").grpRRVer)||0,Object.values(xe).includes(e)?e:xe.UNKNOWN;var e},enumerable:!1,configurable:!0}),e}();zE=new WeakMap;var cI,_I,fI,dI,hI,gI,pI,EI=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ctx=e,this.logger=e.logger}return Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e.checkAuthed(!1)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e.checkAuthed(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkAuthed",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.ctx.connectionStatus===he.CONNECTED||this.ctx.userId&&e?br(this.ctx.naviInfo):Tr(k.RC_NET_UNAVAILABLE)}}),e}(),II=function(e){function r(t,r){var n=e.call(this,t)||this;return Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(F.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,extra:n,createIfNotExist:r}),i),[4,vr.create("joinChatroom").validate("chatroomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isNumber("count",t,!0).fail(k.INVALID_PARAMETER_COUNT).isString("extra",n).fail(k.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){var i=Math.max(Math.min(t,50),-1)||10;return s.svr.joinChatroom(e,i,r,n)}))];case 1:return o=a.sent(),this.logger.summary(F.A_JOIN_CHATROOM_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_QUIT_CHATROOM_T,JSON.stringify({roomId:e}),r),[4,vr.create("quitChatroom").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isString("extra",t).fail(k.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.quitChatroom(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_QUIT_CHATROOM_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_CHATROOM_INFO_T,JSON.stringify({roomId:e,count:t,order:r}),n),[4,vr.create("getChatroomInfo").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,0,20).fail(k.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,2).fail(k.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).next((function(){return o.svr.getChatroomInfo(e,t||0,r||1)}))];case 1:return i=a.sent(),this.logger.summary(F.A_GET_CHATROOM_INFO_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,vr.create("setChatroomEntry").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("key",null==t?void 0:t.key,ir,!0).fail(k.INVALID_PARAMETER_KEY).validate("value",null==t?void 0:t.value,ar,!0).fail(k.INVALID_PARAMETER_VALUE).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(k.INVALID_PARAMETER_NOTIFICATION_EXTRA).isBoolean("isAutoDelete",null==t?void 0:t.isAutoDelete).fail(k.INVALID_PARAMETER_IS_AUTO_DELETE).isBoolean("isSendNotification",null==t?void 0:t.isSendNotification).fail(k.INVALID_PARAMETER_IS_SEND_NOTIFICATION).result().tryTrans(this.validateConnected).next((function(){return o.svr.setChatroomEntry(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_SET_CHATROOM_ENTRY_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,vr.create("setChatroomEntries").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isTypedArray("entries",null==t?void 0:t.entries,(function(e){return ir(null==e?void 0:e.key)&&ar(null==e?void 0:e.value)}),!0).fail(k.INVALID_PARAMETER_ENTRIES).isLimitedArray("entryOptions.entries",null==t?void 0:t.entries,10,!0).fail(k.CHATROOM_KV_STORE_OUT_LIMIT).isBoolean("entryOptions.isForce",null==t?void 0:t.isForce).fail(k.INVALID_PARAMETER_IS_FORCE).isBoolean("entryOptions.isAutoDelete",null==t?void 0:t.isAutoDelete).fail(k.INVALID_PARAMETER_IS_AUTO_DELETE).result().tryTrans(this.validateConnected).next((function(){return i.svr.setChatroomEntries(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_SET_CHATROOM_ENTRIES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,vr.create("removeChatroomEntry").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("entry.key",null==t?void 0:t.key,ir,!0).fail(k.INVALID_PARAMETER_KEY).isBoolean("entry.isSendNotification",null==t?void 0:t.isSendNotification).fail(k.INVALID_PARAMETER_IS_SEND_NOTIFICATION).isLimitedString("entry.notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(k.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return o.svr.removeChatroomEntry(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_REMOVE_CHATROOM_ENTRY_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,vr.create("removeChatroomEntries").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("keys",null==t?void 0:t.keys,10,ir,!0).fail(k.INVALID_PARAMETER_KEYS).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(k.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.removeChatroomEntries(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_REMOVE_CHATROOM_ENTRIES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,key:t}),r),[4,vr.create("getChatroomEntry").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("key",t,ir,!0).fail(k.INVALID_PARAMETER_KEY).result().tryTrans(this.validateConnected).next((function(){return i.svr.getChatroomEntry(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_CHATROOM_ENTRY_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e}),t),[4,vr.create("getAllChatroomEntries").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.getAllChatroomEntries(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_CHATROOM_ENTRIES_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(F.A_GET_CHATROOM_HISTORY_MESSAGES_T,JSON.stringify({roomId:e,count:t,order:r,timestamp:n}),i),[4,vr.create("getChatroomHistoryMessages").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,1,100).fail(k.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,1).fail(k.INVALID_PARAMETER_ORDER).isTimestamp("timestamp",n).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return s.svr.getChatroomHistoryMessages(e,n||0,t||20,r||0)}))];case 1:return o=a.sent(),this.logger.summary(F.A_GET_CHATROOM_HISTORY_MESSAGES_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.svr.setCheckChatRoomDuplicateMessage(e)}}),Object.defineProperty(r.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_BIND_RTC_FOR_CHATROOM_T,JSON.stringify({option:e}),t),[4,vr.create("bindRTCRoomForChatroom").validate("chatRoomId",null==e?void 0:e.chatRoomId,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.bindRTCRoomForChatroom(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_BIND_RTC_FOR_CHATROOM_R,r,t),[2,r]}}))}))}}),r}(EI),bI=function(e){e.groupId;var t=e.groupName,r=e.portraitUri,n=e.introduction,i=e.notice;e.extProfile;var a=e.joinPermission,o=e.removeMemberPermission,s=e.invitePermission,u=e.inviteHandlePermission,l=e.groupInfoEditPermission,c=e.memberInfoEditPermission;return JSON.parse(JSON.stringify({name:t,portraitUrl:r,introduction:n,announcement:i,joinPerm:a,removePerm:o,memInvitePerm:s,invitePerm:u,profilePerm:l,memProfilePerm:c}))},TI=function(e){var t,r,n;return{removeMuteStatus:!(null!==(t=null==e?void 0:e.removeMuteStatus)&&void 0!==t&&!t),removeWhiteList:!(null!==(r=null==e?void 0:e.removeWhiteList)&&void 0!==r&&!r),removeFollow:!(null!==(n=null==e?void 0:e.removeFollow)&&void 0!==n&&!n)}},vI=function(e,t,r){return e.validate("groupId",null==t?void 0:t.groupId,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedString("groupName",null==t?void 0:t.groupName,1,64,r).fail(k.INVALID_PARAMETER_GROUP_NAME).isString("portraitUri",null==t?void 0:t.portraitUri).isString("introduction",null==t?void 0:t.introduction).isString("notice",null==t?void 0:t.notice).validate("extProfile",null==t?void 0:t.extProfile,(function(e){if(!yt(e))return!1;var t=Object.entries(e);return t.length<=10&&t.every((function(e){var t=s(e,2);t[0];var r=t[1];return Et(r)}))})).isNumberEnum("joinPermission",null==t?void 0:t.joinPermission,b).isNumberEnum("removeMemberPermission",null==t?void 0:t.removeMemberPermission,T).isNumberEnum("invitePermission",null==t?void 0:t.invitePermission,T).isNumberEnum("inviteHandlePermission",null==t?void 0:t.inviteHandlePermission,R).isNumberEnum("groupInfoEditPermission",null==t?void 0:t.groupInfoEditPermission,T).isNumberEnum("memberInfoEditPermission",null==t?void 0:t.memberInfoEditPermission,v).fail(k.INVALID_PARAMETER_GROUP_INFO)},RI=function(e,t,r,n,i){return e.isObject("option",n,i).fail(k.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("count",null==n?void 0:n.count,1,t,r).fail(k.INVALID_PARAMETER_COUNT).isString("pageToken",null==n?void 0:n.pageToken).fail(k.INVALID_PARAMETER_PAGING_QUERY_OPTION).isBoolean("order",null==n?void 0:n.order).fail(k.INVALID_PARAMETER_ORDER)},mI=function(e){function r(t,r){var n=e.call(this,t)||this;return Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"_userProfileEnabled",{enumerable:!0,configurable:!0,writable:!0,value:function(){var e;return 1===(null===(e=n.ctx.naviInfo)||void 0===e?void 0:e.userProfile)?br():Tr(k.RC_USER_PROFILE_SERVICE_UNAVAILABLE)}}),n}return t(r,e),Object.defineProperty(r.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_UPDATE_MY_USER_PROFILE_VISIBILITY_T,e,t),[4,vr.create("updateMyUserProfileVisibility").isNumberEnum("visibility",e,de,!0).fail(k.INVALID_PARAMETER_USER_PROFILE_VISIBILITY).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.updateMyUserProfileVisibility(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_UPDATE_MY_USER_PROFILE_VISIBILITY_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_MY_USER_PROFILE_VISIBILITY_T,"",e),[4,this.validateConnected().tryTrans(this._userProfileEnabled).next((function(){return r.svr.getMyUserProfileVisibility()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_MY_USER_PROFILE_VISIBILITY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(r.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T,e,t),[4,vr.create("searchUserProfileByUniqueId").isNotEmptyString("uniqueId",e,!0).fail(k.INVALID_PARAMETER_UNIQUE_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.searchUserProfileByUniqueId(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_ADD_FRIEND_T,JSON.stringify({userId:e,directionType:t,extra:r}),n),[4,vr.create("addFriend").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).isNumberEnum("directionType",t,_,!0).fail(k.INVALID_PARAMETER_DIRECTION_TYPE).isLimitedString("extra",r,0,128).fail(k.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.addFriend(e,t,r||"")}))];case 1:return i=a.sent(),this.svr.addFriend(e,t,r||""),this.logger.summary(F.A_ADD_FRIEND_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_DELETE_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),r),[4,vr.create("deleteFriends").isLimitedTypedArray("userIds",e,100,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,_,!0).fail(k.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.deleteFriends(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_DELETE_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_ACCEPT_FRIEND_REQUEST_T,e,t),[4,vr.create("acceptFriendRequest").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.acceptFriendRequest(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_ACCEPT_FRIEND_REQUEST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REFUSE_FRIEND_REQUEST_T,JSON.stringify({userId:e,reason:t}),r),[4,vr.create("refuseFriendApplication").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).isString("reason",t).fail(k.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.refuseFriendRequest(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_REFUSE_FRIEND_REQUEST_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SET_FRIEND_INFO_T,JSON.stringify({userId:e,remark:t,extProfile:r}),n),[4,vr.create("setFriendInfo").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).isLimitedString("remark",t,0,64,!0).fail(k.INVALID_PARAMETER_REMARK).validate("extProfile",r,(function(e){if("object"!=typeof r)return!1;var t=Object.entries(r);return!(t.length>10||t.some((function(e){var t=s(e,2);t[0];var r=t[1];return!Et(r)})))})).fail(k.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.setFriendInfo(e,t,r||{})}))];case 1:return i=a.sent(),this.logger.summary(F.A_SET_FRIEND_INFO_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_CHECK_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),r),[4,vr.create("checkFriends").isLimitedTypedArray("userIds",e,20,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,_,!0).fail(k.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.checkFriends(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_CHECK_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_FRIENDS_T,JSON.stringify({directionType:e,option:t}),r),[4,vr.create("getFriends").isNumberEnum("directionType",e,f,!0).fail(k.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE).check((function(e){return RI(e,100,!1,t)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:(null==t?void 0:t.count)||50,pageToken:(null==t?void 0:t.pageToken)||"",order:!!(null==t?void 0:t.order)};return i.svr.getFriends(e,r)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_FRIEND_APPLICATIONS_T,JSON.stringify({option:e,types:t,status:r}),n),[4,vr.create("getFriendApplications").check((function(t){return RI(t,100,!1,e)})).check((function(e){e.isTypedArray("types",t,(function(t){return!e.isNumberEnum("type",t,g,!0).isFailed})).fail(k.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE).isTypedArray("status",r,(function(t){return!e.isNumberEnum("status",t,p,!0).isFailed})).fail(k.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:(null==e?void 0:e.count)||50,pageToken:(null==e?void 0:e.pageToken)||"",order:!!(null==e?void 0:e.order)},i=t&&0!==t.length?t:[1,2],a=r&&0!==r.length?r:[0,1,2,3];return o.svr.getFriendApplications(n,i,a)}))];case 1:return i=a.sent(),this.logger.summary(F.A_GET_FRIEND_APPLICATIONS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_FRIENDS_INFO_T,JSON.stringify({userIds:e}),t),[4,vr.create("getFriendsInfo").isLimitedTypedArray("userIds",e,100,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getFriendsInfo(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_FRIENDS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_SEARCH_FRIENDS_INFO_T,JSON.stringify({nickname:e}),t),[4,vr.create("searchFriendsInfo").isLimitedString("nickname",e,1,64,!0).fail(k.INVALID_PARAMETER_NICK_NAME).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.searchFriendsInfo(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_SEARCH_FRIENDS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_SET_FRIEND_ADD_PERMISSION_T,JSON.stringify({permission:e}),t),[4,vr.create("setFriendAddPermission").isNumberEnum("permission",e,d,!0).fail(k.INVALID_PARAMETER_FRIEND_ADD_PERMISSION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.setFriendAddPermission(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_SET_FRIEND_ADD_PERMISSION_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_FRIEND_ADD_PERMISSION_T,JSON.stringify({}),e),[4,vr.create("getFriendAddPermission").result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getFriendAddPermission()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_FRIEND_ADD_PERMISSION_R,t,e),[2,t]}}))}))}}),Object.defineProperty(r.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_CREATE_GROUP_T,JSON.stringify({groupInfo:e,inviteeUserIds:t}),r),[4,vr.create("createGroup").check((function(t){return vI(t,e,!0)})).isLimitedTypedArray("inviteeUserIds",t,30,Ut,!1,0).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r=bI(e);return i.svr.createGroup(e.groupId,r,e.extProfile||{},t||[])}))];case 1:return n=a.sent(),this.logger.summary(F.A_CREATE_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_UPDATE_GROUP_INFO_T,JSON.stringify({groupInfo:e}),t),[4,vr.create("updateGroupInfo").check((function(t){return vI(t,e,!1)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var t=bI(e);return n.svr.updateGroupInfo(e.groupId,t,e.extProfile)}))];case 1:return r=i.sent(),this.logger.summary(F.A_UPDATE_GROUP_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_GROUPS_INFO_T,JSON.stringify({groupIds:e}),t),[4,vr.create("getGroupsInfo").isLimitedTypedArray("groupIds",e,20,Dt,!0,1).fail(k.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getGroupsInfo(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_GROUPS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_KICK_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t,config:r}),n),[4,vr.create("kickGroupMembers").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0,1).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.kickGroupMembers(e,t,TI(r))}))];case 1:return i=a.sent(),this.logger.summary(F.A_KICK_GROUP_MEMBERS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_QUIT_GROUP_T,JSON.stringify({groupId:e,config:t}),r),[4,vr.create("quitGroup").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.quitGroup(e,TI(t))}))];case 1:return n=a.sent(),this.logger.summary(F.A_QUIT_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_DISMISS_GROUP_T,JSON.stringify({groupId:e}),t),[4,vr.create("dismissGroup").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.dismissGroup(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_DISMISS_GROUP_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(F.A_TRANSFER_GROUP_OWNER_T,JSON.stringify({groupId:e,newOwnerId:t,quit:r,config:n}),i),[4,vr.create("transferGroupOwner").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).validate("newOwnerId",t,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.transferGroupOwner(e,t,!!r,TI(n))}))];case 1:return o=a.sent(),this.logger.summary(F.A_TRANSFER_GROUP_OWNER_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"addGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_ADD_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,vr.create("addGroupManagers").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,Ut,!0,1).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(O.ADD,e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_ADD_GROUP_MANAGERS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"removeGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,vr.create("removeGroupManagers").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,Ut,!0,1).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(O.REMOVE,e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_REMOVE_GROUP_MANAGERS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,vr.create("getGroupMembers").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0,1).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.getGroupMembers(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_GROUP_MEMBERS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(F.A_SET_GROUP_MEMBER_INFO_T,JSON.stringify({groupId:e,userId:t,nickname:r,extra:n}),i),[4,vr.create("setGroupMemberInfo").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).validate("userId",t,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).isLimitedString("nickname",r,0,64,!0).fail(k.INVALID_PARAMETER_NICK_NAME).isLimitedString("extra",n,0,128).fail(k.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.setGroupMemberInfo(e,t,r,n)}))];case 1:return o=a.sent(),this.logger.summary(F.A_SET_GROUP_MEMBER_INFO_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SEARCH_GROUP_MEMBERS_T,JSON.stringify({groupId:e,nickName:t,option:r}),n),[4,vr.create("searchGroupMembers").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedString("nickName",t,1,64,!0).fail(k.INVALID_PARAMETER_NICK_NAME).check((function(e){return RI(e,200,!0,r,!0)})).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((function(){var n={count:r.count,pageToken:r.pageToken||"",order:!!r.order};return o.svr.searchGroupMembers(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(F.A_SEARCH_GROUP_MEMBERS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_GROUP_MEMBERS_BY_ROLE_T,JSON.stringify({groupId:e,role:t,option:r}),n),[4,vr.create("getGroupMembersByRole").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isNumberEnum("role",t,m,!0).fail(k.INVALID_PARAMETER_GROUP_MEMBER_ROLE).isLimitedInteger("count",r.count,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).isString("pageToken",r.pageToken).fail(k.INVALID_PARAMETER_PAGING_QUERY_OPTION).isNumberEnum("filterRobotType",r.filterRobotType,Ge).fail(k.INVALID_PARAMETER_PAGING_QUERY_OPTION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:r.count,pageToken:r.pageToken||"",order:!!r.order,filterRobotType:r.filterRobotType||Ge.ALL};return o.svr.getGroupMembersByRole(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(F.A_GET_GROUP_MEMBERS_BY_ROLE_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"addGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_ADD_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,vr.create("addGroupFollows").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(O.ADD,e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_ADD_GROUP_FOLLOWS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"removeGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,vr.create("removeGroupFollows").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(O.REMOVE,e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_REMOVE_GROUP_FOLLOWS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_GROUP_FOLLOWS_T,JSON.stringify({groupId:e}),t),[4,vr.create("getGroupFollows").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getGroupFollows(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_GROUP_FOLLOWS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SET_GROUP_REMARK_T,JSON.stringify({groupId:e,remark:t}),r),[4,vr.create("setGroupRemark").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedString("remark",t,0,64,!0).fail(k.INVALID_PARAMETER_REMARK).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupRemark(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_SET_GROUP_REMARK_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_JOIN_GROUP_T,JSON.stringify({groupId:e}),t),[4,vr.create("joinGroup").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.joinGroup(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_JOIN_GROUP_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_INVITE_USERS_TO_GROUP_T,JSON.stringify({groupId:e,userIds:t}),r),[4,vr.create("inviteUsersToGroup").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,30,Ut,!0,1).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.inviteUsersToGroup(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_INVITE_USERS_TO_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"acceptGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_ACCEPT_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t}),r),[4,vr.create("acceptGroupInvite").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.memberInviteResponse({groupId:e,inviterId:t,optType:C.APPLICANT,optResult:N.ACCEPT})}))];case 1:return n=a.sent(),this.logger.summary(F.A_ACCEPT_GROUP_INVITE_R,n,r),[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"refuseGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_REFUSE_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t,reason:r}),n),[4,vr.create("refuseGroupInvite").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).isLimitedString("reason",r,0,128).fail(k.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,inviterId:t,optType:C.APPLICANT,optResult:N.REFUSE,reason:r})}))];case 1:return i=a.sent(),this.logger.summary(F.A_REFUSE_GROUP_INVITE_R,i,n),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"acceptGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_ACCEPT_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:r}),n),[4,vr.create("acceptGroupApplication").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).validate("inviterId",r,Ut).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r||"",optType:C.MANAGER,optResult:N.ACCEPT})}))];case 1:return i=a.sent(),this.logger.summary(F.A_ACCEPT_GROUP_APPLICATION_R,i,n),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"refuseGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(F.A_REFUSE_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:r,reason:n}),i),[4,vr.create("refuseGroupApplication").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).validate("inviterId",r,Ut).fail(k.INVALID_PARAMETER_USER_ID).isLimitedString("reason",n,0,128).fail(k.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r||"",optType:C.MANAGER,optResult:N.REFUSE,reason:n})}))];case 1:return o=a.sent(),this.logger.summary(F.A_REFUSE_GROUP_APPLICATION_R,o,i),[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_GROUP_APPLICATIONS_T,JSON.stringify({option:e,directions:t,status:r}),n),i=this.ctx.usingCppEngine,[4,vr.create("getGroupApplications").check((function(t){return RI(t,200,!0,e,!0)})).check((function(e){i&&e.isLimitedTypedArray("directions",t,Object.keys(L).length,(function(t){return!e.isNumberEnum("directions",t,L,!0).isFailed}),!0,1).fail(k.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION).isLimitedTypedArray("status",r,Object.keys(S).length,(function(t){return!e.isNumberEnum("status",t,S,!0).isFailed}),!0,1).fail(k.INVALID_PARAMETER_GROUP_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:e.count,pageToken:e.pageToken||"",order:!!e.order};return s.svr.getGroupApplications(n,t||[],r||[])}))];case 1:return o=a.sent(),this.logger.summary(F.A_GET_GROUP_APPLICATIONS_R,o,n),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_JOINED_GROUPS_BY_ROLES_T,JSON.stringify({role:e,option:t}),r),[4,vr.create("getJoinedGroupsByRole").isNumberEnum("role",e,m,!0).fail(k.INVALID_PARAMETER_GROUP_MEMBER_ROLE).check((function(e){return RI(e,100,!0,t,!0)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:t.count,pageToken:t.pageToken||"",order:!!t.order};return i.svr.getJoinedGroupsByRole(e,r)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_JOINED_GROUPS_BY_ROLES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SEARCH_JOINED_GROUPS_T,JSON.stringify({groupName:e,option:t}),r),[4,vr.create("searchJoinedGroups").isLimitedString("groupName",e,1,64,!0).fail(k.INVALID_PARAMETER_GROUP_NAME).check((function(e){return RI(e,200,!0,t,!0)})).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((function(){var r={count:t.count,pageToken:t.pageToken||"",order:!!t.order};return i.svr.searchJoinedGroups(e,r)}))];case 1:return n=a.sent(),this.logger.summary(F.A_SEARCH_JOINED_GROUPS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_JOINED_GROUPS_T,JSON.stringify({groupIds:e}),t),[4,vr.create("getJoinedGroups").isLimitedTypedArray("groupIds",e,20,Dt,!0,1).fail(k.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getJoinedGroups(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_JOINED_GROUPS_R,r,t),[2,r]}}))}))}}),r}(EI),AI=0,yI=function(e){function r(t,r,i){var a=e.call(this,i)||this;return Object.defineProperty(a,"_svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),cI.set(a,void 0),_I.set(a,!1),fI.set(a,!0),dI.set(a,""),Object.defineProperty(a,"_id",{enumerable:!0,configurable:!0,writable:!0,value:++AI}),c(a,cI,n(n({},t),{tagFilter:n({},t.tagFilter)}),"f"),a}return t(r,e),Object.defineProperty(r.prototype,"hasMore",{get:function(){return l(this,fI,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isLoading",{get:function(){return l(this,_I,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"load",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return l(this,_I,"f")?[2,Tr(k.METHOD_BUSY)]:(c(this,_I,!0,"f"),t=this.logger.createTraceId(),this.logger.info(F.A_LOAD_CONVERSATION_LIST_T,JSON.stringify({count:e,loaderId:this._id,pageToken:l(this,dI,"f")}),t),[4,vr.create("ConversationListLoader.load").isLimitedInteger("count",e,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){return u._svr.loadConversationList(l(u,dI,"f"),e,l(u,cI,"f"))}))]);case 1:return r=a.sent(),this.logger.summary(F.A_LOAD_CONVERSATION_LIST_R,r,t,{loaderId:this._id},(function(e){return{pageToken:e.pageToken,finished:e.finished}})),c(this,_I,!1,"f"),r.isOk?(n=r.data,i=n.pageToken,o=n.finished,s=n.list,c(this,dI,i,"f"),c(this,fI,!o,"f"),[2,br(s)]):[2,r.wipe()]}}))}))}}),r}(EI);cI=new WeakMap,_I=new WeakMap,fI=new WeakMap,dI=new WeakMap;var OI,SI,NI,CI,PI,MI,LI,wI,UI,DI=function(e){function r(t,r){var n=e.call(this,t)||this;return hI.add(n),Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"saveEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SAVE_EDITED_MSG_DRAFT_T,JSON.stringify({draft:e,identifier:t}),r),[4,vr.create("saveEditedMessageDraft").check((function(e){return Ic(e,t,X)})).isString("draft",null==e?void 0:e.content,!0).fail(k.INVALID_PARAMETER_DRAFT).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateLogin).next((function(){return i.svr.saveEditedMessageDraft(e,l(i,hI,"m",pI).call(i,t))}))];case 1:return n=a.sent(),this.logger.summary(F.A_SAVE_EDITED_MSG_DRAFT_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,vr.create("getEditedMessageDraft").check((function(t){return Ic(t,e,X)})).result().next((function(){return n.svr.getEditedMessageDraft(l(n,hI,"m",pI).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_EDITED_MSG_DRAFT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_CLEAR_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,vr.create("clearEditedMessageDraft").check((function(t){return Ic(t,e,X)})).result().next((function(){return n.svr.clearEditedMessageDraft(l(n,hI,"m",pI).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(F.A_CLEAR_EDITED_MSG_DRAFT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"createConversationListLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return r=(t=e||{}).conversationTypes,i=t.order,o=t.channelId,s=t.tagFilter,[4,vr.create("createConversationListLoader").isTypedArray("conversationTypes",r,(function(e){return ee(e,W)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("order",i,0,1).fail(k.INVALID_PARAMETER_ORDER).validate("channelId",o,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).check((function(e){if(s){var t=s.tagIds;e.isLimitedTypedArray("tagIds",t,20,mt,!1,0).fail(k.INVALID_PARAMETER_TAG_ID)}})).result().tryTrans(this.validateConnected).trans((function(){return new yI(n(n({},e),{tagFilter:n({},s)}),u.svr,u.ctx)}))];case 1:return[2,a.sent()]}}))}))}}),Object.defineProperty(r.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.conversationType,this.logger.info(F.A_SEND_UG_TYPING_T,JSON.stringify(e),t),[4,vr.create("sendUltraGroupTypingStatus").check((function(t){return Ic(t,e,Q)})).validate("conversationType",r,(function(){return r===x.ULTRA_GROUP}),!0).fail(k.CONVERSATION_TYPE_NOT_SUPPORT).result().tryTrans(this.validateConnected).next((function(){return i.svr.sendUltraGroupTypingStatus(l(i,hI,"m",pI).call(i,e))}))];case 1:return n=a.sent(),this.logger.summary(F.A_SEND_UG_TYPING_R,n,t),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"sendTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SEND_TYPING_STATUS_T,JSON.stringify({identifier:e,typingContentType:t}),r),[4,vr.create("sendTypingStatus").check((function(t){return Ic(t,e,W)})).isString("typingContentType",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var n={messageType:"RC:TypSts",content:{typingContentType:t}};return i.ctx.sendMessage(e,n,r)}))];case 1:return n=a.sent(),this.logger.summary(F.A_SEND_TYPING_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"sendSyncReadStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,o=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SYNC_READ_STATUS_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,vr.create("sendSyncReadStatusMessage").check((function(t){return Ic(t,e,W)})).isNumber("timestamp",t,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(n){return i(o,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return n.serverSaveUnread?[2,Tr(k.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN)]:1===n.sesDriven?[2,this.svr.updateConversationReadTime(e,t)]:(i={messageType:Re.SYNC_READ_STATUS,content:{lastMessageSendTime:t},directionalUserIdList:fr(e.conversationType,[this.ctx.userId])},[4,this.ctx.sendMessage(e,i,r)]);case 1:return[2,a.sent().wipe()]}}))}))}))];case 1:return n=s.sent(),this.logger.summary(F.A_SYNC_READ_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_CLEAR_UNREAD_COUNT_T,JSON.stringify(e),t),[4,vr.create("clearUnreadCount").check((function(t){return Ic(t,e,Q)})).result().tryTrans((function(){return n.checkAuthed(e.conversationType!==x.ULTRA_GROUP)})).tryTrans((function(e){return e.serverSaveUnread?Tr(k.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN):br()})).next((function(){return i(n,void 0,void 0,(function(){return a(this,(function(t){return e.conversationType!==x.ULTRA_GROUP||this.svr.ugSynced?[2,this.svr.clearConversationUnreadCount(l(this,hI,"m",pI).call(this,e))]:[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_CLEAR_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_CLEAR_ALL_UNREAD_COUNT_T,null,e),[4,vr.create("clearAllUnreadCount").result().tryTrans(this.validateLogin).tryTrans((function(e){return e.serverSaveUnread?Tr(k.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN):br()})).next((function(){return i(r,void 0,void 0,(function(){return a(this,(function(e){return[2,this.svr.clearAllSGUnreadCount()]}))}))}))];case 1:return t=n.sent(),this.logger.summary(F.A_CLEAR_ALL_UNREAD_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(r.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_CLEAR_UNREAD_COUNT_BY_TIME_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,vr.create("clearUnreadCountByTimestamp").check((function(t){return Ic(t,e,W)})).isTimestamp("timestamp",t).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).tryTrans((function(e){return e.serverSaveUnread?Tr(k.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN):br()})).next((function(){return i.svr.clearUnreadCountByTimestamp(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_CLEAR_UNREAD_COUNT_BY_TIME_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SEND_READ_RECEIPT_REQ_T,JSON.stringify({identifier:e,messageUId:t}),r),[4,vr.create("sendReadReceiptRequest").check((function(t){return Ic(t,e,Z)})).isNotEmptyString("messageUId",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(){var n={messageType:Re.READ_RECEIPT_REQUEST,content:{messageUId:t}};return i.ctx.sendMessage(e,n,r)}))];case 1:return n=a.sent(),this.logger.summary(F.A_SEND_READ_RECEIPT_REQ_R,n,r),[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageUId:t,timestamp:r}),n),[4,vr.create("sendReadReceiptMessage").check((function(t){return Ic(t,e,z)})).isNotEmptyString("messageUId",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("timestamp",r,1,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var i={messageType:Re.READ_RECEIPT,content:{messageUId:t,lastMessageSendTime:r,type:1}};return o.ctx.sendMessage(e,i,n)}))];case 1:return i=a.sent(),this.logger.summary(F.A_SEND_READ_RECEIPT_R,i,n),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,o=this;return a(this,(function(l){switch(l.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageList:t}),r),[4,vr.create("sendReadReceipt").check((function(t){return Ic(t,e,Z)})).fail(k.INVALID_PARAMETER_TARGET_ID).check((function(e){yt(t)&&!Object.keys(t).some((function(r){var n=t[r];return e.isLimitedTypedArray("messageList",n,Number.MAX_SAFE_INTEGER,mt,!0).isFailed}))||e.setFailed(k.MSG_LIMIT_ERROR)})).result().tryTrans(this.validateConnected).next((function(n){return i(o,void 0,void 0,(function(){var i,o,l;return a(this,(function(a){switch(a.label){case 0:return 0!==(i=n.grpRRVer||0)&&1!==i?[2,Tr(k.READ_RECEIPT_ERROR)]:1===i?(o=[],Object.keys(t).forEach((function(e){o.push.apply(o,u([],s(t[e]),!1))})),[2,this.svr.sendReadReceiptV2(e.targetId,o,e.channelId)]):(l={receiptMessageDic:t},[4,this.ctx.sendMessage(e,{messageType:Re.READ_RECEIPT_RESPONSE,content:l},r)]);case 1:return[2,a.sent().wipe()]}}))}))}))];case 1:return n=l.sent(),this.logger.summary(F.A_SEND_READ_RECEIPT_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_MSG_READER_T,JSON.stringify({targetId:e,messageUId:t,channelId:r}),n),[4,vr.create("getMessageReader").validate("targetId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isNotEmptyString("messageUId",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return i(s,void 0,void 0,(function(){return a(this,(function(i){return 1!==n.grpRRVer?[2,Tr(k.READ_RECEIPT_ERROR)]:[2,this.svr.getMessageReader(e,t,r||"")]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_GET_MSG_READER_R,o,n),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SEND_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,endMsgUid:t,startMsgUid:r}),n),[4,vr.create("sendReadReceiptMessageV4").check((function(t){return Ic(t,e,W)})).isNotEmptyString("endMsgUid",t,!0).fail(k.INVALID_PARAMETER_END_MESSAGE_UID).isNotEmptyString("startMsgUid",r).fail(k.INVALID_PARAMETER_START_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(n){return i(s,void 0,void 0,(function(){return a(this,(function(i){return 3!==n.grpRRVer?[2,Tr(k.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.sendReadReceiptMessageV4(e,r||"",t)]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_SEND_READ_RECEIPT_V4_R,o,n),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,o=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,messageUId:t}),r),[4,vr.create("getMessageReadReceiptV4").check((function(t){return Ic(t,e,Z)})).isNotEmptyString("messageUId",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return i(o,void 0,void 0,(function(){return a(this,(function(n){return 3!==r.grpRRVer?[2,Tr(k.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.getMessageReadReceiptV4(e,t)]}))}))}))];case 1:return n=s.sent(),this.logger.summary(F.A_GET_READ_RECEIPT_V4_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,o=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_BATCH_GET_READ_RECEIPT_INFO_V4_T,JSON.stringify({conversation:e,messageUIds:t}),r),[4,vr.create("batchGetMessageReadReceiptInfoV4").check((function(t){return Ic(t,e,Z)})).isTypedArray("messageUIds",t,mt,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return i(o,void 0,void 0,(function(){return a(this,(function(n){return 3!==r.grpRRVer?[2,Tr(k.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}))];case 1:return n=s.sent(),this.logger.summary(F.A_BATCH_GET_READ_RECEIPT_INFO_V4_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T,JSON.stringify({options:e}),t),[4,vr.create("getConversationsIncludingRobots").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,2,(function(e){return[x.PRIVATE,x.SYSTEM].includes(e)}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var t=n(n({},e),{topPriority:!!e.topPriority});return i.svr.getConversationsIncludingRobots(t)}))];case 1:return r=a.sent(),this.logger.summary(F.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"markRemoteConversationAsRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_MARK_REMOTE_CONVERSATION_AS_READ_T,JSON.stringify(e),t),[4,vr.create("markRemoteConversationAsRead").check((function(t){return Ic(t,e,q)})).result().tryTrans(this.validateConnected).tryTrans((function(e){return e.serverSaveUnread?br():Tr(k.SERVER_RECORD_UNREAD_COUNT_DISABLED)})).next((function(){if(e.conversationType===x.ULTRA_GROUP)return n.svr.clearConversationUnreadCount(l(n,hI,"m",pI).call(n,e));var r={lastMessageSendTime:n.ctx.serverTime},i={messageType:Re.SYNC_READ_STATUS,content:r,directionalUserIdList:fr(e.conversationType,[n.ctx.userId])};return n.svr.markRemoteConversationAsRead(e,i,t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_MARK_REMOTE_CONVERSATION_AS_READ_R,r,t),[2,r.wipe()]}}))}))}}),r}(EI);function GI(e){return n({},e)}hI=new WeakSet,gI=function(e){var t;return!!(2&((null===(t=this.ctx.naviInfo)||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e},pI=function(e){return e.conversationType!==x.ULTRA_GROUP?e:n(n({},e),{channelId:l(this,hI,"m",gI).call(this,e.channelId)})};var VI=function(){function e(e){var t,r,i=this;OI.add(this),Object.defineProperty(this,"_token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_pluginContextQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pluginInstanseMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appkey",{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,"sse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataHosting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_versionInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_typingInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[Re.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),t[Re.INTERCEPT]=this._processInterceptMessage.bind(this),t)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(r={},r[Re.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),r[Re.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),r[Re.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),r)}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:{message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connection:void 0,expansion:void 0,tag:void 0,userSettingsSynced:void 0,userSettingsChanged:void 0,conversationStatusSynced:void 0,robotsSynced:void 0,conversationTagChanged:void 0,pullFinished:void 0,readReceiptReceived:void 0,messageReceiptRequest:void 0,messageReceiptResponse:void 0,typingState:void 0,messageBlocked:void 0,ultraGroupEnable:void 0,sgRelationsSynced:void 0,operateStatus:void 0,ultraGroupMessageExpansionUpdated:void 0,ultraGroupMessageRecalled:void 0,ultraGroupChannelChangeType:void 0,ultraGroupChannelUserKicked:void 0,ultraGroupChannelDelete:void 0,userGroupStatus:void 0,messageReadReceipt:void 0,syncReadStatus:void 0,subscribedUserStatusChange:void 0,subscribedRelationChange:void 0,syncSubscribedUserStatusFinished:void 0,ownUserProfileChanged:void 0,groupOperation:void 0,groupInfoChanged:void 0,groupMemberInfoChanged:void 0,groupApplicationEvent:void 0,groupRemarkChangedSync:void 0,groupFollowsChangedSync:void 0,friendAdd:void 0,friendDelete:void 0,friendApplicationStatusChanged:void 0,friendCleared:void 0,friendInfoChangedSync:void 0,databaseOpened:void 0,databaseUpgradeWillStart:void 0,databaseUpgrading:void 0,databaseUpgradeDidComplete:void 0,readReceiptResponseV5:void 0,speechToTextResponse:void 0,translateResponse:void 0,messagesModified:void 0,messageModifiedSyncCompleted:void 0}}),Object.defineProperty(this,"_typingInternalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"_typingExpireTime",{enumerable:!0,configurable:!0,writable:!0,value:2e3}),Object.defineProperty(this,"_typingChangedList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._options=n({},e),this.appkey=this._options.appkey,this._options.typingExpireTime&&(this._options.typingExpireTime<2e3?this._typingExpireTime=2e3:this._options.typingExpireTime>6e3?this._typingExpireTime=6e3:this._typingExpireTime=this._options.typingExpireTime),this._options.navigators=this._options.navigators.map((function(e){return e.replace(/\/$/g,"")}));var a={onConnected:function(){return i._onConnectionStatusChange(he.CONNECTED)},onConnecting:this._onConnectionStatusChange.bind(this,he.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,he.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,he.DISCONNECTED),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),conversationTag:this._conversationTagListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),userSettingsSynced:this._onUserSettingsSynced.bind(this),userSettingsChanged:this._onUserSettingsChanged.bind(this),conversationStatusSynced:this._onConversationStatusSynced.bind(this),robotsSynced:this._onRobotsSynced.bind(this),onRTCDataChange:this._rtcDataChange.bind(this),pullFinished:this._pullFinishedListener.bind(this),ultraGroupEnable:this._ultraGroupEnableListener.bind(this),sgRelationsSynced:this._sgRelationsSyncedListener.bind(this),operateStatus:this._operateStatusListener.bind(this),ultraGroupMessageExpansionUpdated:this._ultraGroupMessageExpansionUpdatedListener.bind(this),ultraGroupMessageRecalled:this._ultraGroupMessageRecalledListener.bind(this),callInfo:this._callInfoListener.bind(this),ultraGroupChannelChangeType:this._ultraGroupChannelChangeTypeListener.bind(this),ultraGroupChannelUserKicked:this._ultraGroupChannelUserKickedListener.bind(this),ultraGroupChannelDelete:this._ultraGroupChannelDeleteListener.bind(this),onNaviDataChange:this._naviDataChange.bind(this),userGroupStatus:this._userGroupStatusListener.bind(this),messageReadReceipt:this._messageReadReceipt.bind(this),syncReadStatus:this._syncReadStatus.bind(this),subscribedUserStatusChange:this._subscribedUserStatusChange.bind(this),subscribedRelationChange:this._subscribedRelationChange.bind(this),syncSubscribedUserStatusFinished:this._syncSubscribedUserStatusFinished.bind(this),ownUserProfileChanged:this._ownUserProfileChanged.bind(this),groupOperation:this._groupOperation.bind(this),groupInfoChanged:this._groupInfoChanged.bind(this),groupMemberInfoChanged:this._groupMemberInfoChanged.bind(this),groupApplicationEvent:this._groupApplicationEvent.bind(this),groupRemarkChangedSync:this._groupRemarkChangedSync.bind(this),groupFollowsChangedSync:this._groupFollowsChangedSync.bind(this),friendAdd:this._friendAdd.bind(this),friendDelete:this._friendDelete.bind(this),friendApplicationStatusChanged:this._friendApplicationStatusChanged.bind(this),friendCleared:this._friendCleared.bind(this),friendInfoChangedSync:this._friendInfoChangedSync.bind(this),databaseOpened:this._databaseOpened.bind(this),databaseUpgradeWillStart:this._databaseUpgradeWillStart.bind(this),databaseUpgrading:this._databaseUpgrading.bind(this),databaseUpgradeDidComplete:this._databaseUpgradeDidComplete.bind(this),readReceiptResponseV5:this._readReceiptResponseV5.bind(this),speechToTextResponse:this._speechToTextResponse.bind(this),translateResponse:this._translateResponse.bind(this),messagesModified:this._messagesModified.bind(this),messageModifiedSyncCompleted:this._messageModifiedSyncCompleted.bind(this)},o=Vt();this._engine=o?new RCCppEngine(a,this._options):new uI(a,this._options),this.logger=this._engine.logger,this._options.eventLoopBlockingCheck&&ln.start(this.logger),this.sse=new sc(this,o),this.chatroom=new II(this._engine,this._engine.chatroom),this.dataHosting=new mI(this._engine,this._engine.dataHosting),this.chat=new DI(this._engine,this._engine.chat)}return Object.defineProperty(e,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this._context)return this._context.logger.warn(F.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(F.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(F.L_IMSDK_VER_O,JSON.stringify({commitId:"5b8a967452412987c8fb84d28bc76a7e8c7b7e17",version:"5.34.0"}));var r=this._context._engine;return po.setNetworkStatusListener(r.setNetwork.bind(r)),this._context}}),Object.defineProperty(e,"getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"getOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._options}}),Object.defineProperty(e,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(F.A_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))}}),Object.defineProperty(e.prototype,"install",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId();if(this.logger.info(F.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),r),this._pluginInstanseMap[e.tag])return this.logger.warn(F.L_INSTALL_PLUGIN_R,"repeat install",r),this._pluginInstanseMap[e.tag];var n="RCRTC"===e.tag?new _c(this):new cc(this),i=null;try{if(!e.verify(po))return null;i=e.setup(n,po,t)}catch(e){this.logger.error(F.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,r)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(n),this._pluginInstanseMap[e.tag]=i),i}}),Object.defineProperty(e.prototype,"getAppSettings",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.validateLogin().trans((function(e){return new lI(e)}))}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;this.logger.warn(F.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(n=(r=this._watcher).connection)||void 0===n||n.call(r,e,t),this._pluginContextQueue.forEach((function(r){var n;null===(n=r.onconnectionstatechange)||void 0===n||n.call(r,e,t)}))}}),Object.defineProperty(e.prototype,"_processTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._addTypingInfo(GI(e)),!!this._watcher.typingState}}),Object.defineProperty(e.prototype,"_processInterceptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||"",blockType:e.content.interceptType,blockedMessageUId:e.content.msgUId,extra:e.content.extra};if(e.conversationType===x.ULTRA_GROUP){var r=e.content.sourceType;if(t.sourceType=r,(r===pe.MSG_EXPANSION||r===pe.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(F.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!0}}),Object.defineProperty(e.prototype,"_processReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.readReceiptReceived&&this._watcher.readReceiptReceived({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.content.lastMessageSendTime,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptRequestMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptResponseMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,n=this._engine.userId;r&&Array.isArray(r[n])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,r[n])}}),Object.defineProperty(e.prototype,"_messageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i,a,o,s=this;if(!(null===(i=(n=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(n,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(GI(e))}catch(e){return s.logger.error(F.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(o=(a=this._watcher).message)||void 0===o||o.call(a,GI(e),t,r),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=[],a=[],o=[Re.READ_RECEIPT,Re.READ_RECEIPT_REQUEST,Re.READ_RECEIPT_RESPONSE];e.forEach((function(e){var s=n._messageReceiver(e,t,r);s&&o.includes(s.messageType)?a.push(s):s&&i.push(s)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(F.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),a.length&&a.forEach((function(e){n._messageProccessor[e.messageType]&&n._messageProccessor[e.messageType](e)}))}}),Object.defineProperty(e.prototype,"_chatroomInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).chatroomState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).conversationState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_expansionInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).expansion)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_tagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_onUserSettingsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userSettingsSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onUserSettingsChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userSettingsChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onConversationStatusSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).conversationStatusSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onRobotsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;null===(n=(r=this._watcher).robotsSynced)||void 0===n||n.call(r,e,t)}}),Object.defineProperty(e.prototype,"_conversationTagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_typingStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).typingState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_pullFinishedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_MessageBlockedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageBlocked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_callInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._pluginContextQueue.forEach((function(r){try{r.onCallInfo&&r.onCallInfo(e)}catch(e){t.logger.warn(F.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"_ultraGroupEnableListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).ultraGroupEnable)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_sgRelationsSyncedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).sgRelationsSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_operateStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).operateStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageExpansionUpdatedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageRecalledListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageRecalled)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelChangeTypeListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelChangeType)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelUserKickedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelDeleteListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_userGroupStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userGroupStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageReadReceipt)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).syncReadStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedUserStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedUserStatusChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedRelationChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedRelationChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncSubscribedUserStatusFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(F.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(r=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ownUserProfileChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(F.L_OWN_USER_PROFILE_CHANGED_S),null===(r=(t=this._watcher).ownUserProfileChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupOperation)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupMemberInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupApplicationEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupApplicationEvent)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupRemarkChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupRemarkChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupFollowsChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupFollowsChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendAdd)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendApplicationStatusChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendCleared",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendCleared)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendInfoChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_rtcDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pluginContextQueue.forEach((function(r){var n;null===(n=r.onrtcdatachange)||void 0===n||n.call(r,e,t)}))}}),Object.defineProperty(e.prototype,"_naviDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pluginContextQueue.forEach((function(t){var r;null===(r=t.onnavidatachange)||void 0===r||r.call(t,e)}))}}),Object.defineProperty(e.prototype,"_databaseOpened",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;null===(n=(r=this._watcher).databaseOpened)||void 0===n||n.call(r,e,t)}}),Object.defineProperty(e.prototype,"_databaseUpgradeWillStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;this.logger.info(F.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_databaseUpgrading",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(F.L_DB_UPGRATING_S,e),null===(r=(t=this._watcher).databaseUpgrading)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_databaseUpgradeDidComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(F.L_DB_UPGRATE_COMPLETE_S),null===(r=(t=this._watcher).databaseUpgradeDidComplete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_readReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).readReceiptResponseV5)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_speechToTextResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).speechToTextResponse)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_translateResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messagesModified",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messagesModified)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messageModifiedSyncCompleted",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).messageModifiedSyncCompleted)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"assignWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;Object.keys(this._watcher).forEach((function(r){if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];t._watcher[r]=Ot(n)||yt(n)?n:void 0}}))}}),Object.defineProperty(e.prototype,"_resetWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))}}),Object.defineProperty(e.prototype,"_addTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.senderUserId,r=e.conversationType,n=e.targetId,i=e.content,a=e.channelId,o=i.typingContentType,s=a||"",u="".concat(r,"#").concat(n,"#").concat(s);this._typingInfo[u]||(this._typingInfo[u]=[]);var l=this._typingInfo[u].findIndex((function(e){return e.userId===t}));l>=0&&this._typingInfo[u][l].messageType===o?this._typingInfo[u][l].timestamp=Date.now():(l>=0&&this._typingInfo[u].splice(l,1),this._typingInfo[u].push({userId:t,messageType:o,timestamp:Date.now()}),this._typingChangedList.includes(u)||this._typingChangedList.push(u),this._startCheckTypingInfo())}}),Object.defineProperty(e.prototype,"_startCheckTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var r=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===r||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))}}),Object.defineProperty(e.prototype,"_notifyTypingChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(this._typingChangedList.length>0){var t=this._typingChangedList.map((function(t){return{conversationType:Number(t.split("#")[0]),targetId:t.split("#")[1],channelId:t.split("#")[2],list:e._typingInfo[t]||[]}}));this._typingStatusListener(t),this._typingChangedList=[]}0===Object.keys(this._typingInfo).length&&(clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1)}}),Object.defineProperty(e.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.connectedTime}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.serverTime}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.deviceId}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setPushConfig(e)}}),Object.defineProperty(e.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.userId}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.connectionStatus}}),Object.defineProperty(e.prototype,"_validateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return 1!==e.userProfile?Tr(k.RC_USER_PROFILE_SERVICE_UNAVAILABLE):br(e)}}),Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e.checkAuthed(!1)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e.checkAuthed(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkAuthed",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.connectionStatus===he.CONNECTED||this._engine.userId&&e?br(this._engine.naviInfo):Tr(k.RC_NET_UNAVAILABLE)}}),Object.defineProperty(e.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,l(this,OI,"m",SI).call(this,e,t,r)];case 1:return n=i.sent(),this.logger.summary(F.A_CONNECT_R,n,r,void 0,(function(e){return{userId:e}})),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return this.logger.info(F.A_DISCONNECT_O,JSON.stringify({closeDB:e,disablePush:t})),[2,l(this,OI,"m",NI).call(this,e,t)]}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_RECONNECT_T,JSON.stringify({reconnectKickEnable:e}),t),[4,l(this,OI,"m",SI).call(this,this.token,!!e,t)];case 1:return r=n.sent(),this.logger.summary(F.A_RECONNECT_R,r,t,void 0,(function(e){return{userId:e}})),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"_channelIdConvert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(e!==x.ULTRA_GROUP)return t;var r=this.getNaviInfoFromCache();return!!(2&((null==r?void 0:r.ugDriven)||0))&&!t?"RCDefault":t}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.naviInfo}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,a){void 0===i&&(i=[]),void 0===a&&(a=!1);var o,s,u,l={isPersited:t,isCounted:r,searchProps:i,isStatusMessage:a};o=e,s=l,(u=mn.get(o))&&!u.isCustom&&console.warn("Builtin message type '".concat(o,"' cannot be registered")),s.isStatusMessage&&(s.isCounted=s.isPersited=!1),mn.set(o,n(n({},s),{isCustom:!0})),this._engine.registerMessageType(e,l)}}),Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._engine.registerRTCSignalingListener(e)}}),Object.defineProperty(e.prototype,"sendMessageByPlugin",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.L_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),n),[4,l(this,OI,"m",PI).call(this,e,t,n,r)];case 1:return i=a.sent(),this.logger.summary(F.L_SEND_MSG_R,i,n,void 0,(function(t){return{messageId:t.messageId,messageUId:t.messageUId,messageType:t.messageType,identifier:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),n),[4,l(this,OI,"m",PI).call(this,e,t,n,r)];case 1:return i=a.sent(),this.logger.summary(F.A_SEND_MSG_R,i,n,void 0,(function(t){return{messageId:t.messageId,messageUId:t.messageUId,messageType:t.messageType,identifier:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"updateMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_UPDATE_MSG_EXPANSION_T,JSON.stringify({expansion:e,attrs:t}),r),[4,vr.create("updateMessageExpansion").check((function(r){return bc(r,t,Object.keys(e||{}))})).check((function(r){return Tc(r,e,t.canIncludeExpansion)})).result().tryTrans(this.validateConnected).next((function(){var i={put:e,mid:t.messageUId},a=n(n({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===x.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(a,i,t.sentTime):l(o,OI,"m",LI).call(o,a,i,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_UPDATE_MSG_EXPANSION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_MSG_EXPANSION_T,JSON.stringify({keys:e,attrs:t}),r),[4,vr.create("removeMessageExpansion").isLimitedTypedArray("keys",e,20,(function(e){return"string"==typeof e&&/^[A-Za-z0-9_=+-]+$/.test(e)}),!0).fail(k.INVALID_PARAMETER_KEYS).check((function(r){return bc(r,t,e)})).result().tryTrans(this.validateConnected).next((function(){var i={del:e,mid:t.messageUId},a=n(n({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===x.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(a,i,t.sentTime):l(o,OI,"m",LI).call(o,a,i,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_REMOVE_MSG_EXPANSION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeAllMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_ALL_MSG_EXPANSION_T,JSON.stringify({attrs:e}),t),[4,vr.create("removeAllMessageExpansion").check((function(t){return bc(t,e,[])})).check((function(t){e.conversationType!==x.ULTRA_GROUP&&t.setFailed(k.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){var r={clear:1,mid:e.messageUId},a=n(n({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)});return e.conversationType===x.ULTRA_GROUP?i._engine.chat.updateUGMessageExpansion(a,r,e.sentTime):l(i,OI,"m",LI).call(i,a,r,t)}))];case 1:return r=a.sent(),this.logger.summary(F.A_REMOVE_ALL_MSG_EXPANSION_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var o,s=this;return a(this,(function(u){switch(u.label){case 0:return n=n||this.logger.createTraceId(),this.logger.info(F.A_SEND_READ_RECEIPT_V2_T,JSON.stringify({targetId:e,messageUIds:t,channelId:r}),n),[4,vr.create("sendReadReceiptV2").validate("targetId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("messageUIds",t,Number.MAX_SAFE_INTEGER,mt,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return i(s,void 0,void 0,(function(){return a(this,(function(i){return 1!==n.grpRRVer?[2,Tr(k.READ_RECEIPT_ERROR,"The read receipt switch is not on, please call the sendMessage method.")]:[2,this._engine.chat.sendReadReceiptV2(e,t,r)]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_SEND_READ_RECEIPT_V2_R,o,n),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"_destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e=this;return a(this,(function(t){switch(t.label){case 0:return ln.stop(),this._resetWatcher(),this._engine.destroy(),po.removeNetworkStatusListener(),[4,l(this,OI,"m",NI).call(this)];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(F.L_CALLBACK_E,null==t?void 0:t.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},[2]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c=this;return a(this,(function(a){switch(a.label){case 0:return r=null==t?void 0:t.timestamp,n=null==t?void 0:t.count,i=null==t?void 0:t.order,o=null==t?void 0:t.messageType,s=this.logger.createTraceId(),this.logger.info(F.A_GET_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),s),[4,vr.create("getHistoryMessage").check((function(t){return Ic(t,e,K)})).isLimitedInteger("timestamp",r,0,Number.MAX_SAFE_INTEGER).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(k.INVALID_PARAMETER_ORDER).isLimitedInteger("count",n,1,100).fail(k.INVALID_PARAMETER_COUNT).isNotEmptyString("messageType",o).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:r||0,count:n||20,order:i||0,messageType:o||""},a=l(c,OI,"m",CI).call(c,e);return c._engine.getHistoryMessage(a,t,!0)}))];case 1:return u=a.sent(),this.logger.summary(F.A_GET_HISTORY_MSG_R,u,s),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_CONTINUOUS_MSGS_T,JSON.stringify({conversation:e,options:t}),r),[4,vr.create("getContinuousMessages").check((function(t){return Ic(t,e,J)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(k.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(k.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateLogin).next((function(){var r=l(i,OI,"m",CI).call(i,e),n={timestamp:t.timestamp||0,count:t.count||20,order:t.order||0,messageType:""};return i._engine.chat.getContinuousMessages(r,n)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_CONTINUOUS_MSGS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_HIS_MSGS_BY_OBJ_NAMES_T,JSON.stringify({conversation:e,option:t}),r),[4,vr.create("getHistoryMessagesByObjectNames").check((function(t){return Ic(t,e,Q)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(k.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(k.INVALID_PARAMETER_ORDER).isTypedArray("messageTypes",null==t?void 0:t.messageTypes,mt).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateLogin).next((function(){var r=l(i,OI,"m",CI).call(i,e),n={timestamp:t.timestamp||0,count:t.count||20,order:t.order||0,messageTypes:t.messageTypes||[]};return i._engine.chat.getHistoryMessagesByObjectNames(r,n)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_HIS_MSGS_BY_OBJ_NAMES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,o=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_TOP_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e,channelId:t}),r),[4,vr.create("getTopConversationList").isTypedArray("conversationTypes",e,(function(e){return ee(e,q)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",t,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(r){return i(o,void 0,void 0,(function(){var n;return a(this,(function(i){return(n=kp(r))&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTopConversationList(n,e,t)]}))}))}))];case 1:return n=s.sent(),this.logger.summary(F.A_GET_TOP_CONVERSATION_LIST_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UNREAD_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e}),t),[4,vr.create("getUnreadConversationList").isTypedArray("conversationTypes",e,(function(e){return ee(e,q)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).next((function(t){return i(n,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=kp(t))&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getUnreadConversationList(r,e)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_UNREAD_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_BLOCKED_CONVERSATION_LIST_T,"",e),[4,vr.create("getBlockedConversationList").result().tryTrans(this.validateConnected).next((function(e){return i(r,void 0,void 0,(function(){var t;return a(this,(function(r){return(t=kp(e))&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getBlockedConversationList(t)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_BLOCKED_CONVERSATION_LIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByPageIndex",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r=this;return a(this,(function(n){switch(n.label){case 0:return[4,vr.create("getConversationListByPageIndex").isInteger("index",e,!0).fail(k.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",t,!0).fail(k.INVALID_PARAMETER_LIMIT).result().tryTrans(this.validateLogin).next((function(){return r._engine.chat.getConversationListByPageIndex(e,t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_ALL_CONVERSATION_LIST_T,JSON.stringify({channelId:e}),t),[4,vr.create("getAllConversationList").validate("channelId",e,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateLogin).next((function(t){return i(n,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=kp(t))&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getAllConversationList(r,e)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_ALL_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_CONVERSATION_LIST_OLD_T,JSON.stringify(e),t),[4,Vt()&&"string"!=typeof(null==e?void 0:e.channelId)?this.getAllConversationList(null==e?void 0:e.channelId):this.getConversationListByTimestamp(e)];case 1:return r=n.sent(),this.logger.summary(F.A_GET_CONVERSATION_LIST_OLD_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_CONVERSATION_LIST_BY_TIME_T,JSON.stringify(e),t),[4,vr.create("getConversationListByTimestamp").isObject("params",e,!0).fail(k.CONVER_GET_ERROR,"params must be an object").isInteger("startTime",null==e?void 0:e.startTime,!0).fail(k.INVALID_PARAMETER_START_TIME).isInteger("count",null==e?void 0:e.count,!0).fail(k.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==e?void 0:e.order,0,1).fail(k.INVALID_PARAMETER_ORDER).validate("channelId",null==e?void 0:e.channelId,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,(function(e){return ee(e,q)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans((function(){return n.checkAuthed(Vt())})).next((function(t){return i(n,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=kp(t))&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getConversationListByTimestamp(e,r)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_CONVERSATION_LIST_BY_TIME_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_CONVERSATION_T,JSON.stringify(e),t),[4,vr.create("getConversation").check((function(t){return Ic(t,e,K)})).result().tryTrans(this.validateConnected).next((function(){var t=l(n,OI,"m",CI).call(n,e);return n._engine.chat.getConversation(t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_CONVERSATION_R,r,t,e),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_CONVERSATION_T,JSON.stringify(e),r),[4,vr.create("removeConversation").check((function(t){return Ic(t,e,q)})).result().tryTrans(this.validateConnected).next((function(){var r=l(i,OI,"m",CI).call(i,e);return i._engine.chat.batchDeleteConversations({identifiers:[r],deleteRemotely:!!t,deleteMessages:!1})}))];case 1:return n=a.sent(),this.logger.summary(F.A_REMOVE_CONVERSATION_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,o,s,u=this;return a(this,(function(c){switch(c.label){case 0:return t=null==e?void 0:e.identifiers,r=!!(null==e?void 0:e.deleteRemotely),n=!!(null==e?void 0:e.deleteMessages),o=this.logger.createTraceId(),this.logger.info(F.A_BATCH_DEL_CONVERS_T,JSON.stringify({identifiers:t,deleteRemotely:r,deleteMessages:n}),o),[4,vr.create("batchDeleteConversations").isLimitedArray("identifiers",t,100,!0,1).fail(k.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans(this.validateConnected).next((function(){return i(u,void 0,void 0,(function(){var e,i=this;return a(this,(function(a){return 0===(e=t.filter((function(e){return Ec("",e,q).result().isOk})).map((function(e){return l(i,OI,"m",CI).call(i,e)}))).length?[2,br()]:[2,this._engine.chat.batchDeleteConversations({identifiers:e,deleteRemotely:r,deleteMessages:n})]}))}))}))];case 1:return s=c.sent(),this.logger.summary(F.A_BATCH_DEL_CONVERS_R,s,o),[2,s.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelType,n=this.logger.createTraceId(),this.logger.info(F.A_GET_UG_LIST_T,JSON.stringify({targetId:t,channelType:r}),n),[4,vr.create("getUltraGroupList").validate("targetId",t,Ut).fail(k.INVALID_PARAMETER_TARGET_ID).isNumberEnum("channelType",r,te).fail(k.INVALID_PARAMETER_CHANNEL_TYPE).result().tryTrans(this.validateLogin).next((function(){return i(s,void 0,void 0,(function(){return a(this,(function(t){return this._engine.chat.ugSynced?[2,this._engine.chat.getUltraGroupList(e)]:[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_GET_UG_LIST_R,o,n),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_BLOCKED_UG_LIST_T,"",e),[4,vr.create("getBlockedUGList").result().tryTrans(this.validateConnected).next((function(){return i(r,void 0,void 0,(function(){return a(this,(function(e){return this._engine.chat.ugSynced?[2,this._engine.chat.getBlockedUGList()]:[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_BLOCKED_UG_LIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UNREAD_COUNT_T,JSON.stringify(e),t),[4,vr.create("getUnreadCount").check((function(t){return Ic(t,e,Q)})).result().tryTrans(this.validateLogin).next((function(){return i(n,void 0,void 0,(function(){var t;return a(this,(function(r){return e.conversationType!==x.ULTRA_GROUP||this._engine.chat.ugSynced?(t=l(this,OI,"m",CI).call(this,e),[2,this._engine.chat.getConversationUnreadCount(t)]):[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_UNREAD_COUNT_R,r,t,void 0,(function(e){return{unreadCount:e}})),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_TOTAL_UNREAD_COUNT_T,JSON.stringify({conversationTypes:e,includeMuted:t,channelId:r}),n),[4,vr.create("getTotalUnreadCount").validate("channelId",r,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",e,(function(e){return ee(e,Q)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin).next((function(n){return i(s,void 0,void 0,(function(){var i,o;return a(this,(function(a){return!(i=kp(n))&&e&&e.includes(x.ULTRA_GROUP)?[2,Tr(k.METHOD_NOT_SUPPORT)]:(o=e&&e.length>0?e:$(i?q:W)).includes(x.ULTRA_GROUP)&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCount(o,!!t,r)]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_GET_TOTAL_UNREAD_COUNT_R,o,n,void 0,(function(e){return{unreadCount:e}})),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T,JSON.stringify({conversationTypes:e,levels:t,isMentioned:r}),n),[4,vr.create("getTotalUnreadCountByLevels").isLimitedTypedArray("conversationTypes",e,20,(function(e){return ee(e,q)}),!0).fail(k.CONVERSATION_TYPE_NOT_SUPPORT).isTypedArray("levels",t,Mt,!0).fail(k.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return i(s,void 0,void 0,(function(){return a(this,(function(n){return e.includes(x.ULTRA_GROUP)&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCountByLevels(e,t,r)]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R,o,n,void 0,(function(e){return{unreadCount:e}})),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_FIRST_UNREAD_MEG_T,JSON.stringify(e),t),[4,vr.create("getFirstUnreadMessage").check((function(t){return Ic(t,e,Q)})).result().tryTrans(this.validateLogin).next((function(){var t=l(n,OI,"m",CI).call(n,e);return n._engine.chat.getFirstUnreadMessage(t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_FIRST_UNREAD_MSG_R,r,t,e),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,vr.create("getFirstUnreadMessageDigest").check((function(t){return Ic(t,e,Q)})).result().tryTrans(this.validateLogin).next((function(){var t=l(n,OI,"m",CI).call(n,e);return n._engine.chat.getFirstUnreadMessageDigest(t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_FIRST_UNREAD_MSG_DIGEST_R,r,t,e),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:t}),r),[4,vr.create("batchSetConversationNotificationLevel").isLimitedTypedArray("conversations",e,20,(function(e){return!Ec("batchSetConversationNotificationLevel",e,q).isFailed}),!0,1).fail(k.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("notificationLevel",t,Te,!0).fail(k.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var r=e.map((function(e){return l(i,OI,"m",CI).call(i,e)}));return i._engine.chat.batchSetConversationNotificationLevel(r,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u,c,_=this;return a(this,(function(a){switch(a.label){case 0:return i=vr.create("batchSetConversationToTop"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return Ec("batchSetConversationToTop",e,q).result().isOk}),!0,1).fail(k.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==x.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?br():Tr(k.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(s=this.logger.createTraceId(),u=e.map((function(e){return l(_,OI,"m",CI).call(_,e)})),this.logger.info(F.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:u,isTop:t,isUpdateTime:r,isCreateConversation:n}),s),[4,this._engine.chat.batchSetConversationToTop(u,t,r,n)]):[2,o.wipe()];case 1:return c=a.sent(),this.logger.summary(F.A_BATCH_SET_CONVERSATION_TO_TOP_R,c,s),[2,c]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return r=vr.create("batchSetConversationTranslateStrategy"),(n=r.isLimitedTypedArray("conversations",e,20,(function(e){return Ec("",e,q).result().isOk}),!0,1).fail(k.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("strategy",t,Un,!0).fail(k.INVALID_PARAMETER_TRANSLATE_STRATEGY).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),this.logger.info(F.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T,JSON.stringify({conversations:e,strategy:t}),i),o=e.map((function(e){return l(u,OI,"m",CI).call(u,e)})),[4,this._engine.chat.batchSetConversationTranslateStrategy(o,t)]):[2,n.wipe()];case 1:return s=a.sent(),this.logger.summary(F.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R,s,i),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r=this;return a(this,(function(n){switch(n.label){case 0:return[4,Ec("saveTextMessageDraft",e,Q).isString("draft",t,!0).fail(k.INVALID_PARAMETER_DRAFT).result().tryTrans(this.validateLogin).next((function(){var n=l(r,OI,"m",CI).call(r,e);return r._engine.saveTextMessageDraft(n,t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t=this;return a(this,(function(r){switch(r.label){case 0:return[4,Ec("getTextMessageDraft",e,Q).result().tryTrans(this.validateLogin).next((function(){var r=l(t,OI,"m",CI).call(t,e);return t._engine.getTextMessageDraft(r)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t=this;return a(this,(function(r){switch(r.label){case 0:return[4,Ec("clearTextMessageDraft",e,Q).result().tryTrans(this.validateLogin).next((function(){var r=l(t,OI,"m",CI).call(t,e);return t._engine.clearTextMessageDraft(r)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"recallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),n={conversation:e,messageUId:null==t?void 0:t.messageUId},this.logger.info(F.A_RECALL_MESSAGE_T,JSON.stringify(n),r),[4,vr.create("recallMessage").check((function(t){return Ic(t,e,K)})).isNotEmptyString("messageUId",t.messageUId,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",t.disableNotification).fail(k.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",t.pushConfig).fail(k.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(k.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,Ut,!1,1).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){var r=l(o,OI,"m",CI).call(o,e);return o._engine.recallMsg(r,t)}))];case 1:return i=a.sent(),this.logger.summary(F.A_RECALL_MESSAGE_R,i,r,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_DEL_REMOTE_MSGS_T,JSON.stringify({conversation:e,messages:t}),r),[4,vr.create("deleteRemoteMessage").check((function(t){return Ic(t,e,q)})).isLimitedTypedArray("messages",t,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,r=e.sentTime,n=e.messageDirection;return mt(t)&&(n===Ee.SEND||n===Ee.RECEIVE)&&Tt({min:0})(r)}),!0).fail(k.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=l(i,OI,"m",CI).call(i,e);return i._engine.chat.deleteRemoteMessage(r,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_DEL_REMOTE_MSGS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_DEL_REMOTE_MSGS_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,vr.create("deleteRemoteMessageByTimestamp").check((function(t){return Ic(t,e,K)})).isInteger("timestamp",t,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var r=l(i,OI,"m",CI).call(i,e);return i._engine.chat.deleteRemoteMessageByTimestamp(r,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_DEL_REMOTE_MSGS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o,s){return i(this,void 0,void 0,(function(){var u=this;return a(this,(function(l){return[2,vr.create("getFileToken").isNumberEnum("fileType",e,H,!0).fail(k.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(k.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).validate("httpMethod",r,(function(e){return"POST"===e||"PUT"===e})).fail(k.BIZ_ERROR_INVALID_PARAMETER,"`httpMethod` is invalid").isString("queryString",n).fail(k.BIZ_ERROR_INVALID_PARAMETER,"`queryString` is invalid").isString("url",o).fail(k.BIZ_ERROR_INVALID_PARAMETER,"`url` is invalid").isInteger("size",s).fail(k.BIZ_ERROR_INVALID_PARAMETER,"`size` is invalid").result().tryTrans(this.validateConnected).next((function(l){return i(u,void 0,void 0,(function(){var i,u;return a(this,(function(a){switch(a.label){case 0:return i=l.uploadServer||"",u=l.ossConfig||"",[4,this._engine.getFileToken(e,t,r,n,o,s)];case 1:return[2,a.sent().trans((function(e){return Object.assign(e,{qiniu:i,ossConfig:e.ossConfig||u})}))]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,o){return i(this,void 0,void 0,(function(){var i=this;return a(this,(function(a){switch(a.label){case 0:return[4,vr.create("getFileUrl").isNumberEnum("fileType",e,H,!0).fail(k.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(k.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).isString("saveName",o).fail(k.INVALID_PARAMETER_SAVE_NAME).isNumberEnum("serverType",n,r,!0).fail(k.INVALID_PARAMETER_SERVER_TYPE).result().tryTrans(this.validateConnected).next((function(){return i._engine.getFileUrl(e,n,t,o||"")}))];case 1:return[2,a.sent()]}}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_ADD_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,vr.create("createTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(k.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.createTag(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_ADD_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_TAG_T,JSON.stringify({tagId:e}),t),[4,vr.create("removeTag").isLimitedString("tagId",e,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeTag(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_REMOVE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_UPDATE_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,vr.create("updateTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(k.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.updateTag(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_UPDATE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_TAGS_T,"",e),[4,this.validateLogin().next((function(){return r._engine.getTagList()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_TAGS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return(r=vr.create("addTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isTypedArray("conversations",t,(function(e){return Ec("",e,W).result().isOk}),!0).fail(k.INVALID_PARAMETER_CONVERSATIONS).isLimitedInteger("conversations",null==t?void 0:t.length,1,1e3,!0).fail(k.CONVER_OUT_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(n=t.map((function(e){return l(s,OI,"m",CI).call(s,e)})),i=this.logger.createTraceId(),this.logger.info(F.A_ADD_TAG_FOR_CONVERSATIONS_T,JSON.stringify({tagId:e,conversations:n}),i),[4,this._engine.chat.addTagForConversations(e,n)]):[2,r.wipe()];case 1:return o=a.sent(),this.logger.summary(F.A_ADD_TAG_FOR_CONVERSATIONS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return(r=vr.create("removeTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isLimitedTypedArray("conversations",t,1e3,(function(e){return Ec("",e,W).result().isOk}),!0).fail(k.INVALID_PARAMETER_CONVERSATIONS).result().tryTrans(this.validateConnected)).isOk?(n=t.map((function(e){return l(s,OI,"m",CI).call(s,e)})),i=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_TAG_FOR_CONVERS_T,JSON.stringify({tagId:e,conversations:n}),i),[4,this._engine.chat.removeTagForConversations(e,n)]):[2,r.wipe()];case 1:return o=a.sent(),this.logger.summary(F.A_REMOVE_TAG_FOR_CONVERS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return(r=Ec("removeTagsForConversation",e,W).isTypedArray("tagIds",t,(function(e){return Et(e)}),!0).fail(k.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected)).isOk?(n=this.logger.createTraceId(),i=l(this,OI,"m",CI).call(this,e),this.logger.info(F.A_REMOVE_TAGS_FOR_CONVER_T,JSON.stringify({tagIds:t,conversation:i}),n),[4,this._engine.chat.removeTagsForConversation(i,t)]):[2,r.wipe()];case 1:return o=a.sent(),this.logger.summary(F.A_REMOVE_TAGS_FOR_CONVER_R,o,n),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){return(n=vr.create("getConversationListByTag").isLimitedString("tagId",e,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isInteger("count",r,!0).fail(k.CONVER_OUT_LIMIT_ERROR).isLimitedInteger("startTime",t,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_START_TIME).result().tryTrans((function(){return o.checkAuthed(Vt())}))).isOk?(i=r<=0?20:Math.min(r,1e3),[2,this._engine.chat.getConversationListByTag(e,t,i)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_UNREAD_COUNT_BY_TAG_T,JSON.stringify({tagId:e,containMuted:t}),r),[4,vr.create("getUnreadCountByTag").isLimitedString("tagId",e,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isBoolean("containMuted",t,!0).fail(k.INVALID_PARAMETER_CONTAIN_MUTED).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.getUnreadCountByTag(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_UNREAD_COUNT_BY_TAG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return(n=Ec("setConversationStatusInTag",t,W).isLimitedString("tagId",e,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isBoolean("isTop",null==r?void 0:r.isTop,!0).fail(k.INVALID_PARAMETER_IS_TOP).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),o=l(this,OI,"m",CI).call(this,t),this.logger.info(F.A_SET_CONVER_TO_TOP_IN_TAG_T,JSON.stringify({tagId:e,conversation:o,isTop:r.isTop}),i),[4,this._engine.chat.setConversationStatusInTag(e,o,r)]):[2,n.wipe()];case 1:return s=a.sent(),this.logger.summary(F.A_SET_CONVER_TO_TOP_IN_TAG_R,s,i),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return(t=Ec("getTagsForConversation",e,W).result().tryTrans(this.validateLogin)).isOk?(r=this.logger.createTraceId(),n=l(this,OI,"m",CI).call(this,e),this.logger.info(F.A_GET_TAGS_OF_CONVERSATION_T,JSON.stringify(n),r),[4,this._engine.chat.getTagsForConversation(n)]):[2,t.wipe()];case 1:return i=a.sent(),this.logger.summary(F.A_GET_TAGS_OF_CONVERSATION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UNREAD_MENTIONED_COUNT_T,JSON.stringify(e),t),[4,vr.create("getUnreadMentionedCount").check((function(t){return Ic(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){return i(n,void 0,void 0,(function(){var t;return a(this,(function(r){return e.conversationType!==x.ULTRA_GROUP||this._engine.chat.ugSynced?(t=l(this,OI,"m",CI).call(this,e),[2,this._engine.chat.getUnreadMentionedCount(t)]):[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_UNREAD_MENTIONED_COUNT_R,r,t),[2,r.trans(Uc)]}}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_ALL_UNREAD_MENTIONED_COUNT_T,"",e),[4,this.validateLogin().next((function(){return r._engine.chat.getAllUnreadMentionedCount()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_ALL_UNREAD_MENTIONED_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),n=t instanceof Array?t.map((function(e){return null==e?void 0:e.messageUId})):[],i=null==e?void 0:e.conversationType,o=null==e?void 0:e.targetId,s=null==e?void 0:e.channelId,this.logger.info(F.A_GET_UG_MSGS_BY_UID_T,JSON.stringify({conversationType:i,targetId:o,channelId:s,messageUIds:n}),r),[4,vr.create("getUltraGroupMessageListByMessageUId").check((function(t){return Ic(t,e,q)})).isTypedArray("messages",t,(function(e){return mt(null==e?void 0:e.messageUId)}),!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messages",null==t?void 0:t.length,1,20,!0).fail(k.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=l(c,OI,"m",CI).call(c,e);return c._engine.chat.getRemoteMessagesByUIds(r,t.map((function(e){return e.messageUId})))}))];case 1:return u=a.sent(),this.logger.summary(F.A_GET_UG_MSGS_BY_UID_R,u,r,u.isOk?{list:u.data.map((function(e){return e.messageUId}))}:void 0),[2,u.trans((function(e){var t={};return e.forEach((function(e){t[e.messageUId]=e})),t}))]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T,JSON.stringify({targetId:e,levels:r,isGetMentioned:t}),n),[4,vr.create("getUGUnreadCountForAllChannels").validate("targetId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).check((function(e){e.isTypedArray("levels",r,(function(t){return!e.isNumberEnum("",t,Te,!0).isFailed}))})).fail(k.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return i(s,void 0,void 0,(function(){return a(this,(function(n){return this._engine.chat.ugSynced?[2,this._engine.chat.getUGUnreadCountForAllChannels(e,r||[],t)]:[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R,o,n),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelId,n=null==e?void 0:e.sentTime,i=null==e?void 0:e.count,o=this.logger.createTraceId(),this.logger.info(F.A_GET_UG_UNREAD_MENTIONED_DIGEST_T,JSON.stringify({targetId:t,channelId:r,sentTime:n,count:i}),o),[4,vr.create("getUGUnreadMentionedDigest").validate("targetId",t,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).isLimitedInteger("count",i,1,50,!0).fail(k.INVALID_PARAMETER_COUNT).isLimitedInteger("sentTime",n,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return e.channelId=u._channelIdConvert(x.ULTRA_GROUP,r),u._engine.chat.getUGUnreadMentionedDigest(e)}))];case 1:return s=a.sent(),this.logger.summary(F.A_GET_UG_UNREAD_MENTIONED_DIGEST_R,s,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,o=this;return a(this,(function(s){switch(s.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,vr.create("getUGFirstUnreadMessageDigest").validate("targetId",null==e?void 0:e.targetId,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==e?void 0:e.channelId,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){return i(o,void 0,void 0,(function(){var t;return a(this,(function(r){return this._engine.chat.ugSynced?(t=l(this,OI,"m",CI).call(this,n(n({},e),{conversationType:x.ULTRA_GROUP})),[2,this._engine.chat.getUGFirstUnreadMessageDigest(t)]):[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=s.sent(),this.logger.summary(F.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UG_UNREAD_INFO_LIST_T,JSON.stringify({targetIds:e}),t),[4,vr.create("getUGUnreadInfoList").isLimitedTypedArray("targetIds",e,20,(function(e){return Ut(e)}),!0,1).fail(k.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateLogin).next((function(){return i(n,void 0,void 0,(function(){var t;return a(this,(function(r){return this._engine.chat.ugSynced?(t=new Set(e),[2,this._engine.chat.getUGUnreadInfoList(Array.from(t))]):[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_UG_UNREAD_INFO_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return this.validateConnected().next((function(){return n._engine.setCallInfo(e,t,r)}))}}),Object.defineProperty(e.prototype,"_validateSubDriven",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.subDriven,n=void 0===r?0:r;switch(t){case _e.ONLINE_STATUS:return 1&n?br(e):Tr(k.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);case _e.USER_PROFILE:return 2&n?br(e):Tr(k.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);default:return Tr(k.INVALID_PARAMETER_SUBSCRIBE_TYPE)}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t,expiry:r}),n),[4,vr.create("subscribeUser").isLimitedTypedArray("userIds",e,200,Ut,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,_e,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("expiry",r,60,2592e3,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_EXPIRY).result().tryTrans(this.validateConnected).tryTrans((function(e){return o._validateSubDriven(e,t)})).next((function(){return o._engine.subscribeUser(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_SUBSCRIBE_USER_STATUS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_UNSUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t}),r),[4,vr.create("unSubscribeUser").isLimitedTypedArray("userIds",e,200,Ut,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,_e,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_TYPE).result().tryTrans(this.validateConnected).tryTrans((function(e){return i._validateSubDriven(e,t)})).next((function(){return i._engine.unSubscribeUser(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_UNSUBSCRIBE_USER_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_SUBSCRIBE_USER_STATUS_LIST_T,JSON.stringify({subscribeType:e,count:t,offset:r}),n),[4,vr.create("getSubscribeUserList").isNumberEnum("subscribeType",e,_e,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("count",t,1,200,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE).isLimitedInteger("offset",r,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_OFFSET).result().tryTrans(this.validateConnected).tryTrans((function(t){return o._validateSubDriven(t,e)})).next((function(){return o._engine.getSubscribeUserList(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_GET_SUBSCRIBE_USER_STATUS_LIST_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_SUB_USERS_STATUS_T,JSON.stringify({subscribeType:e,userIds:t}),r),[4,vr.create("getSubscribeUserStatus").isNumberEnum("subscribeType",e,_e,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedTypedArray("userIds",t,200,Ut,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).result().tryTrans(this.validateConnected).tryTrans((function(t){return i._validateSubDriven(t,e)})).next((function(){return i._engine.getSubscribeUserStatus(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_SUB_USERS_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_SUB_USERS_ONLINE_STATUS_T,JSON.stringify({userIds:e}),t),[4,vr.create("getSubscribeUsersOnlineStatus").isLimitedTypedArray("userIds",e,200,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){return n._engine.getSubscribeUsersOnlineStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_SUB_USERS_ONLINE_STATUS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_UPDATE_MY_USER_PROFILE_T,JSON.stringify({profile:e}),t),[4,vr.create("updateMyUserProfile").isObject("profile",e,!0).check((function(t){var r=e.name,n=e.portraitUri,i=e.email,a=e.birthday,o=e.gender,u=e.location,l=e.role,c=e.level,_=e.extraProfile;t.isString("name",r).isString("portraitUri",n).isString("email",i).isString("birthday",a).isNumber("gender",o).isString("location",u).isNumber("role",l).isNumber("level",c).isObject("extraProfile",_),!t.isFailed&&_&&Object.entries(_).forEach((function(e){var r=s(e,2);r[0];var n=r[1];t.isString("extraProfile",n,!0)}))})).fail(k.INVALID_PARAMETER_USER_PROFILE).result().tryTrans(this.validateConnected).tryTrans((function(e){return i._validateUserProfile(e)})).next((function(){var t={};return["name","portraitUri","email","birthday","gender","location","role","level"].forEach((function(r){var n=e[r];void 0!==n&&(t[r]=n)})),e.extraProfile&&(t.extraProfile=n({},e.extraProfile)),i._engine.updateMyUserProfile(t)}))];case 1:return r=a.sent(),this.logger.summary(F.A_UPDATE_MY_USER_PROFILE_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_USER_PROFILES_T,JSON.stringify({userIds:e}),t),[4,vr.create("getUserProfiles").isLimitedTypedArray("userIds",e,100,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateLogin).tryTrans((function(e){return n._validateUserProfile(e)})).next((function(){return n._engine.getUserProfiles(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_USER_PROFILES_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_MY_USER_PROFILE_T,void 0,e),[4,vr.create("getMyUserProfile").result().tryTrans(this.validateConnected).tryTrans((function(e){return r._validateUserProfile(e)})).next((function(){return r._engine.getMyUserProfile()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_MY_USER_PROFILE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.chat.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_ADD_TO_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,vr.create("addToBlacklist").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.addToBlacklist(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_ADD_TO_BLACKLIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_FROM_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,vr.create("removeFromBlacklist").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeFromBlacklist(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_REMOVE_FROM_BLACKLIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_BLACKLIST_T,void 0,e),[4,vr.create("getBlacklist").result().tryTrans(this.validateConnected).next((function(){return r._engine.getBlacklist()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_BLACKLIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_BLACKLIST_STATUS_T,JSON.stringify({userId:e}),t),[4,vr.create("getBlacklistStatus").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.getBlacklistStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_BLACKLIST_STATUS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_INSERT_MSG_T,JSON.stringify({conversation:e,params:t}),r),[4,vr.create("insertMessage").check((function(t){return Ic(t,e,Q)})).validate("senderUserId",t.senderUserId,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).isNotEmptyString("messageType",t.messageType,!0).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t.content,!0).fail(k.INVALID_PARAMETER_MESSAGE_CONTENT).isNumberEnum("messageDirection",t.messageDirection,Ee,!0).fail(k.INVALID_MESSAGE_DIRECTION).check((function(e){t.canIncludeExpansion&&t.expansion&&Tc(e,t.expansion,!0)})).isTimestamp("sentTime",t.sentTime).fail(k.INVALID_PARAMETER_TIMESTAMP).isNumberEnum("sentStatus",t.sentStatus,se).fail(k.INVALID_PARAMETER_SENT_STATUS).isTypedArray("directedUserIds",t.directedUserIds,Ut).fail(k.INVALID_PARAMETER_USERIDLIST).isString("searchContent",t.searchContent).fail(k.SEARCH_PROPS_LIMIT_ERROR).result().tryTrans((function(){return pc(t.messageType,t.content)})).tryTrans(this.validateLogin).next((function(){var r=l(i,OI,"m",CI).call(i,e);return i._engine.insertMessage(r,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_INSERT_MSG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_BATCH_INSERT_MSGS_T,JSON.stringify({count:null==e?void 0:e.length,checkDuplicate:t}),r),i=vr.create(""),[4,vr.create("batchInsertMessage").isLimitedTypedArray("messages",e,500,(function(e){return"object"==typeof e&&(Ic(i,e,Q),i.validate("senderUserId",e.senderUserId,Ut,!0).isNotEmptyString("messageType",e.messageType,!0).isObject("content",e.content,!0).isNumberEnum("messageDirection",e.messageDirection,Ee,!0).check((function(t){e.canIncludeExpansion&&e.expansion&&Tc(t,e.expansion,!0)})).isTimestamp("sentTime",e.sentTime).isNumberEnum("sentStatus",e.sentStatus,se).isString("searchContent",e.searchContent).isNumber("receivedStatus",e.receivedStatus).isObject("receivedStatusInfo",e.receivedStatusInfo).isTypedArray("directedUserIds",e.directedUserIds,Ut),!i.isFailed)}),!0).fail(k.MSG_LIMIT_ERROR).result().tryTrans(this.validateLogin).next((function(){var r=e.map((function(e){return n(n({},e),{channelId:s._channelIdConvert(e.conversationType,e.channelId)})}));return s._engine.batchInsertMessage(r,t)}))];case 1:return o=a.sent(),this.logger.summary(F.A_BATCH_INSERT_MSGS_R,o,r),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_LOCAL_MSG_COUNT_T,JSON.stringify({conversation:e}),t),[4,vr.create("getMessageCount").check((function(t){return Ic(t,e,Q)})).result().tryTrans(this.validateLogin).next((function(){var t=l(n,OI,"m",CI).call(n,e);return n._engine.getLocalMessageCount(t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_LOCAL_MSG_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_DELETE_LOCAL_MSGS_T,JSON.stringify({messageIds:e}),t),[4,vr.create("deleteLocalMessages").isTypedArray("messageIds",e,(function(e){return Number.isInteger(e)}),!0).fail(k.INVALID_PARAMETER_MESSAGE_ARRAY).result().tryTrans(this.validateLogin).next((function(){return n._engine.deleteLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_DELETE_LOCAL_MSGS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_DEL_LOCAL_MSGS_BY_TIME_T,JSON.stringify({conversation:e,timestamp:t,cleanSpace:r}),n),[4,vr.create("deleteLocalMessagesByTimestamp").check((function(t){return Ic(t,e,Q)})).isTimestamp("timestamp",t,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){var n=l(o,OI,"m",CI).call(o,e);return o._engine.deleteLocalMessagesByTimestamp(n,t,!!r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_DEL_LOCAL_MSGS_BY_TIME_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T,JSON.stringify({options:e}),t),[4,vr.create("batchClearLocalMessagesByTimestamp").check((function(t){t.isLimitedTypedArray("options",e,20,(function(e){return Ic(t,e,q),!t.isFailed&&Tt({min:0})(e.timestamp)})).fail(k.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return n(n({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)})}));return i._engine.batchClearLocalMessagesByTimestamp(t)}))];case 1:return r=a.sent(),this.logger.summary(F.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),r),[4,vr.create("batchClearRemoteHistoryMessages").isLimitedArray("options",e,20,!0,1).check((function(t){e.forEach((function(e){Ic(t,e,q).isTimestamp("timestamp",null==e?void 0:e.timestamp)}))})).fail(k.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,void 0,!0).check((function(t){e.some((function(e){return e.conversationType===x.ULTRA_GROUP}))&&t.setFailed(k.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.batchClearRemoteHistoryMessages(e,!!t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_BATCH_CLEAR_REMOTE_MSG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_CLEAR_LOCAL_MSG_T,JSON.stringify({conversation:e}),t),[4,vr.create("clearLocalMessages").check((function(t){return Ic(t,e,Q)})).result().tryTrans(this.validateLogin).next((function(){return n._engine.clearLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_CLEAR_LOCAL_MSG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),t),[4,vr.create("getLocalMessage").validate("messageId",e,(function(){return mt(e)||bt(e)}),!0).fail(k.INVALID_PARAMETER_MESSAGE_ID).result().next((function(){return n._engine.getMessage(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_LOCAL_MESSAGE_R,r,t,{messageId:e}),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"_innerSetMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.setMessageContent(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SET_MSG_CONTENT_T,JSON.stringify({messageId:e,messageType:r}),n),[4,vr.create("setMessageContent").isInteger("messageId",e,!0).fail(k.INVALID_PARAMETER_MESSAGE_ID).isNotEmptyString("messageType",r,!0).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_CONTENT).result().tryTrans(this.validateLogin).next((function(){var n=JSON.stringify(t);return o._innerSetMessageContent(e,n,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_SET_MSG_CONTENT_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.setMessageSearchField(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_E_SET_MSG_SENT_STATUS_T,JSON.stringify({messageId:e,sentStatus:t}),r),[4,vr.create("setMessageSentStatus").isInteger("messageId",e,!0).fail(k.INVALID_PARAMETER_MESSAGE_ID).isNumberEnum("sentStatus",t,se,!0).fail(k.INVALID_PARAMETER_SENT_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageSentStatus(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_E_SET_MSG_SENT_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_E_SET_MSG_RECEIVED_STATUS_T,JSON.stringify({messageId:e,receivedStatus:t}),r),[4,vr.create("setMessageReceivedStatus").isInteger("messageId",e,!0).fail(k.INVALID_PARAMETER_MESSAGE_ID).isInteger("receivedStatus",t,!0).fail(k.INVALID_PARAMETER_RECEIVED_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageReceivedStatus(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_E_SET_MSG_RECEIVED_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageStatusToRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(r=Ec("setMessageStatusToRead",e,W).isNumber("timestamp",t,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(n=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,s=e.channelId,this.logger.info(F.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),n),[4,this._engine.updateMessageReceiptStatus(i,o,t,s)]):[2,r.wipe()];case 1:return u=a.sent(),this.logger.summary(F.A_E_SET_MESSAGE_STATUS_TO_READ_R,u,n),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"subscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return(i=vr.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(k.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return mt(e)})).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",r,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",n,(function(e){return ee(e,q)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(F.A_E_SEARCH_CONVERSATION_BY_CONTENT_T,JSON.stringify({keyword:e,messageTypes:t,channelId:r,conversationTypes:n}),o),[4,this._engine.chat.searchConversationByContent(e,t&&0!==t.length?t:[Re.TEXT,Re.FILE],r||"",n&&0!==n.length?n:$(q))]):[2,i.wipe()];case 1:return s=a.sent(),this.logger.summary(F.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,i,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[Re.TEXT,Re.FILE],r&&0!==r.length?r:$(q))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,o;return i(this,void 0,void 0,(function(){var i,s;return a(this,(function(a){switch(a.label){case 0:return(i=Ec("searchMessages",e,Q).isLimitedString("keyword",null==t?void 0:t.keyword,0,1e3,!0).fail(k.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==t?void 0:t.limit,1,_t,!0).fail(k.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==t?void 0:t.offset,0,_t).fail(k.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==t?void 0:t.order,0,1,!0).fail(k.INVALID_PARAMETER_ORDER).isObject("timeRange",t.timeRange).validate("timeRange",t.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!bt(t)||r&&!bt(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(k.INVALID_PARAMETER_TIMESTAMP).isTypedArray("objectNames",null===(r=null==t?void 0:t.messageFilter)||void 0===r?void 0:r.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(k.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(o=null==t?void 0:t.messageFilter)||void 0===o?void 0:o.senderIds,Ut).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans((function(){return Vt()?br():Tr(k.NOT_SUPPORT,"Only support electron platform.")})).tryTrans(this.validateLogin)).isOk?(s=l(this,OI,"m",CI).call(this,e),[4,l(this,OI,"m",wI).call(this,n(n({},t),{conversationFilter:{conversationTypes:[s.conversationType],targetIds:[s.targetId],channelIds:"string"==typeof s.channelId?[s.channelId]:[]}}))]):[2,i.wipe()];case 1:return[2,a.sent().orSync((function(){return br({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,o,s,u;return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){return(i=vr.create("searchMessagesWithParams").isObject("params",e,!0).fail(k.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(k.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,_t,!0).fail(k.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,_t).fail(k.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(k.INVALID_PARAMETER_ORDER).isObject("timeRange",null==e?void 0:e.timeRange).validate("timeRange",null==e?void 0:e.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!bt(t)||r&&!bt(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(k.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(t=null==e?void 0:e.conversationFilter)||void 0===t?void 0:t.conversationTypes,(function(e){return ee(e,Q)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(r=null==e?void 0:e.conversationFilter)||void 0===r?void 0:r.targetIds,20,Ut,!1,0).fail(k.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.channelIds,10,Lt,!1,0).fail(k.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(o=null==e?void 0:e.messageFilter)||void 0===o?void 0:o.senderIds,20,Ut,!1,0).fail(k.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(s=null==e?void 0:e.messageFilter)||void 0===s?void 0:s.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(k.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).result().tryTrans(this.validateLogin)).isOk?(e.limit=Math.min(e.limit,100),(null===(u=e.messageFilter)||void 0===u?void 0:u.objectNames)&&e.messageFilter.objectNames.length>300&&(e.messageFilter.objectNames=e.messageFilter.objectNames.slice(0,300)),[2,l(this,OI,"m",wI).call(this,e)]):[2,i.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(F.A_GET_MSGS_AROUND_TIMESTAMP_T,JSON.stringify({conversation:e,timestamp:t,beforeCount:r,afterCount:n}),i),[4,vr.create("getMessagesAroundTimestamp").check((function(t){return Ic(t,e,Q)})).isLimitedInteger("timestamp",t,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("beforeCount",r,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_BEFORE).isLimitedInteger("afterCount",n,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_AFTER).result().tryTrans(this.validateLogin).next((function(){var i=l(s,OI,"m",CI).call(s,e);return s._engine.chat.getMessagesAroundTimestamp(i,t,r,n)}))];case 1:return o=a.sent(),this.logger.summary(F.A_GET_MSGS_AROUND_TIMESTAMP_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UNREAD_MENTIONED_MSGS_T,JSON.stringify(e),t),[4,vr.create("getUnreadMentionedMessages").check((function(t){return Ic(t,e,Q)})).result().tryTrans(this.validateLogin).next((function(){var t=l(n,OI,"m",CI).call(n,e);return n._engine.chat.getUnreadMentionedMessages(t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_UNREAD_MENTIONED_MSGS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,channelId:t}),r),[4,vr.create("getUltraGroupDefaultNotificationLevel").validate("targetId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("channelId",t,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){var r="string"==typeof t?i._channelIdConvert(x.ULTRA_GROUP,t):t;return i._engine.chat.getUGDefaultNotificationLevel(e,r)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_UG_DEFAULT_NTF_LEVEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,notificationLevel:t,channelId:r}),n),[4,vr.create("setUltraGroupDefaultNotificationLevel").validate("targetId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).isNumberEnum("notificationLevel",t,Te,!0).fail(k.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var n="string"==typeof r?o._channelIdConvert(x.ULTRA_GROUP,r):r;return o._engine.chat.setUGDefaultNotificationLevel(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(F.A_SET_UG_DEFAULT_NTF_LEVEL_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return(t=Ec("getConversationNotificationLevel",e,q).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(l(this,OI,"m",CI).call(this,e))]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=vr.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return ee(e,q)}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE).isNumberEnum("level",t,Te,!0).fail(k.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.setConversationTypeNotificationLevel(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return(t=vr.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return ee(e,q)}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.getConversationTypeNotificationLevel(e)]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return r=null==t?void 0:t.timestamp,n=null==t?void 0:t.count,i=null==t?void 0:t.order,o=this.logger.createTraceId(),this.logger.info(F.A_GET_REMOTE_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),o),[4,vr.create("getRemoteHistoryMessages").check((function(t){return Ic(t,e,K)})).isLimitedInteger("timestamp",r,0,Number.MAX_SAFE_INTEGER).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(k.INVALID_PARAMETER_ORDER).isLimitedInteger("count",n,1,100).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:r||0,count:n||20,order:i||0,messageType:""},a=l(u,OI,"m",CI).call(u,e);return u._engine.getHistoryMessage(a,t,!1)}))];case 1:return s=a.sent(),this.logger.summary(F.A_GET_REMOTE_HISTORY_MSG_R,s,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(F.A_CLEAR_LOCAL_CACHE_O),this._engine.clearLocalData()}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_CONVERSATIONS_T,JSON.stringify({identifiers:e}),t),[4,vr.create("getConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,100,(function(e){return!Ic(t,e,Q).isFailed}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return l(n,OI,"m",CI).call(n,e)}));return n._engine.chat.getConversations(t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_CONVERSATIONS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckDuplicateMessage(!!e)}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i=this;return a(this,(function(a){switch(a.label){case 0:return[4,this.validateConnected().next((function(){return i._engine.rtcSignaling(e,t,r,n)}))];case 1:return[2,a.sent()]}}))}))}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.rtcPing(e,t,r)}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_SET_PROXY_T,JSON.stringify({proxy:e}),t),[4,vr.create("setProxy").check((function(t){return vc(t,e)})).result().next((function(){return n._engine.setProxy(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_SET_PROXY_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_PROXY_T,JSON.stringify({}),e),[4,this._engine.getProxy()];case 1:return t=r.sent(),this.logger.summary(F.A_GET_PROXY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_TEST_PROXY_T,JSON.stringify({proxy:e,testHost:t}),r),[4,vr.create("testProxy").check((function(t){return vc(t,e)})).isString("testHost",t,!0).fail(k.INVALID_PARAMETER_TESTHOST).result().next((function(){return i._engine.testProxy(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_TEST_PROXY_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_REALTIME_CONVERSATIONS_T,JSON.stringify({count:e,startTime:t,order:r}),n),[4,vr.create("getRealtimeConversations").isLimitedInteger("count",e,1,50,!0).fail(k.INVALID_PARAMETER_COUNT).isTimestamp("startTime",t,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",r,0,1,!0).fail(k.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).tryTrans(wc).next((function(){return o._engine.chat.getRealtimeConversations(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_GET_REALTIME_CONVERSATIONS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T,"",e),[4,this.validateConnected().tryTrans(wc).next((function(){return r._engine.chat.getRealtimeConTotalUnreadCount()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_CLEAR_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,this.validateConnected().tryTrans(wc).next((function(){return n._engine.chat.clearRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_CLEAR_REALTIME_CON_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_REALTIME_CONVERSATIONS_T,JSON.stringify(e),t),[4,vr.create("removeRealtimeConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,20,(function(e){return!Ic(t,e,Q).isFailed}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(wc).next((function(){return n._engine.chat.removeRealtimeConversations(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_REMOVE_REALTIME_CONVERSATIONS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,vr.create("batchGetRealtimeConUnreadCount").check((function(t){t.isLimitedTypedArray("identifiers",e,10,(function(e){return!Ic(t,e,Q).isFailed}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(wc).next((function(){return n._engine.chat.batchGetRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return vr.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(k.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(k.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(k.INVALID_PARAMETER_SPAN_MINUTES).isNumberEnum("level",e.level,Me,!0).fail(k.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return this.validateConnected().next((function(){return e._engine.removeNotificationQuietHoursSetting()}))}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return this.validateConnected().next((function(){return e._engine.getNotificationQuietHoursSetting()}))}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getStatsUrlList()}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=Ec("sendReadReceiptResponseV5",e,J).isTypedArray("messageUIdArray",t,(function(e){return Ut(e)}),!0).fail(k.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?br():Tr(k.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.sendReadReceiptResponseV5(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){return(r=Ec("getMessageReadReceiptInfoV5",e,J).isTypedArray("messageUIdArray",t,(function(e){return Ut(e)}),!0).fail(k.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?br():Tr(k.READ_RECEIPT_ERROR)}))).isOk?(n=t.map((function(t){return{identifier:e,messageUId:t}})),[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(n)]):[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){return t=vr.create(""),(r=vr.create("getMessageReadReceiptInfoV5ByIdentifiers").isTypedArray("identifiers",e,(function(e){return Ic(t,e.identifier,J).isNotEmptyString("messageUId",e.messageUId,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).result().isOk}),!0).fail(k.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",e.length,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?br():Tr(k.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(e)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){return(n=Ec("getMessageReadReceiptInfoV5",e,J).isNotEmptyString("messageUId",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isObject("option",r,!0).fail(k.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",r.pageToken).fail(k.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",r.pageCount,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?br():Tr(k.READ_RECEIPT_ERROR)}))).isOk?(r.order=1!==r.order?0:1,r.readStatus=1!==r.readStatus?0:1,[2,this._engine.chat.getMessagesReadReceiptUsersByPageV5(e,t,r)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){return(n=Ec("getMessagesReadReceiptByUsersV5",e,J).isNotEmptyString("messageUId",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",r,(function(e){return Ut(e)}),!0).fail(k.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",r.length,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?br():Tr(k.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessagesReadReceiptByUsersV5(e,t,r)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T,JSON.stringify({messageUId:e,option:t}),r),[4,vr.create("requestSpeechToTextForMessage").isNotEmptyString("messageUId",e,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).tryTrans((function(e){return!!(1&(e.AIBusinessSub||0))?br():Tr(k.SPEECH_TO_TEXT_DISABLE)})).next((function(){return i._engine.chat.requestSpeechToTextForMessage(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r=this;return a(this,(function(n){switch(n.label){case 0:return[4,vr.create("setMessageSpeechToTextVisible").isNumber("messageId",e,!0).fail(k.INVALID_PARAMETER_MESSAGE_ID).result().tryTrans(this.validateLogin).next((function(){return r._engine.chat.setMessageSpeechToTextVisible(e,!!t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T,JSON.stringify({timestamp:e,count:t,topPriority:r}),n),[4,vr.create("getUntaggedConversationListByPage").isLimitedInteger("timestamp",e,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).isInteger("count",t,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateLogin).next((function(){var n=t<=0?20:Math.min(t,100);return o._engine.chat.getUntaggedConversationListByPage(e,n,!!r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"translateMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return i(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=Vt(),[4,vr.create("translateMessagesWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof Mn&&e.isValid(!r)}),!0).fail(k.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(t=null==e?void 0:e.list)||void 0===t?void 0:t.length,1,10,!0).fail(k.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,Cn).fail(k.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(n=a.sent()).isOk?(i=e.list,o=e.force,s=e.mode,[2,l(this,OI,"m",UI).call(this,i,0,s,o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"translateTextsWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return i(this,void 0,void 0,(function(){var r,n,i;return a(this,(function(a){switch(a.label){case 0:return[4,vr.create("translateTextsWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof Ln&&e.isValid(!0)}),!0).fail(k.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(t=null==e?void 0:e.list)||void 0===t?void 0:t.length,1,10,!0).fail(k.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,Cn).fail(k.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(r=a.sent()).isOk?(n=e.list,i=e.mode,[2,l(this,OI,"m",UI).call(this,n,1,i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_SET_TRANSLATION_LANGUAGE_T,JSON.stringify({language:e}),t),[4,vr.create("setTranslationLanguage").isLimitedString("language",e,1,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_LAUGUAGE).result().tryTrans(this.validateConnected).next((function(){return n._engine.userSettings.setTranslationLanguage(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_SET_TRANSLATION_LANGUAGE_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_TRANSLATION_LANGUAGE_T,void 0,e),[4,this.validateLogin().next((function(){return r._engine.userSettings.getTranslationLanguage()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_TRANSLATION_LANGUAGE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_SET_AUTO_TRANSLATE_ENABLED_T,JSON.stringify({enabled:!!e}),t),[4,this.validateConnected().next((function(){return n._engine.userSettings.setAutoTranslateEnabled(!!e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_SET_AUTO_TRANSLATE_ENABLED_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_AUTO_TRANSLATE_ENABLED_T,void 0,e),[4,this.validateLogin().next((function(){return r._engine.userSettings.getAutoTranslateEnabled()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_AUTO_TRANSLATE_ENABLED_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.messageUId,n=null==e?void 0:e.messageContent,this.logger.info(F.A_MODIFY_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUId:r,conversation:null==e?void 0:e.conversation}),t),[4,vr.create("modifyMessageWithParams").check((function(t){return Ic(t,null==e?void 0:e.conversation,X)})).isNotEmptyString("messageUId",r,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isObject("messageContent",n,!0).fail(k.INVALID_PARAMETER_MESSAGE_CONTENT).isLimitedInteger("messageContent",Rc(JSON.stringify(n)),1,He,!0).fail(k.RC_MSG_CONTENT_EXCEED_LIMIT).result().tryTrans(this.validateConnected).next((function(){return o._engine.chat.modifyMessageWithParams(e)}))];case 1:return i=a.sent(),this.logger.summary(F.A_MODIFY_MESSAGE_WITH_PARAMS_R,i,t),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.messageUIds,this.logger.info(F.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUIds:r}),t),[4,Ec("refreshReferenceMessageWithParams",null==e?void 0:e.conversationIdentifier,X).isObject("params",e,!0).fail(k.BIZ_ERROR_INVALID_PARAMETER).isTypedArray("messageUIds",r,(function(e){return mt(e)}),!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==r?void 0:r.length,1,20,!0).fail(k.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.refreshReferenceMessageWithParams(r,e.conversationIdentifier,e.remoteMessageBlock,e.localMessageBlock,e.messageInfoMap)}))];case 1:return n=a.sent(),this.logger.summary(F.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_SYNC_REMOTE_CONVERSATIONS_T,void 0,e),[4,this.validateConnected().next((function(){return r._engine.chat.syncRemoteConversations()}))];case 1:return t=n.sent(),this.logger.summary(F.A_SYNC_REMOTE_CONVERSATIONS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalUGMessagesForAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T,JSON.stringify({targetId:e,timestamp:t}),r),[4,vr.create("deleteLocalUGMessagesForAllChannel").isNotEmptyString("targetId",e,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isTimestamp("timestamp",t,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.deleteLocalUGMessagesForAllChannel(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T,JSON.stringify({params:e}),t),[4,vr.create("getUnreadMentionMeConversationList").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,Number.MAX_SAFE_INTEGER,(function(e){return ee(e,q)}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(t){return i(n,void 0,void 0,(function(){var r;return a(this,(function(n){if(r=kp(t)){if(!this._engine.chat.ugSynced)return[2,Tr(k.METHOD_NOT_AVAILABLE)]}else if(e.conversationTypes=e.conversationTypes.filter((function(e){return e!==x.ULTRA_GROUP})),0===e.conversationTypes.length)return[2,br([])];return[2,this._engine.chat.getUnreadMentionMeConversationList(e,r)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_ALL_ROBOTS_T,void 0,e),[4,this.validateConnected().next((function(){return r._engine.getAllRobots()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_ALL_ROBOTS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getRobotById",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,o=this;return a(this,(function(s){switch(s.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_ROBOT_BY_ID_T,JSON.stringify({id:e}),t),[4,vr.create("getRobotById").validate("id",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return i(o,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.getAllRobots()]}))}))}))];case 1:return r=s.sent(),n=r.trans((function(t){return t.find((function(t){return t.robotId===e}))||null})),this.logger.summary(F.A_GET_ROBOT_BY_ID_R,r,t,{id:e,robot:n.data}),[2,n]}}))}))}}),e}();OI=new WeakSet,SI=function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return[4,vr.create("connect").isNotEmptyString("token",e).fail(k.RC_CONN_TOKEN_INCORRECT).result().next((function(){return i(s,void 0,void 0,(function(){var n,i;return a(this,(function(a){switch(a.label){case 0:return this._token=e,[4,po.getNetworkType()];case 1:return n=a.sent(),this._engine.setNetwork({status:!0,type:n},!0),i=!!this._pluginInstanseMap.RCCallPlus,[2,this._engine.connect(e,t,i,r)]}}))}))}))];case 1:return(n=u.sent()).isOk&&1!==this._engine.naviInfo.type&&(o=dt.getInfo(),this._engine.reportSDKInfo(o)),[2,n]}}))}))},NI=function(e,t){return i(this,void 0,void 0,(function(){var r=this;return a(this,(function(n){switch(n.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e,t)];case 1:return n.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){r.logger.error(F.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},CI=function(e){return n(n({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)})},PI=function(e,t,r,n){return i(this,void 0,void 0,(function(){var i=this;return a(this,(function(a){switch(a.label){case 0:return[4,vr.create("sendMessage").check((function(t){return Ic(t,e,Q)})).isObject("content",t.content,!0).fail(k.INVALID_PARAMETER_MESSAGE_CONTENT).isString("messageType",t.messageType,!0).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){var r=pc(t.messageType,t.content);r.isOk||e.setFailed(r.code)})).isNumber("messageId",t.messageId).fail(k.INVALID_PARAMETER_MESSAGE_ID).isBoolean("isStatusMessage",t.isStatusMessage).fail(k.INVALID_PARAMETER_IS_STATUS_MESSAGE).isBoolean("disableNotification",t.disableNotification).fail(k.INVALID_PARAMETER_DISABLE_NOTIFICATION).isString("pushContent",t.pushContent).fail(k.INVALID_PARAMETER_PUSH_CONTENT).isString("pushData",t.pushData).fail(k.INVALID_PARAMETER_PUSH_DATA).isObject("pushConfig",t.pushConfig).fail(k.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("isVoipPush",t.isVoipPush).fail(k.INVALID_PARAMETER_IS_VOIP_PUSH).isBoolean("canIncludeExpansion",t.canIncludeExpansion).fail(k.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION).check((function(e){t.canIncludeExpansion&&t.expansion&&Tc(e,t.expansion,!0)})).check((function(r){r.isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(k.INVALID_DISABLE_UPDATE_LAST_MESSAGE),r.isFailed||e.conversationType===x.ULTRA_GROUP&&t.disableUpdateLastMessage&&r.setFailed(k.INVALID_DISABLE_UPDATE_LAST_MESSAGE)})).check((function(r){if(!r.isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,Ut,!1,0).fail(k.INVALID_PARAMETER_USERIDLIST).isFailed&&t.directionalUserIdList&&0!==t.directionalUserIdList.length){var n=e.conversationType;[x.GROUP,x.ULTRA_GROUP,x.APP_PUBLIC_SERVICE,x.PUBLIC_SERVICE].includes(n)||r.setFailed(k.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE)}})).isBoolean("isMentioned",t.isMentioned).fail(k.INVALID_PARAMETER_IS_MENTIONED).check((function(r){var n=e.conversationType;if(!t.isMentioned||n!==x.GROUP&&n!==x.ULTRA_GROUP)delete t.content.mentionedInfo;else{var i=t.content.mentionedInfo||{type:t.mentionedType,userIdList:t.mentionedUserIdList};!r.isNumberEnum("mentionedType",null==i?void 0:i.type,Y,!0).fail(k.INVALID_PARAMETER_MENTIONED_TYPE).isTypedArray("mentionedUserIdList",null==i?void 0:i.userIdList,Ut,(null==i?void 0:i.type)===Y.SINGAL).fail(k.INVALID_PARAMETER_USERIDLIST).isString("mentionedContent",null==i?void 0:i.mentionedContent).fail(k.INVALID_PARAMETER_MESSAGE_CONTENT).isFailed&&(t.content.mentionedInfo=i)}})).result().tryTrans(this.validateConnected).tryTrans((function(r){if(!t.needReceipt)return br(r);if(r.grpRRVer!==xe.V5)return Tr(k.READ_RECEIPT_ERROR);var n=e.conversationType,i=An(t.messageType),a=i.isPersited,o=i.isStatusMessage;return(n!==x.GROUP&&n!==x.PRIVATE||t.isStatusMessage||o||!a||n===x.GROUP&&t.directionalUserIdList&&t.directionalUserIdList.length>0)&&(t.needReceipt=!1),br(r)})).tryTrans((function(r){var n=e.conversationType,i=t.messageType;if(n===x.SYSTEM&&i!==Re.SYNC_READ_STATUS)return Tr(k.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE);if(i===Re.STREAM_MESSAGE)return Tr(k.MESSAGE_NOT_SUPPORT_SENDING);if(i===Re.READ_RECEIPT_RESPONSE&&r.grpRRVer)return Tr(k.READ_RECEIPT_ERROR);var a=JSON.stringify(t.content);return Rc(a)>He?Tr(k.RC_MSG_CONTENT_EXCEED_LIMIT):br()})).next((function(){return l(i,OI,"m",MI).call(i,e,t,r,n)}))];case 1:return[2,a.sent()]}}))}))},MI=function(e,t,r,n){var i=l(this,OI,"m",CI).call(this,e);return i.conversationType===x.ULTRA_GROUP?this._engine.sendUltraMessage(i,t,r,n):this._engine.sendMessage(i,t,r,n)},LI=function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,this._engine.sendMessage(e,{content:t,messageType:Re.EXPANSION_NOTIFY},r)];case 1:return[2,n.sent().wipe()]}}))}))},wI=function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.timeRange||{},r=t.startTime,n=t.endTime,i={startTime:null!=r?r:0,endTime:null!=n?n:Number.MAX_SAFE_INTEGER},e.timeRange=i,o=this.logger.createTraceId(),this.logger.info(F.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return s=a.sent(),this.logger.summary(F.A_SEARCH_MSGS_BY_PARAMS_R,s,o),[2,s]}}))}))},UI=function(e,t,r,n){return i(this,void 0,void 0,(function(){return a(this,(function(i){return[2,this._engine.translateWithParams(e.map((function(e){return e.toInnerParam()})),r||Cn.MECHANICAL,!!n,t)]}))}))};export{VI as APIContext,Br as AreaCode,lc as AssertRules,oc as BasicEngine,en as BasicLogger,w as ChatroomEntryType,D as ChatroomSyncStatusReason,G as ChatroomUserChangeType,V as ChrmMemBanType,j as ChrmMemOperateType,U as ChrmSyncStatus,rc as Codec,Ml as ConnectionStatus,x as ConversationType,_ as DirectionType,k as ErrorCode,Xl as EventEmitter,H as FileType,Ge as FilterRobotType,d as FriendAddPermission,p as FriendApplicationStatus,g as FriendApplicationType,h as FriendRelationType,L as GroupApplicationDirection,S as GroupApplicationStatus,M as GroupApplicationType,R as GroupInviteHandlePermission,b as GroupJoinPermission,v as GroupMemberInfoEditPermission,m as GroupMemberRole,A as GroupOperation,T as GroupOperationPermission,C as GroupOperationRole,N as GroupOperationStatus,O as GroupOperationType,xe as GroupReadReceiptVersion,De as HttpMethod,Pe as InterruptionLevel,sn as LogDBProxy,Kr as LogL,Cl as LogLevel,Pl as LogSource,F as LogTagId,He as MAX_MESSAGE_CONTENT_BYTES,_t as MAX_U32_INTEGER,We as MAX_UPLOAD_FILE_SIZE,Y as MentionedType,Ve as MessageAuditType,pe as MessageBlockSourceType,ge as MessageBlockType,Ee as MessageDirection,Re as MessageType,Te as NotificationLevel,ve as NotificationStatus,le as OnlineStatus,ue as OperateStatus,Nl as PBCodec,ce as Platform,cc as PluginContext,Ie as PushImportanceHonor,Me as PushNotificationQuietHoursLevel,f as QueryFriendsDirectionType,he as RCConnectionStatus,Ir as RCResult,Dl as RTCApiType,Vl as RTCJoinType,Ll as RTCMode,_c as RTCPluginContext,me as ReceivedStatus,Yr as ReferenceMessageStatus,se as SentStatus,je as SpeechToTextStatus,kl as StreamMessageResponseEventType,fe as SubscribeOperationType,_e as SubscribeType,Er as SuspendablePromise,Mn as TranslateMessageParam,Cn as TranslateMode,wn as TranslateStatus,Un as TranslateStrategy,Ln as TranslateTextParam,Je as UPLOAD_FILE_CHUNK_SIZE,ht as UUId,re as UltraGroupChannelChangeType,te as UltraGroupChannelType,r as UploadMethod,de as UserProfileVisibility,Wr as UserSettingsChangedKey,ke as UserType,vr as Validator,dt as VersionManage,hc as assert,un as createLogDBProxy,Tr as fail,lr as fixUrlProtocol,Zl as forEach,An as getMessageTypeDescription,ec as getUUID,tc as getUUID22,yn as hasMessageTypeDescription,xr as httpRequest,vt as isArray,It as isBoolean,Ot as isFunction,Nt as isHttpUrl,Tt as isInteger,Rt as isLimitedString,$l as isNull,bt as isNumber,yt as isObject,Et as isString,St as isUndefined,Pt as isValidConversationType,wt as isValidEnum,Gt as isValidFileType,Dt as isValidGroupId,Ut as isValidTargetId,zl as map,At as notEmptyArray,Ct as notEmptyObject,mt as notEmptyString,br as ok,yr as promiseWithResolvers,po as runtime,jt as trans2IReceivedStatusInfo,Le as trans2NotificationLevel,we as trans2NotificationStatus,kt as transformReceivedStatusFlag,Vt as usingCppEngine,gc as validate};
15
+ var e=function(t,r){return e=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])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r,n=function(){return n=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},n.apply(this,arguments)};function i(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(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(o,s)}u((n=n.apply(e,t||[])).next())}))}function a(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function o(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 s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function u(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;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 l(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 c(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"}(r||(r={}));var f,d,_,h,g,p,b,E,I,T,v,R,m,y,A,O,S,N,C,P,M,L,w,U,D,G,V,j,k,x,F={L_IMSDK_VER_O:"L-imsdk_ver-O",A_INIT_REPEAT_O:"A_INIT_REPEAT_O",L_INIT_O:"L-init-O",A_DESTROY_O:"A_DESTROY_O",A_CONNECT_T:"A-connect-T",A_CONNECT_R:"A-connect-R",A_CONNECT_S:"A-connect-S",L_QUERY_CMP_T:"L-query_cmp-T",L_QUERY_CMP_R:"L-query_cmp-R",A_DISCONNECT_O:"A-disconnect-O",A_RECONNECT_T:"A-reconnect-T",A_RECONNECT_R:"A_RECONNECT_R",L_CONNECT_T:"L-connect-T",L_CONNECT_O:"L-connect-O",L_CONNECT_R:"L-connect-R",L_CONNECT_S:"L-connect-S",L_DB_UPGRATE_START_S:"L-db_upgrate_start-S",L_DB_UPGRATING_S:"L-db_upgrating-S",L_DB_UPGRATE_COMPLETE_S:"L-db_upgrate_complete-S",L_NOTIFY_ULTRA_ONLINE_S:"L-notify-ultra-online-S",L_ULTRA_SYNC_DONE_S:"L-ultra-sync-done-S",L_BATCH_MESSAGE_O:"L-BATCH_MESSAGE-O",A_MSG_LISTENER_E:"A-MSG_LISTENER-E",O:"L-original-O",T:"L-TEST-O",L_INSTALL_PLUGIN_T:"L-INSTALL_PLUGIN-T",L_INSTALL_PLUGIN_R:"L-INSTALL_PLUGIN-R",L_NAVI_CONF_E:"L-NAVI_CONF_ERROR-E",L_NAVI_CMP_R:"L-NAVI_CPM-R",A_SEND_MSG_T:"A-send_msg-T",A_SEND_MSG_R:"A-send_msg-R",L_SEND_MSG_T:"L-send_msg-T",L_SEND_MSG_R:"L-send_msg-R",A_SEND_TYPING_STATUS_T:"A-send_typing_status-T",A_SEND_TYPING_STATUS_R:"A-send_typing_status-R",A_SEND_READ_RECEIPT_REQ_T:"A-send_read_receipt_req-T",A_SEND_READ_RECEIPT_REQ_R:"A-send_read_receipt_req-R",L_PULL_MSG_T:"L-pull_msg-T",L_PULL_MSG_R:"L-pull_msg-R",L_PULL_MSG_E:"L-pull_msg-E",L_PULL_MSG_O:"L-pull_msg-O",L_PULL_ULTRA_MSG_T:"L-pull_ultra_msg-T",L_PULL_ULTRA_MSG_R:"L-pull_ultra_msg-R",L_PULL_UG_RELATIONS_T:"L-pull_ug_relations-T",L_PULL_UG_RELATIONS_R:"L-pull_ug_relations-R",L_PULL_CHATROOM_KV_T:"L-pull_chatroom_kv-T",L_PULL_CHATROOM_KV_R:"L-pull_chatroom_kv-R",L_PULL_CHATROOM_MSG_T:"L-pull_chatroom_msg-T",L_PULL_CHATROOM_MSG_R:"L-pull_chatroom_msg-R",L_RECV_MULTI_SYNC_MSG_O:"L-recv_multi_sync_msg-O",L_RECV_S_MSG_O:"L-recv_s_msg-O",A_DELETE_LOCAL_MSGS_T:"A-delete_local_msgs-T",A_DELETE_LOCAL_MSGS_R:"A-delete_local_msgs-R",A_RECALL_MESSAGE_T:"A-recall_msg-T",A_RECALL_MESSAGE_R:"A-recall_msg-R",A_RECALL_MESSAGE_E:"A-recall_msg-E",A_REGTYP_O:"A-regtyp-O",P_REGTYP_E:"P-regtype-E",L_GET_NAVI_T:"L-get_navi-T",L_GET_NAVI_R:"L-get_navi-R",L_REQUEST_T:"L-request-T",L_REQUEST_R:"L-request-R",L_PARSE_NAVI_E:"L-parse_navi-E",L_ENV_S:"L-Env-S",L_GET_INDEX_NAVI_S:"L-get_index_navi-S",A_JOIN_CHATROOM_T:"A-join_chatroom-T",A_JOIN_CHATROOM_R:"A-join_chatroom-R",L_REJOIN_CHATROOM_T:"L-rejoin_chatroom-T",L_REJOIN_CHATROOM_R:"L-rejoin_chatroom-R",A_QUIT_CHATROOM_T:"A-quit_chatroom-T",A_QUIT_CHATROOM_R:"A-quit_chatroom-R",A_GET_CHATROOM_INFO_T:"A-get_chatroom_info-T",A_GET_CHATROOM_INFO_R:"A-get_chatroom_info-R",A_SET_CHATROOM_ENTRY_T:"A-set_chatroom_entry-T",A_SET_CHATROOM_ENTRY_R:"A-set_chatroom_entry-R",A_SET_CHATROOM_ENTRIES_T:"A-set_chatroom_entries-T",A_SET_CHATROOM_ENTRIES_R:"A-set_chatroom_entries-R",A_REMOVE_CHATROOM_ENTRY_T:"A-remove_chatroom_entry-T",A_REMOVE_CHATROOM_ENTRY_R:"A-remove_chatroom_entry-R",A_REMOVE_CHATROOM_ENTRIES_T:"A-remove_chatroom_entries-T",A_REMOVE_CHATROOM_ENTRIES_R:"A-remove_chatroom_entries-R",A_GET_CHATROOM_ENTRY_T:"A-get_chatroom_entry-T",A_GET_CHATROOM_ENTRY_R:"A-get_chatroom_entry-R",A_GET_CHATROOM_ENTRIES_T:"A-get_chatroom_entries-T",A_GET_CHATROOM_ENTRIES_R:"A-get_chatroom_entries-R",A_BIND_RTC_FOR_CHATROOM_T:"A-bind_rtc_for_chatroom-T",A_BIND_RTC_FOR_CHATROOM_R:"A-bind_rtc_for_chatroom-R",L_MEDIA_S:"L-media-S",L_MEDIA_UPLOAD_T:"L-media_upload-T",L_MEDIA_UPLOAD_R:"L-media_upload-R",G_UPLOAD_LOG_S:"G-upload_log-S",G_REPORT_LOG_S:"G-report_log-S",G_UPLOAD_LOG_E:"G-upload_log-E",G_GET_REAL_TIMELOG_COMMAND_S:"G-get_real_timelog_command-S",L_CHECK_ALIVE_IM_T:"L-check_alive_im-T",L_CHECK_ALIVE_IM_R:"L-check_alive_im-R",L_CHECK_ALIVE_IM_S:"L-check_alive_im-S",A_GET_LOCAL_MESSAGE_T:"A-get_local_message-T",A_GET_LOCAL_MESSAGE_R:"A-get_local_message-R",A_GET_HISTORY_MSG_T:"A-get_history_msg-T",A_GET_HISTORY_MSG_R:"A-get_history_msg-R",A_GET_REMOTE_HISTORY_MSG_T:"A-get_remote_history_msg-T",A_GET_REMOTE_HISTORY_MSG_R:"A-get_remote_history_msg-R",L_CALLBACK_E:"L-callback-E",A_SEND_READ_RECEIPT_T:"A-send_read_receipt-T",A_SEND_READ_RECEIPT_R:"A-send_read_receipt-R",A_SEND_READ_RECEIPT_V2_T:"A-send_read_receipt_v2-T",A_SEND_READ_RECEIPT_V2_R:"A-send_read_receipt_v2-R",A_SYNC_READ_STATUS_T:"A-sync_read_status-T",A_SYNC_READ_STATUS_R:"A-sync_read_status-R",L_PB_ENCODE_E:"L-pb-encode-E",L_PB_DECODE_E:"L-pb-decode-E",L_NOTIFY_NAVI_CHANGE_E:"L-notify_navi_change-E",L_REPORT_FULL_LOG_O:"L-report_full_log-O",L_REPORT_FULL_LOG_T:"L-report_full_log-T",L_REPORT_FULL_LOG_R:"L-report_full_log-R",L_REPORT_LOG_POLICY_E:"L-parse_navi_logpolicy-E",L_UNSUPPORT_INDEXDB_O:"L-unsupport_IndexDB-O",L_LOGDB_OPEN_FAILED_E:"L-logDB_open_failed-E",L_LOGDB_CLOSED_S:"L-logDB_closed-S",L_LOGDB_ERROR_E:"L-logDB_error-S",L_LOGDB_ABORT_S:"L-logDB_abort-S",L_REALTIME_LOG_T:"L_REALTIME_LOG_T",L_REALTIME_LOG_R:"L_REALTIME_LOG_R",L_REALTIME_LOG_O:"L_REALTIME_LOG_O",L_SEND_RMTP_E:"L-send-rmtp-E",L_RECV_RMTP_O:"L-recv-rmtp-O",L_RECV_RMTP_E:"L-recv-rmtp-E",L_RECV_S_NTF_O:"L-recv_s_ntf_O",L_RECV_S_CMD_O:"L-recv_s_cmd_O",L_VER_REPORT_T:"L-VER_REPORT-T",L_VER_REPORT_R:"L-VER_REPORT-R",L_UNSUPPORT_NTF_FROM_MAIN_E:"L_UNSUPPORT_NTF_FROM_MAIN_E",A_REMOVE_PROXY_O:"A-remove_proxy-O",L_SET_PROXY_O:"L-set_proxy-O",L_TEST_PROXY_T:"L-test_proxy-T",L_TEST_PROXY_R:"L-test_proxy-R",L_WS_DISACCORD_E:"L-ws_disaccord-E",L_GET_STATIC_CONF_T:"L-get_static_conf-T",L_GET_STATIC_CONF_R:"L-get_static_conf-R",L_GET_STATIC_CONF_E:"L-get_static_conf-E",L_CLOUD_DISABLED:"L-cloud_disabled",L_CLOUD_OVERCLOCK:"L-cloud_overclock",L_CLOUD_APPKEY_REGION_E:"L-cloud_appkey_region_error",L_CLOUD_CONFIG_DATA_E:"L-cloud_config_data_error",L_CLOUD_SET_AREA_CODE_O:"L-cloud_set_area_code-O",L_CLOUD_SET_MRTR_O:"L-cloud_set_mrtr-O",L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S:"L-sync_subscribed_user_status_finished-S",L_PULL_SUBSCRIBED_USER_RELATION_T:"L-pull_subscribed_user_relation-T",L_PULL_SUBSCRIBED_USER_RELATION_R:"L-pull_subscribed_user_relation-R",L_PULL_SUBSCRIBED_USER_STATUS_T:"L-pull_subscribed_user_status-T",L_PULL_SUBSCRIBED_USER_STATUS_R:"L-pull_subscribed_user_status-R",L_OWN_USER_PROFILE_CHANGED_S:"L-own_user_profile_changed-S",L_QUERY_SUBSCRIBE_DATA_T:"L-query_subscribe_data-T",L_QUERY_SUBSCRIBE_DATA_R:"L-query_subscribe_data-R",L_PULL_USER_PROFILE_T:"L-pull_user_profile-T",L_PULL_USER_PROFILE_R:"L-pull_user_profile-R",L_PULL_OWN_PROFILE_T:"L-pull_own_profile-T",L_PULL_OWN_PROFILE_R:"L-pull_own_profile-R",L_QUERY_FRIEND_LIST_T:"L-query_friend_list-T",L_QUERY_FRIEND_LIST_R:"L-query_friend_list-R",L_PULL_USER_PROFILE_REQ_T:"L-pull_user_profile_req-T",L_PULL_USER_PROFILE_REQ_R:"L-pull_user_profile_req-R",L_SERVER_EVENT_NOTIFY_ONLINE_T:"L-server_event_notify_online-T",L_SERVER_EVENT_NOTIFY_ONLINE_R:"L-server_event_notify_online-R",L_PULL_EVENT_CHANGE_T:"L-pull_event_change-T",L_PULL_EVENT_CHANGE_R:"L-pull_event_change-R",L_PARSE_JSON_E:"L-parse_json-E",L_REQ_STREAM_MSG_CONTENT_T:"L-req_stream_msg_content-T",L_REQ_STREAM_MSG_CONTENT_R:"L-req_stream_msg_content-R",L_REQ_STREAM_MSG_CONTENT_O:"L-req_stream_msg_content-O",L_REQ_STREAM_MSG_CONTENT_E:"L-req_stream_msg_content-E",L_PULL_CONVERSATION_SETTINGS_T:"L-pull_conversation_settings-T",L_PULL_CONVERSATION_SETTINGS_R:"L-pull_conversation_settings-R",L_PULL_SG_RELATIONS_T:"L-pull_sg_relations-T",L_PULL_SG_RELATIONS_R:"L-pull_sg_relations-R",A_REMOVE_CONVERSATION_T:"A-remove_conversation-T",A_REMOVE_CONVERSATION_R:"A-remove_conversation-R",A_GET_CONVERSATION_T:"A-get_conversation-T",A_GET_CONVERSATION_R:"A-get_conversation-R",A_BATCH_SET_CONVERSATION_TO_TOP_T:"A-batch_set_conversation_to_top-T",A_BATCH_SET_CONVERSATION_TO_TOP_R:"A-batch_set_conversation_to_top-R",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T:"A-batch_set_convers_notification_level-T",A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R:"A-batch_set_convers_notification_level-R",A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T:"A-batch_set_convers_translate_strategy-T",A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R:"A-batch_set_convers_translate_strategy-R",A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_T:"A-delete_remote_message_by_timestamp-T",A_DELETE_REMOTE_MESSAGE_BY_TIMESTAMP_R:"A-delete_remote_message_by_timestamp-R",A_DEL_REMOTE_MSGS_T:"A-del_remote_msgs-T",A_DEL_REMOTE_MSGS_R:"A-del_remote_msgs-R",A_BATCH_CLEAR_REMOTE_MSG_T:"A-batch_clear_remote_msg-T",A_BATCH_CLEAR_REMOTE_MSG_R:"A-batch_clear_remote_msg-R",L_EVENT_LOOP_BLOCKING_S:"L-event_loop_blocking-S",A_E_SEARCH_CONVERSATION_BY_CONTENT_T:"A-e_search_conversation_by_content-T",A_E_SEARCH_CONVERSATION_BY_CONTENT_R:"A-e_search_conversation_by_content-R",A_LOAD_CONVERSATION_LIST_T:"A-load_conversation_list-T",A_LOAD_CONVERSATION_LIST_R:"A-load_conversation_list-R",P_GET_SYS_VERSION_E:"P-get_sys_version-E",A_CLEAR_LOCAL_CACHE_O:"A-clear_local_cache-O",A_E_SET_MESSAGE_STATUS_TO_READ_T:"A-e_set_message_status_to_read-T",A_E_SET_MESSAGE_STATUS_TO_READ_R:"A-e_set_message_status_to_read-R",A_SEARCH_MSGS_BY_PARAMS_T:"A-search_msgs_by_params-T",A_SEARCH_MSGS_BY_PARAMS_R:"A-search_msgs_by_params-R",A_GET_CHATROOM_HISTORY_MESSAGES_T:"A-get_chatroom_history_messages-T",A_GET_CHATROOM_HISTORY_MESSAGES_R:"A-get_chatroom_history_messages-R",A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T:"A-request_speech_to_text_for_message-T",A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R:"A-request_speech_to_text_for_message-R",L_SYNC_USER_SETTINGS_T:"L-sync_user_settings-T",L_SYNC_USER_SETTINGS_R:"L-sync_user_settings-R",A_ADD_TAG_T:"A-add_tag-T",A_ADD_TAG_R:"A-add_tag-R",A_REMOVE_TAG_T:"A-remove_tag-T",A_REMOVE_TAG_R:"A-remove_tag-R",A_UPDATE_TAG_T:"A-update_tag-T",A_UPDATE_TAG_R:"A-update_tag-R",A_GET_TAGS_T:"A-get_tags-T",A_GET_TAGS_R:"A-get_tags-R",A_ADD_TAG_FOR_CONVERSATIONS_T:"A-add_tag_for_conversations-T",A_ADD_TAG_FOR_CONVERSATIONS_R:"A-add_tag_for_conversations-R",A_GET_TAGS_OF_CONVERSATION_T:"A-get_tags_of_conversation-T",A_GET_TAGS_OF_CONVERSATION_R:"A-get_tags_of_conversation-R",A_SET_CONVER_TO_TOP_IN_TAG_T:"A-set_conver_to_top_in_tag-T",A_SET_CONVER_TO_TOP_IN_TAG_R:"A-set_conver_to_top_in_tag-R",A_REMOVE_TAG_FOR_CONVERS_T:"A-remove_tag_for_conversations-T",A_REMOVE_TAG_FOR_CONVERS_R:"A-remove_tag_for_conversations-R",A_REMOVE_TAGS_FOR_CONVER_T:"A-remove_tags_for_conversation-T",A_REMOVE_TAGS_FOR_CONVER_R:"A-remove_tags_for_conversation-R",A_GET_UNREAD_COUNT_BY_TAG_T:"A-get_unread_count_by_tag-T",A_GET_UNREAD_COUNT_BY_TAG_R:"A-get_unread_count_by_tag-R",A_GET_UNREAD_COUNT_T:"A-get_unread_count-T",A_GET_UNREAD_COUNT_R:"A-get_unread_count-R",A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T:"A-get_untagged_conversation_list_by_page-T",A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R:"A-get_untagged_conversation_list_by_page-R",A_SET_TRANSLATION_LANGUAGE_T:"A-set_translation_language-T",A_SET_TRANSLATION_LANGUAGE_R:"A-set_translation_language-R",A_GET_TRANSLATION_LANGUAGE_T:"A-get_translation_language-T",A_GET_TRANSLATION_LANGUAGE_R:"A-get_translation_language-R",A_SET_AUTO_TRANSLATE_ENABLED_T:"A-set_auto_translate_enabled-T",A_SET_AUTO_TRANSLATE_ENABLED_R:"A-set_auto_translate_enabled-R",A_GET_AUTO_TRANSLATE_ENABLED_T:"A-get_auto_translate_enabled-T",A_GET_AUTO_TRANSLATE_ENABLED_R:"A-get_auto_translate_enabled-R",L_PULL_OFFLINE_MESSAGE_FINISHED_S:"L-pull_offline_message_finished-S",A_MODIFY_MESSAGE_WITH_PARAMS_T:"A-modify_msg_with_params-T",A_MODIFY_MESSAGE_WITH_PARAMS_R:"A-modify_msg_with_params-R",A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T:"A-refresh_refer_msg_with_params-T",A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R:"A-refresh_refer_msg_with_params-R",L_PULL_MODIFY_MSG_T:"L-pull_modify_msg-T",L_PULL_MODIFY_MSG_R:"L-pull_modify_msg-R",A_BATCH_DEL_CONVERS_T:"A-batch_del_conversation-T",A_BATCH_DEL_CONVERS_R:"A-batch_del_conversation-R",A_SYNC_REMOTE_CONVERSATIONS_T:"A-e_sync_remote_conversations-T",A_SYNC_REMOTE_CONVERSATIONS_R:"A-e_sync_remote_conversations-R",L_UPDATE_MSG_BOX_TIME_O:"L-update_msg_box_time-O",A_SEND_UG_TYPING_T:"A-send_ug_typing-T",A_SEND_UG_TYPING_R:"A-send_ug_typing-R",A_GET_UG_LIST_T:"A-get_ug_list-T",A_GET_UG_LIST_R:"A-get_ug_list-R",A_GET_UG_MSGS_BY_UID_T:"A-get_ug_msgs_by_uid-T",A_GET_UG_MSGS_BY_UID_R:"A-get_ug_msgs_by_uid-R",A_GET_UG_UNREAD_MENTIONED_DIGEST_T:"A-get_ug_unread_mentioned_digest-T",A_GET_UG_UNREAD_MENTIONED_DIGEST_R:"A-get_ug_unread_mentioned_digest-R",A_GET_HIS_MSGS_BY_OBJ_NAMES_T:"A-get_his_msgs_by_obj_names-T",A_GET_HIS_MSGS_BY_OBJ_NAMES_R:"A-get_his_msgs_by_obj_names-R",A_GET_CONTINUOUS_MSGS_T:"A-get_continuous_msgs-T",A_GET_CONTINUOUS_MSGS_R:"A-get_continuous_msgs-R",A_GET_MSGS_AROUND_TIMESTAMP_T:"A-get_msgs_around_timestamp-T",A_GET_MSGS_AROUND_TIMESTAMP_R:"A-get_msgs_around_timestamp-R",A_CLEAR_LOCAL_MSG_T:"A-clear_local_msg-T",A_CLEAR_LOCAL_MSG_R:"A-clear_local_msg-R",A_DEL_LOCAL_MSGS_BY_TIME_T:"A-del_local_msgs_by_time-T",A_DEL_LOCAL_MSGS_BY_TIME_R:"A-del_local_msgs_by_time-R",A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T:"A-batch_clear_local_msgs_by_time-T",A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R:"A-batch_clear_local_msgs_by_time-R",A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T:"A-del_local_ug_msgs_for_all_channel-T",A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R:"A-del_local_ug_msgs_for_all_channel-R",A_UPDATE_MSG_EXPANSION_T:"A-update_msg_expansion-T",A_UPDATE_MSG_EXPANSION_R:"A-update_msg_expansion-R",A_REMOVE_MSG_EXPANSION_T:"A-remove_msg_expansion-T",A_REMOVE_MSG_EXPANSION_R:"A-remove_msg_expansion-R",A_REMOVE_ALL_MSG_EXPANSION_T:"A-remove_all_msg_expansion-T",A_REMOVE_ALL_MSG_EXPANSION_R:"A-remove_all_msg_expansion-R",A_INSERT_MSG_T:"A-insert_msg-T",A_INSERT_MSG_R:"A-insert_msg-R",A_BATCH_INSERT_MSGS_T:"A-batch_insert_msgs-T",A_BATCH_INSERT_MSGS_R:"A-batch_insert_msgs-R",A_SET_MSG_CONTENT_T:"A-set_msg_content-T",A_SET_MSG_CONTENT_R:"A-set_msg_content-R",A_SET_UG_DEFAULT_NTF_LEVEL_T:"A-set_ug_default_ntf_level-T",A_SET_UG_DEFAULT_NTF_LEVEL_R:"A-set_ug_default_ntf_level-R",A_GET_UG_DEFAULT_NTF_LEVEL_T:"A-get_ug_default_ntf_level-T",A_GET_UG_DEFAULT_NTF_LEVEL_R:"A-get_ug_default_ntf_level-R",A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T:"A-get_ug_unread_count_for_all_channels-T",A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R:"A-get_ug_unread_count_for_all_channels-R",A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T:"A-get_total_unread_count_by_levels-T",A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R:"A-get_total_unread_count_by_levels-R",A_GET_TOTAL_UNREAD_COUNT_T:"A-get_total_unread_count-T",A_GET_TOTAL_UNREAD_COUNT_R:"A-get_total_unread_count-R",A_GET_FIRST_UNREAD_MEG_T:"A-get_first_unread_msg-T",A_GET_FIRST_UNREAD_MSG_R:"A-get_first_unread_msg-R",A_GET_FIRST_UNREAD_MSG_DIGEST_T:"A-get_first_unread_msg_digest-T",A_GET_FIRST_UNREAD_MSG_DIGEST_R:"A-get_first_unread_msg_digest-R",A_GET_UNREAD_MENTIONED_MSGS_T:"A-get_unread_mentioned_msgs-T",A_GET_UNREAD_MENTIONED_MSGS_R:"A-get_unread_mentioned_msgs-R",A_GET_UG_UNREAD_INFO_LIST_T:"A-get_ug_unread_info_list-T",A_GET_UG_UNREAD_INFO_LIST_R:"A-get_ug_unread_info_list-R",A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T:"A-get_ug_first_unread_msg_digest-T",A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R:"A-get_ug_first_unread_msg_digest-R",A_GET_LOCAL_MSG_COUNT_T:"A-get_local_msg_count-T",A_GET_LOCAL_MSG_COUNT_R:"A-get_local_msg_count-R",A_GET_CONVERSATIONS_T:"A-get_conversations-T",A_GET_CONVERSATIONS_R:"A-get_conversations-R",A_GET_BLOCKED_UG_LIST_T:"A-get_blocked_ug_list-T",A_GET_BLOCKED_UG_LIST_R:"A-get_blocked_ug_list-R",A_CLEAR_UNREAD_COUNT_T:"A-clear_unread_count-T",A_CLEAR_UNREAD_COUNT_R:"A-clear_unread_count-R",A_CLEAR_ALL_UNREAD_COUNT_T:"A-clear_all_unread_count-T",A_CLEAR_ALL_UNREAD_COUNT_R:"A-clear_all_unread_count-R",A_GET_TOP_CONVERSATION_LIST_T:"A-get_top_conversation_list-T",A_GET_TOP_CONVERSATION_LIST_R:"A-get_top_conversation_list-R",A_GET_UNREAD_CONVERSATION_LIST_T:"A-get_unread_conversation_list-T",A_GET_UNREAD_CONVERSATION_LIST_R:"A-get_unread_conversation_list-R",A_GET_BLOCKED_CONVERSATION_LIST_T:"A-get_blocked_conversation_list-T",A_GET_BLOCKED_CONVERSATION_LIST_R:"A-get_blocked_conversation_list-R",A_GET_ALL_CONVERSATION_LIST_T:"A-get_all_conversation_list-T",A_GET_ALL_CONVERSATION_LIST_R:"A-get_all_conversation_list-R",A_GET_CONVERSATION_LIST_BY_TIME_T:"A-get_conversation_list_by_time-T",A_GET_CONVERSATION_LIST_BY_TIME_R:"A-get_conversation_list_by_time-R",A_GET_CONVERSATION_LIST_OLD_T:"A-get_conversation_list_old-T",A_GET_CONVERSATION_LIST_OLD_R:"A-get_conversation_list_old-R",A_GET_UNREAD_MENTIONED_COUNT_T:"A-get_unread_mentioned_count-T",A_GET_UNREAD_MENTIONED_COUNT_R:"A-get_unread_mentioned_count-R",A_GET_ALL_UNREAD_MENTIONED_COUNT_T:"A-get_all_unread_mentioned_count-T",A_GET_ALL_UNREAD_MENTIONED_COUNT_R:"A-get_all_unread_mentioned_count-R",A_GET_REALTIME_CONVERSATIONS_T:"A-get_realtime_conversations-T",A_GET_REALTIME_CONVERSATIONS_R:"A-get_realtime_conversations-R",A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T:"A-get_realtime_con_total_unread_count-T",A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_R:"A-get_realtime_con_total_unread_count-R",A_CLEAR_REALTIME_CON_UNREAD_COUNT_T:"A-clear_realtime_con_unread_count-T",A_CLEAR_REALTIME_CON_UNREAD_COUNT_R:"A-clear_realtime_con_unread_count-R",A_REMOVE_REALTIME_CONVERSATIONS_T:"A-remove_realtime_conversations-T",A_REMOVE_REALTIME_CONVERSATIONS_R:"A-remove_realtime_conversations-R",A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T:"A-batch_get_realtime_con_unread_count-T",A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R:"A-batch_get_realtime_con_unread_count-R",A_GET_SUB_USERS_STATUS_T:"A-get_sub_users_status-T",A_GET_SUB_USERS_STATUS_R:"A-get_sub_users_status-R",A_GET_SUB_USERS_ONLINE_STATUS_T:"A-get_sub_users_online_status-T",A_GET_SUB_USERS_ONLINE_STATUS_R:"A-get_sub_users_online_status-R",A_SAVE_EDITED_MSG_DRAFT_T:"A-save_edited_msg_draft-T",A_SAVE_EDITED_MSG_DRAFT_R:"A-save_edited_msg_draft-R",A_GET_EDITED_MSG_DRAFT_T:"A-get_edited_msg_draft-T",A_GET_EDITED_MSG_DRAFT_R:"A-get_edited_msg_draft-R",A_CLEAR_EDITED_MSG_DRAFT_T:"A-clear_edited_msg_draft-T",A_CLEAR_EDITED_MSG_DRAFT_R:"A-clear_edited_msg_draft-R",A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T:"A-get_unread_mention_me_conversation_list-T",A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R:"A-get_unread_mention_me_conversation_list-R",A_GET_USER_PROFILES_T:"A-get_user_profiles-T",A_GET_USER_PROFILES_R:"A-get_user_profiles-R",A_ADD_TO_BLACKLIST_T:"A-add_to_blacklist-T",A_ADD_TO_BLACKLIST_R:"A-add_to_blacklist-R",A_REMOVE_FROM_BLACKLIST_T:"A-remove_from_blacklist-T",A_REMOVE_FROM_BLACKLIST_R:"A-remove_from_blacklist-R",A_GET_BLACKLIST_T:"A-get_blacklist-T",A_GET_BLACKLIST_R:"A-get_blacklist-R",A_GET_BLACKLIST_STATUS_T:"A-get_blacklist_status-T",A_GET_BLACKLIST_STATUS_R:"A-get_blacklist_status-R",A_E_SET_MSG_RECEIVED_STATUS_T:"A-e_set_msg_received_status-T",A_E_SET_MSG_RECEIVED_STATUS_R:"A-e_set_msg_received_status-R",A_E_SET_MSG_SENT_STATUS_T:"A-e_set_msg_sent_status-T",A_E_SET_MSG_SENT_STATUS_R:"A-e_set_msg_sent_status-R",A_E_SET_CHECK_DUPLICATE_MSG_T:"A-e_set_check_duplicate_msg-T",A_E_SET_CHECK_DUPLICATE_MSG_R:"A-e_set_check_duplicate_msg-R",A_SET_PROXY_T:"A-set_proxy-T",A_SET_PROXY_R:"A-set_proxy-R",A_GET_PROXY_T:"A-get_proxy-T",A_GET_PROXY_R:"A-get_proxy-R",A_TEST_PROXY_T:"A-test_proxy-T",A_TEST_PROXY_R:"A-test_proxy-R",A_CLEAR_UNREAD_COUNT_BY_TIME_T:"A-clear_unread_count_by_time-T",A_CLEAR_UNREAD_COUNT_BY_TIME_R:"A-clear_unread_count_by_time-R",A_GET_MSG_READER_T:"A-get_msg_reader-T",A_GET_MSG_READER_R:"A-get_msg_reader-R",A_SEND_READ_RECEIPT_V4_T:"A-send_read_receipt_v4-T",A_SEND_READ_RECEIPT_V4_R:"A-send_read_receipt_v4-R",A_GET_READ_RECEIPT_V4_T:"A-get_read_receipt_V4-T",A_GET_READ_RECEIPT_V4_R:"A-get_read_receipt_V4-R",A_BATCH_GET_READ_RECEIPT_INFO_V4_T:"A-batch_get_read_receipt_info_V4-T",A_BATCH_GET_READ_RECEIPT_INFO_V4_R:"A-batch_get_read_receipt_info_V4-R",A_GET_ALL_ROBOTS_T:"A-get_all_robots-T",A_GET_ALL_ROBOTS_R:"A-get_all_robots-R",A_GET_ROBOT_BY_ID_T:"A-get_robot_by_id-T",A_GET_ROBOT_BY_ID_R:"A-get_robot_by_id-R",A_ADD_FRIEND_T:"A-add_friend-T",A_ADD_FRIEND_R:"A-add_friend-R",A_DELETE_FRIENDS_T:"A-delete_friends-T",A_DELETE_FRIENDS_R:"A-delete_friends-R",A_ACCEPT_FRIEND_REQUEST_T:"A-accept_friend_request-T",A_ACCEPT_FRIEND_REQUEST_R:"A-accept_friend_request-R",A_REFUSE_FRIEND_REQUEST_T:"A-refuse_friend_request-T",A_REFUSE_FRIEND_REQUEST_R:"A-refuse_friend_request-R",A_SET_FRIEND_INFO_T:"A-set_friend_info-T",A_SET_FRIEND_INFO_R:"A-set_friend_info-R",A_CHECK_FRIENDS_T:"A-check_friends-T",A_CHECK_FRIENDS_R:"A-check_friends-R",A_GET_FRIENDS_T:"A-get_friends-T",A_GET_FRIENDS_R:"A-get_friends-R",A_GET_FRIEND_APPLICATIONS_T:"A-get_friend_applications-T",A_GET_FRIEND_APPLICATIONS_R:"A-get_friend_applications-R",A_GET_FRIENDS_INFO_T:"A-get_friends_info-T",A_GET_FRIENDS_INFO_R:"A-get_friends_info-R",A_SEARCH_FRIENDS_INFO_T:"A-search_friends_info-T",A_SEARCH_FRIENDS_INFO_R:"A-search_friends_info-R",A_SET_FRIEND_ADD_PERMISSION_T:"A-set_friend_add_permission-T",A_SET_FRIEND_ADD_PERMISSION_R:"A-set_friend_add_permission-R",A_GET_FRIEND_ADD_PERMISSION_T:"A-get_friend_add_permission-T",A_GET_FRIEND_ADD_PERMISSION_R:"A-get_friend_add_permission-R",A_CREATE_GROUP_T:"A-create_group-T",A_CREATE_GROUP_R:"A-create_group-R",A_UPDATE_GROUP_INFO_T:"A-update_group_info-T",A_UPDATE_GROUP_INFO_R:"A-update_group_info-R",A_GET_GROUPS_INFO_T:"A-get_groups_info-T",A_GET_GROUPS_INFO_R:"A-get_groups_info-R",A_KICK_GROUP_MEMBERS_T:"A-kick_group_members-T",A_KICK_GROUP_MEMBERS_R:"A-kick_group_members-R",A_QUIT_GROUP_T:"A-quit_group-T",A_QUIT_GROUP_R:"A-quit_group-R",A_DISMISS_GROUP_T:"A-dismiss_group-T",A_DISMISS_GROUP_R:"A-dismiss_group-R",A_TRANSFER_GROUP_OWNER_T:"A-transfer_group_owner-T",A_TRANSFER_GROUP_OWNER_R:"A-transfer_group_owner-R",A_ADD_GROUP_MANAGERS_T:"A-add_group_managers-T",A_ADD_GROUP_MANAGERS_R:"A-add_group_managers-R",A_REMOVE_GROUP_MANAGERS_T:"A-remove_group_managers-T",A_REMOVE_GROUP_MANAGERS_R:"A-remove_group_managers-R",A_GET_GROUP_MEMBERS_T:"A-get_group_members-T",A_GET_GROUP_MEMBERS_R:"A-get_group_members-R",A_SET_GROUP_MEMBER_INFO_T:"A-set_group_member_info-T",A_SET_GROUP_MEMBER_INFO_R:"A-set_group_member_info-R",A_SEARCH_GROUP_MEMBERS_T:"A-search_group_members-T",A_SEARCH_GROUP_MEMBERS_R:"A-search_group_members-R",A_JOIN_GROUP_T:"A-join_group-T",A_JOIN_GROUP_R:"A-join_group-R",A_INVITE_USERS_TO_GROUP_T:"A-invite_users_to_group-T",A_INVITE_USERS_TO_GROUP_R:"A-invite_users_to_group-R",A_ADD_GROUP_FOLLOWS_T:"A-add_group_follows-T",A_ADD_GROUP_FOLLOWS_R:"A-add_group_follows-R",A_REMOVE_GROUP_FOLLOWS_T:"A-remove_group_follows-T",A_REMOVE_GROUP_FOLLOWS_R:"A-remove_group_follows-R",A_GET_GROUP_FOLLOWS_T:"A-get_group_follows-T",A_GET_GROUP_FOLLOWS_R:"A-get_group_follows-R",A_SET_GROUP_REMARK_T:"A-set_group_remark-T",A_SET_GROUP_REMARK_R:"A-set_group_remark-R",A_GET_GROUP_MEMBERS_BY_ROLE_T:"A-get_group_members_by_role-T",A_GET_GROUP_MEMBERS_BY_ROLE_R:"A-get_group_members_by_role-R",A_ACCEPT_GROUP_INVITE_T:"A-accept_group_invite-T",A_ACCEPT_GROUP_INVITE_R:"A-accept_group_invite-R",A_REFUSE_GROUP_INVITE_T:"A-refuse_group_invite-T",A_REFUSE_GROUP_INVITE_R:"A-refuse_group_invite-R",A_ACCEPT_GROUP_APPLICATION_T:"A-accept_group_application-T",A_ACCEPT_GROUP_APPLICATION_R:"A-accept_group_application-R",A_REFUSE_GROUP_APPLICATION_T:"A-refuse_group_application-T",A_REFUSE_GROUP_APPLICATION_R:"A-refuse_group_application-R",A_GET_GROUP_APPLICATIONS_T:"A-get_group_applications-T",A_GET_GROUP_APPLICATIONS_R:"A-get_group_applications-R",A_GET_JOINED_GROUPS_BY_ROLES_T:"A-get_joined_groups_by_roles-T",A_GET_JOINED_GROUPS_BY_ROLES_R:"A-get_joined_groups_by_roles-R",A_SEARCH_JOINED_GROUPS_T:"A-search_joined_groups-T",A_SEARCH_JOINED_GROUPS_R:"A-search_joined_groups-R",A_GET_JOINED_GROUPS_T:"A-get_joined_groups-T",A_GET_JOINED_GROUPS_R:"A-get_joined_groups-R",A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T:"A-search_user_profile_by_unique_id-T",A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R:"A-search_user_profile_by_unique_id-R",A_UPDATE_MY_USER_PROFILE_VISIBILITY_T:"A-update_my_user_profile_visibility-T",A_UPDATE_MY_USER_PROFILE_VISIBILITY_R:"A-update_my_user_profile_visibility-R",A_GET_MY_USER_PROFILE_VISIBILITY_T:"A-get_my_user_profile_visibility-T",A_GET_MY_USER_PROFILE_VISIBILITY_R:"A-get_my_user_profile_visibility-R",A_SUBSCRIBE_USER_STATUS_T:"A-subscribe_user_status-T",A_SUBSCRIBE_USER_STATUS_R:"A-subscribe_user_status-R",A_UNSUBSCRIBE_USER_STATUS_T:"A-unsubscribe_user_status-T",A_UNSUBSCRIBE_USER_STATUS_R:"A-unsubscribe_user_status-R",A_GET_SUBSCRIBE_USER_STATUS_LIST_T:"A-get_subscribe_user_status_list-T",A_GET_SUBSCRIBE_USER_STATUS_LIST_R:"A-get_subscribe_user_status_list-R",A_GET_MY_USER_PROFILE_T:"A-get_my_user_profile-T",A_GET_MY_USER_PROFILE_R:"A-get_my_user_profile-R",A_UPDATE_MY_USER_PROFILE_T:"A-update_my_user_profile-T",A_UPDATE_MY_USER_PROFILE_R:"A-update_my_user_profile-R",A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T:"A-get_conversations_including_robots-T",A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R:"A-get_conversations_including_robots-R",L_PULL_SG_UNREAD_COUNT_T:"L-pull_sg_unread_count-T",L_PULL_SG_UNREAD_COUNT_R:"L-pull_sg_unread_count-R",A_MARK_REMOTE_CONVERSATION_AS_READ_T:"A-mark_remote_conversation_as_read-T",A_MARK_REMOTE_CONVERSATION_AS_READ_R:"A-mark_remote_conversation_as_read-R"};!function(e){e[e.BOTH=2]="BOTH"}(f||(f={})),function(e){e[e.BOTH=2]="BOTH"}(d||(d={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(_||(_={})),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"}(h||(h={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(g||(g={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(p||(p={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(b||(b={})),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"}(E||(E={})),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"}(I||(I={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(T||(T={})),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"}(v||(v={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(R||(R={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(m||(m={})),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"}(y||(y={})),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"}(A||(A={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(O||(O={})),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"}(S||(S={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(N||(N={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}(C||(C={})),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"}(P||(P={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(M||(M={})),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"}(L||(L={})),function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(w||(w={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(U||(U={})),function(e){e[e.LeaveOnMyOwn=0]="LeaveOnMyOwn",e[e.OtherDeviceLogin=1]="OtherDeviceLogin"}(D||(D={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(G||(G={})),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"}(V||(V={})),function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}(j||(j={})),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.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_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.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",e[e.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",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_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_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.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.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.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.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"}(k||(k={})),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"}(x||(x={}));var B,H,Y,W=0,J=1,q=2,K=3,Q=4,X=5,Z=6,z=7,$=function(e){var t=[x.PRIVATE,x.GROUP,x.SYSTEM,x.PUBLIC_SERVICE,x.APP_PUBLIC_SERVICE];switch(e){case W:return t;case J:return[x.PRIVATE,x.GROUP];case q:return u(u([],s(t),!1),[x.ULTRA_GROUP],!1);case K:return u(u([],s(t),!1),[x.ULTRA_GROUP,x.CHATROOM],!1);case Q:return u(u([],s(t),!1),[x.ULTRA_GROUP,x.CHATROOM,x.RTC_ROOM,x.CUSTOMER_SERVICE,x.DISCUSSION],!1);case X:return[x.PRIVATE,x.GROUP,x.ULTRA_GROUP];case Z:return[x.GROUP];case z:return[x.PRIVATE]}},ee=function(e,t){return $(t).includes(e)};!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"}(B||(B={})),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"}(H||(H={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(Y||(Y={}));var te,re,ne,ie,ae,oe,se,ue,le,ce,fe,de,_e,he,ge,pe,be,Ee,Ie,Te,ve,Re={TextMessage:"RC:TxtMsg",TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL:"RC:RcCmd",RECALL_MESSAGE_TYPE:"RC:RcCmd",RECALL_NOTIFICATION_MESSAGE:"RC:RcNtf",READ_RECEIPT:"RC:ReadNtf",READ_RECEIPT_REQUEST:"RC:RRReqMsg",READ_RECEIPT_RESPONSE:"RC:RRRspMsg",SYNC_READ_STATUS:"RC:SRSMsg",GROUP_READ_RECEIPT_REQUEST:"RC:RRMsg",READ_STATE:"RC:RSMsg",DELIVERED:"RC:Delivered",DELIVERED_MSG:"RC:DRMsg",CHATROOM_MERGE_CHANGE:"RC:ChrmMemChange",CHATROOM_SYNC_MSG:"RC:ChrmSyncMsg",CHATROOM_MERGE_BLOCK:"RC:ChrmBlockMsg",CHATROOM_MERGE_BAN:"RC:ChrmBanMsg",TYPING_STATUS:"RC:TypSts",INTERCEPT:"RC:InterceptMsg",CLOUD_CONTROL:"RC:CCConfigChangeRequestMsg",STREAM_MESSAGE:"RC:StreamMsg"};!function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(te||(te={})),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"}(re||(re={})),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"}(ne||(ne={})),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"}(ie||(ie={})),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"}(ae||(ae={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(oe||(oe={})),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"}(se||(se={})),function(e){e[e.typing=0]="typing"}(ue||(ue={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(le||(le={})),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"}(ce||(ce={})),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"}(fe||(fe={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(de||(de={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(_e||(_e={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(he||(he={})),function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(ge||(ge={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(pe||(pe={})),function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(be||(be={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(Ee||(Ee={})),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"}(Ie||(Ie={})),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"}(Te||(Te={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(ve||(ve={}));var me,ye,Ae,Oe,Se,Ne,Ce,Pe,Me,Le=function(e){return e===ve.OPEN?Te.AT_MESSAGE_NOTIFICATION:Te.NOT_SET},we=function(e){return e<=Te.NOT_SET?ve.CLOSE:ve.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"}(me||(me={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(ye||(ye={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(Ae||(Ae={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Oe||(Oe={})),function(e){e[e.CURRENT=2]="CURRENT"}(Se||(Se={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(Ne||(Ne={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(Ce||(Ce={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(Pe||(Pe={})),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"}(Me||(Me={}));var Ue,De,Ge={ALL:0,EXCLUDE_ROBOT:1,ROBOT_ONLY:2},Ve={DISALLOW:0,ALLOW:1},je={NOT_CONVERTED:0,CONVERTING:1,SUCCESS:2,FAILED:3},ke={NORMAL:0,ROBOT:1},xe={UNKNOWN:-1,V1:0,V2:1,V4:3,V5:4};!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"}(Ue||(Ue={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(De||(De={}));var Fe=72e5,Be=6e4,He=131072,Ye="5.36.0-alpha.1".replace(/-.+$/,""),We=5368709120,Je=10485760,qe="rongcloudsystem",Ke=864e5,Qe="RCDeviceId",Xe=function(e){return"navi_".concat(e)},Ze=function(e,t){return"RC-con-stat-ver-".concat(e,"-").concat(t)},ze=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},$e=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},et=function(e,t){return"RC-con-type-settings-".concat(e,"-").concat(t)},rt=function(e,t){return"outbox_".concat(e,"_").concat(t)},nt=function(e,t){return"inbox_".concat(e,"_").concat(t)},it=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},at=function(e,t){return"send_msg_".concat(e,"_").concat(t)},ot=function(e,t){return"RC-us-".concat(e,"-").concat(t)},st=function(e){return"rc-static-config-".concat(e)},ut=function(e){return"RC-cc-".concat(e)},lt=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},ct=function(e){return"RC-LI-".concat(e)},ft=Math.pow(2,31)-1,dt="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};dt.engine="5.36.0-alpha.1";var _t=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)&&(dt[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 dt.engine.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 dt}}),e}();var ht={gen: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)}))},genWithLen:function(e){void 0===e&&(e=22);var t,r=Date.now(),n=r.toString(36),i=Math.floor(Math.random()*r).toString(36),a=e-n.length-i.length;return[i,n,a>0?(t=a,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},gt=ht.genWithLen(22),pt=Date.now(),bt=function(e){return"string"==typeof e},Et=function(e){return"boolean"==typeof e},It=function(e){return"number"==typeof e&&!Number.isNaN(e)},Tt=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},vt=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},Rt=function(e){return function(t){return bt(t)&&(void 0===e.isTrim||0===t.length||t.trim().length>0)&&(void 0===e.minLength||t.length>=e.minLength)&&(void 0===e.maxLength||t.length<=e.maxLength)&&(void 0===e.validator||e.validator(t))}},mt=function(e){return bt(e)&&e.length>0},yt=function(e){return vt(e)&&e.length>0},At=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Ot=function(e){return"function"==typeof e},St=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},Nt=function(e){return bt(e)&&/https?:\/\//.test(e)},Ct=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},Pt=function(e){return It(e)&&Object.prototype.hasOwnProperty.call(x,e)},Mt=function(e){return It(e)&&Object.prototype.hasOwnProperty.call(Te,e)},Lt=function(e){var t=!1;return bt(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},wt=function(e){return Object.values(e.type).includes(e.value)},Ut=function(e){return Rt({minLength:1,maxLength:64})(e)},Dt=function(e){return Rt({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},Gt=function(e){return It(e)&&Object.prototype.hasOwnProperty.call(H,e)},Vt=function(){return void 0!==window.__RCCppContextBridge__},jt=function(e){return{isRead:(e&me.READ)===me.READ,isListened:(e&me.LISTENED)===me.LISTENED,isDownload:(e&me.DOWNLOADED)===me.DOWNLOADED,isRetrieved:(e&me.RETRIEVED)===me.RETRIEVED}},kt=function(e){var t=me.UNREAD;return(null==e?void 0:e.isRead)&&(t|=me.READ),(null==e?void 0:e.isListened)&&(t|=me.LISTENED),(null==e?void 0:e.isDownload)&&(t|=me.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=me.RETRIEVED),t},xt=function(e){return[ce.iOS,ce.Android,ce.Web,ce.PC,ce.Mini,ce.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]}))},Ft=function(e,t,r){var n=t.reduce((function(e,t){return["gender","role","level"].includes(t.key)?e[t.key]=Number(t.value):e[t.key]=t.value,e}),{});return n.userId=e,r.forEach((function(e){n.extraProfile=n.extraProfile||{},n.extraProfile[e.key]=e.value})),n},Bt=function(e,t,r){return t?1===r?B.TLS:B.RMTP:"http"===e?B.WS:B.WSS},Ht=function(e,t){var r=e.server,n=e.backupServer,i=e.bs,a=e.serverAddr,o=e.protocol,l=e.openTLS;if(a)return u([],s(a.filter((function(e){return e.addr}))),!1);var c=[],f=[];return r&&f.push(r),(n||i||"").split(",").forEach((function(e){f.indexOf(e)<0&&f.push(e)})),f.forEach((function(e,n){e&&c.push({addr:e,protocol:Bt(o,t,l),weight:r.length-n,race:!1})})),u([],s(c),!1)},Yt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Kt(e.settingProfile),r=e.extProfile||[],i=e.targetId,a=e.baseInfo,o=e.userInfo;return JSON.parse(JSON.stringify(n(n({groupId:i},Jt(t)),{extProfile:r.length>0?Kt(r):void 0,creatorId:null==a?void 0:a.creatorId,ownerId:null==a?void 0:a.ownerId,createTime:null==a?void 0:a.createTime,membersCount:null==a?void 0:a.memberCount,remark:null==o?void 0:o.remarkName})))}))},Wt=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},Jt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Wt(e.joinPerm),removeMemberPermission:Wt(e.removePerm),invitePermission:Wt(e.memInvitePerm),inviteHandlePermission:Wt(e.invitePerm),groupInfoEditPermission:Wt(e.profilePerm),memberInfoEditPermission:Wt(e.memProfilePerm)}))},qt=function(e){return void 0===e&&(e=[]),e.map(Qt)},Kt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Qt=function(e){var t=e.userId,r=e.name,n=e.portraitUrl,i=e.ext||{},a=i.role,o=i.joinTime,s=i.channelNickName,u=i.additional,l=i.isBot;return{userId:t,name:r||"",portraitUri:n||"",nickname:s||"",extra:u||"",role:a||m.UNDEF,joinedTime:o||0,isRobot:!!l}},Xt=function(e){var t=e.joinUserInfo,r=e.inviterInfo,n=e.processInfo;return{groupId:e.targetId,joinMemberInfo:Qt(t),inviterInfo:r&&r.userId?Qt(r):void 0,operatorInfo:n&&n.userId?Qt(n):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},Zt=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},zt=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};function $t(e){for(var t=null===window||void 0===window?void 0:window.atob(e),r=new Uint8Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r.buffer}var er,tr=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=ht.gen(),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)}(),a=(new Date).getTime(),o="";if(t){var s=t.split(".");o=".".concat(s[s.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(r,"_").concat(a).concat(n).concat(o)},rr=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.channelIdMi,i=t.channelIdHW,a=t.channelIdOPPO,o=t.typeVivo,s=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,f=t.importanceHonor,d=t.imageUrlHonor,_=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var r=e.threadId,n=e.apnsCollapseId,i=e.category,a=e.richMediaUri,o=e.interruptionLevel,s=t.googleConfig,u={};u["thread-id"]=r||"",u["apns-collapse-id"]=n||"",u.category=i||"",u.richMediaUri=a||"",u["interruption-level"]=o||"active";var l={};l.collapse_key=null==s?void 0:s.collapseKey,l.imageUrl=null==s?void 0:s.imageUrl;var c=null==s?void 0:s.priority;return c&&!["high","normal"].includes(c)&&(c="normal"),l.priority=c,{APNS:u,FCM:l}}(e,t),h=[{HW:{channelId:i||"",importance:s||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:a||""}},{VIVO:{classification:o||"",category:c||""}},{APNS:_.APNS},{FCM:_.FCM},{HONOR:{importance:f||Ee.NORMAL,image:d||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(h)},nr=function(e,t){var r={},n={notificationId:t||""},i={};if(!e)return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i};try{var a=JSON.parse(e);null==a||a.forEach((function(e){var t,a,o,s,u,l,c,f,d,_,h,g,p=Object.keys(e);if(0!==p.length){var b=p[0];switch(b){case"HW":return n.channelIdHW=null===(t=e[b])||void 0===t?void 0:t.channelId,n.importanceHW=null===(a=e[b])||void 0===a?void 0:a.importance,n.imageUrlHW=null===(o=e[b])||void 0===o?void 0:o.image,void(n.categoryHW=null===(s=e[b])||void 0===s?void 0:s.category);case"MI":return void(n.channelIdMi=null===(u=e[b])||void 0===u?void 0:u.channelId);case"OPPO":return void(n.channelIdOPPO=null===(l=e[b])||void 0===l?void 0:l.channelId);case"VIVO":return n.typeVivo=null===(c=e[b])||void 0===c?void 0:c.classification,void(n.categoryVivo=null===(f=e[b])||void 0===f?void 0:f.category);case"APNS":return r.threadId=e[b]["thread-id"],r.apnsCollapseId=e[b]["apns-collapse-id"],r.category=e[b].category,r.richMediaUri=e[b].richMediaUri,void(r.interruptionLevel=e[b]["interruption-level"]);case"FCM":return void(n.googleConfig={collapseKey:e[b].collapse_key||"",imageUrl:e[b].imageUrl||"",priority:e[b].priority||""});case"HONOR":return n.importanceHonor=null===(d=e[b])||void 0===d?void 0:d.importance,void(n.imageUrlHonor=null===(_=e[b])||void 0===_?void 0:_.image);case"OHOS":i.category=null===(h=e[b])||void 0===h?void 0:h.category,i.image=null===(g=e[b])||void 0===g?void 0:g.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}},ir=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),r=e.length;return t&&(r<=128&&r>=1)},ar=function(e){var t=e.length;return t<=4096&&t>=1},or=(er=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),r=e+er.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return er=2047&++er,parseInt(r,2)}),sr=function(){var e=_t.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t},ur=function(e,t,r){return i(void 0,void 0,void 0,(function(){var n,i;return a(this,(function(a){switch(a.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return n=a.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(r)},n,$t(e))];case 2:return i=a.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function lr(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!==B.HTTP||n?"https://".concat(e):"http://".concat(e)}var cr=function(e,t){if(!e)return"";var r=e.ossConfig,n=void 0===r?"":r,i="";try{var a=JSON.parse(n);if(a.length>0){var o=a.find((function(e){return e.minio}));o&&(i=o.minio)}}catch(e){t.warn(F.L_PARSE_JSON_E,JSON.stringify({ossConfig:n,error:e}))}return i};var fr,dr=function(e,t){return t&&0!==t.length?[x.GROUP,x.ULTRA_GROUP,x.APP_PUBLIC_SERVICE,x.PUBLIC_SERVICE].includes(e)?t:[]:t||[]},_r=function(e){function r(t){var r=e.call(this,t)||this;return r.name="RCError",r}return t(r,e),Object.defineProperty(r,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new r("Invalid parameter -> ".concat(e)):new r("Invalid parameters.")}}),Object.defineProperty(r,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new r("Wrong parameter type")}}),r}(Error),hr=function(){function e(){fr.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,fr,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return l(this,fr,"f")},enumerable:!1,configurable:!0}),e}();fr=new WeakMap;var gr=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 a=Symbol(),o=this._map.get(e)||this._map.set(e,[]).get(e),s={symbol:a,priority:Math.min(i,100),listener:t.bind(n),once:r},u=o.findIndex((function(e){return e.priority>i}));return-1===u?o.push(s):o.splice(u,0,s),a}}),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=o(this._map),i=n.next();!i.done;i=n.next()){var a=s(i.value,2),u=(a[0],a[1]),l=u.findIndex((function(t){return t.symbol===e}));if(-1!==l)return void u.splice(l,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,a=0;a<n.length;a+=1){var o=n[a],l=o.once,c=o.listener;l&&n.splice(a,1);try{c.apply(void 0,u([i],s(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}u([],s(this._piped.entries()),!1).forEach((function(r){var n=s(r,2),i=n[0],a=n[1];(0===a.length||a.includes(e))&&i.emit.apply(i,u([e],s(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}(),pr=function(e){function r(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}return t(r,e),Object.defineProperty(r.prototype,"length",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(r.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(r.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e<this._dataVersion||(this._versionQueue.push(e),-1!==this._dataVersion&&this._execPulling())}}),Object.defineProperty(r.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r,n,i,o;return a(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=u([],s(o),!1),this._dataVersion=n,i?[2,this._execPulling()]:this._versionQueue.length>0?(this._versionQueue.length=0,[2,this._execPulling()]):[2]}}))}))}}),Object.defineProperty(r.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(r.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(r.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}}),r}(gr),br=function(){function e(e,t){var r=this;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,"_onCancel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._promise=new Promise((function(t){r._resolve=t,e(r._onResolve.bind(r))})),this._onCancel=t}return Object.defineProperty(e.prototype,"_onResolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._resolve(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),Object.defineProperty(e.prototype,"abort",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._onCancel(this._onResolve.bind(this))}}),e}(),Er=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.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(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 i(this,void 0,void 0,(function(){return a(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?Ir(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?Ir(void 0,this.msg):Tr(this.code,this.msg)}}),e}(),Ir=function(e,t){return new Er(0,t||"success",e)},Tr=function(e,t,r){return new Er(e,t||"fail: ".concat(e),r)},vr=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})}return 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?Tr(this._code,this._errmsg):Ir()}}),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 _r.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,a){return void 0===i&&(i=!1),void 0===a&&(a=1),this.isLimitedArray(e,t,r,i,a).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,a){return void 0===i&&(i=!1),void 0===a&&(a=1),this.assertLimitedArray(e,t,r,i,a),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)}}),e}(),Rr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function mr(e){var t,r,n,i,a,o,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=Rr.indexOf(e.charAt(u++))<<2|(i=Rr.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(a=Rr.indexOf(e.charAt(u++)))>>2,n=(3&a)<<6|(o=Rr.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==a&&(s+=String.fromCharCode(r)),64!==o&&(s+=String.fromCharCode(n));return s}var yr,Ar=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},Or=1732584193,Sr=4023233417,Nr=2562383102,Cr=271733878,Pr=[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],Mr=[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 Lr(e,t){return e<<t|e>>>32-t}function wr(e,t,r){return e&r|t&~r}function Ur(e,t,r){return e^t^r}function Dr(e,t,r){return t^(e|~r)}function Gr(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 Vr(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 jr(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 a=new Uint8Array(8),o=4294967295&t,s=4294967295&Math.floor(t/4294967296);a.set(Vr(o),0),a.set(Vr(s),4),n.set(a,e.length+r);var u,l=Or,c=Sr,f=Nr,d=Cr;for(i=0;i<n.length;i+=64){for(var _=Gr(n.slice(i,i+64)),h=l,g=c,p=f,b=d,E=0;E<64;E++){var I=void 0,T=void 0;E<16?(I=(u=c)&f|~u&d,T=E):E<32?(I=wr(c,f,d),T=(5*E+1)%16):E<48?(I=Ur(c,f,d),T=(3*E+5)%16):(I=Dr(c,f,d),T=7*E%16);var v=d;d=f,f=c,c+=Lr(l+I+Mr[E]+_[T]&4294967295,Pr[E]),l=v}l=l+h&4294967295,c=c+g&4294967295,f=f+p&4294967295,d=d+b&4294967295}var R=new Uint8Array(16);return R.set(Vr(l),0),R.set(Vr(c),4),R.set(Vr(f),8),R.set(Vr(d),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(R)}function kr(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 jr(t)}function xr(e){var t=e.method||De.GET,r=e.timeout||Be,n=e.headers,i=e.query,a=e.body,o=e.onProgress,s=zt(e.url,i),u=new XMLHttpRequest;if(u.open(t,s),n&&u.setRequestHeader)for(var l in n)u.setRequestHeader(l,n[l]);return function(e,t,r,n){return new br((function(i){e.onreadystatechange=function(){4===e.readyState&&i({data:e.responseText,status:e.status,xhr:e})},e.onerror=function(){i({status:e.status})},n&&(e.upload.onprogress=function(e){return n(e)}),0!==t&&setTimeout((function(){e.abort(),i({status:e.status})}),t),e.send(r)}),(function(t){e.abort(),t({status:-1})}))}(u,r,a,o)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(yr||(yr={}));var Fr,Br,Hr=0,Yr={DEFAULT:0,MODIFIED:1,RECALLED:2,DELETE:3},Wr={TranslationLanguage:0,AutoTranslateEnable: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"}(Br||(Br={}));var Jr=((Fr={})[Br.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:B.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},Fr[Br.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:B.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},Fr[Br.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:B.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},Fr[Br.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:B.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},Fr[Br.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:B.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},Fr[Br.OM]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5vbS1saWdodC1lZGdlLmNvbQ==","bmF2LWIub20tbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ub20tbGlnaHQtZWRnZS5jb20=",protocol:B.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLm9tLWxpZ2h0LWVkZ2UuY29t","d3MtYi5vbS1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5vbS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIub20tbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9kdWFsc3RhY2stc3RhdHMub20tbGlnaHQtZWRnZS5jb20="]},Fr);function qr(e){return Br[e]?e:Br.BJ}var Kr,Qr=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,a=n.navigators,o=(r=i,void 0===r&&(r=Br.BJ),Jr[qr(r)].naviUrlBase64).map((function(e){return mr(e)})),l=[],c=s(e.split("@"),2)[1];t&&(l=c?c.split(";"):[]);var f=a&&a.length>0?u(u([],s(l),!1),s(a),!1):u(u([],s(l),!1),s(o),!1);return f.filter((function(e,t){return f.indexOf(e)===t})).map((function(e){return lr(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,i=e||{},a=i.log,o=i.logPolicy,l=this.initOption||{},c=l.areaCode,f=l.logServerUrl,d=(r=c,void 0===r&&(r=Br.BJ),Jr[qr(r)].logUrlBase64).map((function(e){return n(n({},e),{addr:mr(e.addr)})})),_=[],h={level:1,itv:6,times:5};if(a)_.push.apply(_,u([],s(a.addrs),!1)),Object.assign(h,a.policy);else if(o)try{var g=JSON.parse(o);_.push({addr:g.url,protocol:B.HTTPS,weight:1}),h.level=g.level,h.itv=g.itv,h.times=g.times}catch(r){t.warn(F.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var p=f?u([{addr:f,protocol:B.HTTPS,weight:101}],s(_),!1):u(u([],s(_),!1),s(d),!1);return{policy:h,addrs:p.filter((function(e,t){return p.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return n(n({},e),{addr:lr(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=Br.BJ),Jr[qr(t)].miniCmpBase64).map((function(e){return mr(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=Br.BJ),Jr[qr(t)].staticConfigUrlBase64).map((function(e){return mr(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=Br.BJ),Jr[qr(r)].cloudControllerUrlBase64).map((function(e){return mr(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:Br.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!Br[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,a=n.activeServer,o=(null==i?void 0:i.addrs)||[],l=(r=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===r&&(r=Br.BJ),Jr[qr(r)].statsUrlBase64).map((function(e){return mr(e)})),c=[];return 0!==o.length?c.push.apply(c,u([],s(o.sort((function(e,t){return t.weight-e.weight})).map((function(e){return lr(e.addr,e.protocol)}))),!1)):a&&c.push(lr(a,B.HTTPS)),l.forEach((function(e){c.includes(e)||c.push(e)})),c}}),e}(),Xr=new Qr,Zr=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 i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:if(!(t=this.getCache()))return[3,6];a.label=1;case 1:return a.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=a.sent(),(i=n.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return lr(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=a.sent(),this.logger.error(F.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),a.label=6;case 6:return[4,this._requestHandle()];case 7:return(s=a.sent())?[4,this.decryptData(s)]:[2];case 8:return(null==(u=a.sent())?void 0:u.areaCode)!==Xr.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==u?void 0:u.bootstrap)||[],(l=null===(e=null==u?void 0:u.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:l.map((function(e){return lr(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r,n,i,l,c,f,d,_,h;return a(this,(function(a){switch(a.label){case 0:e=(e=u(u([],s(this.staticUrls),!1),s(Xr.getStaticConfigUrl()),!1).map((function(e){return lr(e)}))).filter((function(t,r){return e.indexOf(t)===r})),a.label=1;case 1:a.trys.push([1,6,7,8]),t=o(e),r=t.next(),a.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(F.L_GET_STATIC_CONF_T,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(l=a.sent(),c=l.code,f=l.data,200===c)return this.logger.info(F.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),[2,f];this.logger.warn(F.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),a.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return d=a.sent(),_={error:d},[3,8];case 7:try{r&&!r.done&&(h=t.return)&&h.call(t)}finally{if(_)throw _.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"}(Kr||(Kr={}));var zr,$r,en=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:Kr.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kr.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kr.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kr.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kr.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,Kr.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!==Kr.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 gt}}),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,a=e.level,o=e.loggerId;if(console&&!(a<=Kr.FATAL||a>this.outputLevel)){var s=["error","warn","info","debug"][a-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=o?o: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[Kr.DEBUG,Kr.INFO,Kr.WARN,Kr.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,i,a,o){if(void 0===i&&(i={}),t.isOk){var s=null==a?void 0:a(t.data);this.info(e,JSON.stringify(n(n({isOk:!0},i),s)),r)}else{s=null==o?void 0:o(t.data);this.warn(e,JSON.stringify(n(n({code:t.code,msg:t.msg},i),s)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),tn=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,o,s){return i(this,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:i=[],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.logDB.read(e,t,r,n,s)];case 2:return o=a.sent(),vt(o.logs)&&(i=o.logs.filter((function(e){return!(!e||"object"!=typeof e)}))),[3,4];case 3:return a.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 i(this,void 0,void 0,(function(){var r,n,i;return a(this,(function(a){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=Xr.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 i(this,void 0,void 0,(function(){var i,o,s,u,l,c,f,d,_,h;return a(this,(function(a){switch(a.label){case 0:return[4,this.compressLogs(e)];case 1:return i=a.sent(),o=i.success,s=i.data,o?(u=Nt(r)?r:"https://".concat(r),u+="?version=".concat("5.36.0-alpha.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.getDeviceId(),"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:u,body:s,method:"POST"})]):[2,{isOk:!1,itv:n}];case 2:if(l=a.sent(),c=l.status,f=l.data,200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(n+=n),this.reportFailedNumber++,[2,{isOk:!1,itv:n}];if(this.reportFailedNumber=0,f)try{(h=JSON.parse(f)).nextTime&&(n=h.nextTime),d=h.level,_=h.logSwitch}catch(e){this.logger.warn(F.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:d,logSwitch:_}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,l,c,f,d,_,h,g,p,b=this;return a(this,(function(a){switch(a.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||pt,l=Math.max(i-3e4,o+1),c=this.logger.createTraceId(),[4,this._getLogs(o,l,t,!0,c,n)];case 1:return 0!==(f=a.sent().logs).length?[3,2]:[3,4];case 2:return f.length>0?[4,this._sendLogs2Realtime(f,c,e,r)]:[3,4];case 3:d=a.sent(),_=d.itv,h=d.level,g=d.logSwitch,d.isOk&&(p=Math.max.apply(Math,u([],s(f.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(p+1),0===g&&(this.started=!1),void 0!==h&&(t=h)),r=_,a.label=4;case 4:return this.started&&(r>=60&&this.itvByNavi<60&&(r=60),this.timer=setTimeout((function(){return b.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,o,s,u){return void 0===u&&(u=!1),i(this,void 0,void 0,(function(){var i,l,c,f,d,_,h,g;return a(this,(function(a){switch(a.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(i=this.logger.createTraceId(),this.logger.info(F.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:o,messageUId:s,isCloudControl:u}),i),[4,this._getLogs(e,t,Kr.DEBUG,!1,i)]);case 1:return l=a.sent().logs,this.logger.info(F.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),i),c=Nt(n)?n:"https://".concat(n),c+="?version=".concat("5.36.0-alpha.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.getDeviceId(),"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(o),l.length>0?[4,this.compressLogs(l)]:[3,3];case 2:return d=a.sent(),_=d.success,h=d.data,f=_?h:"compress failed",[3,4];case 3:f="no data or no database",a.label=4;case 4:return this.logger.debug(F.L_REPORT_FULL_LOG_O,"compress done",i),u&&(c+="&source=cloud"),[4,this.send({url:c,body:f,method:"POST"})];case 5:return g=a.sent().status,this.logger.info(F.L_REPORT_FULL_LOG_R,JSON.stringify({status:g}),i),[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}(),rn=function(e){var t=e.sessionId,r=e.level,n=e.loggerId,i=e.traceId,a=e.time,o=e.tag,s=e.type,u=e.content;bt(u)||(u=JSON.stringify(u));var l=r<0?u||"":JSON.stringify({content:u,traceId:i,from:n});return l='"'.concat(l.replace(/"/g,'""'),'"'),"".concat(t,",").concat(a,",").concat(s,",").concat(r,",").concat(o,",").concat(l,"\n")};function nn(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 an(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,{logs:[]}]}))}))}function on(){}var sn=function(){function e(e,t){zr.set(this,void 0),$r.set(this,void 0),c(this,zr,e,"f"),c(this,$r,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,l(this,zr,"f").call(this,e,t,r,n,o)];case 1:return(i=a.sent())&&Array.isArray(i.logs)?[2,{logs:i.logs.filter(nn)}]:[2,{logs:[]}];case 2:return s=a.sent(),console.error("[LogDBProxy] read error",s),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{l(this,$r,"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&&c(this,zr,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&c(this,$r,e,"f"),this}}),e}();function un(){return new sn(an,on)}zr=new WeakMap,$r=new WeakMap;var ln=function(){function e(){}var t,r,n,i,a,o;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){l(this,t,"f",r)||(c(this,t,e,"f",r),e.info(F.L_EVENT_LOOP_BLOCKING_S,"start"),l(this,t,"m",o).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){l(this,t,"f",r)&&(l(this,t,"f",r).info(F.L_EVENT_LOOP_BLOCKING_S,"stop"),c(this,t,null,"f",r),l(this,t,"f",n)&&(clearTimeout(l(this,t,"f",n)),c(this,t,null,"f",n)))}}),t=e,o=function e(){var o=this,s=Date.now();c(this,t,setTimeout((function(){var n=Date.now()-s;n>=l(o,t,"f",a)&&l(o,t,"f",r).warn(F.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(n,"ms")),l(o,t,"m",e).call(o)}),l(this,t,"f",i)),"f",n)},r={value:null},n={value:null},i={value:30},a={value:1500},e}(),cn=1,fn=2,dn=3,_n=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,a=this;this.taskLock=!1;var o=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:"",l=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==l&&(this.logId=e.logId,this.reporter.report(o,s,u,l,e.logId,"",!0).finally((function(){a.taskLock=!0,a.uploadTask.length>0&&a.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 hn,gn,pn,bn,En=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 _n(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===Re.LOG_COMMAND&&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,Ct(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 i(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,f,d,_;return a(this,(function(a){switch(a.label){case 0:return!this.isEable&&t===cn&&this.isExire()?(this.logger.info(F.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===fn&&this.isOverclock()?(this.logger.info(F.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=lr(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),s={platform:"web",version:"5.36.0-alpha.1",timestamp:this.timestamp},this.logger.record(Ie.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,De.POST,o,s)]);case 1:return u=a.sent(),l=u.code,c=u.data,this.logger.record(Ie.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===k.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(f=c.targetRegion,this.changeAreaCode===f?[2,this.timestamp]:(d=Xr.setAreaCode(f),this.logger.info(F.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:d,originAreaCode:Xr.getAreaCode(),newAreaCode:f})),this.changeAreaCode=f,(_=Xr.getCloudControllerUrl(f))[0]?[2,this.request(_[0],dn)]:(this.logger.info(F.L_CLOUD_APPKEY_REGION_E,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}(),In=function(e){return e===k.RC_CONN_REDIRECTED},Tn=function(e){function r(t,r,n){var i=e.call(this)||this;return hn.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:""}),bn.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:Ue.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:he.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 t(r,e),Object.defineProperty(r.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(r.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(r.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===he.DISCONNECTED&&e===he.CONNECTING&&(this._doConnectReason=Ce.CONNECT,l(this,hn,"m",pn).call(this)),this._crtConnectionStatus===he.CONNECTED&&e===he.SUSPENDED&&(t===k.RC_PING_EXCEED_LIMIT?this._doConnectReason=Ce.TIMEOUT:t===k.RC_CONN_REDIRECTED?this._doConnectReason=Ce.REDIRECTED:this._doConnectReason=Ce.RECONNECT),this._crtConnectionStatus===he.CONNECTED){var r={bid:sr(),cod:t,net:this.getNetwork().type,dur:Date.now()-l(this,bn,"f"),cid:this.cid};this.logger.record(Ie.IM_CONNECTION_DURATION,JSON.stringify(r)),e===he.SUSPENDED&&l(this,hn,"m",pn).call(this)}switch(this._crtConnectionStatus=e,e){case he.CONNECTED:this.logger.info(F.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),l(this,hn,"m",gn).call(this).emit("onConnected",this._fromSuspend);break;case he.CONNECTING:this.logger.warn(F.L_CONNECT_S,"status: ".concat(e)),l(this,hn,"m",gn).call(this).emit("onConnecting");break;case he.SUSPENDED:this._fromSuspend=!0,this.logger.warn(F.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),In(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),l(this,hn,"m",gn).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(F.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),l(this,hn,"m",gn).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(r.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===he.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(r.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(Ie.IM_NETWORK_CHANGE,JSON.stringify(r))}this._network=e}}),Object.defineProperty(r.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(r.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus===he.CONNECTED?[2,Ir(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(he.CONNECTING),[4,this.try2Connect(e,t,!1,n,!0)]);case 1:return i=a.sent(),o=i.code,s=i.data,o!==k.SUCCESS?(this.setConnectionStatus(he.DISCONNECTED,o),[2,Tr(o)]):(this.setConnectionStatus(he.CONNECTED),[2,Ir(s)])}}))}))}}),Object.defineProperty(r.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,r,n,o),[4,this._crtConnectionTask]);case 1:return i=a.sent(),this._crtConnectionTask=null,[2,i]}}))}))}}),Object.defineProperty(r.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s,u,l,f,d,_,h,g,p;return a(this,(function(a){switch(a.label){case 0:return i={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0},this.logger.record(Ie.IM_STATS_CS,JSON.stringify(i)),s={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,r,!1,n,s)];case 1:return u=a.sent(),l=u.code,f=u.data,l!==k.SUCCESS?[2,Tr(l)]:1===(d=f).type?[2,Tr(k.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(F.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),d,t,n)]);case 2:return _=a.sent(),h=_.code,g=_.data,o||h===k.SUCCESS||(this.retryCount+=1),In(h)?(this.logger.warn(F.L_CONNECT_R,"redirect code: ".concat(h),n),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,n,o)]):[k.RC_TCP_RESET,k.RC_CONN_ACK_TIMEOUT,k.RC_TCP_DISCONNECTED_NO_RMTP,k.CONNECTION_REFUSED].includes(h)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),p=this.cmpWeightCache.every((function(e){return e.failed})),o&&p?(this.logger.warn(F.L_CONNECT_R,"cpp code:".concat(h,",reture code:").concat(k.SERVER_UNAVAILABLE),n),[2,Tr(k.SERVER_UNAVAILABLE)]):(this.logger.warn(F.L_CONNECT_R,"cmp ack timeout, code: ".concat(h),n),this.setConnectionStatus(he.SUSPENDED,h),this.setConnectionStatus(he.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,o)])):h!==k.SUCCESS?(this.logger.warn(F.L_CONNECT_R,"code: ".concat(h),n),[2,Tr(h)]):(this.logger.info(F.L_CONNECT_R,"userId: ".concat(g),n),c(this,bn,Date.now(),"f"),this._crtUserId=g,[2,Ir(g)])}}))}))}}),Object.defineProperty(r.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,o=this;return a(this,(function(s){return r=this.logger.createTraceId(),this.logger.debug(F.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return i(o,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus!==he.SUSPENDED?[2]:(this.setConnectionStatus(he.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=a.sent(),o=i.code,s=i.isOk,this.reconnectTimer=null,s?(this.setConnectionStatus(he.CONNECTED),[2]):[k.SERVER_UNAVAILABLE,k.TIMEOUT,k.RC_SOCKET_DISCONNECTED,k.RC_SOCKET_NOT_CREATED,k.RC_CONN_ACK_TIMEOUT,k.RC_TCP_RESET,k.RC_NAVI_REQ_FAILED,k.RC_NETWORK_DOWN,k.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==he.CONNECTING||(this.setConnectionStatus(he.SUSPENDED,o),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(he.DISCONNECTED,o),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(r.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return In(e)?(this.setConnectionStatus(he.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===k.RC_UDP_DISCONNECTED?(this.setConnectionStatus(he.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(he.DISCONNECTED,e)}}),Object.defineProperty(r.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(he.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(r.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==he.CONNECTED?(this._failedCount=0,this.logger.debug(F.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(F.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===k.SUCCESS?(this.logger.debug(F.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==he.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(F.L_CHECK_ALIVE_IM_R,"code: ".concat(t,", count: ").concat(this._failedCount),e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(F.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(he.SUSPENDED,k.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,k.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(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(he.DISCONNECTED,k.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(r.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(r.prototype,"getCmpList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return u([],s(this.cmpWeightCache),!1);var r=Ht(e,t);return this.cmpWeightCache=u([],s(r),!1),u([],s(r),!1)}}),Object.defineProperty(r.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===B.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,u([],s(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var a=Math.min.apply(Math,u([],s(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==a&&(n.weight=a-1),n.failed=!0}}}}),Object.defineProperty(r.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(r.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this.token=e,this._openCallPlus=r,this.onDisconenctUnusual(n)}}),r}(gr);bn=new WeakMap,hn=new WeakSet,gn=function(){return this},pn=function(){this.uuid=ht.gen(),this.retryCount=0};var vn=function(e){return e.replace(/@.+$/,"@")},Rn=function(){function e(e,t,r,n,i,a){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===a&&(a=!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:a}),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,o){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,r,n,o),[4,this.crtRequest]);case 1:return i=a.sent(),this.crtRequest=null,[2,i]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){var s;return i(this,void 0,void 0,(function(){var i,u,l,c,f,d,_,h,g,p,b,E,I,T,v,R,m;return a(this,(function(a){switch(a.label){case 0:return i=vn(e),u=this.getNaviCache(i),!t&&u&&(l=u.timestamp,c=u.naviInfo,r||Date.now()-l<Fe)?(this.logger.info(F.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),n),o&&(f=o.uuid,d=o.retryCount,_=o.reason,h={bid:sr(),ptc:Ae.NAVI,cod:k.SUCCESS,net:o.type,dur:0,spr:0,pr:null!==(s=c.type)&&void 0!==s?s:0,hos:"",cache:Oe.LOCAL,v:Se.CURRENT,rsn:_,cid:"".concat(f,"_").concat(d),count:d},this.logger.record(Ie.IM_NAVI,JSON.stringify(h),n)),[2,Ir(c)]):(g=Xr.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(F.L_GET_NAVI_T,JSON.stringify({token:e,uris:g}),n),[4,this.requestHandler(g,e,n,o)]);case 1:return p=a.sent(),b=p.code,E=p.data,b===k.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(I=a.sent())?void 0:I.navi)&&(null==I?void 0:I.navi.length)>0?(T=I.navi,[4,this.requestHandler(T,e,n,o)]):[3,4];case 3:v=a.sent(),b=v.code,E=v.data,a.label=4;case 4:return b!==k.SUCCESS?(this.logger.warn(F.L_GET_NAVI_R,b,n),[2,Tr(b)]):(R=E).code&&200!==R.code?(this.logger.warn(F.L_GET_NAVI_R,R.code,n),[2,Tr(this.transHttpCode(R.code))]):Ht(R).length>0?(this.logger.info(F.L_GET_NAVI_R,JSON.stringify({naviInfo:R}),n),this.setNaviCache(i,R),[2,Ir(R)]):(m={server:R.server,backupServer:R.backupServer,serverAddr:R.serverAddr,bs:R.bs},this.logger.warn(F.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(m)),n),[2,Tr(k.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u,l,c,f,d,_;return a(this,(function(a){switch(a.label){case 0:i=0,o=e.length,a.label=1;case 1:return i<o?(s=i===e.length-1,u=this.useV2Navi()?this.httpRequestV2:this.httpRequest,l=Date.now(),[4,u.call(this,e[i],this.appkey,t,r,s)]):[3,4];case 2:if(c=a.sent(),f=c.code,d=c.data,_={bid:sr(),ptc:Ae.NAVI,cod:f,net:null==n?void 0:n.type,dur:Date.now()-l,spr:0,pr:(null==d?void 0:d.type)||0,hos:e[i],cache:Oe.REQUEST,v:Se.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(Ie.IM_NAVI,JSON.stringify(_),r),[k.SUCCESS,k.RC_CONN_TOKEN_INCORRECT,k.RC_LICENSE_EXPIRED].includes(f))return[2,f===k.SUCCESS?Ir(d):Tr(f)];a.label=3;case 3:return i+=1,[3,1];case 4:return[2,Tr(k.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 k.RC_CONN_TOKEN_INCORRECT;case 416:return k.RC_LICENSE_EXPIRED;default:return k.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(vn(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(vn(e),n(n({},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,a=e.protocol,o=e.mac;t="".concat(r,"/v2/navi.json?cloud=").concat(0);var s="token=".concat(encodeURIComponent(n),"&v=").concat(Ye,"&platfrom=").concat(i);return o&&(s+="&m=".concat(o)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(a,";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}(),mn=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 yn(e){return mn.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}function An(e){return mn.has(e)}var On,Sn,Nn,Cn={MECHANICAL:0,INTELLIGENT:1},Pn=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}(),Mn=function(e){function r(t,r,n,i){return e.call(this,t,r,n,i)||this}return t(r,e),r}(Pn),Ln=function(e){function r(t,r,n){return e.call(this,kr(t),r,n,t)||this}return t(r,e),r}(Pn),wn={NONE:0,TRANSLATING:1,SUCCESS:2,FAILED:3},Un={DEFAULT:0,AUTO_ON:1,AUTO_OFF:2},Dn=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),Gn=48,Vn=64,jn=80,kn=96,xn=112,Fn="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Bn=function(e){for(var t={},r=0;r<e.length-1;r++){var n=e.charAt(r)+e.charAt(r+1);t.hasOwnProperty(n)?t[n].push(r):t[n]=[r]}for(var i=[],a=[],o=function(){if(a.length>0){var e=a.join("");if(a=[],e.length>26){var t=Yn(e.length),r=String.fromCharCode(jn|t.length);i.push(r+t)}else{var n=String.fromCharCode(kn|e.length);i.push(n)}i.push(e)}},s=0;s<e.length;){var u=Hn(t,e,s);if(u.length<2)a.push(e.charAt(s++));else if(u.length<4)a.push(e.substr(s,u.length)),s+=u.length;else{var l=Yn(s-u.offset),c=Yn(u.length);if(l.length+c.length>=u.length)a.push(e.substr(s,u.length)),s+=u.length;else{o();var f=String.fromCharCode(Vn|l.length<<2|c.length);i.push(f+l+c),s+=u.length}}}o();var d=Yn(e.length),_=String.fromCharCode(Gn|d.length);return i.push(_+d),i.join("")},Hn=function(e,t,r){var n={length:0,offset:-1};if(t.length,r>=t.length-1)return n;var i=e[t.charAt(r)+t.charAt(r+1)];if(i[0]===r)return n;for(var a=t.length-r,o=0,s=i.length;o<s;o++){var u=i[o],l=r-u;if(!(l>238327)){var c=Math.min(a,l);if(c<=n.length)break;if(!(n.length>2&&t.charAt(u+n.length-1)!==t.charAt(r+n.length-1))){for(var f=2,d=f;d<c&&t.charAt(u+d)===t.charAt(r+d);d++)f++;f>=n.length&&(n.length=f,n.offset=u)}}}return n},Yn=function(e){var t=[],r=0;do{r=e%62,t.push(Fn.charAt(r)),e=(e-r)/62}while(e>0);return t.join("")},Wn=function(e){for(var t=0,r=0,n=e.length-1;n>=0;n--){if(-1===(r=Fn.indexOf(e.charAt(n))))throw new Error('decode number error, data is "'+e+'"');t=62*t+r}return t},Jn=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],r=0,n=t.length;r<n;r++)if(!e[t[r]])return!1;return!0}(uni))},qn=function(e){return["setItem","getItem","removeItem"].forEach((function(t){var r=e[t];e[t]=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return r.apply(e,t)}catch(e){null===console||void 0===console||console.error(e)}}})),e},Kn=function(){function e(e){On.add(this),Sn.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c(this,Sn,e,"f"),this._logger=e.logger}return Object.defineProperty(e.prototype,"open",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,l(this,On,"m",Nn).call(this,e,l(this,Sn,"f"))]}))}))}}),e}();Sn=new WeakMap,On=new WeakSet,Nn=function e(t,r){return i(this,void 0,void 0,(function(){var n,o,s,u=this;return a(this,(function(c){switch(c.label){case 0:return 0===t.length?[2,Tr(k.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(n=t.shift(),o=lr(n.addr,n.protocol),o="".concat(o,"/v3/message/get_stream.json?sdkVersion=").concat("5.36.0-alpha.1","&platform=Websocket&messageUID=").concat(r.msgUId),this._logger.info(F.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(o)),[4,this._openHandler(o,r)]);case 1:return[2,(s=c.sent()).or((function(n){return i(u,void 0,void 0,(function(){return a(this,(function(i){return-1===n?[2,l(this,On,"m",e).call(this,t,r)]:[2,s]}))}))}))]}}))}))};var Qn=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s=this;return a(this,(function(a){return r=Ar(),n=r.resolve,i=r.promise,(o=new XMLHttpRequest).open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){s._logger.warn(F.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),n(Tr(-1,"timeout"))},o.onreadystatechange=function(r){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var i=o.getResponseHeader("Content-Type"),a=null==i?void 0:i.startsWith("text/event-stream");if(200===o.status&&a){n(Ir());var u=0;o.onprogress=function(e){var r=o.response.slice(u);u=o.response.length,t.onRawContent(r)},o.onerror=function(r){s._logger.warn(F.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(k.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);n(Tr(e.code,e.message))}}},o.onerror=function(t){s._logger.warn(F.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),n(Tr(-1))},o.setRequestHeader("Content-Type","application/json;charset=UTF-8"),o.setRequestHeader("App-Key",t.appkey),o.setRequestHeader("Authorization","Bearer ".concat(t.token)),o.send(),[2,i]}))}))}}),r}(Kn),Xn=Jn();var Zn=null,zn=function(e){return i(void 0,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return[4,ei.getNetworkType()];case 1:return t=r.sent(),Zn({status:"online"===e.type,type:t}),[2]}}))}))};var $n,ei={tag:"browser",httpReq:function(e){return xr(e).result()},get localStorage(){return localStorage},get sessionStorage(){return sessionStorage},useNavi:!0,connectPlatform:"",isFromUniapp:Xn,createWebSocket:function(e,t){var r=new WebSocket(e,t);return r.binaryType="arraybuffer",Promise.resolve(Ir({id:Date.now(),onClose:function(e){r.onclose=function(t){var r=t.code,n=t.reason;e(r,n)}},onError:function(e){r.onerror=e},onMessage:function(e){r.onmessage=function(t){e(t.data)}},onOpen:function(e){r.onopen=e},send:function(e){r.send(e)},close:function(e,t){r.close()}}))},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:Ue.UNKONWN},t=e.type,r=e.effectiveType,n=t||r||Ue.UNKONWN;return Promise.resolve(n)},setNetworkStatusListener:function(e){Zn=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",zn),window.addEventListener("online",zn))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",zn),window.removeEventListener("online",zn)),Zn=null},createSSEClient:function(e){return Ir(new Qn(e))},getApiVer:function(){var e=ei.runtimeInfo,t=e.type,r=e.version;return"".concat("browser","|").concat(t,"|").concat(r)},get runtimeInfo(){var e,t,r=navigator.userAgent,n={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var i in n)if(n.hasOwnProperty(i)){var a=r.match(n[i]);if(a){t=i,e=a[1]||a[2];break}}return{type:t||"Unknown",version:e||"Unknown"}}};!function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgS=2]="ppMsgS",e[e.pgMsgS=3]="pgMsgS",e[e.pgMsgP=4]="pgMsgP",e[e.chatMsg=5]="chatMsg",e[e.pcMsgP=6]="pcMsgP",e[e.prMsgS=7]="prMsgS",e[e.pbMsgP=8]="pbMsgP",e[e.qryPMsg=9]="qryPMsg",e[e.qryGMsg=10]="qryGMsg",e[e.qryCHMsg=11]="qryCHMsg",e[e.qryCMsg=12]="qryCMsg",e[e.qrySMsg=13]="qrySMsg",e[e.qryMCMsg=14]="qryMCMsg",e[e.qryMPMsg=15]="qryMPMsg",e[e.recallMsg=16]="recallMsg",e[e.rrMsg=17]="rrMsg",e[e.rrList=18]="rrList",e[e.s_ntf=19]="s_ntf",e[e.s_msg=20]="s_msg",e[e.s_stat=21]="s_stat",e[e.s_cmd=22]="s_cmd",e[e.s_us=23]="s_us",e[e.transLan=24]="transLan",e[e.autoTrans=25]="autoTrans",e[e.pullUS=26]="pullUS",e[e.sendMsgRead=27]="sendMsgRead",e[e.qryMsgRead=28]="qryMsgRead",e[e.qryMsgReadCntBatch=29]="qryMsgReadCntBatch",e[e.updRTime=30]="updRTime",e[e.qryRLBatch=31]="qryRLBatch",e[e.chatMsgS=32]="chatMsgS",e[e.qrySessionsAtt=33]="qrySessionsAtt",e[e.pullMsg=34]="pullMsg",e[e.qrySessions=35]="qrySessions",e[e.delSessions=36]="delSessions",e[e.delMsg=37]="delMsg",e[e.delUgMsg=38]="delUgMsg",e[e.delUgSe=39]="delUgSe",e[e.updRRTime=40]="updRRTime",e[e.qrySessionsUnread=41]="qrySessionsUnread",e[e.setTypeUnpush=42]="setTypeUnpush",e[e.chrmPull=43]="chrmPull",e[e.joinChrm=44]="joinChrm",e[e.joinChrmR=45]="joinChrmR",e[e.exitChrm=46]="exitChrm",e[e.queryChrmI=47]="queryChrmI",e[e.setKV=48]="setKV",e[e.delKV=49]="delKV",e[e.setKVS=50]="setKVS",e[e.delKVS=51]="delKVS",e[e.pullKV=52]="pullKV",e[e.qryRelation=53]="qryRelation",e[e.qryRelationR=54]="qryRelationR",e[e.qryRelationFilter=55]="qryRelationFilter",e[e.delRelation=56]="delRelation",e[e.delRelationBatch=57]="delRelationBatch",e[e.pullSe=58]="pullSe",e[e.pullSeAtts=59]="pullSeAtts",e[e.setSeAtt=60]="setSeAtt",e[e.qnTkn=61]="qnTkn",e[e.qnUrl=62]="qnUrl",e[e.aliUrl=63]="aliUrl",e[e.s3Url=64]="s3Url",e[e.stcUrl=65]="stcUrl",e[e.minioUrl=66]="minioUrl",e[e.cleanPMsg=67]="cleanPMsg",e[e.cleanGMsg=68]="cleanGMsg",e[e.cleanCMsg=69]="cleanCMsg",e[e.cleanSMsg=70]="cleanSMsg",e[e.cleanMCMsg=71]="cleanMCMsg",e[e.cleanMPMsg=72]="cleanMPMsg",e[e.cleanMsgBatch=73]="cleanMsgBatch",e[e.rtcPing=74]="rtcPing",e[e.rtc_ntf=75]="rtc_ntf",e[e.rtcSetOutData=76]="rtcSetOutData",e[e.rtcQryUserOutData=77]="rtcQryUserOutData",e[e.addSeTag=78]="addSeTag",e[e.delSeTag=79]="delSeTag",e[e.addTag=80]="addTag",e[e.delTag=81]="delTag",e[e.reportsdk=82]="reportsdk",e[e.pullUgSes=83]="pullUgSes",e[e.pullUgMsg=84]="pullUgMsg",e[e.ugMsg=85]="ugMsg",e[e.qryUgMsg=86]="qryUgMsg",e[e.updUgRTime=87]="updUgRTime",e[e.upMsgEx=88]="upMsgEx",e[e.modifyMsg=89]="modifyMsg",e[e.qryMsgChange=90]="qryMsgChange",e[e.qryMsg=91]="qryMsg",e[e.operate=92]="operate",e[e.s_opNtf=93]="s_opNtf",e[e.ugUnpushQuery=94]="ugUnpushQuery",e[e.ugUnpushSet=95]="ugUnpushSet",e[e.setRtcRoomId=96]="setRtcRoomId",e[e.qryUgUal=97]="qryUgUal",e[e.updUserSub=98]="updUserSub",e[e.pullUserSub=99]="pullUserSub",e[e.pullSubData=100]="pullSubData",e[e.qrySubData=101]="qrySubData",e[e.pullUserProfile=102]="pullUserProfile",e[e.pullOwnProfile=103]="pullOwnProfile",e[e.updProfilePermiss=104]="updProfilePermiss",e[e.qProfilePermiss=105]="qProfilePermiss",e[e.searchUserProfile=106]="searchUserProfile",e[e.updUserProfile=107]="updUserProfile",e[e.pullEventChange=108]="pullEventChange",e[e.channelCreate=109]="channelCreate",e[e.upChannelInfo=110]="upChannelInfo",e[e.qChannelInfo=111]="qChannelInfo",e[e.channelMemKick=112]="channelMemKick",e[e.channelMemQuit=113]="channelMemQuit",e[e.channelDismiss=114]="channelDismiss",e[e.channelTransfer=115]="channelTransfer",e[e.upChannelManager=116]="upChannelManager",e[e.qChannelMem=117]="qChannelMem",e[e.qChannelSpeMem=118]="qChannelSpeMem",e[e.upChannelMem=119]="upChannelMem",e[e.channelMemJoin=120]="channelMemJoin",e[e.channelMemInvite=121]="channelMemInvite",e[e.channelApplyResp=122]="channelApplyResp",e[e.qChannelApplyList=123]="qChannelApplyList",e[e.qChannelMemJoin=124]="qChannelMemJoin",e[e.qChannelMemSpeJoin=125]="qChannelMemSpeJoin",e[e.upChannelRemark=126]="upChannelRemark",e[e.qChannelRemark=127]="qChannelRemark",e[e.upChannelFollow=128]="upChannelFollow",e[e.qChannelFollow=129]="qChannelFollow",e[e.qSimpleUserProfile=130]="qSimpleUserProfile",e[e.friendAdd=131]="friendAdd",e[e.friendDel=132]="friendDel",e[e.friendHandle=133]="friendHandle",e[e.friendSetPf=134]="friendSetPf",e[e.friendCheck=135]="friendCheck",e[e.friendsQuery=136]="friendsQuery",e[e.friendApplyDel=137]="friendApplyDel",e[e.friendsInfoQry=138]="friendsInfoQry",e[e.friendAuthSet=139]="friendAuthSet",e[e.friendAuthGet=140]="friendAuthGet",e[e.addUnpush=141]="addUnpush",e[e.qryUnpush=142]="qryUnpush",e[e.delUnpush=143]="delUnpush",e[e.s_pubCall=144]="s_pubCall",e[e.reqCall=145]="reqCall",e[e.pullKvMsg=146]="pullKvMsg",e[e.readReceipt=147]="readReceipt",e[e.qryReceipt=148]="qryReceipt",e[e.qryReceiptBatch=149]="qryReceiptBatch",e[e.upConvertMsg=150]="upConvertMsg",e[e.pullModifyMsg=151]="pullModifyMsg",e[e.qAppBot=152]="qAppBot",e[e.qBot=153]="qBot"}($n||($n={}));var ti=function(e){var t=$n[e];return t},ri=function(e){return $n[e]},ni=0,ii=1,ai=2,oi=3,si=4,ui=5,li=6,ci=7,fi=12,di=13,_i=14,hi=4,gi=3,pi="rtcRJoin_data",bi="rtcRExit",Ei="rtcUPut",Ii="rtcUDel",Ti="rtcSetData",vi="userSetData",Ri="rtcQryData",mi="rtcDelData",yi="rtcToken",Ai="rtcUserState",Oi="rtcUList",Si="viewerJoinR",Ni="viewerExitR",Ci="rtcIdentityChange",Pi="rtcInvite",Mi="rtcCancelInvite",Li="rtcInviteAnswer",wi="rtcEndInvite",Ui="rtcQueryJoined",Di=0,Gi=1,Vi=2,ji=3,ki=4,xi=5,Fi=6,Bi=7,Hi=8,Yi=9,Wi=10,Ji=11,qi=12,Ki=13,Qi=14,Xi=15,Zi=16,zi=17,$i=18,ea=19,ta=20,ra=1,na=2,ia=4,aa=5,oa=6,sa=7,ua=8,la=9,ca=function(){function e(){}return Object.defineProperty(e,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this._getBackAndByteSize(e),r=t.back,n=t.byteSize,i=0,a=r.length;i<a;i++)r[i]>255&&(r[i]&=255);return n<=255?[0,n].concat(r):[n>>8,255&n].concat(r)}}),Object.defineProperty(e,"_getBackAndByteSize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],r=0;if("string"==typeof e)for(var n=0,i=e.length;n<i;n++){var a=e.charCodeAt(n);a>=0&&a<=127?(r+=1,t.push(a)):a>=128&&a<=2047?(r+=2,t.push(192|31&a>>6),t.push(128|63&a)):a>=2048&&a<=65535&&(r+=3,t.push(224|15&a>>12),t.push(128|63&a>>6),t.push(128|63&a))}return{byteSize:r,back:t}}}),Object.defineProperty(e,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r,n=[],i=-1,a=e,o="";++i<a.length;){var s=Number(a[i]);if(s===(127&s)||(240&~s?224&~s?192&~s||(s=(s^=192)<<6|128^a[++i]):s=(s=(s^=224)<<6|128^a[++i])<<6|128^a[++i]:s=(s=(s=(s^=240)<<6|128^a[++i])<<6|128^a[++i])<<6|128^a[++i]),!Number.isFinite(s)||s<0||s>1114111||Math.floor(s)!==s)throw RangeError("Invalid code point: ".concat(s));s<=65535?n.push(s):(t=(s-=65536)>>10|55296,r=s%1024|56320,n.push(t,r)),(i+1===a.length||n.length>16384)&&(o+=String.fromCharCode.apply(null,n),n.length=0)}return o}}),e}(),fa=function(){function e(e){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_position",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_poolLen",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._pool=e,this._poolLen=e.length}return Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._position>=this._pool.length}}),Object.defineProperty(e.prototype,"read2Byte",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",r=0;r<2;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n.toString()}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readInt32",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(this.readByte()<<24)+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()}}),Object.defineProperty(e.prototype,"readLong",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(e.check())return-1;for(var t="",r=0;r<8;r++){var n=e._pool[e._position++].toString(16);1===n.length&&(n="0".concat(n)),t+=n}return parseInt(t,16)}}),Object.defineProperty(e.prototype,"readByte",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e}}),Object.defineProperty(e.prototype,"readUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var r=this._pool.subarray(t,this._position);return ca.readUTF(r)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),da=function(){function e(){Object.defineProperty(this,"_pool",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"writeByte",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>=0&&(e>255&&(e&=255),this._pool.push(e))}}),Object.defineProperty(e.prototype,"writeBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pool=this._pool.concat(u([],s(new Int8Array(e)),!1))}}),Object.defineProperty(e.prototype,"writeArr",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pool=this._pool.concat(e)}}),Object.defineProperty(e.prototype,"writeUTF",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=ca.writeUTF(e);this._pool=this._pool.concat(t)}}),Object.defineProperty(e.prototype,"getBytesArray",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool}}),e}(),_a=function(){function e(e,t,r,n){void 0===t&&(t=ii),void 0===r&&(r=!1),void 0===n&&(n=!1),Object.defineProperty(this,"command",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"qos",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_retain",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"dup",{enumerable:!0,configurable:!0,writable:!0,value:n})}return Object.defineProperty(e,"parse",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t>>4,(6&t)>>1,!(1&~t),(8&t)>0)}}),Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.command<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this.dup?8:0}}),e}(),ha=function(){function e(e){Object.defineProperty(this,"header",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.readMessage(e,t,r)}}),Object.defineProperty(e.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return{stream:e,length:t}}}),e}(),ga=function(){function e(e){Object.defineProperty(this,"_header",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._header=new _a(e,ni)}return Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getHeaderFlag();e.writeByte(t),this.writeMessage(e)}}),Object.defineProperty(e.prototype,"setHeaderQos",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._header.qos=e}}),Object.defineProperty(e.prototype,"getHeaderFlag",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._header.encode()}}),Object.defineProperty(e.prototype,"getArrayBuffer",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new da;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),pa=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"userId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"sessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n){if(e.readByte(),this.status=e.readByte(),t<=r.MESSAGE_LENGTH)return{stream:e,length:t};if(n===hi){var i=e.readByte();1&i&&(this.userId=e.readUTF()),2&i&&(this.sessionId=e.readUTF()),4&i&&(this.timestamp=e.readLong()),8&i&&(this.messageId=e.read2Byte())}else this.userId=e.readUTF(),this.sessionId=e.readUTF(),this.timestamp=e.readLong();return{stream:e,length:t}}}),Object.defineProperty(r,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),r}(ha),ba=function(e){function r(t){var r=e.call(this,_i)||this;return Object.defineProperty(r,"status",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.writeArr([0,this.status])}}),r}(ga),Ea=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return e.readByte(),this.status=e.readByte(),this.data=e.readAll(),{stream:e,length:t}}}),Object.defineProperty(r,"MESSAGE_LENGTH",{enumerable:!0,configurable:!0,writable:!0,value:2}),r}(ha),Ia=function(e){function r(){return e.call(this,fi)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),r}(ga),Ta=function(e){function r(t){return e.call(this,t)||this}return t(r,e),r}(ha),va=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"messageId",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=256*e.readByte()+e.readByte();return this.messageId=parseInt(r.toString(),10),{stream:e,length:t}}}),r}(ha),Ra=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.messageId,r=255&t,n=(65280&t)>>8;e.writeByte(n),e.writeByte(r)}}),r}(ga),ma=function(e){function r(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"topic",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(r,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(r,"syncMsg",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r.syncMsg=t.dup,r}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return this.date=t.readInt32(),this.topic=t.readUTF(),this.targetId=t.readUTF(),e.prototype.readMessage.call(this,t,r),this.pbData=t.readAll(),{stream:t,length:r}}}),r}(va),ya=function(e){function r(t,r,n,i){var a=e.call(this,t)||this;return Object.defineProperty(a,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"topic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a.topic="string"==typeof r?r:ri(r),a}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.writeBuffer(this.pbData)}}),r}(Ra),Aa=function(e){function r(t,r,n){return e.call(this,ui,t,n,r)||this}return t(r,e),r}(ya),Oa=function(e){function r(t,r,n){return e.call(this,oi,t,n,r)||this}return t(r,e),r}(ya),Sa=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"millisecond",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"messageUId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.millisecond=256*t.readByte()+t.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=t.readUTF(),{stream:t,length:r}}}),r}(va),Na=function(e){function r(t){var r=e.call(this,si)||this;return r.messageId=t,r}return t(r,e),r}(Ra),Ca=function(e){function r(t){var r=e.call(this,ci)||this;return r.messageId=t,r}return t(r,e),r}(Ra),Pa=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return Object.defineProperty(t,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(t,"status",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(t,"date",{enumerable:!0,configurable:!0,writable:!0,value:0}),t}return t(r,e),Object.defineProperty(r.prototype,"readMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.readMessage.call(this,t,r),this.date=t.readInt32(),this.status=256*t.readByte()+t.readByte(),this.pbData=t.readAll(),{stream:t,length:r}}}),r}(va),Ma=function(e,t){var r=new Uint8Array(e),n=new fa(r),i=n.readByte(),a=function(e){var t,r=e.command;switch(r){case ai:t=new pa(e);break;case oi:t=new ma(e);break;case si:t=new Sa(e);break;case li:t=new Pa(e);break;case di:t=new Ta(e);break;case _i:t=new Ea(e);break;default:console.error("No support for deserializing ".concat(r," messages"))}return t}(_a.parse(i));return a&&a.read(n,r.length-1,t),a},La=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_openHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Ar(),n=r.resolve,i=r.promise,a=this._logger,o=wx.request({url:e,enableChunked:!0,method:"GET",timeout:t.timeout,header:{"Content-Type":"application/json;charset=UTF-8","App-Key":t.appkey,Authorization:"Bearer ".concat(t.token)},success:function(e){var t;if(200===e.statusCode&&(null===(t=e.header["Content-Type"])||void 0===t?void 0:t.startsWith("text/event-stream")))n(Ir());else{var r=JSON.parse(e.data),i=r.code,a=r.message;n(Tr(i,a))}},fail:function(t){var r=t.errMsg,i=t.errno;a.warn(F.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:r,errno:i})),n(Tr(-1,t.errMsg))},complete:function(){a.debug(F.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return o.onChunkReceived((function(e){var r=ca.readUTF(new Uint8Array(e.data));a.debug(F.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(r)),t.onRawContent(r)})),i}}),r}(Kn),wa=Jn(),Ua=qn({setItem:function(e,t){wx.setStorage({key:e,data:t})},getItem:function(e){return wx.getStorageSync(e)},removeItem:function(e){wx.removeStorage({key:e})}}),Da=null,Ga=function(e){var t=e.isConnected,r=e.networkType;Da({status:t,type:r})};var Va={tag:"wechat",httpReq:function(e){var t=e.method||De.GET,r=e.timeout||Be,n=e.headers,i=e.query,a=e.body,o=zt(e.url,i);return new Promise((function(e){wx.request({url:o,method:t,header:n,timeout:r,data:a,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:k.RC_HTTP_REQ_FAIL})}})}))},localStorage:Ua,sessionStorage:Ua,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:wa,createWebSocket:function(e,t){var r=wx.connectSocket({url:e,protocols:t});return Promise.resolve(Ir({id:Date.now(),onClose:function(e){r.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){e(t.errMsg),r.close()}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){Da=e,wx.onNetworkStatusChange(Ga)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(Ga),Da=null},createSSEClient:function(e){return Ir(new La(e))},get runtimeInfo(){return{type:Va.tag,version:"Unknown"}}},ja=Jn(),ka=qn({setItem:function(e,t){my.setStorage({key:e,data:t})},getItem:function(e){return my.getStorageSync({key:e}).data},removeItem:function(e){my.removeStorage({key:e})}}),xa=null,Fa=function(e){var t=e.isConnected,r=e.networkType;xa({status:t,type:r})};var Ba={tag:"alipay",httpReq:function(e){var t=e.method||De.GET,r=e.timeout||Be,n=e.headers,i=e.query,a=e.body,o=zt(e.url,i),s=e.dataType||"json";return new Promise((function(e){my.request({url:o,method:t,headers:n,timeout:r,data:a,dataType:s,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:k.RC_HTTP_REQ_FAIL})}})}))},localStorage:ka,sessionStorage:ka,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ja,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return Promise.resolve(Ir({id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}))},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){xa=e,my.onNetworkStatusChange(Fa)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Fa),xa=null},createSSEClient:function(e){return Tr(k.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:Ba.tag,version:"Unknown"}}},Ha=Jn(),Ya=qn({setItem:function(e,t){tt.setStorage({key:e,data:t})},getItem:function(e){return tt.getStorageSync(e)},removeItem:function(e){tt.removeStorage({key:e})}}),Wa=null,Ja=function(e){var t=e.isConnected,r=e.networkType;Wa({status:t,type:r})};var qa={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ha,localStorage:Ya,sessionStorage:Ya,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:k.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){return new Promise((function(r){var n=tt.connectSocket({url:e,protocols:t,fail:function(e){return r(Tr(k.RC_SOCKET_DISCONNECTED,e.errMsg))}});r(Ir({id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){n.close(),e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}))}))},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){Wa=e,tt.onNetworkStatusChange(Ja)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(Ja),Wa=null},createSSEClient:function(e){return Tr(k.NOT_SUPPORT)},get runtimeInfo(){return{type:qa.tag,version:"Unknown"}}},Ka=Jn(),Qa=qn({setItem:function(e,t){swan.setStorage({key:e,data:t})},getItem:function(e){return swan.getStorageSync(e)},removeItem:function(e){swan.removeStorage({key:e})}}),Xa=null,Za=function(e){var t=e.isConnected,r=e.networkType;Xa({status:t,type:r})};var za={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ka,localStorage:Qa,sessionStorage:Qa,httpReq:function(e){return new Promise((function(t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:k.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=swan.connectSocket({url:e,protocols:t});return Promise.resolve(Ir({id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Xa=e,swan.onNetworkStatusChange(Za)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Za),Xa=null},createSSEClient:function(e){return Tr(k.NOT_SUPPORT)},get runtimeInfo(){return{type:za.tag,version:"Unknown"}}},$a=Jn(),eo=qn({setItem:function(e,t){jd.setStorage({key:e,data:t})},getItem:function(e){return jd.getStorageSync(e)},removeItem:function(e){jd.removeStorage({key:e})}}),to=null,ro=function(e){var t=e.isConnected,r=e.networkType;to({status:t,type:r})};var no={tag:"jingdong",httpReq:function(e){var t=e.method||De.GET,r=e.timeout||Be,n=e.headers,i=e.query,a=e.body,o=zt(e.url,i);return new Promise((function(e){jd.request({url:o,method:t,header:n,timeout:r,data:a,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:k.RC_HTTP_REQ_FAIL})}})}))},localStorage:eo,sessionStorage:eo,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$a,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),Promise.resolve(Ir({id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){to=e,jd.onNetworkStatusChange(ro)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(ro),to=null},createSSEClient:function(e){return Tr(k.NOT_SUPPORT)},get runtimeInfo(){return{type:no.tag,version:"Unknown"}}},io=Jn(),ao=qn({setItem:function(e,t){ks.setStorage({key:e,data:t})},getItem:function(e){return ks.getStorageSync(e)},removeItem:function(e){ks.removeStorage({key:e})}}),oo=null,so=function(e){var t=e.isConnected,r=e.networkType;oo({status:t,type:r})};var uo={tag:"kuaishou",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:io,localStorage:ao,sessionStorage:ao,httpReq:function(e){return new Promise((function(t){ks.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var r=(null==e?void 0:e.data)||{},n={data:JSON.stringify(r),status:e.statusCode};t(n)},fail:function(e){t({status:k.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=ks.connectSocket({url:e,protocols:t});return Promise.resolve(Ir({id:Date.now(),onOpen:function(e){r.onOpen(e)},onClose:function(e){r.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){return e(t.data)}))},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){ks.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){oo=e,ks.onNetworkStatusChange(so)},removeNetworkStatusListener:function(){ks.offNetworkStatusChange(so),oo=null},createSSEClient:function(e){return Tr(k.NOT_SUPPORT)},get runtimeInfo(){return{type:uo.tag,version:"Unknown"}}},lo=qn({setItem:function(e,t){uni.setStorage({key:e,data:t})},getItem:function(e){return uni.getStorageSync(e)},removeItem:function(e){uni.removeStorage({key:e,success:function(){}})}}),co=null,fo=function(e){var t=e.isConnected,r=e.networkType;co({status:t,type:r})};var _o={tag:"uniapp",httpReq:function(e){var t=e.method||De.GET,r=e.timeout||Be,n=e.headers,i=e.query,a=e.body,o=zt(e.url,i);return new Promise((function(e){uni.request({url:o,method:t,header:n,timeout:r,data:a,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:k.RC_HTTP_REQ_FAIL})}})}))},localStorage:lo,sessionStorage:lo,useNavi:!0,get connectPlatform(){var e=uni.getSystemInfoSync(),t=e.uniPlatform,r=e.osName;return["app","app-plus"].includes(t)&&r||""},isFromUniapp:!0,createWebSocket:function(e,t){var r={complete:function(){},url:e,protocols:t},n=uni.connectSocket(r);return Promise.resolve(Ir({id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}))},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var r=t.networkType;e(r)},fail:function(){e(Ue.UNKONWN)}})}))},setNetworkStatusListener:function(e){co=e,uni.onNetworkStatusChange(fo)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(fo),co=null},createSSEClient:function(e){return Tr(k.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,r=e.deviceModel,n=e.deviceBrand,i=e.osVersion,a="android"===e.osName?t:i;return"".concat(n||"","|").concat(r||"","|").concat(a||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:_o.tag,version:"Unknown"}}},ho=function(e){return e&&e.request&&e.getSystemInfo},go="undefined"!=typeof uni&&ho(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return _o;case"mp-jd":return no;case"mp-baidu":return za;case"mp-toutiao":return qa;case"mp-alipay":return Ba;case"mp-weixin":return Va;case"mp-kuaishou":return uo;default:return ei}}():"undefined"!=typeof jd&&ho(jd)?no:"undefined"!=typeof my&&ho(my)?Ba:"undefined"!=typeof tt&&ho(tt)?qa:"undefined"!=typeof ks&&ho(ks)?uo:"undefined"!=typeof swan&&ho(swan)?za:"undefined"!=typeof wx&&ho(wx)?Va:ei;const po=function(){var e,t={},r=function(e){var t=function(e,r,i){if(void 0===e&&(e=t.DEFAULT_CAPACITY),void 0===r&&(r=t.DEFAULT_ENDIAN),void 0===i&&(i=t.DEFAULT_NOASSERT),!i){if((e|=0)<0)throw RangeError("Illegal capacity");r=!!r,i=!!i}this.buffer=0===e?n:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=r,this.noAssert=i};t.VERSION="5.0.1",t.LITTLE_ENDIAN=!0,t.BIG_ENDIAN=!1,t.DEFAULT_CAPACITY=16,t.DEFAULT_ENDIAN=t.BIG_ENDIAN,t.DEFAULT_NOASSERT=!1,t.Long=e||null;var r=t.prototype;r.__isByteBuffer__,Object.defineProperty(r,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var n=new ArrayBuffer(0),i=String.fromCharCode;function a(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function o(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+i.apply(String,e);e.length+arguments.length>1024&&(t.push(i.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function s(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,f=r?i-1:0,d=r?-1:1,_=e[t+f];for(f+=d,a=_&(1<<-c)-1,_>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(_?-1:1);o+=Math.pow(2,n),a-=l}return(_?-1:1)*o*Math.pow(2,a-n)}function u(e,t,r,n,i,a){var o,s,u,l=8*a-i-1,c=(1<<l)-1,f=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:a-1,h=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+_]=255&s,_+=h,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[r+_]=255&o,_+=h,o/=256,l-=8);e[r+_-h]|=128*g}t.accessor=function(){return Uint8Array},t.allocate=function(e,r,n){return new t(e,r,n)},t.concat=function(e,r,n,i){"boolean"!=typeof r&&"string"==typeof r||(i=n,n=r,r=void 0);for(var a,o=0,s=0,u=e.length;s<u;++s)t.isByteBuffer(e[s])||(e[s]=t.wrap(e[s],r)),(a=e[s].limit-e[s].offset)>0&&(o+=a);if(0===o)return new t(0,n,i);var l,c=new t(o,n,i);for(s=0;s<u;)(a=(l=e[s++]).limit-l.offset)<=0||(c.view.set(l.view.subarray(l.offset,l.limit),c.offset),c.offset+=a);return c.limit=c.offset,c.offset=0,c},t.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},t.type=function(){return ArrayBuffer},t.wrap=function(e,n,i,a){if("string"!=typeof n&&(a=i,i=n,n=void 0),"string"==typeof e)switch(void 0===n&&(n="utf8"),n){case"base64":return t.fromBase64(e,i);case"hex":return t.fromHex(e,i);case"binary":return t.fromBinary(e,i);case"utf8":return t.fromUTF8(e,i);case"debug":return t.fromDebug(e,i);default:throw Error("Unsupported encoding: "+n)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var o;if(t.isByteBuffer(e))return(o=r.clone.call(e)).markedOffset=-1,o;if(e instanceof Uint8Array)o=new t(0,i,a),e.length>0&&(o.buffer=e.buffer,o.offset=e.byteOffset,o.limit=e.byteOffset+e.byteLength,o.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)o=new t(0,i,a),e.byteLength>0&&(o.buffer=e,o.offset=0,o.limit=e.byteLength,o.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(o=new t(e.length,i,a)).limit=e.length;for(var s=0;s<e.length;++s)o.view[s]=e[s]}return o},r.writeBitSet=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var n,i=t,a=e.length,o=a>>3,s=0;for(t+=this.writeVarint32(a,t);o--;)n=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(n,t++);if(s<a){var u=0;for(n=0;s<a;)n|=(1&!!e[s++])<<u++;this.writeByte(n,t++)}return r?(this.offset=t,this):t-i},r.readBitSet=function(e){var t=void 0===e;t&&(e=this.offset);var r,n=this.readVarint32(e),i=n.value,a=i>>3,o=0,s=[];for(e+=n.length;a--;)r=this.readByte(e++),s[o++]=!!(1&r),s[o++]=!!(2&r),s[o++]=!!(4&r),s[o++]=!!(8&r),s[o++]=!!(16&r),s[o++]=!!(32&r),s[o++]=!!(64&r),s[o++]=!!(128&r);if(o<i){var u=0;for(r=this.readByte(e++);o<i;)s[o++]=!!(r>>u++&1)}return t&&(this.offset=e),s},r.readBytes=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var n=this.slice(t,t+e);return r&&(this.offset+=e),n},r.writeBytes=r.append,r.writeInt8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view[e];return 128&~r||(r=-(255-r+1)),t&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeUInt8=r.writeUint8,r.readUint8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view[e];return t&&(this.offset+=1),r},r.readUInt8=r.readUint8,r.writeInt16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},r.writeShort=r.writeInt16,r.readInt16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),32768&~r||(r=-(65535-r+1)),t&&(this.offset+=2),r},r.readShort=r.readInt16,r.writeUint16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},r.writeUInt16=r.writeUint16,r.readUint16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),t&&(this.offset+=2),r},r.readUInt16=r.readUint16,r.writeInt32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeInt=r.writeInt32,r.readInt32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),r|=0,t&&(this.offset+=4),r},r.readInt=r.readInt32,r.writeUint32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeUInt32=r.writeUint32,r.readUint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),t&&(this.offset+=4),r},r.readUInt32=r.readUint32,e&&(r.writeInt64=function(t,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var i=this.buffer.byteLength;r>i&&this.resize((i*=2)>r?i:r),r-=8;var a=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=a>>>24&255,this.view[r+2]=a>>>16&255,this.view[r+1]=a>>>8&255,this.view[r]=255&a,r+=4,this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o):(this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o,r+=4,this.view[r]=a>>>24&255,this.view[r+1]=a>>>16&255,this.view[r+2]=a>>>8&255,this.view[r+3]=255&a),n&&(this.offset+=8),this},r.writeLong=r.writeInt64,r.readInt64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var n=0,i=0;this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0);var a=new e(n,i,!1);return r&&(this.offset+=8),a},r.readLong=r.readInt64,r.writeUint64=function(t,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var i=this.buffer.byteLength;r>i&&this.resize((i*=2)>r?i:r),r-=8;var a=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=a>>>24&255,this.view[r+2]=a>>>16&255,this.view[r+1]=a>>>8&255,this.view[r]=255&a,r+=4,this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o):(this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o,r+=4,this.view[r]=a>>>24&255,this.view[r+1]=a>>>16&255,this.view[r+2]=a>>>8&255,this.view[r+3]=255&a),n&&(this.offset+=8),this},r.writeUInt64=r.writeUint64,r.readUint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var n=0,i=0;this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0);var a=new e(n,i,!0);return r&&(this.offset+=8),a},r.readUInt64=r.readUint64),r.writeFloat32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,u(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},r.writeFloat=r.writeFloat32,r.readFloat32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=s(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),r},r.readFloat=r.readFloat32,r.writeFloat64=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=8,u(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},r.writeDouble=r.writeFloat64,r.readFloat64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var r=s(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),r},r.readDouble=r.readFloat64,t.MAX_VARINT32_BYTES=5,t.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},t.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},t.zigZagDecode32=function(e){return e>>>1^-(1&e)},r.writeVarint32=function(e,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var i,a=t.calculateVarint32(e);r+=a;var o=this.buffer.byteLength;for(r>o&&this.resize((o*=2)>r?o:r),r-=a,e>>>=0;e>=128;)i=127&e|128,this.view[r++]=i,e>>>=7;return this.view[r++]=e,n?(this.offset=r,this):a},r.writeVarint32ZigZag=function(e,r){return this.writeVarint32(t.zigZagEncode32(e),r)},r.readVarint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,n=0,i=0;do{if(!this.noAssert&&e>this.limit){var a=Error("Truncated");throw a.truncated=!0,a}r=this.view[e++],n<5&&(i|=(127&r)<<7*n),++n}while(128&r);return i|=0,t?(this.offset=e,i):{value:i,length:n}},r.readVarint32ZigZag=function(e){var r=this.readVarint32(e);return"object"==typeof r?r.value=t.zigZagDecode32(r.value):r=t.zigZagDecode32(r),r},e&&(t.MAX_VARINT64_BYTES=10,t.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,n=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==n?r<16384?r<128?1:2:r<1<<21?3:4:n<16384?n<128?5:6:n<1<<21?7:8:i<128?9:10},t.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},t.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},r.writeVarint64=function(r,n){var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"==typeof r)r=e.fromNumber(r);else if("string"==typeof r)r=e.fromString(r);else if(!(r&&r instanceof e))throw TypeError("Illegal value: "+r+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof r?r=e.fromNumber(r,!1):"string"==typeof r?r=e.fromString(r,!1):!1!==r.unsigned&&(r=r.toSigned());var a=t.calculateVarint64(r),o=r.toInt()>>>0,s=r.shiftRightUnsigned(28).toInt()>>>0,u=r.shiftRightUnsigned(56).toInt()>>>0;n+=a;var l=this.buffer.byteLength;switch(n>l&&this.resize((l*=2)>n?l:n),n-=a,a){case 10:this.view[n+9]=u>>>7&1;case 9:this.view[n+8]=9!==a?128|u:127&u;case 8:this.view[n+7]=8!==a?s>>>21|128:s>>>21&127;case 7:this.view[n+6]=7!==a?s>>>14|128:s>>>14&127;case 6:this.view[n+5]=6!==a?s>>>7|128:s>>>7&127;case 5:this.view[n+4]=5!==a?128|s:127&s;case 4:this.view[n+3]=4!==a?o>>>21|128:o>>>21&127;case 3:this.view[n+2]=3!==a?o>>>14|128:o>>>14&127;case 2:this.view[n+1]=2!==a?o>>>7|128:o>>>7&127;case 1:this.view[n]=1!==a?128|o:127&o}return i?(this.offset+=a,this):a},r.writeVarint64ZigZag=function(e,r){return this.writeVarint64(t.zigZagEncode64(e),r)},r.readVarint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var n=t,i=0,a=0,o=0,s=0;if(i=127&(s=this.view[t++]),128&s&&(i|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(a=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(a|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(a|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(a|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(o=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[t++]))<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|a<<28,a>>>4|o<<24,!1);return r?(this.offset=t,u):{value:u,length:t-n}},r.readVarint64ZigZag=function(r){var n=this.readVarint64(r);return n&&n.value instanceof e?n.value=t.zigZagDecode64(n.value):n=t.zigZagDecode64(n),n}),r.writeCString=function(e,t){var r=void 0===t;r&&(t=this.offset);var n,i=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(n=0;n<i;++n)if(0===e.charCodeAt(n))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}i=c.calculateUTF16asUTF8(a(e))[1],t+=i+1;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=i+1,c.encodeUTF16toUTF8(a(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,r?(this.offset=t,this):i},r.readCString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,n=e,i=-1;return c.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view[e++])?null:i}.bind(this),r=o(),!0),t?(this.offset=e,r()):{string:r(),length:e-n}},r.writeIString=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var n,i=t;n=c.calculateUTF16asUTF8(a(e),this.noAssert)[1],t+=4+n;var o=this.buffer.byteLength;if(t>o&&this.resize((o*=2)>t?o:t),t-=4+n,this.littleEndian?(this.view[t+3]=n>>>24&255,this.view[t+2]=n>>>16&255,this.view[t+1]=n>>>8&255,this.view[t]=255&n):(this.view[t]=n>>>24&255,this.view[t+1]=n>>>16&255,this.view[t+2]=n>>>8&255,this.view[t+3]=255&n),t+=4,c.encodeUTF16toUTF8(a(e),function(e){this.view[t++]=e}.bind(this)),t!==i+4+n)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+n));return r?(this.offset=t,this):t-i},r.readIString=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=e,i=this.readUint32(e),a=this.readUTF8String(i,t.METRICS_BYTES,e+=4);return e+=a.length,r?(this.offset=e,a.string):{string:a.string,length:e-n}},t.METRICS_CHARS="c",t.METRICS_BYTES="b",r.writeUTF8String=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i=t;r=c.calculateUTF16asUTF8(a(e))[1],t+=r;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=r,c.encodeUTF16toUTF8(a(e),function(e){this.view[t++]=e}.bind(this)),n?(this.offset=t,this):t-i},r.writeString=r.writeUTF8String,t.calculateUTF8Chars=function(e){return c.calculateUTF16asUTF8(a(e))[0]},t.calculateUTF8Bytes=function(e){return c.calculateUTF16asUTF8(a(e))[1]},t.calculateString=t.calculateUTF8Bytes,r.readUTF8String=function(e,r,n){"number"==typeof r&&(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),void 0===r&&(r=t.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var a,s=0,u=n;if(r===t.METRICS_CHARS){if(a=o(),c.decodeUTF8(function(){return s<e&&n<this.limit?this.view[n++]:null}.bind(this),(function(e){++s,c.UTF8toUTF16(e,a)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=n,a()):{string:a(),length:n-u}}if(r===t.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+"+e+") <= "+this.buffer.byteLength)}var l=n+e;if(c.decodeUTF8toUTF16(function(){return n<l?this.view[n++]:null}.bind(this),a=o(),this.noAssert),n!==l)throw RangeError("Illegal range: Truncated data, "+n+" == "+l);return i?(this.offset=n,a()):{string:a(),length:n-u}}throw TypeError("Unsupported metrics: "+r)},r.readString=r.readUTF8String,r.writeVString=function(e,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var i,o,s=r;i=c.calculateUTF16asUTF8(a(e),this.noAssert)[1],o=t.calculateVarint32(i),r+=o+i;var u=this.buffer.byteLength;if(r>u&&this.resize((u*=2)>r?u:r),r-=o+i,r+=this.writeVarint32(i,r),c.encodeUTF16toUTF8(a(e),function(e){this.view[r++]=e}.bind(this)),r!==s+i+o)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+i+o));return n?(this.offset=r,this):r-s},r.readVString=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,i=this.readVarint32(e),a=this.readUTF8String(i.value,t.METRICS_BYTES,e+=i.length);return e+=a.length,r?(this.offset=e,a.string):{string:a.string,length:e-n}},r.append=function(e,r,n){"number"!=typeof r&&"string"==typeof r||(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var a=e.limit-e.offset;if(a<=0)return this;n+=a;var o=this.buffer.byteLength;return n>o&&this.resize((o*=2)>n?o:n),n-=a,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=a,i&&(this.offset+=a),this},r.appendTo=function(e,t){return e.append(this,t),this},r.assert=function(e){return this.noAssert=!e,this},r.capacity=function(){return this.buffer.byteLength},r.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},r.clone=function(e){var r=new t(0,this.littleEndian,this.noAssert);return e?(r.buffer=new ArrayBuffer(this.buffer.byteLength),r.view=new Uint8Array(r.buffer)):(r.buffer=this.buffer,r.view=this.view),r.offset=this.offset,r.markedOffset=this.markedOffset,r.limit=this.limit,r},r.compact=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var r=t-e;if(0===r)return this.buffer=n,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var i=new ArrayBuffer(r),a=new Uint8Array(i);return a.set(this.view.subarray(e,t)),this.buffer=i,this.view=a,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=r,this},r.copy=function(e,r){if(void 0===e&&(e=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(e===r)return new t(0,this.littleEndian,this.noAssert);var n=r-e,i=new t(n,this.littleEndian,this.noAssert);return i.offset=0,i.limit=n,i.markedOffset>=0&&(i.markedOffset-=e),this.copyTo(i,0,e,r),i},r.copyTo=function(e,r,n,i){var a,o;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(o=void 0===r)?e.offset:0|r,n=(a=void 0===n)?this.offset:0|n,i=void 0===i?this.limit:0|i,r<0||r>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+r+" <= "+e.buffer.byteLength);if(n<0||i>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var s=i-n;return 0===s?e:(e.ensureCapacity(r+s),e.view.set(this.view.subarray(n,i),r),a&&(this.offset+=s),o&&(e.offset+=s),this)},r.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},r.fill=function(e,t,r){var n=void 0===t;if(n&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;t<r;)this.view[t++]=e;return n&&(this.offset=t),this},r.flip=function(){return this.limit=this.offset,this.offset=0,this},r.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},r.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},r.LE=function(e){return this.littleEndian=void 0===e||!!e,this},r.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},r.prepend=function(e,r,n){"number"!=typeof r&&"string"==typeof r||(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var a=e.limit-e.offset;if(a<=0)return this;var o=a-n;if(o>0){var s=new ArrayBuffer(this.buffer.byteLength+o),u=new Uint8Array(s);u.set(this.view.subarray(n,this.buffer.byteLength),a),this.buffer=s,this.view=u,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,n+=o}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),n-a),e.offset=e.limit,i&&(this.offset-=a),this},r.prependTo=function(e,t){return e.prepend(this,t),this},r.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},r.remaining=function(){return this.limit-this.offset},r.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},r.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),r=new Uint8Array(t);r.set(this.view),this.buffer=t,this.view=r}return this},r.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},r.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},r.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=e,r.limit=t,r},r.toBuffer=function(e){var t=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(!e&&0===t&&r===this.buffer.byteLength)return this.buffer;if(t===r)return n;var i=new ArrayBuffer(r-t);return new Uint8Array(i).set(new Uint8Array(this.buffer).subarray(t,r),0),i},r.toArrayBuffer=r.toBuffer,r.toString=function(e,t,r){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(r=t=e="utf8"),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var l=function(){for(var e={},t=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],r=[],n=0,i=t.length;n<i;++n)r[t[n]]=n;return e.encode=function(e,r){for(var n,i;null!==(n=e());)r(t[n>>2&63]),i=(3&n)<<4,null!==(n=e())?(r(t[63&((i|=n>>4&15)|n>>4&15)]),i=(15&n)<<2,null!==(n=e())?(r(t[63&(i|n>>6&3)]),r(t[63&n])):(r(t[63&i]),r(61))):(r(t[63&i]),r(61),r(61))},e.decode=function(e,t){var n,i,a;function o(e){throw Error("Illegal character code: "+e)}for(;null!==(n=e());)if(void 0===(i=r[n])&&o(n),null!==(n=e())&&(void 0===(a=r[n])&&o(n),t(i<<2>>>0|(48&a)>>4),null!==(n=e()))){if(void 0===(i=r[n])){if(61===n)break;o(n)}if(t((15&a)<<4>>>0|(60&i)>>2),null!==(n=e())){if(void 0===(a=r[n])){if(61===n)break;o(n)}t((3&i)<<6>>>0|a)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();r.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return l.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=o()),r()},t.fromBase64=function(e,r){if("string"!=typeof e)throw TypeError("str");var n=new t(e.length/4*3,r),i=0;return l.decode(a(e),(function(e){n.view[i++]=e})),n.limit=i,n},t.btoa=function(e){return t.fromBinary(e).toBase64()},t.atob=function(e){return t.fromBase64(e).toBinary()},r.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var r=[],n=[];e<t;)r.push(this.view[e++]),r.length>=1024&&(n.push(String.fromCharCode.apply(String,r)),r=[]);return n.join("")+String.fromCharCode.apply(String,r)},t.fromBinary=function(e,r){if("string"!=typeof e)throw TypeError("str");for(var n,i=0,a=e.length,o=new t(a,r);i<a;){if((n=e.charCodeAt(i))>255)throw RangeError("illegal char code: "+n);o.view[i++]=n}return o.limit=a,o},r.toDebug=function(e){for(var t,r=-1,n=this.buffer.byteLength,i="",a="",o="";r<n;){if(-1!==r&&(i+=(t=this.view[r])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(a+=t>32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==n){for(;i.length<51;)i+=" ";o+=i+a+"\n",i=a=""}r===this.offset&&r===this.limit?i+=r===this.markedOffset?"!":"|":r===this.offset?i+=r===this.markedOffset?"[":"<":r===this.limit?i+=r===this.markedOffset?"]":">":i+=r===this.markedOffset?"'":e||0!==r&&r!==n?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";o+=i+a+"\n"}return e?o:i},t.fromDebug=function(e,r,n){for(var i,a,o=e.length,s=new t((o+1)/3|0,r,n),u=0,l=0,c=!1,f=!1,d=!1,_=!1,h=!1;u<o;){switch(i=e.charAt(u++)){case"!":if(!n){if(f||d||_){h=!0;break}f=d=_=!0}s.offset=s.markedOffset=s.limit=l,c=!1;break;case"|":if(!n){if(f||_){h=!0;break}f=_=!0}s.offset=s.limit=l,c=!1;break;case"[":if(!n){if(f||d){h=!0;break}f=d=!0}s.offset=s.markedOffset=l,c=!1;break;case"<":if(!n){if(f){h=!0;break}f=!0}s.offset=l,c=!1;break;case"]":if(!n){if(_||d){h=!0;break}_=d=!0}s.limit=s.markedOffset=l,c=!1;break;case">":if(!n){if(_){h=!0;break}_=!0}s.limit=l,c=!1;break;case"'":if(!n){if(d){h=!0;break}d=!0}s.markedOffset=l,c=!1;break;case" ":c=!1;break;default:if(!n&&c){h=!0;break}if(a=parseInt(i+e.charAt(u++),16),!n&&(isNaN(a)||a<0||a>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[l++]=a,c=!0}if(h)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!n){if(!f||!_)throw TypeError("Illegal str: Missing offset or limit");if(l<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+o)}return s},r.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var r,n=new Array(t-e);e<t;)(r=this.view[e++])<16?n.push("0",r.toString(16)):n.push(r.toString(16));return n.join("")},t.fromHex=function(e,r,n){if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var i,a=e.length,o=new t(a/2|0,r),s=0,u=0;s<a;s+=2){if(i=parseInt(e.substring(s,s+2),16),!n&&(!isFinite(i)||i<0||i>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[u++]=i}return o.limit=u,o};var c=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<128?t(127&r):r<2048?(t(r>>6&31|192),t(63&r|128)):r<65536?(t(r>>12&15|224),t(r>>6&63|128),t(63&r|128)):(t(r>>18&7|240),t(r>>12&63|128),t(r>>6&63|128),t(63&r|128)),r=null},decodeUTF8:function(e,t){for(var r,n,i,a,o=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(r=e());)if(128&r)if(192==(224&r))null===(n=e())&&o([r,n]),t((31&r)<<6|63&n);else if(224==(240&r))(null===(n=e())||null===(i=e()))&&o([r,n,i]),t((15&r)<<12|(63&n)<<6|63&i);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(n=e())||null===(i=e())||null===(a=e()))&&o([r,n,i,a]),t((7&r)<<18|(63&n)<<12|(63&i)<<6|63&a)}else t(r)},UTF16toUTF8:function(e,t){for(var r,n=null;null!==(r=null!==n?n:e());)r>=55296&&r<=57343&&null!==(n=e())&&n>=56320&&n<=57343?(t(1024*(r-55296)+n-56320+65536),n=null):t(r);null!==n&&t(n)},UTF8toUTF16:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<=65535?t(r):(t(55296+((r-=65536)>>10)),t(r%1024+56320)),r=null},encodeUTF16toUTF8:function(t,r){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,r)}))},decodeUTF8toUTF16:function(t,r){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,r)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,r=0;null!==(t=e());)r+=t<128?1:t<2048?2:t<65536?3:4;return r},calculateUTF16asUTF8:function(t){var r=0,n=0;return e.UTF16toUTF8(t,(function(e){++r,n+=e<128?1:e<2048?2:e<65536?3:4})),[r,n]}};return e}();return r.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{c.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),r=o())}catch(r){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},t.fromUTF8=function(e,r,n){if(!n&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new t(c.calculateUTF16asUTF8(a(e),!0)[1],r,n),o=0;return c.encodeUTF16toUTF8(a(e),(function(e){i.view[o++]=e})),i.limit=o,i},t}(function(){function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},n={};function i(e,t){var i,a,s;return t?(s=0<=(e>>>=0)&&e<256)&&(a=n[e])?a:(i=o(e,(0|e)<0?-1:0,!0),s&&(n[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(a=r[e])?a:(i=o(e,e<0?-1:0,!1),s&&(r[e]=i),i)}function a(e,t){if(isNaN(e)||!isFinite(e))return t?g:h;if(t){if(e<0)return g;if(e>=f)return T}else{if(e<=-d)return v;if(e+1>=d)return I}return e<0?a(-e,t).neg():o(e%c|0,e/c|0,t)}function o(t,r,n){return new e(t,r,n)}e.fromInt=i,e.fromNumber=a,e.fromBits=o;var s=Math.pow;function u(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return h;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return u(e.substring(1),t,r).neg();for(var i=a(s(r,8)),o=h,l=0;l<e.length;l+=8){var c=Math.min(8,e.length-l),f=parseInt(e.substring(l,l+c),r);if(c<8){var d=a(s(r,c));o=o.mul(d).add(a(f))}else o=(o=o.mul(i)).add(a(f))}return o.unsigned=t,o}function l(t){return t instanceof e?t:"number"==typeof t?a(t):"string"==typeof t?u(t):o(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=l;var c=4294967296,f=c*c,d=f/2,_=i(1<<24),h=i(0);e.ZERO=h;var g=i(0,!0);e.UZERO=g;var p=i(1);e.ONE=p;var b=i(1,!0);e.UONE=b;var E=i(-1);e.NEG_ONE=E;var I=o(-1,2147483647,!1);e.MAX_VALUE=I;var T=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=T;var v=o(0,-2147483648,!1);e.MIN_VALUE=v;var R=e.prototype;return R.toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},R.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(v)){var t=a(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=a(s(e,6),this.unsigned),o=this,u="";;){var l=o.div(i),c=(o.sub(l.mul(i)).toInt()>>>0).toString(e);if((o=l).isZero())return c+u;for(;c.length<6;)c="0"+c;u=""+c+u}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(v)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},R.isZero=function(){return 0===this.high&&0===this.low},R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return!(1&~this.low)},R.isEven=function(){return!(1&this.low)},R.equals=function(e){return t(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},R.eq=R.equals,R.notEquals=function(e){return!this.eq(e)},R.neq=R.notEquals,R.lessThan=function(e){return this.comp(e)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(e){return this.comp(e)<=0},R.lte=R.lessThanOrEqual,R.greaterThan=function(e){return this.comp(e)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(e){return this.comp(e)>=0},R.gte=R.greaterThanOrEqual,R.compare=function(e){if(t(e)||(e=l(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(v)?v:this.not().add(p)},R.neg=R.negate,R.add=function(e){t(e)||(e=l(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,c=e.low>>>16,f=0,d=0,_=0,h=0;return _+=(h+=a+(65535&e.low))>>>16,d+=(_+=i+c)>>>16,f+=(d+=n+u)>>>16,f+=r+s,o((_&=65535)<<16|(h&=65535),(f&=65535)<<16|(d&=65535),this.unsigned)},R.subtract=function(e){return t(e)||(e=l(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){if(this.isZero())return h;if(t(e)||(e=l(e)),e.isZero())return h;if(this.eq(v))return e.isOdd()?v:h;if(e.eq(v))return this.isOdd()?v:h;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(_)&&e.lt(_))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=e.high>>>16,c=65535&e.high,f=e.low>>>16,d=65535&e.low,g=0,p=0,b=0,E=0;return b+=(E+=s*d)>>>16,p+=(b+=i*d)>>>16,b&=65535,p+=(b+=s*f)>>>16,g+=(p+=n*d)>>>16,p&=65535,g+=(p+=i*f)>>>16,p&=65535,g+=(p+=s*c)>>>16,g+=r*d+n*f+i*c+s*u,o((b&=65535)<<16|(E&=65535),(g&=65535)<<16|(p&=65535),this.unsigned)},R.mul=R.multiply,R.divide=function(e){if(t(e)||(e=l(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:h;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return b;i=g}else{if(this.eq(v))return e.eq(p)||e.eq(E)?v:e.eq(v)?p:(r=this.shr(1).div(e).shl(1)).eq(h)?e.isNegative()?p:E:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(v))return this.unsigned?g:h;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=h}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),u=o<=48?1:s(2,o-48),c=a(r),f=c.mul(e);f.isNegative()||f.gt(n);)f=(c=a(r-=u,this.unsigned)).mul(e);c.isZero()&&(c=p),i=i.add(c),n=n.sub(f)}return i},R.div=R.divide,R.modulo=function(e){return t(e)||(e=l(e)),this.sub(this.div(e).mul(e))},R.mod=R.modulo,R.not=function(){return o(~this.low,~this.high,this.unsigned)},R.and=function(e){return t(e)||(e=l(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return t(e)||(e=l(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return t(e)||(e=l(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},R.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(0,this.low<<e-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var r=this.high;return e<32?o(this.low>>>e|r<<32-e,r>>>e,this.unsigned):o(32===e?r:r>>>e-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},R.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e}());return t.ByteBuffer=r,t.Long=r.Long||null,t.VERSION="5.0.3",t.WIRE_TYPES={},t.WIRE_TYPES.VARINT=0,t.WIRE_TYPES.BITS64=1,t.WIRE_TYPES.LDELIM=2,t.WIRE_TYPES.STARTGROUP=3,t.WIRE_TYPES.ENDGROUP=4,t.WIRE_TYPES.BITS32=5,t.PACKABLE_WIRE_TYPES=[t.WIRE_TYPES.VARINT,t.WIRE_TYPES.BITS64,t.WIRE_TYPES.BITS32],t.TYPES={int32:{name:"int32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.ZERO:void 0},uint64:{name:"uint64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.UZERO:void 0},sint64:{name:"sint64",wireType:t.WIRE_TYPES.VARINT,defaultValue:t.Long?t.Long.ZERO:void 0},bool:{name:"bool",wireType:t.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:t.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:t.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:t.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:t.WIRE_TYPES.BITS64,defaultValue:t.Long?t.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:t.WIRE_TYPES.BITS64,defaultValue:t.Long?t.Long.ZERO:void 0},float:{name:"float",wireType:t.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:t.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:t.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:t.WIRE_TYPES.STARTGROUP,defaultValue:null}},t.MAP_KEY_TYPES=[t.TYPES.int32,t.TYPES.sint32,t.TYPES.sfixed32,t.TYPES.uint32,t.TYPES.fixed32,t.TYPES.int64,t.TYPES.sint64,t.TYPES.sfixed64,t.TYPES.uint64,t.TYPES.fixed64,t.TYPES.bool,t.TYPES.string,t.TYPES.bytes],t.ID_MIN=1,t.ID_MAX=536870911,t.convertFieldsToCamelCase=!1,t.populateAccessors=!0,t.populateDefaults=!0,t.Util=((e={}).IS_NODE=!("object"!=typeof process||process+""!="[object process]"||process.browser),e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e),t.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,FQTYPEREF:/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},t.DotProto=function(e,t){var r={},n=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},i=n.prototype;i._readString=function(){var e='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;e.lastIndex=this.index-1;var r=e.exec(this.source);if(!r)throw Error("unterminated string");return this.index=e.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,r[1]},i.next=function(){if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var e,r,n;do{for(e=!1;t.WHITESPACE.test(n=this.source.charAt(this.index));)if("\n"===n&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(n=this.source.charAt(this.index)))return"/";do{if("\n"===n&&++this.line,++this.index===this.source.length)return null;r=n,n=this.source.charAt(this.index)}while("*"!==r||"/"!==n);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;var i=this.index;if(t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(i++)))for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;var a=this.source.substring(this.index,this.index=i);return'"'!==a&&"'"!==a||(this._stringOpen=a),a},i.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},i.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},i.omit=function(e){return this.peek()===e&&(this.next(),!0)},i.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},r.Tokenizer=n;var a=function(e){this.tn=new n(e),this.proto3=!1},o=a.prototype;function s(e,r){var n=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))n=parseInt(e);else if(t.NUMBER_HEX.test(e))n=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);n=parseInt(e.substring(1),8)}if(n=i*n|0,!r&&n<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return n}function u(e){var r=1;if("-"==e.charAt(0)&&(r=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return r*parseInt(e,10);if(t.NUMBER_HEX.test(e))return r*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return r*parseInt(e.substring(1),8);if("inf"===e)return r*(1/0);if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return r*parseFloat(e);throw Error("illegal number value: "+(r<0?"-":"")+e)}function l(e,t,r){void 0===e[t]?e[t]=r:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(r))}return o.parse=function(){var e,r,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},i=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!i||null!==n.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),n.package=e;break;case"import":if(!i)throw Error("unexpected 'import'");("public"===(e=this.tn.peek())||(r="weak"===e))&&this.tn.next(),e=this._readString(),this.tn.skip(";"),r||n.imports.push(e);break;case"syntax":if(!i)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),i=!1;break;case"enum":this._parseEnum(n),i=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete n.name,n},a.parse=function(e){return new a(e).parse()},o._readString=function(){var e,t,r="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);r+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return r},o._readValue=function(e){var r=this.tn.peek();if('"'===r||"'"===r)return this._readString();if(this.tn.next(),t.NUMBER.test(r))return u(r);if(t.BOOL.test(r))return"true"===r.toLowerCase();if(e&&t.TYPEREF.test(r))return r;throw Error("illegal value: "+r)},o._parseOption=function(e,r){var n=this.tn.next(),i=!1;if("("===n&&(i=!0,n=this.tn.next()),!t.TYPEREF.test(n))throw Error("illegal option name: "+n);var a=n;i&&(this.tn.skip(")"),a="("+a+")",n=this.tn.peek(),t.FQTYPEREF.test(n)&&(a+=n,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,a),r||this.tn.skip(";")},o._parseOptionValue=function(e,r){var n=this.tn.peek();if("{"!==n)l(e.options,r,this._readValue(!0));else for(this.tn.skip("{");"}"!==(n=this.tn.next());){if(!t.NAME.test(n))throw Error("illegal option name: "+r+"."+n);this.tn.omit(":")?l(e.options,r+"."+n,this._readValue(!0)):this._parseOptionValue(e,r+"."+n)}},o._parseService=function(e){var r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal service name at line "+this.tn.line+": "+r);var n={name:r,rpc:{},options:{}};for(this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(n);else{if("rpc"!==r)throw Error("illegal service token: "+r);this._parseServiceRPC(n)}this.tn.omit(";"),e.services.push(n)},o._parseServiceRPC=function(e){var r="rpc",n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal rpc service method name: "+n);var i=n,a={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),"stream"===(n=this.tn.next()).toLowerCase()&&(a.request_stream=!0,n=this.tn.next()),!t.TYPEREF.test(n))throw Error("illegal rpc service request type: "+n);if(a.request=n,this.tn.skip(")"),"returns"!==(n=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+n);if(this.tn.skip("("),"stream"===(n=this.tn.next()).toLowerCase()&&(a.response_stream=!0,n=this.tn.next()),a.response=n,this.tn.skip(")"),"{"===(n=this.tn.peek())){for(this.tn.next();"}"!==(n=this.tn.next());){if("option"!==n)throw Error("illegal rpc service token: "+n);this._parseOption(a)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[r]&&(e[r]={}),e[r][i]=a},o._parseMessage=function(e,r){var n=!!r,i=this.tn.next(),a={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(i))throw Error("illegal "+(n?"group":"message")+" name: "+i);for(a.name=i,n&&(this.tn.skip("="),r.id=s(this.tn.next()),a.isGroup=!0),"["===(i=this.tn.peek())&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(i=this.tn.next());)if(t.RULE.test(i))this._parseMessageField(a,i);else if("oneof"===i)this._parseMessageOneOf(a);else if("enum"===i)this._parseEnum(a);else if("message"===i)this._parseMessage(a);else if("option"===i)this._parseOption(a);else if("service"===i)this._parseService(a);else if("extensions"===i)a.hasOwnProperty("extensions")?a.extensions=a.extensions.concat(this._parseExtensionRanges()):a.extensions=this._parseExtensionRanges();else if("reserved"===i)this._parseIgnored();else if("extend"===i)this._parseExtend(a);else{if(!t.TYPEREF.test(i))throw Error("illegal message token: "+i);if(!this.proto3)throw Error("illegal field rule: "+i);this._parseMessageField(a,"optional",i)}return this.tn.omit(";"),e.messages.push(a),a},o._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},o._parseMessageField=function(e,r,n){if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);var i,a={rule:r,type:"",name:"",options:{},id:0};if("map"===r){if(n)throw Error("illegal type: "+n);if(this.tn.skip("<"),i=this.tn.next(),!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(a.keytype=i,this.tn.skip(","),i=this.tn.next(),!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field: "+i);if(a.type=i,this.tn.skip(">"),i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);a.name=i,this.tn.skip("="),a.id=s(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(a),this.tn.skip(";")}else if("group"===(n=void 0!==n?n:this.tn.next())){var o=this._parseMessage(e,a);if(!/^[A-Z]/.test(o.name))throw Error("illegal group name: "+o.name);a.type=o.name,a.name=o.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(n)&&!t.TYPEREF.test(n))throw Error("illegal message field type: "+n);if(a.type=n,i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);a.name=i,this.tn.skip("="),a.id=s(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(a),this.tn.skip(";")}return e.fields.push(a),a},o._parseMessageOneOf=function(e){var r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal oneof name: "+r);var n,i=r,a=[];for(this.tn.skip("{");"}"!==(r=this.tn.next());)(n=this._parseMessageField(e,"optional",r)).oneof=i,a.push(n.id);this.tn.omit(";"),e.oneofs[i]=a},o._parseFieldOptions=function(e){this.tn.skip("[");for(var t=!0;"]"!==this.tn.peek();)t||this.tn.skip(","),this._parseOption(e,!0),t=!1;this.tn.next()},o._parseEnum=function(e){var r={name:"",values:[],options:{}},n=this.tn.next();if(!t.NAME.test(n))throw Error("illegal name: "+n);for(r.name=n,this.tn.skip("{");"}"!==(n=this.tn.next());)if("option"===n)this._parseOption(r);else{if(!t.NAME.test(n))throw Error("illegal name: "+n);this.tn.skip("=");var i={name:n,id:s(this.tn.next(),!0)};"["===(n=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),r.values.push(i)}this.tn.omit(";"),e.enums.push(r)},o._parseExtensionRanges=function(){var t,r,n,i=[];do{for(r=[];;){switch(t=this.tn.next()){case"min":n=e.ID_MIN;break;case"max":n=e.ID_MAX;break;default:n=u(t)}if(r.push(n),2===r.length)break;if("to"!==this.tn.peek()){r.push(n);break}this.tn.next()}i.push(r)}while(this.tn.omit(","));return this.tn.skip(";"),i},o._parseExtend=function(e){var r=this.tn.next();if(!t.TYPEREF.test(r))throw Error("illegal extend reference: "+r);var n={ref:r,fields:[]};for(this.tn.skip("{");"}"!==(r=this.tn.next());)if(t.RULE.test(r))this._parseMessageField(n,r);else{if(!t.TYPEREF.test(r))throw Error("illegal extend token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(n,"optional",r)}return this.tn.omit(";"),e.messages.push(n),n},o.toString=function(){return"Parser at line "+this.tn.line},r.Parser=a,r}(t,t.Lang),t.Reflect=function(e){var t={},n=function(e,t,r){this.builder=e,this.parent=t,this.name=r,this.className},i=n.prototype;i.fqn=function(){for(var e=this.name,t=this;;){if(null==(t=t.parent))break;e=t.name+"."+e}return e},i.toString=function(e){return(e?this.className+" ":"")+this.fqn()},i.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},t.T=n;var a=function(e,t,r,i,a){n.call(this,e,t,r),this.className="Namespace",this.children=[],this.options=i||{},this.syntax=a||"proto2"},o=a.prototype=Object.create(n.prototype);o.getChildren=function(e){if(null==(e=e||null))return this.children.slice();for(var t=[],r=0,n=this.children.length;r<n;++r)this.children[r]instanceof e&&t.push(this.children[r]);return t},o.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof c.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof c.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},o.getChild=function(e){for(var t="number"==typeof e?"id":"name",r=0,n=this.children.length;r<n;++r)if(this.children[r][t]===e)return this.children[r];return null},o.resolve=function(e,r){var n,i="string"==typeof e?e.split("."):e,a=this,o=0;if(""===i[o]){for(;null!==a.parent;)a=a.parent;o++}do{do{if(!(a instanceof t.Namespace)){a=null;break}if(!(n=a.getChild(i[o]))||!(n instanceof t.T)||r&&!(n instanceof t.Namespace)){a=null;break}a=n,o++}while(o<i.length);if(null!=a)break;if(null!==this.parent)return this.parent.resolve(e,r)}while(null!=a);return a},o.qn=function(e){var r=[],n=e;do{r.unshift(n.name),n=n.parent}while(null!==n);for(var i=1;i<=r.length;i++){var a=r.slice(r.length-i);if(e===this.resolve(a,e instanceof t.Namespace))return a.join(".")}return e.fqn()},o.build=function(){for(var e,t={},r=this.children,n=0,i=r.length;n<i;++n)(e=r[n])instanceof a&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},o.buildOpt=function(){for(var e={},t=Object.keys(this.options),r=0,n=t.length;r<n;++r){var i=t[r],a=this.options[t[r]];e[i]=a}return e},o.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},t.Namespace=a;var s=function(t,r,n,i,a){if(this.type=t,this.resolvedType=r,this.isMapKey=n,this.syntax=i,this.name=a,n&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=s.prototype;function l(t,r){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===r?t.unsigned:r);if("string"==typeof t)return e.Long.fromString(t,r||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,r||!1);throw Error("not convertible to Long")}s.defaultFieldValue=function(t){if("string"==typeof t&&(t=e.TYPES[t]),void 0===t.defaultValue)throw Error("default value for type "+t.name+" is not supported");return t==e.TYPES.bytes?new r(0):t.defaultValue},u.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"},u.verifyValue=function(t){var n=this;function i(e,t){throw Error("Illegal value for "+n.toString(!0)+" of type "+n.type.name+": "+e+" ("+t+")")}switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),t>4294967295?0|t:t;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),t<0?t>>>0:t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return l(t,!1)}catch(e){i(typeof t,e.message)}else i(typeof t,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return l(t,!0)}catch(e){i(typeof t,e.message)}else i(typeof t,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof t&&i(typeof t,"not a boolean"),t;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof t&&i(typeof t,"not a number"),t;case e.TYPES.string:return"string"==typeof t||t&&t instanceof String||i(typeof t,"not a string"),""+t;case e.TYPES.bytes:return r.isByteBuffer(t)?t:r.wrap(t,"base64");case e.TYPES.enum:var a=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(s=0;s<a.length;s++){if(a[s].name==t)return a[s].id;if(a[s].id==t)return a[s].id}if("proto3"===this.syntax)return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),(t>4294967295||t<0)&&i(typeof t,"not in range for uint32"),t;i(t,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(t&&"object"==typeof t||i(typeof t,"object expected"),t instanceof this.resolvedType.clazz)return t;if(t instanceof e.Builder.Message){var o={};for(var s in t)t.hasOwnProperty(s)&&(o[s]=t[s]);t=o}return new this.resolvedType.clazz(t)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+t+" (undefined type "+this.type+")")},u.calculateLength=function(t,n){if(null===n)return 0;var i;switch(this.type){case e.TYPES.int32:return n<0?r.calculateVarint64(n):r.calculateVarint32(n);case e.TYPES.uint32:return r.calculateVarint32(n);case e.TYPES.sint32:return r.calculateVarint32(r.zigZagEncode32(n));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return r.calculateVarint64(n);case e.TYPES.sint64:return r.calculateVarint64(r.zigZagEncode64(n));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return r.calculateVarint32(n);case e.TYPES.double:return 8;case e.TYPES.string:return i=r.calculateUTF8Bytes(n),r.calculateVarint32(i)+i;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");return r.calculateVarint32(n.remaining())+n.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(n),r.calculateVarint32(i)+i;case e.TYPES.group:return(i=this.resolvedType.calculate(n))+r.calculateVarint32(t<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")},u.encodeValue=function(t,n,i){if(null===n)return i;switch(this.type){case e.TYPES.int32:n<0?i.writeVarint64(n):i.writeVarint32(n);break;case e.TYPES.uint32:i.writeVarint32(n);break;case e.TYPES.sint32:i.writeVarint32ZigZag(n);break;case e.TYPES.fixed32:i.writeUint32(n);break;case e.TYPES.sfixed32:i.writeInt32(n);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(n);break;case e.TYPES.sint64:i.writeVarint64ZigZag(n);break;case e.TYPES.fixed64:i.writeUint64(n);break;case e.TYPES.sfixed64:i.writeInt64(n);break;case e.TYPES.bool:"string"==typeof n?i.writeVarint32("false"===n.toLowerCase()?0:!!n):i.writeVarint32(n?1:0);break;case e.TYPES.enum:i.writeVarint32(n);break;case e.TYPES.float:i.writeFloat32(n);break;case e.TYPES.double:i.writeFloat64(n);break;case e.TYPES.string:i.writeVString(n);break;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");var a=n.offset;i.writeVarint32(n.remaining()),i.append(n),n.offset=a;break;case e.TYPES.message:var o=(new r).LE();this.resolvedType.encode(n,o),i.writeVarint32(o.offset),i.append(o.flip());break;case e.TYPES.group:this.resolvedType.encode(n,i),i.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")}return i},u.decode=function(t,r,n){if(r!=this.type.wireType)throw Error("Unexpected wire type for element");var i,a;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(a=t.readVarint32(),t.remaining()<a)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+a+" required but got only "+t.remaining());return(i=t.clone()).limit=i.offset+a,t.offset+=a,i;case e.TYPES.message:return a=t.readVarint32(),this.resolvedType.decode(t,a);case e.TYPES.group:return this.resolvedType.decode(t,-1,n)}throw Error("[INTERNAL] Illegal decode type")},u.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return r.fromBinary(t)}},u.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},t.Element=s;var c=function(e,t,r,n,i,o){a.call(this,e,t,r,n,o),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},f=c.prototype=Object.create(a.prototype);function d(t,r){var n=r.readVarint32(),i=7&n,a=n>>>3;switch(i){case e.WIRE_TYPES.VARINT:do{n=r.readUint8()}while(!(128&~n));break;case e.WIRE_TYPES.BITS64:r.offset+=8;break;case e.WIRE_TYPES.LDELIM:n=r.readVarint32(),r.offset+=n;break;case e.WIRE_TYPES.STARTGROUP:d(a,r);break;case e.WIRE_TYPES.ENDGROUP:if(a===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+a+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:r.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+i)}return!0}f.build=function(t){if(this.clazz&&!t)return this.clazz;var n=function(e,t){var n=t.getChildren(e.Reflect.Message.Field),i=t.getChildren(e.Reflect.Message.OneOf),a=function(o,s){e.Builder.Message.call(this);for(var u=0,l=i.length;u<l;++u)this[i[u].name]=null;for(u=0,l=n.length;u<l;++u){var c=n[u];this[c.name]=c.repeated?[]:c.map?new e.Map(c):null,!c.required&&"proto3"!==t.syntax||null===c.defaultValue||(this[c.name]=c.defaultValue)}var f;if(arguments.length>0)if(1!==arguments.length||null===o||"object"!=typeof o||!("function"!=typeof o.encode||o instanceof a)||Array.isArray(o)||o instanceof e.Map||r.isByteBuffer(o)||o instanceof ArrayBuffer||e.Long&&o instanceof e.Long)for(u=0,l=arguments.length;u<l;++u)void 0!==(f=arguments[u])&&this.$set(n[u].name,f);else this.$set(o)},o=a.prototype=Object.create(e.Builder.Message.prototype);o.add=function(r,n,i){var a=t._fieldsByName[r];if(!i){if(!a)throw Error(this+"#"+r+" is undefined");if(!(a instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+a.toString(!0));if(!a.repeated)throw Error(this+"#"+r+" is not a repeated field");n=a.verifyValue(n,!0)}return null===this[r]&&(this[r]=[]),this[r].push(n),this},o.$add=o.add,o.set=function(r,n,i){if(r&&"object"==typeof r){for(var a in i=n,r)r.hasOwnProperty(a)&&void 0!==(n=r[a])&&void 0===t._oneofsByName[a]&&this.$set(a,n,i);return this}var o=t._fieldsByName[r];if(i)this[r]=n;else{if(!o)throw Error(this+"#"+r+" is not a field: undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+o.toString(!0));this[o.name]=n=o.verifyValue(n)}if(o&&o.oneof){var s=this[o.oneof.name];null!==n?(null!==s&&s!==o.name&&(this[s]=null),this[o.oneof.name]=o.name):s===r&&(this[o.oneof.name]=null)}return this},o.$set=o.set,o.get=function(r,n){if(n)return this[r];var i=t._fieldsByName[r];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+i.toString(!0));return this[i.name]},o.$get=o.get;for(var s=0;s<n.length;s++){var u=n[s];u instanceof e.Reflect.Message.ExtensionField||t.builder.options.populateAccessors&&function(e){var r=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));r=r.substring(0,1).toUpperCase()+r.substring(1);var n=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),i=function(t,r){return this[e.name]=r?t:e.verifyValue(t),this},a=function(){return this[e.name]};null===t.getChild("set"+r)&&(o["set"+r]=i),null===t.getChild("set_"+n)&&(o["set_"+n]=i),null===t.getChild("get"+r)&&(o["get"+r]=a),null===t.getChild("get_"+n)&&(o["get_"+n]=a)}(u)}function l(t,n,i,a){if(null===t||"object"!=typeof t){if(a&&a instanceof e.Reflect.Enum){var o=e.Reflect.Enum.getName(a.object,t);if(null!==o)return o}return t}if(r.isByteBuffer(t))return n?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return i?t.toString():e.Long.fromValue(t);var s;if(Array.isArray(t))return s=[],t.forEach((function(e,t){s[t]=l(e,n,i,a)})),s;if(s={},t instanceof e.Map){for(var u=t.entries(),c=u.next();!c.done;c=u.next())s[t.keyElem.valueToString(c.value[0])]=l(c.value[1],n,i,t.valueElem.resolvedType);return s}var f=t.$type,d=void 0;for(var _ in t)t.hasOwnProperty(_)&&(f&&(d=f.getChild(_))?s[_]=l(t[_],n,i,d.resolvedType):s[_]=l(t[_],n,i));return s}return o.encode=function(e,n){"boolean"==typeof e&&(n=e,e=void 0);var i=!1;e||(e=new r,i=!0);var a=e.littleEndian;try{return t.encode(this,e.LE(),n),(i?e.flip():e).LE(a)}catch(t){throw e.LE(a),t}},a.encode=function(e,t,r){return new a(e).encode(t,r)},o.calculate=function(){return t.calculate(this)},o.encodeDelimited=function(e,n){var i=!1;e||(e=new r,i=!0);var a=(new r).LE();return t.encode(this,a,n).flip(),e.writeVarint32(a.remaining()),e.append(a),i?e.flip():e},o.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},o.toArrayBuffer=o.encodeAB,o.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},o.toBuffer=o.encodeNB,o.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},o.toBase64=o.encode64,o.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},o.toHex=o.encodeHex,o.toRaw=function(e,t){return l(this,!!e,!!t,this.$type)},o.encodeJSON=function(){return JSON.stringify(l(this,!0,!0,this.$type))},a.decode=function(e,n,i){"string"==typeof n&&(i=n,n=-1),"string"==typeof e?e=r.wrap(e,i||"base64"):r.isByteBuffer(e)||(e=r.wrap(e));var a=e.littleEndian;try{var o=t.decode(e.LE(),n);return e.LE(a),o}catch(t){throw e.LE(a),t}},a.decodeDelimited=function(e,n){if("string"==typeof e?e=r.wrap(e,n||"base64"):r.isByteBuffer(e)||(e=r.wrap(e)),e.remaining()<1)return null;var i=e.offset,a=e.readVarint32();if(e.remaining()<a)return e.offset=i,null;try{var o=t.decode(e.slice(e.offset,e.offset+a).LE());return e.offset+=a,o}catch(t){throw e.offset+=a,t}},a.decode64=function(e){return a.decode(e,"base64")},a.decodeHex=function(e){return a.decode(e,"hex")},a.decodeJSON=function(e){return new a(JSON.parse(e))},o.toString=function(){return t.toString()},Object.defineProperty&&(Object.defineProperty(a,"$options",{value:t.buildOpt()}),Object.defineProperty(o,"$options",{value:a.$options}),Object.defineProperty(a,"$type",{value:t}),Object.defineProperty(o,"$type",{value:t})),a}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={},this._oneofsByName={};for(var i,a=0,o=this.children.length;a<o;a++)if((i=this.children[a])instanceof p||i instanceof c||i instanceof I){if(n.hasOwnProperty(i.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+i.toString(!0)+" cannot override static property '"+i.name+"'");n[i.name]=i.build()}else if(i instanceof c.Field)i.build(),this._fields.push(i),this._fieldsById[i.id]=i,this._fieldsByName[i.name]=i;else if(i instanceof c.OneOf)this._oneofsByName[i.name]=i;else if(!(i instanceof c.OneOf||i instanceof E))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[a].toString(!0));return this.clazz=n},f.encode=function(e,t,r){for(var n,i,a=null,o=0,s=this._fields.length;o<s;++o)i=e[(n=this._fields[o]).name],n.required&&null===i?null===a&&(a=n):n.encode(r?i:n.verifyValue(i),t,e);if(null!==a){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+a);throw u.encoded=t,u}return t},f.calculate=function(e){for(var t,r,n=0,i=0,a=this._fields.length;i<a;++i){if(r=e[(t=this._fields[i]).name],t.required&&null===r)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);n+=t.calculate(r,e)}return n},f.decode=function(t,r,n){"number"!=typeof r&&(r=-1);for(var i,a,o,s,u=t.offset,l=new this.clazz;t.offset<u+r||-1===r&&t.remaining()>0;){if(o=(i=t.readVarint32())>>>3,(a=7&i)===e.WIRE_TYPES.ENDGROUP){if(o!==n)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+o+" ("+(n?n+" expected":"not a group")+")");break}if(s=this._fieldsById[o]){if(s.repeated&&!s.options.packed)l[s.name].push(s.decode(a,t));else if(s.map){var c=s.decode(a,t);l[s.name].set(c[0],c[1])}else if(l[s.name]=s.decode(a,t),s.oneof){var f=l[s.oneof.name];null!==f&&f!==s.name&&(l[f]=null),l[s.oneof.name]=s.name}}else switch(a){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:var _=t.readVarint32();t.offset+=_;break;case e.WIRE_TYPES.STARTGROUP:for(;d(o,t););break;default:throw Error("Illegal wire type for unknown field "+o+" in "+this.toString(!0)+"#decode: "+a)}}for(var h=0,g=this._fields.length;h<g;++h)if(null===l[(s=this._fields[h]).name])if("proto3"===this.syntax)l[s.name]=s.defaultValue;else{if(s.required){var p=Error("Missing at least one required field for "+this.toString(!0)+": "+s.name);throw p.decoded=l,p}e.populateDefaults&&null!==s.defaultValue&&(l[s.name]=s.defaultValue)}return l},t.Message=c;var _=function(t,r,i,a,o,s,u,l,f,d){n.call(this,t,r,s),this.className="Message.Field",this.required="required"===i,this.repeated="repeated"===i,this.map="map"===i,this.keyType=a||null,this.type=o,this.resolvedType=null,this.id=u,this.options=l||{},this.defaultValue=null,this.oneof=f||null,this.syntax=d||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof c.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},h=_.prototype=Object.create(n.prototype);h.build=function(){this.element=new s(this.type,this.resolvedType,!1,this.syntax,this.name),this.map&&(this.keyElement=new s(this.keyType,void 0,!0,this.syntax,this.name)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=s.defaultFieldValue(this.type)},h.verifyValue=function(t,r){r=r||!1;var n,i=this;function a(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}if(null===t)return this.required&&a(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&a(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!r){Array.isArray(t)||(t=[t]);var o=[];for(n=0;n<t.length;n++)o.push(this.element.verifyValue(t[n]));return o}return this.map&&!r?t instanceof e.Map?t:(t instanceof Object||a(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&a(typeof t,"no array expected"),this.element.verifyValue(t))},h.hasWirePresence=function(t,r){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&r[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},h.encode=function(t,n,i){if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return n;try{var a;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.ensureCapacity(n.offset+=1);var o=n.offset;for(a=0;a<t.length;a++)this.element.encodeValue(this.id,t[a],n);var s=n.offset-o,u=r.calculateVarint32(s);if(u>1){var l=n.slice(o,n.offset);o+=u-1,n.offset=o,n.append(l)}n.writeVarint32(s,o-u)}else for(a=0;a<t.length;a++)n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[a],n);else this.map?t.forEach((function(t,i,a){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.writeVarint32(o),n.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,n),n.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,n)}),this):this.hasWirePresence(t,i)&&(n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,n))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return n},h.calculate=function(t,n){if(t=this.verifyValue(t),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return 0;var i=0;try{var a,o;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),o=0,a=0;a<t.length;a++)o+=this.element.calculateLength(this.id,t[a]);i+=r.calculateVarint32(o),i+=o}else for(a=0;a<t.length;a++)i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[a]);else this.map?t.forEach((function(t,n,a){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,n)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);i+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=r.calculateVarint32(o),i+=o}),this):this.hasWirePresence(t,n)&&(i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},h.decode=function(t,r,n){var i,a;if(!(!this.map&&t==this.type.wireType||!n&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!n){a=r.readVarint32(),a=r.offset+a;for(var o=[];r.offset<a;)o.push(this.decode(this.type.wireType,r,!0));return o}if(this.map){var u=s.defaultFieldValue(this.keyType);if(i=s.defaultFieldValue(this.type),a=r.readVarint32(),r.remaining()<a)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+a+" required but got only "+r.remaining());var l=r.clone();for(l.limit=l.offset+a,r.offset+=a;l.remaining()>0;){var c=l.readVarint32();t=7&c;var f=c>>>3;if(1===f)u=this.keyElement.decode(l,t,f);else{if(2!==f)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(l,t,f)}}return[u,i]}return this.element.decode(r,t,this.id)},t.Message.Field=_;var g=function(e,t,r,n,i,a,o){_.call(this,e,t,r,null,n,i,a,o),this.extension};g.prototype=Object.create(_.prototype),t.Message.ExtensionField=g;t.Message.OneOf=function(e,t,r){n.call(this,e,t,r),this.fields=[]};var p=function(e,t,r,n,i){a.call(this,e,t,r,n,i),this.className="Enum",this.object=null};p.getName=function(e,t){for(var r,n=Object.keys(e),i=0;i<n.length;++i)if(e[r=n[i]]===t)return r;return null},(p.prototype=Object.create(a.prototype)).build=function(t){if(this.object&&!t)return this.object;for(var r=new e.Builder.Enum,n=this.getChildren(p.Value),i=0,a=n.length;i<a;++i)r[n[i].name]=n[i].id;return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=r},t.Enum=p;var b=function(e,t,r,i){n.call(this,e,t,r),this.className="Enum.Value",this.id=i};b.prototype=Object.create(n.prototype),t.Enum.Value=b;var E=function(e,t,r,i){n.call(this,e,t,r),this.field=i};E.prototype=Object.create(n.prototype),t.Extension=E;var I=function(e,t,r,n){a.call(this,e,t,r,n),this.className="Service",this.clazz=null};(I.prototype=Object.create(a.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){for(var n=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,r){setTimeout(r.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},i=n.prototype=Object.create(e.Builder.Service.prototype),a=t.getChildren(e.Reflect.Service.RPCMethod),o=0;o<a.length;o++)!function(e){i[e.name]=function(n,i){try{try{n=e.resolvedRequestType.clazz.decode(r.wrap(n))}catch(e){if(!(e instanceof TypeError))throw e}if(null===n||"object"!=typeof n)throw Error("Illegal arguments");n instanceof e.resolvedRequestType.clazz||(n=new e.resolvedRequestType.clazz(n)),this.rpcImpl(e.fqn(),n,(function(r,n){if(r)i(r);else{null===n&&(n="");try{n=e.resolvedResponseType.clazz.decode(n)}catch(e){}n&&n instanceof e.resolvedResponseType.clazz?i(null,n):i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}}))}catch(e){setTimeout(i.bind(this,e),0)}},n[e.name]=function(t,r,i){new n(t)[e.name](r,i)},Object.defineProperty&&(Object.defineProperty(n[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(i[e.name],"$options",{value:n[e.name].$options}))}(a[o]);return Object.defineProperty&&(Object.defineProperty(n,"$options",{value:t.buildOpt()}),Object.defineProperty(i,"$options",{value:n.$options}),Object.defineProperty(n,"$type",{value:t}),Object.defineProperty(i,"$type",{value:t})),n}(e,this)},t.Service=I;var T=function(e,t,r,i){n.call(this,e,t,r),this.className="Service.Method",this.options=i||{}};(T.prototype=Object.create(n.prototype)).buildOpt=o.buildOpt,t.Service.Method=T;var v=function(e,t,r,n,i,a,o,s){T.call(this,e,t,r,s),this.className="Service.RPCMethod",this.requestName=n,this.responseName=i,this.requestStream=a,this.responseStream=o,this.resolvedRequestType=null,this.resolvedResponseType=null};return v.prototype=Object.create(T.prototype),t.Service.RPCMethod=v,t}(t),t.Builder=function(e,t,r){var n=function(e){this.ns=new r.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},i=n.prototype;function a(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,a(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}return n.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},n.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},n.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},n.isService=function(e){return!("string"!=typeof e.name||"object"!=typeof e.rpc||!e.rpc)},n.isExtend=function(e){return"string"==typeof e.ref},i.reset=function(){return this.ptr=this.ns,this},i.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach((function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new r.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},i.create=function(t){if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(var i=[t];i.length>0;){if(t=i.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){var a=t.shift();if(n.isMessage(a)){var o=new r.Message(this,this.ptr,a.name,a.options,a.isGroup,a.syntax),s={};a.oneofs&&Object.keys(a.oneofs).forEach((function(e){o.addChild(s[e]=new r.Message.OneOf(this,o,e))}),this),a.fields&&a.fields.forEach((function(e){if(null!==o.getChild(0|e.id))throw Error("duplicate or invalid field id in "+o.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+o.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=s[e.oneof]))throw Error("illegal oneof in "+o.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,a.syntax),t&&t.fields.push(e),o.addChild(e)}),this);var u=[];if(a.enums&&a.enums.forEach((function(e){u.push(e)})),a.messages&&a.messages.forEach((function(e){u.push(e)})),a.services&&a.services.forEach((function(e){u.push(e)})),a.extensions&&("number"==typeof a.extensions[0]?o.extensions=[a.extensions]:o.extensions=a.extensions),this.ptr.addChild(o),u.length>0){i.push(t),t=u,u=null,this.ptr=o,o=null;continue}u=null}else if(n.isEnum(a))o=new r.Enum(this,this.ptr,a.name,a.options,a.syntax),a.values.forEach((function(e){o.addChild(new r.Enum.Value(this,o,e.name,e.id))}),this),this.ptr.addChild(o);else if(n.isService(a))o=new r.Service(this,this.ptr,a.name,a.options),Object.keys(a.rpc).forEach((function(e){var t=a.rpc[e];o.addChild(new r.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(o);else{if(!n.isExtend(a))throw Error("not a valid definition: "+JSON.stringify(a));if(o=this.ptr.resolve(a.ref,!0))a.fields.forEach((function(t){if(null!==o.getChild(0|t.id))throw Error("duplicate extended field id in "+o.name+": "+t.id);if(o.extensions){var n=!1;if(o.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)})),!n)throw Error("illegal extended field id in "+o.name+": "+t.id+" (not within valid ranges)")}var i=t.name;this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i));var a=new r.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),s=new r.Extension(this,this.ptr,t.name,a);a.extension=s,this.ptr.addChild(s),o.addChild(a)}),this);else if(!/\.?google\.protobuf\./.test(a.ref))throw Error("extended message "+a.ref+" is not defined")}a=null,o=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},i.import=function(t,r){var n="/";if("string"==typeof r){if(e.Util.IS_NODE&&(r=require("path").resolve(r)),!0===this.files[r])return this.reset();this.files[r]=!0}else if("object"==typeof r){var i,o=r.root;if(e.Util.IS_NODE&&(o=require("path").resolve(o)),(o.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(n="\\"),i=e.Util.IS_NODE?require("path").join(o,r.file):o+n+r.file,!0===this.files[i])return this.reset();this.files[i]=!0}if(t.imports&&t.imports.length>0){var s,u=!1;"object"==typeof r?(this.importRoot=r.root,u=!0,s=this.importRoot,r=r.file,(s.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(n="\\")):"string"==typeof r?this.importRoot?s=this.importRoot:r.indexOf("/")>=0?""===(s=r.replace(/\/[^\/]*$/,""))&&(s="/"):r.indexOf("\\")>=0?(s=r.replace(/\\[^\\]*$/,""),n="\\"):s=".":s=null;for(var l=0;l<t.imports.length;l++)if("string"==typeof t.imports[l]){if(!s)throw Error("cannot determine import root");var c=t.imports[l];if("google/protobuf/descriptor.proto"===c)continue;if(c=e.Util.IS_NODE?require("path").join(s,c):s+n+c,!0===this.files[c])continue;/\.proto$/i.test(c)&&!e.DotProto&&(c=c.replace(/\.proto$/,".json"));var f=e.Util.fetch(c);if(null===f)throw Error("failed to import '"+c+"' in '"+r+"': file not found");/\.json$/i.test(c)?this.import(JSON.parse(f+""),c):this.import(e.DotProto.Parser.parse(f),c)}else r?/\.(\w+)$/.test(r)?this.import(t.imports[l],r.replace(/^(.+)\.(\w+)$/,(function(e,t,r){return t+"_import"+l+"."+r}))):this.import(t.imports[l],r+"_import"+l):this.import(t.imports[l]);u&&(this.importRoot=null)}t.package&&this.define(t.package),t.syntax&&a(t);var d=this.ptr;return t.options&&Object.keys(t.options).forEach((function(e){d.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=d),t.enums&&(this.create(t.enums),this.ptr=d),t.services&&(this.create(t.services),this.ptr=d),t.extends&&this.create(t.extends),this.reset()},i.resolveAll=function(){var n;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof r.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof r.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(n=(this.ptr instanceof r.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=n,n instanceof r.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==n.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(n instanceof r.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=n.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}"proto3"===this.ptr.syntax&&this.ptr.repeated&&void 0===this.ptr.options.packed&&-1!==e.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType)&&(this.ptr.options.packed=!0)}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((n=this.ptr.parent.resolve(this.ptr.requestName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=n,!((n=this.ptr.parent.resolve(this.ptr.responseName,!0))&&n instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=n}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},i.build=function(e){if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(var t="string"==typeof e?e.split("."):e,r=this.result,n=0;n<t.length;n++){if(!r[t[n]]){r=null;break}r=r[t[n]]}return r},i.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},i.toString=function(){return"Builder"},n.Message=function(){},n.Enum=function(){},n.Service=function(){},n}(t,t.Lang,t.Reflect),t.Map=function(e,t){var r=function(e,r){if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),r)for(var n=Object.keys(r),i=0;i<n.length;i++){var a=this.keyElem.valueFromString(n[i]),o=this.valueElem.verifyValue(r[n[i]]);this.map[this.keyElem.valueToString(a)]={key:a,value:o}}},n=r.prototype;function i(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}return n.clear=function(){this.map={}},n.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),r=t in this.map;return delete this.map[t],r},n.entries=function(){for(var e,t=[],r=Object.keys(this.map),n=0;n<r.length;n++)t.push([(e=this.map[r[n]]).key,e.value]);return i(t)},n.keys=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].key);return i(e)},n.values=function(){for(var e=[],t=Object.keys(this.map),r=0;r<t.length;r++)e.push(this.map[t[r]].value);return i(e)},n.forEach=function(e,t){for(var r,n=Object.keys(this.map),i=0;i<n.length;i++)e.call(t,(r=this.map[n[i]]).value,r.key,this)},n.set=function(e,t){var r=this.keyElem.verifyValue(e),n=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(r)]={key:r,value:n},this},n.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));if(t in this.map)return this.map[t].value},n.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},r}(0,t.Reflect),t.loadProto=function(e,r,n){return("string"==typeof r||r&&"string"==typeof r.file&&"string"==typeof r.root)&&(n=r,r=void 0),t.loadJson(t.DotProto.Parser.parse(e),r,n)},t.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=t.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=t.populateAccessors),new t.Builder(e)},t.loadJson=function(e,r,n){return("string"==typeof r||r&&"string"==typeof r.file&&"string"==typeof r.root)&&(n=r,r=null),r&&"object"==typeof r||(r=t.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),r.import(e,n),r.resolveAll(),r},t}();var bo,Eo,Io,To,vo,Ro,mo,yo,Ao,Oo="NotifyMsg",So="SyncRequestMsg",No="UpStreamMessage",Co="DownStreamMessages",Po="ChrmDownStreamMessages",Mo="DownStreamMessage",Lo="ExtMsgData",wo="GetQNupTokenInput",Uo="GetDownloadUrlInput",Do="GetQNupTokenOutput",Go="GetDownloadUrlOutput",Vo="ChrmInput",jo="ChrmOutput",ko="ChrmPullMsg",xo="RelationQryInput",Fo="RelationQryFilter",Bo="RelationsOutput",Ho="QryRemindListReq",Yo="QryRemindListResp",Wo="CleanHisMsgInput",Jo="CleanMsgBatchReq",qo="QueryChatRoomInfoInput",Ko="QueryChatRoomInfoOutput",Qo="HistoryMsgInput",Xo="HistoryMsgOuput",Zo="SessionsAttQryInput",zo="SessionsAttOutput",$o="SessionMsgReadInput",es="DeleteSessionsInput",ts="QuerySessionsInput",rs="QuerySessionsOutPut",ns="RelationDelBatchReq",is="DeleteMsgInput",as="SetChrmKV",os="SetChrmKVS",ss="ChrmKVOutput",us="ChrmKVSOutput",ls="QueryChrmKV",cs="SetUserSettingInput",fs="SetUserSettingOutput",ds="PullUserSettingInput",_s="PullUserSettingOutput",hs="SessionReq",gs="SessionStates",ps="SessionStateModifyReq",bs="GroupUnpushQuery",Es="GroupUnpushSet",Is="GroupUnpushResult",Ts="SessionStateModifyResp",vs="TypeUnpushInput",Rs="TypeUnpushOutput",ms="GrpReadReceiptMsg",ys="ReadReceipt",As="QueryReceiptReq",Os="QueryReceiptBatchReq",Ss="ReceiptResp",Ns="QueryReceiptBatchResp",Cs="GrpReadReceiptQryResp",Ps="SessionTagAddInput",Ms="SessionTagDelInput",Ls="UserSettingNotification",ws="ReportSDKInput",Us="UltraGrpPullSes",Ds="UltraGrpPullMsg",Gs="MsgChangeReq",Vs="ModifyMsgResp",js="QueryMsgChange",xs="EventChangeList",Fs="MsgChangeList",Bs="MsgQuery",Hs="MsgQueryAck",Ys="OperateStatus",Ws="OperateStatusNotify",Js="SetRtcRoomIdInput",qs="CallInfoUpStream",Ks="CallInfoDownStream",Qs="KvInput",Xs="KvOutput",Zs="ReadReceiptMsg",zs="ReceiptQryReq",$s="QueryReceiptResp",eu="ReceiptCntQryReq",tu="ReceiptCntQryResp",ru="UpdateUserSubReq",nu="UpdateUserSubResp",iu="PullUserSubReq",au="PUllUserSubResp",ou="PullSubDataReq",su="PullSubDataResp",uu="SubDataDetail",lu="QrySubDataReq",cu="UserProfile",fu="SetUserProfileResp",du="PullUserProfileReq",_u="UserProfiles",hu="UserProfileInput",gu="UserProfilePermission",pu="SearchUserProfile",bu="ChannelsInput",Eu="ChannelsOutput",Iu="MultiChannels",Tu="ModifyChannelsInput",vu="ChannelsQueryInput",Ru="ChannelsListResult",mu="ChannelsInviteStatusInfos",yu="ChannelsUserInfos",Au="ChannelsJoinedInfos",Ou="ChannelsMemberUpdateInput",Su="ChannelsMemberResponseInput",Nu="ChannelsMembersInput",Cu="FriendInput",Pu="FriendsInput",Mu="FriendsCheckOutput",Lu="FriendProfileInput",wu="FriendProfileOutput",Uu="FriendQueryInput",Du="FriendsListInput",Gu="FriendLevelSet",Vu="FriendUserInfos",ju="FriendInviteInfos",ku="ChannelApplyInfo",xu="AddUnpushPeriodInput",Fu="DeleteUnpushPeriodInput",Bu="QueryUnpushPeriodInput",Hu="QueryUnpushPeriodOutput",Yu="MsgReadEvent",Wu="ConvertMsgInput",Ju="SpeechToTextInfo",qu="ConvertMsgOutput",Ku="SpeechToTextResult",Qu="TransReq",Xu="TransResp",Zu="PullModifyMsgReq",zu="PullModifyMsgResp",$u="SessionQryInput",el="SessionsOutput",tl="SetUserStatusInput",rl="MCFollowInput",nl="RtcQueryListInput",il="RtcKeyDeleteInput",al="RtcValueInfo",ol="RtcUserListOutput",sl="RtcInput",ul="RtcQryOutput",ll="RtcDataInput",cl="RtcSetDataInput",fl="RtcUserSetDataInput",dl="RtcOutput",_l="RtcTokenOutput",hl="RtcQueryUserJoinedInput",gl="RtcQueryUserJoinedOutput",pl="RtcViewerJoinedOutput",bl="RtcInviteInput",El="RtcCancelInviteInput",Il="RtcInviteAnswerInput",Tl="RtcEndInviteInput",vl="BotInput",Rl="BotOutput",ml=function(e){var t=0,r="";e:do{var n=e.charCodeAt(t++),i=n&xn,a=15&n,o=void 0;switch(i){case Vn:var s=a>>2,u=3&a;if(0===s||0===u)throw new Error("Data parsing error,at "+t);var l=Wn(e.substr(t,s)),c=Wn(e.substr(t+=s,u));if((l=r.length-l)+c>r.length)throw new Error("Data parsing error,at "+t);t+=u,r+=r.substr(l,c);break;case Gn:if((o=Wn(e.substr(t,a)))!==r.length)throw console.log(r.length),console.log(o),new Error("Data parsing error,at "+t);t+=a;break e;case jn:o=Wn(e.substr(t,a)),r+=e.substr(t+=a,o),t+=o;break;case kn:r+=e.substr(t,a),t+=a;break;case xn:if(a>10)throw new Error("Data parsing error,at "+t);r+=e.substr(t,16+a),t+=16+a;break;default:throw new Error("Data parsing error,at "+t+" header:"+i)}}while(t<e.length);return r}("upackage Modules;\nmessEH4kprobuf {\n EJ8sSetUserStatusOutputEW5QV optional int32 nothing=1;\n }I41BaGI41CbInJ3111I72Mistring stEZ4I416EUJbubIA14dId=2Ib1GaSER6Ie2IhrepeatedI618guserid If2II41DIm4rkVoipDynamicI62Egquired I116n engineType = Im37Ea9Ig27jchannelNamEb4Iq35IN4IEb7iExtra = 3IK2RIM3DIl1GadEa6cKeyIQ3IjNotifyMsg IJ3LatIC3DIn4Ce64 tiI43UermId=Iw2HkSyncRequestIv1Mh64 syncTIW16IB5Gkbool ispollIe14I32IEX7cwebI026ERIjPullSend=4EWMdKeepIH84a5Iy3LgsendBoxID34Id24b=6EcLibroadcastEe9a7EeLcendIl37a8IH2KucompressioEnabled = 9IS5GiUpStreamMEG7IO7LbseI814cnIdIfARglassnamIZ7BEZHfontentIYA8I68IkpushText = Ie5GEY7fappDatIdB4Ig57IWFGbtoIbG6ds = Id5MfdelMsgI257IY5GIDC8Ea5Ir35Ia5GIP46iconfigFlaIN94IU55Ig1HlclientUniqueI356a0Il1MfextraCIa49a1IADGdPushIbF6Ie44cExtEb4IIDNdbusCIPG6Eb4In5NhsystemIdEZ4Ii4GEZ8lenderPortraiIp14a2IaFMEF6cBitIw54a2IbMHI13AI2OMetitleI5HMIrK4otemplateIdNoUseIGHPIW44IL35Ig9RfConfigIh24Ij9NIl1AIm98IG3CdDownI3DDbs IrPFEYHe listIBDJICJHIfILffinishIIF5IS3GI7HNIX3JIj18I084EZ7IyIMmcredibleStartEg7IPDMEg8bEnIWI8IUDGIWIPIBJHeytes Eg8bedIuF7I9JHdChrmIC6YIG16I06zIv2KItOHIv2MI665I39TISUNdfromIPJ6Ix2JIgF7IHX5IAU7IRCNegroupISCCIENSIt87IENQI9M9I95DddataIi8EIg5GIfb5IZ8JIbR7IIZ7IO8GI327amIUM7IvLJh32 direcEI4IqLKEZ6lplantform =1IqHMgisRemovId75IjLOesourcIvI5IKEMI8OIIpHNI8OGIMEGI3JEEc8IIEJIaQGa1If5GIKPLIm5NIKPEInRMcextI4j6I4A4Is57IbUSIFPKc32 IeA5bUnIO24IGP9IqPVIlNNgconvertIW36a2Iw5GfExtMsgIbE5cextEB8c= 2IqNHEgBIUmIIjd5aqIaECIDeJIXHCIS14eenum I5FCIQ16fPERSONIC1AEG6aSIUFAeGROUPICFAdTEMPEJ8Ib37oCUSTOMERSERVICEIoEAfNOTIFYIXEAbMCInf8cMP=I687eULTRAIJ18I9D6IyLDkreateDiscusIfe5IeuKI867IMH7IVnHI61GIgoTI3t4I51JI256gInvitatIC2FICuKIq84I81HeLeaveID19I9tPIAu7IC2RcEviI6I5I71LIA2BI51KbReIm44IA2SIP5WEx8bfoIB3zI314IN6MI1QJINxUIZC5IimOIwxDIeQNeadminILS9IgQ9Ic7EhfirstTenInHAIoQJg32 openIwI9IJC5I64NMa31FI71Depage I6hOdnumbIi75IWiHIW1CId5FIJ37IA6IIg47I9B9MR01Ieotal Im1JbMeIC24ID14IPARIwtSEW4MY41EEYKI0nBIE7NeextenIwF4IfaKaGIEO4Il26Jy5L1IW1CIy5MIk4BbmeEe5Iq5oMKE17IHEwI31BIeKTJ07O1IE2FbSeMc217II3vI419IJ3MMH41NI2T9dFileIzSBdIMAGIkR4Iw37eAUDIOId3AdVIDEEF4IGA7cFILEi4I7H7eSIGHTIhGAlCOMBINE_HTMLIUGKlGetQNupTokenI54LIU29MiE1NIl57ckeyI1lQjhttpMethodIWxQhqueryStrIj56IhfNburIXA4IXfNMB816IgtMcsizIVtKIqi7bpTIY36I5X5Ic4HkdownloadUrlIg4iIRAGIg4Te fileI5PCIA2FI0s4J82Y1I72GIi5OMd01NIi56MX01JIi5CIKATILDPMKE15eadlinIY3RetokenIa3QcbosId15Ia3QfbosDatMH41KIMp8batIjl4c5;\nEVLfosskeyIxF5MmC1NhossPolicIH64MUH1NfossSigIg24IipNiossBucketIt67c9;\nIxtMi3CredentiIlN5MXH1Oms3Algorithm =MWH1IEc9IY47IjvPa3IV39MQH1Pa3IV34eatureIjvRbs3Ia3DIjv4MUe1NicAuthorizIQj5MoI1SbtcIQw7fSha256IwvKEhAIl38IB6NcstcIb2EIC6OeminioId2GI7w8EjLIf2GIGwHEjCIh27IFwHEaCIj2DILw4MaR1MIzH7Im24IMX5ISwJIGAAMnK16INwLINLGMhf1UEeAIEUNIRKBIC1ymAdd2BlackListI8qWIOVEIAqAhmoveFromJB111aQISS4I61UImYXI61EIneMID2DIivLI319M0r1KIL3eiBlockPushI11SgblockeeI41MkModifyPermiMC11HIjqSI29IMdJ15M001KEQ7cfo MDK16IuB6I31MICeSIHfSIR19M531WIFzPIcmMcHasIc5TIsjWIu35I714dCodeIe1TI24MEV9IyV5eresulMPT19IJi9EbEI416ME915n_SUCCESS = 0x0IYK7EQ6fFAILURIEi4c0x0MG21JcrmIIrCfMbL1NI5yMbrmIo7hMni1KIXmAMrI1MdjoinM6G17MnO1NMHC15M0d1Qc32 I5u6cCouMAU1CM3O1GjhatroomBanIkC4M0d1Nh32 whiteIAG8IUj9IU4GdPullMF02qMKQ18Il26IR4JI2z4IU16IKf7ML02LM7c1KMp01HIi2BcNewIG7MIE28MIe1nM052VkRelationQryMMK1LMsC1QM9V1HIp4PMDb16MTk19IH9JIlK4drderIC9JM6527hEraseMsgMLX1AMIm1MM2R1AI89GIS6PIesMcqryIfsCMgB1IEU5MaB17Eg7Mnd1MdbotTI457McQ1HIB6BgFilter MRD1MIC6zIe5BMeB19MyZ1FbagMrv1KI867fTagTopIOyQdpageIfp8I26TI3FKIA48MbB1NEV8IwQ5binISSAIh2IbFiMFw19IPAMIEF4IOANIBFRa MJr1bIZ4eI34KIUUKMCR1gIcT9Ix3GMPt1Iemsg =IiNMdreadMKC27M501ObunEb4IiN5Is3PMZk1DMw61McverIVQ4MY02NII28cminIj16M4E2PIj1AIQENbUnIR37MrK16E87MJs1PIs16bMeIu18IdwHIv97bBoM2E2AMOL2DIn1DIWaMMyu18IqNMcmsgIC66IYFMIb26Ip34Mi31PM8z15I4s7IRQHiQryRemindIlT4cReqIe2NMl02AIlXOIp7DI7EMIH37IUOPMZ917Ie2WbspImGGIZ7PItDSdReadIJ25I1EoIsCJM0R1NgtargetIMkK19IYWDgleanHisIy25IEKAI71TIE27Mr52SIE27MJ02KI2E4I845I29DIQ7VIWZIIy24hMsgBatchI59AIMRCIW3GbinE64IT6JgHistoryImI7IWnSID4IIB4PIO6GIm9BIK6AI92PcsOuIdQJNSN231II2FbhaIc44IKkSMCM2HIjMMMCM2IIoMGIzRPb6;IzRcITVHMM215hChatRoomMZf1VI9Z5IcZOI8Z5IZq9Ia1SMms2SIbS4iTotalNumsIV6CIvb9brmMSj16IIT6dnfosITsOEe7IynLMfp27IlUNIoz5M8q1IgPFollowInBSMp32CExJIqusaMMa216Ieb6Ih5IbMCJV1U1Ma41SdmpidMK238Ma41SIZGJI2tDIf6JMIt2HIzc8Mkn17cUrlMMt2HM411EITd7My73DdarchIO34Im4PIS24IO3Ocid=Ie4IIM18I96ZIQ1AMxu18I76CIKDJIew5Io2PIn48Io2NIe65IM1OMIr1TMv93DIn2UIbMIIvSEM7l2HIgOHMV43cIjrCIOxnI4TKI5MhItfKggnoreCmMDv2AIvQLbsgIqQhIM7HIoQEI4TNImQ6IMnNJkQf1IjQsMo127dsAttMa61FMgN1gI61BMbp1SeinboxMSC1QMVW27EaAIr5JIlA4IDR4Irh6Ido8MyE3IIL26cMsgIfh4IR3LIghfI1lAMqM2UMuz2SIGfUIo2EM7O3rgDeleteSIK67M4W1LMh928IRH4MlM17M8X1LEeCNrR2E1IWzQI25uIQa5Jw371IC1DeOutPuID1vIM6EIR7rI1t8cDelIpnFM1B1HaOIDR7breEG6M8B1ObclI7p6IbPKIE1GIeYMIMrCMb03XI5sGMO52RIm7CIcFHIN56I5SOMMJ1ZI33OIfF9IyO8Ih18IFG4Ic74IbArI81AIpUMMV61FME31IIJN4MOU1NM323CIrzLlhrmKVEntity IH7MMJF26IGFNevalueIw1PMT539IQSMInX4estampMUM2RInl5M5U1MM5F17MUJ1KcSetIW36ImIIIs3BeentryIKCOabMof36IY3JMvY3GgnotificIaD8Io3GI4AJIwNJIq27bS MQU1HJr2P2IAB6Ju2o2IR26Men2OIt2FbieIvyBIv2FiFullUpdatIICNMz51EN9W1O1IV3IbSVIeC6IhFDIDDPMKc2YIljDIb17I75SET7IE58grrorKeyMB41OIq2HdkeysEI7MN41OIc1GIPLMIMJDIrIFIQ25MI22OMr717IPHKIMJIIgTMIa7JMI34IMt447fettingIKwRIv67INwOIdM5Izo8ICrKIO5AI4jJI82CISlSI92OIg15greserveI92MbupIwC4I92RI7z4II4rIg1EI92OMDf2FI32WInBMIa2Chtem itemMdy2NIi2BM8d1II91FMAQ1UMNc3iIiVMMkb3GIiH6IhV8Mhb3MI338Meb3JMU51AMdj17IuiGcTagIU35dtagsMmq2JEc7MYe1JMoJ1IEuJMD925MFk3AIqAUIT2EMAA26I334MXb18IY1OJUqU1Ic37MLz1GI32CI955Ii25EA5MK81hIN3OIx9KEWCIW35Iwp7EHAIweeII8SI3fTIOVCMlN25IO2HMC637esSileMeD2CbIsMc326I627cTagIi1BgAutoTraICt5Md01OIb15MqW26IVAPIY9nIeMnMdR25Mjg36IcQ5IzRNM5j3EI71RcSetI41eIqFHbunI414dLeveM6I3MIe1AgResult M1u1WM0u1hIF2TMiA1OIH7DMgt1BIXPgIDRGIx3HIOA4Iw36NMC101IucAIt3fIU9WIlBHIm2AI4WZIyZOIQ4XmGrpReadReceipMrV4DM6J2EIXy5Mke4OIGLHIa1QMX125M771HJd131Ia1BMTW1rMRb4AM2e4UMrJ1LMvK47dreadIKM6b4 MLO2MIc35ds= 5EW7M5H3HcromMtB3AIOiHId37IA5AIg3hIBFJIXcMMMj1GI83KMpg2PMnV2AMlg2MMFb17MPR2bMQE2JIg58MqI2NMRO25MkI28b EZObSiMIC25MHF3OMZP2CMcI28Mbv3PIFpMIr67MDJ1OEaCIChGIS4PIi1TJW871MxB1NIX8iIlEEI4B7MbH2IIaBEbspIYY5cresIhtXMEP4KM711DM5117MlY4OIf7BMoT1MI87EI03UEb9IYo9J53F1Ml62IIw1LJA8q1IC7LMXa25IV5UIt2VMtO1XMpO1TMQj15aCM2c1LMpP2AEW6Mn34GIZ27Iuu4Ec5E95Miq4PMmd16dListMic2PMLe17Il15I3tGIl1CEe6In17Mtj3IIoTIIVbLI548MdD26cNumMcA1JcGrpMak17Im15MuL27IfVKEdCIrYLIoM5MuE2TMfj2EIveJfTagAddMg81iIAyRMn81uIC1DMq21OILZRdnameIzTKMOA39Ik45Mn65OcTopMQD26IP2McDelJd482fDisTagI0eQIf4BMU81NMuS15MFS18NTE111IHQEgportSDKMxl1SgsdkInfoMlo1KI017Mlp1rhUltraGrpM5E56M6718MrF3ZMY93aMrD1IIm1BMbH3hMdN1pIC24ehangeM2q2QMwr4TIlQII9sGIEtJM5K4NfmsgUIDMAG1JI0PGM203qM0t4HMJC2HIyx6IqK5IWM9I7RGEZ5I16NMx33NILeNI569Ih7nI0B7eeedCoIdYPMhm47fnlineTM4e1MI97II3JHeEventIh26IrS5IoGFEVBNf3501ehasNeML845a3IIsNIg2GInDIIL4BIPt6IF3NMlA1QeinessILZLMaM3QM6L1aMhY3IcngeI217MAw3OjriginalId MVw1PEa8MfQ3NMhc39hcondaryIMbQ3KI657eAdminMlV5OdaddiEG6dMarkIMt6Iv2MgperatorMCQ5MMlU17bubIJ66M7N18IqBMIw29Ed8MTb5NM0736bMeMm84BIcRGcextMXu37ItyMMoB3AMN45KIBm6eeventI8m7MV846IkLLIyCKI8GAIwCzIxCHI52LMS33oMJd1ZMlW1MMvx2EIfBJIEONMvd1PIFOAIWBNIFODIVBqeisDelMSN3JJLBK1MJP3HIMBxIsk4MA046ISBlIo8FMMV1CJn891MQn49Id15IZ15MBT25M2d45Iz85c //Mts4HEjFItSLIT8AMqs2OIW99MyP2rIO48cAckMWE3oIi6EhnotExistMvl58IlWHbOpIg94heStatus Mx21XInQTMQN1NMXB48M4w3NMaR2bIh2DMTF27I0j8MWU2ZILRHMtF25IkN8MXP39I859In17Msy2CIyW8EcIjSummary suE86c= 4IjKHIJ1CNi81N1IazGMfz2NIH68M5v2MEF4ISiAI634Eb4IJ6JIm37NyB1T1Mu23WIF3DMi93FdtRtcMVL35MK31MMap48brtEc7M402LI71AMBL4tcCalMoB55M8Q28Mna2QIgHPddataItt7IdxIIY18IpGAJa161ILKIaaMTz25Mk84IbKvML41RI6oGEvEMNk1SIo17IvJJIp14MaD3REV7MZg2RMc12UMMi1SIXzJIJRyI1PYMyR6LbrtIrN8MRk5OcndMEY7IXUHMCn1MMrt3TMAx1jMGn3ZMhQ1GMm71NMML1LMGN1CMJL1CMch1LMcQ1BIB4JMmL1BM4R1HEX5ILzNMU54WM1W3EMra1OMqI5AIVwLimentionedIH7QcCntIK7DMQx2qMVH2RIeARMxg1LMwg1RIk28M2e1IM9S17Ir64Mkc46MGf3LEbAMZZ1nIrP4MSK4RbtmMEM1LMyk26MKL15bubIi5JI6l9MSJ2GMtV2ChubDetailMlg68ME81NIUbSMCg27cxpiIKY6MwN1LIg19MHj6NMni68ImMKIl3FMM54JIG3OMQv5NcubTMPv5FMwa2HIS5OM6o2aM8o1CIa1IbUlIa1AIH3PIwz5IAkEIA2PMSC1WMnq1dMyQ4JcullICNKIe2CIM6xInADMOw2NIs69I9AaI9BQI93HMrU15fubDataIs7WMFT1SgneedAllMO668Iq5YM1l2LID29IV8IER7IQ57IX8aM3L1dJb8J1Ik2EMNz6ScStrMmu4RIfGBMKc2HIb16IQf5MzM4QIb99IClJI317IJLLhplatformMqM4CEbHMlJ3RIF6HINYIcrySI8ASISNxIxEGgProfileIdJtIuXGI929IP17Ih45MPq55If17InUIEgGcExtEjAILPHEkCMx63iMNl2KM733JIX17MOd1QM9C3iIUYIpcensorFailedFielMqD15MB13PIH29Mzr1OMnJ5QI11BMjf6HI68CII8CI91UM3u3sI31BM0L5AImDNEWAIB1UInytMhA46IBCRM4A29MKa6AMIC6NMyJ7MMi41YMwJ1ZIsBCbseMHz15ILDccextIHDFIx1IdBaseEj5abE98MIE2QIMH7MLH4IIE1GIE4MMV625MCS18MmS1NbwnIPpNMyH5JInNMMyH5EIrNIIy68Mv12PMoC15MHC15MVr1TafM1h66Mph5OMpa4OIiB4hrocessCoMLP35Ia6NgsJoinedIP55Iiq8Ig6MEn8M3E68MpW4DM8a1GkFriendInvitIt66bfrEHFMOa1IEq6IX19Eo6EF9MkC5II1KSMpy67IbrCdultiIA38IQvgI74HISE6M2M2EMG12HJBFR1EZ9dQuitIe18MSE27IJF8It47Mec1RMrm2QIcA8IehDMt51DIv1IIb3FIHd7Eg4MKD5QMR345IwnPEW5eWhiteMG13PEY4cAttMU316ITETM5d17JL6Q1If18jPageParam MbU67IC6NbidIA6QbroMJE67M2t2OM9O5AI7LPID2BIDeMMyr27IAwdM172hMZW6EMK038MPX4NMu628I73JML657M1F3AI51FIOE4IMhEMpy1FMwk59Iu6kIgU4IjULIQJ4MFv58INK4MhT5MEfHIqrDIV1NI7K8IN1PIeK9IF1ZIvNAIH1PIUOBIJ1EIW2RIpZOMEP2FIm5HI214cExtIbX8MKJ2QbpTMGJ2TMAH7EMfp4RIOJLII2KIf9LIPE4ImyPMop5BMBD3UdNickMkS6UMoD2AIR3QfremarkIA17MFf4LcisBIgL5MKm7NbanMDT7VMAQ58Mnp27Iv4JMAp26MnF16JfLS1M8p1WIe5PMol7OIe5CMnE3NISSDMvy6OI5DCI14eIdkcIMlSIdkDMjC4NIdkKIkeOIECCI0e8M7A4MIgJNI48uIWHAILD4IMeBI2NOEZ9binI724El8ME91NMzQ48I4UMMTV79I9UTIoF5IL8BMet7KMI715M8g5OdapplMef28MUI2GIT3HIil7IT37MZS7MEa7Ion8MKL7IItEDgResponsJvET1IAD8IhU8Mo02OIjV8IoEPIK89M0X4KIZb8I887MBj6RIS6EIY4QNX01T1M6T6HMH91HIbr8M8A5uMfd3XMHD28Ix1MMGz5NET6ES7IGYGI41EMZO8TIsWPICzKMEw6OIDz6I73OMqU7SI55jIU1JeCheckIg4SEXCIibPEhIIt7tIkJ9Iq2NMTG1JMqG2oIHYDInQkIM2PMxf6TMI21LI1ANIEuQM0l37EW4IGnNIlmPIkJMMN516M6q5BII2IIDjuMh328M1156MtV3TIA2AIxLPIuC7IkfqIFkEInLNIFkEMmV3GIY8PIRS7INKNMhB19I55lMhd5LIs2UI05MMBo4CI5EQMI13NITJDI15NIaM7MTu3MIb7DMaa3HIYI7MNu6IJ6KF1MGA45cSetMp01NMkA47IrJOMy41GM051VMC12lIwDEIOyHIREFIcMVI2AAIB1NIZABMq01REi6aAIMe4MzC35I25MIse6M7X6SIC8DIpVZJTz71M6A2GIrK5MmR18MBO1MMWS1QIbmXIWoBMlq1IMAC29I02SID1AEl5MDS1CI22XcoptIcoGIFfJIN75MmZ2DMnA1WIsG6MoJ6OM9289MPC38IW3WIh2EIS3OIH6PIPVGMnY1TIGwNIW1JdFullIQwCIoEIIGB4Mf736IVCLMMb39IqD5I3JQIVCIIXGJID85If1SINS6MX68CIIRaIn1HcAddM5U46ePerioMNq2TMIs6CMZc4MispanMinutMRD55IOWMIBM8MlY3OgimezoneMTI5QIp2XMkJ7cJ9191I91CMav1SbisM4Q89MzC2OIf5BMFU5NIf5DIUWMIf58MGo8OIf5AMje2JMPg59J7wU1MHp2TMHh5GIK8HMWd27IoCSN7D4U1M1n2DIFcMMuB4CM4s1GMfD4GM5D46MvH1IMuX86MUi5OMpP39Mah35Mda1TMBi39I5PNmSpeechToTextIEa4IU5lMW028ebjectMwJ9VMJ99PIqB7fampleRMnr7MM8Y3AdnelNMPE88IsmNfformatIthQMJN78Mg81II469M544SI56jM6C19I76TMRi1MIQO9MrS7CIe6JIJ17M6v4KdransMvI2JEO5I085ctraEA6MWe2QcmodM5H3LMm396dorceM9658IYwHI427MDb2IEP8IV34Ic36I42dIW1HIusREe7Mr446IDoNI514IehUbteMfc2SI315dFileIBh6MHx7OMBu85aLMKd15IBBNI8M6EZ6MBU7MMaq65aSMNv86IKBKIU5CIP4pIN3CICBEIM3UMu44TEZ6IiFNM5E26M9B8NIp3BM7d1JMIG45MTA4Acq {Mxq4IMoH77MvN4AMMh4dIvA9IJA9MhZ3AM3X2LMgC4KMk53AET8MWI27ICRMdnextMI65FMsH9hIF3GM8n2HMno5dIm2AIXKLII4DMrF4vMwT47MNa7OMCe2WM8U7UII4DMbY4HM121GMhY4PMJT1NEU7ET7MwT57Mj82xI17BMGJ9uIN2ENTf3N1MGR4QI37MMdr6HMxY66IBu6EB5Mx12LEcBIIALMhH36ILPNM0K26I3d6IeeMEZ7cMeCMpr4RIGh4brTMnu6KEW7eutOffEX5ITJGMVK7EMGw85EJ9IeJCM2b55Iqx4Mua5BhKICK = 0IL16eREFUSMLh8BgCOEXISTMFB9HbTaIb74I91BgROOM =1MhH27MSB99Myx5PMu3AWMus6CI9HDMp277IXwVMtN86ICpHbtcIbs5M8K1GMXA7LI01KcKeyIxv6M8L1Sdkey=EzKeValueMuh3UMo16ZIN1FMbB1FMcv4MMup4HII2DEa4I3G4IY1PMII8QI52CMpZ25M6u4OMmd85MVr4HMb58GIVL8Ii2MdroomMD52EEeCMaH6JM81ANM1q3AIqaMkofflineKickMoE2CIX4FMqI7UIRk8Mpw35Mbi3KIV3GMMK3NM0K7AMMl6FIF6LMA075MPd3IbtcMh51RI124M2h15MHL4NMHo98Ea5IZ2GID3DI5r5eInnerMIK5NMEO39bSyIZO4MRB85IqXJbIdIPL4btyMqN4BbidEJHIj7II1K9Mz82II46MbinIm27MOW5BEgMeouterEg8M2c1HIvH4bryIwCPI91DMpz4NMJh85caInIp6JMpO26fnterioIwI7EUBIrMBIdU6M734AIwIIIQZNM011AMYL7OMy017IjQ6Iz2FcSetJ23K1I4LIM9y4NI4L6M3m4OIV3AIarNIV38My18IInD6IZ3LIf7KIC25MEU1EIl2GMn61KIF1MMt61FI0AIIt5RcsInJx8B1ItAGbelIL4PIwRRIS2GIp7GIS2II12KMdC5fIjfPINSKM569RInN8Eb7IJFLfSetOutINCPIW3IIuOTIM99IZTOIcBBMQr9QIcB5IrOKcQryIfB4Ir2LMdT3eIlC7I617INXcIA1NMAbAZMeW7SMa41PImU6IM9LdPullMrg6hIR8HIEW8IS9KI6Z9ND37Z2Ix2HIJ7PN4u6R1MhA28Iko5IkWJIF26mAnchorToVieweM7r3BEG6bToEW6IQ6NMkf16cserMEp18M149rbtcMzo2HMzX4HdevicMDb3BI89WMQo8XIF3UIv6PIj2BM6X8CIfpGI655ID1LIUKSIe8XM927cIhhHM9826MC08REY5M3226M7j5IMmaA8fimeoutM1j7LIA1EM2j47IEYNEb6IhM5Mh85NEY6M5j99IhDMdCancMY6A7IY3oIz2UIa3TIz25IX3TIz2AI7oMEa4hAnswerInIy2WIx2NIV67janswerCodeIu2UIT6aIw2FMrUAPIoeOIOZ4MUh1NIGg6IFvKcEndIG7eIA37IF7TIA3AIN4TMfp48M8V3OIo19dKeysIJ7IcBotILWSM9W36MiJ9IbotIgG6EsFIG15ffo botEuOEW4IozMMZF87MyU5MM3Y2yMLC8EMB41GeMetadIaa5MU3A5ED6MNmASMCY2QMw867IES5MA41OIn1CMl94UIH4MMm94Fb}\n3bMB"),yl=function(){function e(e){bo.add(this),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0});var t=po.loadProto(e);this.pbModules=t.build("Modules").probuf}return Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.pbModules[e].encode(t).toArrayBuffer()}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{var r=this.pbModules[e].decode(t);return l(this,bo,"m",Eo).call(this,r)}catch(t){var n="name: ".concat(e,", stack: ").concat(t.stack);throw null===console||void 0===console||console.error("pb decode error!",n),t}}}),e}();bo=new WeakSet,Eo=function e(t,r){var n,i=this;if(t instanceof Array)return t.map((function(t){return l(i,bo,"m",e).call(i,t)}));if(n=t,"[object Object]"!==Object.prototype.toString.call(n))return t;if(t instanceof po.ByteBuffer)return t.toArrayBuffer();if(t instanceof po.Long)return r?t.toString():t.toNumber();var a={};return Object.keys(t).forEach((function(r){var n=t[r],o=t.$type.name===Lo&&"seqId"===r;a[r]=l(i,bo,"m",e).call(i,n,o)})),a},function(e){e[e.PERSON=1]="PERSON",e[e.PERSONS=2]="PERSONS",e[e.GROUP=3]="GROUP",e[e.TEMPGROUP=4]="TEMPGROUP",e[e.CUSTOMERSERVICE=5]="CUSTOMERSERVICE",e[e.NOTIFY=6]="NOTIFY",e[e.MC=7]="MC",e[e.MP=8]="MP",e[e.ULTRAGROUP=10]="ULTRAGROUP"}(Io||(Io={})),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"}(To||(To={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(vo||(vo={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags",e[e.AutoTrans=4]="AutoTrans"}(Ro||(Ro={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(mo||(mo={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(yo||(yo={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Ao||(Ao={}));var Al,Ol,Sl,Nl,Cl,Pl,Ml,Ll,wl,Ul=new yl(ml);!function(e){e[e.LOG=0]="LOG",e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.FATAL=4]="FATAL",e[e.STATISTICS=6]="STATISTICS",e[e.NONE=1e3]="NONE"}(Al||(Al={})),function(e){e.IM="IM",e.RTC="RTC"}(Ol||(Ol={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",e[e.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",e[e.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",e[e.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",e[e.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",e[e.BLOCKED=9]="BLOCKED",e[e.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",e[e.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",e[e.REDIRECT=14]="REDIRECT",e[e.USER_LOGOUT=19]="USER_LOGOUT",e[e.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",e[e.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",e[e.ULTRALIMIT=1101]="ULTRALIMIT",e[e.REQUEST_NAVI=201]="REQUEST_NAVI",e[e.RESPONSE_NAVI=202]="RESPONSE_NAVI",e[e.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",e[e.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR"}(Sl||(Sl={})),function(e){e[e.RTC=0]="RTC",e[e.LIVE=2]="LIVE",e[e.SIP=4]="SIP",e[e.CALL=5]="CALL",e[e.MEETING=6]="MEETING",e[e.CROSS_MUTI=7]="CROSS_MUTI",e[e.CROSS_LIVE=8]="CROSS_LIVE"}(Nl||(Nl={})),function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(Cl||(Cl={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(Pl||(Pl={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(Ml||(Ml={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(Ll||(Ll={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(wl||(wl={}));var Dl,Gl,Vl,jl,kl,xl,Fl,Bl,Hl,Yl,Wl,Jl=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r})}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e]||(this._map[e]=[]);n.some((function(e){return e.listener===t&&e.target===r}))||n.push({listener:t,target:r,once:!0})}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._map[e];n&&((n=n.filter((function(e){return e.listener!==t||e.target!==r}))).length?this._map[e]=n:delete this._map[e])}}),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[e];if(n)for(var i=0;i<n.length;i+=1){var a=n[i],o=a.target,l=a.once,c=a.listener;l&&(n.splice(i,1),i-=1);try{c.call.apply(c,u([o],s(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._map[e]}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){Object.keys(this._map).forEach(this.removeAll,this)}}),e}(),ql=function(e,t,r){var n=null==r?void 0:r.isReverse;At(e)&&function(){for(var r in e)t(e[r],r,e)}(),(vt(e)||bt(e))&&function(){if(n)for(var r=e.length-1;r>=0;r--)t(e[r],r);else for(var i=0,a=e.length;i<a;i++)t(e[i],i)}()},Kl=function(e,t){return ql(e,(function(r,n){e[n]=t(r,n)})),e},Ql=function(e){return"[object Null]"===Object.prototype.toString.call(e)},Xl=function(){return ht.gen()},Zl=function(){return ht.genWithLen(22)},zl=function(){function e(e){Object.defineProperty(this,"pbCodec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbCodec=new yl(e)}return Object.defineProperty(e.prototype,"encode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return r?t:this.pbCodec.encode(e,t)}}),Object.defineProperty(e.prototype,"decode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.pbCodec.decode(e,t)}}),e}(),$l=function(e,t,r,n,i){var a=n?Object.keys(n).map((function(e){return{key:e,value:n[e]}})):void 0,o=i?Object.keys(i).map((function(e){return{key:e,value:i[e]}})):void 0;return Ul.encode(sl,{roomType:e,broadcastType:t,joinType:r,innerDatas:a,outerDatas:o})},ec=function(e){var t=Ul.decode(ol,e),r=t.users,n=t.token,i=t.sessionId,a=t.roomInfo,o=t.entries,s=t.offlineKickTime,u={};return ql(r,(function(e){var t=e.userId,r=e.userData,n={};ql(r,(function(e){var t=e.key,r=e.value;n[t]=r})),u[t]=n})),{users:u,token:n,sessionId:i,roomInfo:a,kvEntries:o,offlineKickTime:s}};!function(e){e.INIT="INIT",e.DATA="DATA",e.END="END"}(Dl||(Dl={}));var tc=function(e){function r(t,r){var n=e.call(this)||this;return Gl.add(n),Vl.set(n,void 0),jl.set(n,new Map),kl.set(n,void 0),c(n,Vl,t,"f"),c(n,kl,r,"f"),n}return t(r,e),Object.defineProperty(r.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=l(this,Gl,"a",xl).createTraceId(),l(this,Gl,"a",xl).info(F.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,vr.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(l(this,Vl,"f").validateConnected).tryTrans((function(e){var t,r;return(null===(r=null===(t=null==e?void 0:e.streamServer)||void 0===t?void 0:t.addrs)||void 0===r?void 0:r.length)?Ir(e.streamServer.addrs):Tr(k.STREAM_MESSAGE_DISABLE)})).next((function(t){return l(n,Gl,"m",Wl).call(n,e,t)}))];case 1:return r=i.sent(),l(this,Gl,"a",xl).summary(F.L_REQ_STREAM_MSG_CONTENT_R,r,t,{messageUId:e}),[2,r.wipe()]}}))}))}}),r}(gr);Vl=new WeakMap,jl=new WeakMap,kl=new WeakMap,Gl=new WeakSet,xl=function(){return l(this,Vl,"f").logger},Fl=function(e,t,r){var n=l(this,jl,"f").get(e);n&&(l(this,jl,"f").delete(e),l(this,Gl,"m",Bl).call(this,e,Dl.END,t,n.msg))},Bl=function(e,t,r,n,i){this.emit("message",{code:r,messageUId:e,type:t,chunk:i,message:n})},Hl=function(e,t){e.content=n(n({},e.content),t),l(this,Vl,"f")._innerSetMessageContent(e.messageId,JSON.stringify(e.content),e.messageType)},Yl=function(e,t,r){var n,i,a=l(this,jl,"f").get(t);switch(e){case"init":a.msg&&l(this,Gl,"m",Hl).call(this,a.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),l(this,Gl,"m",Bl).call(this,t,Dl.INIT,k.SUCCESS,a.msg);break;case"complete":i=(n=r.length?JSON.parse(r):{}).complete||!1,a.msg&&l(this,Gl,"m",Hl).call(this,a.msg,{stopReason:n.stopReason||0,completeReason:n.completeReason||0,complete:i,isSynced:i}),l(this,Gl,"m",Fl).call(this,t,n.stopReason||0,i);break;default:n=JSON.parse(r),a.cached+=n.content,a.msg&&l(this,Gl,"m",Hl).call(this,a.msg,{content:a.cached}),l(this,Gl,"m",Bl).call(this,t,Dl.DATA,k.SUCCESS,a.msg,{content:n.content,fullContent:a.cached})}},Wl=function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c,f=this;return a(this,(function(a){switch(a.label){case 0:return l(this,jl,"f").has(e)?[2,Tr(k.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:l(this,jl,"f").size>=3?[2,Tr(k.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(r=go.createSSEClient({logger:l(this,Gl,"a",xl),msgUId:e,appkey:l(this,Vl,"f").appkey,token:l(this,Vl,"f").token,timeout:3e4,onRawContent:function(t){t.split("\n\n").forEach((function(t){if(0!==t.length){t.startsWith("data:")&&(t="event:delta\n".concat(t));var r=t.indexOf("\n"),n=t.slice(0,r).replace("event:",""),i=t.slice(r+1+5);l(f,Gl,"m",Yl).call(f,n,e,i.trim())}}))},onNetworkError:function(t){l(f,Gl,"m",Fl).call(f,e,t,!1)}}),r.isOk?(n=r.data,i={client:n,cached:"",msg:void 0},l(this,jl,"f").set(e,i),l(this,kl,"f")?[4,l(this,Vl,"f").getLocalMessage(e)]:[3,2]):[2,r.wipe()]);case 1:if(o=a.sent(),s=o.code,!(u=o.data))return l(this,jl,"f").delete(e),[2,Tr(s,"message not found, msgUId: ".concat(e))];if(u.content.isSynced)return l(this,jl,"f").delete(e),[2,Tr(k.STREAM_MESSAGE_SYNCED,"synced")];i.msg=u,a.label=2;case 2:return[4,n.open(t.slice())];case 3:return(c=a.sent()).isOk||l(this,jl,"f").delete(e),[2,c.wipe()]}}))}))};var rc,nc,ic=function(){function e(e){Object.defineProperty(this,"_context",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"__getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"createCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new zl(t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new yl(e)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._context.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"getNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getNaviInfoFromCache()}}),Object.defineProperty(e.prototype,"getCoreVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.36.0-alpha.1"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.36.0-alpha.1"}}),Object.defineProperty(e.prototype,"getAppkey",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.appkey}}),Object.defineProperty(e.prototype,"getCurrentId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getCurrentUserId()}}),Object.defineProperty(e.prototype,"getUserToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.token}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getConnectionStatus()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getDeviceId()}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.setPushConfig(e)}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return console.warn('[PluginContext] sendMessage is deprecated, please use "sendMessageTo" instead'),this.sendMessageTo({conversationType:e,targetId:t,channelId:r.channelId},r)}}),Object.defineProperty(e.prototype,"sendMessageTo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.sendMessageByPlugin(e,t)}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){void 0===n&&(n=[]),this._context.registerMessageType(e,t,r,n)}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getServerTime()}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.setCallInfo(e,t,r)}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._context.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context.getStatsUrlList()}}),e}(),ac=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"joinRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o,s){return i(this,void 0,void 0,(function(){var i,u,l,c,f;return a(this,(function(a){switch(a.label){case 0:return i=$l(t,r,n,o,s),[4,this.rtcSignaling(e,pi,!0,i)];case 1:return u=a.sent(),l=u.code,c=u.buffer,l===k.SUCCESS&&c&&(f=ec(c)),[2,{code:l,data:f}]}}))}))}}),Object.defineProperty(r.prototype,"quitRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Ul.encode(tl,{status:0}),[4,this.rtcSignaling(e,bi,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,this._context.rtcPing(e,t,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcPingResVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._context.rtcPing(e,t,r)}}),Object.defineProperty(r.prototype,"getRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){throw new Error("Method not implemented.")}}),Object.defineProperty(r.prototype,"setRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Ul.encode(al,{key:t,value:r}),[4,this.rtcSignaling(e,Ei,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Ul.encode(il,{key:t}),[4,this.rtcSignaling(e,Ii,!1,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o,s){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return i=Ul.encode(cl,{interior:n,target:o,key:t,value:r,objectName:null==s?void 0:s.name,content:null==s?void 0:s.content}),[4,this.rtcSignaling(e,Ti,!1,i)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return void 0===o&&(o=""),i(this,void 0,void 0,(function(){var i,s;return a(this,(function(a){switch(a.label){case 0:return i={objectName:n,content:[{key:t.name,value:t.content}],valueInfo:[{key:"uris",value:r},{key:"mcu_uris",value:o}]},s=Ul.encode(fl,i),[4,this.rtcSignaling(e,vi,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Ul.encode(fl,{objectName:t,valueInfo:[{key:"cdn_uris",value:r}]}),[4,this.rtcSignaling(e,vi,!0,n)];case 1:return[2,i.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=Ul.encode(ll,{interior:r,target:n,key:t}),[4,this.rtcSignaling(e,Ri,!0,i)];case 1:return o=a.sent(),s=o.code,u=o.buffer,s===k.SUCCESS&&u?(l=Ul.decode(ul,u).outInfo,c={},l.forEach((function(e){c[e.key]=e.value})),[2,{code:s,data:c}]):[2,{code:s}]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return i=Ul.encode(ll,{interior:r,target:n,key:t,objectName:null==o?void 0:o.name,content:null==o?void 0:o.content}),[4,this.rtcSignaling(e,mi,!1,i)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(r.prototype,"getRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))}}),Object.defineProperty(r.prototype,"getRTCToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=$l(t,r),[4,this.rtcSignaling(e,yi,!0,n)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===k.SUCCESS&&s?(u=Ul.decode(_l,s).rtcToken,[2,{code:o,data:{rtcToken:u}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"setRTCState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Ul.encode(rl,{state:t}),[4,this.rtcSignaling(e,Ai,!0,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=Ul.encode(nl,{order:2}),[4,this.rtcSignaling(e,Oi,!0,t)];case 1:return r=a.sent(),n=r.code,i=r.buffer,n===k.SUCCESS&&i?(o=ec(i),[2,{code:n,data:o}]):[2,{code:n}]}}))}))}}),Object.defineProperty(r.prototype,"joinLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return n=$l(t,r),[4,this.rtcSignaling(e,Si,!0,n)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===k.SUCCESS&&s?(u=Ul.decode(pl,s),l=u.rtcToken,c=u.entries,[2,{code:o,data:{token:l,kvEntries:c}}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"quitLivingRoomAsAudience",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Ul.encode(tl,{status:0}),[4,this.rtcSignaling(e,Ni,!0,t)];case 1:return[2,r.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"rtcIdentityChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=Ul.encode(sl,{roomType:Nl.LIVE,broadcastType:r,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,Ci,!0,n)];case 1:return i=a.sent(),o=i.code,s=i.buffer,o===k.SUCCESS&&s?(u=ec(s),[2,{code:o,data:u}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,s=e.roomId,u=Ul.encode(bl,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(s,Pi,!0,u)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,s=Ul.encode(El,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,inviteInfo:i}),[4,this.rtcSignaling(o,Mi,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return t=e.inviteUserId,r=e.inviteRoomId,n=e.inviteSessionId,i=e.content,o=e.key,s=e.value,u=e.agree,l=e.roomId,c=Ul.encode(Il,{inviteUserId:t,inviteRoomId:r,inviteSessionId:n,content:i,key:o,value:s,answerCode:u?1:0}),[4,this.rtcSignaling(l,Li,!0,c)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.endRoomId,r=e.sessionId,n=e.content,i=e.keys,o=e.roomId,s=Ul.encode(Tl,{inviteRoomId:t,inviteSessionId:r,inviteContent:n,inviteRoomKeys:i}),[4,this.rtcSignaling(o,wi,!0,s)];case 1:return[2,a.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"registerRTCSignalListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._context.registerRTCSignalingListener(e)}}),Object.defineProperty(r.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return[4,this._context.rtcSignaling(e,t,r,n)];case 1:return[2,{code:(i=a.sent()).code,buffer:i.data}]}}))}))}}),Object.defineProperty(r.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=Ul.encode(hl,{userId:e}),[4,this.rtcSignaling("",Ui,!0,t)];case 1:return r=a.sent(),n=r.code,i=r.buffer,n===k.SUCCESS&&i?(o=Ul.decode(gl,i).info,[2,{code:n,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:n}]}}))}))}}),r}(ic);!function(e){e[e.STRING=0]="STRING",e[e.ONLY_STRING=1]="ONLY_STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.OBJECT=4]="OBJECT",e[e.ARRAY=5]="ARRAY",e[e.CALLBACK=6]="CALLBACK",e[e.CHANNEL_ID=7]="CHANNEL_ID"}(nc||(nc={}));var oc=((rc={})[nc.STRING]=mt,rc[nc.ONLY_STRING]=bt,rc[nc.NUMBER]=It,rc[nc.BOOLEAN]=function(e){return"boolean"==typeof e},rc[nc.OBJECT]=At,rc[nc.ARRAY]=vt,rc[nc.CALLBACK]=function(e){var t=!0;return At(e)||(t=!1),(e=e||{}).onSuccess&&!Ot(e.onSuccess)&&(t=!1),e.onError&&!Ot(e.onError)&&(t=!1),t},rc[nc.CHANNEL_ID]=Lt,rc),sc=function(e){function r(t){var r=e.call(this,t)||this;return r.name="RCAssertError",r}return t(r,e),r}(Error),uc=function(e,t,r,n){if(void 0===n&&(n=!1),!lc(e,t,r,n))throw new sc("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},lc=function(e,t,r,n){void 0===n&&(n=!1),r=oc[r]||r;var i=n?r(t):St(t)||null==t||r(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},cc=function(e,t){var r=yn(e).searchProps;return r&&0!==r.length?r.every((function(e){return void 0!==t[e]}))?Ir():Tr(k.SEARCH_PROPS_LIMIT_ERROR):Ir()},fc=function(e,t,r){return dc(vr.create(e),t,r)},dc=function(e,t,r){return e.isFailed||e.isObject("conversation",t,!0).fail(k.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return ee(null==t?void 0:t.conversationType,r)}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID),e},_c=function(e,t,r){return e.check((function(e){return dc(e,t,X)})).check((function(e){var n=null==t?void 0:t.messageType;mt(n)?n===Re.STREAM_MESSAGE&&r.includes("RC_Ext_StreamMsgSummary")&&e.setFailed(k.STREAM_MESSAGE_EXPANSION_KEY_ERROR):e.setFailed(k.INVALID_PARAMETER_MESSAGE_TYPE)})).check((function(e){(null==t?void 0:t.canIncludeExpansion)||e.setFailed(k.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isNotEmptyString("messageUId",null==t?void 0:t.messageUId,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isTimestamp("sentTime",null==t?void 0:t.sentTime,!0).fail(k.INVALID_PARAMETER_TIMESTAMP),e},hc=function(e,t,r){return e.check((function(e){r||e.setFailed(k.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isObject("expansion",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_EXPANSION).check((function(e){var r=Object.keys(t);if(r.length>20||0===r.length)e.setFailed(k.EXPANSION_LIMIT_EXCEET);else if(r.some((function(e){return!/^[A-Za-z0-9_=+-]+$/.test(e)||"string"!=typeof t[e]})))e.setFailed(k.INVALID_PARAMETER_MESSAGE_EXPANSION);else{r.some((function(e){return e.length>32||t[e].length>4096}))&&e.setFailed(k.EXPANSION_LIMIT_EXCEET)}})),e},gc=function(e,t){return t?(e.isObject("proxy",t,!0).isString("socketHost",t.socksHost,!0).isNumber("socketPort",t.socksPort,!0).isString("socketUsername",t.socksUsername).isString("socketPassword",t.socksPassword).fail(k.INVALID_PARAMETER_PROXY),e):e};var pc=function(e){return 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).byteLength},bc=function(e,t,r,n,i){var a=0;return e&&(a|=16),t&&(a|=32),r&&(a|=64),n&&(a|=512),i&&(a|=1024),a},Ec=function(e){var t;try{t=JSON.parse(e)}catch(r){t=e}if(null==t?void 0:t.user){var r=t.user,n=r.portrait,i=r.portraitUri,a=n||i;a&&(t.user.portrait=t.user.portraitUri=a)}return t},Ic=function(e){var t={};try{var r=JSON.parse(e);Object.entries(r).forEach((function(e){var r=s(e,2),n=r[0],i=r[1];t[n]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},Tc=function(e,t,r,n){var i,a,o=Ul.decode(No,e.pbData),s=ti(e.topic);if(s===$n.recallMsg){var u=JSON.parse(o.content);i=u.conversationType,a=u.targetId}else i=function(e){var t;return((t={})[$n.ppMsgP]=x.PRIVATE,t[$n.pgMsgP]=x.GROUP,t[$n.chatMsg]=x.CHATROOM,t[$n.ugMsg]=x.ULTRA_GROUP,t[$n.pcMsgP]=x.CUSTOMER_SERVICE,t[$n.pbMsgP]=x.SYSTEM,t)[e]||x.PRIVATE}(s),a=e.targetId;var l=![x.GROUP,x.CHATROOM,x.RTC_ROOM,x.ULTRA_GROUP].includes(i),c=l?a:t,f=l?"":a,d=yc(o.sessionId),_=d.isPersited,h=d.isCounted,g=d.isMentioned,p=d.disableNotification,b=d.canIncludeExpansion;return{fromUserId:c,type:i,groupId:f,classname:o.classname,content:o.content,dataTime:r,status:bc(_,h,g,p,b),msgId:n,direction:be.SEND,clientUniqueId:o.clientUniqueId,extraContent:o.extraContent,pushContent:o.pushText,configFlag:o.configFlag,pushExt:o.pushExt,busChannel:o.busChannel,toUserIds:o.toUserIds,optionBits:o.optionBits}},vc=function(e,t,r,i){void 0===r&&(r=!1);var a,o,s,u=e.type,l=e.classname,c=![x.GROUP,x.CHATROOM,x.RTC_ROOM,x.ULTRA_GROUP].includes(u)?i||e.fromUserId:e.groupId||i,f={isPersited:!!(16&(a=e.status)),isCounted:!!(32&a),isMentioned:!!(64&a),disableNotification:!!(512&a),receivedStatus:2&a?me.RETRIEVED:me.UNREAD,canIncludeExpansion:!!(1024&a)},d=f.isMentioned,_=f.disableNotification,h=f.receivedStatus,g=f.canIncludeExpansion,p=e.direction===be.SEND?be.SEND:be.RECEIVE,b=function(e,t,r){void 0===e&&(e=0);var i=function(e){return{isVoipPush:!!(1&e),isFilerWhiteBlacklist:!!(2&e),disablePushTitle:!!(4&e),forceShowDetailContent:!!(8&e)}}(e),a=i.disablePushTitle,o=i.forceShowDetailContent,s=nr(null==r?void 0:r.pushConfigs,null==r?void 0:r.pushId);return n({pushTitle:(null==r?void 0:r.title)||"",pushContent:t||"",pushData:"",disablePushTitle:a,forceShowDetailContent:o,templateId:null==r?void 0:r.templateId},s)}(e.configFlag||0,e.pushContent,e.pushExt),E=(o=e.extStatus,{isInterrupt:!!(2&(s=o||0)),isModifyMessage:!!(4&s),isPrivateChannel:!!(8&s),isStatusMessage:!!(64&s)}),I=E.isInterrupt,T=E.isModifyMessage,v=E.isPrivateChannel,R=E.isStatusMessage,m=yn(e.classname),y=m.isCounted,A=m.isPersited,O=m.isStatusMessage;return{conversationType:u,targetId:c,senderUserId:p===be.SEND?t:e.fromUserId,messageType:l,messageUId:e.msgId,isPersited:A,isCounted:y,isMentioned:d,sentTime:e.dataTime,messageDirection:p,receivedTime:Date.now(),disableNotification:_,receivedStatus:h,receivedStatusInfo:jt(h),canIncludeExpansion:g,content:Ec(e.content),expansion:e.extraContent?Ic(e.extraContent):null,pushConfig:b,channelId:e.busChannel||"",isInterrupt:I,isModifyMessage:T,messageId:e.clientUniqueId||0,sentStatus:se.SENT,isOffLineMessage:r,channelType:v?te.PRIVATE:te.PUBLIC,isStatusMessage:R||!!O,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:!!(1&(e.optionBits||0)),needReceipt:!!(2&(e.optionBits||0)),sendReceipt:!!(4&(e.optionBits||0))||void 0,modifyInfo:Ac(e.convertExt),extraData:e.extMsgData?{seqId:e.extMsgData.seqId,sentTime:e.extMsgData.sendTime}:void 0}},Rc=function(e,t,r,n,i){void 0===n&&(n=!1);var a=vc(t,r,n,i);return a.messageType===Re.RECALL&&e.serverSaveUnread?(a.__innerData__={keepUnreadCount:!(16&t.optionBits)},a):a},mc=function(e,t,r,n,i){var a=0,o=yn(e),s=o.isPersited,u=o.isCounted,l=o.isStatusMessage,c=i||l;return s&&!c&&(a|=1),u&&!c&&(a|=2),t&&(a|=4),r&&(a|=32),n&&(a|=64),a},yc=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}},Ac=function(e){if(e)try{var t=JSON.parse(e).modify;if(t.time)return{timestamp:t.time,content:{},status:Hr}}catch(t){console.error("parse message modify info error: ".concat(e),t)}},Oc=function(e,t){var r=e.content,i=r.sentTime,a=r.messageUId,o=r.isDelete,s=r.isAdmin,u=r.directionalUserIdList,l=r.extra,c={recallTime:i,recallActionTime:e.sentTime,admin:!!s,delete:!!o,isDelete:!!o,operatorId:e.senderUserId,extra:l},f=n(n({},e),{content:c,messageType:Re.RECALL_NOTIFICATION_MESSAGE});return t&&(f.messageUId=a,f.sentTime=i,f.directedUserIds=u),f};function Sc(e){return 1&~((null==e?void 0:e.sessionMode)||0)?Tr(k.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):Ir()}function Nc(e){return Math.min(e,999)}var Cc,Pc,Mc=function(){function e(e){var t;Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"subscribeData",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[fe.ONLINE_STATUS]={},t[fe.USER_PROFILE]={},t)}),Object.defineProperty(this,"_ownProfile",{enumerable:!0,configurable:!0,writable:!0,value:null})}return Object.defineProperty(e.prototype,"clearSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;this.subscribeData=((e={})[fe.ONLINE_STATUS]={},e[fe.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===fe.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].statusMap={}})):e===fe.USER_PROFILE&&Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].profile=void 0}))}}),Object.defineProperty(e.prototype,"getSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.subscribeData[e][t];return r?n({},r):void 0}}),Object.defineProperty(e.prototype,"removeSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){delete this.subscribeData[e][t]}}),Object.defineProperty(e.prototype,"updateSubscribeUserData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this.subscribeData[e][t]=r}}),Object.defineProperty(e.prototype,"clearExpiredData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t in this.subscribeData[e]){var r=this.subscribeData[e][t];r.expiry<(Date.now()+this._delayTime-r.subscribeTime)/1e3&&delete this.subscribeData[e][t]}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return u([],s(Object.values(this.subscribeData[e])),!1).sort((function(e,t){return e.subscribeTime-t.subscribeTime})).slice(r,r+t)}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=n(n({},null===(t=this._ownProfile)||void 0===t?void 0:t.extraProfile),e.extraProfile);this._ownProfile=n(n(n({},this._ownProfile),e),{extraProfile:r})}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ownProfile?n(n({},this._ownProfile),{extraProfile:n({},this._ownProfile.extraProfile)}):null}}),e}(),Lc=function(){function e(e){Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_relationshipStatusVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subUserStatusVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_ownProfileVersion",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subStore",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subStore=new Mc(e)}return Object.defineProperty(e.prototype,"updateRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._relationshipStatusVersion&&(this._relationshipStatusVersion=e)}}),Object.defineProperty(e.prototype,"getRelationshipStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._relationshipStatusVersion}}),Object.defineProperty(e.prototype,"updateSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e>this._subUserStatusVersion&&(this._subUserStatusVersion=e)}}),Object.defineProperty(e.prototype,"getSubscribeUserStatusVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subUserStatusVersion}}),Object.defineProperty(e.prototype,"_filterSubscribeRelationData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.reduce((function(e,t){return t.subUsers.forEach((function(r){var n=e.find((function(e){return e.subscribeType===t.subType&&e.userId===r.subUserId}));n?n.subscribeTime<t.subTime&&(n.expiry=t.expiry,n.operationType=t.opType,n.subscribeTime=t.subTime):e.push({userId:r.subUserId,subscribeTime:t.subTime,subscribeType:t.subType,expiry:t.expiry,operationType:t.opType})})),e}),[])}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=!1);var n=[],i=[],a=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,o,s=e.userId,u=e.subscribeTime,l=e.subscribeType,c=e.expiry;if(e.operationType===de.UNSUBSCRIBE)return r._subStore.removeSubscribeUserData(l,s),void a.push(e);var f=r._subStore.getSubscribeUserData(l,s);if(!(f&&f.subscribeTime>=u)){if(l===fe.ONLINE_STATUS){n.push(s);var d=(null===(t=f)||void 0===t?void 0:t.statusMap)||{};r._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,statusMap:d})}else{i.push(s);var _=null===(o=f)||void 0===o?void 0:o.profile;r._subStore.updateSubscribeUserData(l,s,{subscribeTime:u,expiry:c,userId:s,subscribeType:l,profile:_,isSubscribed:!0})}a.push(e)}})),{newSubscribeOnlineStatusList:n,newSubscribeUserProfileList:i,subscribeUserChangeList:a}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(fe.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(fe.USER_PROFILE)}}),Object.defineProperty(e.prototype,"updateSubscribeUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var i=e.subUserId,a=e.data,o=t._subStore.getSubscribeUserData(fe.ONLINE_STATUS,i);if(o){var s=[],u=n({},o.statusMap);a.forEach((function(e){var t=e.platformInfo,r=e.versionTime,i=u[t];if(!(i&&i.changeTime>r)){var a={eventValue:e.value,changeTime:r};u[t]=a,s.push(n(n({},a),{platform:t}))}})),t._subStore.updateSubscribeUserData(fe.ONLINE_STATUS,i,{subscribeTime:o.subscribeTime,expiry:o.expiry,userId:i,subscribeType:fe.ONLINE_STATUS,statusMap:u}),r.push({userId:i,subscribeType:fe.ONLINE_STATUS,subscribeTime:o.subscribeTime,expiry:o.expiry,details:s})}})),r}}),Object.defineProperty(e.prototype,"updateSubscribeUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return e.forEach((function(e){var i=e.userId,a=e.version,o=e.userProfile,s=e.userExtProfile,u=t._subStore.getSubscribeUserData(fe.USER_PROFILE,i),l=Ft(i,o,s);u?u.profile&&u.profile.version>=a||(t._subStore.updateSubscribeUserData(fe.USER_PROFILE,i,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:i,subscribeType:fe.USER_PROFILE,profile:{info:l,version:a},isSubscribed:u.isSubscribed}),u.isSubscribed&&r.push({userId:i,subscribeType:fe.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:n({},l)})):t._subStore.updateSubscribeUserData(fe.USER_PROFILE,i,{subscribeTime:0,expiry:0,userId:i,subscribeType:fe.USER_PROFILE,profile:{info:l,version:a},isSubscribed:!1})})),r}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,i=[];return t.forEach((function(t){var a=r._subStore.getSubscribeUserData(e,t);if(!a||a.expiry<(Date.now()+r._delayTime-a.subscribeTime)/1e3)r._subStore.removeSubscribeUserData(e,t);else{var o={subscribeTime:a.subscribeTime,expiry:a.expiry,userId:a.userId,subscribeType:a.subscribeType};if(e===fe.ONLINE_STATUS){var s=a.statusMap,u=Object.keys(s).map((function(e){return n({platform:~~e},s[~~e])}));o.details=xt(u)}else if(e===fe.USER_PROFILE&&!a.isSubscribed)return;i.push(o)}})),i}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[],i=[];return e.forEach((function(e){var a=t._subStore.getSubscribeUserData(fe.USER_PROFILE,e);if(a&&a.profile){var o=a.profile,s=o.version,u=o.info;if(a.isSubscribed)return t._delayTime+Date.now()-s>6048e5?void i.push(e):void r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}));t._delayTime+Date.now()-s>6e5?i.push(e):r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}))}else i.push(e)})),{list:r,needQueryUserIds:i}}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subStore.clearExpiredData(e),this._subStore.getSubscribeUserList(e,t,r).map((function(t){var r={subscribeTime:t.subscribeTime,expiry:t.expiry,userId:t.userId,subscribeType:t.subscribeType};if(e===fe.ONLINE_STATUS){var i=Object.keys(t.statusMap).map((function(e){return n({platform:~~e},t.statusMap[~~e])}));r.details=xt(i)}return r}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ownProfileVersion>t||this._subStore.updateOwnProfile(e)}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subStore.getOwnProfile()}}),e}(),wc=function(){function e(e,t,r,n,i,a,o){Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_event",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_currentUserId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_isOpenUserProfile",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"_subDriven",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"_isPullingRelationship",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullRelationshipQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullRelationshipFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_isPullingSubUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullSubUserStatusQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pullSubUserStatusFailTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_subscribeService",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._subscribeService=new Lc(n)}return Object.defineProperty(e.prototype,"syncData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return this._subDriven?[4,this._syncSubscribeRelationship(!1)]:[3,3];case 1:return e.sent(),[4,this._syncSubscribeUserStatus(!0)];case 2:e.sent(),e.label=3;case 3:return this._isOpenUserProfile?[4,this.syncOwnProfile()]:[3,5];case 4:e.sent(),e.label=5;case 5:return 1&this._subDriven&&this._event.syncSubscribeUserStatusFinished(fe.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(fe.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(fe.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(fe.FRIEND_USER_PROFILE),[2]}}))}))}}),Object.defineProperty(e.prototype,"startSyncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this._pullRelationshipQueue.push(e),this._syncSubscribeRelationship(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!0),i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this._isPullingRelationship?[2]:(this._isPullingRelationship=!0,[4,this._pullSubscribeRelationship(e)]);case 1:return t.sent(),this._isPullingRelationship=!1,this._pullRelationshipQueue.length>0?(this._pullRelationshipQueue.length=0,[4,this._syncSubscribeRelationship(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=""),i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,f,d,_,h,g;return a(this,(function(a){switch(a.label){case 0:return r=this._subscribeService.getRelationshipStatusVersion(),n=this._logger.createTraceId(),this._logger.info(F.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:r,_pageToken:t}),n),i=Ul.encode(iu,{version:r,pageToken:t}),[4,this._ctx.query($n.pullUserSub,this._currentUserId,i,au)];case 1:return o=a.sent(),this._logger.summary(F.L_PULL_SUBSCRIBED_USER_RELATION_R,o,n),o.isOk?(this._pullRelationshipFailTime=0,s=o.data,u=s.list,l=s.version,c=s.hasNext,f=s.pageToken,e?(d=this._subscribeService.updateSubscribeRelation(u),_=d.newSubscribeOnlineStatusList,h=d.newSubscribeUserProfileList,(g=d.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(g),_.length>0&&this._queryAndUpdateUserOnlineStatus(_),h.length>0&&this._queryAndUpdateUserProfile(h)):this._subscribeService.updateSubscribeRelation(u,!t),this._subscribeService.updateRelationshipStatusVersion(l),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>l})),c?[4,this._pullSubscribeRelationship(e,f)]:[3,3]):(this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:a.sent(),a.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"startsyncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this._pullSubUserStatusQueue.push(e),this._syncSubscribeUserStatus(),[2]}))}))}}),Object.defineProperty(e.prototype,"_syncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this._isPullingSubUserStatus?[2]:(this._isPullingSubUserStatus=!0,[4,this._pullSubscribeUserStatus(e)]);case 1:return t.sent(),this._isPullingSubUserStatus=!1,this._pullSubUserStatusQueue.length>0?(this._pullSubUserStatusQueue.length=0,[4,this._syncSubscribeUserStatus(e)]):[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_pullSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===e&&(e=!1),void 0===t&&(t=""),i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,f,d,_,h;return a(this,(function(a){switch(a.label){case 0:return r=this._subscribeService.getSubscribeUserStatusVersion(),n=this._logger.createTraceId(),this._logger.info(F.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:r,_pageToken:t,needAllData:e}),n),i=Ul.encode(ou,{versionTime:r,needAllData:e,pageToken:t}),[4,this._ctx.query($n.pullSubData,this._currentUserId,i,su)];case 1:return(o=a.sent()).isOk?(this._pullSubUserStatusFailTime=0,s=o.data,u=s.list,l=s.versionTime,c=s.hasNext,f=s.pageToken,d=s.isFull,this._logger.info(F.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code}),n),this._pullSubUserStatusQueue=this._pullSubUserStatusQueue.filter((function(e){return e>l})),this._subscribeService.updateSubscribeUserStatusVersion(l),_=[],h=[],u.forEach((function(e){switch(e.subType){case fe.ONLINE_STATUS:_.push(e);break;case fe.USER_PROFILE:h.push(e.subUserId);case fe.FRIEND_ONLINE_STATUS:case fe.FRIEND_USER_PROFILE:}})),d&&""===t&&this._subscribeService.clearSubscribeStatus(),_.length>0&&this._updateUserOnlineStatus(_,!d),h.length>0?[4,this._queryAndUpdateUserProfile(h,!d)]:[3,3]):(this._logger.warn(F.L_PULL_SUBSCRIBED_USER_STATUS_R,JSON.stringify({code:o.code,failTime:this._pullSubUserStatusFailTime}),n),this._pullSubUserStatusFailTime++,this._pullSubUserStatusFailTime>5?(this._pullSubUserStatusFailTime=0,[2]):[2,this._pullSubscribeUserStatus(e,t)]);case 2:a.sent(),a.label=3;case 3:return c?[4,this._pullSubscribeUserStatus(e,f)]:[3,5];case 4:a.sent(),a.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return t=this._logger.createTraceId(),this._logger.info(F.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),r=Ul.encode(lu,{subType:fe.ONLINE_STATUS,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._ctx.query($n.qrySubData,this._currentUserId,r,su)];case 1:return n=i.sent(),this._logger.summary(F.L_QUERY_SUBSCRIBE_DATA_R,n,t),n.isOk?(this._updateUserOnlineStatus(n.data.list),[2]):[2]}}))}))}}),Object.defineProperty(e.prototype,"_updateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!0);var r=this._subscribeService.updateSubscribeUserOnlineStatus(e);r=r.filter((function(e){return e.details&&e.details.length>0})),t&&r.length>0&&this._event.subscribeUserStatusChanged(r)}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!0),i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return r=this._logger.createTraceId(),this._logger.info(F.L_PULL_USER_PROFILE_T,JSON.stringify(e),r),n=Ul.encode(du,{userId:e}),i=new Aa($n.pullUserProfile,n,this._currentUserId),[4,this._ctx.send(i,_u)];case 1:return o=a.sent(),s=o.code,u=o.data,this._logger.info(F.L_PULL_USER_PROFILE_R,JSON.stringify({code:s,data:u}),r),s!==k.SUCCESS?[2,Tr(s)]:(l=this._subscribeService.updateSubscribeUserProfile(u.UserProfile),t&&l.length>0&&this._event.subscribeUserStatusChanged(l),[2,Ir(u.UserProfile)])}}))}))}}),Object.defineProperty(e.prototype,"updateUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return(t=Ul.decode(uu,e.pbData)).subType!==fe.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==fe.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==fe.FRIEND_ONLINE_STATUS?[3,3]:(r=t.data.map((function(e){return{changeTime:e.versionTime,eventValue:e.value,platform:e.platformInfo}})),this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,details:r}]),[3,5]);case 3:return t.subType!==fe.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:n=a.sent(),(i=n.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Ft(t.subUserId,i[0].userProfile,i[0].userExtProfile)}]),a.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._subscribeService.getSubscribeUserStatus(e,t)}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._subscribeService.getSubscribeUserList(e,t,r)}}),Object.defineProperty(e.prototype,"updateSubscribeRelation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),i(this,void 0,void 0,(function(){var i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=Ul.encode(ru,{subType:t,opType:r,expiry:n,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._ctx.query($n.updUserSub,this._currentUserId,i,nu)];case 1:return o=a.sent(),s=o.code,u=o.data,l=o.isOk,s===k.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT?[2,Tr(s,"",u.subUsers.map((function(e){return e.subUserId})))]:l?(c=u.subTime,this._subscribeService.updateSubscribeRelation([{subType:t,subTime:c,expiry:n,opType:r,subUsers:e.map((function(e){return{subUserId:e}}))}]),r===de.SUBSCRIBE&&(t===fe.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===fe.USER_PROFILE&&this._queryAndUpdateUserProfile(e,!1)),[2,o.wipe()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=this._subscribeService.getUserProfiles(e),r=t.needQueryUserIds,n=t.list,0===r.length?[2,Ir(n)]:[4,this._queryAndUpdateUserProfile(r,!1)];case 1:return(i=a.sent()).isOk?(o=i.data.map((function(e){return Ft(e.userId,e.userProfile,e.userExtProfile)})),[2,Ir(u(u([],s(n),!1),s(o),!1))]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"syncOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(F.L_PULL_OWN_PROFILE_T,"",t),r=Ul.encode(hu,{nothing:1}),[4,this._ctx.query($n.pullOwnProfile,this._currentUserId,r,cu)]):[2,Tr(k.RC_USER_PROFILE_SERVICE_UNAVAILABLE)];case 1:return n=a.sent(),this._logger.summary(F.L_PULL_OWN_PROFILE_R,n,t),n.isOk?(i=n.data,o=i.userExtProfile,s=i.userProfile,u=i.version,l=i.userId,c=Ft(l,s,o),this._subscribeService.updateOwnProfile(c,u),e&&this._event.ownUserProfileChanged(c),[2,Ir(c)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,Ir(e)]:[2,this.syncOwnProfile()]}))}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),Uc=function(e){function r(t,r,n,i){var a=e.call(this,t,r,n,i)||this;return Cc.set(a,pt),a}return t(r,e),Object.defineProperty(r.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,Cc,e,"f")}}),Object.defineProperty(r.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,Cc,"f")}}),r}(en);Cc=new WeakMap;var Dc=null,Gc="RC_LOGS",Vc="RC_STATISTICS",jc=((Pc={})[Gc]=["level","time"],Pc[Vc]=["level","time"],Pc),kc=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),a=IDBKeyRange.upperBound(Date.now()-r),o=i.openCursor(a);o.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},o.onerror=function(){n()}}))},xc=null,Fc=function(e){return i(void 0,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return[4,Dc];case 1:return(t=n.sent())?(r=t.db,[4,kc(r,Gc,e)]):[2];case 2:return n.sent(),[4,kc(r,Vc,e)];case 3:return n.sent(),xc=setTimeout((function(){return Fc(e)}),6e5),[2]}}))}))},Bc=function(e,t,r){void 0===r&&(r=168),Dc||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==go.runtimeInfo.type?Dc=new Promise((function(n){var i=window.indexedDB;!function(e){var t=window.indexedDB;t.databases&&t.databases().then((function(r){r.forEach((function(r){r.name&&e.includes(r.name)&&t.deleteDatabase(r.name)}))}))}(["RC_ENGINE_DB","RC_STATISTIC_".concat(e)]);var a="RC_LOGS_".concat(e),o=i.open(a,2);o.onerror=function(e){t.error(F.L_LOGDB_OPEN_FAILED_E,e.target.error),n(null)},o.onsuccess=function(i){var a=i.target.result;a?(a.onclose=function(e){Dc=null,t.warn(F.L_LOGDB_CLOSED_S)},a.onerror=function(e){Dc=null,t.error(F.L_LOGDB_ERROR_E,e.target.error)},a.onabort=function(e){t.info(F.L_LOGDB_ABORT_S,e.target.error)},Fc(3600*Math.max(24,Math.min(168,r))*1e3),n({appkey:e,db:a})):n(null)},o.onupgradeneeded=function(e){var t=e.target.result;Object.keys(jc).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var r=t.createObjectStore(e,{autoIncrement:!0});jc[e].forEach((function(e){return r.createIndex(e,e,{unique:!1})}))}))}})):t.warn(F.L_UNSUPPORT_INDEXDB_O))},Hc=[],Yc=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite");i.oncomplete=n,i.onabort=n;var a=i.objectStore(t);r.forEach((function(e){try{a.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},Wc=[],Jc=!1,qc=function(e){return i(void 0,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return Jc||0===Wc.length?[2]:(Jc=!0,t=Wc.filter((function(e){return e.level<Kr.FATAL})),r=Wc.filter((function(e){return e.level>=Kr.FATAL})),Wc.length=0,[4,Yc(e,Gc,r)]);case 1:return n.sent(),[4,Yc(e,Vc,t)];case 2:return n.sent(),Jc=!1,0===Wc.length&&Hc.length>0&&(Hc.forEach((function(e){return e.close()})),Hc.length=0),setTimeout((function(){return qc(e)})),[2]}}))}))},Kc=function(){var e=un();return e.setLogReader((function(e,t,r,n,o){return void 0===o&&(o=Gc),i(void 0,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return[4,Dc];case 1:return(i=a.sent())?[2,new Promise((function(a){var s=i.db.transaction(o,"readonly").objectStore(o),u=[],l=IDBKeyRange.bound(e,t),c=s.index("time").openCursor(l);c.onsuccess=function(e){var t=e.target.result;if(t){var i=t.value;i.level<=r&&(n?i.sessionId===gt:i.level>=0)&&u.push(i),t.continue()}else a({logs:u})},c.onerror=function(){a({logs:[]})}}))]:[2,{logs:[]}]}}))}))})),e.setLogWriter((function(e){!function(e){i(void 0,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return[4,Dc];case 1:if(!(t=r.sent()))return[2];if(e.content&&bt(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return Wc.push(e),qc(t.db),[2]}}))}))}(e)})),e},Qc=function(e,t){return i(void 0,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=t.get("logReporter"))["REPORT_SESSION_".concat(e)]={sessionId:gt},t.set("logReporter",r),[2]}))}))},Xc=function(e,t){return i(void 0,void 0,void 0,(function(){var r,n;return a(this,(function(i){return r=t.get("logReporter"),[2,(null==(n=r["REPORT_SESSION_".concat(e)])?void 0:n.sessionId)===gt]}))}))},Zc=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,r){return void 0===t&&(t=Date.now()-Zc),void 0===r&&(r=Date.now()),i(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=t<0?Date.now()+t:t,(r=r<=0?Date.now():r)-t>Zc&&(t=r-Zc),n=un(),(i=new Uc(e,"RC-IM","IM",n)).debug(F.T,"get logs: startTime ".concat(t," endTime ").concat(r)),Bc(e,i),[4,n.read(t,r,Kr.DEBUG,!1)];case 1:return o=a.sent().logs,i.debug(F.T,"get logs ".concat(o.length)),function(e,t){var r=t.map((function(e){var t=e.sessionId,r=e.time,n=e.type,i=e.level,a=e.tag,o=e.traceId,s=e.loggerId,u=e.content;return"".concat(t,",").concat(r,",").concat(n,",").concat(i,",").concat(a,",").concat(o,",").concat(s,',"').concat(u,'"\n')})),n=new Blob(r,{type:"text/csv"}),i=URL.createObjectURL(n),a=document.createElement("a");a.href=i,a.download="".concat(e,".csv"),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}("".concat(e,"-").concat(t,"-").concat(r),o),[2]}}))}))}}}}var zc,$c,ef,tf,rf,nf=function(e){function r(t,r,n,i,a){var o,s=go.runtimeInfo,u=s.type,l=s.version,c="".concat(u,"|").concat(l,"|").concat(r.getSessionId(),"|").concat(go.connectPlatform);return o=e.call(this,t,c,i,r)||this,Object.defineProperty(o,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"appStorage",{enumerable:!0,configurable:!0,writable:!0,value:a}),o}return t(r,e),Object.defineProperty(r.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.appStorage.deviceId}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return go.httpReq(e)}}),Object.defineProperty(r.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return i(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,Qc(t.userId,this.appStorage)];case 1:return r.sent(),[2,e.prototype.checkStart.call(this,t,this.tableName)]}}))}))}}),Object.defineProperty(r.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,{success:!0,data:Bn(e.map(rn).join(""))}]}))}))}}),Object.defineProperty(r.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return i(this,void 0,void 0,(function(){return a(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,r,n,this.tableName)]}))}))}}),r}(tn),af=function(e){function r(t,r,n){return e.call(this,t,r,Gc,r.proxy,n)||this}return t(r,e),Object.defineProperty(r.prototype,"isReporter",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,Xc(this.userId,this.appStorage)];case 1:return[2,e.sent()]}}))}))}}),Object.defineProperty(r.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n,o,s,u,l){return void 0===l&&(l=!1),i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return[4,this.isReporter()];case 1:return i=a.sent(),this.userId&&!i?[2]:[2,e.prototype.report.call(this,t,r,n,o,s,u,l)]}}))}))}}),r}(nf),of=function(e){function r(t,r,n){return e.call(this,t,r,Vc,r.proxy,n)||this}return t(r,e),r}(nf),sf=function(e){function r(t,r,n){var i=e.call(this,"WebConversationSettings")||this;return zc.add(i),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:n}),$c.set(i,!1),i._ctx.on("sCmd",l(i,zc,"m",tf),i),i._ctx.on("onConnected",l(i,zc,"m",ef),i),i}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t=this;return a(this,(function(r){switch(r.label){case 0:return[4,l(this,zc,"m",rf).call(this,e)];case 1:return[2,r.sent().trans((function(){return{version:t._storage.get("conversationStatusVersion")}}))]}}))}))}}),Object.defineProperty(r.prototype,"syncDataFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=this._storage.get("conversationStatusVersion"),[4,l(this,zc,"m",rf).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),r}(pr);$c=new WeakMap,zc=new WeakSet,ef=function(){c(this,$c,!0,"f")},tf=function(e,t){var r=t.type,n=t.time;if(3===r)this.push(n),e.stopPropagation()},rf=function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),t.info(F.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),r),n=Ul.encode(hs,{time:e}),[4,this._ctx.query($n.pullSeAtts,this._ctx.currentUserId,n,gs)];case 1:return(i=a.sent()).isOk&&(o=this._storage.updateBySessionStates(i.data.state)).length&&this._emitter.emit("conversationStatusChanged",o),s=this._storage.get("conversationStatusVersion"),t.summary(F.L_PULL_CONVERSATION_SETTINGS_R,i,r,{version:e,nextVersion:s},(function(e){return{respVer:e.version}})),l(this,$c,"f")&&(c(this,$c,!1,"f"),this._emitter.emit("conversationStatusSynced",i.code)),[2,i.wipe()]}}))}))};var uf,lf,cf,ff,df,_f=function(){function e(){Object.defineProperty(this,"_memData",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._memData=this._syncDataHandler(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._memData[e].value}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._memData[e],n=r.key,i=r.stringify;r.value=t;var a=i?JSON.stringify(t):t;go.localStorage.setItem(n,a)}}),Object.defineProperty(e.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._memData[e];delete this._memData[e];var r=t.key;go.localStorage.removeItem(r)}}),e}(),hf=function(e){var t;return"".concat(null!==(t=e.channelId)&&void 0!==t?t:"","_").concat(e.conversationType,"_").concat(e.targetId)},gf=function(e){var t=s(e.split("_")),r=t[0],n=t[1],i=t.slice(2);return{channelId:r,conversationType:parseInt(n,10),targetId:i.join("_")}};function pf(e){if(e){if(Array.isArray(e))return e;var t=Object.entries(e).map((function(e){var t=s(e,2);return{tagId:t[0],isTop:t[1].isTop}}));return t}}var bf=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:Te.NOT_SET,translateStrategy:Un.DEFAULT,tags:[],channelType:te.PUBLIC,operationTime:0,draft:"",hidden:!1,includeRobot:!1,version:0}},Ef=function(){function e(e){uf.set(this,void 0),lf.set(this,void 0),cf.set(this,void 0),ff.set(this,bf()),df.set(this,[]),c(this,uf,e.conversationType,"f"),c(this,lf,e.targetId,"f"),c(this,cf,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return l(this,uf,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return l(this,lf,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return l(this,cf,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return l(this,ff,"f").version||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return l(this,ff,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!l(this,ff,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!l(this,ff,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return l(this,ff,"f").notificationLevel||Te.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateStrategy",{get:function(){return l(this,ff,"f").translateStrategy||Un.DEFAULT},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(l(this,ff,"f").tags||[]).map((function(e){return{tagId:e.tagId,isTop:e.isTop}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadCount",{get:function(){return l(this,ff,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return l(this,ff,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return l(this,ff,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!l(this,ff,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return l(this,ff,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return l(this,ff,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return l(this,ff,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return l(this,ff,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return l(this,ff,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return l(this,ff,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return l(this,ff,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return l(this,ff,"f").draft||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessage",{get:function(){return this.firstUnreadTime?{sentTime:this.firstUnreadTime,messageType:this.firstUnreadMessageType,messageUId:this.firstUnreadMessageUId}:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return{conversationType:l(this,uf,"f"),targetId:l(this,lf,"f"),channelId:l(this,cf,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return hf(this.identifier)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"includeRobot",{get:function(){return!!l(this,ff,"f").includeRobot},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){return n(n({},this.identifier),{latestMessage:this.latestMessage,unreadMessageCount:this.unreadCount,unreadMentionedCount:this.unreadMentionedCount,unreadMentionedMeCount:this.unreadMentionedMeCount,hasMentioned:this.hasMentioned,mentionedInfo:this.mentionedInfo,lastUnreadTime:0,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,notificationStatus:we(this.notificationLevel),isTop:this.isTop,operationTime:this.operationTime,firstUnreadMessage:this.firstUnreadMessage,versionTime:0,draft:this.draft,includeRobot:this.includeRobot})}}),Object.defineProperty(e.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e={};return this.isTop&&(e.to=!0),this.notificationLevel!==Te.NOT_SET&&(e.nl=this.notificationLevel),this.tags.length>0&&(e.tg=this.tags),this.translateStrategy!==Un.DEFAULT&&(e.ts=this.translateStrategy),this.hidden&&(e.h=!0),e}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.updateAttrs(n(n({},bf()),{tags:this.tags,isTop:this.isTop,notificationLevel:this.notificationLevel,translateStrategy:this.translateStrategy,hidden:!0}))}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:e,firstUnreadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0};return t.version=Math.max(this.version,e),this.updateAttrs(t,e)}}),Object.defineProperty(e.prototype,"updateAttrs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=0);var n={},i={latestMessage:"latestMessage",unreadCount:"unreadMessageCount",hasMentioned:"hasMentioned",mentionedInfo:"mentionedInfo",notificationLevel:"notificationLevel",tags:"tags",isTop:"isTop",translateStrategy:"translateStrategy",lastReadTime:void 0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0,firstUnreadTime:void 0,unreadMentionedCount:void 0,unreadMentionedMeCount:void 0,channelType:void 0,operationTime:void 0,draft:void 0,includeRobot:void 0,hidden:void 0,version:void 0};return Object.entries(i).forEach((function(i){var a=s(i,2),o=a[0],u=a[1],c=o;if(Object.prototype.hasOwnProperty.call(e,c)){var f=e[c];l(r,ff,"f")[c]!==f&&(l(r,ff,"f")[c]=f,u&&(n[u]={time:t,val:f}))}})),Object.keys(n).length>0?n:null}}),Object.defineProperty(e.prototype,"addRecvMessageRecord",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){l(this,df,"f").push([e,t,r]),this.removeRecvMessageRecords(e-12e4)}}),Object.defineProperty(e.prototype,"removeRecvMessageRecords",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,df,l(this,df,"f").filter((function(t){return s(t,1)[0]<=e})),"f")}}),Object.defineProperty(e.prototype,"calibrateUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.mentionCnt,r=e.mentionMeCnt,n=e.clearTime,i=e.firstUnreadMsg,a=e.cnt,o=e.cutOffTime,u=t>0,c=u?{type:r>0?Y.SINGAL:Y.ALL}:void 0,f={unreadCount:a,unreadMentionedCount:t,unreadMentionedMeCount:r,lastReadTime:n,firstUnreadTime:null==i?void 0:i.msgTime,firstUnreadMessageType:null==i?void 0:i.className,firstUnreadMessageUId:null==i?void 0:i.msgId,hasMentioned:u,mentionedInfo:c,version:o};l(this,df,"f").forEach((function(e){var t=s(e,3),r=t[0],n=t[1],i=t[2];r<=o||(f.version=Math.max(f.version,r),f.unreadCount+=n,i===Y.SINGAL?f.unreadMentionedMeCount+=n:i===Y.ALL&&(f.unreadMentionedCount+=n))}));var d=this.updateAttrs(f,n);return this.removeRecvMessageRecords(o),d}}),e}();uf=new WeakMap,lf=new WeakMap,cf=new WeakMap,ff=new WeakMap,df=new WeakMap;var If,Tf,vf,Rf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"toStoragItem",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toStoragItem.call(this);return this.unreadCount>0&&(t.c=this.unreadCount),this.unreadMentionedCount>0&&(t.mc=this.unreadMentionedCount),this.unreadMentionedMeCount>0&&(t.mmc=this.unreadMentionedMeCount),this.hasMentioned&&(t.hm=!0),this.mentionedInfo&&(t.m=this.mentionedInfo),this.firstUnreadMessageUId&&(t.fuid=this.firstUnreadMessageUId),this.firstUnreadMessageType&&(t.fumt=this.firstUnreadMessageType),this.firstUnreadTime&&(t.fut=this.firstUnreadTime),this.lastReadTime&&(t.rt=this.lastReadTime),this.version&&(t.v=this.version),t}}),r}(Ef),mf=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"toIReceivedConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=e.prototype.toIReceivedConversation.call(this);return t.channelType=this.channelType,t}}),Object.defineProperty(r.prototype,"isDefaultChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!this.channelId||"RCDefault"===this.channelId}}),r}(Ef),yf=function(e){return"".concat(e.targetId,"_").concat(e.channelId)},Af=function(e){function r(t){var r=e.call(this)||this;return If.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"models",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(r,"ugSentRecord",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),r}return t(r,e),Object.defineProperty(r.prototype,"enableReadReceiptStorage",{get:function(){return this._ctx.initOptions.enableReadReceiptStorage},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=go.localStorage,n=e.appkey,i=e.currentUserId,a=e.isDisableEmptyUGChannelId;r.removeItem("RC-con-s-ver-".concat(n,"-").concat(i)),this.ugSentRecord.clear();var o=nt(n,i),u=rt(n,i),c=it(n,i),f=ze(n,i),d=Ze(n,i),_=$e(n,i),h=et(n,i),g=at(n,i),p=lt(n,i),b=r.getItem(o)||"0",E=r.getItem(u)||"0",I=r.getItem(c)||"1",T=r.getItem(d)||"0",v=JSON.parse(r.getItem(h)||"{}"),R=JSON.parse(r.getItem(f)||"{}"),m=JSON.parse(r.getItem(_)||"{}"),y=JSON.parse(r.getItem(g)||"{}"),A=JSON.parse(r.getItem(p)||"{}");l(this,If,"m",Tf).call(this,R,m,v,a);var O=Object.entries(A);return O.length>0&&O.forEach((function(e){var r=s(e,2),n=r[0],i=r[1];Object.entries(i).forEach((function(e){var r=s(e,2),n=r[0],a=r[1];delete a.d,a.t<t._ctx.serverTime-Ke&&delete i[n]})),0===Object.keys(i).length&&delete A[n]})),{inboxTime:{value:parseInt(b,10)||0,key:o},outboxTime:{value:parseInt(E,10)||0,key:u},broadcastTime:{value:parseInt(I,10)||0,key:c},conversationStatus:{value:R,key:f,stringify:!0},ultraGroupStatus:{value:m,key:_,stringify:!0},conversationStatusVersion:{value:parseInt(T,10)||0,key:d},conversationTypeGlobalSettings:{value:v,key:h,stringify:!0},sentRecord:{value:y,key:g,stringify:!0},readReceiptRecord:{value:A,key:p,stringify:!0}}}}),Object.defineProperty(r.prototype,"addUGSentRecord",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.ugSentRecord.set(e,t)}}),Object.defineProperty(r.prototype,"removeUGSentRecordByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;Array.from(this.ugSentRecord.entries()).forEach((function(r){var n=s(r,2),i=n[0];n[1]<=e&&t.ugSentRecord.delete(i)}))}}),Object.defineProperty(r.prototype,"isLocalSentUGMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.ugSentRecord.has(e)}}),Object.defineProperty(r.prototype,"addSentRecord",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("sentRecord");r[e]=t,this.set("sentRecord",r)}}),Object.defineProperty(r.prototype,"removeSentRecord",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("sentRecord");delete t[e],this.set("sentRecord",t)}}),Object.defineProperty(r.prototype,"removeSentRecordByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("sentRecord");Object.keys(t).forEach((function(r){t[r]<=e&&delete t[r]})),this.set("sentRecord",t)}}),Object.defineProperty(r.prototype,"isLocalSent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.get("sentRecord")[e]}}),Object.defineProperty(r.prototype,"addReadReceiptRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.content,i=e.senderUserId,a=e.sentTime,o=n.messageUId;if(r!==x.GROUP||!o)return!1;if(!this.enableReadReceiptStorage)return!0;if(a<this._ctx.serverTime-Ke)return!1;var u=this.get("readReceiptRecord"),l=yf(e),c=u[l]=u[l]||{};c[o]={t:e.sentTime,sId:i===t?void 0:i};var f=Object.entries(c);if(f.length>30){var d=s(f.sort((function(e,t){return e[1].t-t[1].t})).pop(),2),_=d[0];d[1],delete c[_]}return this.set("readReceiptRecord",u),!0}}),Object.defineProperty(r.prototype,"handleReadReceiptResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.content,i=e.senderUserId;if(e.sentTime,r!==x.GROUP||!n.receiptMessageDic)return!1;if(!this.enableReadReceiptStorage)return!0;var a=i===t,o=n.receiptMessageDic,u=yf(e),l=this.get("readReceiptRecord"),c=l[u]=l[u]||{};a?(Object.entries(o).forEach((function(e){var t=s(e,2);t[0],t[1].forEach((function(e){delete c[e]}))})),0===Object.keys(c).length&&delete l[u]):(o[t]||[]).forEach((function(e){var t=c[e];t&&(t.us=(t.us||[]).concat(i))}));return this.set("readReceiptRecord",l),!0}}),Object.defineProperty(r.prototype,"getReadReceiptResponseUsers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return(null===(r=(this.get("readReceiptRecord")[yf(e)]||{})[t])||void 0===r?void 0:r.us)||[]}}),Object.defineProperty(r.prototype,"createReadReceiptResponseContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("readReceiptRecord")[yf(e)]||{},r={receiptMessageDic:{}};return Object.entries(t).forEach((function(e){var t=s(e,2),n=t[0],i=t[1];i.sId&&(r.receiptMessageDic[i.sId]=r.receiptMessageDic[i.sId]||[],r.receiptMessageDic[i.sId].push(n))})),r}}),Object.defineProperty(r.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),this.models.clear(),l(this,If,"m",vf).call(this)}}),Object.defineProperty(r.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("conversationTypeGlobalSettings");t===Te.NOT_SET?delete r[e]:r[e]={nl:t},this.set("conversationTypeGlobalSettings",r)}}),Object.defineProperty(r.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return(null===(t=this.get("conversationTypeGlobalSettings")[e])||void 0===t?void 0:t.nl)||Te.NOT_SET}}),Object.defineProperty(r.prototype,"getOrCreateModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.targetId;e.channelId;var i=this.getModel(e);if(!i){i=e.conversationType===x.ULTRA_GROUP?new mf(e):new Rf(e);var a=(r===x.PRIVATE||r===x.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===n}));i.updateAttrs({includeRobot:a}),t&&this.models.set(i.key,i)}return i}}),Object.defineProperty(r.prototype,"updateConversationStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get("ultraGroupStatus"),r=this.get("conversationStatus");e.forEach((function(e){var n=e.conversationType,i=e.key,a=e.toStoragItem(),o=Object.keys(a),s=0===o.length||1===o.length&&"h"===o[0],u=n===x.ULTRA_GROUP?t:r;s?delete u[i]:u[i]=a})),this.set("conversationStatus",r),this.set("ultraGroupStatus",t)}}),Object.defineProperty(r.prototype,"updateBySessionStates",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(!(null==e?void 0:e.length))return[];var r=this.get("conversationStatusVersion"),n=new Map,i=new Set;e.forEach((function(e){var a=e.channelId,o=e.busChannel,s=e.type,u=e.stateItem,l=e.time;r=Math.max(r,l);var c={};if(null==u||u.forEach((function(e){var t=e.tags,r=e.sessionStateType,n=e.value;switch(r){case Ro.IsSilent:c.notificationLevel=parseInt(n,10);break;case Ro.IsTop:c.isTop="1"===n;break;case Ro.Tags:c.tags=t;break;case Ro.AutoTrans:c.translateStrategy=parseInt(n,10)}})),a){var f={conversationType:s,targetId:a,channelId:o},d=t.getOrCreateModel(f,!0);i.add(d);var _=d.updateAttrs(c,l);if(_)if(n.has(d)){var h=n.get(d);Object.assign(h,_)}else n.set(d,_)}else void 0!==c.notificationLevel&&t.setConversationTypeNotificationLevel(s,c.notificationLevel)})),this.set("conversationStatusVersion",r),this.updateConversationStorage(Array.from(i));var a=Array.from(n.entries()).map((function(e){var t=s(e,2),r=t[0],n=t[1];return{conversation:r.toIReceivedConversation(),updatedItems:n}}));return a}}),Object.defineProperty(r.prototype,"addRelations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;e.forEach((function(e){var n=e.userId,i=e.type,a={conversationType:i,targetId:n,channelId:e.busChannel},o=r.getOrCreateModel(a,!0),s=function(e,t){var r,n,i,a=e.msg,o=e.isBot;return{latestMessage:a?vc(a,t,!1,e.userId):void 0,lastReadTime:e.readMsgTime,unreadCount:e.unreadCount,operationTime:e.versionTime,unreadMentionedCount:e.remindCount,unreadMentionedMeCount:e.remindMeCount,firstUnreadMessageType:null===(r=e.msgInfo)||void 0===r?void 0:r.className,firstUnreadMessageUId:null===(n=e.msgInfo)||void 0===n?void 0:n.msgId,firstUnreadTime:null===(i=e.msgInfo)||void 0===i?void 0:i.msgTime,includeRobot:!!o}}(e,t);i===x.ULTRA_GROUP?o.updateAttrs(s):o.updateAttrs({latestMessage:s.latestMessage,operationTime:s.operationTime,includeRobot:s.includeRobot,hidden:!1})}))}}),Object.defineProperty(r.prototype,"getDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);return(null==t?void 0:t.draft)||""}}),Object.defineProperty(r.prototype,"setDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.getOrCreateModel(e,!0).updateAttrs({draft:t})}}),Object.defineProperty(r.prototype,"deleteDrafts",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);t&&t.updateAttrs({draft:""})}}),Object.defineProperty(r.prototype,"getCachedUGConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r={conversationType:x.ULTRA_GROUP,targetId:e,channelId:t},n=this.getModel(r);return(null==n?void 0:n.toIReceivedConversation())||null}}),Object.defineProperty(r.prototype,"getAllUGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.models.values();return Array.from(e).filter((function(e){return e.conversationType===x.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(r.prototype,"getAllSGModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.models.values();return Array.from(e).filter((function(e){return e.conversationType!==x.ULTRA_GROUP})).map((function(e){return e}))}}),Object.defineProperty(r.prototype,"getAllModels",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Array.from(this.models.values())}}),Object.defineProperty(r.prototype,"getModel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=hf(e),i=this.models.get(n);if(!i)return null;var a=(t===x.PRIVATE||t===x.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===r}));return i.updateAttrs({includeRobot:a}),i}}),Object.defineProperty(r.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getModel(e);t&&(t.remove(),this.updateConversationStorage([t]))}}),Object.defineProperty(r.prototype,"getAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=0;return this.getAllSGModels().forEach((function(n){var i,a=n.conversationType;e.includes(a)&&(n.notificationLevel>Te.NOT_SET&&!t||(r+=null!==(i=n.unreadCount)&&void 0!==i?i:0))})),r}}),Object.defineProperty(r.prototype,"getTagConversationCountMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=new Map;return this.getAllModels().forEach((function(t){var r=t.tags;r.length>0&&r.forEach((function(r){e.set(r.tagId,(e.get(r.tagId)||[]).concat(t.identifier))}))})),e}}),Object.defineProperty(r.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getModel(e);if(!r)return null;var n=r.clearUnreadCount(t);return this.updateConversationStorage([r]),n?{conversation:r.toIReceivedConversation(),updatedItems:n}:null}}),r}(_f);If=new WeakSet,Tf=function(e,t,r,n){Object.keys(e).forEach((function(t){var n=gf(t);ee(n.conversationType,W)?n.targetId||(r[n.conversationType]={nl:e[t].nl||Te.NOT_SET},delete e[t]):delete e[t]})),Object.keys(t).forEach((function(e){var i=gf(e);if(i.conversationType===x.ULTRA_GROUP)return i.targetId?void(n&&!i.channelId&&delete t[e]):(r[i.conversationType]={nl:t[e].nl||Te.NOT_SET},void delete t[e]);delete t[e]}))},vf=function(){var e=this,t=Object.entries(this.get("conversationStatus")),r=Object.entries(this.get("ultraGroupStatus"));u(u([],s(t),!1),s(r),!1).forEach((function(t){var r,n,i,a,o,u,l,c,f,d,_,h,g,p,b,E,I=s(t,2),T=I[0],v=I[1],R=gf(T);ee(R.conversationType,q)&&e.getOrCreateModel(R,!0).updateAttrs((n=(r=v).c,i=r.mc,a=r.mmc,o=r.hm,u=r.m,l=r.fut,c=r.fuid,f=r.fumt,d=r.nl,_=r.to,h=r.tg,g=r.rt,p=r.h,b=r.ts,E=r.v,{isTop:_,notificationLevel:d,tags:pf(h),unreadCount:n,unreadMentionedCount:i,unreadMentionedMeCount:a,hasMentioned:o,mentionedInfo:u,firstUnreadTime:l,firstUnreadMessageUId:c,firstUnreadMessageType:f,lastReadTime:g,hidden:p,translateStrategy:b,version:E||g}),0)}))};function Of(e){let t=e.length;for(;--t>=0;)e[t]=0}const Sf=256,Nf=286,Cf=30,Pf=15,Mf=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Lf=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),wf=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Uf=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Df=new Array(576);Of(Df);const Gf=new Array(60);Of(Gf);const Vf=new Array(512);Of(Vf);const jf=new Array(256);Of(jf);const kf=new Array(29);Of(kf);const xf=new Array(Cf);function Ff(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let Bf,Hf,Yf;function Wf(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}Of(xf);const Jf=e=>e<256?Vf[e]:Vf[256+(e>>>7)],qf=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Kf=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,qf(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},Qf=(e,t,r)=>{Kf(e,r[2*t],r[2*t+1])},Xf=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},Zf=(e,t,r)=>{const n=new Array(16);let i,a,o=0;for(i=1;i<=Pf;i++)o=o+r[i-1]<<1,n[i]=o;for(a=0;a<=t;a++){let t=e[2*a+1];0!==t&&(e[2*a]=Xf(n[t]++,t))}},zf=e=>{let t;for(t=0;t<Nf;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Cf;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},$f=e=>{e.bi_valid>8?qf(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},ed=(e,t,r,n)=>{const i=2*t,a=2*r;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]},td=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&ed(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!ed(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},rd=(e,t,r)=>{let n,i,a,o,s=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+s++],n+=(255&e.pending_buf[e.sym_buf+s++])<<8,i=e.pending_buf[e.sym_buf+s++],0===n?Qf(e,i,t):(a=jf[i],Qf(e,a+Sf+1,t),o=Mf[a],0!==o&&(i-=kf[a],Kf(e,i,o)),n--,a=Jf(n),Qf(e,a,r),o=Lf[a],0!==o&&(n-=xf[a],Kf(e,n,o)))}while(s<e.sym_next);Qf(e,256,t)},nd=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems;let o,s,u,l=-1;for(e.heap_len=0,e.heap_max=573,o=0;o<a;o++)0!==r[2*o]?(e.heap[++e.heap_len]=l=o,e.depth[o]=0):r[2*o+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,r[2*u]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=n[2*u+1]);for(t.max_code=l,o=e.heap_len>>1;o>=1;o--)td(e,r,o);u=a;do{o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],td(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,r[2*u]=r[2*o]+r[2*s],e.depth[u]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,r[2*o+1]=r[2*s+1]=u,e.heap[1]=u++,td(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,f,d,_,h,g=0;for(d=0;d<=Pf;d++)e.bl_count[d]=0;for(r[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],d=r[2*r[2*c+1]+1]+1,d>u&&(d=u,g++),r[2*c+1]=d,c>n||(e.bl_count[d]++,_=0,c>=s&&(_=o[c-s]),h=r[2*c],e.opt_len+=h*(d+_),a&&(e.static_len+=h*(i[2*c+1]+_)));if(0!==g){do{for(d=u-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(d=u;0!==d;d--)for(c=e.bl_count[d];0!==c;)f=e.heap[--l],f>n||(r[2*f+1]!==d&&(e.opt_len+=(d-r[2*f+1])*r[2*f],r[2*f+1]=d),c--)}})(e,t),Zf(r,l,e.bl_count)},id=(e,t,r)=>{let n,i,a=-1,o=t[1],s=0,u=7,l=4;for(0===o&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s<u&&i===o||(s<l?e.bl_tree[2*i]+=s:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,a=i,0===o?(u=138,l=3):i===o?(u=6,l=3):(u=7,l=4))},ad=(e,t,r)=>{let n,i,a=-1,o=t[1],s=0,u=7,l=4;for(0===o&&(u=138,l=3),n=0;n<=r;n++)if(i=o,o=t[2*(n+1)+1],!(++s<u&&i===o)){if(s<l)do{Qf(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==a&&(Qf(e,i,e.bl_tree),s--),Qf(e,16,e.bl_tree),Kf(e,s-3,2)):s<=10?(Qf(e,17,e.bl_tree),Kf(e,s-3,3)):(Qf(e,18,e.bl_tree),Kf(e,s-11,7));s=0,a=i,0===o?(u=138,l=3):i===o?(u=6,l=3):(u=7,l=4)}};let od=!1;const sd=(e,t,r,n)=>{Kf(e,0+(n?1:0),3),$f(e),qf(e,r),qf(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};var ud=(e,t,r,n)=>{let i,a,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<Sf;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),nd(e,e.l_desc),nd(e,e.d_desc),o=(e=>{let t;for(id(e,e.dyn_ltree,e.l_desc.max_code),id(e,e.dyn_dtree,e.d_desc.max_code),nd(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Uf[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?sd(e,t,r,n):4===e.strategy||a===i?(Kf(e,2+(n?1:0),3),rd(e,Df,Gf)):(Kf(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(Kf(e,t-257,5),Kf(e,r-1,5),Kf(e,n-4,4),i=0;i<n;i++)Kf(e,e.bl_tree[2*Uf[i]+1],3);ad(e,e.dyn_ltree,t-1),ad(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),rd(e,e.dyn_ltree,e.dyn_dtree)),zf(e),n&&$f(e)},ld={_tr_init:e=>{od||((()=>{let e,t,r,n,i;const a=new Array(16);for(r=0,n=0;n<28;n++)for(kf[n]=r,e=0;e<1<<Mf[n];e++)jf[r++]=n;for(jf[r-1]=n,i=0,n=0;n<16;n++)for(xf[n]=i,e=0;e<1<<Lf[n];e++)Vf[i++]=n;for(i>>=7;n<Cf;n++)for(xf[n]=i<<7,e=0;e<1<<Lf[n]-7;e++)Vf[256+i++]=n;for(t=0;t<=Pf;t++)a[t]=0;for(e=0;e<=143;)Df[2*e+1]=8,e++,a[8]++;for(;e<=255;)Df[2*e+1]=9,e++,a[9]++;for(;e<=279;)Df[2*e+1]=7,e++,a[7]++;for(;e<=287;)Df[2*e+1]=8,e++,a[8]++;for(Zf(Df,287,a),e=0;e<Cf;e++)Gf[2*e+1]=5,Gf[2*e]=Xf(e,5);Bf=new Ff(Df,Mf,257,Nf,Pf),Hf=new Ff(Gf,Lf,0,Cf,Pf),Yf=new Ff(new Array(0),wf,0,19,7)})(),od=!0),e.l_desc=new Wf(e.dyn_ltree,Bf),e.d_desc=new Wf(e.dyn_dtree,Hf),e.bl_desc=new Wf(e.bl_tree,Yf),e.bi_buf=0,e.bi_valid=0,zf(e)},_tr_stored_block:sd,_tr_flush_block:ud,_tr_tally:(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(jf[r]+Sf+1)]++,e.dyn_dtree[2*Jf(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Kf(e,2,3),Qf(e,256,Df),(e=>{16===e.bi_valid?(qf(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var cd=(e,t,r,n)=>{let i=65535&e,a=e>>>16&65535,o=0;for(;0!==r;){o=r>2e3?2e3:r,r-=o;do{i=i+t[n++]|0,a=a+i|0}while(--o);i%=65521,a%=65521}return i|a<<16};const fd=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var dd=(e,t,r,n)=>{const i=fd,a=n+r;e^=-1;for(let r=n;r<a;r++)e=e>>>8^i[255&(e^t[r])];return~e},_d={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},hd={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:gd,_tr_stored_block:pd,_tr_flush_block:bd,_tr_tally:Ed,_tr_align:Id}=ld,{Z_NO_FLUSH:Td,Z_PARTIAL_FLUSH:vd,Z_FULL_FLUSH:Rd,Z_FINISH:md,Z_BLOCK:yd,Z_OK:Ad,Z_STREAM_END:Od,Z_STREAM_ERROR:Sd,Z_DATA_ERROR:Nd,Z_BUF_ERROR:Cd,Z_DEFAULT_COMPRESSION:Pd,Z_FILTERED:Md,Z_HUFFMAN_ONLY:Ld,Z_RLE:wd,Z_FIXED:Ud,Z_DEFAULT_STRATEGY:Dd,Z_UNKNOWN:Gd,Z_DEFLATED:Vd}=hd,kd=258,xd=262,Fd=42,Bd=113,Hd=666,Yd=(e,t)=>(e.msg=_d[t],t),Wd=e=>2*e-(e>4?9:0),Jd=e=>{let t=e.length;for(;--t>=0;)e[t]=0},qd=e=>{let t,r,n,i=e.w_size;t=e.hash_size,n=t;do{r=e.head[--n],e.head[n]=r>=i?r-i:0}while(--t);t=i,n=t;do{r=e.prev[--n],e.prev[n]=r>=i?r-i:0}while(--t)};let Kd=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const Qd=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},Xd=(e,t)=>{bd(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Qd(e.strm)},Zd=(e,t)=>{e.pending_buf[e.pending++]=t},zd=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},$d=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=cd(e.adler,t,i,r):2===e.state.wrap&&(e.adler=dd(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},e_=(e,t)=>{let r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-xd?e.strstart-(e.w_size-xd):0,l=e.window,c=e.w_mask,f=e.prev,d=e.strstart+kd;let _=l[a+o-1],h=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,l[r+o]===h&&l[r+o-1]===_&&l[r]===l[a]&&l[++r]===l[a+1]){a+=2,r++;do{}while(l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&a<d);if(n=kd-(d-a),a=d-kd,n>o){if(e.match_start=t,o=n,n>=s)break;_=l[a+o-1],h=l[a+o]}}}while((t=f[t&c])>u&&0!=--i);return o<=e.lookahead?o:e.lookahead},t_=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-xd)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),qd(e),n+=t),0===e.strm.avail_in)break;if(r=$d(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Kd(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Kd(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<xd&&0!==e.strm.avail_in)},r_=(e,t)=>{let r,n,i,a=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,o=0,s=e.strm.avail_in;do{if(r=65535,i=e.bi_valid+42>>3,e.strm.avail_out<i)break;if(i=e.strm.avail_out-i,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>i&&(r=i),r<a&&(0===r&&t!==md||t===Td||r!==n+e.strm.avail_in))break;o=t===md&&r===n+e.strm.avail_in?1:0,pd(e,0,0,o),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Qd(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&($d(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(0===o);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),o?4:t!==Td&&t!==md&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&($d(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),i=e.bi_valid+42>>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,a=i>e.w_size?e.w_size:i,n=e.strstart-e.block_start,(n>=a||(n||t===md)&&t!==Td&&0===e.strm.avail_in&&n<=i)&&(r=n>i?i:n,o=t===md&&0===e.strm.avail_in&&r===n?1:0,pd(e,e.block_start,r,o),e.block_start+=r,Qd(e.strm)),o?3:1)},n_=(e,t)=>{let r,n;for(;;){if(e.lookahead<xd){if(t_(e),e.lookahead<xd&&t===Td)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Kd(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-xd&&(e.match_length=e_(e,r)),e.match_length>=3)if(n=Ed(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Kd(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Kd(e,e.ins_h,e.window[e.strstart+1]);else n=Ed(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Xd(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===md?(Xd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Xd(e,!1),0===e.strm.avail_out)?1:2},i_=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<xd){if(t_(e),e.lookahead<xd&&t===Td)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Kd(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-xd&&(e.match_length=e_(e,r),e.match_length<=5&&(e.strategy===Md||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=Ed(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=Kd(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(Xd(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=Ed(e,0,e.window[e.strstart-1]),n&&Xd(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Ed(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===md?(Xd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Xd(e,!1),0===e.strm.avail_out)?1:2};function a_(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const o_=[new a_(0,0,0,0,r_),new a_(4,4,8,4,n_),new a_(4,5,16,8,n_),new a_(4,6,32,32,n_),new a_(4,4,16,16,i_),new a_(8,16,32,32,i_),new a_(8,16,128,128,i_),new a_(8,32,128,256,i_),new a_(32,128,258,1024,i_),new a_(32,258,258,4096,i_)];function s_(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Vd,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Jd(this.dyn_ltree),Jd(this.dyn_dtree),Jd(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Jd(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Jd(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const u_=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Fd&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Bd&&t.status!==Hd?1:0},l_=e=>{if(u_(e))return Yd(e,Sd);e.total_in=e.total_out=0,e.data_type=Gd;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Fd:Bd,e.adler=2===t.wrap?0:1,t.last_flush=-2,gd(t),Ad},c_=e=>{const t=l_(e);var r;return t===Ad&&((r=e.state).window_size=2*r.w_size,Jd(r.head),r.max_lazy_match=o_[r.level].max_lazy,r.good_match=o_[r.level].good_length,r.nice_match=o_[r.level].nice_length,r.max_chain_length=o_[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},f_=(e,t,r,n,i,a)=>{if(!e)return Sd;let o=1;if(t===Pd&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>9||r!==Vd||n<8||n>15||t<0||t>9||a<0||a>Ud||8===n&&1!==o)return Yd(e,Sd);8===n&&(n=9);const s=new s_;return e.state=s,s.strm=e,s.status=Fd,s.wrap=o,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=t,s.strategy=a,s.method=r,c_(e)};var d_={deflateInit:(e,t)=>f_(e,t,Vd,15,8,Dd),deflateInit2:f_,deflateReset:c_,deflateResetKeep:l_,deflateSetHeader:(e,t)=>u_(e)||2!==e.state.wrap?Sd:(e.state.gzhead=t,Ad),deflate:(e,t)=>{if(u_(e)||t>yd||t<0)return e?Yd(e,Sd):Sd;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===Hd&&t!==md)return Yd(e,0===e.avail_out?Cd:Sd);const n=r.last_flush;if(r.last_flush=t,0!==r.pending){if(Qd(e),0===e.avail_out)return r.last_flush=-1,Ad}else if(0===e.avail_in&&Wd(t)<=Wd(n)&&t!==md)return Yd(e,Cd);if(r.status===Hd&&0!==e.avail_in)return Yd(e,Cd);if(r.status===Fd&&0===r.wrap&&(r.status=Bd),r.status===Fd){let t=Vd+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=Ld||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=n<<6,0!==r.strstart&&(t|=32),t+=31-t%31,zd(r,t),0!==r.strstart&&(zd(r,e.adler>>>16),zd(r,65535&e.adler)),e.adler=1,r.status=Bd,Qd(e),0!==r.pending)return r.last_flush=-1,Ad}if(57===r.status)if(e.adler=0,Zd(r,31),Zd(r,139),Zd(r,8),r.gzhead)Zd(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Zd(r,255&r.gzhead.time),Zd(r,r.gzhead.time>>8&255),Zd(r,r.gzhead.time>>16&255),Zd(r,r.gzhead.time>>24&255),Zd(r,9===r.level?2:r.strategy>=Ld||r.level<2?4:0),Zd(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Zd(r,255&r.gzhead.extra.length),Zd(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=dd(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(Zd(r,0),Zd(r,0),Zd(r,0),Zd(r,0),Zd(r,0),Zd(r,9===r.level?2:r.strategy>=Ld||r.level<2?4:0),Zd(r,3),r.status=Bd,Qd(e),0!==r.pending)return r.last_flush=-1,Ad;if(69===r.status){if(r.gzhead.extra){let t=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let i=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=dd(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=i,Qd(e),0!==r.pending)return r.last_flush=-1,Ad;t=0,n-=i}let i=new Uint8Array(r.gzhead.extra);r.pending_buf.set(i.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>t&&(e.adler=dd(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=dd(e.adler,r.pending_buf,r.pending-n,n)),Qd(e),0!==r.pending)return r.last_flush=-1,Ad;n=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Zd(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=dd(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=dd(e.adler,r.pending_buf,r.pending-n,n)),Qd(e),0!==r.pending)return r.last_flush=-1,Ad;n=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Zd(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=dd(e.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Qd(e),0!==r.pending))return r.last_flush=-1,Ad;Zd(r,255&e.adler),Zd(r,e.adler>>8&255),e.adler=0}if(r.status=Bd,Qd(e),0!==r.pending)return r.last_flush=-1,Ad}if(0!==e.avail_in||0!==r.lookahead||t!==Td&&r.status!==Hd){let n=0===r.level?r_(r,t):r.strategy===Ld?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(t_(e),0===e.lookahead)){if(t===Td)return 1;break}if(e.match_length=0,r=Ed(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Xd(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===md?(Xd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Xd(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===wd?((e,t)=>{let r,n,i,a;const o=e.window;for(;;){if(e.lookahead<=kd){if(t_(e),e.lookahead<=kd&&t===Td)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){a=e.strstart+kd;do{}while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<a);e.match_length=kd-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=Ed(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Ed(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Xd(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===md?(Xd(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Xd(e,!1),0===e.strm.avail_out)?1:2})(r,t):o_[r.level].func(r,t);if(3!==n&&4!==n||(r.status=Hd),1===n||3===n)return 0===e.avail_out&&(r.last_flush=-1),Ad;if(2===n&&(t===vd?Id(r):t!==yd&&(pd(r,0,0,!1),t===Rd&&(Jd(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Qd(e),0===e.avail_out))return r.last_flush=-1,Ad}return t!==md?Ad:r.wrap<=0?Od:(2===r.wrap?(Zd(r,255&e.adler),Zd(r,e.adler>>8&255),Zd(r,e.adler>>16&255),Zd(r,e.adler>>24&255),Zd(r,255&e.total_in),Zd(r,e.total_in>>8&255),Zd(r,e.total_in>>16&255),Zd(r,e.total_in>>24&255)):(zd(r,e.adler>>>16),zd(r,65535&e.adler)),Qd(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Ad:Od)},deflateEnd:e=>{if(u_(e))return Sd;const t=e.state.status;return e.state=null,t===Bd?Yd(e,Nd):Ad},deflateSetDictionary:(e,t)=>{let r=t.length;if(u_(e))return Sd;const n=e.state,i=n.wrap;if(2===i||1===i&&n.status!==Fd||n.lookahead)return Sd;if(1===i&&(e.adler=cd(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(Jd(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const a=e.avail_in,o=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,t_(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=Kd(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,t_(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=o,e.input=s,e.avail_in=a,n.wrap=i,Ad},deflateInfo:"pako deflate (from Nodeca project)"};const __=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var h_={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)__(r,t)&&(e[t]=r[t])}}return e},flattenChunks:e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,i=e.length;t<i;t++){let i=e[t];r.set(i,n),n+=i.length}return r}};let g_=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){g_=!1}const p_=new Uint8Array(256);for(let e=0;e<256;e++)p_[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;p_[254]=p_[254]=1;var b_={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,a,o=e.length,s=0;for(i=0;i<o;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<o&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<o&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},buf2string:(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,i;const a=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){a[i++]=t;continue}let o=p_[t];if(o>4)a[i++]=65533,n+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&n<r;)t=t<<6|63&e[n++],o--;o>1?a[i++]=65533:t<65536?a[i++]=t:(t-=65536,a[i++]=55296|t>>10&1023,a[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&g_)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r})(a,i)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+p_[e[r]]>t?r:t}};var E_=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const I_=Object.prototype.toString,{Z_NO_FLUSH:T_,Z_SYNC_FLUSH:v_,Z_FULL_FLUSH:R_,Z_FINISH:m_,Z_OK:y_,Z_STREAM_END:A_,Z_DEFAULT_COMPRESSION:O_,Z_DEFAULT_STRATEGY:S_,Z_DEFLATED:N_}=hd;function C_(e){this.options=h_.assign({level:O_,method:N_,chunkSize:16384,windowBits:15,memLevel:8,strategy:S_},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new E_,this.strm.avail_out=0;let r=d_.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==y_)throw new Error(_d[r]);if(t.header&&d_.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?b_.string2buf(t.dictionary):"[object ArrayBuffer]"===I_.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=d_.deflateSetDictionary(this.strm,e),r!==y_)throw new Error(_d[r]);this._dict_set=!0}}C_.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,a;if(this.ended)return!1;for(a=t===~~t?t:!0===t?m_:T_,"string"==typeof e?r.input=b_.string2buf(e):"[object ArrayBuffer]"===I_.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(a===v_||a===R_)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=d_.deflate(r,a),i===A_)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=d_.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===y_;if(0!==r.avail_out){if(a>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},C_.prototype.onData=function(e){this.chunks.push(e)},C_.prototype.onEnd=function(e){e===y_&&(this.result=h_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const P_=16209;var M_=function(e,t){let r,n,i,a,o,s,u,l,c,f,d,_,h,g,p,b,E,I,T,v,R,m,y,A;const O=e.state;r=e.next_in,y=e.input,n=r+(e.avail_in-5),i=e.next_out,A=e.output,a=i-(t-e.avail_out),o=i+(e.avail_out-257),s=O.dmax,u=O.wsize,l=O.whave,c=O.wnext,f=O.window,d=O.hold,_=O.bits,h=O.lencode,g=O.distcode,p=(1<<O.lenbits)-1,b=(1<<O.distbits)-1;e:do{_<15&&(d+=y[r++]<<_,_+=8,d+=y[r++]<<_,_+=8),E=h[d&p];t:for(;;){if(I=E>>>24,d>>>=I,_-=I,I=E>>>16&255,0===I)A[i++]=65535&E;else{if(!(16&I)){if(64&I){if(32&I){O.mode=16191;break e}e.msg="invalid literal/length code",O.mode=P_;break e}E=h[(65535&E)+(d&(1<<I)-1)];continue t}for(T=65535&E,I&=15,I&&(_<I&&(d+=y[r++]<<_,_+=8),T+=d&(1<<I)-1,d>>>=I,_-=I),_<15&&(d+=y[r++]<<_,_+=8,d+=y[r++]<<_,_+=8),E=g[d&b];;){if(I=E>>>24,d>>>=I,_-=I,I=E>>>16&255,16&I){if(v=65535&E,I&=15,_<I&&(d+=y[r++]<<_,_+=8,_<I&&(d+=y[r++]<<_,_+=8)),v+=d&(1<<I)-1,v>s){e.msg="invalid distance too far back",O.mode=P_;break e}if(d>>>=I,_-=I,I=i-a,v>I){if(I=v-I,I>l&&O.sane){e.msg="invalid distance too far back",O.mode=P_;break e}if(R=0,m=f,0===c){if(R+=u-I,I<T){T-=I;do{A[i++]=f[R++]}while(--I);R=i-v,m=A}}else if(c<I){if(R+=u+c-I,I-=c,I<T){T-=I;do{A[i++]=f[R++]}while(--I);if(R=0,c<T){I=c,T-=I;do{A[i++]=f[R++]}while(--I);R=i-v,m=A}}}else if(R+=c-I,I<T){T-=I;do{A[i++]=f[R++]}while(--I);R=i-v,m=A}for(;T>2;)A[i++]=m[R++],A[i++]=m[R++],A[i++]=m[R++],T-=3;T&&(A[i++]=m[R++],T>1&&(A[i++]=m[R++]))}else{R=i-v;do{A[i++]=A[R++],A[i++]=A[R++],A[i++]=A[R++],T-=3}while(T>2);T&&(A[i++]=A[R++],T>1&&(A[i++]=A[R++]))}break}if(64&I){e.msg="invalid distance code",O.mode=P_;break e}E=g[(65535&E)+(d&(1<<I)-1)]}}break}}while(r<n&&i<o);T=_>>3,r-=T,_-=T<<3,d&=(1<<_)-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<o?o-i+257:257-(i-o),O.hold=d,O.bits=_};const L_=15,w_=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),U_=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),D_=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),G_=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var V_=(e,t,r,n,i,a,o,s)=>{const u=s.bits;let l,c,f,d,_,h,g=0,p=0,b=0,E=0,I=0,T=0,v=0,R=0,m=0,y=0,A=null;const O=new Uint16Array(16),S=new Uint16Array(16);let N,C,P,M=null;for(g=0;g<=L_;g++)O[g]=0;for(p=0;p<n;p++)O[t[r+p]]++;for(I=u,E=L_;E>=1&&0===O[E];E--);if(I>E&&(I=E),0===E)return i[a++]=20971520,i[a++]=20971520,s.bits=1,0;for(b=1;b<E&&0===O[b];b++);for(I<b&&(I=b),R=1,g=1;g<=L_;g++)if(R<<=1,R-=O[g],R<0)return-1;if(R>0&&(0===e||1!==E))return-1;for(S[1]=0,g=1;g<L_;g++)S[g+1]=S[g]+O[g];for(p=0;p<n;p++)0!==t[r+p]&&(o[S[t[r+p]]++]=p);if(0===e?(A=M=o,h=20):1===e?(A=w_,M=U_,h=257):(A=D_,M=G_,h=0),y=0,p=0,g=b,_=a,T=I,v=0,f=-1,m=1<<I,d=m-1,1===e&&m>852||2===e&&m>592)return 1;for(;;){N=g-v,o[p]+1<h?(C=0,P=o[p]):o[p]>=h?(C=M[o[p]-h],P=A[o[p]-h]):(C=96,P=0),l=1<<g-v,c=1<<T,b=c;do{c-=l,i[_+(y>>v)+c]=N<<24|C<<16|P}while(0!==c);for(l=1<<g-1;y&l;)l>>=1;if(0!==l?(y&=l-1,y+=l):y=0,p++,0==--O[g]){if(g===E)break;g=t[r+o[p]]}if(g>I&&(y&d)!==f){for(0===v&&(v=I),_+=b,T=g-v,R=1<<T;T+v<E&&(R-=O[T+v],!(R<=0));)T++,R<<=1;if(m+=1<<T,1===e&&m>852||2===e&&m>592)return 1;f=y&d,i[f]=I<<24|T<<16|_-a}}return 0!==y&&(i[_+y]=g-v<<24|64<<16),s.bits=I,0};const{Z_FINISH:j_,Z_BLOCK:k_,Z_TREES:x_,Z_OK:F_,Z_STREAM_END:B_,Z_NEED_DICT:H_,Z_STREAM_ERROR:Y_,Z_DATA_ERROR:W_,Z_MEM_ERROR:J_,Z_BUF_ERROR:q_,Z_DEFLATED:K_}=hd,Q_=16180,X_=16190,Z_=16191,z_=16192,$_=16194,eh=16199,th=16200,rh=16206,nh=16209,ih=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function ah(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const oh=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Q_||t.mode>16211?1:0},sh=e=>{if(oh(e))return Y_;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Q_,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,F_},uh=e=>{if(oh(e))return Y_;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,sh(e)},lh=(e,t)=>{let r;if(oh(e))return Y_;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Y_:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,uh(e))},ch=(e,t)=>{if(!e)return Y_;const r=new ah;e.state=r,r.strm=e,r.window=null,r.mode=Q_;const n=lh(e,t);return n!==F_&&(e.state=null),n};let fh,dh,_h=!0;const hh=e=>{if(_h){fh=new Int32Array(512),dh=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(V_(1,e.lens,0,288,fh,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;V_(2,e.lens,0,32,dh,0,e.work,{bits:5}),_h=!1}e.lencode=fh,e.lenbits=9,e.distcode=dh,e.distbits=5},gh=(e,t,r,n)=>{let i;const a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),a.window.set(t.subarray(r-n,r-n+i),a.wnext),(n-=i)?(a.window.set(t.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0};var ph={inflateReset:uh,inflateReset2:lh,inflateResetKeep:sh,inflateInit:e=>ch(e,15),inflateInit2:ch,inflate:(e,t)=>{let r,n,i,a,o,s,u,l,c,f,d,_,h,g,p,b,E,I,T,v,R,m,y=0;const A=new Uint8Array(4);let O,S;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(oh(e)||!e.output||!e.input&&0!==e.avail_in)return Y_;r=e.state,r.mode===Z_&&(r.mode=z_),o=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,c=r.bits,f=s,d=u,m=F_;e:for(;;)switch(r.mode){case Q_:if(0===r.wrap){r.mode=z_;break}for(;c<16;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(2&r.wrap&&35615===l){0===r.wbits&&(r.wbits=15),r.check=0,A[0]=255&l,A[1]=l>>>8&255,r.check=dd(r.check,A,2,0),l=0,c=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=nh;break}if((15&l)!==K_){e.msg="unknown compression method",r.mode=nh;break}if(l>>>=4,c-=4,R=8+(15&l),0===r.wbits&&(r.wbits=R),R>15||R>r.wbits){e.msg="invalid window size",r.mode=nh;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&l?16189:Z_,l=0,c=0;break;case 16181:for(;c<16;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(r.flags=l,(255&r.flags)!==K_){e.msg="unknown compression method",r.mode=nh;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=nh;break}r.head&&(r.head.text=l>>8&1),512&r.flags&&4&r.wrap&&(A[0]=255&l,A[1]=l>>>8&255,r.check=dd(r.check,A,2,0)),l=0,c=0,r.mode=16182;case 16182:for(;c<32;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}r.head&&(r.head.time=l),512&r.flags&&4&r.wrap&&(A[0]=255&l,A[1]=l>>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,r.check=dd(r.check,A,4,0)),l=0,c=0,r.mode=16183;case 16183:for(;c<16;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}r.head&&(r.head.xflags=255&l,r.head.os=l>>8),512&r.flags&&4&r.wrap&&(A[0]=255&l,A[1]=l>>>8&255,r.check=dd(r.check,A,2,0)),l=0,c=0,r.mode=16184;case 16184:if(1024&r.flags){for(;c<16;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}r.length=l,r.head&&(r.head.extra_len=l),512&r.flags&&4&r.wrap&&(A[0]=255&l,A[1]=l>>>8&255,r.check=dd(r.check,A,2,0)),l=0,c=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(_=r.length,_>s&&(_=s),_&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+_),R)),512&r.flags&&4&r.wrap&&(r.check=dd(r.check,n,_,a)),s-=_,a+=_,r.length-=_),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===s)break e;_=0;do{R=n[a+_++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R))}while(R&&_<s);if(512&r.flags&&4&r.wrap&&(r.check=dd(r.check,n,_,a)),s-=_,a+=_,R)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===s)break e;_=0;do{R=n[a+_++],r.head&&R&&r.length<65536&&(r.head.comment+=String.fromCharCode(R))}while(R&&_<s);if(512&r.flags&&4&r.wrap&&(r.check=dd(r.check,n,_,a)),s-=_,a+=_,R)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;c<16;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(4&r.wrap&&l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=nh;break}l=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Z_;break;case 16189:for(;c<32;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}e.adler=r.check=ih(l),l=0,c=0,r.mode=X_;case X_:if(0===r.havedict)return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=c,H_;e.adler=r.check=1,r.mode=Z_;case Z_:if(t===k_||t===x_)break e;case z_:if(r.last){l>>>=7&c,c-=7&c,r.mode=rh;break}for(;c<3;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}switch(r.last=1&l,l>>>=1,c-=1,3&l){case 0:r.mode=16193;break;case 1:if(hh(r),r.mode=eh,t===x_){l>>>=2,c-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=nh}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=nh;break}if(r.length=65535&l,l=0,c=0,r.mode=$_,t===x_)break e;case $_:r.mode=16195;case 16195:if(_=r.length,_){if(_>s&&(_=s),_>u&&(_=u),0===_)break e;i.set(n.subarray(a,a+_),o),s-=_,a+=_,u-=_,o+=_,r.length-=_;break}r.mode=Z_;break;case 16196:for(;c<14;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(r.nlen=257+(31&l),l>>>=5,c-=5,r.ndist=1+(31&l),l>>>=5,c-=5,r.ncode=4+(15&l),l>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=nh;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;c<3;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}r.lens[N[r.have++]]=7&l,l>>>=3,c-=3}for(;r.have<19;)r.lens[N[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},m=V_(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,m){e.msg="invalid code lengths set",r.mode=nh;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[l&(1<<r.lenbits)-1],p=y>>>24,b=y>>>16&255,E=65535&y,!(p<=c);){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(E<16)l>>>=p,c-=p,r.lens[r.have++]=E;else{if(16===E){for(S=p+2;c<S;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(l>>>=p,c-=p,0===r.have){e.msg="invalid bit length repeat",r.mode=nh;break}R=r.lens[r.have-1],_=3+(3&l),l>>>=2,c-=2}else if(17===E){for(S=p+3;c<S;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}l>>>=p,c-=p,R=0,_=3+(7&l),l>>>=3,c-=3}else{for(S=p+7;c<S;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}l>>>=p,c-=p,R=0,_=11+(127&l),l>>>=7,c-=7}if(r.have+_>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=nh;break}for(;_--;)r.lens[r.have++]=R}}if(r.mode===nh)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=nh;break}if(r.lenbits=9,O={bits:r.lenbits},m=V_(1,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,m){e.msg="invalid literal/lengths set",r.mode=nh;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},m=V_(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,m){e.msg="invalid distances set",r.mode=nh;break}if(r.mode=eh,t===x_)break e;case eh:r.mode=th;case th:if(s>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=c,M_(e,d),o=e.next_out,i=e.output,u=e.avail_out,a=e.next_in,n=e.input,s=e.avail_in,l=r.hold,c=r.bits,r.mode===Z_&&(r.back=-1);break}for(r.back=0;y=r.lencode[l&(1<<r.lenbits)-1],p=y>>>24,b=y>>>16&255,E=65535&y,!(p<=c);){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(b&&!(240&b)){for(I=p,T=b,v=E;y=r.lencode[v+((l&(1<<I+T)-1)>>I)],p=y>>>24,b=y>>>16&255,E=65535&y,!(I+p<=c);){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}l>>>=I,c-=I,r.back+=I}if(l>>>=p,c-=p,r.back+=p,r.length=E,0===b){r.mode=16205;break}if(32&b){r.back=-1,r.mode=Z_;break}if(64&b){e.msg="invalid literal/length code",r.mode=nh;break}r.extra=15&b,r.mode=16201;case 16201:if(r.extra){for(S=r.extra;c<S;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;y=r.distcode[l&(1<<r.distbits)-1],p=y>>>24,b=y>>>16&255,E=65535&y,!(p<=c);){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(!(240&b)){for(I=p,T=b,v=E;y=r.distcode[v+((l&(1<<I+T)-1)>>I)],p=y>>>24,b=y>>>16&255,E=65535&y,!(I+p<=c);){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}l>>>=I,c-=I,r.back+=I}if(l>>>=p,c-=p,r.back+=p,64&b){e.msg="invalid distance code",r.mode=nh;break}r.offset=E,r.extra=15&b,r.mode=16203;case 16203:if(r.extra){for(S=r.extra;c<S;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=nh;break}r.mode=16204;case 16204:if(0===u)break e;if(_=d-u,r.offset>_){if(_=r.offset-_,_>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=nh;break}_>r.wnext?(_-=r.wnext,h=r.wsize-_):h=r.wnext-_,_>r.length&&(_=r.length),g=r.window}else g=i,h=o-r.offset,_=r.length;_>u&&(_=u),u-=_,r.length-=_;do{i[o++]=g[h++]}while(--_);0===r.length&&(r.mode=th);break;case 16205:if(0===u)break e;i[o++]=r.length,u--,r.mode=th;break;case rh:if(r.wrap){for(;c<32;){if(0===s)break e;s--,l|=n[a++]<<c,c+=8}if(d-=u,e.total_out+=d,r.total+=d,4&r.wrap&&d&&(e.adler=r.check=r.flags?dd(r.check,i,d,o-d):cd(r.check,i,d,o-d)),d=u,4&r.wrap&&(r.flags?l:ih(l))!==r.check){e.msg="incorrect data check",r.mode=nh;break}l=0,c=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;c<32;){if(0===s)break e;s--,l+=n[a++]<<c,c+=8}if(4&r.wrap&&l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=nh;break}l=0,c=0}r.mode=16208;case 16208:m=B_;break e;case nh:m=W_;break e;case 16210:return J_;default:return Y_}return e.next_out=o,e.avail_out=u,e.next_in=a,e.avail_in=s,r.hold=l,r.bits=c,(r.wsize||d!==e.avail_out&&r.mode<nh&&(r.mode<rh||t!==j_))&&gh(e,e.output,e.next_out,d-e.avail_out),f-=e.avail_in,d-=e.avail_out,e.total_in+=f,e.total_out+=d,r.total+=d,4&r.wrap&&d&&(e.adler=r.check=r.flags?dd(r.check,i,d,e.next_out-d):cd(r.check,i,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Z_?128:0)+(r.mode===eh||r.mode===$_?256:0),(0===f&&0===d||t===j_)&&m===F_&&(m=q_),m},inflateEnd:e=>{if(oh(e))return Y_;let t=e.state;return t.window&&(t.window=null),e.state=null,F_},inflateGetHeader:(e,t)=>{if(oh(e))return Y_;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,F_):Y_},inflateSetDictionary:(e,t)=>{const r=t.length;let n,i,a;return oh(e)?Y_:(n=e.state,0!==n.wrap&&n.mode!==X_?Y_:n.mode===X_&&(i=1,i=cd(i,t,r,0),i!==n.check)?W_:(a=gh(e,t,r,r),a?(n.mode=16210,J_):(n.havedict=1,F_)))},inflateInfo:"pako inflate (from Nodeca project)"};var bh=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Eh=Object.prototype.toString,{Z_NO_FLUSH:Ih,Z_FINISH:Th,Z_OK:vh,Z_STREAM_END:Rh,Z_NEED_DICT:mh,Z_STREAM_ERROR:yh,Z_DATA_ERROR:Ah,Z_MEM_ERROR:Oh}=hd;function Sh(e){this.options=h_.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new E_,this.strm.avail_out=0;let r=ph.inflateInit2(this.strm,t.windowBits);if(r!==vh)throw new Error(_d[r]);if(this.header=new bh,ph.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=b_.string2buf(t.dictionary):"[object ArrayBuffer]"===Eh.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=ph.inflateSetDictionary(this.strm,t.dictionary),r!==vh)))throw new Error(_d[r])}function Nh(e,t){const r=new Sh(t);if(r.push(e),r.err)throw r.msg||_d[r.err];return r.result}Sh.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Th:Ih,"[object ArrayBuffer]"===Eh.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=ph.inflate(r,o),a===mh&&i&&(a=ph.inflateSetDictionary(r,i),a===vh?a=ph.inflate(r,o):a===Ah&&(a=mh));r.avail_in>0&&a===Rh&&r.state.wrap>0&&0!==e[r.next_in];)ph.inflateReset(r),a=ph.inflate(r,o);switch(a){case yh:case Ah:case mh:case Oh:return this.onEnd(a),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(0===r.avail_out||a===Rh))if("string"===this.options.to){let e=b_.utf8border(r.output,r.next_out),t=r.next_out-e,i=b_.buf2string(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(a!==vh||0!==s){if(a===Rh)return a=ph.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Sh.prototype.onData=function(e){this.chunks.push(e)},Sh.prototype.onEnd=function(e){e===vh&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=h_.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ch={Inflate:Sh,inflate:Nh,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Nh(e,t)},ungzip:Nh,constants:hd};const{Inflate:Ph,inflate:Mh,inflateRaw:Lh,ungzip:wh}=Ch;var Uh=wh;function Dh(e){return Object.keys(e).map((function(t){var r=e[t];return"string"!=typeof r&&(r="".concat(r)),{key:t,value:r}}))}function Gh(e,t,r,n){return Ul.encode(bu,{targetId:e,type:x.GROUP,users:n,extProfile:r?Dh(r):void 0,settingProfile:Dh(t)})}var Vh,jh,kh,xh,Fh,Bh,Hh,Yh,Wh,Jh,qh,Kh,Qh,Xh=function(e,t){return Ul.encode($o,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},Zh=function(e){var t=Ul.decode(Bo,e),r=t.compressioEnabled,n=t.compressedData,i=t.info,a=t.pullTime,o=t.isFinished,s=t.pageToken;if(r){var u=Uh(n);return Zh(u)}return{info:i,pullTime:a,isFinished:o,pageToken:s}},zh=function(e){var t=Ul.decode(Co,e);if(t.compressioEnabled){var r=Uh(t.compressedData);return zh(r)}return t},$h=function(e){var t=Ul.decode(Po,e);if(t.compressioEnabled){var r=Uh(t.compressedData);return $h(r)}return{syncTime:t.syncTime,list:t.list.map((function(e){return Ul.decode(Mo,new Uint8Array(e))}))}},eg=function(e){return Ul.encode(As,n(n({},e),{compress:Dn.enable()}))},tg=function(e){var t=Ul.decode(Ss,e);if(t.compress){var r=Uh(t.compressData);return tg(r)}return t},rg=function(e){var t=Ul.decode(Ns,e);if(t.compress){var r=Uh(t.compressData);return rg(r)}return t},ng=function(e){var t=e.listType,r=e.result,i=e.page,a=new Uint8Array(r),o=[];switch(t){case 1:o=Ul.decode(yu,a).list;break;case 2:o=Ul.decode(mu,a).list;break;case 3:o=Ul.decode(Au,a).list;break;case 11:o=Ul.decode(Vu,a).list;break;case 12:o=Ul.decode(ju,a).list}return n(n({},i),{list:o})},ig=function(e){return Ul.encode(Qo,n(n({},e),{compressioEnabled:Dn.enable(),ignoreCmd:!0}))},ag=function(e){var t=Ul.decode(Xo,e);if(t.compressioEnabled){var r=Uh(t.compressedData);return ag(r)}return t},og=function(e,t){return Ul.encode(ps,{ignoreVersion:!0,version:e,state:t})},sg=function(e){var t=Ul.decode(zu,e);if(t.compress){var r=Uh(t.compressedData);return sg(r)}return t},ug=function(e){return Ul.encode(ls,{timestamp:e,compressioEnabled:Dn.enable()})},lg=function(e){var t=Ul.decode(ss,e);if(t.compressioEnabled){var r=Uh(t.compressedData);return lg(r)}return t},cg=function(e,t){var r,n,i,a,u=e.targetId,l=e.conversationType,c=e.channelId,f=t.messageType,d=t.isMentioned,_=t.disableNotification,h=t.canIncludeExpansion,g=t.pushConfig,p=t.directionalUserIdList,b=t.isVoipPush,E=t.isFilerWhiteBlacklist,I=t.content,T=t.pushContent,v=t.pushData,R=t.expansion,m=t.messageId,y=t.needReceipt,A=t.disableUpdateLastMessage,O=t.isStatusMessage,S=yn(f).isPersited,N=mc(f,d,_,h,O),C=function(e,t,r,n){var i=0;return e&&(i|=1),t&&(i|=2),r&&(i|=4),n&&(i|=8),i}(!!b,!E,!!(null==g?void 0:g.disablePushTitle),!!(null==g?void 0:g.forceShowDetailContent));if(I.user&&I.user.portraitUri&&(I.user.portrait=I.user.portraitUri),h&&R){i={};try{for(var P=o(Object.entries(R)),M=P.next();!M.done;M=P.next()){var L=s(M.value,2),w=L[0],U=L[1];i[w]={v:U}}}catch(e){r={error:e}}finally{try{M&&!M.done&&(n=P.return)&&n.call(P)}finally{if(r)throw r.error}}}if(g){var D=g.pushTitle,G=g.iOSConfig,V=g.androidConfig,j=g.templateId,k=g.harmonyOSConfig;a={title:D,pushConfigs:rr(G,V,k),pushId:null==V?void 0:V.notificationId,templateId:j}}var F=l===x.SYSTEM?u:void 0,B=0;return S&&A&&(B|=1),y&&(B|=2),Ul.encode(No,{sessionId:N,pushText:(null==g?void 0:g.pushContent)||T,appData:(null==g?void 0:g.pushData)||v,toUserIds:p,configFlag:C,classname:f,content:JSON.stringify(I),extraContent:i?JSON.stringify(i):void 0,pushExt:a,clientUniqueId:m,busChannel:c,systemId:F,optionBits:B})},fg=function(e){return Ul.encode(vu,n(n({},e),{type:x.GROUP}))},dg=function(e){return Ul.encode(Ou,n(n({},e),{type:x.GROUP}))},_g=function(e){return Ul.encode(Tu,n(n({},e),{type:x.GROUP}))},hg=function(e){var t=Ul.decode(el,e);if(t.compress){var r=Uh(t.compressedData);return hg(r)}return t},gg=((Vh={})[ra]=k.RC_DISCONN_KICK,Vh[na]=k.RC_DISCONN_EXCEPTION,Vh[aa]=k.RC_DISCONN_EXCEPTION,Vh[oa]=k.RC_CONN_REDIRECTED,Vh[sa]=k.RC_CONN_TOKEN_EXPIRED,Vh[ua]=k.RC_CONN_PROTO_VERSION_ERROR,Vh[la]=k.RC_ACCOUNT_CANCELLATION,Vh),pg=((jh={})[Di]=k.SUCCESS,jh[Gi]=k.RC_CONN_PROTO_VERSION_ERROR,jh[Vi]=k.RC_CONN_IDENTIFIER_REJECTED,jh[ji]=k.RC_CONN_SERVER_UNAVAILABLE,jh[ki]=k.RC_CONN_TOKEN_INCORRECT,jh[xi]=k.RC_CONN_NOT_AUTHRORIZED,jh[Fi]=k.RC_CONN_REDIRECTED,jh[Bi]=k.RC_CONN_PACKAGE_NAME_INVALID,jh[Hi]=k.RC_CONN_APP_BLOCKED_OR_DELETED,jh[Yi]=k.RC_CONN_USER_BLOCKED,jh[Wi]=k.RC_CONN_TOKEN_EXPIRED,jh[Ji]=k.RC_CONN_DEVICE_ERROR,jh[qi]=k.RC_CONN_HOSTNAME_ERROR,jh[Ki]=k.RC_DISCONN_SAME_CLIENT_ON_LINE,jh[Qi]=k.RC_LISCENSE_COUNT_OUT_OF_LIMIT,jh[Xi]=k.RC_CONN_WRONG_CLUSTER,jh[Zi]=k.RC_APP_AUTH_NOT_PASS,jh[zi]=k.RC_OTP_USED,jh[$i]=k.RC_PLATFORM_ERROR,jh[ea]=k.RC_ACCOUNT_CANCELLATION,jh[ta]=k.RC_LICENSE_EXPIRED,jh),bg=function(e){return[$n.ppMsgS,$n.pgMsgS,$n.chatMsgS,$n.prMsgS].includes(e)},Eg=function(e){function r(t,r,n){var i=e.call(this,"WebSGMsgReceiver")||this;return kh.add(i),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_recvRecord",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),i._ctx.on("sMsg",l(i,kh,"m",Bh),i),i._ctx.on("syncMsg",l(i,kh,"m",Fh),i),i}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c,f,d,_,h,g,p,b,E,I,T,v,R,m,y,A,O=this;return a(this,(function(a){switch(a.label){case 0:return r=this._ctx,n=r.logger,i=r.currentUserId,o=r.connectedTime,s=this._ctx.getNaviInfoFromCache(),u=this._storage.get("inboxTime"),c=this._storage.get("outboxTime"),f=this._storage.get("broadcastTime"),d=n.createTraceId(),n.info(F.L_PULL_MSG_T,JSON.stringify({inboxTime:u,outboxTime:c,broadcastTime:f}),d),_=Ul.encode(So,{ispolling:!1,isPullSend:!0,syncTime:u,sendBoxSyncTime:c,broadcastSyncTime:f,compressioEnabled:Dn.enable()}),[4,this._ctx.query($n.pullMsg,i,_)];case 1:return(h=a.sent()).isOk?(g=zh(h.data.pbData),b=(p=g).list,E=p.finished,I=p.syncTime,T=p.broadcastSyncTime,v=c,R=b.map((function(e){var t=Rc(s,e,i,e.dataTime<o);return t.messageDirection===be.SEND&&(v=Math.max(v,t.sentTime)),t})),m=l(this,kh,"a",xh),y=R.filter((function(e){if(e.senderUserId===i){var t=e.messageType===Re.RECALL?"Cmd:".concat(e.content.messageUId):e.messageUId;return!O._storage.isLocalSent(t)}if(m)return!0;var r=!O._recvRecord.has(e.messageUId);return r&&O._recvRecord.set(e.messageUId,e.sentTime),r})),this._storage.set("inboxTime",I),this._storage.set("broadcastTime",T||1),this._storage.set("outboxTime",v),n.info(F.L_PULL_MSG_R,JSON.stringify({code:0,inboxTime:I,broadcastTime:T,outboxTime:v,msgCount:R.length,afterFilteredCount:y.length,hasNext:!E}),d),A=Math.max(I,T||1,v),0===e&&this._emitter.emit("__firstOfflineMessageTime__",(null===(t=R[0])||void 0===t?void 0:t.sentTime)||0),this._storage.removeSentRecordByTimestamp(v),l(this,kh,"m",Hh).call(this,"pullMsg",y,!!E),l(this,kh,"m",Yh).call(this,I),[2,Ir({version:A,hasNext:!E})]):(n.warn(F.L_PULL_MSG_R,JSON.stringify({code:h.code}),d),[2,h.wipe()])}}))}))}}),r}(pr);kh=new WeakSet,xh=function(){var e;return 0!==(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.openHistoryMsg)},Fh=function(e,t,r){var n=t.conversationType,i=t.sentTime,a=t.messageUId;n!==x.ULTRA_GROUP&&n!==x.CHATROOM&&(e.stopPropagation(),n===x.RTC_ROOM||bg(r)||this._storage.addSentRecord(a,i),l(this,kh,"m",Hh).call(this,"syncMsg",[t],!0))},Bh=function(e,t){var r=t.conversationType,n=t.sentTime,i=t.isStatusMessage,a=t.messageUId;r!==x.CHATROOM&&r!==x.ULTRA_GROUP&&(e.stopPropagation(),i||r===x.RTC_ROOM?l(this,kh,"m",Hh).call(this,"smsg",[t],!0):l(this,kh,"a",xh)?this.push(n):(this._recvRecord.has(a)||(this._recvRecord.set(a,n),l(this,kh,"m",Hh).call(this,"smsg",[t],!0)),l(this,kh,"m",Yh).call(this,n)))},Hh=function(e,t,r){this._emitter.emit("messages",e,t,r)},Yh=function(e){var t=this;if(!l(this,kh,"a",xh)){var r=e-18e4;Array.from(this._recvRecord.entries()).forEach((function(e){var n=s(e,2),i=n[0];n[1]<=r&&t._recvRecord.delete(i)}))}};var Ig,Tg,vg=function(e){function r(t,r){var n=e.call(this,"WebUGMsgReceiver")||this;return Wh.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),n._ctx.on("syncMsg",l(n,Wh,"m",qh),n),n._ctx.on("sCmd",l(n,Wh,"m",Jh),n),n}return t(r,e),Object.defineProperty(r.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,l(this,Wh,"m",Qh).call(this,0)];case 1:return(e=a.sent()).isOk?(this._ctx.logger.info(F.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,l(this,Wh,"m",Kh).call(this,0,[])]):(this._ctx.logger.warn(F.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(r=a.sent()).isOk?(n=r.data,i=n.length>0?n[n.length-1].versionTime:0,o=Math.max(t,i),[2,Ir({relations:n,msgVersion:o})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,c=this;return a(this,(function(a){switch(a.label){case 0:return[4,l(this,Wh,"m",Qh).call(this,e)];case 1:return(t=a.sent()).isOk?(r=t.data,n=r.syncTime,i=r.finished,(null==(o=r.list)?void 0:o.length)&&(s=this._ctx.currentUserId,(u=o.filter((function(e){return!c._storage.isLocalSentUGMessage(e.msgId)})).map((function(e){return vc(e,s,!1)}))).length>0&&this._ctx.emit("messagesFromUG",u,n)),this._storage.removeUGSentRecordByTimestamp(n),[2,Ir({version:n,hasNext:!i})]):[2,t.wipe()]}}))}))}}),r}(pr);Wh=new WeakSet,Jh=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},qh=function(e,t){t.conversationType===x.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},Kh=function e(t,r){return i(this,void 0,void 0,(function(){var n,i,o,c,f,d,_,h,g,p;return a(this,(function(a){switch(a.label){case 0:return n=this._ctx,i=n.currentUserId,o=n.logger,c=o.createTraceId(),o.info(F.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),c),f=Ul.encode(Us,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query($n.pullUgSes,i,f,void 0)];case 1:return d=a.sent(),o.summary(F.L_PULL_UG_RELATIONS_R,d,c,{ver:t}),d.isOk?(_=Zh(d.data.pbData),h=_.info,g=_.isFinished,r.push.apply(r,u([],s(h),!1)),g?[2,Ir(r)]:(p=h[h.length-1].versionTime,[2,l(this,Wh,"m",e).call(this,p,r)])):[2,d.wipe()]}}))}))},Qh=function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=n.createTraceId(),n.info(F.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),l=e,o=Ul.encode(Ds,{syncTime:l,compressioEnabled:Dn.enable()}),[4,this._ctx.query($n.pullUgMsg,r,o)];case 1:return s=a.sent(),n.summary(F.L_PULL_ULTRA_MSG_R,s,i,{version:e}),s.isOk?(u=s.data,[2,Ir(zh(u.pbData))]):[2,s.wipe()]}var l}))}))};var Rg,mg,yg,Ag=13,Og=36,Sg=41,Ng=function(e){function r(t,r){var n=e.call(this,"WebServerEventHandler")||this;return Ig.add(n),Object.defineProperty(n,"_con",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,u,c,f=this;return a(this,(function(a){switch(a.label){case 0:return t=this._logger.createTraceId(),this._logger.info(F.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,l(this,Ig,"m",Tg).call(this,e)];case 1:return r=a.sent(),this._logger.summary(F.L_PULL_EVENT_CHANGE_R,r,t,{version:e}),r.isOk?(n=r.data,i=n.list,o=n.syncTime,u=n.hasNext,i.length&&(c=new Map,i.forEach((function(e){var t=e.changeType;c.has(t)?c.get(t).push(e):c.set(t,[e])})),Array.from(c.entries()).forEach((function(e){var t=s(e,2),r=t[0],n=t[1];f.emit("serverEvent",r,n)}))),[2,Ir({version:o,hasNext:u})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"noticeOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return e=this._logger.createTraceId(),this._logger.info(F.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,l(this,Ig,"m",Tg).call(this,0)];case 1:return t=r.sent(),this._logger.summary(F.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),r}(pr);Ig=new WeakSet,Tg=function(e){var t=Ul.encode(js,{syncTime:e});return this._con.query($n.pullEventChange,this._con.getCurrentUserId(),t,xs)};var Cg=function(e){function r(t){var r=e.call(this,"WebUGServerEventHandler")||this;return Rg.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=Ul.encode(js,{syncTime:e}),[4,this._ctx.query($n.qryMsgChange,this._ctx.currentUserId,t,Fs)];case 1:return(r=a.sent()).isOk?(n=r.data,i=n.list,o=n.syncTime,s=n.hasNext,i&&i.length&&l(this,Rg,"m",mg).call(this,i),[2,Ir({version:o,hasNext:s})]):[2,r.wipe()]}}))}))}}),r}(pr);Rg=new WeakSet,mg=function(e){var t=[],r=[],n=[],i=[],a=[];e.forEach((function(e){switch(e.changeType){case 1:r.push(e);break;case 2:t.push(e);break;case 3:n.push(e);break;case 4:i.push(e);break;case 5:a.push(e)}})),r.length&&l(this,Rg,"m",yg).call(this,r,1),t.length&&l(this,Rg,"m",yg).call(this,t,2),n.length&&this.emit("ugMsgRecalled",e),i.length&&this._ctx.emit("ugChannelChanged",i),a.length&&this._ctx.emit("ugUserGroupChanged",a)},yg=function(e,t){var r=this,n=new Map;e.forEach((function(e){var t=e.targetId,r=e.busChannel,i=e.msgUID,a="".concat(t,"-").concat(r),o=n.get(a);o?o.messageUIds.push(i):n.set(a,{conversationIdentifier:{conversationType:x.ULTRA_GROUP,targetId:t,channelId:r},messageUIds:[i]})})),Array.from(n.entries()).forEach((function(e){var n=s(e,2);n[0];var i=n[1];1===t?r.emit("ugMsgExpansion",i.conversationIdentifier,i.messageUIds):r.emit("ugMsgModify",i.conversationIdentifier,i.messageUIds)}))};var Pg,Mg,Lg,wg,Ug,Dg,Gg,Vg,jg,kg,xg,Fg,Bg,Hg,Yg,Wg,Jg,qg,Kg,Qg,Xg,Zg,zg,$g,ep,tp,rp,np,ip,ap,op,sp,up,lp,cp,fp,dp,_p,hp,gp,pp,bp,Ep,Ip,Tp,vp,Rp,mp,yp=function(){return i(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,Tr(k.NOT_SUPPORT,"Not support")]}))}))},Ap=function(e){function r(t,r){var n=e.call(this,"WebSGMsgModifyReceiver")||this;return Pg.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"storage",{enumerable:!0,configurable:!0,writable:!0,value:r}),Mg.set(n,!0),n._ctx.on("onConnected",l(n,Pg,"m",Lg),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i,o,s,u,f;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger.createTraceId(),this._ctx.logger.info(F.L_PULL_MODIFY_MSG_T,JSON.stringify({time:e}),t),d={pullVersion:e},r=Ul.encode(Zu,n(n({},d),{modifyType:[1],compress:Dn.enable()})),[4,this._ctx.query($n.pullModifyMsg,this._ctx.currentUserId,r,void 0)];case 1:return i=a.sent(),this._ctx.logger.summary(F.L_PULL_MODIFY_MSG_R,i,t),i.isOk?(o=sg(i.data.pbData),s=o.msg,u=o.nextVersion,f=o.finished,s&&s.length&&l(this,Pg,"m",wg).call(this,s),l(this,Mg,"f")&&(this._ctx.emit("messageModifiedSyncCompleted",!f),c(this,Mg,!1,"f")),[2,Ir({version:u,hasNext:!f})]):[2,i.wipe()]}var d}))}))}}),r}(pr);Mg=new WeakMap,Pg=new WeakSet,Lg=function(e,t){c(this,Mg,!0,"f"),t||this.reset()},wg=function(e){var t=this,r=[],n=this._ctx.currentUserId;e.forEach((function(e){var i=e.msg;if(1===e.modifyType){var a=vc(i,n,!1);r.push(a);var o=a.conversationType,s=a.targetId,u=a.channelId,l=t.storage.getModel({conversationType:o,targetId:s,channelId:u});if(l&&l.latestMessage){var c=l.latestMessage,f=c.messageUId,d=c.messageType,_=c.content;if(f!==a.messageUId){if(d===Re.REFERENCE){if(_.referMsgUid!==a.messageUId)return;_.referMsg=a.content}}else l.updateAttrs({latestMessage:a})}}})),r.length&&this._ctx.emit("messageModified",r)};var Op=18e4,Sp=function(e){function r(t,r,n){var i=e.call(this)||this;return Dg.add(i),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_userSettins",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Gg.set(i,void 0),Vg.set(i,void 0),jg.set(i,void 0),kg.set(i,void 0),xg.set(i,void 0),Fg.set(i,!1),Bg.set(i,void 0),Hg.set(i,!1),np.set(i,1),Object.defineProperty(i,"getConversationListByPageIndex",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"getUntaggedConversationListByPage",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Ep.set(i,new Set),Object.defineProperty(i,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"setMessageSpeechToTextVisible",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"syncRemoteConversations",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"getMessagesAroundTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"deleteLocalUGMessagesForAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"getUnreadMentionedMessages",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"saveEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"getEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"clearEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(i,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:yp}),c(i,Bg,new gr,"f"),c(i,xg,n,"f"),i.storage=new Af(t),i.settings=new sf(i._ctx,i.storage,i),c(i,Gg,new vg(i._ctx,i.storage),"f"),c(i,Vg,new Eg(i._ctx,i.storage,l(i,Bg,"f")),"f"),c(i,jg,new Cg(i._ctx),"f"),c(i,kg,new Ap(i._ctx,i.storage),"f"),l(i,Bg,"f").on("messages",l(i,Dg,"m",Zg),i),l(i,Bg,"f").on("__firstOfflineMessageTime__",(function(e,t){l(i,kg,"f").setInitVersion(t||i._ctx.connectedTime)}),i),l(i,jg,"f").on("ugMsgModify",l(i,Dg,"m",op),i),l(i,jg,"f").on("ugMsgExpansion",l(i,Dg,"m",sp),i),l(i,jg,"f").on("ugMsgRecalled",l(i,Dg,"m",up),i),i._ctx.on("onConnected",l(i,Dg,"m",rp),i),i._ctx.on("onDisconnected",l(i,Dg,"m",fp),i),i._ctx.on("onSuspend",l(i,Dg,"m",fp),i),i._ctx.on("sCmd",l(i,Dg,"m",dp),i),i._ctx.on("sNtf",l(i,Dg,"m",_p),i),i._ctx.on("signal",l(i,Dg,"m",hp),i),i._ctx.on("serverEvent",l(i,Dg,"m",zg),i),i._ctx.on("robotsSynced",l(i,Dg,"m",Yg),i),i}return t(r,e),Object.defineProperty(r.prototype,"ugSynced",{get:function(){return l(this,Fg,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c,f;return a(this,(function(a){return r=e.count,n=e.startTime,i=e.order,o=e.conversationTypes,t?(s=0!==n||i?n:Number.MAX_SAFE_INTEGER,u=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==x.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>s:e.operationTime<s)})).sort((function(e,t){return e.operationTime-t.operationTime})),c=Math.min(u.length,r),f=i?u.slice(0,c):u.slice(u.length-c),i||f.reverse(),[2,Ir(f.map((function(e){return e.toIReceivedConversation()})))]):[2,l(this,Dg,"m",gp).call(this,n,r,i||0,o)]}))}))}}),Object.defineProperty(r.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){return n=((null==t?void 0:t.length)||0)>0?t:$(e?q:W),i="string"==typeof r&&""!==r,o=this.storage.getAllModels().filter((function(t){return t.isTop&&!t.hidden&&n.includes(t.conversationType)&&(t.conversationType!==x.ULTRA_GROUP&&(!i||t.channelId===r)||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,l(this,Dg,"m",pp).call(this,o)]}))}))}}),Object.defineProperty(r.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>Te.NOT_SET&&(t.conversationType!==x.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,l(this,Dg,"m",pp).call(this,t)]}))}))}}),Object.defineProperty(r.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){return r=((null==t?void 0:t.length)||0)>0?t:$(e?q:W),n=this.storage.getAllModels().filter((function(t){return t.unreadCount>0&&r.includes(t.conversationType)&&(t.conversationType!==x.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,l(this,Dg,"m",pp).call(this,n)]}))}))}}),Object.defineProperty(r.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return r="string"==typeof t,e?(n=this.storage.getAllModels().filter((function(e){return!(e.hidden||(e.conversationType===x.ULTRA_GROUP||r&&e.channelId!==t)&&e.channelId&&"RCDefault"!==e.channelId)})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,Ir(n)]):[4,l(this,Dg,"m",gp).call(this,0,1e3,0)];case 1:return[2,i.sent().trans((function(e){return e.filter((function(e){return!r||e.channelId===t}))}))]}}))}))}}),Object.defineProperty(r.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){return n=0,this.storage.getAllModels().forEach((function(i){i.unreadCount>0&&e.includes(i.conversationType)&&(i.conversationType!==x.ULTRA_GROUP&&(!r&&!i.channelId||i.channelId===r)||i.conversationType===x.ULTRA_GROUP&&(""===i.channelId||"RCDefault"===i.channelId))&&(t||i.notificationLevel<=Te.NOT_SET)&&(n+=i.unreadCount)})),[2,Ir(n)]}))}))}}),Object.defineProperty(r.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return t=this.storage.getOrCreateModel(e,!1),r=t.toIReceivedConversation(),[4,l(this,Dg,"m",pp).call(this,[r])];case 1:return(n=i.sent()).isOk?[2,n.trans((function(e){return e[0]}))]:[2,Ir(r)]}}))}))}}),Object.defineProperty(r.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var r,i,o,s,u,c,f=this;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,l(this,Dg,"m",bp).call(this,e,r,t)];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.version,u=o.updateVersion,c=e.map((function(e){var r=f.storage.getOrCreateModel(e,!0);return r.updateAttrs({isTop:t,hidden:!n&&r.hidden,operationTime:r.hidden&&n?Date.now():r.operationTime}),r})),this.storage.updateConversationStorage(c),u&&this.storage.set("conversationStatusVersion",s),[2,Ir()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c=this;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,l(this,Dg,"m",bp).call(this,e,r,void 0,t)];case 1:return(n=a.sent()).isOk?(i=n.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var r=c.storage.getOrCreateModel(e,!0);return r.updateAttrs({notificationLevel:t}),r})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,Ir()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c=this;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,l(this,Dg,"m",bp).call(this,e,r,void 0,void 0,t)];case 1:return(n=a.sent()).isOk?(i=n.data,o=i.version,s=i.updateVersion,u=e.map((function(e){var r=c.storage.getOrCreateModel(e,!0);return r.updateAttrs({translateStrategy:t}),r})),this.storage.updateConversationStorage(u),s&&this.storage.set("conversationStatusVersion",o),[2,Ir()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this.storage.getOrCreateModel(e,!1),[2,Ir(t.notificationLevel)]}))}))}}),Object.defineProperty(r.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this.storage.getConversationTypeNotificationLevel(e),[2,Ir(t)]}))}))}}),Object.defineProperty(r.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=this._ctx.currentUserId,i=Ul.encode(vs,{type:e,unpushLevel:t,version:r,ignoreVersion:!0}),[4,this._ctx.query($n.setTypeUnpush,n,i,Rs)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,this.storage.setConversationTypeNotificationLevel(e,t),l&&this.storage.set("conversationStatusVersion",u),[2,Ir()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){return e=this.storage.getAllSGModels(),t=this._ctx.serverTime,e.forEach((function(e){return e.clearUnreadCount(t)})),this.storage.updateConversationStorage(e),[2,Ir()]}))}))}}),Object.defineProperty(r.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return r=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),n=Ul.encode(is,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:r}),i=e.conversationType===x.ULTRA_GROUP?$n.delUgMsg:$n.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,n)];case 1:return(o=a.sent()).isOk?this._ctx.includeUg?((s=this.storage.getModel(e))&&(u=s.latestMessage)&&t.some((function(e){return e.messageUId===u.messageUId}))&&s.updateAttrs({latestMessage:null}),[2,Ir()]):[2,Ir()]:[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=Ul.encode(Wo,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),n=Np[e.conversationType],[4,this._ctx.query(n,this._ctx.currentUserId,r)];case 1:return(i=a.sent()).isOk?this._ctx.includeUg?((o=this.storage.getModel(e))&&(s=o.latestMessage)&&(0===t||s.sentTime<=t)&&o.updateAttrs({latestMessage:null}),[2,Ir()]):[2,Ir()]:[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=Ul.encode(Jo,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query($n.cleanMsgBatch,this._ctx.currentUserId,t)];case 1:return(r=i.sent()).isOk?(e.forEach((function(e){var t=n.storage.getModel(e);if(t){var r=t.latestMessage;r&&(!e.timestamp||r.sentTime<=e.timestamp)&&t.updateAttrs({latestMessage:null})}})),[2,Ir()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return r=Ul.encode(ys,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),n=t[0],[4,this._ctx.query($n.readReceipt,n,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,u,l;return a(this,(function(a){switch(a.label){case 0:return t=new Map,e.forEach((function(e){var r=hf(e.identifier),n=t.get(r)||new Set;n.add(e.messageUId),t.set(r,n)})),r=Array.from(t.entries()).map((function(e){var t=s(e,2),r=t[0],n=t[1],i=gf(r);return{targetId:i.targetId,type:i.conversationType,busChannel:i.channelId,msgIds:Array.from(n)}})),n=function(e){return Ul.encode(Os,{items:e,compress:Dn.enable()})}(r),[4,this._ctx.query($n.qryReceiptBatch,e[0].messageUId,n)];case 1:return(i=a.sent()).isOk?(o=i.data,u=rg(o.pbData).item,l=[],u.forEach((function(e){var t,r={conversationType:e.type,targetId:e.targetId,channelId:e.busChannel};null===(t=e.msg)||void 0===t||t.forEach((function(e){var t=e.msgId,n=e.unreadCnt,i=e.readCnt,a=e.totalCnt;l.push({identifier:r,messageUId:t,unreadCount:n,readCount:i,totalCount:a})}))})),[2,Ir(l)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,f;return a(this,(function(a){switch(a.label){case 0:return n=0===r.readStatus?1:2,i=eg({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:1,pageType:1,pageToken:r.pageToken,pageSize:r.pageCount,readType:n,order:r.order?0:1}),[4,this._ctx.query($n.qryReceipt,t,i)];case 1:return(o=a.sent()).isOk?(s=o.data,u=tg(s.pbData),l=u.resp,c=u.pageToken,f=l[0],[2,Ir({pageToken:c||"",totalCount:1===n?f.readCnt:f.unreadCnt,users:(1===n?f.readUser:f.unreadUser).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,l,c;return a(this,(function(a){switch(a.label){case 0:return n=eg({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:r}),[4,this._ctx.query($n.qryReceipt,t,n)];case 1:return(i=a.sent()).isOk?(o=i.data,l=tg(o.pbData).resp,c=l[0],[2,Ir({pageToken:"",totalCount:0,users:u(u([],s(c.readUser),!1),s(c.unreadUser),!1).map((function(e){var t=e.userId,r=e.mentioned;return{userId:t,timestamp:e.receiptTime||0,isMentioned:!!r}}))})]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=vr.create("requestSpeechToTextForMessage").isObject("option",t,!0).fail(k.BIZ_ERROR_INVALID_PARAMETER,"option type error").validate("messageType",null==t?void 0:t.messageType,(function(e){return e===Re.HQ_VOICE||e===Re.VOICE}),!0).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){if(t.messageType===Re.HQ_VOICE)e.validate("numberOfChannels",t.numberOfChannels,(function(e){return 1===e}),!0).fail(k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"numberOfChannels invalid").validate("sampleRate",t.sampleRate,(function(e){return 16e3===e||8e3===e}),!0).fail(k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"sampleRate invalid").isString("format",t.format).fail(k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"format invalid").isHttpUrl("remoteUrl",t.remoteUrl,!0).fail(k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"remoteUrl invalid");else{var r=t.content;e.isNotEmptyString("content",r,!0).fail(k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"content invalid")}})).isLimitedInteger("duration",t.duration,1,60,!0).fail(k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"duration invalid").result()).isOk?l(this,Ep,"f").has(e)?[2,Tr(k.SPEECH_TO_TEXT_REQUEST_IN_PROCESS,"speech to text request in process")]:(l(this,Dg,"m",Ip).call(this,e,t),[2,Ir()]):[2,r.wipe()]}))}))}}),Object.defineProperty(r.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return t=e.messageUId,r=e.messageContent,n=e.conversation,i=Ul.encode(Gs,{targetId:n.targetId,type:n.conversationType,busChannel:n.channelId,msgUID:t,msgTime:0,content:JSON.stringify(r),fromUserId:""}),[4,this._ctx.query($n.modifyMsg,this._ctx.currentUserId,i,Vs)];case 1:return(o=a.sent()).isOk?((s=this.storage.getModel(n))&&(u=s.latestMessage,l=s.conversationType,u&&u.messageUId===t&&(u.content=r,u.isModifyMessage=!0,u.modifyInfo=l===x.ULTRA_GROUP?void 0:{timestamp:o.data.modifyTime,status:Hr,content:{}},s.updateAttrs({latestMessage:u}))),[2,Ir()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s=this;return a(this,(function(a){return(i=vr.create("refreshReferenceMessageWithParams").validate("messageInfoMap",o,(function(t){return t&&e.every((function(e){return t[e]&&mt(t[e])}))}),!0).fail(k.INVALID_PARAMETER_MESSAGE_INFO_MAP).result()).isOk?(setTimeout((function(){n([]),l(s,Dg,"m",vp).call(s,e,t,r,o)}),0),[2,Ir()]):[2,i.wipe()]}))}))}}),Object.defineProperty(r.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,u,l,c,f,d,_,h,g,p=this;return a(this,(function(a){switch(a.label){case 0:return this._userSettins.hasTag(e)?(r=this.storage.get("conversationStatusVersion"),n=Date.now(),i=this._ctx.currentUserId,o=t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:n,stateItem:[{sessionStateType:Ro.Tags,value:"",tags:[{tagId:e}]}]}})),u=og(r,o),[4,this._ctx.query($n.addTag,i,u,Ts)]):[2,Tr(k.TAG_NOT_EXIST)];case 1:return(l=a.sent()).isOk?(c=l.data,f=c.version,d=c.updateVersion,_=new Map,t.forEach((function(t){var r=p.storage.getOrCreateModel(t,!0),n={},i=r.tags;i.some((function(t){return t.tagId===e}))||(n.tags=i.concat({tagId:e}),_.set(r,n))})),h=[],g=[],Array.from(_.entries()).forEach((function(e){var t=s(e,2),r=t[0],n=t[1];g.push(r);var i=r.updateAttrs(n,f);i&&h.push({conversation:r.toIReceivedConversation(),updatedItems:i})})),this.storage.updateConversationStorage(g),d&&this.storage.set("conversationStatusVersion",f),h.length>0&&this.emit("conversationStatusChanged",h),[2,Ir()]):[2,l.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){return t=this.storage.getOrCreateModel(e,!1),r=this._userSettins.getTags(),n=t.tags.map((function(e){var t;return{tagId:e.tagId,tagName:null===(t=r[e.tagId])||void 0===t?void 0:t.tagName}})),[2,Ir(n)]}))}))}}),Object.defineProperty(r.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,f,d,_,h;return a(this,(function(a){switch(a.label){case 0:return n=this.storage.get("conversationStatusVersion"),i=r.isTop,o=this.storage.getOrCreateModel(t,!1),s=o.tags,(u=s.find((function(t){return t.tagId===e})))?(l=og(n,[{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:Ro.Tags,value:"",tags:[{tagId:e,isTop:i}]}]}]),c=this._ctx.currentUserId,[4,this._ctx.query($n.addTag,c,l,Ts)]):[2,Tr(k.NO_TAG_IN_CONVER)];case 1:return(f=a.sent()).isOk?(d=f.data,_=d.version,h=d.updateVersion,u.isTop=i,o.updateAttrs({tags:s},_),this.storage.updateConversationStorage([o]),h&&this.storage.set("conversationStatusVersion",_),[2,Ir()]):[2,f.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,f=this;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=og(r,t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:Ro.Tags,value:"",tags:[{tagId:e}]}]}}))),i=this._ctx.currentUserId,[4,this._ctx.query($n.delTag,i,n,Ts)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=t.map((function(t){var r=f.storage.getOrCreateModel(t,!0),n={tags:r.tags.filter((function(t){return t.tagId!==e}))};return r.updateAttrs(n,u),r})),this.storage.updateConversationStorage(c),l&&this.storage.set("conversationStatusVersion",u),[2,Ir()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,f,d;return a(this,(function(a){switch(a.label){case 0:return r=this._ctx.currentUserId,n=this.storage.get("conversationStatusVersion"),i=og(n,[{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:Date.now(),stateItem:[{sessionStateType:Ro.Tags,value:"",tags:t.map((function(e){return{tagId:e}}))}]}]),[4,this._ctx.query($n.delTag,r,i,Ts)];case 1:return(o=a.sent()).isOk?(s=o.data,u=s.version,l=s.updateVersion,c=this.storage.getOrCreateModel(e,!0),f=c.tags,d={tags:f.filter((function(e){return!t.includes(e.tagId)}))},c.updateAttrs(d,u),this.storage.updateConversationStorage([c]),l&&this.storage.set("conversationStatusVersion",u),[2,Ir()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){return this._userSettins.hasTag(e)?(i=t||Number.MAX_SAFE_INTEGER,0===(o=this.storage.getAllSGModels().filter((function(t){return t.operationTime<i&&t.tags.some((function(t){return t.tagId===e}))})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r)).length?[2,Ir([])]:(s=o.map((function(t){return n(n({},t.toIReceivedConversation()),{isTopInTag:t.tags.some((function(t){return t.tagId===e&&t.isTop}))})})),[2,l(this,Dg,"m",pp).call(this,s)])):[2,Ir([])]}))}))}}),Object.defineProperty(r.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){return r=0,this.storage.getAllSGModels().forEach((function(n){var i;if(n.tags.some((function(t){return t.tagId===e}))){if(n.notificationLevel>Te.NOT_SET&&!t)return;r+=null!==(i=n.unreadCount)&&void 0!==i?i:0}})),[2,Ir(r)]}))}))}}),Object.defineProperty(r.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=e.identifiers,r=e.deleteMessages,n=Ul.encode(ns,{relation:t.map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),cleanMsg:r}),[4,this._ctx.query($n.delRelationBatch,this._ctx.currentUserId,n,void 0)];case 1:return(i=a.sent()).isOk&&t.forEach((function(e){var t=o.storage.getModel(e);t&&o.storage.removeConversation(t)})),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Ul.encode(ms,{msgId:t,channelId:r}),[4,this._ctx.query($n.rrMsg,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.channelId,n=e.targetId,i=Ul.encode(Ys,{targetId:n,type:t,busChannel:r||"",opType:0}),(o=new Oa($n.operate,i,n)).setHeaderQos(ii),[4,this._ctx.send(o)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){return t=e.targetId,r=e.channelType,n=this.storage.getAllUGModels().filter((function(e){return!(void 0!==t&&t!==e.targetId||void 0!==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})).map((function(e){var t=e.toIReceivedConversation();return t.unreadMentionedCount=Nc(t.unreadMentionedCount||0),t.unreadMessageCount=Nc(t.unreadMessageCount||0),t.unreadMentionedMeCount=Nc(t.unreadMentionedMeCount||0),t})),[2,Ir(n)]}))}))}}),Object.defineProperty(r.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=this._ctx.currentUserId,[4,l(this,Dg,"m",Tp).call(this,e,t)];case 1:return(n=a.sent()).isOk?(i=n.data,o=i.list,i.notExistMsgId,s=o.map((function(t){return vc(t,r,!1,e.targetId)})),[2,Ir(s)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.targetId,r=e.channelId,n=e.sentTime,i=e.count,o=Ul.encode(Ho,{groupId:t,busChannel:r,msgTime:n,size:i}),[4,this._ctx.query($n.qryUgUal,this._ctx.currentUserId,o,Yo)];case 1:return(s=a.sent()).isOk?(u=s.data.msgInfo,[2,Ir(u.map((function(e){return{messageUId:e.msgId,sentTime:e.msgTime,messageType:e.className,mentionedType:e.remindType}})))]):[2,s.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var o;return i(this,void 0,void 0,(function(){var i,s,u,l,c,f,d,_;return a(this,(function(a){switch(a.label){case 0:return i=this._ctx.currentUserId,s=t.mid,u=t.put,l=t.del,c=t.clear,f=Ul.encode(Gs,{fromUserId:i,targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgUID:s,msgTime:r,content:JSON.stringify(t)}),[4,this._ctx.query($n.upMsgEx,e.targetId,f)];case 1:return(d=a.sent()).isOk&&(null==(_=null===(o=this.storage.getModel(e))||void 0===o?void 0:o.latestMessage)?void 0:_.messageUId)===s&&(c?_.expansion={}:u?_.expansion=n(n({},_.expansion),u):l&&_.expansion&&l.forEach((function(e){delete _.expansion[e]}))),[2,d.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Ul.encode(Es,{unpushLevel:t,busChannel:r}),[4,this._ctx.query($n.ugUnpushSet,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i;return a(this,(function(a){switch(a.label){case 0:return r=Ul.encode(bs,{busChannel:t}),[4,this._ctx.query($n.ugUnpushQuery,e,r,Is)];case 1:return(n=a.sent()).isOk?(i=n.data.unpushLevel,[2,Ir(i)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){return r=this.storage.getModel(e),[2,Ir(null!==(t=null==r?void 0:r.unreadMentionedCount)&&void 0!==t?t:0)]}))}))}}),Object.defineProperty(r.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){return e=this.storage.getAllSGModels().reduce((function(e,t){return e+t.unreadMentionedCount}),0),[2,Ir(e)]}))}))}}),Object.defineProperty(r.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){return n=0,this.storage.getAllModels().forEach((function(i){if(e.includes(i.conversationType)){var a=i.notificationLevel,o=i.unreadCount,s=i.unreadMentionedCount;(0===t.length||t.includes(a))&&(n+=r?s:o)}})),[2,Ir(n)]}))}))}}),Object.defineProperty(r.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this.storage.getModel(e),[2,Ir(t?t.unreadCount:0)]}))}))}}),Object.defineProperty(r.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){return(t=this.storage.getModel(e))?(r=t.firstUnreadMessage,[2,Ir(r?{messageUId:r.messageUId||"",sentTime:r.sentTime}:null)]):[2,Ir(null)]}))}))}}),Object.defineProperty(r.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i;return a(this,(function(a){return n=this.storage.getAllUGModels(),i=n.reduce((function(n,i){var a=r?i.unreadMentionedCount:i.unreadCount;if(!a||i.targetId!==e)return n;var o=i.notificationLevel||Te.NOT_SET;return!t.length||t.includes(o)?n+a:n}),0),[2,Ir(Nc(i))]}))}))}}),Object.defineProperty(r.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this.storage.getAllUGModels().filter((function(t){return e.includes(t.targetId)})).map((function(e){return{conversationType:e.conversationType,type:e.conversationType,targetId:e.targetId,channelId:e.channelId,unreadMessageCount:Nc(e.unreadCount||0),mentionedCount:Nc(e.unreadMentionedCount||0),mentionedMeCount:Nc(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||Te.NOT_SET}})),[2,Ir(t)]}))}))}}),Object.defineProperty(r.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){return t=this.storage.getModel(e),(r=null==t?void 0:t.firstUnreadMessage)?[2,Ir(r)]:[2,Tr(k.RC_DB_DATA_NOT_FOUND)]}))}))}}),Object.defineProperty(r.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){return e=this.storage.getAllUGModels().filter((function(e){return e.notificationLevel>Te.NOT_SET})).map((function(e){return e.toIReceivedConversation()})),[2,Ir(e)]}))}))}}),Object.defineProperty(r.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.serverTime,e.conversationType!==x.ULTRA_GROUP?[3,2]:(r=Xh(e,t),(n=new Oa($n.updUgRTime,r,this._ctx.currentUserId)).setHeaderQos(ii),[4,this._ctx.send(n)]);case 1:if(!(i=a.sent()).isOk)return[2,i.wipe()];a.label=2;case 2:return this.storage.clearConversationUnreadCount(e,t),[2,Ir()]}}))}))}}),Object.defineProperty(r.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return[4,l(this,Dg,"m",mp).call(this,t,r,e,[],Ge.ALL,$n.qrySessions)];case 1:return(i=a.sent()).isOk?(o=this._ctx.currentUserId,s=i.data.info.map((function(e){var t=e.unreadCount,r=e.busChannel,i=e.type,a=e.userId,s=e.versionTime,l=e.msg,c=u.storage.getOrCreateModel({conversationType:i,targetId:a,channelId:r||""},!1);return n(n({},c.toIReceivedConversation()),{unreadMessageCount:t,operationTime:s,latestMessage:l?vc(l,o,!1,a):null})})).sort((function(e,t){var n,i,a=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0,o=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===r?o-a:a-o})),[2,Ir(s)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=Ul.encode(Zo,{nothing:1}),[4,this._ctx.query($n.qrySessionsAtt,this._ctx.currentUserId,e,zo)];case 1:return[2,t.sent().trans((function(e){return e.totalUnreadCount}))]}}))}))}}),Object.defineProperty(r.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return t=this._ctx.serverTime,this.storage.clearConversationUnreadCount(e,this._ctx.serverTime),r=Xh(e,t),n=new Oa($n.updRRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Ul.encode(es,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query($n.delSessions,this._ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Ul.encode(ts,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query($n.qrySessionsUnread,this._ctx.currentUserId,t,rs)];case 1:return[2,r.sent().trans((function(e){return e.sessions.map((function(e){return{conversationType:e.type,targetId:e.channelId,channelId:e.busChannel||"",unreadCount:e.unreadCount||0}}))}))]}}))}))}}),Object.defineProperty(r.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){return r=e.count,n=e.conversationTypes,i=e.timestamp||Number.MAX_SAFE_INTEGER,t?(o=this.storage.getAllModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&n.includes(e.conversationType)&&(e.conversationType!==x.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r),[2,Ir(o.map((function(e){return e.toIReceivedConversation()})))]):(s=this.storage.getAllSGModels().filter((function(e){return e.operationTime<i&&e.unreadMentionedCount>0&&n.includes(e.conversationType)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r),u=s.map((function(e){return e.toIReceivedConversation()})),[2,l(this,Dg,"m",pp).call(this,u)])}))}))}}),Object.defineProperty(r.prototype,"loadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var i,o,s,u,l,c,f,d=this;return a(this,(function(a){switch(a.label){case 0:return i=function(e,t,r){var n=r.conversationTypes,i=r.tagFilter,a=void 0===i?{}:i,o=r.order;r.channelId;var s=a.tagIds,u=a.topPriority;return Ul.encode(Fo,{type:n,count:t,order:o,tags:s,isTagTop:!!u,pageToken:e,compress:Dn.enable()})}(e,t,r),[4,this._ctx.query($n.qryRelationFilter,this._ctx.currentUserId,i,void 0)];case 1:return(o=a.sent()).isOk?(s=Zh(o.data.pbData),u=s.pageToken,l=s.isFinished,c=s.info,f=c.map((function(e){var t=e.busChannel,r=e.type,i=e.userId,a={conversationType:r,targetId:i,channelId:t||""},o=d.storage.getOrCreateModel(a,!1);return n(n({},o.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?vc(e.msg,d._ctx.currentUserId,!1,i):null})})),[2,Ir({pageToken:u||"",finished:!!l,list:f})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return r=Xh(e,t),n=new Oa($n.updRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Ul.encode(ms,{msgId:[t],channelId:r}),[4,this._ctx.query($n.rrList,e,n,Cs)];case 1:return[2,i.sent().trans((function(e){return{totalMemberCount:e.totalMemberNum,list:e.list}}))]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return n=e.conversationType,i=e.targetId,o=e.channelId,s=Ul.encode(Zs,{targetId:i,type:n,busChannel:o,startMsgId:t,endMsgId:r}),u=new Oa($n.sendMsgRead,s,i),[4,this._ctx.send(u)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return r=e.targetId,n=e.channelId,i=void 0===n?"":n,o=Ul.encode(zs,{targetId:r,busChannel:i,msgId:t}),[4,this._ctx.query($n.qryMsgRead,r,o,$s)];case 1:return[2,a.sent().trans((function(e){var t=e.list,r=e.num,n=e.readCnt;return{list:t.map((function(e){return{userId:e.userId,readTime:e.receiptTime}})),totalCount:r,readCount:n}}))]}}))}))}}),Object.defineProperty(r.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=e.targetId,i=e.conversationType,o=e.channelId,s=Ul.encode(eu,{type:i,busChannel:o,msgId:t}),[4,this._ctx.query($n.qryMsgReadCntBatch,r,s,tu)];case 1:return[2,a.sent().trans((function(t){return t.result.map((function(t){return n({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}))]}}))}))}}),Object.defineProperty(r.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){return t=e.count,r=e.conversationTypes,this._ctx.includeUg?(n=e.timestamp||Number.MAX_SAFE_INTEGER,i=this.storage.getAllSGModels().filter((function(e){return e.includeRobot&&e.operationTime<n&&r.includes(e.conversationType)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,t),[2,Ir(i.map((function(e){return e.toIReceivedConversation()})))]):[2,l(this,Dg,"m",gp).call(this,e.timestamp,t,0,r,Ge.ROBOT_ONLY)]}))}))}}),Object.defineProperty(r.prototype,"markRemoteConversationAsRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,l(this,xg,"f").sendMessage(e,t,r)];case 1:return(n=a.sent()).isOk?(i=n.data.sentTime,(o=this.storage.getModel(e))&&(o.clearUnreadCount(i),this.storage.updateConversationStorage([o])),[2,n.wipe()]):[2,n.wipe()]}}))}))}}),r}(gr);Gg=new WeakMap,Vg=new WeakMap,jg=new WeakMap,kg=new WeakMap,xg=new WeakMap,Fg=new WeakMap,Bg=new WeakMap,Hg=new WeakMap,np=new WeakMap,Ep=new WeakMap,Dg=new WeakSet,Yg=function(e,t,r){if(t===k.SUCCESS&&this._ctx.includeUg&&0!==r.length){var n=[x.PRIVATE,x.SYSTEM];this.storage.getAllSGModels().filter((function(e){return n.includes(e.conversationType)&&r.some((function(t){return t.robotId===e.targetId}))})).forEach((function(e){return e.updateAttrs({includeRobot:!0})}))}},Wg=function(e,t){var r=e.conversationType,i=e.targetId,a=e.channelId,o=e.senderUserId;if(e.messageType,r!==x.PRIVATE||o!==this._ctx.currentUserId)return!1;var s={conversationType:r,targetId:i,channelId:a},u=this.storage.getOrCreateModel(s,!0),l=u.clearUnreadCount(e.sentTime);return l&&t.set(u,n(n({},t.get(u)),l)),!0},Jg=function(e,t,r,i){var a=t.conversationType,o=t.targetId,s=t.channelId,u=t.senderUserId,l=t.content;if(u!==this._ctx.currentUserId)return!1;var c={conversationType:a,targetId:o,channelId:s},f=this.storage.getOrCreateModel(c,!0),d=f.clearUnreadCount(t.sentTime);return d&&r.set(f,n(n({},r.get(f)),d)),f.removeRecvMessageRecords(t.sentTime),1!==e.sesDriven||(t.isOffLineMessage&&i.push(n(n({},c),{timestamp:l.lastMessageSendTime})),!1)},qg=function(e,t){var r=e.conversationType,i=e.targetId,a=e.channelId,o=e.content,s={conversationType:r,targetId:i,channelId:a},u=r===x.PRIVATE?{privateReadReceipt:n(n({},s),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:n(n({},s),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})};t.push(u)},Kg=function(e,t,r,i){var a,o=e.content,s=e.conversationType,u=e.targetId,l=e.channelId,c=e.isPersited,f=e.isStatusMessage,d=e.isCounted,_=e.messageType,h=e.isMentioned,g=e.senderUserId,p=e.disableUpdateLastMessage;if(ee(s,q)&&!f&&c&&!Sc(r).isOk){var b={conversationType:s,targetId:u,channelId:l},E=this.storage.getOrCreateModel(b,!0),I=g===i,T=_===Re.RECALL,v={hidden:!1},R=function(){var r=E.updateAttrs(v,e.sentTime);r&&t.set(E,n(n({},t.get(E)),r))};if(T&&!E.hidden||(v.operationTime=e.sentTime),p||(v.latestMessage=r.supportRecallRefactor&&T?Oc(e,!0):e),I||E.version>=e.sentTime)R();else{if(v.version=e.sentTime,_===Re.RECALL){var m=o.sentTime;return m&&m>E.lastReadTime&&!(null===(a=e.__innerData__)||void 0===a?void 0:a.keepUnreadCount)&&(v.unreadCount=E.unreadCount-1,0===v.unreadCount&&(v.firstUnreadMessageUId="",v.firstUnreadTime=0,v.firstUnreadMessageType="",v.unreadMentionedCount=0,v.unreadMentionedMeCount=0,v.hasMentioned=!1,v.mentionedInfo=void 0),E.addRecvMessageRecord(m,-1)),void R()}if(d){var y;if(v.unreadCount=E.unreadCount+1,0===E.unreadCount&&(v.firstUnreadMessageUId=e.messageUId,v.firstUnreadTime=e.sentTime,v.firstUnreadMessageType=e.messageType),h&&o.mentionedInfo){var A=o.mentionedInfo,O=A.type,S=A.userIdList;O===Y.SINGAL&&(null==S?void 0:S.includes(i))?(y=Y.SINGAL,v.unreadMentionedMeCount=E.unreadMentionedMeCount+1,v.hasMentioned=!0,v.mentionedInfo=E.mentionedInfo||{type:O,userIdList:S}):O===Y.ALL&&(y=Y.ALL,v.unreadMentionedCount=E.unreadMentionedCount+1,v.hasMentioned=!0,v.mentionedInfo=E.mentionedInfo||{type:O,userIdList:S})}E.addRecvMessageRecord(e.sentTime,1,y),R()}else R()}}},Qg=function(e,t){var r=e.conversationType,i=e.targetId,a=e.channelId,o=e.content,s={conversationType:r,targetId:i,channelId:a||""},u=o.put,l=o.del,c=o.mid,f=o.clear;if(u?t.push({updatedExpansion:n(n({},s),{messageUId:c,expansion:u})}):l&&t.push({deletedExpansion:n(n({},s),{messageUId:c,deletedKeys:l})}),this._ctx.includeUg){var d=this.storage.getModel(s);d&&d.latestMessage&&d.latestMessage.messageUId===c&&(f?d.latestMessage.expansion={}:u?d.latestMessage.expansion=n(n({},d.latestMessage.expansion),u):l&&d.latestMessage.expansion&&l.forEach((function(e){delete d.latestMessage.expansion[e]})))}},Xg=function(e){var t=this,r=this._ctx.currentUserId,n=this._ctx.getNaviInfoFromCache(),i={v4ReadReceipts:[],v4SyncNotify:[],expansions:[],logCmdMessages:[],cloudControllerMessages:[],messages:[],updateModels:new Map};return i.messages=e.filter((function(e){switch(e.messageType){case Re.DELIVERED:case Re.DELIVERED_MSG:return!1;case Re.LOG_COMMAND:return i.logCmdMessages.push(e),!1;case Re.CLOUD_CONTROL:return i.cloudControllerMessages.push(e),!1;case Re.READ_RECEIPT:return l(t,Dg,"m",Wg).call(t,e,i.updateModels);case Re.SYNC_READ_STATUS:return l(t,Dg,"m",Jg).call(t,n,e,i.updateModels,i.v4SyncNotify);case Re.READ_STATE:return l(t,Dg,"m",qg).call(t,e,i.v4ReadReceipts),!1;case Re.READ_RECEIPT_REQUEST:return t.storage.addReadReceiptRequest(e,r);case Re.READ_RECEIPT_RESPONSE:return t.storage.handleReadReceiptResponse(e,r);case Re.EXPANSION_NOTIFY:return l(t,Dg,"m",Qg).call(t,e,i.expansions),!1;default:return l(t,Dg,"m",Kg).call(t,e,i.updateModels,n,r),!0}})),i},Zg=function(e,t,r,n){e.stopPropagation(),this._ctx.recordReceivedMessagesForStatistics(r);var i=l(this,Dg,"m",Xg).call(this,r),a=i.messages,o=i.v4ReadReceipts,u=i.v4SyncNotify,f=i.expansions,d=i.logCmdMessages,_=i.cloudControllerMessages,h=i.updateModels;if(u.length&&this.emit("syncReadStatusV4",u),a.length&&this.emit("messages",t,a,n),!l(this,Hg,"f")&&"pullMsg"===t&&n&&(c(this,Hg,!0,"f"),this.emit("offlineFinished"),l(this,kg,"f").startInterval(Op,!0)),f.length&&this.emit("expansions",f),o.length&&this.emit("readReceiptV4",o),h.size){var g=[],p=[];Array.from(h.entries()).forEach((function(e){var t=s(e,2),r=t[0],n=t[1];p.push(r),g.push({conversation:r.toIReceivedConversation(),updatedItems:n})})),this.storage.updateConversationStorage(p),this.emit("conversationStatusChanged",g)}this._ctx.handleLogCmdMessages(d),this._ctx.handleCloudControllerMessage(_)},zg=function(e,t,r){if(t===Og){e.stopPropagation();var n=[];r.forEach((function(e){if(0===e.subChangeType){var t=Ul.decode(Yu,new Uint8Array(e.eventData)),r=t.msgId,i=t.unreadCnt,a=t.readCnt,o=t.readList,s=t.totalCnt;n.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:r,users:o.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}})),readCount:a,unreadCount:i,totalCount:s})}})),this._ctx.emit("readReceiptResponseV5",n)}},$g=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return c(this,Hg,!1,"f"),e||(l(this,Vg,"f").setInitVersion(0),this._ctx.includeUg&&l(this,Dg,"m",ip).call(this)),this._ctx.svrUnread?(e||this.storage.getAllSGModels().forEach((function(e){return e.clearUnreadCount(0)})),[4,l(this,Dg,"m",ep).call(this,0)]):[3,2];case 1:t.sent(),t.label=2;case 2:return l(this,Vg,"f").startInterval(Op,!0),[2]}}))}))},ep=function e(t,r,o){return void 0===r&&(r=new Map),i(this,void 0,void 0,(function(){var i,s,u,c,f,d,_,h,g,p=this;return a(this,(function(a){switch(a.label){case 0:return i=this._ctx,s=i.logger,u=i.currentUserId,c=s.createTraceId(),s.info(F.L_PULL_SG_UNREAD_COUNT_T,JSON.stringify({version:t,pageToken:o}),c),f=function(e,t){return Ul.encode($u,{version:e,compress:Dn.enable(),pageToken:t})}(t,o),[4,this._ctx.query($n.pullSe,u,f,void 0)];case 1:return(d=a.sent()).isOk?(_=hg(d.data.pbData),h=_.session,g=_.pageToken,s.summary(F.L_PULL_SG_UNREAD_COUNT_R,d,c,{nextPageToken:g}),h.forEach((function(e){var t=e.targetId,i=e.type,a=e.busChannel,o=e.unread,s=o;s.cnt,s.mentionCnt,s.mentionMeCnt,s.clearTime,s.cutOffTime,s.firstUnreadMsg;var u={conversationType:i,targetId:t,channelId:a},l=p.storage.getOrCreateModel(u,!0),c=l.calibrateUnreadCount(o);c&&r.set(l,n(n({},r.get(l)),c))})),g?[2,l(this,Dg,"m",e).call(this,t,r,g)]:(this.storage.updateConversationStorage(Array.from(r.keys())),[2])):(s.warn(F.L_PULL_SG_UNREAD_COUNT_R,d.errmsg(),c),[2])}}))}))},tp=function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return e?[3,2]:(this.settings.reset(),[4,this.settings.syncDataFromServer()]);case 1:t=r.sent(),this.settings.setInitVersion(t),r.label=2;case 2:return this._ctx.isConnected&&this.settings.startInterval(Op,!0),[2]}}))}))},rp=function(e,t){c(this,Fg,!1,"f"),t||this.storage.syncDataFromLocalStorage(this._ctx),l(this,Dg,"m",tp).call(this,t),l(this,Dg,"m",$g).call(this,t),this._ctx.ugEnabel&&l(this,Dg,"m",cp).call(this,t)},ip=function e(){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,f,d=this;return a(this,(function(a){switch(a.label){case 0:return this._ctx.isConnected?(t=this._ctx.logger,r=t.createTraceId(),n=l(this,np,"f"),t.info(F.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:n}),r),[4,l(this,Dg,"m",mp).call(this,n,1,1e3)]):[2];case 1:return(i=a.sent()).isOk?(o=i.data,s=o.info,u=o.isFinished,f=o.pullTime,c(this,np,f,"f"),t.info(F.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:n,isFinished:u,pullTime:f}),r),this.storage.addRelations(s,this._ctx.currentUserId),u?(this.emit("sgRelationsSynced",k.SUCCESS),[2]):[2,l(this,Dg,"m",e).call(this)]):(t.warn(F.L_PULL_SG_RELATIONS_R,i.errmsg(),r),setTimeout((function(){return l(d,Dg,"m",e).call(d)}),1e3),[2])}}))}))},ap=function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return[4,l(this,Dg,"m",Tp).call(this,e,t)];case 1:return(n=a.sent()).isOk?(i=n.data.list.map((function(t){return vc(t,u._ctx.currentUserId,!1,e.targetId)})),(o=this.storage.getModel(e))&&o.latestMessage&&(s=i.find((function(e){return e.messageUId===o.latestMessage.messageUId})))&&o.updateAttrs({latestMessage:s}),2===r?this._ctx.emit("messageModified",i):1===r&&this._ctx.emit("ugMsgExpansionUpdated",i),[2]):[2]}}))}))},op=function(e,t,r){l(this,Dg,"m",ap).call(this,t,r,2)},sp=function(e,t,r){l(this,Dg,"m",ap).call(this,t,r,1)},up=function(e,t){var r=this,i=t.map((function(e){var t=e.targetId,i=e.busChannel,a=e.msgUID,o=e.msgTime,s=e.operatorId,u=e.remindType,c={conversationType:x.ULTRA_GROUP,targetId:t,channelId:i||""},f=n(n({},c),{messageUId:a,sentTime:o}),d=n(n({},c),{sentTime:o,messageUId:a,senderUserId:s,content:f,messageDirection:1,messageType:Re.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:me.UNREAD,receivedStatusInfo:jt(me.UNREAD)}),_=r.storage.getModel(c);return _&&l(r,Dg,"m",lp).call(r,_,d,u),d}));this._ctx.emit("ugMsgRecalled",i)},lp=function(e,t,r){var n={},i=t.content,a=i.messageUId,o=i.sentTime,s=e.latestMessage;s&&s.messageUId===a&&(n.latestMessage=Oc(t,!0)),o&&e.lastReadTime<o&&e.unreadCount&&(n.unreadCount=e.unreadCount-1,r!==Y.ALL&&r!==Y.SINGAL||!e.unreadMentionedCount||(n.unreadMentionedCount=e.unreadMentionedCount-1),r===Y.SINGAL&&e.unreadMentionedCount&&(n.unreadMentionedMeCount=e.unreadMentionedMeCount-1));var u=e.updateAttrs(n,o);this.storage.updateConversationStorage([e]),u&&this.emit("conversationStatusChanged",[{conversation:e.toIReceivedConversation(),updatedItems:u}])},cp=function(e){return i(this,void 0,void 0,(function(){var e,t,r,n;return a(this,(function(i){switch(i.label){case 0:return[4,l(this,Gg,"f").markOnline()];case 1:return(e=i.sent()).isOk?(t=e.data,r=t.relations,n=t.msgVersion,this.storage.addRelations(r,this._ctx.currentUserId),c(this,Fg,!0,"f"),this.emit("ultraGroupEnable"),l(this,Gg,"f").setInitVersion(n),l(this,Gg,"f").startInterval(Op,!0),l(this,jg,"f").setInitVersion(n),l(this,jg,"f").startInterval(Op,!0),[2]):[2]}}))}))},fp=function(){c(this,Fg,!1,"f"),this.settings.stopInterval(),l(this,Gg,"f").reset(),l(this,Vg,"f").reset(),l(this,jg,"f").reset()},dp=function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return 3===t.type?(e.stopPropagation(),this.settings.push(t.time),[2]):7===t.type?(e.stopPropagation(),l(this,jg,"f").push(t.time),[2]):12===t.type?(e.stopPropagation(),l(this,kg,"f").push(t.time),[2]):13!==t.type?[3,2]:(e.stopPropagation(),r=new Map,[4,l(this,Dg,"m",ep).call(this,t.time,r)]);case 1:i.sent(),r.size>0&&(n=Array.from(r.entries()).map((function(e){var t=s(e,2),r=t[0],n=t[1];return{conversation:r.toIReceivedConversation(),updatedItems:n}})),this.emit("conversationStatusChanged",n)),i.label=2;case 2:return[2]}}))}))},_p=function(e,t){1===t.type&&(e.stopPropagation(),l(this,Vg,"f").push(t.time))},hp=function(e,t,r){var n=t.syncMsg,i=ti(t.topic);if(n&&i===$n.updUgRTime){e.stopPropagation();var a=Ul.decode($o,t.pbData),o=a.channelId,s=a.busChannel,u=a.msgTime,l=this.storage.clearConversationUnreadCount({conversationType:x.ULTRA_GROUP,targetId:o,channelId:s||""},u);l&&this.emit("conversationStatusChanged",[l])}},gp=function(e,t,r,o,s){return i(this,void 0,void 0,(function(){var i,u,c,f,d,_=this;return a(this,(function(a){switch(a.label){case 0:return i=this._ctx.currentUserId,[4,l(this,Dg,"m",mp).call(this,e,r||0,t,o,s)];case 1:return(u=a.sent()).isOk?(c=u.data,f=c.info,c.isFinished,c.pullTime,d=f.map((function(e){var t=e.userId,r=e.type,a=e.busChannel,o=_.storage.getOrCreateModel({conversationType:r,targetId:t,channelId:a},!1);return n(n({},o.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?vc(e.msg,i,!1,t):null})})),[2,Ir(d)]):[2,u.wipe()]}}))}))},pp=function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return this._ctx.includeUg?[2,Ir(e)]:(t=this._ctx.currentUserId,r=e.filter((function(e){return e.conversationType!==x.ULTRA_GROUP})).map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),0===r.length?[2,Ir(e)]:(n=Ul.encode(ns,{relation:r}),[4,this._ctx.query($n.qryRLBatch,this._ctx.currentUserId,n,void 0)]));case 1:return(i=a.sent()).isOk?(l(this,Dg,"m",Rp).call(this,i.data.pbData).info.forEach((function(r){if(r.msg){var n=e.find((function(e){return(e.channelId||"")===(r.busChannel||"")&&e.targetId===r.userId&&e.conversationType===r.type}));n.latestMessage=vc(r.msg,t,!1,r.userId),n.includeRobot=!!r.isBot}})),[2,Ir(e)]):[2,i.wipe()]}}))}))},bp=function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s;return a(this,(function(a){return i=[],void 0!==r&&i.push({sessionStateType:Ro.IsTop,value:r?"1":"0"}),void 0!==n&&i.push({sessionStateType:Ro.IsSilent,value:n.toString()}),void 0!==o&&i.push({sessionStateType:Ro.AutoTrans,value:o.toString()}),s=og(t,e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:i}}))),[2,this._ctx.query($n.setSeAtt,this._ctx.currentUserId,s,Ts)]}))}))},Ip=function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return l(this,Ep,"f").add(e),r=t.messageType===Re.HQ_VOICE?{msgId:e,objectName:t.messageType,content:t.remoteUrl,sampleRate:t.sampleRate,channelNumber:t.numberOfChannels,format:t.format}:{msgId:e,objectName:t.messageType,content:t.content},n=Ul.encode(Wu,{businessType:1,businessInfo:Ul.encode(Ju,r)}),[4,this._ctx.query($n.upConvertMsg,e,n,qu)];case 1:return i=a.sent(),l(this,Ep,"f").delete(e),o=i.code,i.isOk?(u=Ul.decode(Ku,new Uint8Array(i.data.businessResult)),s={status:je.SUCCESS,text:u.result}):s={status:je.FAILED,text:""},this._ctx.emit("speechToTextResponse",{code:o,messageUId:e,sttInfo:s}),[2]}}))}))},Tp=function(e,t){var r=e.targetId,n=e.conversationType,i=e.channelId,a=Ul.encode(Bs,{targetId:r,type:n,query:t.map((function(e){return{msgTime:0,msgUID:e,busChannel:i}}))});return this._ctx.query($n.qryMsg,this._ctx.currentUserId,a,Hs)},vp=function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,c,f,d,_,h,g,p,b,E,I=this;return a(this,(function(a){switch(a.label){case 0:return i=Object.values(n),o=u([],s(new Set(u(u([],s(e),!1),s(i),!1))),!1),[4,l(this,Dg,"m",Tp).call(this,t,o)];case 1:return c=a.sent(),f=c.isOk,d=c.code,_=c.data,f?(g=(h=_).list,p=h.notExistMsgId,b=new Map(g.map((function(e){var r=vc(e,I._ctx.currentUserId,!1,t.targetId);return[r.messageUId,r]}))),E=e.map((function(e){var t=b.get(e);if(!t)return p.includes(e)?{messageUId:e,code:k.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:k.SERVER_DATA_ERROR};if(t.messageType!==Re.REFERENCE)return{messageUId:e,code:k.INVALID_PARAMETER_MESSAGE_TYPE};var r=n[e],i=b.get(r),a=t.content;return i?(a.referMsg=i.content,a.referMsgStatus=i.isModifyMessage?Yr.MODIFIED:Yr.DEFAULT,{messageUId:e,message:t,code:k.SUCCESS}):p.includes(r)?(a.referMsgStatus=Yr.DELETE,{messageUId:e,code:k.RC_DB_DATA_NOT_FOUND,message:t}):(a.referMsgStatus=Yr.DEFAULT,{messageUId:e,code:k.SERVER_DATA_ERROR,message:t})})),r(E),[2]):(r(e.map((function(e){return{messageUId:e,code:d}}))),[2])}}))}))},Rp=function(e){var t=Zh(e);return this._ctx.getNaviInfoFromCache().supportRecallRefactor&&t.info.forEach((function(e){var t=e.msg;if(t&&t.classname===Re.RECALL){var r=JSON.parse(t.content),n=r.messageUId,i=r.sentTime,a=r.extra,o={recallTime:i,recallActionTime:t.dataTime,admin:!!r.isAdmin,delete:!!r.isDelete,isDelete:!!r.isDelete,operatorId:t.fromUserId,extra:a};t.classname=Re.RECALL_NOTIFICATION_MESSAGE,t.content=JSON.stringify(o),t.msgId=n,t.dataTime=i||t.dataTime}})),t},mp=function(e,t,r,n,o,s){return void 0===s&&(s=$n.qryRelationR),i(this,void 0,void 0,(function(){var i,u,c=this;return a(this,(function(a){switch(a.label){case 0:return i=this._ctx.currentUserId,u=function(e,t,r,n,i){return Ul.encode(xo,{startTime:e,order:t,count:r,compressioEnabled:Dn.enable(),channelType:n,botType:i})}(e,t,r,n,o),[4,this._ctx.query(s,i,u)];case 1:return[2,a.sent().trans((function(e){return l(c,Dg,"m",Rp).call(c,e.pbData)}))]}}))}))};var Np=((Ug={})[x.PRIVATE]=$n.cleanPMsg,Ug[x.GROUP]=$n.cleanGMsg,Ug[x.CUSTOMER_SERVICE]=$n.cleanCMsg,Ug[x.SYSTEM]=$n.cleanSMsg,Ug[x.APP_PUBLIC_SERVICE]=$n.cleanMCMsg,Ug[x.PUBLIC_SERVICE]=$n.cleanMPMsg,Ug[x.ULTRA_GROUP]=$n.cleanGMsg,Ug),Cp=function(e){function r(t,r,n,i){var a=e.call(this,t,r,n)||this;return Object.defineProperty(a,"appStorage",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"_socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(a,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(a,"_socketIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(a,"_serverSessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(a,"_localConnectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(a,"_idCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(a,"_generateMessageId",{enumerable:!0,configurable:!0,writable:!0,value:function(){return a._idCount>=65535&&(a._idCount=0),++a._idCount}}),Object.defineProperty(a,"_pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_messageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(a,"_syncMessageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),a}return t(r,e),Object.defineProperty(r.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(r.prototype,"getLocalConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime}}),Object.defineProperty(r.prototype,"getCrtServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-this._localConnectedTime+this._connectedTime}}),Object.defineProperty(r.prototype,"getDelayTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._localConnectedTime-this._connectedTime}}),Object.defineProperty(r.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var r,i,o,s,u,l,c,f,d,_;return a(this,(function(h){switch(h.label){case 0:if(r=t.openAnti,i=t.type,o=t.baggageEnabled,s=this.getCmpList(t),this.logger.debug(F.L_NAVI_CMP_R,JSON.stringify(s),n),0===(u=s.filter((function(e,t){return s.findIndex((function(t){return t.addr===e.addr}))===t})).sort((function(e,t){return e.weight>t.weight?-1:1}))).length)return this.logger.error(F.L_NAVI_CONF_E,"no service available",n),[2,Tr(k.SERVER_UNAVAILABLE)];l=1===r?hi:gi,c=function(t){var r,s,c,d,_,h,g,p,b,E,I;return a(this,(function(a){switch(a.label){case 0:return r=u[t],s=r.protocol,c=r.addr,d=r.weight,_=function(e,t,r,n,i,a,o,s,u,l){var c,f=u?"&protocolVer=".concat(u):"";return"".concat(r,"://").concat(n,"/websocket?appId=").concat(i,"&token=").concat(encodeURIComponent(a),"&sdkVer=").concat(Ye,"&pid=").concat(s,"&deviceId=").concat(encodeURIComponent(e)).concat(1===l?"&baggage=".concat(encodeURIComponent("cid=".concat(o))):"","&apiVer=").concat(encodeURIComponent((null===(c=go.getApiVer)||void 0===c?void 0:c.call(go))||"".concat(go.tag,"||"))).concat(go.connectPlatform?"&platform=".concat(go.connectPlatform):"").concat(f).concat(go.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(t)):"")}(f.appStorage.deviceId,f.appStorage.packageName,s===B.WS?"ws":"wss",c,f.appkey,e,f.cid,"",l,o),h=Date.now(),[4,f.connectWebSocket(_,l,n)];case 1:return g=a.sent(),p=g.code,b=g.data,E=f.cmpWeightCache.findIndex((function(e){return e.addr===c})),I={bid:sr(),ptc:Ae.WS,cod:p,net:f.getNetwork().type,dur:Date.now()-h,spr:0,pr:i||0,hos:c,idx:E,rct:f.retryCount?Ne.RECONNECT:Ne.CONNECT,cid:f.cid,v:Se.CURRENT,rsn:f._doConnectReason,count:f.retryCount,weight:d,ssid:f._serverSessionId},f.logger.record(Ie.IM_WEBSOCKET,JSON.stringify(I),n),p===k.RC_SOCKET_DISCONNECTED||p===k.TIMEOUT?[2,"continue"]:p!==k.SUCCESS?[2,{value:Tr(p)}]:(f._localConnectedTime=Math.floor((Date.now()+h)/2),f._socket=b.socket,f.updateCmpWeight(u[t].addr,!0),f.curCmpUrl=u[t].addr,[2,{value:Ir(b.userId)}])}}))},f=this,d=0,h.label=1;case 1:return d<u.length?[5,c(d)]:[3,4];case 2:if("object"==typeof(_=h.sent()))return[2,_.value];h.label=3;case 3:return d+=1,[3,1];case 4:return[2,Tr(k.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(r.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u,l,c,f,d,_=this;return a(this,(function(a){switch(a.label){case 0:return this.logger.info(F.L_CONNECT_O,"connect start: ".concat(e),r),n=Ar(),i=n.resolve,o=n.promise,[4,go.createWebSocket(e)];case 1:return s=a.sent(),u=s.data,l=s.code,c=s.msg,l===k.SUCCESS&&u?(this._socketIndex=u.id,f=k.SUCCESS,d=setTimeout((function(){_.logger.warn(F.L_CONNECT_S,"timeout",r),f=k.TIMEOUT,"wechat"===go.tag?u.close():(i(Tr(k.TIMEOUT)),_.onSocketEnd(u,k.TIMEOUT,r))}),5e3),u.onOpen((function(){_.logger.info(F.L_CONNECT_S,"socket opened",r),clearTimeout(d)})),u.onError((function(e){_.logger.info(F.L_CONNECT_S,"socket error",r),clearTimeout(d);var t=k.RC_SOCKET_DISCONNECTED;i(Tr(t)),_.onSocketEnd(u,t,r)})),u.onClose((function(){_.logger.info(F.L_CONNECT_S,"socket close",r);var e=f===k.SUCCESS?k.RC_SOCKET_DISCONNECTED:f;i(Tr(e)),_.onSocketEnd(u,e,r)})),u.onMessage((function(e){if(_._socketIndex===u.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var n=Ma(e,t);if(n){if(n instanceof pa){var a=n.status;if(a!==Di)return _.logger.warn(F.L_CONNECT_O,"connect failed: ".concat(a),r),f=pg[a],u.close(),void i(Tr(f));_.logger.info(F.L_CONNECT_O,"connect success",r);var o=n.timestamp,s=n.userId,l=n.messageId,c=n.sessionId;return _._serverSessionId=c,_._connectedTime=o,_._idCount=l,void i(Ir({userId:s,socket:u}))}if(n instanceof Ea){var d=n.status;return _.logger.info(F.T,"recv disconnect signal -> status: ".concat(d)),void _.onRecvDisconnect(d,u)}_._onReceiveSignal(n)}}}else _.logger.warn(F.L_WS_DISACCORD_E,JSON.stringify({socketIndex:_._socketIndex,curSocketId:u.id}))})),[2,o]):[2,Tr(l,c)]}}))}))}}),Object.defineProperty(r.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==ni)return e instanceof ma&&!e.syncMsg?(this.logger.debug(F.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new Na(e.messageId))):void(e instanceof Pa&&this._messageIds[e.messageId]&&(this.logger.debug(F.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new Ca(e.messageId))))}}),Object.defineProperty(r.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=e.syncMsg,r=e.topic,n=e.messageId,this.logger.debug(F.O,"recv PublishReader -> messageId: ".concat(n," ").concat(r)),r===vi?[2]:!t||bg(ti(r))?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[n]=e}))];case 1:return i=a.sent(),delete this._syncMessageIds[n],this.emit("signal",e,i),[2]}}))}))}}),Object.defineProperty(r.prototype,"_onReceiveSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return e instanceof Ta&&this._pingResolve?(this._pingResolve(k.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof Sa||e instanceof Pa)&&(t=e.messageId,this.logger.debug(F.O,"recv ack -> messageId: ".concat(t)),(r=this._messageIds[t])&&(r(e),delete this._messageIds[t]),(n=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],n(e))),e instanceof ma?[4,this._publishReader(e)]:[3,2]);case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(r.prototype,"onRecvDisconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(function(e){return gg[e]}(e)))}}),Object.defineProperty(r.prototype,"onSocketEnd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this._socket&&this._socket===e?(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0)):this.logger.warn(F.L_CONNECT_S,"socket end but not the current socket",r)}}),Object.defineProperty(r.prototype,"clearResolves",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(k.RC_SOCKET_DISCONNECTED)}}}),Object.defineProperty(r.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t._pingResolve=r,setTimeout((function(){return r(k.TIMEOUT)}),e),t.sendOnly(new Ia)}))}}),Object.defineProperty(r.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof Oa||e instanceof Aa)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(r.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return this._socket?(t=this._generateMessageId(),e.messageId=t,this._socket.send(e.getArrayBuffer()),[4,new Promise((function(e){i._messageIds[t]=e,setTimeout((function(){i._messageIds[t]&&delete i._messageIds[t],e(k.TIMEOUT)}),3e4)}))]):[2,Tr(k.RC_NET_CHANNEL_INVALID)];case 1:return r=a.sent(),n="number"==typeof r?r:r.status,k.SUCCESS,"number"==typeof r?[2,Tr(r)]:[2,n===k.SUCCESS?Ir(r):Tr(n,"",r)]}}))}))}}),Object.defineProperty(r.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s,u;return a(this,(function(a){switch(a.label){case 0:return this.logger.createTraceId(),ri(e),i=new Aa(e,r,t),o&&i.setHeaderQos(o),[4,this._sendHandler(i)];case 1:return s=a.sent(),u=s.data,s.isOk&&void 0!==n?[2,Ir(Ul.decode(n,u.pbData))]:[2,s]}}))}))}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return[4,this._sendHandler(e)];case 1:return(r=a.sent()).data?r.data instanceof Sa?[2,r]:(n=r.data,i=t&&n.pbData&&[k.SUCCESS,k.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,k.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,k.RC_USER_PROFILE_KEY_NOT_EXIST,k.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,k.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,k.RC_USER_PROFILE_VALUE_EXCEED_RANGE,k.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(n.status)>=0,o=i?Ul.decode(t,n.pbData):n,0!==n.status?[2,Tr(n.status,void 0,t&&n.pbData?o:null)]:[2,Ir(o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return r?[4,this.sendOnly(new ba(ia))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),r}(Tn),Pp={};function Mp(){return{code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:1,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:Xr.getMiniCmpUrlList().join(",")}}var Lp=function(e){function r(t,r,n,i,a,o){void 0===a&&(a="default");var s=e.call(this,t,r,n,go.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),go.useNavi,o)||this;return Object.defineProperty(s,"_appStorage",{enumerable:!0,configurable:!0,writable:!0,value:i}),s._environment=a,s}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s,u,l;return a(this,(function(a){switch(a.label){case 0:return i="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(r),"&callBack=x&v=").concat(Ye,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(go.tag),this.logger.debug(F.L_REQUEST_T,"req navi => ".concat(i),n),[4,go.httpReq({url:i,timeout:1e4,dataType:"text"})];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(F.L_REQUEST_R,"request navi failed: ".concat(s.status),n),!go.useNavi&&o?[2,Ir(Mp())]:[2,Tr(this.transHttpCode(s.status))];try{return 0===(u=s.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(u=JSON.parse('"'.concat(u,'"'))),(l=JSON.parse(u)).protocol=/^https/.test(i)?"https":"http",l.code&&200!==l.code?[2,Tr(this.transHttpCode(l.code))]:(go.useNavi||(l.server="",l.backupServer=Xr.getMiniCmpUrlList().join(","),l.logSwitch=0),[2,Ir(l)])}catch(e){this.logger.error(F.L_PARSE_NAVI_E,s.data,n)}return[2,Tr(k.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o){return i(this,void 0,void 0,(function(){var i,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:go.tag,protocol:(/^https/.test(e)?B.WSS:B.WS).toString()}),this.logger.debug(F.L_REQUEST_T,"req navi => ".concat(i.url),n),[4,go.httpReq(i)];case 1:if(200!==(s=a.sent()).status)return this.logger.debug(F.L_REQUEST_R,"request navi failed: ".concat(s.status),n),!go.useNavi&&o?[2,Ir(Mp())]:[2,Tr(this.transHttpCode(s.status))];try{return u=s.data,(l="object"!=typeof u?JSON.parse(u):u).protocol=/^https/.test(i.url)?"https":"http",go.useNavi||(l.logSwitch=0,c=Xr.getMiniCmpUrlList(),l.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(i.url)?B.WSS:B.WS,weight:c.length-t}}))),[2,Ir(l)]}catch(e){this.logger.error(F.L_PARSE_NAVI_E,s.data,n)}return[2,Tr(k.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=this.getCatchKey(e);if(Pp[r])return Pp[r];var n,i=this._appStorage.get("naviInfo");if(!i)return null;try{n=JSON.parse(i)}catch(e){n=[]}if(0===n.length)return null;var a=n.find((function(r){return r.token===e&&r.environment===t._environment}))||null;return Pp[r]=a,a}}),Object.defineProperty(r.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],i=Date.now(),a=this._appStorage.get("naviInfo");if(a){try{n=JSON.parse(a)}catch(e){n=[]}n.length>0&&(n=n.filter((function(t){return i-t.timestamp<Fe&&(e!==t.token||r._environment!==t.environment)})))}var o={timestamp:i,naviInfo:t,token:e,environment:this._environment};n.push(o),this._appStorage.set("naviInfo",JSON.stringify(n)),Pp[this.getCatchKey(e)]=o}}),r}(Rn),wp=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})};function Up(e){var t=!(1&~(e.ugMsg||0)),r=!(1&~(e.sessionCfg||0));return t&&r}var Dp,Gp,Vp,jp,kp,xp,Fp,Bp,Hp,Yp,Wp,Jp,qp,Kp=function(e){function r(t,r,n,i){var a=e.call(this,r,t,n)||this;Object.defineProperty(a,"_appStorage",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(a,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"_mrtr",{enumerable:!0,configurable:!0,writable:!0,value:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}});var o=go.runtimeInfo,s=o.type,u=o.version;return a.model="Web|".concat(s,"|").concat(u),a.init(),a}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u,l,c,f,d,_;return a(this,(function(a){switch(a.label){case 0:return(i=n).deviceId=this._appStorage.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},s=this.logger.createTraceId(),this.logger.info(F.L_REQUEST_T,JSON.stringify(o),s),[4,go.httpReq(o)];case 1:u=a.sent(),l=u.status,c=u.data,f=void 0===c?"":c,this.logger.info(F.L_REQUEST_R,JSON.stringify({status:l,data:f}),s);try{return d=JSON.parse(f),_=d.data,[2,{code:parseInt(d.code,10),data:_}]}catch(e){return this.logger.warn(F.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:l,data:f,error:e})),[2,{code:l,msg:e}]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._appStorage.set("cloudControllerData",JSON.stringify(e))}}),Object.defineProperty(r.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._appStorage.get("cloudControllerData")}}),Object.defineProperty(r.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(F.L_CLOUD_SET_MRTR_O,JSON.stringify(e)),this._mrtr=e}}),Object.defineProperty(r.prototype,"getMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._mrtr}}),r}(En),Qp=function(e){function r(t,r,n){var i=e.call(this,t,r)||this;return Object.defineProperty(i,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_appStorage",{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return t(r,e),Object.defineProperty(r.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._appStorage.get("staticConf")}}),Object.defineProperty(r.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._appStorage.set("staticConf",e)}}),Object.defineProperty(r.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._appStorage.delete("staticConf")}}),Object.defineProperty(r.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return[4,go.httpReq({url:e})];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 i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,ur(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(F.L_GET_STATIC_CONF_E,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),r}(Zr),Xp=function(e){function r(){var t=e.call(this)||this;Object.defineProperty(t,"_deviceId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"_customDeviceId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(t,"_packageName",{enumerable:!0,configurable:!0,writable:!0,value:""});var r="",n=go.localStorage;return"browser"!==go.tag?(r=n.getItem(Qe)||"")||(r=ht.genWithLen(22),n.setItem(Qe,r)):r=gt,t._deviceId=r,t}return t(r,e),Object.defineProperty(r.prototype,"setPackageName",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._packageName=e}}),Object.defineProperty(r.prototype,"deviceId",{get:function(){return this._customDeviceId||this._deviceId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"packageName",{get:function(){return this._packageName},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setCustomDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._customDeviceId=e}}),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.appkey,r=go.localStorage,n=ut(t),i=r.getItem(n),a=st(t),o=r.getItem(a),s=Xe(t),u=r.getItem(s),l=ct(t),c=r.getItem(l);return{cloudControllerData:{value:i,key:n},staticConf:{value:o,key:a},naviInfo:{value:u,key:s},logReporter:{value:c?JSON.parse(c):{},key:l,stringify:!0}}}}),r}(_f),Zp=[$n.chatMsg,$n.ugMsg,$n.recallMsg,$n.ppMsgS,$n.pgMsgS,$n.ppMsgP,$n.pgMsgP,$n.pcMsgP,$n.prMsgS,$n.pbMsgP,$n.chatMsgS],zp=function(e){function r(t){var r,n,i=e.call(this)||this;Dp.add(i),Object.defineProperty(i,"_initOptions",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_connection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"send",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"query",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"sendOnly",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"connect",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"disconnect",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"appStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"userStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Gp.set(i,void 0),Vp.set(i,void 0),jp.set(i,void 0),kp.set(i,void 0),xp.set(i,void 0),Object.defineProperty(i,"_robots",{enumerable:!0,configurable:!0,writable:!0,value:{robots:[],isSynced:!1}}),i.appStorage=new Xp,i.appStorage.syncDataFromLocalStorage(i);var a=t.appkey,o=t.loggerProxy,u=t.environment,f=t.useNaviV2,d=t.logOutputLevel,_=t.logExpireTime,h=t.areaCode,g=t.navigators,p=t.logServerUrl,b=t.miniCMPProxy,E=o||Kc(),I=i.logger=new Uc(t.appkey,"IMLib","IM",E);I.setOutputLevel(d),o||Bc(a,i.logger,_),Xr.init({areaCode:h,navigators:g,logServerUrl:p,miniCMPProxy:b}),i.navi=new Lp(a,i.logger,new Qp(a,i.logger,i.appStorage),i.appStorage,u||"default",!!f);var T=i._connection=new Cp(a,i.navi,i.logger,i.appStorage);return i.send=i._connection.send.bind(i._connection),i.query=i._connection.query.bind(i._connection),i.sendOnly=i._connection.sendOnly.bind(i._connection),i.connect=i._connection.connect.bind(i._connection),i.disconnect=i._connection.disconnect.bind(i._connection),T.on("onConnected",l(i,Dp,"m",Fp),i),T.on("onDisconnected",l(i,Dp,"m",Hp),i),T.on("onSuspend",l(i,Dp,"m",Bp),i),T.on("signal",l(i,Dp,"m",Yp),i),T.pipe(i),c(i,Vp,new af(a,I,i.appStorage),"f"),c(i,jp,new of(a,I,i.appStorage),"f"),c(i,kp,new Kp(a,I,l(i,Vp,"f"),i.appStorage),"f"),n=i,r=s(Xr.getCloudControllerUrl(),1),{set value(e){c(n,xp,e,"f")}}.value=r[0],i.userStorage=new wp,c(i,Gp,new Ng(T,I),"f"),l(i,Gp,"f").pipe(i),"browser"===go.tag&&l(i,kp,"f").request(l(i,xp,"f"),cn),i}return t(r,e),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._connection.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectionStatus",{get:function(){return this._connection.getConnectionStatus()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connection.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentToken",{get:function(){return this._connection.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"serverTime",{get:function(){return this._connection.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"delayTime",{get:function(){return this._connection.getDelayTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectedTime",{get:function(){return this._connection.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ugEnabel",{get:function(){return!(1&~(this.getNaviInfoFromCache().ugMsg||0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isDisableEmptyUGChannelId",{get:function(){return!(2&~(this.getNaviInfoFromCache().ugDriven||0))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"includeUg",{get:function(){return Up(this.getNaviInfoFromCache())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"svrUnread",{get:function(){return 1===this.getNaviInfoFromCache().serverSaveUnread},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"logReporter",{get:function(){return l(this,Vp,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"statisticReporter",{get:function(){return l(this,jp,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"appkey",{get:function(){return this.initOptions.appkey},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"initOptions",{get:function(){return this._initOptions},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.getNaviInfoFromCache(this.currentToken)}}),Object.defineProperty(r.prototype,"robots",{get:function(){return this._robots.robots.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,l,c;return a(this,(function(a){switch(a.label){case 0:return t=this._robots.robots.slice(),!e&&this._robots.isSynced?[2,Ir(t)]:(r=Ul.encode(vl,{ids:[]}),[4,this._connection.query($n.qAppBot,this.currentUserId,r,Rl)]);case 1:return(n=a.sent()).isOk?(i=Math.max.apply(Math,u([],s(t.map((function(e){return e.updateTime}))),!1)),o=[],l=n.data.bots.map((function(e){var t={robotId:e.id,name:e.name,portraitUri:e.portraitUrl,robotType:e.type||"",metadata:Object.fromEntries(e.metadata.map((function(e){return[e.key,e.value]}))),createTime:e.createTime,updateTime:e.updateTime};return t.updateTime>i&&o.push(t),t})),c=t.filter((function(e){return!l.some((function(t){return t.robotId===e.robotId}))})),this._robots.isSynced=!0,this._robots.robots=l,e&&this.emit("robotsSynced",n.code,l.slice(),o,c),[2,Ir(l.slice())]):(e&&this.emit("robotsSynced",n.code,[],[],[]),[2,Tr(n.code,n.msg,t)])}}))}))}}),Object.defineProperty(r.prototype,"handleCloudControllerMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return 0===e.length?[2]:e.shift().senderUserId!==qe?[2,this.handleCloudControllerMessage(e)]:(t=this._connection.getToken(),[4,l(this,kp,"f").request(l(this,xp,"f"),dn,t)]);case 1:return r=i.sent()||0,n=e.filter((function(e){return e.sentTime>r})),[2,this.handleCloudControllerMessage(n)]}}))}))}}),Object.defineProperty(r.prototype,"handleLogCmdMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){if(e.senderUserId===qe){var r=e.content,n=r.startTime,i=r.endTime,a=r.platform,o=r.logId,s=r.uri;l(t,Vp,"f").report(parseInt(n,10),parseInt(i,10),a,s,o,e.messageUId)}}))}}),Object.defineProperty(r.prototype,"handleNetworkChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._connection.setNetwork(e,t),e.status&&l(this,xp,"f")){var r=this._connection.getToken();l(this,kp,"f").request(l(this,xp,"f"),fn,r)}}}),Object.defineProperty(r.prototype,"checkIfNeedRecordMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=l(this,kp,"f").getMRTRConfig();if(!r)return!1;var n=function(e){if(!e)return Math.floor(4294967296*Math.random());var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return Math.abs(t)}(t),i=0;switch(e){case x.PRIVATE:i=r.private;break;case x.GROUP:i=r.group;break;case x.CHATROOM:i=r.chatroom;break;case x.ULTRA_GROUP:i=r.ultraGroup}return!!i&&n%(1/i)==0}}),Object.defineProperty(r.prototype,"recordReceivedMessagesForStatistics",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(0!==e.length){var r=this.connectedTime,n=e.filter((function(e){return e.sentTime>=r&&t.checkIfNeedRecordMessageUId(e.conversationType,e.messageUId)})).map((function(e){return e.messageUId}));if(0!==n.length){var i=Date.now();this.logger.record(Ie.IM_MSG_RECEIVE,JSON.stringify({client_ts:i,server_deltatime:i-this.serverTime,msg_ids:n.join(",")}))}}}}),r}(gr);Gp=new WeakMap,Vp=new WeakMap,jp=new WeakMap,kp=new WeakMap,xp=new WeakMap,Dp=new WeakSet,Fp=function(e,t){return i(this,void 0,void 0,(function(){var e,r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return t||this.getAllRobots(!0),[4,l(this,Gp,"f").noticeOnline()];case 1:return(e=a.sent()).isOk?(t?l(this,Gp,"f").startInterval(18e4,!0):(r=e.data,n=r.syncTime,i=r.hasNext,l(this,Gp,"f").setInitVersion(n),l(this,Gp,"f").startInterval(18e4,!!i)),o=this.getNaviInfoFromCache(),l(this,Vp,"f").checkStart(o),l(this,jp,"f").checkStart(o),[2]):[2]}}))}))},Bp=function(e,t){l(this,Gp,"f").stopInterval()},Hp=function(e){this._robots.isSynced=!1,this._robots.robots=[],l(this,Gp,"f").reset(),l(this,Vp,"f").stop(),l(this,jp,"f").stop()},Yp=function(e,t,r){var n=t.topic,i=t.syncMsg,a=ti(n),o=this.getNaviInfoFromCache();if(a||(this.logger.warn(F.L_RECV_RMTP_E,"unknown topic: ".concat(n)),e.stopPropagation()),this.logger.debug(F.L_RECV_RMTP_O,n),i&&Zp.includes(a)){e.stopPropagation();var s=r||{},u=s.timestamp,c=void 0===u?this.serverTime:u,f=s.messageUId,d=void 0===f?"":f,_=Tc(t,this.currentUserId,c,d),h=Rc(o,_,this.currentUserId,!1,t.targetId);this.emit("syncMsg",h,a)}else{if(a===$n.s_ntf){e.stopPropagation();var g=(E=Ul.decode(Oo,t.pbData)).type,p=E.chrmId,b=E.time;return this.logger.info(F.L_RECV_S_NTF_O,"type: ".concat(g,", chrmId: ").concat(p,", time: ").concat(b)),void this.emit("sNtf",E)}if(a===$n.s_cmd){e.stopPropagation();var E;g=(E=Ul.decode(Oo,t.pbData)).type,p=E.chrmId,b=E.time;if(this.logger.info(F.L_RECV_S_CMD_O,"type: ".concat(g,", chrmId: ").concat(p,", time: ").concat(b)),11===g)return void l(this,Gp,"f").push(b);this.emit("sCmd",E)}if(a===$n.s_msg){e.stopPropagation();_=Ul.decode(Mo,t.pbData),h=Rc(o,_,this.currentUserId,!1);this.emit("sMsg",h)}}};var $p,eb=function(e,t,r){var n=0;return e&&(n|=1),t&&(n|=2),r&&(n|=4),n},tb=function(e,t,r){return{chatroomId:e,key:t.key,value:t.value,timestamp:t.version,type:r?w.DELETE:w.UPDATE}},rb=function(e){function r(t,r,n){var i=e.call(this,"WebChatroomKVStore")||this;return Wp.add(i),Object.defineProperty(i,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:n}),Jp.set(i,new Map),Object.defineProperty(i,"_emittedEntriesSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),i}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i,o,s,u,c,f,d,_,h=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),i=this._chatroomId,o={chatroomId:i,timestamp:e},t.info(F.L_PULL_CHATROOM_KV_T,JSON.stringify(o),r),[4,this._ctx.query($n.pullKV,i,ug(e),void 0)];case 1:return(s=a.sent()).isOk?(u=lg(s.data.pbData),c=u.bFullUpdate,f=u.entries,d=u.syncTime,t.info(F.L_PULL_CHATROOM_KV_R,JSON.stringify(n(n({},o),{newVersion:d})),r),_=new Map,c&&(Array.from(l(this,Jp,"f").values()).forEach((function(e){_.set(e.key,tb(i,e,!0))})),l(this,Jp,"f").clear()),Array.from(f.values()).forEach((function(e){var t,r=(t=e.status,{isAutoDelete:!!(1&t),isOverwrite:!!(2&t),isDelete:!!(4&t)}).isDelete,n=function(e){var t=e.key,r=e.value;return e.timestamp,{key:t,value:r,userId:e.uid,version:e.version}}(e);r?l(h,Jp,"f").delete(n.key):l(h,Jp,"f").set(n.key,n),_.set(n.key,tb(i,n,r))})),this._emittedEntriesSynced||(this._emittedEntriesSynced=!0,this._emitter.emit("chatroom",{entriesSynced:i})),_.size>0&&this._emitter.emit("chatroom",{updatedEntries:Array.from(_.values())}),[2,Ir({version:d})]):(t.warn(F.L_PULL_CHATROOM_KV_R,JSON.stringify(n(n({},o),{code:s.code})),r),[2,s.wipe()])}}))}))}}),Object.defineProperty(r.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return[4,l(this,Wp,"m",qp).call(this,e,t,!1)];case 1:return(r=n.sent()).isOk&&l(this,Jp,"f").set(e.key,{key:e.key,value:e.value,userId:this._ctx.currentUserId,version:this._ctx.serverTime}),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return[4,l(this,Wp,"m",qp).call(this,{key:e.key,value:"",isAutoDelete:!1,isSendNotification:e.isSendNotification,notificationExtra:e.notificationExtra},t,!0)];case 1:return(r=n.sent()).isOk&&l(this,Jp,"f").delete(e.key),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,c=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.serverTime,r=e.entries.map((function(r){var n,i=l(c,Jp,"f").get(r.key);return{key:r.key,value:r.value,uid:c._ctx.currentUserId,version:null!==(n=null==i?void 0:i.version)&&void 0!==n?n:t,status:eb(!!e.isAutoDelete,e.isForce||!1,!1)}})),n=Ul.encode(os,{entry:r}),[4,this._ctx.query($n.setKVS,this._chatroomId,n,us)];case 1:return(i=a.sent()).isOk||i.code===k.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?((o=i.data).errorKeys,s=o.keysVersion,u=new Map,null==s||s.forEach((function(e){u.set(e.key,e.version)})),e.entries.forEach((function(e){var t=e.key,r=u.get(t);r&&l(c,Jp,"f").set(t,{key:t,value:e.value,userId:c._ctx.currentUserId,version:r})})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return t=eb(!1,!1,!0),r=this._ctx.serverTime,n=Ul.encode(os,{entry:e.keys.map((function(e){var n,i=l(u,Jp,"f").get(e);return{key:e,status:t,value:"",uid:u._ctx.currentUserId,version:null!==(n=null==i?void 0:i.version)&&void 0!==n?n:r}}))}),[4,this._ctx.query($n.delKVS,this._chatroomId,n,us)];case 1:return(i=a.sent()).isOk||i.code===k.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?(o=i.data.errorKeys,s=new Set,null==o||o.forEach((function(e){return s.add(e.key)})),e.keys.forEach((function(e){s.has(e)||l(u,Jp,"f").delete(e)})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,Jp,"f").has(e)?l(this,Jp,"f").get(e).value:null}}),Object.defineProperty(r.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Array.from(l(this,Jp,"f").entries()).map((function(e){var t=s(e,2);return[t[0],t[1].value]}));return Object.fromEntries(e)}}),r}(pr);Jp=new WeakMap,Wp=new WeakSet,qp=function(e,t,r){var n;return i(this,void 0,void 0,(function(){var i,o,s,u,c;return a(this,(function(a){switch(a.label){case 0:return i=this._ctx.serverTime,o=l(this,Jp,"f").get(e.key),s=eb(!!e.isAutoDelete,t,r),u={entry:{key:e.key,value:e.value,uid:this._ctx.currentUserId,version:null!==(n=null==o?void 0:o.version)&&void 0!==n?n:i,status:s}},e.isSendNotification&&(u.type=x.CHATROOM,u.bNotify=!0,u.notification={sessionId:mc(Re.CHRM_KV_NOTIFY,!1,!1,!1),classname:Re.CHRM_KV_NOTIFY,content:JSON.stringify({key:e.key,value:e.value,extra:e.notificationExtra,type:r?w.DELETE:w.UPDATE})}),c=Ul.encode(as,u),[4,this._ctx.query(r?$n.delKV:$n.setKV,this._chatroomId,c)];case 1:return[2,a.sent().wipe()]}}))}))};var nb,ib,ab,ob,sb=function(e){function r(t,r,n,i){var a=e.call(this,"WebChatroomMessageReceiver")||this;return Object.defineProperty(a,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(a,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:i}),$p.set(a,0),c(a,$p,n,"f"),a}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,c,f,d,_=this;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),n={chatroomId:this._chatroomId,version:e},t.info(F.L_PULL_CHATROOM_MSG_T,JSON.stringify(n),r),i=function(e,t){return Ul.encode(ko,{syncTime:e,count:t,compressioEnabled:Dn.enable()})}(e,l(this,$p,"f")),[4,this._ctx.query($n.chrmPull,this._chatroomId,i,void 0)];case 1:return o=a.sent(),t.summary(F.L_PULL_CHATROOM_MSG_R,o,r,n),o.isOk?(s=this._ctx.currentUserId,u=$h(o.data.pbData),c=u.list,f=u.syncTime,c.length>0&&(d=c.map((function(e){return vc(e,s,!1,_._chatroomId)})),this._emitter.emit("message",d,this._chatroomId)),[2,Ir({version:f})]):[2,o.wipe()]}}))}))}}),r}(pr);$p=new WeakMap;var ub,lb,cb,fb,db,_b,hb,gb,pb,bb,Eb,Ib,Tb,vb,Rb,mb,yb,Ab=function(){function e(e,t,r,n,i){nb.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"roomId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"initCount",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"extra",{enumerable:!0,configurable:!0,writable:!0,value:i}),ib.set(this,void 0),ab.set(this,void 0),c(this,ib,new sb(this._ctx,this.roomId,r,n),"f"),c(this,ab,new rb(this._ctx,this.roomId,n),"f")}return Object.defineProperty(e.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;l(this,ib,"f").setInitVersion(0),l(this,ib,"f").startInterval(e,!0),l(this,nb,"a",ob)&&(l(this,ab,"f").setInitVersion(0),l(this,ab,"f").startInterval(e,!0))}}),Object.defineProperty(e.prototype,"restartInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;this.stopInterval(),l(this,ab,"f").startInterval(e,!0),l(this,ib,"f").startInterval(e,!0)}}),Object.defineProperty(e.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){l(this,ib,"f").stopInterval(),l(this,ab,"f").stopInterval()}}),Object.defineProperty(e.prototype,"handleMessageNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){l(this,ib,"f").push(e)}}),Object.defineProperty(e.prototype,"handleKVNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){l(this,ab,"f").push(e)}}),Object.defineProperty(e.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return[2,l(this,ab,"f").setEntry(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,l(this,ab,"f").setEntries(e)]}))}))}}),Object.defineProperty(e.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return[2,l(this,ab,"f").removeEntry(e,t)]}))}))}}),Object.defineProperty(e.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,l(this,ab,"f").removeEntries(e)]}))}))}}),Object.defineProperty(e.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,ab,"f").getEntry(e)}}),Object.defineProperty(e.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,ab,"f").getAllEntries()}}),e}();ib=new WeakMap,ab=new WeakMap,nb=new WeakSet,ob=function(){var e;return!!(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.kvStorage)};var Ob,Sb,Nb,Cb,Pb=function(e){var t=e.joinTime,r=e.createTime,n=e.memberCount,i=e.chatroomBanState;return{createTime:r,joinTime:t,memberCount:n,isAllChatroomBanned:!(1&~(i||0)),isCurrentUserBanned:!(2&~(i||0)),isCurrentChatroomBanned:!(4&~(i||0)),isCurrentChatroomInWhitelist:!(1&~(e.whiteListState||0))}},Mb=function(e){function r(t){var r=e.call(this)||this;return ub.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),lb.set(r,new Map),Object.defineProperty(r,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),cb.set(r,void 0),Object.defineProperty(r,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:yp}),r.logger=t.logger,c(r,cb,new gr,"f"),l(r,cb,"f").on("message",l(r,ub,"m",db),r),l(r,cb,"f").on("chatroom",l(r,ub,"m",fb),r),r._ctx.on("onConnected",l(r,ub,"m",gb),r),r._ctx.on("onDisconnected",l(r,ub,"m",_b),r),r._ctx.on("onSuspend",l(r,ub,"m",hb),r),r._ctx.on("sNtf",l(r,ub,"m",bb),r),r._ctx.on("sCmd",l(r,ub,"m",Eb),r),r._ctx.on("syncMsg",l(r,ub,"m",pb),r),r._ctx.on("sMsg",l(r,ub,"m",pb),r),r}return t(r,e),Object.defineProperty(r.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o;return a(this,(function(a){switch(a.label){case 0:return[4,l(this,ub,"m",vb).call(this,e,r,n)];case 1:return(i=a.sent()).isOk?((o=l(this,lb,"f").get(e))||(o=new Ab(this._ctx,e,t,l(this,cb,"f"),n),l(this,lb,"f").set(e,o),o.startInterval()),[2,i.trans(Pb)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return l(this,lb,"f").get(e)?(l(this,ub,"m",Rb).call(this,e),r=Ul.encode(Vo,{nothing:1,extra:t}),[4,this._ctx.query($n.exitChrm,e,r)]):[2,Ir()];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Ul.encode(qo,{count:t,order:r}),[4,this._ctx.query($n.queryChrmI,e,n,Ko)];case 1:return[2,i.sent().trans((function(e){return{userCount:e.userTotalNums,userInfos:e.userInfos.map((function(e){return{id:e.id,time:e.time}}))}}))]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){return[2,l(this,ub,"m",mb).call(this,e).next((function(e){return e.setEntry(t,r)}))]}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return[2,l(this,ub,"m",mb).call(this,e).next((function(e){return e.setEntries(t)}))]}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){return[2,l(this,ub,"m",mb).call(this,e).next((function(e){return e.removeEntry(t,r)}))]}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return[2,l(this,ub,"m",mb).call(this,e).next((function(e){return e.removeEntries(t)}))]}))}))}}),Object.defineProperty(r.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return(r=l(this,lb,"f").get(e))?null===(n=r.getEntry(t))?[2,Tr(k.CHATROOM_KEY_NOT_EXIST)]:[2,Ir(n)]:[4,l(this,ub,"m",yb).call(this,e)];case 1:return[2,i.sent().tryTrans((function(e){var r=e[t];return void 0===r?Tr(k.CHATROOM_KEY_NOT_EXIST):Ir(r)}))]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return(t=l(this,lb,"f").get(e))?[2,Ir(t.getAllEntries())]:[2,l(this,ub,"m",yb).call(this,e)]}))}))}}),Object.defineProperty(r.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return i=ig({targetId:e,time:t,count:r,order:n}),o=this._ctx.currentUserId,[4,this._ctx.query($n.qryCHMsg,e,i)];case 1:return(s=a.sent()).isOk?(u=ag(s.data.pbData),[2,Ir({hasMore:!!u.hasMsg,list:u.list.map((function(t){return vc(t,o,!1,e)}))})]):[2,s.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Ul.encode(Js,{rtcRoomId:e.rtcRoomId}),[4,this._ctx.query($n.setRtcRoomId,e.chatRoomId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),r}(gr);lb=new WeakMap,cb=new WeakMap,ub=new WeakSet,fb=function(e,t){e.stopPropagation(),this.emit("chatroom",t)},db=function(e,t,r){e.stopPropagation(),this._ctx.recordReceivedMessagesForStatistics(t),l(this,ub,"m",Ib).call(this,t,r)},_b=function(){var e,t;try{for(var r=o(l(this,lb,"f").values()),n=r.next();!n.done;n=r.next()){n.value.stopInterval()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}l(this,lb,"f").clear()},hb=function(){var e,t;try{for(var r=o(l(this,lb,"f").values()),n=r.next();!n.done;n=r.next()){n.value.stopInterval()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},gb=function(e,t){var r,n;if(t)try{for(var i=o(l(this,lb,"f").values()),a=i.next();!a.done;a=i.next()){var s=a.value;l(this,ub,"m",Tb).call(this,s)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},pb=function(e,t){t.conversationType===x.CHATROOM&&(e.stopPropagation(),l(this,ub,"m",Ib).call(this,[t],t.targetId))},bb=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r){e.stopPropagation();var a=l(this,lb,"f").get(n);a&&a.handleMessageNotify(i)}},Eb=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r||4===r){e.stopPropagation();var a=l(this,lb,"f").get(n);if(a)return 4===r?(l(this,lb,"f").delete(n),void this.emit("chatroom",{chatroomDestroyed:n})):void a.handleKVNotify(i)}},Ib=function(e,t){var r=this;if(l(this,lb,"f").get(t)){var n=e.filter((function(e){var n,i=e.messageType;if(i===Re.CHATROOM_MERGE_CHANGE){var a=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 r.emit("chatroom",{userChange:a}),!1}if(i===Re.CHATROOM_MERGE_BAN){var o=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 r.emit("chatroom",{chatroomNotifyBan:o}),!1}if(i===Re.CHATROOM_SYNC_MSG){var s=function(e){var t=e.content;return{chatroomId:t.chatroomId,status:t.status,reason:t.reason,time:t.time,extra:t.extra||""}}(e);return r.emit("chatroom",{chatroomNotifyMultiLoginSync:s}),!1}if(i===Re.CHATROOM_MERGE_BLOCK){var u=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 u.operateType===j.Blocked&&(null===(n=null==u?void 0:u.userIdList)||void 0===n?void 0:n.includes(r._ctx.currentUserId))&&l(r,ub,"m",Rb).call(r,t),r.emit("chatroom",{chatroomNotifyBlock:u}),!1}return!0}));n.length>0&&this.emit("message",n,t)}},Tb=function(e){return i(this,void 0,void 0,(function(){var t,r,i,o,s,u,c,f;return a(this,(function(a){switch(a.label){case 0:return t=e.roomId,r=e.extra,i=this.logger.createTraceId(),this.logger.info(F.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:t}),i),[4,l(this,ub,"m",vb).call(this,t,!1,r)];case 1:return o=a.sent(),this.logger.summary(F.L_REJOIN_CHATROOM_R,o,i,{chatroomId:t}),s=o.code,u=o.isOk,c=o.data,u?(e.restartInterval(),f=Pb(c),this.emit("chatroom",{rejoinedRoom:n(n({chatroomId:t},f),{count:e.initCount})}),[2]):(s!==k.RC_CHATROOM_USER_KICKED&&s!==k.RC_CHATROOM_NOT_EXIST||l(this,lb,"f").delete(t),this.emit("chatroom",{rejoinedRoom:{chatroomId:t,errorCode:s}}),[2])}}))}))},vb=function(e,t,r){var n=Ul.encode(Vo,{extra:r,nothing:1}),i=t?$n.joinChrm:$n.joinChrmR;return this._ctx.query(i,e,n,jo)},Rb=function(e){var t=l(this,lb,"f").get(e);t&&(t.stopInterval(),l(this,lb,"f").delete(e))},mb=function(e){var t=l(this,lb,"f").get(e);return t?Ir(t):Tr(k.NOT_IN_CHATROOM)},yb=function(e){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return[4,this._ctx.query($n.pullKV,e,ug(0),void 0)];case 1:return(t=n.sent()).isOk?(r=lg(t.data.pbData).entries,[2,Ir(r.reduce((function(e,t){return e[t.key]=t.value,e}),{}))]):[2,t.wipe()]}}))}))};var Lb=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=go.localStorage,r=e.appkey,n=e.currentUserId,i=ot(r,n),a=t.getItem(i)||"{}",o=JSON.parse(a);return{value:{value:{version:o.version||0,tags:o.tags||{},transLan:o.transLan||"zh",autoTrans:o.autoTrans||!1},key:i,stringify:!0}}}}),Object.defineProperty(r.prototype,"version",{get:function(){return this.get("value").version||0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tags",{get:function(){return this.get("value").tags||{}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"forceUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.set("value",e)}}),Object.defineProperty(r.prototype,"addTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("value"),n=r.tags,i=r.autoTrans,a=r.transLan;n[e.tagId]={tagName:e.tagName,createdTime:t},this.set("value",{version:t,tags:n,autoTrans:i,transLan:a})}}),Object.defineProperty(r.prototype,"deleteTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("value"),n=r.tags,i=r.autoTrans,a=r.transLan;delete n[e],this.set("value",{version:t,tags:n,autoTrans:i,transLan:a})}}),r}(_f),wb=function(e){function r(t){var r=e.call(this,"UserSettings")||this;return Ob.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Sb.set(r,!1),r.storage=new Lb,r._ctx.on("onConnected",r._handleConnected,r),r._ctx.on("onDisconnected",r._handleDisconnected,r),r._ctx.on("onSuspend",r._handleDisconnected,r),r._ctx.on("signal",r._handleSignal,r),r}return t(r,e),Object.defineProperty(r.prototype,"_handleConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.storage.syncDataFromLocalStorage(this._ctx),c(this,Sb,!0,"f");var e=this.storage.version;this.setInitVersion(e),this.push(e)}}),Object.defineProperty(r.prototype,"_handleDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reset()}}),Object.defineProperty(r.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(ti(t.topic)===$n.s_us){var r=Ul.decode(Ls,t.pbData).version;this.push(r),e.stopPropagation()}}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u,c,f,d,_,h,g,p,b,E,I,T,v;return a(this,(function(a){switch(a.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=this._ctx.getNaviInfoFromCache(),o=n.createTraceId(),n.info(F.L_SYNC_USER_SETTINGS_T,"version: ".concat(e),o),s=Ul.encode(ds,{version:e,ipType:i.ipType||0}),[4,this._ctx.query($n.pullUS,r,s,_s)];case 1:return u=a.sent(),n.summary(F.L_SYNC_USER_SETTINGS_R,u,o),u.isOk?(c=u.data,f=c.version,d=c.items,_=!1,h=!1,g=!1,p="",b=this.storage.get("value"),E=b.transLan,I=b.autoTrans,T=b.tags,v={version:f,transLan:E,autoTrans:I,tags:T},null==d||d.forEach((function(e){var t=e.key,r=e.value;switch(t){case"Tag":v.tags={},e.tags.forEach((function(e){v.tags[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),_=!0;break;case"transLan":g=!0,v.transLan=ca.readUTF(new Uint8Array(r));break;case"autoTrans":h=!0,v.autoTrans="1"===ca.readUTF(new Uint8Array(r));break;case"VoipInfo":p=ca.readUTF(new Uint8Array(r))}})),this.storage.set("value",v),_&&this.emit("tagsChanged"),g&&this.emit("userSettingsChanged",{key:Wr.TranslationLanguage,value:v.transLan}),h&&this.emit("userSettingsChanged",{key:Wr.AutoTranslateEnable,value:v.autoTrans}),p&&this.emit("voipInfoChanged",p),l(this,Ob,"m",Nb).call(this,u.code),[2,Ir({version:f})]):(l(this,Ob,"m",Nb).call(this,u.code),[2,u.wipe()])}}))}))}}),Object.defineProperty(r.prototype,"hasTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.storage.tags[e]}}),Object.defineProperty(r.prototype,"getTags",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.storage.tags}}),Object.defineProperty(r.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=Ul.encode(Ps,{version:t,tags:[{tagId:e.tagId,name:e.tagName}],ignoreVersion:!0}),[4,this._ctx.query($n.addSeTag,r,n,fs)];case 1:return(i=a.sent()).isOk&&(o=i.data,s=o.version,u=o.updateVersion,this.storage.addTag(e,u?s:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=Ul.encode(Ms,{version:t,tags:[{tagId:e}],ignoreVersion:!0}),[4,this._ctx.query($n.delSeTag,r,n,fs)];case 1:return(i=a.sent()).isOk&&(o=i.data,s=o.version,u=o.updateVersion,this.storage.deleteTag(e,u?s:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,l(this,Ob,"m",Cb).call(this,$n.transLan,e)]}))}))}}),Object.defineProperty(r.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,Ir(this.storage.get("value").transLan||"zh")]}))}))}}),Object.defineProperty(r.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,l(this,Ob,"m",Cb).call(this,$n.autoTrans,e?"1":"0")]}))}))}}),Object.defineProperty(r.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,Ir(this.storage.get("value").autoTrans)]}))}))}}),r}(pr);Sb=new WeakMap,Ob=new WeakSet,Nb=function(e){l(this,Sb,"f")&&(c(this,Sb,!1,"f"),this.emit("userSettingsSynced",e))},Cb=function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,f,d,_,h,g;return a(this,(function(a){switch(a.label){case 0:return r=this.storage.version,n=this._ctx.currentUserId,i=Ul.encode(cs,{version:r,value:t,ignoreVersion:!0}),[4,this._ctx.query(e,n,i,fs)];case 1:if((o=a.sent()).isOk){switch(s=o.data,u=s.version,l=s.updateVersion,c=this.storage.get("value"),f=c.transLan,d=c.autoTrans,_=c.tags,h=c.version,g={version:l?u:h,transLan:f,autoTrans:d,tags:_},e){case $n.transLan:g.transLan=t;break;case $n.autoTrans:g.autoTrans="1"===t}this.storage.set("value",g)}return[2,o.wipe()]}}))}))};var Ub,Db,Gb,Vb,jb,kb,xb,Fb,Bb,Hb,Yb,Wb,Jb,qb,Kb=function(e){var t;return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,remark:null!==(t=e.remarkName)&&void 0!==t?t:"",directionType:e.friendType,extProfile:Object.fromEntries(e.extProfile.map((function(e){return[e.key,e.value]}))),addTime:e.relationTime,inBlackList:!!e.flag}},Qb=function(e){var t,r,n=e.targetId,i=e.settingProfile,a=e.extProfile,o=e.baseInfo,s=e.userInfo,u=Zt(i||[]),l=Zt(a||[]);return{groupId:n,groupName:u.name||"",portraitUri:u.portraitUrl||"",introduction:u.introduction||"",notice:u.announcement||"",extProfile:l,joinPermission:~~u.joinPerm,removeMemberPermission:~~u.removePerm,invitePermission:~~u.memInvitePerm,inviteHandlePermission:~~u.invitePerm,groupInfoEditPermission:~~u.profilePerm,memberInfoEditPermission:~~u.memProfilePerm,creatorId:(null==o?void 0:o.creatorId)||"",ownerId:(null==o?void 0:o.ownerId)||"",createTime:(null==o?void 0:o.createTime)||0,membersCount:(null==o?void 0:o.memberCount)||0,remark:null!==(t=null==s?void 0:s.remarkName)&&void 0!==t?t:"",joinedTime:(null==s?void 0:s.joinTime)||0,role:null!==(r=null==s?void 0:s.role)&&void 0!==r?r:m.UNDEF}},Xb=function(){function e(e){Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"searchFriendsInfo",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"searchGroupMembers",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"searchJoinedGroups",{enumerable:!0,configurable:!0,writable:!0,value:yp})}return Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Ul.encode(gu,{permission:e}),[4,this.ctx.query($n.updProfilePermiss,this.ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=Ul.encode(hu,{nothing:1}),[4,this.ctx.query($n.qProfilePermiss,this.ctx.currentUserId,e,gu)];case 1:return[2,t.sent().trans((function(e){return e.permission}))]}}))}))}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=Ul.encode(pu,{uniqueId:e}),[4,this.ctx.query($n.searchUserProfile,this.ctx.currentUserId,t,cu)];case 1:return(r=a.sent()).isOk?(n=r.data,i=n.userId,o=n.userProfile,s=n.userExtProfile,u=Ft(i,o,s),[2,Ir(u)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return i=Gh(e,t,r,n),[4,this.ctx.query($n.channelCreate,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,o.wipe()]:(s=Ul.decode(Eu,o.data.pbData),u={errorKeys:s.censorFailedFields,processCode:s.processCode||0},[2,Tr(o.code,o.msg,u)])}}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return n=Gh(e,t,r),[4,this.ctx.query($n.upChannelInfo,e,n,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=Ul.decode(Eu,i.data.pbData),[2,Tr(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n;return a(this,(function(i){switch(i.label){case 0:return t=Ul.encode(Iu,{type:x.GROUP,list:e.map((function(e){return{targetId:e}}))}),[4,this.ctx.query($n.qChannelInfo,e[0],t,Ru)];case 1:return(r=i.sent()).isOk?(n=ng(r.data).list,[2,Ir(n.map(Qb))]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=_g({targetId:e,users:t,settingInfo:{isQuit:!0,isDelBan:r.removeMuteStatus,isDelAttention:r.removeFollow,isDelWhite:r.removeWhiteList}}),[4,this.ctx.query($n.channelMemKick,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=_g({targetId:e,settingInfo:{isQuit:!0,isDelBan:t.removeMuteStatus,isDelAttention:t.removeFollow,isDelWhite:t.removeWhiteList}}),[4,this.ctx.query($n.channelMemQuit,e,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=_g({targetId:e}),[4,this.ctx.query($n.channelDismiss,e,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return i=_g({targetId:e,settingInfo:{isQuit:r,isDelBan:n.removeMuteStatus,isDelAttention:n.removeFollow,isDelWhite:n.removeWhiteList},users:[t]}),[4,this.ctx.query($n.channelTransfer,e,i)];case 1:return[2,a.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Ul.encode(Tu,{targetId:t,type:x.GROUP,users:r,operateType:e}),[4,this.ctx.query($n.upChannelManager,t,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Ul.encode(Tu,{targetId:t,type:x.GROUP,users:r,operateType:e}),[4,this.ctx.query($n.upChannelFollow,t,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return t=fg({targetId:e}),[4,this.ctx.query($n.qChannelFollow,this.ctx.currentUserId,t,Ru)];case 1:return(r=a.sent()).isOk?(n=ng(r.data).list,i=n.map((function(e){return{userId:e.userId,time:e.opTime}})),[2,Ir(i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=dg({targetId:e,operateType:t?O.ADD:O.REMOVE,channelNickName:t}),[4,this.ctx.query($n.upChannelRemark,e,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return n=Ul.encode(Cu,{targetId:e,type:t,info:r}),[4,this.ctx.query($n.friendAdd,this.ctx.currentUserId,n,Eu)];case 1:return[2,i.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Ul.encode(Pu,{targetId:e,type:t}),[4,this.ctx.query($n.friendDel,this.ctx.currentUserId,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Ul.encode(Cu,{targetId:e,type:1}),[4,this.ctx.query($n.friendHandle,this.ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Ul.encode(Cu,{targetId:e,type:2,info:t}),[4,this.ctx.query($n.friendHandle,this.ctx.currentUserId,r)];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return n=Ul.encode(Lu,{targetId:e,remarkName:t,extProfile:Object.entries(r).map((function(e){var t=s(e,2);return{key:t[0],value:t[1]}}))}),[4,this.ctx.query($n.friendSetPf,this.ctx.currentUserId,n,void 0)];case 1:return(i=a.sent()).isOk||!i.data?[2,i.wipe()]:(o=Ul.decode(wu,i.data.pbData),[2,Tr(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Ul.encode(Pu,{targetId:e,type:t}),[4,this.ctx.query($n.friendCheck,this.ctx.currentUserId,r,Mu)];case 1:return[2,n.sent().trans((function(e){return e.list.map((function(e){return{userId:e.targetId,relationType:e.status}}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return r=Ul.encode(Uu,{queryType:11,friendType:e,page:{size:t.count,order:t.order?0:1,pageToken:t.pageToken}}),[4,this.ctx.query($n.friendsQuery,this.ctx.currentUserId,r,Ru)];case 1:return(n=a.sent()).isOk?(i=n.data.page,o=i.pageToken,s=i.hasNext,u=ng(n.data).list,l={pageToken:s&&o?o:"",data:u.map(Kb)},[2,Ir(l)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=Ul.encode(Uu,{queryType:12,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query($n.friendsQuery,this.ctx.currentUserId,t,Ru)];case 1:return(r=a.sent()).isOk?(n=r.data.page,i=n.pageToken,o=n.hasNext,s=ng(r.data).list,u={pageToken:o&&i?i:"",data:s.map((function(e){return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,applicationType:e.type,applicationStatus:e.status,operationTime:e.operateTime,extra:e.info||""}}))},[2,Ir(u)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Ul.encode(Du,{targetId:e}),[4,this.ctx.query($n.friendsInfoQry,this.ctx.currentUserId,t,Vu)];case 1:return[2,r.sent().trans((function(e){return e.list.map(Kb)}))]}}))}))}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Ul.encode(Gu,{level:e}),[4,this.ctx.query($n.friendAuthSet,this.ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return e=this.ctx.currentUserId,t=Ul.encode(Cu,{targetId:e}),[4,this.ctx.query($n.friendAuthGet,e,t,Gu)];case 1:return[2,r.sent().trans((function(e){return e.level}))]}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return r=fg({targetId:e,ids:t}),[4,this.ctx.query($n.qChannelSpeMem,e,r,Ru)];case 1:return(n=a.sent()).isOk?(i=ng(n.data).list,o=i.map(Qt),[2,Ir(o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return i=dg({targetId:e,userId:t,channelNickName:r,additional:n}),[4,this.ctx.query($n.upChannelMem,e,i,void 0)];case 1:return(o=a.sent()).isOk||!o.data?[2,o.wipe()]:(s=Ul.decode(Eu,o.data.pbData),[2,Tr(o.code,o.msg,{errorKeys:s.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return n=fg({targetId:e,roleType:t,botType:r.filterRobotType,page:{size:r.count,order:r.order?0:1,pageToken:r.pageToken}}),[4,this.ctx.query($n.qChannelMem,e,n,Ru)];case 1:return(i=a.sent()).isOk?(o=i.data.page,s=o.pageToken,u=o.hasNext,l=ng(i.data).list,c={pageToken:u&&s?s:"",data:l.map(Qt)},[2,Ir(c)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Ul.encode(Nu,{targetId:e,type:x.GROUP}),[4,this.ctx.query($n.channelMemJoin,e,t,Eu)];case 1:return[2,r.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Ul.encode(Nu,{targetId:e,type:x.GROUP,userIds:t}),[4,this.ctx.query($n.channelMemInvite,e,r,Eu)];case 1:return[2,n.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=e.groupId,r=e.inviterId,n=e.optType,i=e.optResult,o=e.joinUserId,s=e.reason,u=Ul.encode(Su,{targetId:t,type:x.GROUP,optType:n,optResult:i,inviterId:r,joinUserId:o,detail:s}),[4,this.ctx.query($n.channelApplyResp,t,u,Eu)];case 1:return[2,a.sent().trans((function(e){return{processCode:e.processCode||0}}))]}}))}))}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return t=fg({page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query($n.qChannelApplyList,this.ctx.currentUserId,t,Ru)];case 1:return(r=a.sent()).isOk?(n=ng(r.data),i=n.pageToken,o=n.hasNext,s=n.list,u=s.map(Xt),[2,Ir({data:u,pageToken:o&&i?i:""})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l;return a(this,(function(a){switch(a.label){case 0:return r=fg({roleType:e,page:{size:t.count,pageToken:t.pageToken,order:t.order?1:0}}),[4,this.ctx.query($n.qChannelMemJoin,this.ctx.currentUserId,r,Ru)];case 1:return(n=a.sent()).isOk?(i=n.data.page,o=i.pageToken,s=i.hasNext,u=ng(n.data).list,l=u.map(Qb),[2,Ir({data:l,pageToken:s&&o?o:""})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return t=Ul.encode(vu,{type:x.GROUP,ids:e}),[4,this.ctx.query($n.qChannelMemSpeJoin,this.ctx.currentUserId,t,Ru)];case 1:return(r=a.sent()).isOk?(n=ng(r.data).list,i=n.map(Qb),[2,Ir(i)]):[2,r.wipe()]}}))}))}}),e}(),Zb=((Ub={})[P.GROUP_OPERATION]=function(e){return"ChannelEventData"},Ub[P.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},Ub[b.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},Ub),zb=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"decodeByPBName",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=e,i={}[t];try{n=e.length>0&&Ul.decode(t,e),Ot(i)&&(n=i.call(this,n,r))}catch(e){this.logger.error(F.L_PB_DECODE_E,t)}return n}}),Object.defineProperty(e.prototype,"formatEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return e.map((function(e){var r,n=e.businessId,i=e.time,a=e.changeType,o=e.originalId,s=e.originalTime,u=e.secondaryId,l=e.isAdmin,c=e.additionalMark,f=e.operatorId,d=e.subChangeType,_=e.secondaryType,h=e.remindType,g=e.isRemindMe,p=e.extIds,b=e.eventData;return b&&(r=t._formatEventData(b,a,d)),{businessId:n,changeType:a,originalId:o,time:i,originalTime:s,secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:f,subChangeType:d,userGroupIds:p,secondaryType:_,remindType:h,isRemindMe:g,eventData:r}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n={};return e&&Zb[t]&&Zb[t](r)&&(n=Ul.decode(Zb[t](r),e)||{}),n}}),e}(),$b=((Db={})[x.PRIVATE]=$n.qryPMsg,Db[x.GROUP]=$n.qryGMsg,Db[x.CHATROOM]=$n.qryCHMsg,Db[x.CUSTOMER_SERVICE]=$n.qryCMsg,Db[x.SYSTEM]=$n.qrySMsg,Db[x.APP_PUBLIC_SERVICE]=$n.qryMCMsg,Db[x.PUBLIC_SERVICE]=$n.qryMPMsg,Db[x.ULTRA_GROUP]=$n.qryUgMsg,Db),eE=function(e,t,r,n,i,a){var o=yn(t.messageType),s=o.isCounted,u=o.isPersited,l=o.isStatusMessage;return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:i,messageDirection:be.SEND,isCounted:s,isMentioned:!!t.isMentioned,content:t.content,messageType:t.messageType,isOffLineMessage:!1,isPersited:u,messageUId:r,sentTime:n,receivedTime:0,disableNotification:!!t.disableNotification,isStatusMessage:!!l,canIncludeExpansion:!!t.canIncludeExpansion,expansion:t.canIncludeExpansion?t.expansion:null,receivedStatus:me.UNREAD,receivedStatusInfo:jt(me.UNREAD),pushConfig:t.pushConfig,isInterrupt:t.isInterrupt,messageId:a||0,sentStatus:se.SENT,directedUserIds:t.directionalUserIdList,disableUpdateLastMessage:t.disableUpdateLastMessage,needReceipt:t.needReceipt}},tE=[P.GROUP_OPERATION,P.GROUP_PROFILE_CHANGE,P.GROUP_APPLICATION_INVITATION,P.GROUP_FOLLOW_USER_CHANGE],rE=[b.FRIEND_APPLICATION],nE=function(){function e(e,t){var r=this;Gb.add(this),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_initOptions",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subscribeManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataHosting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_codec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_latestPullKVMsgTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_handleInnerMsgOptions",{enumerable:!0,configurable:!0,writable:!0,value:function(e,t){var n=t.messageType;return n===Re.SYNC_READ_STATUS&&(t.directionalUserIdList=dr(e.conversationType,[r.currentUserId])),n===Re.READ_RECEIPT_RESPONSE&&(t.content.receiptMessageDic&&0!==Object.keys(t.content.receiptMessageDic).length||(t.content=r._chat.storage.createReadReceiptResponseContent(e)),t.directionalUserIdList=Object.keys(t.content.receiptMessageDic)),t}}),Object.defineProperty(this,"getOSInfo",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"getProcessInfo",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"getMainProcessInfo",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"setProxy",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"getProxy",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"testProxy",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"getLocalMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"deleteLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"deleteLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"batchClearLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"clearLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:yp}),Object.defineProperty(this,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:yp});var n=this._ctx=new zp(t),i=n.logger;this._codec=new zb(i),this._userSettings=new wb(n),this._chat=new Sp(n,this._userSettings,this),this._chatroom=new Mb(n),this._dataHosting=new Xb(n),this._chat.on("messages",this._handleChatMessages,this),this._chat.on("offlineFinished",(function(){return r._watcher.pullFinished()}),this),this._chat.on("syncReadStatusV4",this._handleSyncReadStatusV4,this),this._chat.on("expansions",this._handleExpansions,this),this._chat.on("readReceiptV4",this._handleReadReceiptV4,this),this._chat.on("conversationStatusChanged",this._conversationStatusChanged,this),this._chat.on("conversationStatusSynced",(function(e,t){return r._watcher.conversationStatusSynced(t)}),this),this._chat.on("sgRelationsSynced",(function(e,t){return r._watcher.sgRelationsSynced(t)}),this),this._chat.on("ultraGroupEnable",(function(){return r._watcher.ultraGroupEnable()}),this),this._chatroom.on("message",this._handleChatroomMessages,this),this._chatroom.on("chatroom",this._handlerChatroomEvent,this),n.on("sCmd",this._handleSCmdNotify,this),n.on("signal",this._handleSignal,this),n.on("onConnected",this.onConnected,this),n.on("onDisconnected",this.onDisconnected,this),n.on("onConnecting",this.onConnecting,this),n.on("onSuspend",this.onSuspend,this),n.on("messagesFromUG",this._handleMessagesFromUltraGroup,this),n.on("serverEvent",l(this,Gb,"m",Yb),this),n.on("readReceiptResponseV5",l(this,Gb,"m",jb),this),n.on("speechToTextResponse",l(this,Gb,"m",kb),this),n.on("ugUserGroupChanged",this._handleUserGroupStatus,this),n.on("ugChannelChanged",this._handleUltraChannelChange,this),n.on("messageModified",l(this,Gb,"m",xb),this),n.on("messageModifiedSyncCompleted",l(this,Gb,"m",Fb),this),n.on("ugMsgExpansionUpdated",l(this,Gb,"m",Bb),this),n.on("ugMsgRecalled",l(this,Gb,"m",Hb),this),n.on("robotsSynced",l(this,Gb,"m",Vb),this),this._userSettings.on("voipInfoChanged",this._naviChangeHandler,this),this._userSettings.on("tagsChanged",(function(){return r._watcher.tag()}),this),this._userSettings.on("userSettingsSynced",(function(e,t){return r._watcher.userSettingsSynced(t)}),this),this._userSettings.on("userSettingsChanged",(function(e,t){return r._watcher.userSettingsChanged(t)}),this)}return Object.defineProperty(e.prototype,"appkey",{get:function(){return this._initOptions.appkey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userSettings",{get:function(){return this._userSettings},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataHosting",{get:function(){return this._dataHosting},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"usingCppEngine",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"logger",{get:function(){return this._ctx.logger},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._ctx.getNaviInfoFromCache();this._initSubscribeManager(r),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(t)}}),Object.defineProperty(e.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resetMemoryState(),this._watcher.onDisconnected(t)}}),Object.defineProperty(e.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.onSuspend(t)}}),Object.defineProperty(e.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(e.prototype,"_handleSyncReadStatusV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;t.forEach((function(e){return r._watcher.syncReadStatus(e)}))}}),Object.defineProperty(e.prototype,"_handleReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;t.forEach((function(e){return r._watcher.messageReadReceipt(e)}))}}),Object.defineProperty(e.prototype,"_handleExpansions",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;t.forEach((function(e){return r._watcher.expansion(e)}))}}),Object.defineProperty(e.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));this._watcher.conversation(t),r&&this._watcher.conversationTag()}}),Object.defineProperty(e.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new wc(this._ctx,{syncSubscribeUserStatusFinished:function(e){var r,n;null===(n=(r=t._watcher).syncSubscribedUserStatusFinished)||void 0===n||n.call(r,e)},subscribeUserStatusChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedUserStatusChange)||void 0===n||n.call(r,e)},subscribeRelationChanged:function(e){var r,n;null===(n=(r=t._watcher).subscribedRelationChange)||void 0===n||n.call(r,e)},ownUserProfileChanged:function(e){var r,n;null===(n=(r=t._watcher).ownUserProfileChanged)||void 0===n||n.call(r,e)}},this.currentUserId,this._ctx.delayTime,this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new Uc(this.appkey,e,t,this.logger.proxy)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._ctx.navi.request(this._ctx.currentToken,!0,!0,this.logger.createTraceId())}}),Object.defineProperty(e.prototype,"naviInfo",{get:function(){return this._ctx.getNaviInfoFromCache()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connectedTime",{get:function(){return this._ctx.connectedTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connectionStatus",{get:function(){return this._ctx.connectionStatus},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){return a(this,(function(i){return this._openCallPlus=r,[2,this._ctx.connect(e,t,r,n)]}))}))}}),Object.defineProperty(e.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=new Map,a=[];t.forEach((function(e){var t,r,o,s=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,f=e.isMentioned,d=e.isCounted,_=e.senderUserId,h=e.messageType,g=e.sentTime,p=e.channelType,b=e.isPersited,E={conversationType:x.ULTRA_GROUP,targetId:s,channelId:c||""},I=n._chat.storage.getOrCreateModel(E,!0),T=i.get(I)||{params:{channelType:p},time:g};i.set(I,T),T.time=g;var v=T.params;if(b&&(v.hidden=!1,v.latestMessage=e,v.operationTime=g),d&&_!==n.currentUserId&&h!==Re.RECALL_NOTIFICATION_MESSAGE){v.unreadCount=(v.unreadCount||I.unreadCount)+1;var R=(null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===Y.ALL;f&&(R||(null===(o=null===(r=null==u?void 0:u.mentionedInfo)||void 0===r?void 0:r.userIdList)||void 0===o?void 0:o.includes(n.currentUserId)))&&(v.unreadMentionedCount=(v.unreadMentionedCount||I.unreadMentionedCount)+1,R||(v.unreadMentionedMeCount=(v.unreadMentionedMeCount||I.unreadMentionedMeCount)+1),v.hasMentioned=!0,v.mentionedInfo=null==u?void 0:u.mentionedInfo),I.firstUnreadMessage||v.firstUnreadMessageUId||(v.firstUnreadMessageType=h,v.firstUnreadMessageUId=l,v.firstUnreadTime=g)}a.push(e)}));var o=[],u=[];Array.from(i.entries()).forEach((function(e){var t=s(e,2),r=t[0],n=t[1],i=n.params,a=n.time;o.push(r);var l=r.updateAttrs(i,a);l&&u.push({conversation:r.toIReceivedConversation(),updatedItems:l})})),this._chat.storage.updateConversationStorage(o),u.length>0&&this._watcher.conversation(u),this._batchMessage(a)}}),Object.defineProperty(e.prototype,"_handleChatroomMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){this._watcher.batchMessage(t)}}),Object.defineProperty(e.prototype,"_handlerChatroomEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.chatroom(t)}}),Object.defineProperty(e.prototype,"_handleChatMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this._watcher.batchMessage(r)}}),Object.defineProperty(e.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=t.syncMsg,a=t.topic;if(i)this._receiveSyncMsg(t,r);else switch(ti(a)){case $n.rtc_ntf:this._watcher.onRTCDataChange(t.pbData);break;case $n.s_opNtf:this._pullOperateStatusNotify(t);break;case $n.s_pubCall:this._pubCallInfo(t);break;case $n.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(t)}}}),Object.defineProperty(e.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n,i,a=t.time;switch(t.type){case 8:null===(r=this._subscribeManager)||void 0===r||r.startsyncSubscribeUserStatus(a);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(a);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(e.prototype,"_receiveMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,r=e.channelId,n=void 0===r?"":r,i=e.conversationType,a=e.targetId,o=t.put,s=t.del,u=t.mid;o&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:o,channelId:n,conversationType:i,targetId:a}}),s&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:s,channelId:n,conversationType:i,targetId:a}})}}),Object.defineProperty(e.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var a=this._chat.storage.clearConversationUnreadCount({conversationType:e,targetId:t,channelId:r},i);n&&a&&this._watcher.conversation([a])}}),Object.defineProperty(e.prototype,"_updateSGModelCacheAfterSent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.isPersited,i=e.targetId,a=e.channelId,o=e.sentTime,s=e.disableUpdateLastMessage,u=e.messageType,l=e.messageUId,c=e.content;if(ee(t,W)){var f=this.naviInfo,d={conversationType:t,targetId:i,channelId:a},_=this._chat.storage.getOrCreateModel(d,!0),h={},g=u===Re.RECALL;if(r){g&&!_.hidden||(h.operationTime=o),h.hidden=!1;var p=g?c.sentTime:o;s||_.latestMessage&&!(_.latestMessage.sentTime<=p)||(h.latestMessage=f.supportRecallRefactor&&g?Oc(e,!0):e)}if(this._ctx.includeUg&&u===Re.EXPANSION_NOTIFY&&_.latestMessage&&_.latestMessage.messageUId===l){var b=c,E=b.put,I=b.del;b.clear?_.latestMessage.expansion={}:E?_.latestMessage.expansion=n(n({},_.latestMessage.expansion),E):I&&_.latestMessage.expansion&&I.forEach((function(e){delete _.latestMessage.expansion[e]}))}var T=_.updateAttrs(h,e.sentTime);this._chat.storage.updateConversationStorage([_]),T&&this._watcher.conversation([{conversation:_.toIReceivedConversation(),updatedItems:T}])}}}),Object.defineProperty(e.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;switch(ti(e.topic)){case $n.updRTime:this._receivesyncReadStatus(e);break;case $n.updUserSub:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(e.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.batchMessage(e)}}),Object.defineProperty(e.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ul.decode(Ks,e.pbData),r=t.key,n=t.dataContent,i=t.maxTime;this._latestPullKVMsgTimestamp=i,this._watcher.callInfo(JSON.stringify({list:[{key:r,value:n}]}))}}),Object.defineProperty(e.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Ul.decode($o,e.pbData),r=t.type,n=t.channelId,i=t.msgTime,a=t.busChannel;this._clearConversationUnreadCount(r,n,a||"",!0,i),this._watcher.syncReadStatus({conversationType:r,targetId:n,channelId:a,timestamp:i})}}),Object.defineProperty(e.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r,n;return a(this,(function(i){switch(i.label){case 0:return this._ctx.isConnected?(e=Ul.encode(Qs,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._ctx.query($n.pullKvMsg,this.currentUserId,e,Xs)]):[2];case 1:return t=i.sent(),r=t.isOk,n=t.data,r&&n?(this._latestPullKVMsgTimestamp=n.maxTime,this._watcher.callInfo(JSON.stringify({list:n.info})),[2]):[2]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,f,d,_,h,g,p=this;return a(this,(function(a){switch(a.label){case 0:return r=e.conversationType,n=e.targetId,i=e.channelId,o=t.timestamp,s=t.count,u=t.order,l=$b[r],c=this.currentUserId,f=ig({targetId:n,busChannel:i,time:o||(1===u?1:this._ctx.serverTime+6e4),count:s,order:u}),d=r===x.CHATROOM?n:c,[4,this._ctx.query(l,d,f,void 0)];case 1:return(_=a.sent()).isOk?(h=ag(_.data.pbData),g=h.list.map((function(e){var t=vc(e,c,!1,n);if(t.messageDirection===be.SEND){var r=p._chat.storage.getReadReceiptResponseUsers(t,t.messageUId);t.readReceiptInfo={isReceiptRequestMessage:!0,readerList:r}}return t})),[2,Ir({hasMore:!!h.hasMsg,list:0===u?g.reverse():g})]):[2,_.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),r=JSON.stringify(e),this.logger.info(F.L_VER_REPORT_T,r,t),n=Ul.encode(ws,{sdkInfo:r}),[4,this._ctx.query($n.reportsdk,this._ctx.currentUserId,n)];case 1:return i=a.sent(),this.logger.summary(F.L_VER_REPORT_R,i,t),[2]}}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return this._chat.storage.setDrafts(e,t),[2,Ir()]}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=this._chat.storage.getDrafts(e),[2,Ir(t)]}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this._chat.storage.deleteDrafts(e),[2,Ir()]}))}))}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,o){return i(this,void 0,void 0,(function(){var r,i,s,u,l,c,f,d,_,h,g,p,b,E,I,T,v,R;return a(this,(function(a){switch(a.label){case 0:return r=e.conversationType,i=e.targetId,t=this._handleInnerMsgOptions(e,t),s=!1,[x.PRIVATE,x.GROUP].includes(r)&&(t.isStatusMessage||yn(t.messageType).isStatusMessage)&&(s=!0),u=s?function(e){var t;return(t={},t[x.PRIVATE]=$n.ppMsgS,t[x.GROUP]=$n.pgMsgS,t)[e]}(r):function(e){var t;return(t={},t[x.PRIVATE]=$n.ppMsgP,t[x.GROUP]=$n.pgMsgP,t[x.CHATROOM]=$n.chatMsg,t[x.CUSTOMER_SERVICE]=$n.pcMsgP,t[x.RTC_ROOM]=$n.prMsgS,t[x.SYSTEM]=$n.pbMsgP,t)[e]}(r)||$n.ppMsgP,t.messageId||(t.messageId=or()),l=t.messageId,c=cg(e,t),(f=new Oa($n[u],c,r===x.SYSTEM?this.currentUserId:i)).setHeaderQos(ii),s?(this._ctx.sendOnly(f),[2,Ir(eE(e,n(n({},t),{isStatusMessage:s}),"",0,this.currentUserId,l))]):(d=this._ctx.serverTime,_=eE(e,n(n({},t),{isStatusMessage:s}),"",d,this.currentUserId,l),null==o||o(l),h=Date.now(),[4,this._ctx.send(f)]);case 1:return g=a.sent(),p=g.code,b=g.isOk,E=g.msg,I=g.data,b?(v=(T=I).timestamp,R=T.messageUId,_.sentTime=v,_.messageUId=R,this._sendMessageSuccessHandle(_),this._ctx.checkIfNeedRecordMessageUId(r,R)&&this.logger.record(Ie.IM_MSG_SEND,JSON.stringify({msg_id:R,channel:r,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:p})),[2,Ir(_)]):(this._ctx.checkIfNeedRecordMessageUId(r)&&this.logger.record(Ie.IM_MSG_SEND,JSON.stringify({channel:r,start_ts:h,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:p})),_.sentStatus=se.FAILED,[2,Tr(p,E,_)])}}))}))}}),Object.defineProperty(e.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.conversationType!==x.CHATROOM&&this._chat.storage.addSentRecord(e.messageUId,e.sentTime),this._updateSGModelCacheAfterSent(e);var t=e.messageType;t===Re.READ_RECEIPT_REQUEST&&this._chat.storage.addReadReceiptRequest(e,this.currentUserId),t===Re.READ_RECEIPT_RESPONSE&&this._chat.storage.handleReadReceiptResponse(e,this.currentUserId)}}),Object.defineProperty(e.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,l,c,f,d,_,h,g,p,b,E,I,T,v,R,m;return a(this,(function(a){switch(a.label){case 0:return r=e.targetId,n=e.conversationType,i=e.channelId||"",o=t.user,s=t.extra,u=t.isDelete,l=t.directionalUserIdList,c=t.disableUpdateLastMessage,f=t.messageUId,d=t.sentTime,_=t.disableNotification,h=t.pushConfig,g=t.pushContent,p=t.isAdmin,b={conversationType:n,targetId:r,messageUId:f,sentTime:d,channelId:i,isDelete:!!u,isAdmin:!!p},o&&(b.user=o),s&&(b.extra=s),E={content:b,messageType:Re.RECALL,disableNotification:_,pushConfig:h,pushContent:(null==h?void 0:h.pushContent)||g,disableUpdateLastMessage:c,directionalUserIdList:dr(n,l)},I=cg(e,E),(T=new Oa($n.recallMsg,I,this.currentUserId)).setHeaderQos(ii),[4,this._ctx.send(T)];case 1:return(v=a.sent()).isOk?(R=v.data,n!==x.ULTRA_GROUP&&(R.messageUId="Cmd:".concat(f)),m=eE(e,E,R.messageUId,R.timestamp,this.currentUserId),n===x.ULTRA_GROUP?(this._chat.storage.addUGSentRecord(R.messageUId,R.timestamp),this._updateUltraGroupWhenRecallMsg(m)):(this._chat.storage.addSentRecord(R.messageUId,R.timestamp),this._updateSGModelCacheAfterSent(m)),[2,Ir(m)]):[2,v.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ctx.navi.updateVoipCallInfo(this._ctx.currentToken,t);var r=this._ctx.getNaviInfoFromCache();this._watcher.onNaviDataChange(n({},r))}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,o,s,u){return i(this,void 0,void 0,(function(){var i,l,c,f,d;return a(this,(function(a){switch(a.label){case 0:return i=o&&"uploads"!==o?t||"":tr(e,t),l=this.naviInfo,c=cr(l,this.logger),f="",c||(f=JSON.stringify({uploadDomain:c})),d=Ul.encode(wo,{type:e,key:i,httpMethod:r||"",queryString:o||"",url:s||"",ext:f,size:u?Math.ceil(u):0,ipType:l.ipType||0}),[4,this._ctx.query($n.qnTkn,this.currentUserId,d,Do)];case 1:return[2,a.sent().trans((function(e){return n(n({},e),{fileName:i,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,o){return i(this,void 0,void 0,(function(){var i,s,u,l,c;return a(this,(function(a){switch(a.label){case 0:return i=this.naviInfo,u="",l="",t===r.QINIU?s=$n.qnUrl:t===r.AWS?s=$n.s3Url:t===r.STC?s=$n.stcUrl:t===r.MINIO?(s=$n.minioUrl,u=cr(i,this.logger),l=JSON.stringify({url:u})):s=$n.aliUrl,c=Ul.encode(Uo,{type:e,key:n,fileName:o,ext:l,size:-1,ipType:i.ipType||0}),[4,this._ctx.query(s,this.currentUserId,c,Go)];case 1:return[2,a.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this._ctx.disconnect(e,t)];case 1:return r.sent(),this._resetMemoryState(),[2,Ir()]}}))}))}}),Object.defineProperty(e.prototype,"_resetMemoryState",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subscribeManager&&delete this._subscribeManager}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(e.prototype,"serverTime",{get:function(){return this._ctx.serverTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._ctx.currentUserId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentUserId",{get:function(){return this._ctx.currentUserId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,Tr(k.TAG_EXISTS)]:[2,this._userSettings.createTag(e)]}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e)?[2,this._userSettings.removeTag(e)]:[2,Tr(k.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,this._userSettings.createTag(e)]:[2,Tr(k.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){for(i in t=this._userSettings.getTags(),r=this._chat.storage.getTagConversationCountMap(),n=[],t)n.push({tagId:i,tagName:t[i].tagName,createdTime:t[i].createdTime,conversationCount:(null===(e=r.get(i))||void 0===e?void 0:e.length)||0});return[2,Ir(n)]}))}))}}),Object.defineProperty(e.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,o){return i(this,void 0,void 0,(function(){var r,i,s,u,l,c,f,d,_,h,g,p,b,E,I;return a(this,(function(a){switch(a.label){case 0:return r=e.targetId,t.messageId||(t.messageId=or()),i=t.messageId,s=cg(e,t),(u=new Oa($n.ugMsg,s,r)).setHeaderQos(ii),l=this._ctx.serverTime,c=eE(e,n({},t),"",l,this.currentUserId,i),o&&o(i),f=Date.now(),[4,this._ctx.send(u)];case 1:return d=a.sent(),_=d.code,h=d.data,_!==k.SUCCESS?(this._ctx.checkIfNeedRecordMessageUId(x.ULTRA_GROUP)&&this.logger.record(Ie.IM_MSG_SEND,JSON.stringify({channel:x.ULTRA_GROUP,start_ts:f,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:_})),c.sentStatus=se.FAILED,[2,Tr(_,void 0,c)]):(p=(g=h).timestamp,b=g.messageUId,c.sentTime=p,c.messageUId=b,this._ctx.checkIfNeedRecordMessageUId(x.ULTRA_GROUP,b)&&this.logger.record(Ie.IM_MSG_SEND,JSON.stringify({msg_id:b,channel:x.ULTRA_GROUP,start_ts:f,client_ts:Date.now(),server_deltatime:Date.now()-this._ctx.serverTime,cod:_})),this._chat.storage.addUGSentRecord(b,p),E=this._chat.storage.getOrCreateModel(e,!0),(I=E.updateAttrs({operationTime:p,latestMessage:n({},c)},p))&&this._watcher.conversation([{conversation:E.toIReceivedConversation(),updatedItems:I}]),[2,Ir(c)])}}))}))}}),Object.defineProperty(e.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._ctx.isConnected){var t=function(e){var t=e,r=t.type,n=t.notifyType,i=t.info,a=t.summary,o=[],s=[],u=!(2&~n),l=!(1&~n);return l&&Array.isArray(i)&&i.forEach((function(e){var t=e,r=t.targetId,n=t.busChannel,i=t.userId,a=t.opType,s=t.optime;o.push({targetId:r,channelId:n,userId:i,operationType:a,operationTime:s})})),u&&Array.isArray(a)&&a.forEach((function(e){var t=e,r=t.targetId,n=t.busChannel,i=t.count,a=t.opType;s.push({targetId:r,channelId:n,count:i,operationType:a})})),{conversationType:r,info:o,summary:s,hasInfo:l,hasSummary:u}}(Ul.decode(Ws,e.pbData));this._watcher.operateStatus(t)}}}),Object.defineProperty(e.prototype,"_handleConvertEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=[];e.filter((function(e){return 0===e.subChangeType})).forEach((function(e){var t=Ul.decode(Xu,new Uint8Array(e.eventData)).results;n.push.apply(n,u([],s(t.map((function(e){return{identifier:e.messageUID,from:e.inputSource,code:e.code,translateInfo:{targetLanguage:e.targetLan,translatedText:e.transResult||"",status:e.code===k.SUCCESS?wn.SUCCESS:wn.FAILED}}}))),!1))})),n.length&&(null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,n))}}),Object.defineProperty(e.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:tE},Friend:{map:{},types:rE}},r=function(e,t,r){e[t]||(e[t]=[]),e[t].push(r)};e.forEach((function(e){var n=e.changeType;for(var i in t)if(t[i].types.includes(n)){r(t[i].map,n,e);break}}));var n={Group:this._processChangeMapGroup.bind(this),Friend:this._processChangeMapFriend.bind(this)};for(var i in t)Object.keys(t[i].map).length>0&&n[i](t[i].map)}}),Object.defineProperty(e.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=P.GROUP_OPERATION,r=P.GROUP_PROFILE_CHANGE,n=P.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[r]&&this._handleGroupProfileChange(e[r]),e[n]&&this._handleFollowUserChange(e[n])}}),Object.defineProperty(e.prototype,"_processChangeMapFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e[b.FRIEND_APPLICATION]||[]).forEach((function(e){var r,n,i,a,o,s,u,l,c,f,d=e.subChangeType,_=e.businessId,h=e.time,g=e.eventData,b=E.FRIEND_APPLY,I=E.FRIEND_REFUSE,T=E.FRIEND_USER_INFO,v=E.FRIENDS_INPUT,R=E.FRIEND_CLEAR,m=E.FRIEND_INFO_CHANGE,y=E.FRIEND_INFO_CHANGE_SYNC;switch(d){case b:case I:var A=d===b?p.UNHANDLED:p.REFUSED;null===(n=(r=t._watcher).friendApplicationStatusChanged)||void 0===n||n.call(r,{userId:_,applicationType:g.applyType,applicationStatus:A,directionType:g.friendType,operationTime:h,extra:g.info||""});break;case T:null===(a=(i=t._watcher).friendAdd)||void 0===a||a.call(i,{userId:_,name:g.name,portraitUri:g.portraitUrl,directionType:g.friendType,operationTime:h});break;case v:null===(s=(o=t._watcher).friendDelete)||void 0===s||s.call(o,{userIds:g.targetId,directionType:g.type,operationTime:h});break;case R:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,h);break;case m:break;case y:null===(f=(c=t._watcher).friendInfoChangedSync)||void 0===f||f.call(c,{userId:_,remark:g.remarkname,extProfile:g.extProfile,operationTime:h})}}))}}),Object.defineProperty(e.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,a,o=e.subChangeType,u=e.businessId,l=e.time,c=e.eventData,f=c.optUserInfo,d=c.channelInfo,_=c.userInfos,h={groupId:u,operation:o,operationTime:l};f&&(r=s(qt([f]),1),h.operatorInfo=r[0]),o===y.CREATE&&(n=s(function(e){return void 0===e&&(e=[]),e.map((function(e){var t,r,n,i,a,o,s,u,l,c=Kt(e.settingProfile)||{},f=e.extProfile||[],d=e.targetId,_=e.baseInfo,h=e.userInfo;return{groupId:d,groupName:null!==(t=c.name)&&void 0!==t?t:"",portraitUri:null!==(r=c.portraitUrl)&&void 0!==r?r:"",introduction:null!==(n=c.introduction)&&void 0!==n?n:"",notice:null!==(i=c.announcement)&&void 0!==i?i:"",extProfile:Kt(f),joinPermission:~~c.joinPerm,removeMemberPermission:~~c.removePerm,invitePermission:~~c.memInvitePerm,inviteHandlePermission:~~c.invitePerm,groupInfoEditPermission:~~c.profilePerm,memberInfoEditPermission:~~c.memProfilePerm,creatorId:null!==(a=null==_?void 0:_.creatorId)&&void 0!==a?a:"",ownerId:null!==(o=null==_?void 0:_.ownerId)&&void 0!==o?o:"",createTime:(null==_?void 0:_.createTime)||0,membersCount:null!==(s=null==_?void 0:_.memberCount)&&void 0!==s?s:0,remark:null!==(u=null==h?void 0:h.remarkName)&&void 0!==u?u:"",joinedTime:(null==h?void 0:h.joinTime)||0,role:null!==(l=null==h?void 0:h.role)&&void 0!==l?l:m.UNDEF}}))}([d]),1),h.groupInfo=n[0]),[y.CREATE,y.DISMISS].includes(o)||(h.memberInfos=qt(_)),null===(a=(i=t._watcher).groupOperation)||void 0===a||a.call(i,h)}))}}),Object.defineProperty(e.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,a,o,u,l=e.businessId,c=e.time,f=e.eventData,d=e.subChangeType,_=e.secondaryId;switch(d){case A.GROUP_INFO_CHANGE:var h=s(qt([f.optUserInfo]),1)[0],g=s(Yt([f.channelInfo]),1)[0],p=s(f.channelFullInfo?Yt([f.channelFullInfo]):[void 0],1)[0];null===(n=(r=t._watcher).groupInfoChanged)||void 0===n||n.call(r,{operatorInfo:h,groupInfo:g,changedGroupInfo:g,operationTime:c,fullGroupInfo:p});break;case A.MEMBER_PROFILE_CHANGE:h=s(qt([f.optUserInfo]),1)[0];var b=qt(f.userInfos)[0];null===(a=(i=t._watcher).groupMemberInfoChanged)||void 0===a||a.call(i,{groupId:l,operatorInfo:h,memberInfo:b,operationTime:c});break;case A.GROUP_REMARK_DELETE:case A.GROUP_REMARK_SET:var E=d===A.GROUP_REMARK_SET?O.ADD:O.REMOVE;null===(u=(o=t._watcher).groupRemarkChangedSync)||void 0===u||u.call(o,{groupId:l,operationType:E,operationTime:c,groupRemark:_})}}))}}),Object.defineProperty(e.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i=e.subChangeType,a=e.businessId,o=e.time,s=e.userGroupIds,u=1===i?O.ADD:O.REMOVE;null===(n=(r=t._watcher).groupFollowsChangedSync)||void 0===n||n.call(r,{groupId:a,operationType:u,operationTime:o,userIds:s})}))}}),Object.defineProperty(e.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],i=[],a=[];t.forEach((function(e){var t=e.subChangeType,o=e.targetId;e.msgTime;var s=e.operatorId,u=e.busChannelType,l=e.time,c=e.busChannel||"",f={conversationType:x.ULTRA_GROUP,targetId:o,channelId:c},d=r._chat.storage.getModel(f);switch(t){case ie.PRIVATE_TO_PUBLIC:null==d||d.updateAttrs({channelType:te.PUBLIC}),n.push({targetId:o,channelId:c,changeType:re.PRIVATE_TO_PUBLIC,channelType:te.PUBLIC});break;case ie.PUBLIC_TO_PRIVATE:null==d||d.updateAttrs({channelType:te.PRIVATE}),n.push({targetId:o,channelId:c,changeType:re.PUBLIC_TO_PRIVATE,channelType:te.PRIVATE});break;case ie.PUBLIC_TO_PRIVATE_USER_NOT_IN:d&&r._chat.storage.removeConversation(d),n.push({targetId:o,channelId:c,changeType:re.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:u});break;case ie.CHANNEL_DELETE:d&&r._chat.storage.removeConversation(d),i.push({targetId:o,channelId:c,channelType:u,deleteTime:l});break;case ie.CHANNEL_USER_KICKED:a.push({targetId:o,channelId:c,userId:s,channelType:te.PRIVATE}),s===r.currentUserId&&d&&r._chat.storage.removeConversation(d);case ie.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),i.length>0&&this._watcher.ultraGroupChannelDelete(i),a.length>0&&this._watcher.ultraGroupChannelUserKicked(a)}}),Object.defineProperty(e.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var e,r,n,i,o,s;return a(this,(function(a){return e=[],r=[],n=[],i=[],o=[],t.forEach((function(t){var a=t.type,s=t.targetId,u=t.busChannelType,l=t.busChannel,c=t.userGroupIds;switch(t.subChangeType){case ae.REMOVE_USER_GROUP:e.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.JOIN_USER_GROUP:r.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.EXIT_USER_GROUP:n.push({conversation:{conversationType:a,targetId:s},userGroupIds:c});break;case ae.CHANNEL_BIND_USER_GROUP:i.push({conversation:{conversationType:a,targetId:s,channelId:l},channelType:u,userGroupIds:c});break;case ae.CHANNEL_UNBIND_USER_GROUP:o.push({conversation:{conversationType:a,targetId:s,channelId:l},channelType:u,userGroupIds:c})}})),s={},e.length>0&&(s.userGroupDisband=e),r.length>0&&(s.userAdded=r),n.length>0&&(s.userRemoved=n),i.length>0&&(s.userGroupBindChannel=i),o.length>0&&(s.userGroupUnBindChannel=o),this._watcher.userGroupStatus(s),[2]}))}))}}),Object.defineProperty(e.prototype,"_updateUltraGroupWhenRecallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._chat.storage.getModel(e);if(r){var n={},i=e.content,a=i.messageUId,o=i.sentTime,s=r.latestMessage;s&&s.messageUId===a&&(n.latestMessage=Oc(e,!0)),o&&r.lastReadTime<o&&r.unreadCount&&(n.unreadCount=r.unreadCount-1,t!==oe.ALL&&t!==oe.ME||!r.unreadMentionedCount||(n.unreadMentionedCount=r.unreadMentionedCount-1),t===oe.ME&&r.unreadMentionedCount&&(n.unreadMentionedMeCount=r.unreadMentionedMeCount-1));var u=r.updateAttrs(n,e.sentTime);this._chat.storage.updateConversationStorage([r]),u&&this._watcher.conversation([{conversation:r.toIReceivedConversation(),updatedItems:u}])}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._subscribeManager.updateSubscribeRelation(e,t,de.SUBSCRIBE,r)]}))}))}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this._subscribeManager.updateSubscribeRelation(e,t,de.UNSUBSCRIBE)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){return i=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserList(e,t,r),[2,Ir(i)]}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){return n=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserStatus(e,t),[2,Ir(n||[])]}))}))}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return i(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=Ul.encode(cu,l(this,Gb,"m",Wb).call(this,e)),[4,this._ctx.query($n.updUserProfile,this.currentUserId,r,void 0)];case 1:return(n=a.sent()).data?(i=Ul.decode(fu,n.data.pbData),n.isOk?(o=i.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,o),[2,n.wipe()]):(s=i.censorFailedFields,[2,Tr(n.code,"",s&&0!==s.length?{errorKeys:s,errorKey:s[0]}:void 0)])):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subscribeManager.getOwnProfile()}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._subscribeManager.getUserProfiles(e)]}))}))}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){return a(this,(function(i){switch(i.label){case 0:return r?[3,2]:[4,this._ctx.send(new Oa(t,n,e))];case 1:return[2,i.sent().wipe()];case 2:return[4,this._ctx.query(t,e,n,void 0)];case 3:return[2,i.sent().trans((function(e){return e.pbData}))]}}))}))}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o;return a(this,(function(a){switch(a.label){case 0:return n=$l(t,r),[4,this.rtcSignaling(e,$n[$n.rtcPing],!0,n)];case 1:return(i=a.sent()).isOk?(o=Ul.decode(dl,i.data),[2,Ir(o)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"deviceId",{get:function(){return this._ctx.appStorage.deviceId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._ctx.appStorage.setCustomDeviceId(e.deviceId),this._ctx.appStorage.setPackageName(e.packageName)}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){i(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return Dc?(xc&&(clearTimeout(xc),xc=null),[4,Dc]):[2];case 1:return(e=r.sent())&&(t=e.db,Hc.push(t)),Dc=null,[2]}}))}))}}),Object.defineProperty(e.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._ctx.handleNetworkChange(e,t)}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i;return a(this,(function(a){switch(a.label){case 0:return n=Ul.encode(qs,{key:t,dataContent:r}),[4,this._ctx.query($n.reqCall,e,n,qs)];case 1:return(i=a.sent()).isOk?[2,i.trans((function(e){return{key:e.key,value:e.dataContent}}))]:[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return t=Ul.encode(xu,e),[4,this._ctx.query($n.addUnpush,this.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=Ul.encode(Fu,{nothing:0}),[4,this._ctx.query($n.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return e=Ul.encode(Bu,{nothing:0}),[4,this._ctx.query($n.qryUnpush,this.currentUserId,e,Hu)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,r=e.spanMinutes,n=e.startTime,i=e.level,a=e.timezone;return t?{spanMinutes:r,startTime:n,level:i,timezone:a}:{spanMinutes:0,startTime:"",level:Me.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,Ir(Xr.getStatsUrlList(this.naviInfo))]}))}))}}),Object.defineProperty(e.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u,l,c,f,d=this;return a(this,(function(a){switch(a.label){case 0:return i=0===n?e[0].identifier:this.currentUserId,o=this.userSettings.storage.get("value").transLan,s=[],u=[],e.forEach((function(e){var t=e.sourceLanguage,r=e.content,i=e.targetLanguage||o;t!==i?r?s.push({messageUID:e.identifier,sourceLan:e.sourceLanguage,targetLan:e.targetLanguage||o,text:e.content,inputSource:n,transType:1}):u.push({identifier:e.identifier,from:n,code:k.TRANSLATION_TEXT_INVALID,translateInfo:{targetLanguage:i,translatedText:"",status:wn.NONE}}):u.push({identifier:e.identifier,from:n,code:k.TRANSLATION_LANGUAGE_SAME,translateInfo:{targetLanguage:i,translatedText:"",status:wn.NONE}})})),0!==s.length?[3,1]:(l=Ir(),[3,3]);case 1:return c=Ul.encode(Wu,{businessType:3,businessInfo:Ul.encode(Qu,{forceTrans:r,transInfos:s,model:t})}),[4,this._ctx.query($n.upConvertMsg,i,c,qu)];case 2:f=a.sent(),l=f.wipe(),a.label=3;case 3:return u.length>0&&setTimeout((function(){return d._watcher.translateResponse(u)}),0),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return this._subscribeManager?(t=[],r=new Set,this._subscribeManager.getSubscribeUserStatus(fe.ONLINE_STATUS,e).forEach((function(e){var n=e.userId,i=e.details,a=(void 0===i?[]:i).map((function(e){return{platform:e.platform,isOnline:!!e.eventValue,updateTime:e.changeTime}})),o=a.some((function(e){return e.isOnline})),s={userId:n,isOnline:o,details:a};t.push(s),r.add(n)})),0===(n=e.filter((function(e){return!r.has(e)}))).length?[2,Ir(t)]:[4,l(this,Gb,"m",Jb).call(this,fe.FRIEND_ONLINE_STATUS,n)]):[2,Ir([])];case 1:return(i=a.sent()).isOk?(i.data.list.forEach((function(e){var r,n=e.subUserId,i=e.data.map((function(e){return{platform:e.platformInfo,isOnline:!!e.value,updateTime:e.versionTime}})),a=i.some((function(e){return e.isOnline}));t.push((r={userId:n,isOnline:a,details:i},[ce.iOS,ce.Android,ce.Web,ce.PC,ce.Mini,ce.HarmonyOS].forEach((function(e){r.details.some((function(t){return t.platform===e}))||r.details.push({platform:e,isOnline:!1,updateTime:0})})),r))})),[2,Ir(t)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._ctx.getAllRobots(!1)]}))}))}}),e}();Gb=new WeakSet,Vb=function(e,t,r,n,i){this._watcher.robotsSynced(t,n)},jb=function(e,t){this._watcher.readReceiptResponseV5(t)},kb=function(e,t){this._watcher.speechToTextResponse(t)},xb=function(e,t){this._watcher.messagesModified(t)},Fb=function(e){this._watcher.messageModifiedSyncCompleted()},Bb=function(e,t){this._watcher.ultraGroupMessageExpansionUpdated(t)},Hb=function(e,t){this._watcher.ultraGroupMessageRecalled(t)},Yb=function(e,t,r){var n=this;t!==Ag?t!==Sg?this._handleEventChangeList(this._codec.formatEventChangeList(r)):this._handleConvertEvent(r):r.forEach((function(e){Ul.decode(ku,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,r,i=Xt(e);null===(r=(t=n._watcher).groupApplicationEvent)||void 0===r||r.call(t,i)}))}))},Wb=function(e){var t={},r=e.extraProfile;return r&&(delete e.extraProfile,t.userExtProfile=Dh(r)),t.userProfile=Dh(e),t},Jb=function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){switch(n.label){case 0:return r=Ul.encode(lu,{subType:e,subUsers:t.map((function(e){return{subUserId:e}}))}),[4,this._ctx.query($n.qrySubData,this.currentUserId,r,su)];case 1:return[2,n.sent()]}}))}))};var iE=function(){function e(e){qb.set(this,void 0),c(this,qb,e,"f")}return Object.defineProperty(e.prototype,"isSpeechToTextEnabled",{get:function(){return!!(1&(l(this,qb,"f").AIBusinessSub||0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConversationListIncludeUltraGroup",{get:function(){return Up(l(this,qb,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messageModifiableMinutes",{get:function(){return l(this,qb,"f").msgModifyMinute||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readReceiptVersion",{get:function(){return e=(e=l(this,qb,"f").grpRRVer)||0,Object.values(xe).includes(e)?e:xe.UNKNOWN;var e},enumerable:!1,configurable:!0}),e}();qb=new WeakMap;var aE,oE,sE,uE,lE,cE,fE,dE=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ctx=e,this.logger=e.logger}return Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e.checkAuthed(!1)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e.checkAuthed(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkAuthed",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.ctx.connectionStatus===he.CONNECTED||this.ctx.userId&&e?Ir(this.ctx.naviInfo):Tr(k.RC_NET_UNAVAILABLE)}}),e}(),_E=function(e){function r(t,r){var n=e.call(this,t)||this;return Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(F.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,extra:n,createIfNotExist:r}),i),[4,vr.create("joinChatroom").validate("chatroomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isNumber("count",t,!0).fail(k.INVALID_PARAMETER_COUNT).isString("extra",n).fail(k.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){var i=Math.max(Math.min(t,50),-1)||10;return s.svr.joinChatroom(e,i,r,n)}))];case 1:return o=a.sent(),this.logger.summary(F.A_JOIN_CHATROOM_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_QUIT_CHATROOM_T,JSON.stringify({roomId:e}),r),[4,vr.create("quitChatroom").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isString("extra",t).fail(k.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.quitChatroom(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_QUIT_CHATROOM_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_CHATROOM_INFO_T,JSON.stringify({roomId:e,count:t,order:r}),n),[4,vr.create("getChatroomInfo").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,0,20).fail(k.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,2).fail(k.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).next((function(){return o.svr.getChatroomInfo(e,t||0,r||1)}))];case 1:return i=a.sent(),this.logger.summary(F.A_GET_CHATROOM_INFO_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,vr.create("setChatroomEntry").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("key",null==t?void 0:t.key,ir,!0).fail(k.INVALID_PARAMETER_KEY).validate("value",null==t?void 0:t.value,ar,!0).fail(k.INVALID_PARAMETER_VALUE).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(k.INVALID_PARAMETER_NOTIFICATION_EXTRA).isBoolean("isAutoDelete",null==t?void 0:t.isAutoDelete).fail(k.INVALID_PARAMETER_IS_AUTO_DELETE).isBoolean("isSendNotification",null==t?void 0:t.isSendNotification).fail(k.INVALID_PARAMETER_IS_SEND_NOTIFICATION).result().tryTrans(this.validateConnected).next((function(){return o.svr.setChatroomEntry(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_SET_CHATROOM_ENTRY_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,vr.create("setChatroomEntries").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isTypedArray("entries",null==t?void 0:t.entries,(function(e){return ir(null==e?void 0:e.key)&&ar(null==e?void 0:e.value)}),!0).fail(k.INVALID_PARAMETER_ENTRIES).isLimitedArray("entryOptions.entries",null==t?void 0:t.entries,10,!0).fail(k.CHATROOM_KV_STORE_OUT_LIMIT).isBoolean("entryOptions.isForce",null==t?void 0:t.isForce).fail(k.INVALID_PARAMETER_IS_FORCE).isBoolean("entryOptions.isAutoDelete",null==t?void 0:t.isAutoDelete).fail(k.INVALID_PARAMETER_IS_AUTO_DELETE).result().tryTrans(this.validateConnected).next((function(){return i.svr.setChatroomEntries(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_SET_CHATROOM_ENTRIES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,vr.create("removeChatroomEntry").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("entry.key",null==t?void 0:t.key,ir,!0).fail(k.INVALID_PARAMETER_KEY).isBoolean("entry.isSendNotification",null==t?void 0:t.isSendNotification).fail(k.INVALID_PARAMETER_IS_SEND_NOTIFICATION).isLimitedString("entry.notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(k.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return o.svr.removeChatroomEntry(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_REMOVE_CHATROOM_ENTRY_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,vr.create("removeChatroomEntries").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("keys",null==t?void 0:t.keys,10,ir,!0).fail(k.INVALID_PARAMETER_KEYS).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(k.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.removeChatroomEntries(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_REMOVE_CHATROOM_ENTRIES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,key:t}),r),[4,vr.create("getChatroomEntry").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("key",t,ir,!0).fail(k.INVALID_PARAMETER_KEY).result().tryTrans(this.validateConnected).next((function(){return i.svr.getChatroomEntry(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_CHATROOM_ENTRY_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e}),t),[4,vr.create("getAllChatroomEntries").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.getAllChatroomEntries(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_CHATROOM_ENTRIES_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(F.A_GET_CHATROOM_HISTORY_MESSAGES_T,JSON.stringify({roomId:e,count:t,order:r,timestamp:n}),i),[4,vr.create("getChatroomHistoryMessages").validate("roomId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,1,100).fail(k.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,1).fail(k.INVALID_PARAMETER_ORDER).isTimestamp("timestamp",n).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return s.svr.getChatroomHistoryMessages(e,n||0,t||20,r||0)}))];case 1:return o=a.sent(),this.logger.summary(F.A_GET_CHATROOM_HISTORY_MESSAGES_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.svr.setCheckChatRoomDuplicateMessage(e)}}),Object.defineProperty(r.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_BIND_RTC_FOR_CHATROOM_T,JSON.stringify({option:e}),t),[4,vr.create("bindRTCRoomForChatroom").validate("chatRoomId",null==e?void 0:e.chatRoomId,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.bindRTCRoomForChatroom(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_BIND_RTC_FOR_CHATROOM_R,r,t),[2,r]}}))}))}}),r}(dE),hE=function(e){e.groupId;var t=e.groupName,r=e.portraitUri,n=e.introduction,i=e.notice;e.extProfile;var a=e.joinPermission,o=e.removeMemberPermission,s=e.invitePermission,u=e.inviteHandlePermission,l=e.groupInfoEditPermission,c=e.memberInfoEditPermission;return JSON.parse(JSON.stringify({name:t,portraitUrl:r,introduction:n,announcement:i,joinPerm:a,removePerm:o,memInvitePerm:s,invitePerm:u,profilePerm:l,memProfilePerm:c}))},gE=function(e){var t,r,n;return{removeMuteStatus:!(null!==(t=null==e?void 0:e.removeMuteStatus)&&void 0!==t&&!t),removeWhiteList:!(null!==(r=null==e?void 0:e.removeWhiteList)&&void 0!==r&&!r),removeFollow:!(null!==(n=null==e?void 0:e.removeFollow)&&void 0!==n&&!n)}},pE=function(e,t,r){return e.validate("groupId",null==t?void 0:t.groupId,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedString("groupName",null==t?void 0:t.groupName,1,64,r).fail(k.INVALID_PARAMETER_GROUP_NAME).isString("portraitUri",null==t?void 0:t.portraitUri).isString("introduction",null==t?void 0:t.introduction).isString("notice",null==t?void 0:t.notice).validate("extProfile",null==t?void 0:t.extProfile,(function(e){if(!At(e))return!1;var t=Object.entries(e);return t.length<=10&&t.every((function(e){var t=s(e,2);t[0];var r=t[1];return bt(r)}))})).isNumberEnum("joinPermission",null==t?void 0:t.joinPermission,I).isNumberEnum("removeMemberPermission",null==t?void 0:t.removeMemberPermission,T).isNumberEnum("invitePermission",null==t?void 0:t.invitePermission,T).isNumberEnum("inviteHandlePermission",null==t?void 0:t.inviteHandlePermission,R).isNumberEnum("groupInfoEditPermission",null==t?void 0:t.groupInfoEditPermission,T).isNumberEnum("memberInfoEditPermission",null==t?void 0:t.memberInfoEditPermission,v).fail(k.INVALID_PARAMETER_GROUP_INFO)},bE=function(e,t,r,n,i){return e.isObject("option",n,i).fail(k.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("count",null==n?void 0:n.count,1,t,r).fail(k.INVALID_PARAMETER_COUNT).isString("pageToken",null==n?void 0:n.pageToken).fail(k.INVALID_PARAMETER_PAGING_QUERY_OPTION).isBoolean("order",null==n?void 0:n.order).fail(k.INVALID_PARAMETER_ORDER)},EE=function(e){function r(t,r){var n=e.call(this,t)||this;return Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"_userProfileEnabled",{enumerable:!0,configurable:!0,writable:!0,value:function(){var e;return 1===(null===(e=n.ctx.naviInfo)||void 0===e?void 0:e.userProfile)?Ir():Tr(k.RC_USER_PROFILE_SERVICE_UNAVAILABLE)}}),n}return t(r,e),Object.defineProperty(r.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_UPDATE_MY_USER_PROFILE_VISIBILITY_T,e,t),[4,vr.create("updateMyUserProfileVisibility").isNumberEnum("visibility",e,_e,!0).fail(k.INVALID_PARAMETER_USER_PROFILE_VISIBILITY).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.updateMyUserProfileVisibility(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_UPDATE_MY_USER_PROFILE_VISIBILITY_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_MY_USER_PROFILE_VISIBILITY_T,"",e),[4,this.validateConnected().tryTrans(this._userProfileEnabled).next((function(){return r.svr.getMyUserProfileVisibility()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_MY_USER_PROFILE_VISIBILITY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(r.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T,e,t),[4,vr.create("searchUserProfileByUniqueId").isNotEmptyString("uniqueId",e,!0).fail(k.INVALID_PARAMETER_UNIQUE_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.searchUserProfileByUniqueId(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_ADD_FRIEND_T,JSON.stringify({userId:e,directionType:t,extra:r}),n),[4,vr.create("addFriend").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).isNumberEnum("directionType",t,f,!0).fail(k.INVALID_PARAMETER_DIRECTION_TYPE).isLimitedString("extra",r,0,128).fail(k.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.addFriend(e,t,r||"")}))];case 1:return i=a.sent(),this.svr.addFriend(e,t,r||""),this.logger.summary(F.A_ADD_FRIEND_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_DELETE_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),r),[4,vr.create("deleteFriends").isLimitedTypedArray("userIds",e,100,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,f,!0).fail(k.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.deleteFriends(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_DELETE_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_ACCEPT_FRIEND_REQUEST_T,e,t),[4,vr.create("acceptFriendRequest").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.acceptFriendRequest(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_ACCEPT_FRIEND_REQUEST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REFUSE_FRIEND_REQUEST_T,JSON.stringify({userId:e,reason:t}),r),[4,vr.create("refuseFriendApplication").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).isString("reason",t).fail(k.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.refuseFriendRequest(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_REFUSE_FRIEND_REQUEST_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SET_FRIEND_INFO_T,JSON.stringify({userId:e,remark:t,extProfile:r}),n),[4,vr.create("setFriendInfo").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).isLimitedString("remark",t,0,64,!0).fail(k.INVALID_PARAMETER_REMARK).validate("extProfile",r,(function(e){if("object"!=typeof r)return!1;var t=Object.entries(r);return!(t.length>10||t.some((function(e){var t=s(e,2);t[0];var r=t[1];return!bt(r)})))})).fail(k.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.setFriendInfo(e,t,r||{})}))];case 1:return i=a.sent(),this.logger.summary(F.A_SET_FRIEND_INFO_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_CHECK_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),r),[4,vr.create("checkFriends").isLimitedTypedArray("userIds",e,20,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,f,!0).fail(k.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.checkFriends(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_CHECK_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_FRIENDS_T,JSON.stringify({directionType:e,option:t}),r),[4,vr.create("getFriends").isNumberEnum("directionType",e,d,!0).fail(k.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE).check((function(e){return bE(e,100,!1,t)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:(null==t?void 0:t.count)||50,pageToken:(null==t?void 0:t.pageToken)||"",order:!!(null==t?void 0:t.order)};return i.svr.getFriends(e,r)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_FRIEND_APPLICATIONS_T,JSON.stringify({option:e,types:t,status:r}),n),[4,vr.create("getFriendApplications").check((function(t){return bE(t,100,!1,e)})).check((function(e){e.isTypedArray("types",t,(function(t){return!e.isNumberEnum("type",t,g,!0).isFailed})).fail(k.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE).isTypedArray("status",r,(function(t){return!e.isNumberEnum("status",t,p,!0).isFailed})).fail(k.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:(null==e?void 0:e.count)||50,pageToken:(null==e?void 0:e.pageToken)||"",order:!!(null==e?void 0:e.order)},i=t&&0!==t.length?t:[1,2],a=r&&0!==r.length?r:[0,1,2,3];return o.svr.getFriendApplications(n,i,a)}))];case 1:return i=a.sent(),this.logger.summary(F.A_GET_FRIEND_APPLICATIONS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_FRIENDS_INFO_T,JSON.stringify({userIds:e}),t),[4,vr.create("getFriendsInfo").isLimitedTypedArray("userIds",e,100,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getFriendsInfo(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_FRIENDS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_SEARCH_FRIENDS_INFO_T,JSON.stringify({nickname:e}),t),[4,vr.create("searchFriendsInfo").isLimitedString("nickname",e,1,64,!0).fail(k.INVALID_PARAMETER_NICK_NAME).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.searchFriendsInfo(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_SEARCH_FRIENDS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_SET_FRIEND_ADD_PERMISSION_T,JSON.stringify({permission:e}),t),[4,vr.create("setFriendAddPermission").isNumberEnum("permission",e,_,!0).fail(k.INVALID_PARAMETER_FRIEND_ADD_PERMISSION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.setFriendAddPermission(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_SET_FRIEND_ADD_PERMISSION_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_FRIEND_ADD_PERMISSION_T,JSON.stringify({}),e),[4,vr.create("getFriendAddPermission").result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getFriendAddPermission()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_FRIEND_ADD_PERMISSION_R,t,e),[2,t]}}))}))}}),Object.defineProperty(r.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_CREATE_GROUP_T,JSON.stringify({groupInfo:e,inviteeUserIds:t}),r),[4,vr.create("createGroup").check((function(t){return pE(t,e,!0)})).isLimitedTypedArray("inviteeUserIds",t,30,Ut,!1,0).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r=hE(e);return i.svr.createGroup(e.groupId,r,e.extProfile||{},t||[])}))];case 1:return n=a.sent(),this.logger.summary(F.A_CREATE_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_UPDATE_GROUP_INFO_T,JSON.stringify({groupInfo:e}),t),[4,vr.create("updateGroupInfo").check((function(t){return pE(t,e,!1)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var t=hE(e);return n.svr.updateGroupInfo(e.groupId,t,e.extProfile)}))];case 1:return r=i.sent(),this.logger.summary(F.A_UPDATE_GROUP_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_GROUPS_INFO_T,JSON.stringify({groupIds:e}),t),[4,vr.create("getGroupsInfo").isLimitedTypedArray("groupIds",e,20,Dt,!0,1).fail(k.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getGroupsInfo(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_GROUPS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_KICK_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t,config:r}),n),[4,vr.create("kickGroupMembers").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0,1).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.kickGroupMembers(e,t,gE(r))}))];case 1:return i=a.sent(),this.logger.summary(F.A_KICK_GROUP_MEMBERS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_QUIT_GROUP_T,JSON.stringify({groupId:e,config:t}),r),[4,vr.create("quitGroup").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.quitGroup(e,gE(t))}))];case 1:return n=a.sent(),this.logger.summary(F.A_QUIT_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_DISMISS_GROUP_T,JSON.stringify({groupId:e}),t),[4,vr.create("dismissGroup").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.dismissGroup(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_DISMISS_GROUP_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(F.A_TRANSFER_GROUP_OWNER_T,JSON.stringify({groupId:e,newOwnerId:t,quit:r,config:n}),i),[4,vr.create("transferGroupOwner").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).validate("newOwnerId",t,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.transferGroupOwner(e,t,!!r,gE(n))}))];case 1:return o=a.sent(),this.logger.summary(F.A_TRANSFER_GROUP_OWNER_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"addGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_ADD_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,vr.create("addGroupManagers").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,Ut,!0,1).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(O.ADD,e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_ADD_GROUP_MANAGERS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"removeGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,vr.create("removeGroupManagers").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,Ut,!0,1).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(O.REMOVE,e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_REMOVE_GROUP_MANAGERS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,vr.create("getGroupMembers").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0,1).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.getGroupMembers(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_GROUP_MEMBERS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(F.A_SET_GROUP_MEMBER_INFO_T,JSON.stringify({groupId:e,userId:t,nickname:r,extra:n}),i),[4,vr.create("setGroupMemberInfo").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).validate("userId",t,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).isLimitedString("nickname",r,0,64,!0).fail(k.INVALID_PARAMETER_NICK_NAME).isLimitedString("extra",n,0,128).fail(k.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.setGroupMemberInfo(e,t,r,n)}))];case 1:return o=a.sent(),this.logger.summary(F.A_SET_GROUP_MEMBER_INFO_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SEARCH_GROUP_MEMBERS_T,JSON.stringify({groupId:e,nickName:t,option:r}),n),[4,vr.create("searchGroupMembers").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedString("nickName",t,1,64,!0).fail(k.INVALID_PARAMETER_NICK_NAME).check((function(e){return bE(e,200,!0,r,!0)})).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((function(){var n={count:r.count,pageToken:r.pageToken||"",order:!!r.order};return o.svr.searchGroupMembers(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(F.A_SEARCH_GROUP_MEMBERS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_GROUP_MEMBERS_BY_ROLE_T,JSON.stringify({groupId:e,role:t,option:r}),n),[4,vr.create("getGroupMembersByRole").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isNumberEnum("role",t,m,!0).fail(k.INVALID_PARAMETER_GROUP_MEMBER_ROLE).isLimitedInteger("count",r.count,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).isString("pageToken",r.pageToken).fail(k.INVALID_PARAMETER_PAGING_QUERY_OPTION).isNumberEnum("filterRobotType",r.filterRobotType,Ge).fail(k.INVALID_PARAMETER_PAGING_QUERY_OPTION).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:r.count,pageToken:r.pageToken||"",order:!!r.order,filterRobotType:r.filterRobotType||Ge.ALL};return o.svr.getGroupMembersByRole(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(F.A_GET_GROUP_MEMBERS_BY_ROLE_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"addGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_ADD_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,vr.create("addGroupFollows").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(O.ADD,e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_ADD_GROUP_FOLLOWS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"removeGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,vr.create("removeGroupFollows").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(O.REMOVE,e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_REMOVE_GROUP_FOLLOWS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_GROUP_FOLLOWS_T,JSON.stringify({groupId:e}),t),[4,vr.create("getGroupFollows").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getGroupFollows(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_GROUP_FOLLOWS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SET_GROUP_REMARK_T,JSON.stringify({groupId:e,remark:t}),r),[4,vr.create("setGroupRemark").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedString("remark",t,0,64,!0).fail(k.INVALID_PARAMETER_REMARK).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupRemark(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_SET_GROUP_REMARK_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_JOIN_GROUP_T,JSON.stringify({groupId:e}),t),[4,vr.create("joinGroup").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.joinGroup(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_JOIN_GROUP_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_INVITE_USERS_TO_GROUP_T,JSON.stringify({groupId:e,userIds:t}),r),[4,vr.create("inviteUsersToGroup").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,30,Ut,!0,1).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.inviteUsersToGroup(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_INVITE_USERS_TO_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"acceptGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_ACCEPT_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t}),r),[4,vr.create("acceptGroupInvite").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.memberInviteResponse({groupId:e,inviterId:t,optType:C.APPLICANT,optResult:N.ACCEPT})}))];case 1:return n=a.sent(),this.logger.summary(F.A_ACCEPT_GROUP_INVITE_R,n,r),[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"refuseGroupInvite",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_REFUSE_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t,reason:r}),n),[4,vr.create("refuseGroupInvite").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).isLimitedString("reason",r,0,128).fail(k.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,inviterId:t,optType:C.APPLICANT,optResult:N.REFUSE,reason:r})}))];case 1:return i=a.sent(),this.logger.summary(F.A_REFUSE_GROUP_INVITE_R,i,n),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"acceptGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_ACCEPT_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:r}),n),[4,vr.create("acceptGroupApplication").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).validate("inviterId",r,Ut).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r||"",optType:C.MANAGER,optResult:N.ACCEPT})}))];case 1:return i=a.sent(),this.logger.summary(F.A_ACCEPT_GROUP_APPLICATION_R,i,n),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"refuseGroupApplication",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(F.A_REFUSE_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:r,reason:n}),i),[4,vr.create("refuseGroupApplication").validate("groupId",e,Dt,!0).fail(k.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).validate("inviterId",r,Ut).fail(k.INVALID_PARAMETER_USER_ID).isLimitedString("reason",n,0,128).fail(k.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return s.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r||"",optType:C.MANAGER,optResult:N.REFUSE,reason:n})}))];case 1:return o=a.sent(),this.logger.summary(F.A_REFUSE_GROUP_APPLICATION_R,o,i),[2,o.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_GROUP_APPLICATIONS_T,JSON.stringify({option:e,directions:t,status:r}),n),i=this.ctx.usingCppEngine,[4,vr.create("getGroupApplications").check((function(t){return bE(t,200,!0,e,!0)})).check((function(e){i&&e.isLimitedTypedArray("directions",t,Object.keys(L).length,(function(t){return!e.isNumberEnum("directions",t,L,!0).isFailed}),!0,1).fail(k.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION).isLimitedTypedArray("status",r,Object.keys(S).length,(function(t){return!e.isNumberEnum("status",t,S,!0).isFailed}),!0,1).fail(k.INVALID_PARAMETER_GROUP_APPLICATION_STATUS)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var n={count:e.count,pageToken:e.pageToken||"",order:!!e.order};return s.svr.getGroupApplications(n,t||[],r||[])}))];case 1:return o=a.sent(),this.logger.summary(F.A_GET_GROUP_APPLICATIONS_R,o,n),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_JOINED_GROUPS_BY_ROLES_T,JSON.stringify({role:e,option:t}),r),[4,vr.create("getJoinedGroupsByRole").isNumberEnum("role",e,m,!0).fail(k.INVALID_PARAMETER_GROUP_MEMBER_ROLE).check((function(e){return bE(e,100,!0,t,!0)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r={count:t.count,pageToken:t.pageToken||"",order:!!t.order};return i.svr.getJoinedGroupsByRole(e,r)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_JOINED_GROUPS_BY_ROLES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SEARCH_JOINED_GROUPS_T,JSON.stringify({groupName:e,option:t}),r),[4,vr.create("searchJoinedGroups").isLimitedString("groupName",e,1,64,!0).fail(k.INVALID_PARAMETER_GROUP_NAME).check((function(e){return bE(e,200,!0,t,!0)})).result().tryTrans(this.validateLogin).tryTrans(this._userProfileEnabled).next((function(){var r={count:t.count,pageToken:t.pageToken||"",order:!!t.order};return i.svr.searchJoinedGroups(e,r)}))];case 1:return n=a.sent(),this.logger.summary(F.A_SEARCH_JOINED_GROUPS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_JOINED_GROUPS_T,JSON.stringify({groupIds:e}),t),[4,vr.create("getJoinedGroups").isLimitedTypedArray("groupIds",e,20,Dt,!0,1).fail(k.INVALID_PARAMETER_GROUP_IDS).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return n.svr.getJoinedGroups(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_JOINED_GROUPS_R,r,t),[2,r]}}))}))}}),r}(dE),IE=0,TE=function(e){function r(t,r,i){var a=e.call(this,i)||this;return Object.defineProperty(a,"_svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),aE.set(a,void 0),oE.set(a,!1),sE.set(a,!0),uE.set(a,""),Object.defineProperty(a,"_id",{enumerable:!0,configurable:!0,writable:!0,value:++IE}),c(a,aE,n(n({},t),{tagFilter:n({},t.tagFilter)}),"f"),a}return t(r,e),Object.defineProperty(r.prototype,"hasMore",{get:function(){return l(this,sE,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isLoading",{get:function(){return l(this,oE,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"load",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return l(this,oE,"f")?[2,Tr(k.METHOD_BUSY)]:(c(this,oE,!0,"f"),t=this.logger.createTraceId(),this.logger.info(F.A_LOAD_CONVERSATION_LIST_T,JSON.stringify({count:e,loaderId:this._id,pageToken:l(this,uE,"f")}),t),[4,vr.create("ConversationListLoader.load").isLimitedInteger("count",e,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){return u._svr.loadConversationList(l(u,uE,"f"),e,l(u,aE,"f"))}))]);case 1:return r=a.sent(),this.logger.summary(F.A_LOAD_CONVERSATION_LIST_R,r,t,{loaderId:this._id},(function(e){return{pageToken:e.pageToken,finished:e.finished}})),c(this,oE,!1,"f"),r.isOk?(n=r.data,i=n.pageToken,o=n.finished,s=n.list,c(this,uE,i,"f"),c(this,sE,!o,"f"),[2,Ir(s)]):[2,r.wipe()]}}))}))}}),r}(dE);aE=new WeakMap,oE=new WeakMap,sE=new WeakMap,uE=new WeakMap;var vE=function(e){function r(t,r){var n=e.call(this,t)||this;return lE.add(n),Object.defineProperty(n,"svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),n}return t(r,e),Object.defineProperty(r.prototype,"saveEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SAVE_EDITED_MSG_DRAFT_T,JSON.stringify({draft:e,identifier:t}),r),[4,vr.create("saveEditedMessageDraft").check((function(e){return dc(e,t,X)})).isString("draft",null==e?void 0:e.content,!0).fail(k.INVALID_PARAMETER_DRAFT).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateLogin).next((function(){return i.svr.saveEditedMessageDraft(e,l(i,lE,"m",fE).call(i,t))}))];case 1:return n=a.sent(),this.logger.summary(F.A_SAVE_EDITED_MSG_DRAFT_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,vr.create("getEditedMessageDraft").check((function(t){return dc(t,e,X)})).result().next((function(){return n.svr.getEditedMessageDraft(l(n,lE,"m",fE).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_EDITED_MSG_DRAFT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_CLEAR_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,vr.create("clearEditedMessageDraft").check((function(t){return dc(t,e,X)})).result().next((function(){return n.svr.clearEditedMessageDraft(l(n,lE,"m",fE).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(F.A_CLEAR_EDITED_MSG_DRAFT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"createConversationListLoader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return r=(t=e||{}).conversationTypes,i=t.order,o=t.channelId,s=t.tagFilter,[4,vr.create("createConversationListLoader").isTypedArray("conversationTypes",r,(function(e){return ee(e,W)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("order",i,0,1).fail(k.INVALID_PARAMETER_ORDER).validate("channelId",o,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).check((function(e){if(s){var t=s.tagIds;e.isLimitedTypedArray("tagIds",t,20,mt,!1,0).fail(k.INVALID_PARAMETER_TAG_ID)}})).result().tryTrans(this.validateConnected).trans((function(){return new TE(n(n({},e),{tagFilter:n({},s)}),u.svr,u.ctx)}))];case 1:return[2,a.sent()]}}))}))}}),Object.defineProperty(r.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.conversationType,this.logger.info(F.A_SEND_UG_TYPING_T,JSON.stringify(e),t),[4,vr.create("sendUltraGroupTypingStatus").check((function(t){return dc(t,e,Q)})).validate("conversationType",r,(function(){return r===x.ULTRA_GROUP}),!0).fail(k.CONVERSATION_TYPE_NOT_SUPPORT).result().tryTrans(this.validateConnected).next((function(){return i.svr.sendUltraGroupTypingStatus(l(i,lE,"m",fE).call(i,e))}))];case 1:return n=a.sent(),this.logger.summary(F.A_SEND_UG_TYPING_R,n,t),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"sendTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SEND_TYPING_STATUS_T,JSON.stringify({identifier:e,typingContentType:t}),r),[4,vr.create("sendTypingStatus").check((function(t){return dc(t,e,W)})).isString("typingContentType",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var n={messageType:"RC:TypSts",content:{typingContentType:t}};return i.ctx.sendMessage(e,n,r)}))];case 1:return n=a.sent(),this.logger.summary(F.A_SEND_TYPING_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"sendSyncReadStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,o=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SYNC_READ_STATUS_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,vr.create("sendSyncReadStatusMessage").check((function(t){return dc(t,e,W)})).isNumber("timestamp",t,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(n){return i(o,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return n.serverSaveUnread?[2,Tr(k.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN)]:1===n.sesDriven?[2,this.svr.updateConversationReadTime(e,t)]:(i={messageType:Re.SYNC_READ_STATUS,content:{lastMessageSendTime:t},directionalUserIdList:dr(e.conversationType,[this.ctx.userId])},[4,this.ctx.sendMessage(e,i,r)]);case 1:return[2,a.sent().wipe()]}}))}))}))];case 1:return n=s.sent(),this.logger.summary(F.A_SYNC_READ_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_CLEAR_UNREAD_COUNT_T,JSON.stringify(e),t),[4,vr.create("clearUnreadCount").check((function(t){return dc(t,e,Q)})).result().tryTrans((function(){return n.checkAuthed(e.conversationType!==x.ULTRA_GROUP)})).tryTrans((function(e){return e.serverSaveUnread?Tr(k.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN):Ir()})).next((function(){return i(n,void 0,void 0,(function(){return a(this,(function(t){return e.conversationType!==x.ULTRA_GROUP||this.svr.ugSynced?[2,this.svr.clearConversationUnreadCount(l(this,lE,"m",fE).call(this,e))]:[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_CLEAR_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_CLEAR_ALL_UNREAD_COUNT_T,null,e),[4,vr.create("clearAllUnreadCount").result().tryTrans(this.validateLogin).tryTrans((function(e){return e.serverSaveUnread?Tr(k.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN):Ir()})).next((function(){return i(r,void 0,void 0,(function(){return a(this,(function(e){return[2,this.svr.clearAllSGUnreadCount()]}))}))}))];case 1:return t=n.sent(),this.logger.summary(F.A_CLEAR_ALL_UNREAD_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(r.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_CLEAR_UNREAD_COUNT_BY_TIME_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,vr.create("clearUnreadCountByTimestamp").check((function(t){return dc(t,e,W)})).isTimestamp("timestamp",t).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).tryTrans((function(e){return e.serverSaveUnread?Tr(k.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN):Ir()})).next((function(){return i.svr.clearUnreadCountByTimestamp(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_CLEAR_UNREAD_COUNT_BY_TIME_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SEND_READ_RECEIPT_REQ_T,JSON.stringify({identifier:e,messageUId:t}),r),[4,vr.create("sendReadReceiptRequest").check((function(t){return dc(t,e,Z)})).isNotEmptyString("messageUId",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(){var n={messageType:Re.READ_RECEIPT_REQUEST,content:{messageUId:t}};return i.ctx.sendMessage(e,n,r)}))];case 1:return n=a.sent(),this.logger.summary(F.A_SEND_READ_RECEIPT_REQ_R,n,r),[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageUId:t,timestamp:r}),n),[4,vr.create("sendReadReceiptMessage").check((function(t){return dc(t,e,z)})).isNotEmptyString("messageUId",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("timestamp",r,1,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var i={messageType:Re.READ_RECEIPT,content:{messageUId:t,lastMessageSendTime:r,type:1}};return o.ctx.sendMessage(e,i,n)}))];case 1:return i=a.sent(),this.logger.summary(F.A_SEND_READ_RECEIPT_R,i,n),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,o=this;return a(this,(function(l){switch(l.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageList:t}),r),[4,vr.create("sendReadReceipt").check((function(t){return dc(t,e,Z)})).fail(k.INVALID_PARAMETER_TARGET_ID).check((function(e){At(t)&&!Object.keys(t).some((function(r){var n=t[r];return e.isLimitedTypedArray("messageList",n,Number.MAX_SAFE_INTEGER,mt,!0).isFailed}))||e.setFailed(k.MSG_LIMIT_ERROR)})).result().tryTrans(this.validateConnected).next((function(n){return i(o,void 0,void 0,(function(){var i,o,l;return a(this,(function(a){switch(a.label){case 0:return 0!==(i=n.grpRRVer||0)&&1!==i?[2,Tr(k.READ_RECEIPT_ERROR)]:1===i?(o=[],Object.keys(t).forEach((function(e){o.push.apply(o,u([],s(t[e]),!1))})),[2,this.svr.sendReadReceiptV2(e.targetId,o,e.channelId)]):(l={receiptMessageDic:t},[4,this.ctx.sendMessage(e,{messageType:Re.READ_RECEIPT_RESPONSE,content:l},r)]);case 1:return[2,a.sent().wipe()]}}))}))}))];case 1:return n=l.sent(),this.logger.summary(F.A_SEND_READ_RECEIPT_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_MSG_READER_T,JSON.stringify({targetId:e,messageUId:t,channelId:r}),n),[4,vr.create("getMessageReader").validate("targetId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isNotEmptyString("messageUId",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return i(s,void 0,void 0,(function(){return a(this,(function(i){return 1!==n.grpRRVer?[2,Tr(k.READ_RECEIPT_ERROR)]:[2,this.svr.getMessageReader(e,t,r||"")]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_GET_MSG_READER_R,o,n),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SEND_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,endMsgUid:t,startMsgUid:r}),n),[4,vr.create("sendReadReceiptMessageV4").check((function(t){return dc(t,e,W)})).isNotEmptyString("endMsgUid",t,!0).fail(k.INVALID_PARAMETER_END_MESSAGE_UID).isNotEmptyString("startMsgUid",r).fail(k.INVALID_PARAMETER_START_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(n){return i(s,void 0,void 0,(function(){return a(this,(function(i){return 3!==n.grpRRVer?[2,Tr(k.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.sendReadReceiptMessageV4(e,r||"",t)]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_SEND_READ_RECEIPT_V4_R,o,n),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,o=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,messageUId:t}),r),[4,vr.create("getMessageReadReceiptV4").check((function(t){return dc(t,e,Z)})).isNotEmptyString("messageUId",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return i(o,void 0,void 0,(function(){return a(this,(function(n){return 3!==r.grpRRVer?[2,Tr(k.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.getMessageReadReceiptV4(e,t)]}))}))}))];case 1:return n=s.sent(),this.logger.summary(F.A_GET_READ_RECEIPT_V4_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,o=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_BATCH_GET_READ_RECEIPT_INFO_V4_T,JSON.stringify({conversation:e,messageUIds:t}),r),[4,vr.create("batchGetMessageReadReceiptInfoV4").check((function(t){return dc(t,e,Z)})).isTypedArray("messageUIds",t,mt,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return i(o,void 0,void 0,(function(){return a(this,(function(n){return 3!==r.grpRRVer?[2,Tr(k.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}))];case 1:return n=s.sent(),this.logger.summary(F.A_BATCH_GET_READ_RECEIPT_INFO_V4_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T,JSON.stringify({options:e}),t),[4,vr.create("getConversationsIncludingRobots").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,2,(function(e){return[x.PRIVATE,x.SYSTEM].includes(e)}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var t=n(n({},e),{topPriority:!!e.topPriority});return i.svr.getConversationsIncludingRobots(t)}))];case 1:return r=a.sent(),this.logger.summary(F.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"markRemoteConversationAsRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_MARK_REMOTE_CONVERSATION_AS_READ_T,JSON.stringify(e),t),[4,vr.create("markRemoteConversationAsRead").check((function(t){return dc(t,e,q)})).result().tryTrans(this.validateConnected).tryTrans((function(e){return e.serverSaveUnread?Ir():Tr(k.SERVER_RECORD_UNREAD_COUNT_DISABLED)})).next((function(){if(e.conversationType===x.ULTRA_GROUP)return n.svr.clearConversationUnreadCount(l(n,lE,"m",fE).call(n,e));var r={lastMessageSendTime:n.ctx.serverTime},i={messageType:Re.SYNC_READ_STATUS,content:r,directionalUserIdList:dr(e.conversationType,[n.ctx.userId])};return n.svr.markRemoteConversationAsRead(e,i,t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_MARK_REMOTE_CONVERSATION_AS_READ_R,r,t),[2,r.wipe()]}}))}))}}),r}(dE);lE=new WeakSet,cE=function(e){var t;return!!(2&((null===(t=this.ctx.naviInfo)||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e},fE=function(e){return e.conversationType!==x.ULTRA_GROUP?e:n(n({},e),{channelId:l(this,lE,"m",cE).call(this,e.channelId)})};var RE,mE,yE,AE,OE,SE,NE,CE,PE,ME,LE,wE,UE,DE,GE=function(e){function r(t,r,n,o){var s=this,u=un();return u.setLogReader((function(e,t,r,n){return i(s,void 0,void 0,(function(){return a(this,(function(e){return[2,{logs:[]}]}))}))})),u.setLogWriter((function(e){o(e)})),s=e.call(this,t,r,n,u)||this}return t(r,e),Object.defineProperty(r.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return 0}}),Object.defineProperty(r.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),r}(en),VE=0,jE=Date.now(),kE=function(e){var t=Date.now();return jE!==t&&(jE=t,VE=0),[e,window.__RCCppContextBridge__.process.pid,t,VE++].join("__")},xE=function(){return i(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,Tr(k.NOT_SUPPORT,"Not support")]}))}))},FE=function(){function e(e,t){var r,n=this;RE.add(this),Object.defineProperty(this,"_initOptions",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),mE.set(this,void 0),yE.set(this,void 0),AE.set(this,!1),Object.defineProperty(this,"_resolveMaps",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"loadConversationList",{enumerable:!0,configurable:!0,writable:!0,value:xE}),Object.defineProperty(this,"batchGetMessageReadReceiptInfoV4",{enumerable:!0,configurable:!0,writable:!0,value:xE}),Object.defineProperty(this,"getRealtimeConversations",{enumerable:!0,configurable:!0,writable:!0,value:xE}),Object.defineProperty(this,"getRealtimeConTotalUnreadCount",{enumerable:!0,configurable:!0,writable:!0,value:xE}),Object.defineProperty(this,"clearRealtimeConUnreadCount",{enumerable:!0,configurable:!0,writable:!0,value:xE}),Object.defineProperty(this,"removeRealtimeConversations",{enumerable:!0,configurable:!0,writable:!0,value:xE}),Object.defineProperty(this,"batchGetRealtimeConUnreadCount",{enumerable:!0,configurable:!0,writable:!0,value:xE});var i=t,a=function(e){return n._send2Main("onReceiveRendererLog",e)},o=c(this,yE,new GE(i.appkey,"IMLib","IM",a),"f");c(this,mE,a,"f"),o.setOutputLevel(i.logOutputLevel);var l=window.__RCCppContextBridge__.ipcRenderer;l.on("__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",(function(t,r){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var o=e[r];if(o){switch(r){case"ultraGroupEnable":c(n,AE,!0,"f");break;case"onNaviDataChange":n._cache.naviInfo=i[0];break;case"onRTCDataChange":i[0]=new Uint8Array(i[0]);break;case"onConnected":c(n,AE,!1,"f"),n._cache=i[1];break;case"onSuspend":c(n,AE,!1,"f"),n._setConnectionStatus(he.SUSPENDED);break;case"onDisconnected":c(n,AE,!1,"f"),n._setConnectionStatus(he.DISCONNECTED);break;case"onConnecting":n._setConnectionStatus(he.CONNECTING)}o.apply(void 0,u([],s(i),!1))}else n.logger.error(F.L_UNSUPPORT_NTF_FROM_MAIN_E,r)})),l.on("__RC_CHANNEL_RESULT_FROM_MAIN__",(function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var a=n._resolveMaps[t];a&&(delete n._resolveMaps[t],a.apply(void 0,u([],s(r),!1)))})),i.httpInMainProcess&&(go.httpReq=this.sendHTTPRequest.bind(this)),l.send("__RC_INNER_COMMAND_INIT__",{navigators:i.navigators,areaCode:i.areaCode,logServerUrl:i.logServerUrl,environment:i.environment,enableReadReceiptStorage:i.enableReadReceiptStorage,useNaviV2:null!==(r=i.useNaviV2)&&void 0!==r&&r}),this._cache=this._callMainSync("getMainProcessCache")}return Object.defineProperty(e.prototype,"chat",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"chatroom",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userSettings",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataHosting",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"logger",{get:function(){return l(this,yE,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ugSynced",{get:function(){return l(this,AE,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._cache.connectionStatus=e,e===he.DISCONNECTED&&(this._cache.crtUserId="")}}),Object.defineProperty(e.prototype,"sendHTTPRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._callMain("sendHTTPRequest",e)}}),Object.defineProperty(e.prototype,"_callMain",{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];var i=window.__RCCppContextBridge__.ipcRenderer;return new Promise((function(n){var a=kE(e);t._resolveMaps[a]=n,i.send.apply(i,u(["__RC_CHANNEL_CALL_MAIN__",a,e],s(r),!1))}))}}),Object.defineProperty(e.prototype,"_send2Main",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];(t=window.__RCCppContextBridge__.ipcRenderer).send.apply(t,u(["__RC_CHANNEL_SEND_2_MAIN__",e],s(r),!1))}}),Object.defineProperty(e.prototype,"_callMainSync",{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(t=window.__RCCppContextBridge__.ipcRenderer).sendSync.apply(t,u(["__RC_CHANNEL_CALL_MAIN_SYNC__",e],s(r),!1))}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"refetchNaviInfo")}}),Object.defineProperty(e.prototype,"naviInfo",{get:function(){return this._cache.naviInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new GE(this.appkey,e,t,l(this,mE,"f"))}}),Object.defineProperty(e.prototype,"connectionStatus",{get:function(){return this._cache.connectionStatus},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"usingCppEngine",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){return a(this,(function(i){return[2,l(this,RE,"m",OE).call(this,"connect",e,t,r,n)]}))}))}}),Object.defineProperty(e.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._send2Main("reportSDKInfo",e)}}),Object.defineProperty(e.prototype,"connectedTime",{get:function(){return this._cache.connectedTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getHistoryMessage",e,t,r)}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getContinuousMessages",e,t)}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getHistoryMessagesByObjectNames",e,t)}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"deleteRemoteMessage",e,t)}}),Object.defineProperty(e.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"recallMsg",e,t)}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"deleteRemoteMessageByTimestamp",e,t)}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getTopConversationList",e,t,r)}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getUnreadConversationList",e,t)}}),Object.defineProperty(e.prototype,"getConversationListByPageIndex",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getConversationListByPageIndex",e,t)}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getAllConversationList",e,t)}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getConversationListByTimestamp",e,t)}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getUntaggedConversationListByPage",e,t,r)}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getConversation",e)}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"batchDeleteConversations",e)}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getTotalUnreadCount",e,t,r)}}),Object.defineProperty(e.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getConversationUnreadCount",e)}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getTotalUnreadCountByLevels",e,t,r)}}),Object.defineProperty(e.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"clearConversationUnreadCount",e)}}),Object.defineProperty(e.prototype,"markRemoteConversationAsRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"markRemoteConversationAsRead",e,t,r)}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getFirstUnreadMessage",e)}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getFirstUnreadMessageDigest",e)}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"saveTextMessageDraft",e,t)}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getTextMessageDraft",e)}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"clearTextMessageDraft",e)}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return l(this,RE,"m",OE).call(this,"batchSetConversationToTop",e,t,r,n)}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"batchSetConversationNotificationLevel",e,t)}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"batchSetConversationTranslateStrategy",e,t)}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this,a=["sendMessageBefore",Date.now(),Math.floor(Math.random()*Date.now())].join("_");return n&&(this._resolveMaps[a]=function(e){try{n(e)}catch(e){i.logger.error(F.L_CALLBACK_E,JSON.stringify({error:null==e?void 0:e.stack,pos:"sendMsgBefore"}))}}),l(this,RE,"m",OE).call(this,"sendMessage",e,t,r,a)}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"sendReadReceiptV2",e,t,r)}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getMessageReader",e,t,r)}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"sendReadReceiptMessageV4",e,t,r)}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getMessageReadReceiptV4",e,t)}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"updateConversationReadTime",e,t)}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return[2,l(this,RE,"m",OE).call(this,"disconnect",e,t)]}))}))}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._send2Main("registerMessageType",e,t)}}),Object.defineProperty(e.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return l(this,RE,"m",OE).call(this,"joinChatroom",e,t,r,n)}}),Object.defineProperty(e.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"quitChatroom",e,t)}}),Object.defineProperty(e.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getChatroomInfo",e,t,r)}}),Object.defineProperty(e.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return l(this,RE,"m",OE).call(this,"getChatroomHistoryMessages",e,t,r,n)}}),Object.defineProperty(e.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"setChatroomEntry",e,t,r)}}),Object.defineProperty(e.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"setChatroomEntries",e,t)}}),Object.defineProperty(e.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"removeChatroomEntry",e,t,r)}}),Object.defineProperty(e.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"removeChatroomEntries",e,t)}}),Object.defineProperty(e.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getChatroomEntry",e,t)}}),Object.defineProperty(e.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getAllChatroomEntries",e)}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return l(this,RE,"m",OE).call(this,"getFileToken",e,t,r,n,i,a)}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return l(this,RE,"m",OE).call(this,"getFileUrl",e,t,r,n)}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"setUserStatus",e)}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getUserStatus",e)}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"clearConversations",e,t)}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"addToBlacklist",e)}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"removeFromBlacklist",e)}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"getBlacklist")}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getBlacklistStatus",e)}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"insertMessage",e,t)}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"batchInsertMessage",e,t)}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getLocalMessageCount",e)}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"deleteLocalMessages",e)}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"deleteLocalMessagesByTimestamp",e,t,r)}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"batchClearLocalMessagesByTimestamp",e)}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"batchClearRemoteHistoryMessages",e,t)}}),Object.defineProperty(e.prototype,"clearLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"clearLocalMessages",e)}}),Object.defineProperty(e.prototype,"getMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getMessage",e)}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"setMessageContent",e,t,r)}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"setMessageSearchField",e,t,r)}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return l(this,RE,"m",OE).call(this,"searchConversationByContent",e,t,r,n)}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"searchConversationByContentWithAllChannel",e,t,r)}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"searchMessagesWithParams",e)}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getUnreadMentionedMessages",e)}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getUnreadMentionedCount",e)}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return l(this,RE,"m",OE).call(this,"getMessagesAroundTimestamp",e,t,r,n)}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"setMessageSentStatus",e,t)}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"setMessageReceivedStatus",e,t)}}),Object.defineProperty(e.prototype,"updateMessageReceiptStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return l(this,RE,"m",OE).call(this,"updateMessageReceiptStatus",e,t,r,n)}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"clearUnreadCountByTimestamp",e,t)}}),Object.defineProperty(e.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,l(this,RE,"m",OE).call(this,"clearAllSGUnreadCount")]}))}))}}),Object.defineProperty(e.prototype,"serverTime",{get:function(){return Date.now()-this._cache.deltaTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deviceId",{get:function(){return this._cache.deviceId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._cache.crtUserId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"bindRTCRoomForChatroom",e)}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){switch(a.label){case 0:return i=Array.prototype.slice.call(new Uint8Array(n)),[4,l(this,RE,"m",OE).call(this,"rtcSignaling",e,t,r,i)];case 1:return[2,a.sent().trans((function(e){return new Uint8Array(e)}))]}}))}))}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"rtcPing",e,t,r)}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"createTag",e)}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"removeTag",e)}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"updateTag",e)}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"getTagList")}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"addTagForConversations",e,t)}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"removeTagForConversations",e,t)}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"removeTagsForConversation",e,t)}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getConversationListByTag",e,t,r)}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getUnreadCountByTag",e,t)}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"setConversationStatusInTag",e,t,r)}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getTagsForConversation",e)}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"clearLocalData")}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"setCallInfo",e,t,r)}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"getAllUnreadMentionedCount")}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getUltraGroupList",e)}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"getBlockedUGList")}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getBlockedConversationList",e)}}),Object.defineProperty(e.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this.sendMessage(e,t,r,n)}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getConversationNotificationLevel",e)}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"setConversationTypeNotificationLevel",e,t)}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getConversationTypeNotificationLevel",e)}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getUGUnreadCountForAllChannels",e,t,r)}}),Object.defineProperty(e.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"setUGDefaultNotificationLevel",e,t,r)}}),Object.defineProperty(e.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getUGDefaultNotificationLevel",e,t)}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getUGUnreadInfoList",e)}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,l(this,RE,"m",OE).call(this,"getOSInfo")]}))}))}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){return e=window.__RCCppContextBridge__.process,t={title:e.title,pid:e.pid,ppid:e.ppid,platform:e.platform,arch:e.arch,uptime:e.uptime(),cpuUsage:e.cpuUsage(),memoryUsage:e.memoryUsage(),resourceUsage:e.resourceUsage()},[2,Ir(t)]}))}))}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,l(this,RE,"m",OE).call(this,"getMainProcessInfo")]}))}))}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"setProxy",e)}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"getProxy")}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"testProxy",e,t)}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"setCheckDuplicateMessage",e)}}),Object.defineProperty(e.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"setCheckChatRoomDuplicateMessage",e)}}),Object.defineProperty(e.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._send2Main("setNetwork",e,t)}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"subscribeUser",e,t,r)}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"unSubscribeUser",e,t)}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getSubscribeUserList",e,t,r)}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getSubscribeUserStatus",e,t)}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getConversations",e)}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"updateMyUserProfile",e)}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getUserProfiles",e)}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"getMyUserProfile")}}),Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"updateMyUserProfileVisibility",e)}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"getMyUserProfileVisibility")}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"searchUserProfileByUniqueId",e)}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){return a(this,(function(i){return[2,l(this,RE,"m",OE).call(this,"createGroup",e,t,r,n)]}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"updateGroupInfo",e,t,r)}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getGroupsInfo",e)}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"kickGroupMembers",e,t,r)}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"quitGroup",e,t)}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"dismissGroup",e)}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return l(this,RE,"m",OE).call(this,"transferGroupOwner",e,t,r,n)}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"setGroupManagers",e,t,r)}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getGroupMembersByRole",e,t,r)}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getGroupMembers",e,t)}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return l(this,RE,"m",OE).call(this,"setGroupMemberInfo",e,t,r,n)}}),Object.defineProperty(e.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"searchGroupMembers",e,t,r)}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"joinGroup",e)}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"inviteUsersToGroup",e,t)}}),Object.defineProperty(e.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"memberInviteResponse",e)}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getGroupApplications",e,t,r)}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getJoinedGroupsByRole",e,t)}}),Object.defineProperty(e.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"searchJoinedGroups",e,t)}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getJoinedGroups",e)}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"setGroupRemark",e,t)}}),Object.defineProperty(e.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"setGroupFollows",e,t,r)}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getGroupFollows",e)}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"addFriend",e,t,r)}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"deleteFriends",e,t)}}),Object.defineProperty(e.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"acceptFriendRequest",e)}}),Object.defineProperty(e.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"refuseFriendRequest",e,t)}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"setFriendInfo",e,t,r)}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"checkFriends",e,t)}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getFriends",e,t)}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getFriendApplications",e,t,r)}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getFriendsInfo",e)}}),Object.defineProperty(e.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"searchFriendsInfo",e)}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"setFriendAddPermission",e)}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"getFriendAddPermission")}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,l(this,RE,"m",OE).call(this,"setNotificationQuietHoursWithSetting",e)]}))}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,l(this,RE,"m",OE).call(this,"removeNotificationQuietHoursSetting")]}))}))}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,l(this,RE,"m",OE).call(this,"getNotificationQuietHoursSetting")]}))}))}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"getStatsUrlList")}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"sendReadReceiptResponseV5",e,t)}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getMessageReadReceiptInfoV5ByIdentifiers",e)}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getMessagesReadReceiptUsersByPageV5",e,t,r)}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"getMessagesReadReceiptByUsersV5",e,t,r)}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"requestSpeechToTextForMessage",e)}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"setMessageSpeechToTextVisible",e,t)}}),Object.defineProperty(e.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return l(this,RE,"m",OE).call(this,"translateWithParams",e,t,r,n)}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"setTranslationLanguage",e)}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"getTranslationLanguage")}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"setAutoTranslateEnabled",e)}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"getAutoTranslateEnabled")}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"modifyMessageWithParams",e)}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u=this;return a(this,(function(a){return i=function(e,t){var r=[e,Date.now(),Math.floor(Math.random()*Date.now())].join("_");return u._resolveMaps[r]=function(r){try{t(r)}catch(t){u.logger.error(F.L_CALLBACK_E,JSON.stringify({error:null==t?void 0:t.stack,pos:e}))}},r},o=i("localMessageBlock",n),s=i("remoteMessageBlock",r),[2,l(this,RE,"m",OE).call(this,"refreshReferenceMessageWithParams",e,t,s,o)]}))}))}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"syncRemoteConversations")}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"sendUltraGroupTypingStatus",e)}}),Object.defineProperty(e.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getRemoteMessagesByUIds",e,t)}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getUGUnreadMentionedDigest",e)}}),Object.defineProperty(e.prototype,"deleteLocalUGMessagesForAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"deleteLocalUGMessagesForAllChannel",e,t)}}),Object.defineProperty(e.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return l(this,RE,"m",OE).call(this,"updateUGMessageExpansion",e,t,r)}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getUGFirstUnreadMessageDigest",e)}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getSubscribeUsersOnlineStatus",e)}}),Object.defineProperty(e.prototype,"saveEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"saveEditedMessageDraft",e,t)}}),Object.defineProperty(e.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getEditedMessageDraft",e)}}),Object.defineProperty(e.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"clearEditedMessageDraft",e)}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return l(this,RE,"m",OE).call(this,"getUnreadMentionMeConversationList",e,t)}}),Object.defineProperty(e.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return l(this,RE,"m",OE).call(this,"getAllRobots")}}),Object.defineProperty(e.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return l(this,RE,"m",OE).call(this,"getConversationsIncludingRobots",e)}}),Object.defineProperty(e.prototype,"appkey",{get:function(){return this._initOptions.appkey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){}}),e}();function BE(e){return n({},e)}mE=new WeakMap,yE=new WeakMap,AE=new WeakMap,RE=new WeakSet,OE=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=Ar(),a=i.promise,o=i.resolve,l=kE(e);return this._resolveMaps[l]=function(e){var t=e.code,r=e.msg,n=e.data;o(Er.from(t,r,n))},(t=window.__RCCppContextBridge__.ipcRenderer).send.apply(t,u(["__RC_CHANNEL_CALL_MAIN__",l,e],s(r),!1)),a};var HE=function(){function e(e){var t,r,i=this;SE.add(this),Object.defineProperty(this,"_token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_pluginContextQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_pluginInstanseMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_engine",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"appkey",{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,"sse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chatroom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataHosting",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_versionInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_typingInfo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[Re.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),t[Re.INTERCEPT]=this._processInterceptMessage.bind(this),t)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(r={},r[Re.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),r[Re.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),r[Re.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),r)}),Object.defineProperty(this,"_watcher",{enumerable:!0,configurable:!0,writable:!0,value:{message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connection:void 0,expansion:void 0,tag:void 0,userSettingsSynced:void 0,userSettingsChanged:void 0,conversationStatusSynced:void 0,robotsSynced:void 0,conversationTagChanged:void 0,pullFinished:void 0,readReceiptReceived:void 0,messageReceiptRequest:void 0,messageReceiptResponse:void 0,typingState:void 0,messageBlocked:void 0,ultraGroupEnable:void 0,sgRelationsSynced:void 0,operateStatus:void 0,ultraGroupMessageExpansionUpdated:void 0,ultraGroupMessageRecalled:void 0,ultraGroupChannelChangeType:void 0,ultraGroupChannelUserKicked:void 0,ultraGroupChannelDelete:void 0,userGroupStatus:void 0,messageReadReceipt:void 0,syncReadStatus:void 0,subscribedUserStatusChange:void 0,subscribedRelationChange:void 0,syncSubscribedUserStatusFinished:void 0,ownUserProfileChanged:void 0,groupOperation:void 0,groupInfoChanged:void 0,groupMemberInfoChanged:void 0,groupApplicationEvent:void 0,groupRemarkChangedSync:void 0,groupFollowsChangedSync:void 0,friendAdd:void 0,friendDelete:void 0,friendApplicationStatusChanged:void 0,friendCleared:void 0,friendInfoChangedSync:void 0,databaseOpened:void 0,databaseUpgradeWillStart:void 0,databaseUpgrading:void 0,databaseUpgradeDidComplete:void 0,readReceiptResponseV5:void 0,speechToTextResponse:void 0,translateResponse:void 0,messagesModified:void 0,messageModifiedSyncCompleted:void 0}}),Object.defineProperty(this,"_typingInternalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"_typingExpireTime",{enumerable:!0,configurable:!0,writable:!0,value:2e3}),Object.defineProperty(this,"_typingChangedList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_rtcListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._options=n({},e),this.appkey=this._options.appkey,this._options.typingExpireTime&&(this._options.typingExpireTime<2e3?this._typingExpireTime=2e3:this._options.typingExpireTime>6e3?this._typingExpireTime=6e3:this._typingExpireTime=this._options.typingExpireTime),this._options.navigators=this._options.navigators.map((function(e){return e.replace(/\/$/g,"")}));var a={onRTCDataChange:this._rtcDataChange.bind(this),onConnected:function(){return i._onConnectionStatusChange(he.CONNECTED)},onConnecting:this._onConnectionStatusChange.bind(this,he.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,he.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,he.DISCONNECTED),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),conversationTag:this._conversationTagListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),userSettingsSynced:this._onUserSettingsSynced.bind(this),userSettingsChanged:this._onUserSettingsChanged.bind(this),conversationStatusSynced:this._onConversationStatusSynced.bind(this),robotsSynced:this._onRobotsSynced.bind(this),pullFinished:this._pullFinishedListener.bind(this),ultraGroupEnable:this._ultraGroupEnableListener.bind(this),sgRelationsSynced:this._sgRelationsSyncedListener.bind(this),operateStatus:this._operateStatusListener.bind(this),ultraGroupMessageExpansionUpdated:this._ultraGroupMessageExpansionUpdatedListener.bind(this),ultraGroupMessageRecalled:this._ultraGroupMessageRecalledListener.bind(this),callInfo:this._callInfoListener.bind(this),ultraGroupChannelChangeType:this._ultraGroupChannelChangeTypeListener.bind(this),ultraGroupChannelUserKicked:this._ultraGroupChannelUserKickedListener.bind(this),ultraGroupChannelDelete:this._ultraGroupChannelDeleteListener.bind(this),onNaviDataChange:this._naviDataChange.bind(this),userGroupStatus:this._userGroupStatusListener.bind(this),messageReadReceipt:this._messageReadReceipt.bind(this),syncReadStatus:this._syncReadStatus.bind(this),subscribedUserStatusChange:this._subscribedUserStatusChange.bind(this),subscribedRelationChange:this._subscribedRelationChange.bind(this),syncSubscribedUserStatusFinished:this._syncSubscribedUserStatusFinished.bind(this),ownUserProfileChanged:this._ownUserProfileChanged.bind(this),groupOperation:this._groupOperation.bind(this),groupInfoChanged:this._groupInfoChanged.bind(this),groupMemberInfoChanged:this._groupMemberInfoChanged.bind(this),groupApplicationEvent:this._groupApplicationEvent.bind(this),groupRemarkChangedSync:this._groupRemarkChangedSync.bind(this),groupFollowsChangedSync:this._groupFollowsChangedSync.bind(this),friendAdd:this._friendAdd.bind(this),friendDelete:this._friendDelete.bind(this),friendApplicationStatusChanged:this._friendApplicationStatusChanged.bind(this),friendCleared:this._friendCleared.bind(this),friendInfoChangedSync:this._friendInfoChangedSync.bind(this),databaseOpened:this._databaseOpened.bind(this),databaseUpgradeWillStart:this._databaseUpgradeWillStart.bind(this),databaseUpgrading:this._databaseUpgrading.bind(this),databaseUpgradeDidComplete:this._databaseUpgradeDidComplete.bind(this),readReceiptResponseV5:this._readReceiptResponseV5.bind(this),speechToTextResponse:this._speechToTextResponse.bind(this),translateResponse:this._translateResponse.bind(this),messagesModified:this._messagesModified.bind(this),messageModifiedSyncCompleted:this._messageModifiedSyncCompleted.bind(this)},o=Vt();this._engine=o?new FE(a,this._options):new nE(a,this._options),this.logger=this._engine.logger,this._options.eventLoopBlockingCheck&&ln.start(this.logger),this.sse=new tc(this,o),this.chatroom=new _E(this._engine,this._engine.chatroom),this.dataHosting=new EE(this._engine,this._engine.dataHosting),this.chat=new vE(this._engine,this._engine.chat)}return Object.defineProperty(e,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this._context)return this._context.logger.warn(F.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(F.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime,runtime:go.tag})),this._context.logger.warn(F.L_IMSDK_VER_O,JSON.stringify({commitId:"fe5f206be1fb01bdf131cbbd3ce6dd60ae8f52d0",version:"5.36.0-alpha.1"}));var r=this._context._engine;return go.setNetworkStatusListener(r.setNetwork.bind(r)),this._context}}),Object.defineProperty(e,"getContext",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._context}}),Object.defineProperty(e.prototype,"getOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._options}}),Object.defineProperty(e,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(F.A_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))}}),Object.defineProperty(e.prototype,"install",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId();if(this.logger.info(F.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),r),this._pluginInstanseMap[e.tag])return this.logger.warn(F.L_INSTALL_PLUGIN_R,"repeat install",r),this._pluginInstanseMap[e.tag];var n="RCRTC"===e.tag?new ac(this):new ic(this),i=null;try{if(!e.verify(go))return null;i=e.setup(n,go,t)}catch(e){this.logger.error(F.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,r)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(n),this._pluginInstanseMap[e.tag]=i),i}}),Object.defineProperty(e.prototype,"getAppSettings",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.validateLogin().trans((function(e){return new iE(e)}))}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;this.logger.warn(F.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(n=(r=this._watcher).connection)||void 0===n||n.call(r,e,t),this._pluginContextQueue.forEach((function(r){var n;null===(n=r.onconnectionstatechange)||void 0===n||n.call(r,e,t)}))}}),Object.defineProperty(e.prototype,"_processTypingStatusMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._addTypingInfo(BE(e)),!!this._watcher.typingState}}),Object.defineProperty(e.prototype,"_processInterceptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||"",blockType:e.content.interceptType,blockedMessageUId:e.content.msgUId,extra:e.content.extra};if(e.conversationType===x.ULTRA_GROUP){var r=e.content.sourceType;if(t.sourceType=r,(r===pe.MSG_EXPANSION||r===pe.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(F.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(t),!0}}),Object.defineProperty(e.prototype,"_processReadReceiptMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.readReceiptReceived&&this._watcher.readReceiptReceived({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.content.lastMessageSendTime,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptRequestMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)}}),Object.defineProperty(e.prototype,"_processReadReceiptResponseMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,n=this._engine.userId;r&&Array.isArray(r[n])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,r[n])}}),Object.defineProperty(e.prototype,"_messageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i,a,o,s=this;if(!(null===(i=(n=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(n,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(BE(e))}catch(e){return s.logger.error(F.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(o=(a=this._watcher).message)||void 0===o||o.call(a,BE(e),t,r),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=[],a=[],o=[Re.READ_RECEIPT,Re.READ_RECEIPT_REQUEST,Re.READ_RECEIPT_RESPONSE];e.forEach((function(e){var s=n._messageReceiver(e,t,r);s&&o.includes(s.messageType)?a.push(s):s&&i.push(s)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(F.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),a.length&&a.forEach((function(e){n._messageProccessor[e.messageType]&&n._messageProccessor[e.messageType](e)}))}}),Object.defineProperty(e.prototype,"_chatroomInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).chatroomState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_conversationInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).conversationState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_expansionInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).expansion)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_tagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_onUserSettingsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userSettingsSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onUserSettingsChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userSettingsChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onConversationStatusSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).conversationStatusSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_onRobotsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;null===(n=(r=this._watcher).robotsSynced)||void 0===n||n.call(r,e,t)}}),Object.defineProperty(e.prototype,"_conversationTagListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_typingStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).typingState)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_pullFinishedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_MessageBlockedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageBlocked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_callInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._pluginContextQueue.forEach((function(r){try{r.onCallInfo&&r.onCallInfo(e)}catch(e){t.logger.warn(F.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"_ultraGroupEnableListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).ultraGroupEnable)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_sgRelationsSyncedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).sgRelationsSynced)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_operateStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).operateStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageExpansionUpdatedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupMessageRecalledListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupMessageRecalled)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelChangeTypeListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelChangeType)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelUserKickedListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ultraGroupChannelDeleteListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).ultraGroupChannelDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_userGroupStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).userGroupStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messageReadReceipt)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).syncReadStatus)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedUserStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedUserStatusChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_subscribedRelationChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).subscribedRelationChange)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_syncSubscribedUserStatusFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(F.L_SYNC_SUBSCRIBED_USER_STATUS_FINISHED_S),null===(r=(t=this._watcher).syncSubscribedUserStatusFinished)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_ownUserProfileChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(F.L_OWN_USER_PROFILE_CHANGED_S),null===(r=(t=this._watcher).ownUserProfileChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupOperation)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupMemberInfoChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupApplicationEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupApplicationEvent)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupRemarkChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupRemarkChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_groupFollowsChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).groupFollowsChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendAdd)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendDelete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendApplicationStatusChanged)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendCleared",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendCleared)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_friendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).friendInfoChangedSync)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_naviDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._pluginContextQueue.forEach((function(t){var r;null===(r=t.onnavidatachange)||void 0===r||r.call(t,e)}))}}),Object.defineProperty(e.prototype,"_databaseOpened",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;null===(n=(r=this._watcher).databaseOpened)||void 0===n||n.call(r,e,t)}}),Object.defineProperty(e.prototype,"_databaseUpgradeWillStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;this.logger.info(F.L_DB_UPGRATE_START_S),null===(t=(e=this._watcher).databaseUpgradeWillStart)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"_databaseUpgrading",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(F.L_DB_UPGRATING_S,e),null===(r=(t=this._watcher).databaseUpgrading)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_databaseUpgradeDidComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;this.logger.info(F.L_DB_UPGRATE_COMPLETE_S),null===(r=(t=this._watcher).databaseUpgradeDidComplete)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_readReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).readReceiptResponseV5)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_speechToTextResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).speechToTextResponse)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_translateResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messagesModified",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;null===(r=(t=this._watcher).messagesModified)||void 0===r||r.call(t,e)}}),Object.defineProperty(e.prototype,"_messageModifiedSyncCompleted",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;null===(t=(e=this._watcher).messageModifiedSyncCompleted)||void 0===t||t.call(e)}}),Object.defineProperty(e.prototype,"assignWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;Object.keys(this._watcher).forEach((function(r){if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];t._watcher[r]=Ot(n)||At(n)?n:void 0}}))}}),Object.defineProperty(e.prototype,"_resetWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))}}),Object.defineProperty(e.prototype,"_addTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.senderUserId,r=e.conversationType,n=e.targetId,i=e.content,a=e.channelId,o=i.typingContentType,s=a||"",u="".concat(r,"#").concat(n,"#").concat(s);this._typingInfo[u]||(this._typingInfo[u]=[]);var l=this._typingInfo[u].findIndex((function(e){return e.userId===t}));l>=0&&this._typingInfo[u][l].messageType===o?this._typingInfo[u][l].timestamp=Date.now():(l>=0&&this._typingInfo[u].splice(l,1),this._typingInfo[u].push({userId:t,messageType:o,timestamp:Date.now()}),this._typingChangedList.includes(u)||this._typingChangedList.push(u),this._startCheckTypingInfo())}}),Object.defineProperty(e.prototype,"_startCheckTypingInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var r=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===r||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))}}),Object.defineProperty(e.prototype,"_notifyTypingChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(this._typingChangedList.length>0){var t=this._typingChangedList.map((function(t){return{conversationType:Number(t.split("#")[0]),targetId:t.split("#")[1],channelId:t.split("#")[2],list:e._typingInfo[t]||[]}}));this._typingStatusListener(t),this._typingChangedList=[]}0===Object.keys(this._typingInfo).length&&(clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1)}}),Object.defineProperty(e.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.connectedTime}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.serverTime}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.deviceId}}),Object.defineProperty(e.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setPushConfig(e)}}),Object.defineProperty(e.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.userId}}),Object.defineProperty(e.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.connectionStatus}}),Object.defineProperty(e.prototype,"_validateUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return 1!==e.userProfile?Tr(k.RC_USER_PROFILE_SERVICE_UNAVAILABLE):Ir(e)}}),Object.defineProperty(e.prototype,"validateConnected",{get:function(){var e=this;return function(){return e.checkAuthed(!1)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"validateLogin",{get:function(){var e=this;return function(){return e.checkAuthed(!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checkAuthed",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.connectionStatus===he.CONNECTED||this._engine.userId&&e?Ir(this._engine.naviInfo):Tr(k.RC_NET_UNAVAILABLE)}}),Object.defineProperty(e.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){switch(i.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,l(this,SE,"m",NE).call(this,e,t,r)];case 1:return n=i.sent(),this.logger.summary(F.A_CONNECT_R,n,r,void 0,(function(e){return{userId:e}})),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return this.logger.info(F.A_DISCONNECT_O,JSON.stringify({closeDB:e,disablePush:t})),[2,l(this,SE,"m",CE).call(this,e,t)]}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_RECONNECT_T,JSON.stringify({reconnectKickEnable:e}),t),[4,l(this,SE,"m",NE).call(this,this.token,!!e,t)];case 1:return r=n.sent(),this.logger.summary(F.A_RECONNECT_R,r,t,void 0,(function(e){return{userId:e}})),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"_channelIdConvert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(e!==x.ULTRA_GROUP)return t;var r=this.getNaviInfoFromCache();return!!(2&((null==r?void 0:r.ugDriven)||0))&&!t?"RCDefault":t}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.naviInfo}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,a){void 0===i&&(i=[]),void 0===a&&(a=!1);var o,s,u,l={isPersited:t,isCounted:r,searchProps:i,isStatusMessage:a};o=e,s=l,(u=mn.get(o))&&!u.isCustom&&console.warn("Builtin message type '".concat(o,"' cannot be registered")),s.isStatusMessage&&(s.isCounted=s.isPersited=!1),mn.set(o,n(n({},s),{isCustom:!0})),this._engine.registerMessageType(e,l)}}),Object.defineProperty(e.prototype,"_rtcDataChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;null===(t=this._rtcListener)||void 0===t||t.call(this,e)}}),Object.defineProperty(e.prototype,"registerRTCSignalingListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._rtcListener=e}}),Object.defineProperty(e.prototype,"sendMessageByPlugin",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.L_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),n),[4,l(this,SE,"m",ME).call(this,e,t,n,r)];case 1:return i=a.sent(),this.logger.summary(F.L_SEND_MSG_R,i,n,void 0,(function(t){return{messageId:t.messageId,messageUId:t.messageUId,messageType:t.messageType,identifier:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),n),[4,l(this,SE,"m",ME).call(this,e,t,n,r)];case 1:return i=a.sent(),this.logger.summary(F.A_SEND_MSG_R,i,n,void 0,(function(t){return{messageId:t.messageId,messageUId:t.messageUId,messageType:t.messageType,identifier:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"updateMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_UPDATE_MSG_EXPANSION_T,JSON.stringify({expansion:e,attrs:t}),r),[4,vr.create("updateMessageExpansion").check((function(r){return _c(r,t,Object.keys(e||{}))})).check((function(r){return hc(r,e,t.canIncludeExpansion)})).result().tryTrans(this.validateConnected).next((function(){var i={put:e,mid:t.messageUId},a=n(n({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===x.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(a,i,t.sentTime):l(o,SE,"m",wE).call(o,a,i,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_UPDATE_MSG_EXPANSION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_MSG_EXPANSION_T,JSON.stringify({keys:e,attrs:t}),r),[4,vr.create("removeMessageExpansion").isLimitedTypedArray("keys",e,20,(function(e){return"string"==typeof e&&/^[A-Za-z0-9_=+-]+$/.test(e)}),!0).fail(k.INVALID_PARAMETER_KEYS).check((function(r){return _c(r,t,e)})).result().tryTrans(this.validateConnected).next((function(){var i={del:e,mid:t.messageUId},a=n(n({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===x.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(a,i,t.sentTime):l(o,SE,"m",wE).call(o,a,i,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_REMOVE_MSG_EXPANSION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeAllMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_ALL_MSG_EXPANSION_T,JSON.stringify({attrs:e}),t),[4,vr.create("removeAllMessageExpansion").check((function(t){return _c(t,e,[])})).check((function(t){e.conversationType!==x.ULTRA_GROUP&&t.setFailed(k.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){var r={clear:1,mid:e.messageUId},a=n(n({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)});return e.conversationType===x.ULTRA_GROUP?i._engine.chat.updateUGMessageExpansion(a,r,e.sentTime):l(i,SE,"m",wE).call(i,a,r,t)}))];case 1:return r=a.sent(),this.logger.summary(F.A_REMOVE_ALL_MSG_EXPANSION_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var o,s=this;return a(this,(function(u){switch(u.label){case 0:return n=n||this.logger.createTraceId(),this.logger.info(F.A_SEND_READ_RECEIPT_V2_T,JSON.stringify({targetId:e,messageUIds:t,channelId:r}),n),[4,vr.create("sendReadReceiptV2").validate("targetId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("messageUIds",t,Number.MAX_SAFE_INTEGER,mt,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return i(s,void 0,void 0,(function(){return a(this,(function(i){return 1!==n.grpRRVer?[2,Tr(k.READ_RECEIPT_ERROR,"The read receipt switch is not on, please call the sendMessage method.")]:[2,this._engine.chat.sendReadReceiptV2(e,t,r)]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_SEND_READ_RECEIPT_V2_R,o,n),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"_destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e=this;return a(this,(function(t){switch(t.label){case 0:return ln.stop(),this._resetWatcher(),this._engine.destroy(),go.removeNetworkStatusListener(),[4,l(this,SE,"m",CE).call(this)];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(F.L_CALLBACK_E,null==t?void 0:t.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},[2]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c=this;return a(this,(function(a){switch(a.label){case 0:return r=null==t?void 0:t.timestamp,n=null==t?void 0:t.count,i=null==t?void 0:t.order,o=null==t?void 0:t.messageType,s=this.logger.createTraceId(),this.logger.info(F.A_GET_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),s),[4,vr.create("getHistoryMessage").check((function(t){return dc(t,e,K)})).isLimitedInteger("timestamp",r,0,Number.MAX_SAFE_INTEGER).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(k.INVALID_PARAMETER_ORDER).isLimitedInteger("count",n,1,100).fail(k.INVALID_PARAMETER_COUNT).isNotEmptyString("messageType",o).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:r||0,count:n||20,order:i||0,messageType:o||""},a=l(c,SE,"m",PE).call(c,e);return c._engine.getHistoryMessage(a,t,!0)}))];case 1:return u=a.sent(),this.logger.summary(F.A_GET_HISTORY_MSG_R,u,s),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_CONTINUOUS_MSGS_T,JSON.stringify({conversation:e,options:t}),r),[4,vr.create("getContinuousMessages").check((function(t){return dc(t,e,J)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(k.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(k.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateLogin).next((function(){var r=l(i,SE,"m",PE).call(i,e),n={timestamp:t.timestamp||0,count:t.count||20,order:t.order||0,messageType:""};return i._engine.chat.getContinuousMessages(r,n)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_CONTINUOUS_MSGS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_HIS_MSGS_BY_OBJ_NAMES_T,JSON.stringify({conversation:e,option:t}),r),[4,vr.create("getHistoryMessagesByObjectNames").check((function(t){return dc(t,e,Q)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(k.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(k.INVALID_PARAMETER_ORDER).isTypedArray("messageTypes",null==t?void 0:t.messageTypes,mt).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateLogin).next((function(){var r=l(i,SE,"m",PE).call(i,e),n={timestamp:t.timestamp||0,count:t.count||20,order:t.order||0,messageTypes:t.messageTypes||[]};return i._engine.chat.getHistoryMessagesByObjectNames(r,n)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_HIS_MSGS_BY_OBJ_NAMES_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,o=this;return a(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_TOP_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e,channelId:t}),r),[4,vr.create("getTopConversationList").isTypedArray("conversationTypes",e,(function(e){return ee(e,q)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",t,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(r){return i(o,void 0,void 0,(function(){var n;return a(this,(function(i){return(n=Up(r))&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTopConversationList(n,e,t)]}))}))}))];case 1:return n=s.sent(),this.logger.summary(F.A_GET_TOP_CONVERSATION_LIST_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UNREAD_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e}),t),[4,vr.create("getUnreadConversationList").isTypedArray("conversationTypes",e,(function(e){return ee(e,q)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).next((function(t){return i(n,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=Up(t))&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getUnreadConversationList(r,e)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_UNREAD_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_BLOCKED_CONVERSATION_LIST_T,"",e),[4,vr.create("getBlockedConversationList").result().tryTrans(this.validateConnected).next((function(e){return i(r,void 0,void 0,(function(){var t;return a(this,(function(r){return(t=Up(e))&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getBlockedConversationList(t)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_BLOCKED_CONVERSATION_LIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByPageIndex",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r=this;return a(this,(function(n){switch(n.label){case 0:return[4,vr.create("getConversationListByPageIndex").isInteger("index",e,!0).fail(k.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",t,!0).fail(k.INVALID_PARAMETER_LIMIT).result().tryTrans(this.validateLogin).next((function(){return r._engine.chat.getConversationListByPageIndex(e,t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_ALL_CONVERSATION_LIST_T,JSON.stringify({channelId:e}),t),[4,vr.create("getAllConversationList").validate("channelId",e,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateLogin).next((function(t){return i(n,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=Up(t))&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getAllConversationList(r,e)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_ALL_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_CONVERSATION_LIST_OLD_T,JSON.stringify(e),t),[4,Vt()&&"string"!=typeof(null==e?void 0:e.channelId)?this.getAllConversationList(null==e?void 0:e.channelId):this.getConversationListByTimestamp(e)];case 1:return r=n.sent(),this.logger.summary(F.A_GET_CONVERSATION_LIST_OLD_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_CONVERSATION_LIST_BY_TIME_T,JSON.stringify(e),t),[4,vr.create("getConversationListByTimestamp").isObject("params",e,!0).fail(k.CONVER_GET_ERROR,"params must be an object").isInteger("startTime",null==e?void 0:e.startTime,!0).fail(k.INVALID_PARAMETER_START_TIME).isInteger("count",null==e?void 0:e.count,!0).fail(k.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==e?void 0:e.order,0,1).fail(k.INVALID_PARAMETER_ORDER).validate("channelId",null==e?void 0:e.channelId,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,(function(e){return ee(e,q)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans((function(){return n.checkAuthed(Vt())})).next((function(t){return i(n,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=Up(t))&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getConversationListByTimestamp(e,r)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_CONVERSATION_LIST_BY_TIME_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_CONVERSATION_T,JSON.stringify(e),t),[4,vr.create("getConversation").check((function(t){return dc(t,e,K)})).result().tryTrans(this.validateConnected).next((function(){var t=l(n,SE,"m",PE).call(n,e);return n._engine.chat.getConversation(t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_CONVERSATION_R,r,t,e),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_CONVERSATION_T,JSON.stringify(e),r),[4,vr.create("removeConversation").check((function(t){return dc(t,e,q)})).result().tryTrans(this.validateConnected).next((function(){var r=l(i,SE,"m",PE).call(i,e);return i._engine.chat.batchDeleteConversations({identifiers:[r],deleteRemotely:!!t,deleteMessages:!1})}))];case 1:return n=a.sent(),this.logger.summary(F.A_REMOVE_CONVERSATION_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,o,s,u=this;return a(this,(function(c){switch(c.label){case 0:return t=null==e?void 0:e.identifiers,r=!!(null==e?void 0:e.deleteRemotely),n=!!(null==e?void 0:e.deleteMessages),o=this.logger.createTraceId(),this.logger.info(F.A_BATCH_DEL_CONVERS_T,JSON.stringify({identifiers:t,deleteRemotely:r,deleteMessages:n}),o),[4,vr.create("batchDeleteConversations").isLimitedArray("identifiers",t,100,!0,1).fail(k.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans(this.validateConnected).next((function(){return i(u,void 0,void 0,(function(){var e,i=this;return a(this,(function(a){return 0===(e=t.filter((function(e){return fc("",e,q).result().isOk})).map((function(e){return l(i,SE,"m",PE).call(i,e)}))).length?[2,Ir()]:[2,this._engine.chat.batchDeleteConversations({identifiers:e,deleteRemotely:r,deleteMessages:n})]}))}))}))];case 1:return s=c.sent(),this.logger.summary(F.A_BATCH_DEL_CONVERS_R,s,o),[2,s.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelType,n=this.logger.createTraceId(),this.logger.info(F.A_GET_UG_LIST_T,JSON.stringify({targetId:t,channelType:r}),n),[4,vr.create("getUltraGroupList").validate("targetId",t,Ut).fail(k.INVALID_PARAMETER_TARGET_ID).isNumberEnum("channelType",r,te).fail(k.INVALID_PARAMETER_CHANNEL_TYPE).result().tryTrans(this.validateLogin).next((function(){return i(s,void 0,void 0,(function(){return a(this,(function(t){return this._engine.chat.ugSynced?[2,this._engine.chat.getUltraGroupList(e)]:[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_GET_UG_LIST_R,o,n),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_BLOCKED_UG_LIST_T,"",e),[4,vr.create("getBlockedUGList").result().tryTrans(this.validateConnected).next((function(){return i(r,void 0,void 0,(function(){return a(this,(function(e){return this._engine.chat.ugSynced?[2,this._engine.chat.getBlockedUGList()]:[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_BLOCKED_UG_LIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UNREAD_COUNT_T,JSON.stringify(e),t),[4,vr.create("getUnreadCount").check((function(t){return dc(t,e,Q)})).result().tryTrans(this.validateLogin).next((function(){return i(n,void 0,void 0,(function(){var t;return a(this,(function(r){return e.conversationType!==x.ULTRA_GROUP||this._engine.chat.ugSynced?(t=l(this,SE,"m",PE).call(this,e),[2,this._engine.chat.getConversationUnreadCount(t)]):[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_UNREAD_COUNT_R,r,t,void 0,(function(e){return{unreadCount:e}})),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_TOTAL_UNREAD_COUNT_T,JSON.stringify({conversationTypes:e,includeMuted:t,channelId:r}),n),[4,vr.create("getTotalUnreadCount").validate("channelId",r,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",e,(function(e){return ee(e,Q)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin).next((function(n){return i(s,void 0,void 0,(function(){var i,o;return a(this,(function(a){return!(i=Up(n))&&e&&e.includes(x.ULTRA_GROUP)?[2,Tr(k.METHOD_NOT_SUPPORT)]:(o=e&&e.length>0?e:$(i?q:W)).includes(x.ULTRA_GROUP)&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCount(o,!!t,r)]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_GET_TOTAL_UNREAD_COUNT_R,o,n,void 0,(function(e){return{unreadCount:e}})),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T,JSON.stringify({conversationTypes:e,levels:t,isMentioned:r}),n),[4,vr.create("getTotalUnreadCountByLevels").isLimitedTypedArray("conversationTypes",e,20,(function(e){return ee(e,q)}),!0).fail(k.CONVERSATION_TYPE_NOT_SUPPORT).isTypedArray("levels",t,Mt,!0).fail(k.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return i(s,void 0,void 0,(function(){return a(this,(function(n){return e.includes(x.ULTRA_GROUP)&&!this._engine.chat.ugSynced?[2,Tr(k.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCountByLevels(e,t,r)]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R,o,n,void 0,(function(e){return{unreadCount:e}})),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_FIRST_UNREAD_MEG_T,JSON.stringify(e),t),[4,vr.create("getFirstUnreadMessage").check((function(t){return dc(t,e,Q)})).result().tryTrans(this.validateLogin).next((function(){var t=l(n,SE,"m",PE).call(n,e);return n._engine.chat.getFirstUnreadMessage(t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_FIRST_UNREAD_MSG_R,r,t,e),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,vr.create("getFirstUnreadMessageDigest").check((function(t){return dc(t,e,Q)})).result().tryTrans(this.validateLogin).next((function(){var t=l(n,SE,"m",PE).call(n,e);return n._engine.chat.getFirstUnreadMessageDigest(t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_FIRST_UNREAD_MSG_DIGEST_R,r,t,e),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:t}),r),[4,vr.create("batchSetConversationNotificationLevel").isLimitedTypedArray("conversations",e,20,(function(e){return!fc("batchSetConversationNotificationLevel",e,q).isFailed}),!0,1).fail(k.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("notificationLevel",t,Te,!0).fail(k.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var r=e.map((function(e){return l(i,SE,"m",PE).call(i,e)}));return i._engine.chat.batchSetConversationNotificationLevel(r,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s,u,c,f=this;return a(this,(function(a){switch(a.label){case 0:return i=vr.create("batchSetConversationToTop"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return fc("batchSetConversationToTop",e,q).result().isOk}),!0,1).fail(k.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==x.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?Ir():Tr(k.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(s=this.logger.createTraceId(),u=e.map((function(e){return l(f,SE,"m",PE).call(f,e)})),this.logger.info(F.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:u,isTop:t,isUpdateTime:r,isCreateConversation:n}),s),[4,this._engine.chat.batchSetConversationToTop(u,t,r,n)]):[2,o.wipe()];case 1:return c=a.sent(),this.logger.summary(F.A_BATCH_SET_CONVERSATION_TO_TOP_R,c,s),[2,c]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return r=vr.create("batchSetConversationTranslateStrategy"),(n=r.isLimitedTypedArray("conversations",e,20,(function(e){return fc("",e,q).result().isOk}),!0,1).fail(k.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("strategy",t,Un,!0).fail(k.INVALID_PARAMETER_TRANSLATE_STRATEGY).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),this.logger.info(F.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T,JSON.stringify({conversations:e,strategy:t}),i),o=e.map((function(e){return l(u,SE,"m",PE).call(u,e)})),[4,this._engine.chat.batchSetConversationTranslateStrategy(o,t)]):[2,n.wipe()];case 1:return s=a.sent(),this.logger.summary(F.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R,s,i),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r=this;return a(this,(function(n){switch(n.label){case 0:return[4,fc("saveTextMessageDraft",e,Q).isString("draft",t,!0).fail(k.INVALID_PARAMETER_DRAFT).result().tryTrans(this.validateLogin).next((function(){var n=l(r,SE,"m",PE).call(r,e);return r._engine.saveTextMessageDraft(n,t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t=this;return a(this,(function(r){switch(r.label){case 0:return[4,fc("getTextMessageDraft",e,Q).result().tryTrans(this.validateLogin).next((function(){var r=l(t,SE,"m",PE).call(t,e);return t._engine.getTextMessageDraft(r)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t=this;return a(this,(function(r){switch(r.label){case 0:return[4,fc("clearTextMessageDraft",e,Q).result().tryTrans(this.validateLogin).next((function(){var r=l(t,SE,"m",PE).call(t,e);return t._engine.clearTextMessageDraft(r)}))];case 1:return[2,r.sent()]}}))}))}}),Object.defineProperty(e.prototype,"recallMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),n={conversation:e,messageUId:null==t?void 0:t.messageUId},this.logger.info(F.A_RECALL_MESSAGE_T,JSON.stringify(n),r),[4,vr.create("recallMessage").check((function(t){return dc(t,e,K)})).isNotEmptyString("messageUId",t.messageUId,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",t.disableNotification).fail(k.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",t.pushConfig).fail(k.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(k.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,Ut,!1,1).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){var r=l(o,SE,"m",PE).call(o,e);return o._engine.recallMsg(r,t)}))];case 1:return i=a.sent(),this.logger.summary(F.A_RECALL_MESSAGE_R,i,r,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_DEL_REMOTE_MSGS_T,JSON.stringify({conversation:e,messages:t}),r),[4,vr.create("deleteRemoteMessage").check((function(t){return dc(t,e,q)})).isLimitedTypedArray("messages",t,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,r=e.sentTime,n=e.messageDirection;return mt(t)&&(n===be.SEND||n===be.RECEIVE)&&Tt({min:0})(r)}),!0).fail(k.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=l(i,SE,"m",PE).call(i,e);return i._engine.chat.deleteRemoteMessage(r,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_DEL_REMOTE_MSGS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_DEL_REMOTE_MSGS_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,vr.create("deleteRemoteMessageByTimestamp").check((function(t){return dc(t,e,K)})).isInteger("timestamp",t,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var r=l(i,SE,"m",PE).call(i,e);return i._engine.chat.deleteRemoteMessageByTimestamp(r,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_DEL_REMOTE_MSGS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,o,s){return i(this,void 0,void 0,(function(){var u=this;return a(this,(function(l){return[2,vr.create("getFileToken").isNumberEnum("fileType",e,H,!0).fail(k.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(k.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).validate("httpMethod",r,(function(e){return"POST"===e||"PUT"===e})).fail(k.BIZ_ERROR_INVALID_PARAMETER,"`httpMethod` is invalid").isString("queryString",n).fail(k.BIZ_ERROR_INVALID_PARAMETER,"`queryString` is invalid").isString("url",o).fail(k.BIZ_ERROR_INVALID_PARAMETER,"`url` is invalid").isInteger("size",s).fail(k.BIZ_ERROR_INVALID_PARAMETER,"`size` is invalid").result().tryTrans(this.validateConnected).next((function(l){return i(u,void 0,void 0,(function(){var i,u;return a(this,(function(a){switch(a.label){case 0:return i=l.uploadServer||"",u=l.ossConfig||"",[4,this._engine.getFileToken(e,t,r,n,o,s)];case 1:return[2,a.sent().trans((function(e){return Object.assign(e,{qiniu:i,ossConfig:e.ossConfig||u})}))]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,n,o){return i(this,void 0,void 0,(function(){var i=this;return a(this,(function(a){switch(a.label){case 0:return[4,vr.create("getFileUrl").isNumberEnum("fileType",e,H,!0).fail(k.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(k.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).isString("saveName",o).fail(k.INVALID_PARAMETER_SAVE_NAME).isNumberEnum("serverType",n,r,!0).fail(k.INVALID_PARAMETER_SERVER_TYPE).result().tryTrans(this.validateConnected).next((function(){return i._engine.getFileUrl(e,n,t,o||"")}))];case 1:return[2,a.sent()]}}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_ADD_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,vr.create("createTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(k.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.createTag(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_ADD_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_TAG_T,JSON.stringify({tagId:e}),t),[4,vr.create("removeTag").isLimitedString("tagId",e,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeTag(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_REMOVE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_UPDATE_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,vr.create("updateTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(k.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.updateTag(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_UPDATE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_TAGS_T,"",e),[4,this.validateLogin().next((function(){return r._engine.getTagList()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_TAGS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return(r=vr.create("addTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isTypedArray("conversations",t,(function(e){return fc("",e,W).result().isOk}),!0).fail(k.INVALID_PARAMETER_CONVERSATIONS).isLimitedInteger("conversations",null==t?void 0:t.length,1,1e3,!0).fail(k.CONVER_OUT_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(n=t.map((function(e){return l(s,SE,"m",PE).call(s,e)})),i=this.logger.createTraceId(),this.logger.info(F.A_ADD_TAG_FOR_CONVERSATIONS_T,JSON.stringify({tagId:e,conversations:n}),i),[4,this._engine.chat.addTagForConversations(e,n)]):[2,r.wipe()];case 1:return o=a.sent(),this.logger.summary(F.A_ADD_TAG_FOR_CONVERSATIONS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return(r=vr.create("removeTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isLimitedTypedArray("conversations",t,1e3,(function(e){return fc("",e,W).result().isOk}),!0).fail(k.INVALID_PARAMETER_CONVERSATIONS).result().tryTrans(this.validateConnected)).isOk?(n=t.map((function(e){return l(s,SE,"m",PE).call(s,e)})),i=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_TAG_FOR_CONVERS_T,JSON.stringify({tagId:e,conversations:n}),i),[4,this._engine.chat.removeTagForConversations(e,n)]):[2,r.wipe()];case 1:return o=a.sent(),this.logger.summary(F.A_REMOVE_TAG_FOR_CONVERS_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o;return a(this,(function(a){switch(a.label){case 0:return(r=fc("removeTagsForConversation",e,W).isTypedArray("tagIds",t,(function(e){return bt(e)}),!0).fail(k.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected)).isOk?(n=this.logger.createTraceId(),i=l(this,SE,"m",PE).call(this,e),this.logger.info(F.A_REMOVE_TAGS_FOR_CONVER_T,JSON.stringify({tagIds:t,conversation:i}),n),[4,this._engine.chat.removeTagsForConversation(i,t)]):[2,r.wipe()];case 1:return o=a.sent(),this.logger.summary(F.A_REMOVE_TAGS_FOR_CONVER_R,o,n),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){return(n=vr.create("getConversationListByTag").isLimitedString("tagId",e,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isInteger("count",r,!0).fail(k.CONVER_OUT_LIMIT_ERROR).isLimitedInteger("startTime",t,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_START_TIME).result().tryTrans((function(){return o.checkAuthed(Vt())}))).isOk?(i=r<=0?20:Math.min(r,1e3),[2,this._engine.chat.getConversationListByTag(e,t,i)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_UNREAD_COUNT_BY_TAG_T,JSON.stringify({tagId:e,containMuted:t}),r),[4,vr.create("getUnreadCountByTag").isLimitedString("tagId",e,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isBoolean("containMuted",t,!0).fail(k.INVALID_PARAMETER_CONTAIN_MUTED).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.getUnreadCountByTag(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_UNREAD_COUNT_BY_TAG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return(n=fc("setConversationStatusInTag",t,W).isLimitedString("tagId",e,1,10,!0).fail(k.INVALID_PARAMETER_TAG_ID).isBoolean("isTop",null==r?void 0:r.isTop,!0).fail(k.INVALID_PARAMETER_IS_TOP).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),o=l(this,SE,"m",PE).call(this,t),this.logger.info(F.A_SET_CONVER_TO_TOP_IN_TAG_T,JSON.stringify({tagId:e,conversation:o,isTop:r.isTop}),i),[4,this._engine.chat.setConversationStatusInTag(e,o,r)]):[2,n.wipe()];case 1:return s=a.sent(),this.logger.summary(F.A_SET_CONVER_TO_TOP_IN_TAG_R,s,i),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i;return a(this,(function(a){switch(a.label){case 0:return(t=fc("getTagsForConversation",e,W).result().tryTrans(this.validateLogin)).isOk?(r=this.logger.createTraceId(),n=l(this,SE,"m",PE).call(this,e),this.logger.info(F.A_GET_TAGS_OF_CONVERSATION_T,JSON.stringify(n),r),[4,this._engine.chat.getTagsForConversation(n)]):[2,t.wipe()];case 1:return i=a.sent(),this.logger.summary(F.A_GET_TAGS_OF_CONVERSATION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UNREAD_MENTIONED_COUNT_T,JSON.stringify(e),t),[4,vr.create("getUnreadMentionedCount").check((function(t){return dc(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){return i(n,void 0,void 0,(function(){var t;return a(this,(function(r){return e.conversationType!==x.ULTRA_GROUP||this._engine.chat.ugSynced?(t=l(this,SE,"m",PE).call(this,e),[2,this._engine.chat.getUnreadMentionedCount(t)]):[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_UNREAD_MENTIONED_COUNT_R,r,t),[2,r.trans(Nc)]}}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_ALL_UNREAD_MENTIONED_COUNT_T,"",e),[4,this.validateLogin().next((function(){return r._engine.chat.getAllUnreadMentionedCount()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_ALL_UNREAD_MENTIONED_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupMessageListByMessageUId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u,c=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),n=t instanceof Array?t.map((function(e){return null==e?void 0:e.messageUId})):[],i=null==e?void 0:e.conversationType,o=null==e?void 0:e.targetId,s=null==e?void 0:e.channelId,this.logger.info(F.A_GET_UG_MSGS_BY_UID_T,JSON.stringify({conversationType:i,targetId:o,channelId:s,messageUIds:n}),r),[4,vr.create("getUltraGroupMessageListByMessageUId").check((function(t){return dc(t,e,q)})).isTypedArray("messages",t,(function(e){return mt(null==e?void 0:e.messageUId)}),!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messages",null==t?void 0:t.length,1,20,!0).fail(k.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=l(c,SE,"m",PE).call(c,e);return c._engine.chat.getRemoteMessagesByUIds(r,t.map((function(e){return e.messageUId})))}))];case 1:return u=a.sent(),this.logger.summary(F.A_GET_UG_MSGS_BY_UID_R,u,r,u.isOk?{list:u.data.map((function(e){return e.messageUId}))}:void 0),[2,u.trans((function(e){var t={};return e.forEach((function(e){t[e.messageUId]=e})),t}))]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T,JSON.stringify({targetId:e,levels:r,isGetMentioned:t}),n),[4,vr.create("getUGUnreadCountForAllChannels").validate("targetId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).check((function(e){e.isTypedArray("levels",r,(function(t){return!e.isNumberEnum("",t,Te,!0).isFailed}))})).fail(k.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return i(s,void 0,void 0,(function(){return a(this,(function(n){return this._engine.chat.ugSynced?[2,this._engine.chat.getUGUnreadCountForAllChannels(e,r||[],t)]:[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return o=u.sent(),this.logger.summary(F.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R,o,n),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelId,n=null==e?void 0:e.sentTime,i=null==e?void 0:e.count,o=this.logger.createTraceId(),this.logger.info(F.A_GET_UG_UNREAD_MENTIONED_DIGEST_T,JSON.stringify({targetId:t,channelId:r,sentTime:n,count:i}),o),[4,vr.create("getUGUnreadMentionedDigest").validate("targetId",t,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).isLimitedInteger("count",i,1,50,!0).fail(k.INVALID_PARAMETER_COUNT).isLimitedInteger("sentTime",n,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return e.channelId=u._channelIdConvert(x.ULTRA_GROUP,r),u._engine.chat.getUGUnreadMentionedDigest(e)}))];case 1:return s=a.sent(),this.logger.summary(F.A_GET_UG_UNREAD_MENTIONED_DIGEST_R,s,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,o=this;return a(this,(function(s){switch(s.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,vr.create("getUGFirstUnreadMessageDigest").validate("targetId",null==e?void 0:e.targetId,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==e?void 0:e.channelId,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){return i(o,void 0,void 0,(function(){var t;return a(this,(function(r){return this._engine.chat.ugSynced?(t=l(this,SE,"m",PE).call(this,n(n({},e),{conversationType:x.ULTRA_GROUP})),[2,this._engine.chat.getUGFirstUnreadMessageDigest(t)]):[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=s.sent(),this.logger.summary(F.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UG_UNREAD_INFO_LIST_T,JSON.stringify({targetIds:e}),t),[4,vr.create("getUGUnreadInfoList").isLimitedTypedArray("targetIds",e,20,(function(e){return Ut(e)}),!0,1).fail(k.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateLogin).next((function(){return i(n,void 0,void 0,(function(){var t;return a(this,(function(r){return this._engine.chat.ugSynced?(t=new Set(e),[2,this._engine.chat.getUGUnreadInfoList(Array.from(t))]):[2,Tr(k.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_UG_UNREAD_INFO_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getOSInfo()}}),Object.defineProperty(e.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getProcessInfo()}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getMainProcessInfo()}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this;return this.validateConnected().next((function(){return n._engine.setCallInfo(e,t,r)}))}}),Object.defineProperty(e.prototype,"_validateSubDriven",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.subDriven,n=void 0===r?0:r;switch(t){case fe.ONLINE_STATUS:return 1&n?Ir(e):Tr(k.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);case fe.USER_PROFILE:return 2&n?Ir(e):Tr(k.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);default:return Tr(k.INVALID_PARAMETER_SUBSCRIBE_TYPE)}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t,expiry:r}),n),[4,vr.create("subscribeUser").isLimitedTypedArray("userIds",e,200,Ut,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,fe,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("expiry",r,60,2592e3,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_EXPIRY).result().tryTrans(this.validateConnected).tryTrans((function(e){return o._validateSubDriven(e,t)})).next((function(){return o._engine.subscribeUser(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_SUBSCRIBE_USER_STATUS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_UNSUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t}),r),[4,vr.create("unSubscribeUser").isLimitedTypedArray("userIds",e,200,Ut,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,fe,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_TYPE).result().tryTrans(this.validateConnected).tryTrans((function(e){return i._validateSubDriven(e,t)})).next((function(){return i._engine.unSubscribeUser(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_UNSUBSCRIBE_USER_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_SUBSCRIBE_USER_STATUS_LIST_T,JSON.stringify({subscribeType:e,count:t,offset:r}),n),[4,vr.create("getSubscribeUserList").isNumberEnum("subscribeType",e,fe,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("count",t,1,200,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE).isLimitedInteger("offset",r,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_OFFSET).result().tryTrans(this.validateConnected).tryTrans((function(t){return o._validateSubDriven(t,e)})).next((function(){return o._engine.getSubscribeUserList(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_GET_SUBSCRIBE_USER_STATUS_LIST_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_SUB_USERS_STATUS_T,JSON.stringify({subscribeType:e,userIds:t}),r),[4,vr.create("getSubscribeUserStatus").isNumberEnum("subscribeType",e,fe,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedTypedArray("userIds",t,200,Ut,!0).fail(k.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).result().tryTrans(this.validateConnected).tryTrans((function(t){return i._validateSubDriven(t,e)})).next((function(){return i._engine.getSubscribeUserStatus(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_SUB_USERS_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_SUB_USERS_ONLINE_STATUS_T,JSON.stringify({userIds:e}),t),[4,vr.create("getSubscribeUsersOnlineStatus").isLimitedTypedArray("userIds",e,200,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){return n._engine.getSubscribeUsersOnlineStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_SUB_USERS_ONLINE_STATUS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_UPDATE_MY_USER_PROFILE_T,JSON.stringify({profile:e}),t),[4,vr.create("updateMyUserProfile").isObject("profile",e,!0).check((function(t){var r=e.name,n=e.portraitUri,i=e.email,a=e.birthday,o=e.gender,u=e.location,l=e.role,c=e.level,f=e.extraProfile;t.isString("name",r).isString("portraitUri",n).isString("email",i).isString("birthday",a).isNumber("gender",o).isString("location",u).isNumber("role",l).isNumber("level",c).isObject("extraProfile",f),!t.isFailed&&f&&Object.entries(f).forEach((function(e){var r=s(e,2);r[0];var n=r[1];t.isString("extraProfile",n,!0)}))})).fail(k.INVALID_PARAMETER_USER_PROFILE).result().tryTrans(this.validateConnected).tryTrans((function(e){return i._validateUserProfile(e)})).next((function(){var t={};return["name","portraitUri","email","birthday","gender","location","role","level"].forEach((function(r){var n=e[r];void 0!==n&&(t[r]=n)})),e.extraProfile&&(t.extraProfile=n({},e.extraProfile)),i._engine.updateMyUserProfile(t)}))];case 1:return r=a.sent(),this.logger.summary(F.A_UPDATE_MY_USER_PROFILE_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_USER_PROFILES_T,JSON.stringify({userIds:e}),t),[4,vr.create("getUserProfiles").isLimitedTypedArray("userIds",e,100,Ut,!0).fail(k.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateLogin).tryTrans((function(e){return n._validateUserProfile(e)})).next((function(){return n._engine.getUserProfiles(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_USER_PROFILES_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_MY_USER_PROFILE_T,void 0,e),[4,vr.create("getMyUserProfile").result().tryTrans(this.validateConnected).tryTrans((function(e){return r._validateUserProfile(e)})).next((function(){return r._engine.getMyUserProfile()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_MY_USER_PROFILE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this._engine.chat.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_ADD_TO_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,vr.create("addToBlacklist").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.addToBlacklist(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_ADD_TO_BLACKLIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_FROM_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,vr.create("removeFromBlacklist").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeFromBlacklist(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_REMOVE_FROM_BLACKLIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_BLACKLIST_T,void 0,e),[4,vr.create("getBlacklist").result().tryTrans(this.validateConnected).next((function(){return r._engine.getBlacklist()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_BLACKLIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_BLACKLIST_STATUS_T,JSON.stringify({userId:e}),t),[4,vr.create("getBlacklistStatus").validate("userId",e,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.getBlacklistStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_BLACKLIST_STATUS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_INSERT_MSG_T,JSON.stringify({conversation:e,params:t}),r),[4,vr.create("insertMessage").check((function(t){return dc(t,e,Q)})).validate("senderUserId",t.senderUserId,Ut,!0).fail(k.INVALID_PARAMETER_USER_ID).isNotEmptyString("messageType",t.messageType,!0).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t.content,!0).fail(k.INVALID_PARAMETER_MESSAGE_CONTENT).isNumberEnum("messageDirection",t.messageDirection,be,!0).fail(k.INVALID_MESSAGE_DIRECTION).check((function(e){t.canIncludeExpansion&&t.expansion&&hc(e,t.expansion,!0)})).isTimestamp("sentTime",t.sentTime).fail(k.INVALID_PARAMETER_TIMESTAMP).isNumberEnum("sentStatus",t.sentStatus,se).fail(k.INVALID_PARAMETER_SENT_STATUS).isTypedArray("directedUserIds",t.directedUserIds,Ut).fail(k.INVALID_PARAMETER_USERIDLIST).isString("searchContent",t.searchContent).fail(k.SEARCH_PROPS_LIMIT_ERROR).result().tryTrans((function(){return cc(t.messageType,t.content)})).tryTrans(this.validateLogin).next((function(){var r=l(i,SE,"m",PE).call(i,e);return i._engine.insertMessage(r,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_INSERT_MSG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_BATCH_INSERT_MSGS_T,JSON.stringify({count:null==e?void 0:e.length,checkDuplicate:t}),r),i=vr.create(""),[4,vr.create("batchInsertMessage").isLimitedTypedArray("messages",e,500,(function(e){return"object"==typeof e&&(dc(i,e,Q),i.validate("senderUserId",e.senderUserId,Ut,!0).isNotEmptyString("messageType",e.messageType,!0).isObject("content",e.content,!0).isNumberEnum("messageDirection",e.messageDirection,be,!0).check((function(t){e.canIncludeExpansion&&e.expansion&&hc(t,e.expansion,!0)})).isTimestamp("sentTime",e.sentTime).isNumberEnum("sentStatus",e.sentStatus,se).isString("searchContent",e.searchContent).isNumber("receivedStatus",e.receivedStatus).isObject("receivedStatusInfo",e.receivedStatusInfo).isTypedArray("directedUserIds",e.directedUserIds,Ut),!i.isFailed)}),!0).fail(k.MSG_LIMIT_ERROR).result().tryTrans(this.validateLogin).next((function(){var r=e.map((function(e){return n(n({},e),{channelId:s._channelIdConvert(e.conversationType,e.channelId)})}));return s._engine.batchInsertMessage(r,t)}))];case 1:return o=a.sent(),this.logger.summary(F.A_BATCH_INSERT_MSGS_R,o,r),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_LOCAL_MSG_COUNT_T,JSON.stringify({conversation:e}),t),[4,vr.create("getMessageCount").check((function(t){return dc(t,e,Q)})).result().tryTrans(this.validateLogin).next((function(){var t=l(n,SE,"m",PE).call(n,e);return n._engine.getLocalMessageCount(t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_LOCAL_MSG_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_DELETE_LOCAL_MSGS_T,JSON.stringify({messageIds:e}),t),[4,vr.create("deleteLocalMessages").isTypedArray("messageIds",e,(function(e){return Number.isInteger(e)}),!0).fail(k.INVALID_PARAMETER_MESSAGE_ARRAY).result().tryTrans(this.validateLogin).next((function(){return n._engine.deleteLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_DELETE_LOCAL_MSGS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_DEL_LOCAL_MSGS_BY_TIME_T,JSON.stringify({conversation:e,timestamp:t,cleanSpace:r}),n),[4,vr.create("deleteLocalMessagesByTimestamp").check((function(t){return dc(t,e,Q)})).isTimestamp("timestamp",t,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){var n=l(o,SE,"m",PE).call(o,e);return o._engine.deleteLocalMessagesByTimestamp(n,t,!!r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_DEL_LOCAL_MSGS_BY_TIME_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,i=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T,JSON.stringify({options:e}),t),[4,vr.create("batchClearLocalMessagesByTimestamp").check((function(t){t.isLimitedTypedArray("options",e,20,(function(e){return dc(t,e,q),!t.isFailed&&Tt({min:0})(e.timestamp)})).fail(k.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return n(n({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)})}));return i._engine.batchClearLocalMessagesByTimestamp(t)}))];case 1:return r=a.sent(),this.logger.summary(F.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),r),[4,vr.create("batchClearRemoteHistoryMessages").isLimitedArray("options",e,20,!0,1).check((function(t){e.forEach((function(e){dc(t,e,q).isTimestamp("timestamp",null==e?void 0:e.timestamp)}))})).fail(k.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,void 0,!0).check((function(t){e.some((function(e){return e.conversationType===x.ULTRA_GROUP}))&&t.setFailed(k.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.batchClearRemoteHistoryMessages(e,!!t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_BATCH_CLEAR_REMOTE_MSG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_CLEAR_LOCAL_MSG_T,JSON.stringify({conversation:e}),t),[4,vr.create("clearLocalMessages").check((function(t){return dc(t,e,Q)})).result().tryTrans(this.validateLogin).next((function(){return n._engine.clearLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_CLEAR_LOCAL_MSG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),t),[4,vr.create("getLocalMessage").validate("messageId",e,(function(){return mt(e)||It(e)}),!0).fail(k.INVALID_PARAMETER_MESSAGE_ID).result().next((function(){return n._engine.getMessage(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_LOCAL_MESSAGE_R,r,t,{messageId:e}),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"_innerSetMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.setMessageContent(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SET_MSG_CONTENT_T,JSON.stringify({messageId:e,messageType:r}),n),[4,vr.create("setMessageContent").isInteger("messageId",e,!0).fail(k.INVALID_PARAMETER_MESSAGE_ID).isNotEmptyString("messageType",r,!0).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_CONTENT).result().tryTrans(this.validateLogin).next((function(){var n=JSON.stringify(t);return o._innerSetMessageContent(e,n,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_SET_MSG_CONTENT_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.setMessageSearchField(e,t,r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_E_SET_MSG_SENT_STATUS_T,JSON.stringify({messageId:e,sentStatus:t}),r),[4,vr.create("setMessageSentStatus").isInteger("messageId",e,!0).fail(k.INVALID_PARAMETER_MESSAGE_ID).isNumberEnum("sentStatus",t,se,!0).fail(k.INVALID_PARAMETER_SENT_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageSentStatus(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_E_SET_MSG_SENT_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_E_SET_MSG_RECEIVED_STATUS_T,JSON.stringify({messageId:e,receivedStatus:t}),r),[4,vr.create("setMessageReceivedStatus").isInteger("messageId",e,!0).fail(k.INVALID_PARAMETER_MESSAGE_ID).isInteger("receivedStatus",t,!0).fail(k.INVALID_PARAMETER_RECEIVED_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageReceivedStatus(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_E_SET_MSG_RECEIVED_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageStatusToRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return(r=fc("setMessageStatusToRead",e,W).isNumber("timestamp",t,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(n=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,s=e.channelId,this.logger.info(F.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),n),[4,this._engine.updateMessageReceiptStatus(i,o,t,s)]):[2,r.wipe()];case 1:return u=a.sent(),this.logger.summary(F.A_E_SET_MESSAGE_STATUS_TO_READ_R,u,n),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s;return a(this,(function(a){switch(a.label){case 0:return(i=vr.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(k.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return mt(e)})).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",r,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",n,(function(e){return ee(e,q)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(F.A_E_SEARCH_CONVERSATION_BY_CONTENT_T,JSON.stringify({keyword:e,messageTypes:t,channelId:r,conversationTypes:n}),o),[4,this._engine.chat.searchConversationByContent(e,t&&0!==t.length?t:[Re.TEXT,Re.FILE],r||"",n&&0!==n.length?n:$(q))]):[2,i.wipe()];case 1:return s=a.sent(),this.logger.summary(F.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,i,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[Re.TEXT,Re.FILE],r&&0!==r.length?r:$(q))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,o;return i(this,void 0,void 0,(function(){var i,s;return a(this,(function(a){switch(a.label){case 0:return(i=fc("searchMessages",e,Q).isLimitedString("keyword",null==t?void 0:t.keyword,0,1e3,!0).fail(k.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==t?void 0:t.limit,1,ft,!0).fail(k.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==t?void 0:t.offset,0,ft).fail(k.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==t?void 0:t.order,0,1,!0).fail(k.INVALID_PARAMETER_ORDER).isObject("timeRange",t.timeRange).validate("timeRange",t.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!It(t)||r&&!It(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(k.INVALID_PARAMETER_TIMESTAMP).isTypedArray("objectNames",null===(r=null==t?void 0:t.messageFilter)||void 0===r?void 0:r.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(k.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(o=null==t?void 0:t.messageFilter)||void 0===o?void 0:o.senderIds,Ut).fail(k.INVALID_PARAMETER_USER_ID).result().tryTrans((function(){return Vt()?Ir():Tr(k.NOT_SUPPORT,"Only support electron platform.")})).tryTrans(this.validateLogin)).isOk?(s=l(this,SE,"m",PE).call(this,e),[4,l(this,SE,"m",UE).call(this,n(n({},t),{conversationFilter:{conversationTypes:[s.conversationType],targetIds:[s.targetId],channelIds:"string"==typeof s.channelId?[s.channelId]:[]}}))]):[2,i.wipe()];case 1:return[2,a.sent().orSync((function(){return Ir({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,o,s,u;return i(this,void 0,void 0,(function(){var i;return a(this,(function(a){return(i=vr.create("searchMessagesWithParams").isObject("params",e,!0).fail(k.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(k.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,ft,!0).fail(k.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,ft).fail(k.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(k.INVALID_PARAMETER_ORDER).isObject("timeRange",null==e?void 0:e.timeRange).validate("timeRange",null==e?void 0:e.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!It(t)||r&&!It(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(k.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(t=null==e?void 0:e.conversationFilter)||void 0===t?void 0:t.conversationTypes,(function(e){return ee(e,Q)})).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(r=null==e?void 0:e.conversationFilter)||void 0===r?void 0:r.targetIds,20,Ut,!1,0).fail(k.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.channelIds,10,Lt,!1,0).fail(k.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(o=null==e?void 0:e.messageFilter)||void 0===o?void 0:o.senderIds,20,Ut,!1,0).fail(k.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(s=null==e?void 0:e.messageFilter)||void 0===s?void 0:s.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(k.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).result().tryTrans(this.validateLogin)).isOk?(e.limit=Math.min(e.limit,100),(null===(u=e.messageFilter)||void 0===u?void 0:u.objectNames)&&e.messageFilter.objectNames.length>300&&(e.messageFilter.objectNames=e.messageFilter.objectNames.slice(0,300)),[2,l(this,SE,"m",UE).call(this,e)]):[2,i.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i,o,s=this;return a(this,(function(a){switch(a.label){case 0:return i=this.logger.createTraceId(),this.logger.info(F.A_GET_MSGS_AROUND_TIMESTAMP_T,JSON.stringify({conversation:e,timestamp:t,beforeCount:r,afterCount:n}),i),[4,vr.create("getMessagesAroundTimestamp").check((function(t){return dc(t,e,Q)})).isLimitedInteger("timestamp",t,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("beforeCount",r,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_BEFORE).isLimitedInteger("afterCount",n,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_AFTER).result().tryTrans(this.validateLogin).next((function(){var i=l(s,SE,"m",PE).call(s,e);return s._engine.chat.getMessagesAroundTimestamp(i,t,r,n)}))];case 1:return o=a.sent(),this.logger.summary(F.A_GET_MSGS_AROUND_TIMESTAMP_R,o,i),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UNREAD_MENTIONED_MSGS_T,JSON.stringify(e),t),[4,vr.create("getUnreadMentionedMessages").check((function(t){return dc(t,e,Q)})).result().tryTrans(this.validateLogin).next((function(){var t=l(n,SE,"m",PE).call(n,e);return n._engine.chat.getUnreadMentionedMessages(t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_UNREAD_MENTIONED_MSGS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_GET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,channelId:t}),r),[4,vr.create("getUltraGroupDefaultNotificationLevel").validate("targetId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("channelId",t,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){var r="string"==typeof t?i._channelIdConvert(x.ULTRA_GROUP,t):t;return i._engine.chat.getUGDefaultNotificationLevel(e,r)}))];case 1:return n=a.sent(),this.logger.summary(F.A_GET_UG_DEFAULT_NTF_LEVEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setUltraGroupDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_SET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,notificationLevel:t,channelId:r}),n),[4,vr.create("setUltraGroupDefaultNotificationLevel").validate("targetId",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,Lt).fail(k.INVALID_PARAMETER_CHANNEL_ID).isNumberEnum("notificationLevel",t,Te,!0).fail(k.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var n="string"==typeof r?o._channelIdConvert(x.ULTRA_GROUP,r):r;return o._engine.chat.setUGDefaultNotificationLevel(e,t,n)}))];case 1:return i=a.sent(),this.logger.summary(F.A_SET_UG_DEFAULT_NTF_LEVEL_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return(t=fc("getConversationNotificationLevel",e,q).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(l(this,SE,"m",PE).call(this,e))]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=vr.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return ee(e,q)}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE).isNumberEnum("level",t,Te,!0).fail(k.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.setConversationTypeNotificationLevel(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){return(t=vr.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return ee(e,q)}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE).result().tryTrans(this.validateConnected)).isOk?[2,this._engine.chat.getConversationTypeNotificationLevel(e)]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i,o,s,u=this;return a(this,(function(a){switch(a.label){case 0:return r=null==t?void 0:t.timestamp,n=null==t?void 0:t.count,i=null==t?void 0:t.order,o=this.logger.createTraceId(),this.logger.info(F.A_GET_REMOTE_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),o),[4,vr.create("getRemoteHistoryMessages").check((function(t){return dc(t,e,K)})).isLimitedInteger("timestamp",r,0,Number.MAX_SAFE_INTEGER).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(k.INVALID_PARAMETER_ORDER).isLimitedInteger("count",n,1,100).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:r||0,count:n||20,order:i||0,messageType:""},a=l(u,SE,"m",PE).call(u,e);return u._engine.getHistoryMessage(a,t,!1)}))];case 1:return s=a.sent(),this.logger.summary(F.A_GET_REMOTE_HISTORY_MSG_R,s,o),[2,s]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(F.A_CLEAR_LOCAL_CACHE_O),this._engine.clearLocalData()}}),Object.defineProperty(e.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._engine.createLogger(e,t)}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_CONVERSATIONS_T,JSON.stringify({identifiers:e}),t),[4,vr.create("getConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,100,(function(e){return!dc(t,e,Q).isFailed}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return l(n,SE,"m",PE).call(n,e)}));return n._engine.chat.getConversations(t)}))];case 1:return r=i.sent(),this.logger.summary(F.A_GET_CONVERSATIONS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._engine.setCheckDuplicateMessage(!!e)}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return i(this,void 0,void 0,(function(){var i=this;return a(this,(function(a){switch(a.label){case 0:return[4,this.validateConnected().next((function(){return i._engine.rtcSignaling(e,t,r,n)}))];case 1:return[2,a.sent()]}}))}))}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this._engine.rtcPing(e,t,r)}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_SET_PROXY_T,JSON.stringify({proxy:e}),t),[4,vr.create("setProxy").check((function(t){return gc(t,e)})).result().next((function(){return n._engine.setProxy(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_SET_PROXY_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t;return a(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_PROXY_T,JSON.stringify({}),e),[4,this._engine.getProxy()];case 1:return t=r.sent(),this.logger.summary(F.A_GET_PROXY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_TEST_PROXY_T,JSON.stringify({proxy:e,testHost:t}),r),[4,vr.create("testProxy").check((function(t){return gc(t,e)})).isString("testHost",t,!0).fail(k.INVALID_PARAMETER_TESTHOST).result().next((function(){return i._engine.testProxy(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_TEST_PROXY_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_REALTIME_CONVERSATIONS_T,JSON.stringify({count:e,startTime:t,order:r}),n),[4,vr.create("getRealtimeConversations").isLimitedInteger("count",e,1,50,!0).fail(k.INVALID_PARAMETER_COUNT).isTimestamp("startTime",t,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",r,0,1,!0).fail(k.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).tryTrans(Sc).next((function(){return o._engine.chat.getRealtimeConversations(e,t,r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_GET_REALTIME_CONVERSATIONS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T,"",e),[4,this.validateConnected().tryTrans(Sc).next((function(){return r._engine.chat.getRealtimeConTotalUnreadCount()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_CLEAR_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,this.validateConnected().tryTrans(Sc).next((function(){return n._engine.chat.clearRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_CLEAR_REALTIME_CON_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_REMOVE_REALTIME_CONVERSATIONS_T,JSON.stringify(e),t),[4,vr.create("removeRealtimeConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,20,(function(e){return!dc(t,e,Q).isFailed}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(Sc).next((function(){return n._engine.chat.removeRealtimeConversations(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_REMOVE_REALTIME_CONVERSATIONS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,vr.create("batchGetRealtimeConUnreadCount").check((function(t){t.isLimitedTypedArray("identifiers",e,10,(function(e){return!dc(t,e,Q).isFailed}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(Sc).next((function(){return n._engine.chat.batchGetRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return vr.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(k.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(k.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(k.INVALID_PARAMETER_SPAN_MINUTES).isNumberEnum("level",e.level,Me,!0).fail(k.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return this.validateConnected().next((function(){return e._engine.removeNotificationQuietHoursSetting()}))}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return this.validateConnected().next((function(){return e._engine.getNotificationQuietHoursSetting()}))}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.getStatsUrlList()}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r;return a(this,(function(n){return(r=fc("sendReadReceiptResponseV5",e,J).isTypedArray("messageUIdArray",t,(function(e){return Ut(e)}),!0).fail(k.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?Ir():Tr(k.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.sendReadReceiptResponseV5(e,t)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n;return a(this,(function(i){return(r=fc("getMessageReadReceiptInfoV5",e,J).isTypedArray("messageUIdArray",t,(function(e){return Ut(e)}),!0).fail(k.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?Ir():Tr(k.READ_RECEIPT_ERROR)}))).isOk?(n=t.map((function(t){return{identifier:e,messageUId:t}})),[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(n)]):[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r;return a(this,(function(n){return t=vr.create(""),(r=vr.create("getMessageReadReceiptInfoV5ByIdentifiers").isTypedArray("identifiers",e,(function(e){return dc(t,e.identifier,J).isNotEmptyString("messageUId",e.messageUId,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).result().isOk}),!0).fail(k.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",e.length,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?Ir():Tr(k.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessageReadReceiptInfoV5ByIdentifiers(e)]:[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){return(n=fc("getMessageReadReceiptInfoV5",e,J).isNotEmptyString("messageUId",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isObject("option",r,!0).fail(k.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",r.pageToken).fail(k.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",r.pageCount,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?Ir():Tr(k.READ_RECEIPT_ERROR)}))).isOk?(r.order=1!==r.order?0:1,r.readStatus=1!==r.readStatus?0:1,[2,this._engine.chat.getMessagesReadReceiptUsersByPageV5(e,t,r)]):[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n;return a(this,(function(i){return(n=fc("getMessagesReadReceiptByUsersV5",e,J).isNotEmptyString("messageUId",t,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",r,(function(e){return Ut(e)}),!0).fail(k.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",r.length,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?Ir():Tr(k.READ_RECEIPT_ERROR)}))).isOk?[2,this._engine.chat.getMessagesReadReceiptByUsersV5(e,t,r)]:[2,n.wipe()]}))}))}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T,JSON.stringify({messageUId:e,option:t}),r),[4,vr.create("requestSpeechToTextForMessage").isNotEmptyString("messageUId",e,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).tryTrans((function(e){return!!(1&(e.AIBusinessSub||0))?Ir():Tr(k.SPEECH_TO_TEXT_DISABLE)})).next((function(){return i._engine.chat.requestSpeechToTextForMessage(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r=this;return a(this,(function(n){switch(n.label){case 0:return[4,vr.create("setMessageSpeechToTextVisible").isNumber("messageId",e,!0).fail(k.INVALID_PARAMETER_MESSAGE_ID).result().tryTrans(this.validateLogin).next((function(){return r._engine.chat.setMessageSpeechToTextVisible(e,!!t)}))];case 1:return[2,n.sent()]}}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return i(this,void 0,void 0,(function(){var n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return n=this.logger.createTraceId(),this.logger.info(F.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T,JSON.stringify({timestamp:e,count:t,topPriority:r}),n),[4,vr.create("getUntaggedConversationListByPage").isLimitedInteger("timestamp",e,0,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).isInteger("count",t,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateLogin).next((function(){var n=t<=0?20:Math.min(t,100);return o._engine.chat.getUntaggedConversationListByPage(e,n,!!r)}))];case 1:return i=a.sent(),this.logger.summary(F.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"translateMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return i(this,void 0,void 0,(function(){var r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return r=Vt(),[4,vr.create("translateMessagesWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof Mn&&e.isValid(!r)}),!0).fail(k.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(t=null==e?void 0:e.list)||void 0===t?void 0:t.length,1,10,!0).fail(k.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,Cn).fail(k.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(n=a.sent()).isOk?(i=e.list,o=e.force,s=e.mode,[2,l(this,SE,"m",DE).call(this,i,0,s,o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"translateTextsWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return i(this,void 0,void 0,(function(){var r,n,i;return a(this,(function(a){switch(a.label){case 0:return[4,vr.create("translateTextsWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof Ln&&e.isValid(!0)}),!0).fail(k.TRANSLATION_PARAMS_TYPE_INVALID).isLimitedInteger("list",null===(t=null==e?void 0:e.list)||void 0===t?void 0:t.length,1,10,!0).fail(k.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,Cn).fail(k.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(r=a.sent()).isOk?(n=e.list,i=e.mode,[2,l(this,SE,"m",DE).call(this,n,1,i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_SET_TRANSLATION_LANGUAGE_T,JSON.stringify({language:e}),t),[4,vr.create("setTranslationLanguage").isLimitedString("language",e,1,Number.MAX_SAFE_INTEGER,!0).fail(k.INVALID_PARAMETER_LAUGUAGE).result().tryTrans(this.validateConnected).next((function(){return n._engine.userSettings.setTranslationLanguage(e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_SET_TRANSLATION_LANGUAGE_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_TRANSLATION_LANGUAGE_T,void 0,e),[4,this.validateLogin().next((function(){return r._engine.userSettings.getTranslationLanguage()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_TRANSLATION_LANGUAGE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_SET_AUTO_TRANSLATE_ENABLED_T,JSON.stringify({enabled:!!e}),t),[4,this.validateConnected().next((function(){return n._engine.userSettings.setAutoTranslateEnabled(!!e)}))];case 1:return r=i.sent(),this.logger.summary(F.A_SET_AUTO_TRANSLATE_ENABLED_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_AUTO_TRANSLATE_ENABLED_T,void 0,e),[4,this.validateLogin().next((function(){return r._engine.userSettings.getAutoTranslateEnabled()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_AUTO_TRANSLATE_ENABLED_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.messageUId,n=null==e?void 0:e.messageContent,this.logger.info(F.A_MODIFY_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUId:r,conversation:null==e?void 0:e.conversation}),t),[4,vr.create("modifyMessageWithParams").check((function(t){return dc(t,null==e?void 0:e.conversation,X)})).isNotEmptyString("messageUId",r,!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isObject("messageContent",n,!0).fail(k.INVALID_PARAMETER_MESSAGE_CONTENT).isLimitedInteger("messageContent",pc(JSON.stringify(n)),1,He,!0).fail(k.RC_MSG_CONTENT_EXCEED_LIMIT).result().tryTrans(this.validateConnected).next((function(){return o._engine.chat.modifyMessageWithParams(e)}))];case 1:return i=a.sent(),this.logger.summary(F.A_MODIFY_MESSAGE_WITH_PARAMS_R,i,t),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.messageUIds,this.logger.info(F.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUIds:r}),t),[4,fc("refreshReferenceMessageWithParams",null==e?void 0:e.conversationIdentifier,X).isObject("params",e,!0).fail(k.BIZ_ERROR_INVALID_PARAMETER).isTypedArray("messageUIds",r,(function(e){return mt(e)}),!0).fail(k.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==r?void 0:r.length,1,20,!0).fail(k.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.refreshReferenceMessageWithParams(r,e.conversationIdentifier,e.remoteMessageBlock,e.localMessageBlock,e.messageInfoMap)}))];case 1:return n=a.sent(),this.logger.summary(F.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_R,n,t),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_SYNC_REMOTE_CONVERSATIONS_T,void 0,e),[4,this.validateConnected().next((function(){return r._engine.chat.syncRemoteConversations()}))];case 1:return t=n.sent(),this.logger.summary(F.A_SYNC_REMOTE_CONVERSATIONS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalUGMessagesForAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return i(this,void 0,void 0,(function(){var r,n,i=this;return a(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(F.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T,JSON.stringify({targetId:e,timestamp:t}),r),[4,vr.create("deleteLocalUGMessagesForAllChannel").isNotEmptyString("targetId",e,!0).fail(k.INVALID_PARAMETER_TARGET_ID).isTimestamp("timestamp",t,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.deleteLocalUGMessagesForAllChannel(e,t)}))];case 1:return n=a.sent(),this.logger.summary(F.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n=this;return a(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T,JSON.stringify({params:e}),t),[4,vr.create("getUnreadMentionMeConversationList").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,Number.MAX_SAFE_INTEGER,(function(e){return ee(e,q)}),!0).fail(k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(k.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(k.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(t){return i(n,void 0,void 0,(function(){var r;return a(this,(function(n){if(r=Up(t)){if(!this._engine.chat.ugSynced)return[2,Tr(k.METHOD_NOT_AVAILABLE)]}else if(e.conversationTypes=e.conversationTypes.filter((function(e){return e!==x.ULTRA_GROUP})),0===e.conversationTypes.length)return[2,Ir([])];return[2,this._engine.chat.getUnreadMentionMeConversationList(e,r)]}))}))}))];case 1:return r=o.sent(),this.logger.summary(F.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return i(this,void 0,void 0,(function(){var e,t,r=this;return a(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(F.A_GET_ALL_ROBOTS_T,void 0,e),[4,this.validateConnected().next((function(){return r._engine.getAllRobots()}))];case 1:return t=n.sent(),this.logger.summary(F.A_GET_ALL_ROBOTS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getRobotById",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return i(this,void 0,void 0,(function(){var t,r,n,o=this;return a(this,(function(s){switch(s.label){case 0:return t=this.logger.createTraceId(),this.logger.info(F.A_GET_ROBOT_BY_ID_T,JSON.stringify({id:e}),t),[4,vr.create("getRobotById").validate("id",e,Ut,!0).fail(k.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return i(o,void 0,void 0,(function(){return a(this,(function(e){return[2,this._engine.getAllRobots()]}))}))}))];case 1:return r=s.sent(),n=r.trans((function(t){return t.find((function(t){return t.robotId===e}))||null})),this.logger.summary(F.A_GET_ROBOT_BY_ID_R,r,t,{id:e,robot:n.data}),[2,n]}}))}))}}),e}();SE=new WeakSet,NE=function(e,t,r){return i(this,void 0,void 0,(function(){var n,o,s=this;return a(this,(function(u){switch(u.label){case 0:return[4,vr.create("connect").isNotEmptyString("token",e).fail(k.RC_CONN_TOKEN_INCORRECT).result().next((function(){return i(s,void 0,void 0,(function(){var n,i;return a(this,(function(a){switch(a.label){case 0:return this._token=e,[4,go.getNetworkType()];case 1:return n=a.sent(),this._engine.setNetwork({status:!0,type:n},!0),i=!!this._pluginInstanseMap.RCCallPlus,[2,this._engine.connect(e,t,i,r)]}}))}))}))];case 1:return(n=u.sent()).isOk&&1!==this._engine.naviInfo.type&&(o=_t.getInfo(),this._engine.reportSDKInfo(o)),[2,n]}}))}))},CE=function(e,t){return i(this,void 0,void 0,(function(){var r=this;return a(this,(function(n){switch(n.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e,t)];case 1:return n.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){r.logger.error(F.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},PE=function(e){return n(n({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)})},ME=function(e,t,r,n){return i(this,void 0,void 0,(function(){var i=this;return a(this,(function(a){switch(a.label){case 0:return[4,vr.create("sendMessage").check((function(t){return dc(t,e,Q)})).isObject("content",t.content,!0).fail(k.INVALID_PARAMETER_MESSAGE_CONTENT).isString("messageType",t.messageType,!0).fail(k.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){var r=cc(t.messageType,t.content);r.isOk||e.setFailed(r.code)})).isNumber("messageId",t.messageId).fail(k.INVALID_PARAMETER_MESSAGE_ID).isBoolean("isStatusMessage",t.isStatusMessage).fail(k.INVALID_PARAMETER_IS_STATUS_MESSAGE).isBoolean("disableNotification",t.disableNotification).fail(k.INVALID_PARAMETER_DISABLE_NOTIFICATION).isString("pushContent",t.pushContent).fail(k.INVALID_PARAMETER_PUSH_CONTENT).isString("pushData",t.pushData).fail(k.INVALID_PARAMETER_PUSH_DATA).isObject("pushConfig",t.pushConfig).fail(k.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("isVoipPush",t.isVoipPush).fail(k.INVALID_PARAMETER_IS_VOIP_PUSH).isBoolean("canIncludeExpansion",t.canIncludeExpansion).fail(k.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION).check((function(e){t.canIncludeExpansion&&t.expansion&&hc(e,t.expansion,!0)})).check((function(r){r.isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(k.INVALID_DISABLE_UPDATE_LAST_MESSAGE),r.isFailed||e.conversationType===x.ULTRA_GROUP&&t.disableUpdateLastMessage&&r.setFailed(k.INVALID_DISABLE_UPDATE_LAST_MESSAGE)})).check((function(r){if(!r.isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,Ut,!1,0).fail(k.INVALID_PARAMETER_USERIDLIST).isFailed&&t.directionalUserIdList&&0!==t.directionalUserIdList.length){var n=e.conversationType;[x.GROUP,x.ULTRA_GROUP,x.APP_PUBLIC_SERVICE,x.PUBLIC_SERVICE].includes(n)||r.setFailed(k.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE)}})).isBoolean("isMentioned",t.isMentioned).fail(k.INVALID_PARAMETER_IS_MENTIONED).check((function(r){var n=e.conversationType;if(!t.isMentioned||n!==x.GROUP&&n!==x.ULTRA_GROUP)delete t.content.mentionedInfo;else{var i=t.content.mentionedInfo||{type:t.mentionedType,userIdList:t.mentionedUserIdList};!r.isNumberEnum("mentionedType",null==i?void 0:i.type,Y,!0).fail(k.INVALID_PARAMETER_MENTIONED_TYPE).isTypedArray("mentionedUserIdList",null==i?void 0:i.userIdList,Ut,(null==i?void 0:i.type)===Y.SINGAL).fail(k.INVALID_PARAMETER_USERIDLIST).isString("mentionedContent",null==i?void 0:i.mentionedContent).fail(k.INVALID_PARAMETER_MESSAGE_CONTENT).isFailed&&(t.content.mentionedInfo=i)}})).result().tryTrans(this.validateConnected).tryTrans((function(r){if(!t.needReceipt)return Ir(r);if(r.grpRRVer!==xe.V5)return Tr(k.READ_RECEIPT_ERROR);var n=e.conversationType,i=yn(t.messageType),a=i.isPersited,o=i.isStatusMessage;return(n!==x.GROUP&&n!==x.PRIVATE||t.isStatusMessage||o||!a||n===x.GROUP&&t.directionalUserIdList&&t.directionalUserIdList.length>0)&&(t.needReceipt=!1),Ir(r)})).tryTrans((function(r){var n=e.conversationType,i=t.messageType;if(n===x.SYSTEM&&i!==Re.SYNC_READ_STATUS)return Tr(k.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE);if(i===Re.STREAM_MESSAGE)return Tr(k.MESSAGE_NOT_SUPPORT_SENDING);if(i===Re.READ_RECEIPT_RESPONSE&&r.grpRRVer)return Tr(k.READ_RECEIPT_ERROR);var a=JSON.stringify(t.content);return pc(a)>He?Tr(k.RC_MSG_CONTENT_EXCEED_LIMIT):Ir()})).next((function(){return l(i,SE,"m",LE).call(i,e,t,r,n)}))];case 1:return[2,a.sent()]}}))}))},LE=function(e,t,r,n){var i=l(this,SE,"m",PE).call(this,e);return i.conversationType===x.ULTRA_GROUP?this._engine.sendUltraMessage(i,t,r,n):this._engine.sendMessage(i,t,r,n)},wE=function(e,t,r){return i(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return[4,this._engine.sendMessage(e,{content:t,messageType:Re.EXPANSION_NOTIFY},r)];case 1:return[2,n.sent().wipe()]}}))}))},UE=function(e){return i(this,void 0,void 0,(function(){var t,r,n,i,o,s;return a(this,(function(a){switch(a.label){case 0:return t=e.timeRange||{},r=t.startTime,n=t.endTime,i={startTime:null!=r?r:0,endTime:null!=n?n:Number.MAX_SAFE_INTEGER},e.timeRange=i,o=this.logger.createTraceId(),this.logger.info(F.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return s=a.sent(),this.logger.summary(F.A_SEARCH_MSGS_BY_PARAMS_R,s,o),[2,s]}}))}))},DE=function(e,t,r,n){return i(this,void 0,void 0,(function(){return a(this,(function(i){return[2,this._engine.translateWithParams(e.map((function(e){return e.toInnerParam()})),r||Cn.MECHANICAL,!!n,t)]}))}))};export{HE as APIContext,Br as AreaCode,nc as AssertRules,en as BasicLogger,w as ChatroomEntryType,D as ChatroomSyncStatusReason,G as ChatroomUserChangeType,V as ChrmMemBanType,j as ChrmMemOperateType,U as ChrmSyncStatus,zl as Codec,Sl as ConnectionStatus,x as ConversationType,f as DirectionType,k as ErrorCode,Jl as EventEmitter,H as FileType,Ge as FilterRobotType,_ as FriendAddPermission,p as FriendApplicationStatus,g as FriendApplicationType,h as FriendRelationType,L as GroupApplicationDirection,S as GroupApplicationStatus,M as GroupApplicationType,R as GroupInviteHandlePermission,I as GroupJoinPermission,v as GroupMemberInfoEditPermission,m as GroupMemberRole,y as GroupOperation,T as GroupOperationPermission,C as GroupOperationRole,N as GroupOperationStatus,O as GroupOperationType,xe as GroupReadReceiptVersion,De as HttpMethod,Pe as InterruptionLevel,sn as LogDBProxy,Kr as LogL,Al as LogLevel,Ol as LogSource,F as LogTagId,He as MAX_MESSAGE_CONTENT_BYTES,ft as MAX_U32_INTEGER,We as MAX_UPLOAD_FILE_SIZE,Y as MentionedType,Ve as MessageAuditType,pe as MessageBlockSourceType,ge as MessageBlockType,be as MessageDirection,Re as MessageType,Te as NotificationLevel,ve as NotificationStatus,le as OnlineStatus,ue as OperateStatus,yl as PBCodec,ce as Platform,ic as PluginContext,Ee as PushImportanceHonor,Me as PushNotificationQuietHoursLevel,d as QueryFriendsDirectionType,he as RCConnectionStatus,Er as RCResult,Ml as RTCApiType,wl as RTCJoinType,Nl as RTCMode,ac as RTCPluginContext,me as ReceivedStatus,Yr as ReferenceMessageStatus,se as SentStatus,je as SpeechToTextStatus,Dl as StreamMessageResponseEventType,de as SubscribeOperationType,fe as SubscribeType,br as SuspendablePromise,Mn as TranslateMessageParam,Cn as TranslateMode,wn as TranslateStatus,Un as TranslateStrategy,Ln as TranslateTextParam,Je as UPLOAD_FILE_CHUNK_SIZE,ht as UUId,re as UltraGroupChannelChangeType,te as UltraGroupChannelType,r as UploadMethod,_e as UserProfileVisibility,Wr as UserSettingsChangedKey,ke as UserType,vr as Validator,_t as VersionManage,uc as assert,un as createLogDBProxy,Tr as fail,lr as fixUrlProtocol,ql as forEach,yn as getMessageTypeDescription,Xl as getUUID,Zl as getUUID22,An as hasMessageTypeDescription,xr as httpRequest,vt as isArray,Et as isBoolean,Ot as isFunction,Nt as isHttpUrl,Tt as isInteger,Rt as isLimitedString,Ql as isNull,It as isNumber,At as isObject,bt as isString,St as isUndefined,Pt as isValidConversationType,wt as isValidEnum,Gt as isValidFileType,Dt as isValidGroupId,Ut as isValidTargetId,Kl as map,yt as notEmptyArray,Ct as notEmptyObject,mt as notEmptyString,Ir as ok,Ar as promiseWithResolvers,go as runtime,jt as trans2IReceivedStatusInfo,Le as trans2NotificationLevel,we as trans2NotificationStatus,kt as transformReceivedStatusFlag,Vt as usingCppEngine,lc as validate};