@rongcloud/engine 5.32.0 → 5.32.1-c-test-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -13,4 +13,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
- 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){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function o(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function a(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 u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function l(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function c(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 d(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}exports.UploadMethod=void 0,(r=exports.UploadMethod||(exports.UploadMethod={}))[r.QINIU=1]="QINIU",r[r.ALI=2]="ALI",r[r.AWS=3]="AWS",r[r.STC=4]="STC",r[r.MINIO=5]="MINIO";var _,f,p,h,g,E,b,T,v,R,I,m,y,A,S,O,C,N,P,L,M,w,U,D,x,G,V,j,k,F,B={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_CALL_MAIN_SYNC_O:"L_CALL_MAIN_SYNC_O",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_CACHE_O:"L-cloud_set_cache-O",L_CLOUD_GET_CACHE_O:"L-cloud_get_cache-O",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"};exports.DirectionType=void 0,(_=exports.DirectionType||(exports.DirectionType={}))[_.BOTH=2]="BOTH",exports.QueryFriendsDirectionType=void 0,(f=exports.QueryFriendsDirectionType||(exports.QueryFriendsDirectionType={}))[f.BOTH=2]="BOTH",exports.FriendAddPermission=void 0,(p=exports.FriendAddPermission||(exports.FriendAddPermission={}))[p.FREE=1]="FREE",p[p.NEED_VERIFY=2]="NEED_VERIFY",p[p.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.FriendRelationType=void 0,(h=exports.FriendRelationType||(exports.FriendRelationType={}))[h.NONE=0]="NONE",h[h.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",h[h.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",h[h.BOTH_WAY=3]="BOTH_WAY",exports.FriendApplicationType=void 0,(g=exports.FriendApplicationType||(exports.FriendApplicationType={}))[g.SENT=1]="SENT",g[g.RECEIVED=2]="RECEIVED",exports.FriendApplicationStatus=void 0,(E=exports.FriendApplicationStatus||(exports.FriendApplicationStatus={}))[E.UNHANDLED=0]="UNHANDLED",E[E.ACCEPTED=1]="ACCEPTED",E[E.REFUSED=2]="REFUSED",E[E.EXPIRED=3]="EXPIRED",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"}(T||(T={})),exports.GroupJoinPermission=void 0,(v=exports.GroupJoinPermission||(exports.GroupJoinPermission={}))[v.OWNER_VERIFY=0]="OWNER_VERIFY",v[v.FREE=1]="FREE",v[v.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",v[v.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.GroupOperationPermission=void 0,(R=exports.GroupOperationPermission||(exports.GroupOperationPermission={}))[R.OWNER=0]="OWNER",R[R.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",R[R.EVERYONE=2]="EVERYONE",exports.GroupMemberInfoEditPermission=void 0,(I=exports.GroupMemberInfoEditPermission||(exports.GroupMemberInfoEditPermission={}))[I.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",I[I.OWNER_OR_SELF=1]="OWNER_OR_SELF",I[I.SELF=2]="SELF",exports.GroupInviteHandlePermission=void 0,(m=exports.GroupInviteHandlePermission||(exports.GroupInviteHandlePermission={}))[m.FREE=0]="FREE",m[m.INVITEE_VERIFY=1]="INVITEE_VERIFY",exports.GroupMemberRole=void 0,(y=exports.GroupMemberRole||(exports.GroupMemberRole={}))[y.UNDEF=0]="UNDEF",y[y.NORMAL=1]="NORMAL",y[y.MANAGER=2]="MANAGER",y[y.OWNER=3]="OWNER",exports.GroupOperation=void 0,(A=exports.GroupOperation||(exports.GroupOperation={}))[A.CREATE=0]="CREATE",A[A.JOIN=1]="JOIN",A[A.KICK=2]="KICK",A[A.QUIT=3]="QUIT",A[A.DISMISS=4]="DISMISS",A[A.ADD_MANAGER=5]="ADD_MANAGER",A[A.REMOVE_MANAGER=6]="REMOVE_MANAGER",A[A.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER",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"}(S||(S={})),exports.GroupOperationType=void 0,(O=exports.GroupOperationType||(exports.GroupOperationType={}))[O.ADD=1]="ADD",O[O.REMOVE=2]="REMOVE",exports.GroupApplicationStatus=void 0,(C=exports.GroupApplicationStatus||(exports.GroupApplicationStatus={}))[C.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",C[C.MANAGER_REFUSED=1]="MANAGER_REFUSED",C[C.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",C[C.INVITEE_REFUSED=3]="INVITEE_REFUSED",C[C.JOINED=4]="JOINED",C[C.EXPIRED=5]="EXPIRED",exports.GroupOperationStatus=void 0,(N=exports.GroupOperationStatus||(exports.GroupOperationStatus={}))[N.REFUSE=0]="REFUSE",N[N.ACCEPT=1]="ACCEPT",exports.GroupOperationRole=void 0,(P=exports.GroupOperationRole||(exports.GroupOperationRole={}))[P.APPLICANT=0]="APPLICANT",P[P.MANAGER=1]="MANAGER",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"}(L||(L={})),exports.GroupApplicationType=void 0,(M=exports.GroupApplicationType||(exports.GroupApplicationType={}))[M.APPLICATION=0]="APPLICATION",M[M.INVITATION=1]="INVITATION",exports.GroupApplicationDirection=void 0,(w=exports.GroupApplicationDirection||(exports.GroupApplicationDirection={}))[w.APPLICATION_SENT=0]="APPLICATION_SENT",w[w.INVITATION_SENT=1]="INVITATION_SENT",w[w.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",w[w.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED",exports.ChatroomEntryType=void 0,(U=exports.ChatroomEntryType||(exports.ChatroomEntryType={}))[U.UPDATE=1]="UPDATE",U[U.DELETE=2]="DELETE",exports.ChrmSyncStatus=void 0,(D=exports.ChrmSyncStatus||(exports.ChrmSyncStatus={}))[D.QUIT=0]="QUIT",D[D.JOIN=1]="JOIN",exports.ChatroomSyncStatusReason=void 0,(x=exports.ChatroomSyncStatusReason||(exports.ChatroomSyncStatusReason={}))[x.LeaveOnMyOwn=0]="LeaveOnMyOwn",x[x.OtherDeviceLogin=1]="OtherDeviceLogin",exports.ChatroomUserChangeType=void 0,(G=exports.ChatroomUserChangeType||(exports.ChatroomUserChangeType={}))[G.QUIT=0]="QUIT",G[G.JOIN=1]="JOIN",exports.ChrmMemBanType=void 0,(V=exports.ChrmMemBanType||(exports.ChrmMemBanType={}))[V.UnmuteUsers=0]="UnmuteUsers",V[V.MuteUsers=1]="MuteUsers",V[V.UnmuteAll=2]="UnmuteAll",V[V.MuteAll=3]="MuteAll",V[V.RemoveWhitelist=4]="RemoveWhitelist",V[V.AddWhitelist=5]="AddWhitelist",V[V.UnmuteGloble=6]="UnmuteGloble",V[V.MuteGloble=7]="MuteGloble",exports.ChrmMemOperateType=void 0,(j=exports.ChrmMemOperateType||(exports.ChrmMemOperateType={}))[j.Deblock=0]="Deblock",j[j.Blocked=1]="Blocked",exports.ErrorCode=void 0,(k=exports.ErrorCode||(exports.ErrorCode={}))[k.SUCCESS=0]="SUCCESS",k[k.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",k[k.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",k[k.NOT_IN_WHITELIST=407]="NOT_IN_WHITELIST",k[k.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",k[k.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",k[k.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",k[k.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",k[k.MESSAGE_OVER_MODIFY_TIME_FAIL=20114]="MESSAGE_OVER_MODIFY_TIME_FAIL",k[k.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",k[k.MESSAGE_UNSUPPORTED_MODIFY=20116]="MESSAGE_UNSUPPORTED_MODIFY",k[k.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",k[k.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",k[k.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",k[k.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",k[k.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",k[k.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",k[k.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",k[k.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",k[k.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",k[k.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",k[k.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",k[k.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",k[k.NOT_IN_GROUP=22406]="NOT_IN_GROUP",k[k.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",k[k.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",k[k.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",k[k.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",k[k.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",k[k.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",k[k.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",k[k.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",k[k.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",k[k.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",k[k.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",k[k.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",k[k.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",k[k.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",k[k.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",k[k.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",k[k.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",k[k.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",k[k.HAVNODEVICEID=24001]="HAVNODEVICEID",k[k.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",k[k.FEILD=24009]="FEILD",k[k.INTERNALERRROR=24015]="INTERNALERRROR",k[k.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",k[k.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",k[k.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",k[k.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",k[k.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",k[k.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",k[k.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",k[k.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",k[k.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",k[k.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",k[k.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",k[k.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",k[k.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",k[k.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",k[k.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",k[k.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",k[k.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",k[k.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",k[k.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",k[k.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",k[k.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",k[k.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",k[k.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",k[k.RECALL_MESSAGE=25101]="RECALL_MESSAGE",k[k.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",k[k.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",k[k.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",k[k.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",k[k.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",k[k.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",k[k.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",k[k.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",k[k.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",k[k.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",k[k.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",k[k.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",k[k.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",k[k.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",k[k.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",k[k.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",k[k.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",k[k.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",k[k.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",k[k.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",k[k.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",k[k.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",k[k.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",k[k.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",k[k.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",k[k.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",k[k.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",k[k.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",k[k.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",k[k.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",k[k.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",k[k.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",k[k.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",k[k.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",k[k.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",k[k.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",k[k.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",k[k.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",k[k.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",k[k.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",k[k.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",k[k.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",k[k.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",k[k.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",k[k.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",k[k.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",k[k.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",k[k.RC_FRIEND_NOT_SUPPORT_ROBOT=25474]="RC_FRIEND_NOT_SUPPORT_ROBOT",k[k.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",k[k.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",k[k.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",k[k.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",k[k.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",k[k.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",k[k.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",k[k.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",k[k.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",k[k.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",k[k.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",k[k.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",k[k.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",k[k.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",k[k.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",k[k.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",k[k.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",k[k.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",k[k.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",k[k.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",k[k.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",k[k.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",k[k.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",k[k.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",k[k.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",k[k.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",k[k.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",k[k.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",k[k.TRANS_FAILED=28401]="TRANS_FAILED",k[k.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",k[k.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",k[k.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",k[k.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",k[k.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",k[k.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",k[k.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",k[k.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",k[k.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",k[k.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",k[k.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",k[k.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",k[k.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",k[k.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",k[k.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",k[k.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",k[k.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",k[k.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",k[k.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",k[k.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",k[k.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",k[k.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",k[k.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",k[k.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",k[k.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",k[k.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",k[k.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",k[k.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",k[k.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",k[k.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",k[k.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",k[k.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",k[k.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",k[k.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",k[k.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",k[k.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",k[k.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",k[k.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",k[k.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",k[k.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",k[k.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",k[k.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",k[k.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",k[k.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",k[k.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",k[k.RC_OTP_USED=31027]="RC_OTP_USED",k[k.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",k[k.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",k[k.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",k[k.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",k[k.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",k[k.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",k[k.RC_TCP_RESET=32054]="RC_TCP_RESET",k[k.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",k[k.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",k[k.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",k[k.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",k[k.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",k[k.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",k[k.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",k[k.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",k[k.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",k[k.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",k[k.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",k[k.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",k[k.TAG_EXISTS=33101]="TAG_EXISTS",k[k.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",k[k.METHOD_BUSY=33103]="METHOD_BUSY",k[k.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",k[k.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",k[k.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",k[k.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",k[k.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",k[k.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",k[k.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",k[k.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",k[k.UPLOAD_FAIL=34011]="UPLOAD_FAIL",k[k.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",k[k.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",k[k.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",k[k.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",k[k.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",k[k.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",k[k.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",k[k.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",k[k.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",k[k.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",k[k.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",k[k.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",k[k.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",k[k.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",k[k.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",k[k.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",k[k.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",k[k.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",k[k.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",k[k.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",k[k.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",k[k.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",k[k.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",k[k.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",k[k.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",k[k.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",k[k.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",k[k.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",k[k.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",k[k.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",k[k.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",k[k.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",k[k.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",k[k.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",k[k.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",k[k.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",k[k.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",k[k.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",k[k.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",k[k.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",k[k.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",k[k.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",k[k.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",k[k.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",k[k.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",k[k.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",k[k.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",k[k.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",k[k.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",k[k.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",k[k.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",k[k.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",k[k.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",k[k.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",k[k.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",k[k.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",k[k.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",k[k.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",k[k.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",k[k.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",k[k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",k[k.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",k[k.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",k[k.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",k[k.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",k[k.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",k[k.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",k[k.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",k[k.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",k[k.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",k[k.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",k[k.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",k[k.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",k[k.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",k[k.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",k[k.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",k[k.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",k[k.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",k[k.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",k[k.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",k[k.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",k[k.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",k[k.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",k[k.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",k[k.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",k[k.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",k[k.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",k[k.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",k[k.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",k[k.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",k[k.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",k[k.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",k[k.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",k[k.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",k[k.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",k[k.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",k[k.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",k[k.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",k[k.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",k[k.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",k[k.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",k[k.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",k[k.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",k[k.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",k[k.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",k[k.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",k[k.NOT_SUPPORT=35004]="NOT_SUPPORT",k[k.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",k[k.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",k[k.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",k[k.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",k[k.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",k[k.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",k[k.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",k[k.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",k[k.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",k[k.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",k[k.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",k[k.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",k[k.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",k[k.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",k[k.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",k[k.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",k[k.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",k[k.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",k[k.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",k[k.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",k[k.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",k[k.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",k[k.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",k[k.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",k[k.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",k[k.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",k[k.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",k[k.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",k[k.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",k[k.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",k[k.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",k[k.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",k[k.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",k[k.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",k[k.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",k[k.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",k[k.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",k[k.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",k[k.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",k[k.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",k[k.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",k[k.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",k[k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",k[k.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",k[k.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",k[k.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",k[k.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",k[k.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",k[k.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",k[k.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",k[k.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",k[k.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",k[k.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",k[k.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",k[k.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",k[k.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",k[k.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",k[k.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",k[k.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",k[k.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",k[k.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",k[k.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",k[k.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",k[k.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",k[k.TIMEOUT=-1]="TIMEOUT",exports.ConversationType=void 0,(F=exports.ConversationType||(exports.ConversationType={}))[F.NONE=0]="NONE",F[F.PRIVATE=1]="PRIVATE",F[F.DISCUSSION=2]="DISCUSSION",F[F.GROUP=3]="GROUP",F[F.CHATROOM=4]="CHATROOM",F[F.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",F[F.SYSTEM=6]="SYSTEM",F[F.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",F[F.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",F[F.ULTRA_GROUP=10]="ULTRA_GROUP",F[F.RTC_ROOM=12]="RTC_ROOM";var H,q,Y,W=0,J=1,K=2,Q=3,X=4,Z=5,z=6,$=7,ee=function(e){var t=[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE];switch(e){case W:return t;case J:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP];case K:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP],!1);case Q:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM],!1);case X:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.CUSTOMER_SERVICE,exports.ConversationType.DISCUSSION],!1);case Z:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP];case z:return[exports.ConversationType.GROUP];case $:return[exports.ConversationType.PRIVATE]}},te=function(e,t){return ee(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"}(H||(H={})),exports.FileType=void 0,(q=exports.FileType||(exports.FileType={}))[q.IMAGE=1]="IMAGE",q[q.AUDIO=2]="AUDIO",q[q.VIDEO=3]="VIDEO",q[q.FILE=4]="FILE",q[q.SIGHT=5]="SIGHT",q[q.COMBINE_HTML=6]="COMBINE_HTML",exports.MentionedType=void 0,(Y=exports.MentionedType||(exports.MentionedType={}))[Y.ALL=1]="ALL",Y[Y.SINGAL=2]="SINGAL";var re,ne,ie,oe,se,ae,ue,le,ce,de,_e,fe,pe,he,ge,Ee,be,Te,ve,Re,Ie,me={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"};exports.UltraGroupChannelType=void 0,(re=exports.UltraGroupChannelType||(exports.UltraGroupChannelType={}))[re.PUBLIC=0]="PUBLIC",re[re.PRIVATE=1]="PRIVATE",exports.UltraGroupChannelChangeType=void 0,(ne=exports.UltraGroupChannelChangeType||(exports.UltraGroupChannelChangeType={}))[ne.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",ne[ne.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",ne[ne.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN",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"}(ie||(ie={})),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"}(oe||(oe={})),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"}(se||(se={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(ae||(ae={})),exports.SentStatus=void 0,(ue=exports.SentStatus||(exports.SentStatus={}))[ue.SENDING=10]="SENDING",ue[ue.FAILED=20]="FAILED",ue[ue.SENT=30]="SENT",ue[ue.RECEIVED=40]="RECEIVED",ue[ue.READ=50]="READ",ue[ue.DESTROYED=60]="DESTROYED",exports.OperateStatus=void 0,(le=exports.OperateStatus||(exports.OperateStatus={}))[le.typing=0]="typing",exports.OnlineStatus=void 0,(ce=exports.OnlineStatus||(exports.OnlineStatus={}))[ce.ONLINE=1]="ONLINE",ce[ce.OFFLINE=0]="OFFLINE",exports.Platform=void 0,(de=exports.Platform||(exports.Platform={}))[de.Other=0]="Other",de[de.iOS=1]="iOS",de[de.Android=2]="Android",de[de.Web=3]="Web",de[de.PC=4]="PC",de[de.Mini=5]="Mini",de[de.HarmonyOS=6]="HarmonyOS",exports.SubscribeType=void 0,(_e=exports.SubscribeType||(exports.SubscribeType={}))[_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",exports.SubscribeOperationType=void 0,(fe=exports.SubscribeOperationType||(exports.SubscribeOperationType={}))[fe.SUBSCRIBE=0]="SUBSCRIBE",fe[fe.UNSUBSCRIBE=1]="UNSUBSCRIBE",exports.UserProfileVisibility=void 0,(pe=exports.UserProfileVisibility||(exports.UserProfileVisibility={}))[pe.NOT_SET=0]="NOT_SET",pe[pe.INVISIBLE=1]="INVISIBLE",pe[pe.EVERYONE=2]="EVERYONE",pe[pe.FriendVisible=3]="FriendVisible",exports.RCConnectionStatus=void 0,(he=exports.RCConnectionStatus||(exports.RCConnectionStatus={}))[he.CONNECTED=0]="CONNECTED",he[he.CONNECTING=1]="CONNECTING",he[he.DISCONNECTED=2]="DISCONNECTED",he[he.SUSPENDED=3]="SUSPENDED",exports.MessageBlockType=void 0,(ge=exports.MessageBlockType||(exports.MessageBlockType={}))[ge.GLOBAL=1]="GLOBAL",ge[ge.CUSTOM=2]="CUSTOM",ge[ge.THIRD_PARTY=3]="THIRD_PARTY",exports.MessageBlockSourceType=void 0,(Ee=exports.MessageBlockSourceType||(exports.MessageBlockSourceType={}))[Ee.MSG_ORIGINAL=0]="MSG_ORIGINAL",Ee[Ee.MSG_EXPANSION=1]="MSG_EXPANSION",Ee[Ee.MSG_MODIFY=2]="MSG_MODIFY",exports.MessageDirection=void 0,(be=exports.MessageDirection||(exports.MessageDirection={}))[be.SEND=1]="SEND",be[be.RECEIVE=2]="RECEIVE",exports.PushImportanceHonor=void 0,(Te=exports.PushImportanceHonor||(exports.PushImportanceHonor={})).NORMAL="NORMAL",Te.LOW="LOW",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"}(ve||(ve={})),exports.NotificationLevel=void 0,(Re=exports.NotificationLevel||(exports.NotificationLevel={}))[Re.ALL_MESSAGE=-1]="ALL_MESSAGE",Re[Re.NOT_SET=0]="NOT_SET",Re[Re.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",Re[Re.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",Re[Re.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",Re[Re.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION",exports.NotificationStatus=void 0,(Ie=exports.NotificationStatus||(exports.NotificationStatus={}))[Ie.OPEN=1]="OPEN",Ie[Ie.CLOSE=2]="CLOSE";var ye,Ae,Se,Oe,Ce,Ne,Pe,Le,Me,we=function(e){return e<=exports.NotificationLevel.NOT_SET?exports.NotificationStatus.CLOSE:exports.NotificationStatus.OPEN};exports.ReceivedStatus=void 0,(ye=exports.ReceivedStatus||(exports.ReceivedStatus={}))[ye.READ=1]="READ",ye[ye.LISTENED=2]="LISTENED",ye[ye.DOWNLOADED=4]="DOWNLOADED",ye[ye.RETRIEVED=8]="RETRIEVED",ye[ye.UNREAD=0]="UNREAD",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"}(Se||(Se={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Oe||(Oe={})),function(e){e[e.CURRENT=2]="CURRENT"}(Ce||(Ce={})),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"}(Pe||(Pe={})),exports.InterruptionLevel=void 0,(Le=exports.InterruptionLevel||(exports.InterruptionLevel={})).PASSIVE="passive",Le.ACTIVE="active",Le.TIME_SENSITIVE="time-sensitive",Le.CRITICAL="critical",exports.PushNotificationQuietHoursLevel=void 0,(Me=exports.PushNotificationQuietHoursLevel||(exports.PushNotificationQuietHoursLevel={}))[Me.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",Me[Me.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",Me[Me.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED";var Ue,De,xe={ALL:0,EXCLUDE_ROBOT:1,ROBOT_ONLY:2},Ge={NOT_CONVERTED:0,CONVERTING:1,SUCCESS:2,FAILED:3},Ve={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={})),exports.HttpMethod=void 0,(De=exports.HttpMethod||(exports.HttpMethod={})).GET="GET",De.POST="POST",De.PUT="PUT";var je=72e5,ke=6e4,Fe=131072,Be="5.32.0".replace(/-.+$/,""),He="rongcloudsystem",qe=864e5,Ye=function(e){return"navi_".concat(e)},We=function(e,t){return"RC-con-s-ver-".concat(e,"-").concat(t)},Je=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},Ke=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},Qe=function(e,t){return"RC-con-type-settings-".concat(e,"-").concat(t)},Xe=function(e,t){return"outbox_".concat(e,"_").concat(t)},Ze=function(e,t){return"inbox_".concat(e,"_").concat(t)},ze=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},$e=function(e,t){return"send_msg_".concat(e,"_").concat(t)},et=function(e,t){return"RC-us-".concat(e,"-").concat(t)},rt=function(e){return"rc-static-config-".concat(e)},nt=function(e){return"RC-cc-".concat(e)},it=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},ot=function(e){return"RC-LI-".concat(e)},st=Math.pow(2,31)-1,at="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};at.engine="5.32.0";var ut=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)&&(at[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 at.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 at}}),e}();var lt={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),o=e-n.length-i.length;return[i,n,o>0?(t=o,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},ct=lt.genWithLen(22),dt=Date.now(),_t=function(e){return"string"==typeof e},ft=function(e){return"number"==typeof e&&!Number.isNaN(e)},pt=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},ht=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},gt=function(e){return function(t){return _t(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))}},Et=function(e){return _t(e)&&e.length>0},bt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Tt=function(e){return"function"==typeof e},vt=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},Rt=function(e){return _t(e)&&/https?:\/\//.test(e)},It=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},mt=function(e){return ft(e)&&Object.prototype.hasOwnProperty.call(exports.NotificationLevel,e)},yt=function(e){var t=!1;return _t(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},At=function(e){return gt({minLength:1,maxLength:64})(e)},St=function(e){return gt({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},Ot=function(){return"undefined"!=typeof RCCppEngine},Ct=function(e){return{isRead:(e&exports.ReceivedStatus.READ)===exports.ReceivedStatus.READ,isListened:(e&exports.ReceivedStatus.LISTENED)===exports.ReceivedStatus.LISTENED,isDownload:(e&exports.ReceivedStatus.DOWNLOADED)===exports.ReceivedStatus.DOWNLOADED,isRetrieved:(e&exports.ReceivedStatus.RETRIEVED)===exports.ReceivedStatus.RETRIEVED}},Nt=function(e){return[exports.Platform.iOS,exports.Platform.Android,exports.Platform.Web,exports.Platform.PC,exports.Platform.Mini,exports.Platform.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]}))},Pt=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},Lt=function(e,t,r){return t?1===r?H.TLS:H.RMTP:"http"===e?H.WS:H.WSS},Mt=function(e,t){var r=e.server,n=e.backupServer,i=e.bs,o=e.serverAddr,s=e.protocol,a=e.openTLS;if(o)return l([],u(o.filter((function(e){return e.addr}))),!1);var c=[],d=[];return r&&d.push(r),(n||i||"").split(",").forEach((function(e){d.indexOf(e)<0&&d.push(e)})),d.forEach((function(e,n){e&&c.push({addr:e,protocol:Lt(s,t,a),weight:r.length-n,race:!1})})),l([],u(c),!1)},wt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Gt(e.settingProfile),r=e.extProfile||[],i=e.targetId,o=e.baseInfo,s=e.userInfo;return JSON.parse(JSON.stringify(n(n({groupId:i},Dt(t)),{extProfile:r.length>0?Gt(r):void 0,creatorId:null==o?void 0:o.creatorId,ownerId:null==o?void 0:o.ownerId,createTime:null==o?void 0:o.createTime,membersCount:null==o?void 0:o.memberCount,remark:null==s?void 0:s.remarkName})))}))},Ut=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},Dt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Ut(e.joinPerm),removeMemberPermission:Ut(e.removePerm),invitePermission:Ut(e.memInvitePerm),inviteHandlePermission:Ut(e.invitePerm),groupInfoEditPermission:Ut(e.profilePerm),memberInfoEditPermission:Ut(e.memProfilePerm)}))},xt=function(e){return void 0===e&&(e=[]),e.map(Vt)},Gt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Vt=function(e){var t=e.userId,r=e.name,n=e.portraitUrl,i=e.ext||{},o=i.role,s=i.joinTime,a=i.channelNickName,u=i.additional,l=i.isBot;return{userId:t,name:r||"",portraitUri:n||"",nickname:a||"",extra:u||"",role:o||exports.GroupMemberRole.UNDEF,joinedTime:s||0,isRobot:!!l}},jt=function(e){var t=e.joinUserInfo,r=e.inviterInfo,n=e.processInfo;return{groupId:e.targetId,joinMemberInfo:Vt(t),inviterInfo:r&&r.userId?Vt(r):void 0,operatorInfo:n&&n.userId?Vt(n):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},kt=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},Ft=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 Bt(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 Ht,qt=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=lt.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)}(),o=(new Date).getTime(),s="";if(t){var a=t.split(".");s=".".concat(a[a.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(r,"_").concat(o).concat(n).concat(s)},Yt=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,s=t.typeVivo,a=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,d=t.importanceHonor,_=t.imageUrlHonor,f=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var r=e.threadId,n=e.apnsCollapseId,i=e.category,o=e.richMediaUri,s=e.interruptionLevel,a=t.googleConfig,u={};u["thread-id"]=r||"",u["apns-collapse-id"]=n||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=s||"active";var l={};l.collapse_key=null==a?void 0:a.collapseKey,l.imageUrl=null==a?void 0:a.imageUrl;var c=null==a?void 0:a.priority;return c&&!["high","normal"].includes(c)&&(c="normal"),l.priority=c,{APNS:u,FCM:l}}(e,t),p=[{HW:{channelId:i||"",importance:a||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:s||"",category:c||""}},{APNS:f.APNS},{FCM:f.FCM},{HONOR:{importance:d||exports.PushImportanceHonor.NORMAL,image:_||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(p)},Wt=function(e,t){var r={},n={notificationId:t||""},i={};if(!e)return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,s,a,u,l,c,d,_,f,p,h,g=Object.keys(e);if(0!==g.length){var E=g[0];switch(E){case"HW":return n.channelIdHW=null===(t=e[E])||void 0===t?void 0:t.channelId,n.importanceHW=null===(o=e[E])||void 0===o?void 0:o.importance,n.imageUrlHW=null===(s=e[E])||void 0===s?void 0:s.image,void(n.categoryHW=null===(a=e[E])||void 0===a?void 0:a.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===(d=e[E])||void 0===d?void 0:d.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===(_=e[E])||void 0===_?void 0:_.importance,void(n.imageUrlHonor=null===(f=e[E])||void 0===f?void 0:f.image);case"OHOS":i.category=null===(p=e[E])||void 0===p?void 0:p.category,i.image=null===(h=e[E])||void 0===h?void 0:h.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}},Jt=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),r=e.length;return t&&(r<=128&&r>=1)},Kt=function(e){var t=e.length;return t<=4096&&t>=1},Qt=(Ht=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),r=e+Ht.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return Ht=2047&++Ht,parseInt(r,2)}),Xt=function(){var e=ut.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t},Zt=function(e,t,r){return o(void 0,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return n=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(r)},n,Bt(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function zt(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!==H.HTTP||n?"https://".concat(e):"http://".concat(e)}var $t=function(e,t){if(!e)return"";var r=e.ossConfig,n=void 0===r?"":r,i="";try{var o=JSON.parse(n);if(o.length>0){var s=o.find((function(e){return e.minio}));s&&(i=s.minio)}}catch(e){t.warn(B.L_PARSE_JSON_E,JSON.stringify({ossConfig:n,error:e}))}return i};var er,tr=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),rr=function(){function e(){er.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){d(this,er,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return c(this,er,"f")},enumerable:!1,configurable:!0}),e}();er=new WeakMap;var nr=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 Set})}return Object.defineProperty(e.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===i&&(i=0);var o=Symbol(),s=this._map.get(e)||this._map.set(e,[]).get(e),a={symbol:o,priority:Math.min(i,100),listener:t.bind(n),once:r},u=s.findIndex((function(e){return e.priority>i}));return-1===u?s.push(a):s.splice(u,0,a),o}}),Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!1,r,n)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!0,r,n)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;try{for(var n=a(this._map),i=n.next();!i.done;i=n.next()){var o=u(i.value,2),s=(o[0],o[1]),l=s.findIndex((function(t){return t.symbol===e}));if(-1!==l)return void s.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 rr,o=0;o<n.length;o+=1){var s=n[o],a=s.once,c=s.listener;a&&n.splice(o,1);try{c.apply(void 0,l([i],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}l([],u(this._piped.values()),!1).forEach((function(r){return r.emit.apply(r,l([e],u(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){this._piped.add(e)}}),e}(),ir=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){return void 0===t&&(t=!1),o(this,void 0,void 0,(function(){return s(this,(function(r){return-1!==this._dataVersion||(this._dataVersion=e,t&&this._execPulling()),[2]}))}))}}),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 o(this,void 0,void 0,(function(){var e,t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return this._pullingPromise?[2]:(this._pullingPromise=this._handleSyncData(this._dataVersion),[4,this._pullingPromise]);case 1:if(e=s.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=l([],u(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}(nr),or=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}(),sr=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 o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){return s(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?ar(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?ar(void 0,this.msg):ur(this.code,this.msg)}}),e}(),ar=function(e,t){return new sr(0,t||"success",e)},ur=function(e,t,r){return new sr(e,t||"fail: ".concat(e),r)},lr=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?ur(this._code,this._errmsg):ar()}}),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 tr.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"isHttpUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isNotEmptyString(e,t,r).validate(e,t,(function(e){return/^https?:\/\//.test(e)}))}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isString(e,t,r).validate(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assertString(e,t,r),this.assert(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isLimitedInteger(e,t,0,Number.MAX_SAFE_INTEGER,r)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.isArray(e,t,n).validate(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isArray(e,t,n).validate(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,r,i,o).validate(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,r,i,o),this.assert(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"isStringEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isString(e,t,n).validate(e,t,(function(e){return Object.values(r).includes(e)}),n)}}),Object.defineProperty(e.prototype,"isNumberEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isNumber(e,t,n).validate(e,t,(function(e){return Object.values(r).includes(e)}),n)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"function"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"function"==typeof e}),r)}}),e}(),cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function dr(e){var t,r,n,i,o,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=cr.indexOf(e.charAt(u++))<<2|(i=cr.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(o=cr.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(s=cr.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==o&&(a+=String.fromCharCode(r)),64!==s&&(a+=String.fromCharCode(n));return a}var _r,fr=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},pr=1732584193,hr=4023233417,gr=2562383102,Er=271733878,br=[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],Tr=[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 vr(e,t){return e<<t|e>>>32-t}function Rr(e,t,r){return e&r|t&~r}function Ir(e,t,r){return e^t^r}function mr(e,t,r){return t^(e|~r)}function yr(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 Ar(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 Sr(e){var t=8*e.length,r=e.length%64<56?56-e.length%64:120-e.length%64,n=new Uint8Array(e.length+r+8);n.set(e),n[e.length]=128;for(var i=1;i<r;i++)n[e.length+i]=0;var o=new Uint8Array(8),s=4294967295&t,a=4294967295&Math.floor(t/4294967296);o.set(Ar(s),0),o.set(Ar(a),4),n.set(o,e.length+r);var u,l=pr,c=hr,d=gr,_=Er;for(i=0;i<n.length;i+=64){for(var f=yr(n.slice(i,i+64)),p=l,h=c,g=d,E=_,b=0;b<64;b++){var T=void 0,v=void 0;b<16?(T=(u=c)&d|~u&_,v=b):b<32?(T=Rr(c,d,_),v=(5*b+1)%16):b<48?(T=Ir(c,d,_),v=(3*b+5)%16):(T=mr(c,d,_),v=7*b%16);var R=_;_=d,d=c,c+=vr(l+T+Tr[b]+f[v]&4294967295,br[b]),l=R}l=l+p&4294967295,c=c+h&4294967295,d=d+g&4294967295,_=_+E&4294967295}var I=new Uint8Array(16);return I.set(Ar(l),0),I.set(Ar(c),4),I.set(Ar(d),8),I.set(Ar(_),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(I)}function Or(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 Sr(t)}function Cr(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||ke,n=e.headers,i=e.query,o=e.body,s=e.onProgress,a=Ft(e.url,i),u=new XMLHttpRequest;if(u.open(t,a),n&&u.setRequestHeader)for(var l in n)u.setRequestHeader(l,n[l]);return function(e,t,r,n){return new or((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,o,s)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(_r||(_r={}));var Nr,Pr,Lr=0,Mr={DEFAULT:0,MODIFIED:1,RECALLED:2,DELETE:3},wr={TranslationLanguage:0,AutoTranslateEnable:1};exports.AreaCode=void 0,(Pr=exports.AreaCode||(exports.AreaCode={}))[Pr.BJ=1]="BJ",Pr[Pr.SG=2]="SG",Pr[Pr.NA=3]="NA",Pr[Pr.SG_A=4]="SG_A",Pr[Pr.SG_B=4]="SG_B",Pr[Pr.SA=5]="SA",Pr[Pr.OM=6]="OM";var Ur=((Nr={})[exports.AreaCode.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},Nr[exports.AreaCode.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},Nr[exports.AreaCode.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},Nr[exports.AreaCode.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},Nr[exports.AreaCode.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},Nr[exports.AreaCode.OM]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5vbS1saWdodC1lZGdlLmNvbQ==","bmF2LWIub20tbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ub20tbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLm9tLWxpZ2h0LWVkZ2UuY29t","d3MtYi5vbS1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5vbS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIub20tbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9kdWFsc3RhY2stc3RhdHMub20tbGlnaHQtZWRnZS5jb20="]},Nr);function Dr(e){return exports.AreaCode[e]?e:exports.AreaCode.BJ}var xr,Gr=function(){function e(){Object.defineProperty(this,"initOption",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.initOption=e}}),Object.defineProperty(e.prototype,"getNaviUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this.initOption||{},i=n.areaCode,o=n.navigators,s=(r=i,void 0===r&&(r=exports.AreaCode.BJ),Ur[Dr(r)].naviUrlBase64).map((function(e){return dr(e)})),a=[],c=u(e.split("@"),2)[1];t&&(a=c?c.split(";"):[]);var d=o&&o.length>0?l(l([],u(a),!1),u(o),!1):l(l([],u(a),!1),u(s),!1);return d.filter((function(e,t){return d.indexOf(e)===t})).map((function(e){return zt(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,i=e||{},o=i.log,s=i.logPolicy,a=this.initOption||{},c=a.areaCode,d=a.logServerUrl,_=(r=c,void 0===r&&(r=exports.AreaCode.BJ),Ur[Dr(r)].logUrlBase64).map((function(e){return n(n({},e),{addr:dr(e.addr)})})),f=[],p={level:1,itv:6,times:5};if(o)f.push.apply(f,l([],u(o.addrs),!1)),Object.assign(p,o.policy);else if(s)try{var h=JSON.parse(s);f.push({addr:h.url,protocol:H.HTTPS,weight:1}),p.level=h.level,p.itv=h.itv,p.times=h.times}catch(r){t.warn(B.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var g=d?l([{addr:d,protocol:H.HTTPS,weight:101}],u(f),!1):l(l([],u(f),!1),u(_),!1);return{policy:p,addrs:g.filter((function(e,t){return g.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return n(n({},e),{addr:zt(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=exports.AreaCode.BJ),Ur[Dr(t)].miniCmpBase64).map((function(e){return dr(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=exports.AreaCode.BJ),Ur[Dr(t)].staticConfigUrlBase64).map((function(e){return dr(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=exports.AreaCode.BJ),Ur[Dr(r)].cloudControllerUrlBase64).map((function(e){return dr(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:exports.AreaCode.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!exports.AreaCode[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=e||{},i=n.active,o=n.activeServer,s=(null==i?void 0:i.addrs)||[],a=(r=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===r&&(r=exports.AreaCode.BJ),Ur[Dr(r)].statsUrlBase64).map((function(e){return dr(e)})),c=[];return 0!==s.length?c.push.apply(c,l([],u(s.sort((function(e,t){return t.weight-e.weight})).map((function(e){return zt(e.addr,e.protocol)}))),!1)):o&&c.push(zt(o,H.HTTPS)),a.forEach((function(e){c.includes(e)||c.push(e)})),c}}),e}(),Vr=new Gr,jr=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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:if(!(t=this.getCache()))return[3,6];s.label=1;case 1:return s.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=s.sent(),(i=n.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return zt(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=s.sent(),this.logger.error(B.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),s.label=6;case 6:return[4,this._requestHandle()];case 7:return(a=s.sent())?[4,this.decryptData(a)]:[2];case 8:return(null==(u=s.sent())?void 0:u.areaCode)!==Vr.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:a})),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 zt(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,c,d,_,f,p;return s(this,(function(s){switch(s.label){case 0:e=(e=l(l([],u(this.staticUrls),!1),u(Vr.getStaticConfigUrl()),!1).map((function(e){return zt(e)}))).filter((function(t,r){return e.indexOf(t)===r})),s.label=1;case 1:s.trys.push([1,6,7,8]),t=a(e),r=t.next(),s.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(B.L_GET_STATIC_CONF_T,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(o=s.sent(),c=o.code,d=o.data,200===c)return this.logger.info(B.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),[2,d];this.logger.warn(B.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),s.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return _=s.sent(),f={error:_},[3,8];case 7:try{r&&!r.done&&(p=t.return)&&p.call(t)}finally{if(f)throw f.error}return[7];case 8:return[2]}}))}))}}),e}();exports.LogL=void 0,(xr=exports.LogL||(exports.LogL={}))[xr.STATISTICS=-2]="STATISTICS",xr[xr.RECORD=-1]="RECORD",xr[xr.FATAL=0]="FATAL",xr[xr.ERROR=1]="ERROR",xr[xr.WARN=2]="WARN",xr[xr.INFO=3]="INFO",xr[xr.DEBUG=4]="DEBUG";var kr,Fr,Br=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,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:exports.LogL.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.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!==exports.LogL.DEBUG&&this.logDB.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 ct}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,r=e.tag,n=e.content,i=e.traceId,o=e.level,s=e.loggerId;if(console&&!(o<=exports.LogL.FATAL||o>this.outputLevel)){var a=["error","warn","info","debug"][o-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=s?s:this._id,"][").concat((a||"stat").toUpperCase(),"]: ").concat(r," | ").concat(n," | ").concat(i);console[a||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){(function(e){return[exports.LogL.DEBUG,exports.LogL.INFO,exports.LogL.WARN,exports.LogL.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,o,s){if(void 0===i&&(i={}),t.isOk){var a=null==o?void 0:o(t.data);this.info(e,JSON.stringify(n(n({isOk:!0},i),a)),r)}else{a=null==s?void 0:s(t.data);this.warn(e,JSON.stringify(n(n({code:t.code,msg:t.msg},i),a)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),Hr=function(){function e(e,t,r,n,i,o){void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}return Object.defineProperty(e.prototype,"_getLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return o(this,void 0,void 0,(function(){var i,o;return s(this,(function(s){switch(s.label){case 0:i=[],s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.logDB.read(e,t,r,n,a)];case 2:return o=s.sent(),ht(o.logs)&&(i=o.logs.filter((function(e){return!(!e||"object"!=typeof e)}))),[3,4];case 3:return s.sent(),[3,4];case 4:return[2,{logs:i}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=Vr.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 o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,_,f,p;return s(this,(function(s){switch(s.label){case 0:return[4,this.compressLogs(e)];case 1:return i=s.sent(),o=i.success,a=i.data,o?(u=Rt(r)?r:"https://".concat(r),u+="?version=".concat("5.32.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:u,body:a,method:"POST"})]):[2,{isOk:!1,itv:n}];case 2:if(l=s.sent(),c=l.status,d=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,d)try{(p=JSON.parse(d)).nextTime&&(n=p.nextTime),_=p.level,f=p.logSwitch}catch(e){this.logger.warn(B.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:_,logSwitch:f}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,c,d,_,f,p,h,g,E=this;return s(this,(function(s){switch(s.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||dt,a=Math.max(i-3e4,o+1),c=this.logger.createTraceId(),[4,this._getLogs(o,a,t,!0,c,n)];case 1:return 0!==(d=s.sent().logs).length?[3,2]:[3,4];case 2:return d.length>0?[4,this._sendLogs2Realtime(d,c,e,r)]:[3,4];case 3:_=s.sent(),f=_.itv,p=_.level,h=_.logSwitch,_.isOk&&(g=Math.max.apply(Math,l([],u(d.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(g+1),0===h&&(this.started=!1),void 0!==p&&(t=p)),r=f,s.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,i,a,u){return void 0===u&&(u=!1),o(this,void 0,void 0,(function(){var o,l,c,d,_,f,p,h;return s(this,(function(s){switch(s.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(o=this.logger.createTraceId(),this.logger.info(B.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:a,isCloudControl:u}),o),[4,this._getLogs(e,t,exports.LogL.DEBUG,!1,o)]);case 1:return l=s.sent().logs,this.logger.info(B.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),o),c=Rt(n)?n:"https://".concat(n),c+="?version=".concat("5.32.0","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),l.length>0?[4,this.compressLogs(l)]:[3,3];case 2:return _=s.sent(),f=_.success,p=_.data,d=f?p:"compress failed",[3,4];case 3:d="no data or no database",s.label=4;case 4:return this.logger.debug(B.L_REPORT_FULL_LOG_O,"compress done",o),u&&(c+="&source=cloud"),[4,this.send({url:c,body:d,method:"POST"})];case 5:return h=s.sent().status,this.logger.info(B.L_REPORT_FULL_LOG_R,JSON.stringify({status:h}),o),[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}(),qr=function(e){var t=e.sessionId,r=e.level,n=e.loggerId,i=e.traceId,o=e.time,s=e.tag,a=e.type,u=e.content;_t(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(o,",").concat(a,",").concat(r,",").concat(s,",").concat(l,"\n")};function Yr(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 Wr(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{logs:[]}]}))}))}function Jr(){}var Kr=function(){function e(e,t){kr.set(this,void 0),Fr.set(this,void 0),d(this,kr,e,"f"),d(this,Fr,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,c(this,kr,"f").call(this,e,t,r,n,i)];case 1:return(o=s.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(Yr)}]:[2,{logs:[]}];case 2:return a=s.sent(),console.error("[LogDBProxy] read error",a),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{c(this,Fr,"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&&d(this,kr,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&d(this,Fr,e,"f"),this}}),e}();function Qr(){return new Kr(Wr,Jr)}kr=new WeakMap,Fr=new WeakMap;var Xr,Zr=function(){function e(){}var t,r,n,i,o,s;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,t,"f",r)||(d(this,t,e,"f",r),e.info(B.L_EVENT_LOOP_BLOCKING_S,"start"),c(this,t,"m",s).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,t,"f",r)&&(c(this,t,"f",r).info(B.L_EVENT_LOOP_BLOCKING_S,"stop"),d(this,t,null,"f",r),c(this,t,"f",n)&&(clearTimeout(c(this,t,"f",n)),d(this,t,null,"f",n)))}}),t=e,s=function e(){var s=this,a=Date.now();d(this,t,setTimeout((function(){var n=Date.now()-a;n>=c(s,t,"f",o)&&c(s,t,"f",r).warn(B.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(n,"ms")),c(s,t,"m",e).call(s)}),c(this,t,"f",i)),"f",n)},r={value:null},n={value:null},i={value:30},o={value:1500},e}();!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(Xr||(Xr={}));var zr=function(){function e(e){Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"uploadTask",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"taskLock",{enumerable:!0,configurable:!0,writable:!0,value:!0})}return Object.defineProperty(e.prototype,"uploadLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.uploadTask.push(e),this.enqueueTask()}}),Object.defineProperty(e.prototype,"reportLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o=this;this.taskLock=!1;var s=null!==(t=e.startTime)&&void 0!==t?t:0,a=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(s,a,u,l,e.logId,"",!0).finally((function(){o.taskLock=!0,o.uploadTask.length>0&&o.enqueueTask()})))}}),Object.defineProperty(e.prototype,"enqueueTask",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.taskLock){var e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}}}),e}();var $r,en,tn,rn,nn=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 zr(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===me.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,It(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 o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,_,f;return s(this,(function(s){switch(s.label){case 0:return!this.isEable&&t===Xr.init&&this.isExire()?(this.logger.info(B.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===Xr.newWorkChange&&this.isOverclock()?(this.logger.info(B.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=zt(e),this.lastRequestTime=(new Date).getTime(),i="".concat(n,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},r&&(o["RC-Token"]=r),a={platform:"web",version:"5.32.0",timestamp:this.timestamp},this.logger.record(ve.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,exports.HttpMethod.POST,o,a)]);case 1:return u=s.sent(),l=u.code,c=u.data,this.logger.record(ve.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===exports.ErrorCode.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(d=c.targetRegion,this.changeAreaCode===d?[2,this.timestamp]:(_=Vr.setAreaCode(d),this.logger.info(B.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:_,originAreaCode:Vr.getAreaCode(),newAreaCode:d})),this.changeAreaCode=d,(f=Vr.getCloudControllerUrl(d))[0]?[2,this.request(f[0],Xr.other)]:(this.logger.info(B.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}(),on=function(e){return e===exports.ErrorCode.RC_CONN_REDIRECTED},sn=function(e){function r(t,r,n){var i=e.call(this)||this;return $r.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:""}),rn.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:exports.RCConnectionStatus.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===exports.RCConnectionStatus.DISCONNECTED&&e===exports.RCConnectionStatus.CONNECTING&&(this._doConnectReason=Pe.CONNECT,c(this,$r,"m",tn).call(this)),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED&&e===exports.RCConnectionStatus.SUSPENDED&&(t===exports.ErrorCode.RC_PING_EXCEED_LIMIT?this._doConnectReason=Pe.TIMEOUT:t===exports.ErrorCode.RC_CONN_REDIRECTED?this._doConnectReason=Pe.REDIRECTED:this._doConnectReason=Pe.RECONNECT),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED){var r={bid:Xt(),cod:t,net:this.getNetwork().type,dur:Date.now()-c(this,rn,"f"),cid:this.cid};this.logger.record(ve.IM_CONNECTION_DURATION,JSON.stringify(r)),e===exports.RCConnectionStatus.SUSPENDED&&c(this,$r,"m",tn).call(this)}switch(this._crtConnectionStatus=e,e){case exports.RCConnectionStatus.CONNECTED:this.logger.info(B.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),c(this,$r,"m",en).call(this).emit("onConnected",this._fromSuspend);break;case exports.RCConnectionStatus.CONNECTING:this.logger.warn(B.L_CONNECT_S,"status: ".concat(e)),c(this,$r,"m",en).call(this).emit("onConnecting");break;case exports.RCConnectionStatus.SUSPENDED:this._fromSuspend=!0,this.logger.warn(B.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),on(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,$r,"m",en).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(B.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,$r,"m",en).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===exports.RCConnectionStatus.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(ve.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 o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED?[2,ar(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[4,this.try2Connect(e,t,!1,n,!0)]);case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2,ur(o)]):(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2,ar(a)])}}))}))}}),Object.defineProperty(r.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,r,n,i),[4,this._crtConnectionTask]);case 1:return o=s.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(r.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c,_,f,p,h,g;return s(this,(function(s){switch(s.label){case 0:return o={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0},this.logger.record(ve.IM_STATS_CS,JSON.stringify(o)),a={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,r,!1,n,a)];case 1:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,ur(l)]:1===(_=c).type?[2,ur(exports.ErrorCode.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(B.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),_,t,n)]);case 2:return f=s.sent(),p=f.code,h=f.data,i||p===exports.ErrorCode.SUCCESS||(this.retryCount+=1),on(p)?(this.logger.warn(B.L_CONNECT_R,"redirect code: ".concat(p),n),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,n,i)]):[exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP,exports.ErrorCode.CONNECTION_REFUSED].includes(p)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),g=this.cmpWeightCache.every((function(e){return e.failed})),i&&g?(this.logger.warn(B.L_CONNECT_R,"cpp code:".concat(p,",reture code:").concat(exports.ErrorCode.SERVER_UNAVAILABLE),n),[2,ur(exports.ErrorCode.SERVER_UNAVAILABLE)]):(this.logger.warn(B.L_CONNECT_R,"cmp ack timeout, code: ".concat(p),n),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,p),this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,i)])):p!==exports.ErrorCode.SUCCESS?(this.logger.warn(B.L_CONNECT_R,"code: ".concat(p),n),[2,ur(p)]):(this.logger.info(B.L_CONNECT_R,"userId: ".concat(h),n),d(this,rn,Date.now(),"f"),this._crtUserId=h,[2,ar(h)])}}))}))}}),Object.defineProperty(r.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){return r=this.logger.createTraceId(),this.logger.debug(B.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return o(i,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.SUSPENDED?[2]:(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=s.sent(),o=i.code,a=i.isOk,this.reconnectTimer=null,a?(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2]):[exports.ErrorCode.SERVER_UNAVAILABLE,exports.ErrorCode.TIMEOUT,exports.ErrorCode.RC_SOCKET_DISCONNECTED,exports.ErrorCode.RC_SOCKET_NOT_CREATED,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_NAVI_REQ_FAILED,exports.ErrorCode.RC_NETWORK_DOWN,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTING||(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,o),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(r.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return on(e)?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===exports.ErrorCode.RC_UDP_DISCONNECTED?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,e)}}),Object.defineProperty(r.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(r.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?(this._failedCount=0,this.logger.debug(B.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(B.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===exports.ErrorCode.SUCCESS?(this.logger.debug(B.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(B.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(B.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,exports.ErrorCode.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,exports.ErrorCode.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(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(exports.RCConnectionStatus.DISCONNECTED,exports.ErrorCode.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 l([],u(this.cmpWeightCache),!1);var r=Mt(e,t);return this.cmpWeightCache=l([],u(r),!1),l([],u(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===H.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var o=Math.min.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==o&&(n.weight=o-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}(nr);rn=new WeakMap,$r=new WeakSet,en=function(){return this},tn=function(){this.uuid=lt.gen(),this.retryCount=0};var an=function(e){return e.replace(/@.+$/,"@")},un=function(){function e(e,t,r,n,i,o){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isUseDynamicNaviUrl",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"crtRequest",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:"default"})}return Object.defineProperty(e.prototype,"getCatchKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e+(this._environment?"-".concat(this._environment):"")}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,r,n,i),[4,this.crtRequest]);case 1:return o=s.sent(),this.crtRequest=null,[2,o]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var a;return o(this,void 0,void 0,(function(){var o,u,l,c,d,_,f,p,h,g,E,b,T,v,R,I,m;return s(this,(function(s){switch(s.label){case 0:return o=an(e),u=this.getNaviCache(o),!t&&u&&(l=u.timestamp,c=u.naviInfo,r||Date.now()-l<je)?(this.logger.info(B.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),n),i&&(d=i.uuid,_=i.retryCount,f=i.reason,p={bid:Xt(),ptc:Se.NAVI,cod:exports.ErrorCode.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(a=c.type)&&void 0!==a?a:0,hos:"",cache:Oe.LOCAL,v:Ce.CURRENT,rsn:f,cid:"".concat(d,"_").concat(_),count:_},this.logger.record(ve.IM_NAVI,JSON.stringify(p),n)),[2,ar(c)]):(h=Vr.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(B.L_GET_NAVI_T,JSON.stringify({token:e,uris:h}),n),[4,this.requestHandler(h,e,n,i)]);case 1:return g=s.sent(),E=g.code,b=g.data,E===exports.ErrorCode.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(T=s.sent())?void 0:T.navi)&&(null==T?void 0:T.navi.length)>0?(v=T.navi,[4,this.requestHandler(v,e,n,i)]):[3,4];case 3:R=s.sent(),E=R.code,b=R.data,s.label=4;case 4:return E!==exports.ErrorCode.SUCCESS?(this.logger.warn(B.L_GET_NAVI_R,E,n),[2,ur(E)]):(I=b).code&&200!==I.code?(this.logger.warn(B.L_GET_NAVI_R,I.code,n),[2,ur(this.transHttpCode(I.code))]):Mt(I).length>0?(this.logger.info(B.L_GET_NAVI_R,JSON.stringify({naviInfo:I}),n),this.setNaviCache(o,I),[2,ar(I)]):(m={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(B.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(m)),n),[2,ur(exports.ErrorCode.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,_,f;return s(this,(function(s){switch(s.label){case 0:i=0,o=e.length,s.label=1;case 1:return i<o?(a=i===e.length-1,u=this.useV2Navi()?this.httpRequestV2:this.httpRequest,l=Date.now(),[4,u.call(this,e[i],this.appkey,t,r,a)]):[3,4];case 2:if(c=s.sent(),d=c.code,_=c.data,f={bid:Xt(),ptc:Se.NAVI,cod:d,net:null==n?void 0:n.type,dur:Date.now()-l,spr:0,pr:(null==_?void 0:_.type)||0,hos:e[i],cache:Oe.REQUEST,v:Ce.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(ve.IM_NAVI,JSON.stringify(f),r),[exports.ErrorCode.SUCCESS,exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,exports.ErrorCode.RC_LICENSE_EXPIRED].includes(d))return[2,d===exports.ErrorCode.SUCCESS?ar(_):ur(d)];s.label=3;case 3:return i+=1,[3,1];case 4:return[2,ur(exports.ErrorCode.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 exports.ErrorCode.RC_CONN_TOKEN_INCORRECT;case 416:return exports.ErrorCode.RC_LICENSE_EXPIRED;default:return exports.ErrorCode.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(an(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(an(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,o=e.protocol,s=e.mac;t="".concat(r,"/v2/navi.json?cloud=").concat(0);var a="token=".concat(encodeURIComponent(n),"&v=").concat(Be,"&platfrom=").concat(i);return s&&(a+="&m=".concat(s)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(o,";rtc=4;log=2;iptype=v4,v6")},body:a,url:t,timeout:1e4}}}),Object.defineProperty(e.prototype,"useV2Navi",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),ln=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 cn(e){return ln.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}var dn,_n,fn,pn={MECHANICAL:0,INTELLIGENT:1},hn=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}(),gn=function(e){function r(t,r,n,i){return e.call(this,t,r,n,i)||this}return t(r,e),r}(hn),En=function(e){function r(t,r,n){return e.call(this,Or(t),r,n,t)||this}return t(r,e),r}(hn),bn={NONE:0,TRANSLATING:1,SUCCESS:2,FAILED:3},Tn={DEFAULT:0,AUTO_ON:1,AUTO_OFF:2},vn=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))},Rn=function(){function e(e){dn.add(this),_n.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),d(this,_n,e,"f"),this._logger=e.logger}return Object.defineProperty(e.prototype,"open",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,c(this,dn,"m",fn).call(this,e,c(this,_n,"f"))]}))}))}}),e}();_n=new WeakMap,dn=new WeakSet,fn=function e(t,r){return o(this,void 0,void 0,(function(){var n,i,a,u=this;return s(this,(function(l){switch(l.label){case 0:return 0===t.length?[2,ur(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(n=t.shift(),i=zt(n.addr,n.protocol),i="".concat(i,"/v3/message/get_stream.json?sdkVersion=").concat("5.32.0","&platform=Websocket&messageUID=").concat(r.msgUId),this._logger.info(B.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(i)),[4,this._openHandler(i,r)]);case 1:return[2,(a=l.sent()).or((function(n){return o(u,void 0,void 0,(function(){return s(this,(function(i){return-1===n?[2,c(this,dn,"m",e).call(this,t,r)]:[2,a]}))}))}))]}}))}))};var In=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 o(this,void 0,void 0,(function(){var r,n,i,o,a=this;return s(this,(function(s){return r=fr(),n=r.resolve,i=r.promise,(o=new XMLHttpRequest).open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){a._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),n(ur(-1,"timeout"))},o.onreadystatechange=function(r){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var i=o.getResponseHeader("Content-Type"),s=null==i?void 0:i.startsWith("text/event-stream");if(200===o.status&&s){n(ar());var u=0;o.onprogress=function(e){var r=o.response.slice(u);u=o.response.length,t.onRawContent(r)},o.onerror=function(r){a._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);n(ur(e.code,e.message))}}},o.onerror=function(t){a._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),n(ur(-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}(Rn),mn=vn();var yn=null,An=function(e){return o(void 0,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,On.getNetworkType()];case 1:return t=r.sent(),yn({status:"online"===e.type,type:t}),[2]}}))}))};var Sn,On={tag:"browser",httpReq:function(e){return Cr(e).result()},get localStorage(){return localStorage},get sessionStorage(){return sessionStorage},useNavi:!0,connectPlatform:"",isFromUniapp:mn,createWebSocket:function(e,t){var r=new WebSocket(e,t);return r.binaryType="arraybuffer",Promise.resolve(ar({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){yn=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",An),window.addEventListener("online",An))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",An),window.removeEventListener("online",An)),yn=null},createSSEClient:function(e){return ar(new In(e))},getApiVer:function(){var e=On.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 o=r.match(n[i]);if(o){t=i,e=o[1]||o[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.pullSeAtts=58]="pullSeAtts",e[e.setSeAtt=59]="setSeAtt",e[e.qnTkn=60]="qnTkn",e[e.qnUrl=61]="qnUrl",e[e.aliUrl=62]="aliUrl",e[e.s3Url=63]="s3Url",e[e.stcUrl=64]="stcUrl",e[e.minioUrl=65]="minioUrl",e[e.cleanPMsg=66]="cleanPMsg",e[e.cleanGMsg=67]="cleanGMsg",e[e.cleanCMsg=68]="cleanCMsg",e[e.cleanSMsg=69]="cleanSMsg",e[e.cleanMCMsg=70]="cleanMCMsg",e[e.cleanMPMsg=71]="cleanMPMsg",e[e.cleanMsgBatch=72]="cleanMsgBatch",e[e.rtcPing=73]="rtcPing",e[e.rtc_ntf=74]="rtc_ntf",e[e.rtcSetOutData=75]="rtcSetOutData",e[e.rtcQryUserOutData=76]="rtcQryUserOutData",e[e.addSeTag=77]="addSeTag",e[e.delSeTag=78]="delSeTag",e[e.addTag=79]="addTag",e[e.delTag=80]="delTag",e[e.reportsdk=81]="reportsdk",e[e.pullUgSes=82]="pullUgSes",e[e.pullUgMsg=83]="pullUgMsg",e[e.ugMsg=84]="ugMsg",e[e.qryUgMsg=85]="qryUgMsg",e[e.updUgRTime=86]="updUgRTime",e[e.upMsgEx=87]="upMsgEx",e[e.modifyMsg=88]="modifyMsg",e[e.qryMsgChange=89]="qryMsgChange",e[e.qryMsg=90]="qryMsg",e[e.operate=91]="operate",e[e.s_opNtf=92]="s_opNtf",e[e.ugUnpushQuery=93]="ugUnpushQuery",e[e.ugUnpushSet=94]="ugUnpushSet",e[e.setRtcRoomId=95]="setRtcRoomId",e[e.qryUgUal=96]="qryUgUal",e[e.updUserSub=97]="updUserSub",e[e.pullUserSub=98]="pullUserSub",e[e.pullSubData=99]="pullSubData",e[e.qrySubData=100]="qrySubData",e[e.pullUserProfile=101]="pullUserProfile",e[e.pullOwnProfile=102]="pullOwnProfile",e[e.updProfilePermiss=103]="updProfilePermiss",e[e.qProfilePermiss=104]="qProfilePermiss",e[e.searchUserProfile=105]="searchUserProfile",e[e.updUserProfile=106]="updUserProfile",e[e.pullEventChange=107]="pullEventChange",e[e.channelCreate=108]="channelCreate",e[e.upChannelInfo=109]="upChannelInfo",e[e.qChannelInfo=110]="qChannelInfo",e[e.channelMemKick=111]="channelMemKick",e[e.channelMemQuit=112]="channelMemQuit",e[e.channelDismiss=113]="channelDismiss",e[e.channelTransfer=114]="channelTransfer",e[e.upChannelManager=115]="upChannelManager",e[e.qChannelMem=116]="qChannelMem",e[e.qChannelSpeMem=117]="qChannelSpeMem",e[e.upChannelMem=118]="upChannelMem",e[e.channelMemJoin=119]="channelMemJoin",e[e.channelMemInvite=120]="channelMemInvite",e[e.channelApplyResp=121]="channelApplyResp",e[e.qChannelApplyList=122]="qChannelApplyList",e[e.qChannelMemJoin=123]="qChannelMemJoin",e[e.qChannelMemSpeJoin=124]="qChannelMemSpeJoin",e[e.upChannelRemark=125]="upChannelRemark",e[e.qChannelRemark=126]="qChannelRemark",e[e.upChannelFollow=127]="upChannelFollow",e[e.qChannelFollow=128]="qChannelFollow",e[e.qSimpleUserProfile=129]="qSimpleUserProfile",e[e.friendAdd=130]="friendAdd",e[e.friendDel=131]="friendDel",e[e.friendHandle=132]="friendHandle",e[e.friendSetPf=133]="friendSetPf",e[e.friendCheck=134]="friendCheck",e[e.friendsQuery=135]="friendsQuery",e[e.friendApplyDel=136]="friendApplyDel",e[e.friendsInfoQry=137]="friendsInfoQry",e[e.friendAuthSet=138]="friendAuthSet",e[e.friendAuthGet=139]="friendAuthGet",e[e.addUnpush=140]="addUnpush",e[e.qryUnpush=141]="qryUnpush",e[e.delUnpush=142]="delUnpush",e[e.s_pubCall=143]="s_pubCall",e[e.reqCall=144]="reqCall",e[e.pullKvMsg=145]="pullKvMsg",e[e.readReceipt=146]="readReceipt",e[e.qryReceipt=147]="qryReceipt",e[e.qryReceiptBatch=148]="qryReceiptBatch",e[e.upConvertMsg=149]="upConvertMsg",e[e.pullModifyMsg=150]="pullModifyMsg",e[e.qAppBot=151]="qAppBot",e[e.qBot=152]="qBot"}(Sn||(Sn={}));var Cn=function(e){var t=Sn[e];return t},Nn=function(e){return Sn[e]},Pn=0,Ln=1,Mn=2,wn=3,Un=4,Dn=5,xn=6,Gn=7,Vn=12,jn=13,kn=14,Fn=4,Bn=3,Hn="rtcRJoin_data",qn="rtcRExit",Yn="rtcUPut",Wn="rtcUDel",Jn="rtcSetData",Kn="userSetData",Qn="rtcQryData",Xn="rtcDelData",Zn="rtcToken",zn="rtcUserState",$n="rtcUList",ei="viewerJoinR",ti="viewerExitR",ri="rtcPullKv",ni="rtcIdentityChange",ii="rtcInvite",oi="rtcCancelInvite",si="rtcInviteAnswer",ai="rtcEndInvite",ui="rtcQueryJoined",li=0,ci=1,di=2,_i=3,fi=4,pi=5,hi=6,gi=7,Ei=8,bi=9,Ti=10,vi=11,Ri=12,Ii=13,mi=14,yi=15,Ai=16,Si=17,Oi=18,Ci=19,Ni=20,Pi=1,Li=2,Mi=4,wi=5,Ui=6,Di=7,xi=8,Gi=9,Vi=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,o=r.length;i<o;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 o=e.charCodeAt(n);o>=0&&o<=127?(r+=1,t.push(o)):o>=128&&o<=2047?(r+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(r+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}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,o=e,s="";++i<o.length;){var a=Number(o[i]);if(a===(127&a)||(240&~a?224&~a?192&~a||(a=(a^=192)<<6|128^o[++i]):a=(a=(a^=224)<<6|128^o[++i])<<6|128^o[++i]:a=(a=(a=(a^=240)<<6|128^o[++i])<<6|128^o[++i])<<6|128^o[++i]),!Number.isFinite(a)||a<0||a>1114111||Math.floor(a)!==a)throw RangeError("Invalid code point: ".concat(a));a<=65535?n.push(a):(t=(a-=65536)>>10|55296,r=a%1024|56320,n.push(t,r)),(i+1===o.length||n.length>16384)&&(s+=String.fromCharCode.apply(null,n),n.length=0)}return s}}),e}(),ji=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 Vi.readUTF(r)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),ki=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(l([],u(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=Vi.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}(),Fi=function(){function e(e,t,r,n){void 0===t&&(t=Ln),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}(),Bi=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}(),Hi=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 Fi(e,Pn)}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 ki;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),qi=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===Fn){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}(Bi),Yi=function(e){function r(t){var r=e.call(this,kn)||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}(Hi),Wi=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}(Bi),Ji=function(e){function r(){return e.call(this,Vn)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),r}(Hi),Ki=function(e){function r(t){return e.call(this,t)||this}return t(r,e),r}(Bi),Qi=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}(Bi),Xi=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}(Hi),Zi=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}(Qi),zi=function(e){function r(t,r,n,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"topic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o.topic="string"==typeof r?r:Nn(r),o}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}(Xi),$i=function(e){function r(t,r,n){return e.call(this,Dn,t,n,r)||this}return t(r,e),r}(zi),eo=function(e){function r(t,r,n){return e.call(this,wn,t,n,r)||this}return t(r,e),r}(zi),to=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}(Qi),ro=function(e){function r(t){var r=e.call(this,Un)||this;return r.messageId=t,r}return t(r,e),r}(Xi),no=function(e){function r(t){var r=e.call(this,Gn)||this;return r.messageId=t,r}return t(r,e),r}(Xi),io=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}(Qi),oo=function(e,t){var r=new Uint8Array(e),n=new ji(r),i=n.readByte(),o=function(e){var t,r=e.command;switch(r){case Mn:t=new qi(e);break;case wn:t=new Zi(e);break;case Un:t=new to(e);break;case xn:t=new io(e);break;case jn:t=new Ki(e);break;case kn:t=new Wi(e);break;default:console.error("No support for deserializing ".concat(r," messages"))}return t}(Fi.parse(i));return o&&o.read(n,r.length-1,t),o},so=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=fr(),n=r.resolve,i=r.promise,o=this._logger,s=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(ar());else{var r=JSON.parse(e.data),i=r.code,o=r.message;n(ur(i,o))}},fail:function(t){var r=t.errMsg,i=t.errno;o.warn(B.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:r,errno:i})),n(ur(-1,t.errMsg))},complete:function(){o.debug(B.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return s.onChunkReceived((function(e){var r=Vi.readUTF(new Uint8Array(e.data));o.debug(B.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(r)),t.onRawContent(r)})),i}}),r}(Rn),ao=vn(),uo=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return wx[e].apply(wx,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},lo={setItem:uo("setStorageSync"),getItem:uo("getStorageSync"),removeItem:uo("removeStorageSync"),clear:uo("clearStorageSync")},co=null,_o=function(e){var t=e.isConnected,r=e.networkType;co({status:t,type:r})};var fo={tag:"wechat",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||ke,n=e.headers,i=e.query,o=e.body,s=Ft(e.url,i);return new Promise((function(e){wx.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:lo,sessionStorage:lo,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ao,createWebSocket:function(e,t){var r=wx.connectSocket({url:e,protocols:t});return Promise.resolve(ar({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){co=e,wx.onNetworkStatusChange(_o)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(_o),co=null},createSSEClient:function(e){return ar(new so(e))},get runtimeInfo(){return{type:fo.tag,version:"Unknown"}}},po=vn(),ho=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var n=my[e]({key:t[0]}).data;return n?JSON.stringify(n):n}catch(e){}}},go={setItem:ho("setStorageSync"),getItem:ho("getStorageSync"),removeItem:ho("removeStorageSync"),clear:ho("clearStorageSync")},Eo=null,bo=function(e){var t=e.isConnected,r=e.networkType;Eo({status:t,type:r})};var To={tag:"alipay",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||ke,n=e.headers,i=e.query,o=e.body,s=Ft(e.url,i),a=e.dataType||"json";return new Promise((function(e){my.request({url:s,method:t,headers:n,timeout:r,data:o,dataType:a,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:go,sessionStorage:go,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:po,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return Promise.resolve(ar({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){Eo=e,my.onNetworkStatusChange(bo)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(bo),Eo=null},createSSEClient:function(e){return ur(exports.ErrorCode.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:To.tag,version:"Unknown"}}},vo=vn(),Ro=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return tt[e].apply(tt,l([],u(t),!1))}catch(e){}}},Io={setItem:Ro("setStorageSync"),getItem:Ro("getStorageSync"),removeItem:Ro("removeStorageSync"),clear:Ro("clearStorageSync")},mo=null,yo=function(e){var t=e.isConnected,r=e.networkType;mo({status:t,type:r})};var Ao={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:vo,localStorage:Io,sessionStorage:Io,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:exports.ErrorCode.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(ur(exports.ErrorCode.RC_SOCKET_DISCONNECTED,e.errMsg))}});r(ar({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){mo=e,tt.onNetworkStatusChange(yo)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(yo),mo=null},createSSEClient:function(e){return ur(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Ao.tag,version:"Unknown"}}},So=vn(),Oo=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return swan[e].apply(swan,l([],u(t),!1))}catch(e){}}},Co={setItem:Oo("setStorageSync"),getItem:Oo("getStorageSync"),removeItem:Oo("removeStorageSync"),clear:Oo("clearStorageSync")},No=null,Po=function(e){var t=e.isConnected,r=e.networkType;No({status:t,type:r})};var Lo={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:So,localStorage:Co,sessionStorage:Co,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:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=swan.connectSocket({url:e,protocols:t});return Promise.resolve(ar({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 o(this,void 0,void 0,(function(){return s(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){No=e,swan.onNetworkStatusChange(Po)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Po),No=null},createSSEClient:function(e){return ur(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Lo.tag,version:"Unknown"}}},Mo=vn(),wo=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return jd[e].apply(jd,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Uo={setItem:wo("setStorageSync"),getItem:wo("getStorageSync"),removeItem:wo("removeStorageSync"),clear:wo("clearStorageSync")},Do=null,xo=function(e){var t=e.isConnected,r=e.networkType;Do({status:t,type:r})};var Go={tag:"jingdong",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||ke,n=e.headers,i=e.query,o=e.body,s=Ft(e.url,i);return new Promise((function(e){jd.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Uo,sessionStorage:Uo,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Mo,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),Promise.resolve(ar({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){Do=e,jd.onNetworkStatusChange(xo)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(xo),Do=null},createSSEClient:function(e){return ur(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Go.tag,version:"Unknown"}}},Vo=vn(),jo=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return ks[e].apply(ks,l([],u(t),!1))}catch(e){}}},ko={setItem:jo("setStorageSync"),getItem:jo("getStorageSync"),removeItem:jo("removeStorageSync"),clear:jo("clearStorageSync")},Fo=null,Bo=function(e){var t=e.isConnected,r=e.networkType;Fo({status:t,type:r})};var Ho={tag:"kuaishou",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Vo,localStorage:ko,sessionStorage:ko,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:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=ks.connectSocket({url:e,protocols:t});return Promise.resolve(ar({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){Fo=e,ks.onNetworkStatusChange(Bo)},removeNetworkStatusListener:function(){ks.offNetworkStatusChange(Bo),Fo=null},createSSEClient:function(e){return ur(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Ho.tag,version:"Unknown"}}},qo=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return uni[e].apply(uni,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Yo={setItem:qo("setStorageSync"),getItem:qo("getStorageSync"),removeItem:qo("removeStorageSync"),clear:qo("clearStorageSync")},Wo=null,Jo=function(e){var t=e.isConnected,r=e.networkType;Wo({status:t,type:r})};var Ko={tag:"uniapp",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||ke,n=e.headers,i=e.query,o=e.body,s=Ft(e.url,i);return new Promise((function(e){uni.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Yo,sessionStorage:Yo,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(ar({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){Wo=e,uni.onNetworkStatusChange(Jo)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Jo),Wo=null},createSSEClient:function(e){return ur(exports.ErrorCode.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,r=e.deviceModel,n=e.deviceBrand,i=e.osVersion,o="android"===e.osName?t:i;return"".concat(n||"","|").concat(r||"","|").concat(o||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:Ko.tag,version:"Unknown"}}},Qo=function(e){return e&&e.request&&e.getSystemInfo},Xo="undefined"!=typeof uni&&Qo(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return Ko;case"mp-jd":return Go;case"mp-baidu":return Lo;case"mp-toutiao":return Ao;case"mp-alipay":return To;case"mp-weixin":return fo;case"mp-kuaishou":return Ho;default:return On}}():"undefined"!=typeof jd&&Qo(jd)?Go:"undefined"!=typeof my&&Qo(my)?To:"undefined"!=typeof tt&&Qo(tt)?Ao:"undefined"!=typeof ks&&Qo(ks)?Ho:"undefined"!=typeof swan&&Qo(swan)?Lo:"undefined"!=typeof wx&&Qo(wx)?fo:On;const Zo=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 o(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function s(){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 a(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,d=r?i-1:0,_=r?-1:1,f=e[t+d];for(d+=_,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+e[t+d],d+=_,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+d],d+=_,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=l}return(f?-1:1)*s*Math.pow(2,o-n)}function u(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,d=c>>1,_=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?_/u:_*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=c?(a=0,s=c):s+d>=1?(a=(t*u-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+f]=255&s,f+=p,s/=256,l-=8);e[r+f-p]|=128*h}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 o,s=0,a=0,u=e.length;a<u;++a)t.isByteBuffer(e[a])||(e[a]=t.wrap(e[a],r)),(o=e[a].limit-e[a].offset)>0&&(s+=o);if(0===s)return new t(0,n,i);var l,c=new t(s,n,i);for(a=0;a<u;)(o=(l=e[a++]).limit-l.offset)<=0||(c.view.set(l.view.subarray(l.offset,l.limit),c.offset),c.offset+=o);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,o){if("string"!=typeof n&&(o=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 s;if(t.isByteBuffer(e))return(s=r.clone.call(e)).markedOffset=-1,s;if(e instanceof Uint8Array)s=new t(0,i,o),e.length>0&&(s.buffer=e.buffer,s.offset=e.byteOffset,s.limit=e.byteOffset+e.byteLength,s.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)s=new t(0,i,o),e.byteLength>0&&(s.buffer=e,s.offset=0,s.limit=e.byteLength,s.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(s=new t(e.length,i,o)).limit=e.length;for(var a=0;a<e.length;++a)s.view[a]=e[a]}return s},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,o=e.length,s=o>>3,a=0;for(t+=this.writeVarint32(o,t);s--;)n=1&!!e[a++]|(1&!!e[a++])<<1|(1&!!e[a++])<<2|(1&!!e[a++])<<3|(1&!!e[a++])<<4|(1&!!e[a++])<<5|(1&!!e[a++])<<6|(1&!!e[a++])<<7,this.writeByte(n,t++);if(a<o){var u=0;for(n=0;a<o;)n|=(1&!!e[a++])<<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,o=i>>3,s=0,a=[];for(e+=n.length;o--;)r=this.readByte(e++),a[s++]=!!(1&r),a[s++]=!!(2&r),a[s++]=!!(4&r),a[s++]=!!(8&r),a[s++]=!!(16&r),a[s++]=!!(32&r),a[s++]=!!(64&r),a[s++]=!!(128&r);if(s<i){var u=0;for(r=this.readByte(e++);s<i;)a[s++]=!!(r>>u++&1)}return t&&(this.offset=e),a},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 o=t.low,s=t.high;return this.littleEndian?(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,r+=4,this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s):(this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s,r+=4,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),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 o=new e(n,i,!1);return r&&(this.offset+=8),o},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 o=t.low,s=t.high;return this.littleEndian?(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,r+=4,this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s):(this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s,r+=4,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),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 o=new e(n,i,!0);return r&&(this.offset+=8),o},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=a(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=a(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,o=t.calculateVarint32(e);r+=o;var s=this.buffer.byteLength;for(r>s&&this.resize((s*=2)>r?s:r),r-=o,e>>>=0;e>=128;)i=127&e|128,this.view[r++]=i,e>>>=7;return this.view[r++]=e,n?(this.offset=r,this):o},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 o=Error("Truncated");throw o.truncated=!0,o}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 o=t.calculateVarint64(r),s=r.toInt()>>>0,a=r.shiftRightUnsigned(28).toInt()>>>0,u=r.shiftRightUnsigned(56).toInt()>>>0;n+=o;var l=this.buffer.byteLength;switch(n>l&&this.resize((l*=2)>n?l:n),n-=o,o){case 10:this.view[n+9]=u>>>7&1;case 9:this.view[n+8]=9!==o?128|u:127&u;case 8:this.view[n+7]=8!==o?a>>>21|128:a>>>21&127;case 7:this.view[n+6]=7!==o?a>>>14|128:a>>>14&127;case 6:this.view[n+5]=6!==o?a>>>7|128:a>>>7&127;case 5:this.view[n+4]=5!==o?128|a:127&a;case 4:this.view[n+3]=4!==o?s>>>21|128:s>>>21&127;case 3:this.view[n+2]=3!==o?s>>>14|128:s>>>14&127;case 2:this.view[n+1]=2!==o?s>>>7|128:s>>>7&127;case 1:this.view[n]=1!==o?128|s:127&s}return i?(this.offset+=o,this):o},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,o=0,s=0,a=0;if(i=127&(a=this.view[t++]),128&a&&(i|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(o=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(s=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<7,128&a||this.noAssert&&void 0===a))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|o<<28,o>>>4|s<<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(o(e))[1],t+=i+1;var s=this.buffer.byteLength;return t>s&&this.resize((s*=2)>t?s:t),t-=i+1,c.encodeUTF16toUTF8(o(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=s(),!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(o(e),this.noAssert)[1],t+=4+n;var s=this.buffer.byteLength;if(t>s&&this.resize((s*=2)>t?s: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(o(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),o=this.readUTF8String(i,t.METRICS_BYTES,e+=4);return e+=o.length,r?(this.offset=e,o.string):{string:o.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(o(e))[1],t+=r;var s=this.buffer.byteLength;return t>s&&this.resize((s*=2)>t?s:t),t-=r,c.encodeUTF16toUTF8(o(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(o(e))[0]},t.calculateUTF8Bytes=function(e){return c.calculateUTF16asUTF8(o(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 o,a=0,u=n;if(r===t.METRICS_CHARS){if(o=s(),c.decodeUTF8(function(){return a<e&&n<this.limit?this.view[n++]:null}.bind(this),(function(e){++a,c.UTF8toUTF16(e,o)})),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return i?(this.offset=n,o()):{string:o(),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),o=s(),this.noAssert),n!==l)throw RangeError("Illegal range: Truncated data, "+n+" == "+l);return i?(this.offset=n,o()):{string:o(),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,s,a=r;i=c.calculateUTF16asUTF8(o(e),this.noAssert)[1],s=t.calculateVarint32(i),r+=s+i;var u=this.buffer.byteLength;if(r>u&&this.resize((u*=2)>r?u:r),r-=s+i,r+=this.writeVarint32(i,r),c.encodeUTF16toUTF8(o(e),function(e){this.view[r++]=e}.bind(this)),r!==a+i+s)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+i+s));return n?(this.offset=r,this):r-a},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),o=this.readUTF8String(i.value,t.METRICS_BYTES,e+=i.length);return e+=o.length,r?(this.offset=e,o.string):{string:o.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 o=e.limit-e.offset;if(o<=0)return this;n+=o;var s=this.buffer.byteLength;return n>s&&this.resize((s*=2)>n?s:n),n-=o,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=o,i&&(this.offset+=o),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),o=new Uint8Array(i);return o.set(this.view.subarray(e,t)),this.buffer=i,this.view=o,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 o,s;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(s=void 0===r)?e.offset:0|r,n=(o=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 a=i-n;return 0===a?e:(e.ensureCapacity(r+a),e.view.set(this.view.subarray(n,i),r),o&&(this.offset+=a),s&&(e.offset+=a),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 o=e.limit-e.offset;if(o<=0)return this;var s=o-n;if(s>0){var a=new ArrayBuffer(this.buffer.byteLength+s),u=new Uint8Array(a);u.set(this.view.subarray(n,this.buffer.byteLength),o),this.buffer=a,this.view=u,this.offset+=s,this.markedOffset>=0&&(this.markedOffset+=s),this.limit+=s,n+=s}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),n-o),e.offset=e.limit,i&&(this.offset-=o),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,o;function s(e){throw Error("Illegal character code: "+e)}for(;null!==(n=e());)if(void 0===(i=r[n])&&s(n),null!==(n=e())&&(void 0===(o=r[n])&&s(n),t(i<<2>>>0|(48&o)>>4),null!==(n=e()))){if(void 0===(i=r[n])){if(61===n)break;s(n)}if(t((15&o)<<4>>>0|(60&i)>>2),null!==(n=e())){if(void 0===(o=r[n])){if(61===n)break;s(n)}t((3&i)<<6>>>0|o)}}},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=s()),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(o(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,o=e.length,s=new t(o,r);i<o;){if((n=e.charCodeAt(i))>255)throw RangeError("illegal char code: "+n);s.view[i++]=n}return s.limit=o,s},r.toDebug=function(e){for(var t,r=-1,n=this.buffer.byteLength,i="",o="",s="";r<n;){if(-1!==r&&(i+=(t=this.view[r])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==n){for(;i.length<51;)i+=" ";s+=i+o+"\n",i=o=""}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+=" ";s+=i+o+"\n"}return e?s:i},t.fromDebug=function(e,r,n){for(var i,o,s=e.length,a=new t((s+1)/3|0,r,n),u=0,l=0,c=!1,d=!1,_=!1,f=!1,p=!1;u<s;){switch(i=e.charAt(u++)){case"!":if(!n){if(d||_||f){p=!0;break}d=_=f=!0}a.offset=a.markedOffset=a.limit=l,c=!1;break;case"|":if(!n){if(d||f){p=!0;break}d=f=!0}a.offset=a.limit=l,c=!1;break;case"[":if(!n){if(d||_){p=!0;break}d=_=!0}a.offset=a.markedOffset=l,c=!1;break;case"<":if(!n){if(d){p=!0;break}d=!0}a.offset=l,c=!1;break;case"]":if(!n){if(f||_){p=!0;break}f=_=!0}a.limit=a.markedOffset=l,c=!1;break;case">":if(!n){if(f){p=!0;break}f=!0}a.limit=l,c=!1;break;case"'":if(!n){if(_){p=!0;break}_=!0}a.markedOffset=l,c=!1;break;case" ":c=!1;break;default:if(!n&&c){p=!0;break}if(o=parseInt(i+e.charAt(u++),16),!n&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[l++]=o,c=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!n){if(!d||!f)throw TypeError("Illegal str: Missing offset or limit");if(l<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+s)}return a},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,o=e.length,s=new t(o/2|0,r),a=0,u=0;a<o;a+=2){if(i=parseInt(e.substring(a,a+2),16),!n&&(!isFinite(i)||i<0||i>255))throw TypeError("Illegal str: Contains non-hex characters");s.view[u++]=i}return s.limit=u,s};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,o,s=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())&&s([r,n]),t((31&r)<<6|63&n);else if(224==(240&r))(null===(n=e())||null===(i=e()))&&s([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===(o=e()))&&s([r,n,i,o]),t((7&r)<<18|(63&n)<<12|(63&i)<<6|63&o)}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=s())}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(o(e),!0)[1],r,n),s=0;return c.encodeUTF16toUTF8(o(e),(function(e){i.view[s++]=e})),i.limit=s,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,o,a;return t?(a=0<=(e>>>=0)&&e<256)&&(o=n[e])?o:(i=s(e,(0|e)<0?-1:0,!0),a&&(n[e]=i),i):(a=-128<=(e|=0)&&e<128)&&(o=r[e])?o:(i=s(e,e<0?-1:0,!1),a&&(r[e]=i),i)}function o(e,t){if(isNaN(e)||!isFinite(e))return t?h:p;if(t){if(e<0)return h;if(e>=d)return v}else{if(e<=-_)return R;if(e+1>=_)return T}return e<0?o(-e,t).neg():s(e%c|0,e/c|0,t)}function s(t,r,n){return new e(t,r,n)}e.fromInt=i,e.fromNumber=o,e.fromBits=s;var a=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 p;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=o(a(r,8)),s=p,l=0;l<e.length;l+=8){var c=Math.min(8,e.length-l),d=parseInt(e.substring(l,l+c),r);if(c<8){var _=o(a(r,c));s=s.mul(_).add(o(d))}else s=(s=s.mul(i)).add(o(d))}return s.unsigned=t,s}function l(t){return t instanceof e?t:"number"==typeof t?o(t):"string"==typeof t?u(t):s(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=l;var c=4294967296,d=c*c,_=d/2,f=i(1<<24),p=i(0);e.ZERO=p;var h=i(0,!0);e.UZERO=h;var g=i(1);e.ONE=g;var E=i(1,!0);e.UONE=E;var b=i(-1);e.NEG_ONE=b;var T=s(-1,2147483647,!1);e.MAX_VALUE=T;var v=s(-1,-1,!0);e.MAX_UNSIGNED_VALUE=v;var R=s(0,-2147483648,!1);e.MIN_VALUE=R;var I=e.prototype;return I.toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},I.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(R)){var t=o(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=o(a(e,6),this.unsigned),s=this,u="";;){var l=s.div(i),c=(s.sub(l.mul(i)).toInt()>>>0).toString(e);if((s=l).isZero())return c+u;for(;c.length<6;)c="0"+c;u=""+c+u}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){if(this.isNegative())return this.eq(R)?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},I.isZero=function(){return 0===this.high&&0===this.low},I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return!(1&~this.low)},I.isEven=function(){return!(1&this.low)},I.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)},I.eq=I.equals,I.notEquals=function(e){return!this.eq(e)},I.neq=I.notEquals,I.lessThan=function(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.greaterThan=function(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.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},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(R)?R:this.not().add(g)},I.neg=I.negate,I.add=function(e){t(e)||(e=l(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,a=e.high>>>16,u=65535&e.high,c=e.low>>>16,d=0,_=0,f=0,p=0;return f+=(p+=o+(65535&e.low))>>>16,_+=(f+=i+c)>>>16,d+=(_+=n+u)>>>16,d+=r+a,s((f&=65535)<<16|(p&=65535),(d&=65535)<<16|(_&=65535),this.unsigned)},I.subtract=function(e){return t(e)||(e=l(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){if(this.isZero())return p;if(t(e)||(e=l(e)),e.isZero())return p;if(this.eq(R))return e.isOdd()?R:p;if(e.eq(R))return this.isOdd()?R:p;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(f)&&e.lt(f))return o(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,c=65535&e.high,d=e.low>>>16,_=65535&e.low,h=0,g=0,E=0,b=0;return E+=(b+=a*_)>>>16,g+=(E+=i*_)>>>16,E&=65535,g+=(E+=a*d)>>>16,h+=(g+=n*_)>>>16,g&=65535,h+=(g+=i*d)>>>16,g&=65535,h+=(g+=a*c)>>>16,h+=r*_+n*d+i*c+a*u,s((E&=65535)<<16|(b&=65535),(h&=65535)<<16|(g&=65535),this.unsigned)},I.mul=I.multiply,I.divide=function(e){if(t(e)||(e=l(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?h:p;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return h;if(e.gt(this.shru(1)))return E;i=h}else{if(this.eq(R))return e.eq(g)||e.eq(b)?R:e.eq(R)?g:(r=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?g:b:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(R))return this.unsigned?h:p;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=p}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),u=s<=48?1:a(2,s-48),c=o(r),d=c.mul(e);d.isNegative()||d.gt(n);)d=(c=o(r-=u,this.unsigned)).mul(e);c.isZero()&&(c=g),i=i.add(c),n=n.sub(d)}return i},I.div=I.divide,I.modulo=function(e){return t(e)||(e=l(e)),this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.not=function(){return s(~this.low,~this.high,this.unsigned)},I.and=function(e){return t(e)||(e=l(e)),s(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return t(e)||(e=l(e)),s(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return t(e)||(e=l(e)),s(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?s(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):s(0,this.low<<e-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?s(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):s(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var r=this.high;return e<32?s(this.low>>>e|r<<32-e,r>>>e,this.unsigned):s(32===e?r:r>>>e-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.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]},I.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 o=this.source.substring(this.index,this.index=i);return'"'!==o&&"'"!==o||(this._stringOpen=o),o},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 o=function(e){this.tn=new n(e),this.proto3=!1},s=o.prototype;function a(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 s.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},o.parse=function(e){return new o(e).parse()},s._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},s._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)},s._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 o=n;i&&(this.tn.skip(")"),o="("+o+")",n=this.tn.peek(),t.FQTYPEREF.test(n)&&(o+=n,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,o),r||this.tn.skip(";")},s._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)}},s._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)},s._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,o={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),"stream"===(n=this.tn.next()).toLowerCase()&&(o.request_stream=!0,n=this.tn.next()),!t.TYPEREF.test(n))throw Error("illegal rpc service request type: "+n);if(o.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()&&(o.response_stream=!0,n=this.tn.next()),o.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(o)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[r]&&(e[r]={}),e[r][i]=o},s._parseMessage=function(e,r){var n=!!r,i=this.tn.next(),o={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(i))throw Error("illegal "+(n?"group":"message")+" name: "+i);for(o.name=i,n&&(this.tn.skip("="),r.id=a(this.tn.next()),o.isGroup=!0),"["===(i=this.tn.peek())&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(i=this.tn.next());)if(t.RULE.test(i))this._parseMessageField(o,i);else if("oneof"===i)this._parseMessageOneOf(o);else if("enum"===i)this._parseEnum(o);else if("message"===i)this._parseMessage(o);else if("option"===i)this._parseOption(o);else if("service"===i)this._parseService(o);else if("extensions"===i)o.hasOwnProperty("extensions")?o.extensions=o.extensions.concat(this._parseExtensionRanges()):o.extensions=this._parseExtensionRanges();else if("reserved"===i)this._parseIgnored();else if("extend"===i)this._parseExtend(o);else{if(!t.TYPEREF.test(i))throw Error("illegal message token: "+i);if(!this.proto3)throw Error("illegal field rule: "+i);this._parseMessageField(o,"optional",i)}return this.tn.omit(";"),e.messages.push(o),o},s._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},s._parseMessageField=function(e,r,n){if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);var i,o={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(o.keytype=i,this.tn.skip(","),i=this.tn.next(),!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field: "+i);if(o.type=i,this.tn.skip(">"),i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);o.name=i,this.tn.skip("="),o.id=a(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(n=void 0!==n?n:this.tn.next())){var s=this._parseMessage(e,o);if(!/^[A-Z]/.test(s.name))throw Error("illegal group name: "+s.name);o.type=s.name,o.name=s.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(n)&&!t.TYPEREF.test(n))throw Error("illegal message field type: "+n);if(o.type=n,i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);o.name=i,this.tn.skip("="),o.id=a(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},s._parseMessageOneOf=function(e){var r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal oneof name: "+r);var n,i=r,o=[];for(this.tn.skip("{");"}"!==(r=this.tn.next());)(n=this._parseMessageField(e,"optional",r)).oneof=i,o.push(n.id);this.tn.omit(";"),e.oneofs[i]=o},s._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()},s._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:a(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)},s._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},s._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},s.toString=function(){return"Parser at line "+this.tn.line},r.Parser=o,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 o=function(e,t,r,i,o){n.call(this,e,t,r),this.className="Namespace",this.children=[],this.options=i||{},this.syntax=o||"proto2"},s=o.prototype=Object.create(n.prototype);s.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},s.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)},s.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},s.resolve=function(e,r){var n,i="string"==typeof e?e.split("."):e,o=this,s=0;if(""===i[s]){for(;null!==o.parent;)o=o.parent;s++}do{do{if(!(o instanceof t.Namespace)){o=null;break}if(!(n=o.getChild(i[s]))||!(n instanceof t.T)||r&&!(n instanceof t.Namespace)){o=null;break}o=n,s++}while(s<i.length);if(null!=o)break;if(null!==this.parent)return this.parent.resolve(e,r)}while(null!=o);return o},s.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 o=r.slice(r.length-i);if(e===this.resolve(o,e instanceof t.Namespace))return o.join(".")}return e.fqn()},s.build=function(){for(var e,t={},r=this.children,n=0,i=r.length;n<i;++n)(e=r[n])instanceof o&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},s.buildOpt=function(){for(var e={},t=Object.keys(this.options),r=0,n=t.length;r<n;++r){var i=t[r],o=this.options[t[r]];e[i]=o}return e},s.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},t.Namespace=o;var a=function(t,r,n,i,o){if(this.type=t,this.resolvedType=r,this.isMapKey=n,this.syntax=i,this.name=o,n&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=a.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")}a.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 o=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(a=0;a<o.length;a++){if(o[a].name==t)return o[a].id;if(o[a].id==t)return o[a].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 s={};for(var a in t)t.hasOwnProperty(a)&&(s[a]=t[a]);t=s}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 o=n.offset;i.writeVarint32(n.remaining()),i.append(n),n.offset=o;break;case e.TYPES.message:var s=(new r).LE();this.resolvedType.encode(n,s),i.writeVarint32(s.offset),i.append(s.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,o;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(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return(i=t.clone()).limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);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=a;var c=function(e,t,r,n,i,s){o.call(this,e,t,r,n,s),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},d=c.prototype=Object.create(o.prototype);function _(t,r){var n=r.readVarint32(),i=7&n,o=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:_(o,r);break;case e.WIRE_TYPES.ENDGROUP:if(o===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+o+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:r.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+i)}return!0}d.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),o=function(s,a){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 d;if(arguments.length>0)if(1!==arguments.length||null===s||"object"!=typeof s||!("function"!=typeof s.encode||s instanceof o)||Array.isArray(s)||s instanceof e.Map||r.isByteBuffer(s)||s instanceof ArrayBuffer||e.Long&&s instanceof e.Long)for(u=0,l=arguments.length;u<l;++u)void 0!==(d=arguments[u])&&this.$set(n[u].name,d);else this.$set(s)},s=o.prototype=Object.create(e.Builder.Message.prototype);s.add=function(r,n,i){var o=t._fieldsByName[r];if(!i){if(!o)throw Error(this+"#"+r+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+r+" is not a repeated field");n=o.verifyValue(n,!0)}return null===this[r]&&(this[r]=[]),this[r].push(n),this},s.$add=s.add,s.set=function(r,n,i){if(r&&"object"==typeof r){for(var o in i=n,r)r.hasOwnProperty(o)&&void 0!==(n=r[o])&&void 0===t._oneofsByName[o]&&this.$set(o,n,i);return this}var s=t._fieldsByName[r];if(i)this[r]=n;else{if(!s)throw Error(this+"#"+r+" is not a field: undefined");if(!(s instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+s.toString(!0));this[s.name]=n=s.verifyValue(n)}if(s&&s.oneof){var a=this[s.oneof.name];null!==n?(null!==a&&a!==s.name&&(this[a]=null),this[s.oneof.name]=s.name):a===r&&(this[s.oneof.name]=null)}return this},s.$set=s.set,s.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]},s.$get=s.get;for(var a=0;a<n.length;a++){var u=n[a];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},o=function(){return this[e.name]};null===t.getChild("set"+r)&&(s["set"+r]=i),null===t.getChild("set_"+n)&&(s["set_"+n]=i),null===t.getChild("get"+r)&&(s["get"+r]=o),null===t.getChild("get_"+n)&&(s["get_"+n]=o)}(u)}function l(t,n,i,o){if(null===t||"object"!=typeof t){if(o&&o instanceof e.Reflect.Enum){var s=e.Reflect.Enum.getName(o.object,t);if(null!==s)return s}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 a;if(Array.isArray(t))return a=[],t.forEach((function(e,t){a[t]=l(e,n,i,o)})),a;if(a={},t instanceof e.Map){for(var u=t.entries(),c=u.next();!c.done;c=u.next())a[t.keyElem.valueToString(c.value[0])]=l(c.value[1],n,i,t.valueElem.resolvedType);return a}var d=t.$type,_=void 0;for(var f in t)t.hasOwnProperty(f)&&(d&&(_=d.getChild(f))?a[f]=l(t[f],n,i,_.resolvedType):a[f]=l(t[f],n,i));return a}return s.encode=function(e,n){"boolean"==typeof e&&(n=e,e=void 0);var i=!1;e||(e=new r,i=!0);var o=e.littleEndian;try{return t.encode(this,e.LE(),n),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},o.encode=function(e,t,r){return new o(e).encode(t,r)},s.calculate=function(){return t.calculate(this)},s.encodeDelimited=function(e,n){var i=!1;e||(e=new r,i=!0);var o=(new r).LE();return t.encode(this,o,n).flip(),e.writeVarint32(o.remaining()),e.append(o),i?e.flip():e},s.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},s.toArrayBuffer=s.encodeAB,s.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},s.toBuffer=s.encodeNB,s.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},s.toBase64=s.encode64,s.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},s.toHex=s.encodeHex,s.toRaw=function(e,t){return l(this,!!e,!!t,this.$type)},s.encodeJSON=function(){return JSON.stringify(l(this,!0,!0,this.$type))},o.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 o=e.littleEndian;try{var s=t.decode(e.LE(),n);return e.LE(o),s}catch(t){throw e.LE(o),t}},o.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,o=e.readVarint32();if(e.remaining()<o)return e.offset=i,null;try{var s=t.decode(e.slice(e.offset,e.offset+o).LE());return e.offset+=o,s}catch(t){throw e.offset+=o,t}},o.decode64=function(e){return o.decode(e,"base64")},o.decodeHex=function(e){return o.decode(e,"hex")},o.decodeJSON=function(e){return new o(JSON.parse(e))},s.toString=function(){return t.toString()},Object.defineProperty&&(Object.defineProperty(o,"$options",{value:t.buildOpt()}),Object.defineProperty(s,"$options",{value:o.$options}),Object.defineProperty(o,"$type",{value:t}),Object.defineProperty(s,"$type",{value:t})),o}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={},this._oneofsByName={};for(var i,o=0,s=this.children.length;o<s;o++)if((i=this.children[o])instanceof g||i instanceof c||i instanceof T){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 b))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[o].toString(!0));return this.clazz=n},d.encode=function(e,t,r){for(var n,i,o=null,s=0,a=this._fields.length;s<a;++s)i=e[(n=this._fields[s]).name],n.required&&null===i?null===o&&(o=n):n.encode(r?i:n.verifyValue(i),t,e);if(null!==o){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+o);throw u.encoded=t,u}return t},d.calculate=function(e){for(var t,r,n=0,i=0,o=this._fields.length;i<o;++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},d.decode=function(t,r,n){"number"!=typeof r&&(r=-1);for(var i,o,s,a,u=t.offset,l=new this.clazz;t.offset<u+r||-1===r&&t.remaining()>0;){if(s=(i=t.readVarint32())>>>3,(o=7&i)===e.WIRE_TYPES.ENDGROUP){if(s!==n)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+s+" ("+(n?n+" expected":"not a group")+")");break}if(a=this._fieldsById[s]){if(a.repeated&&!a.options.packed)l[a.name].push(a.decode(o,t));else if(a.map){var c=a.decode(o,t);l[a.name].set(c[0],c[1])}else if(l[a.name]=a.decode(o,t),a.oneof){var d=l[a.oneof.name];null!==d&&d!==a.name&&(l[d]=null),l[a.oneof.name]=a.name}}else switch(o){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 f=t.readVarint32();t.offset+=f;break;case e.WIRE_TYPES.STARTGROUP:for(;_(s,t););break;default:throw Error("Illegal wire type for unknown field "+s+" in "+this.toString(!0)+"#decode: "+o)}}for(var p=0,h=this._fields.length;p<h;++p)if(null===l[(a=this._fields[p]).name])if("proto3"===this.syntax)l[a.name]=a.defaultValue;else{if(a.required){var g=Error("Missing at least one required field for "+this.toString(!0)+": "+a.name);throw g.decoded=l,g}e.populateDefaults&&null!==a.defaultValue&&(l[a.name]=a.defaultValue)}return l},t.Message=c;var f=function(t,r,i,o,s,a,u,l,d,_){n.call(this,t,r,a),this.className="Message.Field",this.required="required"===i,this.repeated="repeated"===i,this.map="map"===i,this.keyType=o||null,this.type=s,this.resolvedType=null,this.id=u,this.options=l||{},this.defaultValue=null,this.oneof=d||null,this.syntax=_||"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))},p=f.prototype=Object.create(n.prototype);p.build=function(){this.element=new a(this.type,this.resolvedType,!1,this.syntax,this.name),this.map&&(this.keyElement=new a(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=a.defaultFieldValue(this.type)},p.verifyValue=function(t,r){r=r||!1;var n,i=this;function o(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}if(null===t)return this.required&&o(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&o(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!r){Array.isArray(t)||(t=[t]);var s=[];for(n=0;n<t.length;n++)s.push(this.element.verifyValue(t[n]));return s}return this.map&&!r?t instanceof e.Map?t:(t instanceof Object||o(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&o(typeof t,"no array expected"),this.element.verifyValue(t))},p.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}},p.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 o;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 s=n.offset;for(o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],n);var a=n.offset-s,u=r.calculateVarint32(a);if(u>1){var l=n.slice(s,n.offset);s+=u-1,n.offset=s,n.append(l)}n.writeVarint32(a,s-u)}else for(o=0;o<t.length;o++)n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[o],n);else this.map?t.forEach((function(t,i,o){var s=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(s),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},p.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 o,s;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),s=0,o=0;o<t.length;o++)s+=this.element.calculateLength(this.id,t[o]);i+=r.calculateVarint32(s),i+=s}else for(o=0;o<t.length;o++)i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[o]);else this.map?t.forEach((function(t,n,o){var s=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(s),i+=s}),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},p.decode=function(t,r,n){var i,o;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){o=r.readVarint32(),o=r.offset+o;for(var s=[];r.offset<o;)s.push(this.decode(this.type.wireType,r,!0));return s}if(this.map){var u=a.defaultFieldValue(this.keyType);if(i=a.defaultFieldValue(this.type),o=r.readVarint32(),r.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+r.remaining());var l=r.clone();for(l.limit=l.offset+o,r.offset+=o;l.remaining()>0;){var c=l.readVarint32();t=7&c;var d=c>>>3;if(1===d)u=this.keyElement.decode(l,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(l,t,d)}}return[u,i]}return this.element.decode(r,t,this.id)},t.Message.Field=f;var h=function(e,t,r,n,i,o,s){f.call(this,e,t,r,null,n,i,o,s),this.extension};h.prototype=Object.create(f.prototype),t.Message.ExtensionField=h;t.Message.OneOf=function(e,t,r){n.call(this,e,t,r),this.fields=[]};var g=function(e,t,r,n,i){o.call(this,e,t,r,n,i),this.className="Enum",this.object=null};g.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},(g.prototype=Object.create(o.prototype)).build=function(t){if(this.object&&!t)return this.object;for(var r=new e.Builder.Enum,n=this.getChildren(g.Value),i=0,o=n.length;i<o;++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=g;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 b=function(e,t,r,i){n.call(this,e,t,r),this.field=i};b.prototype=Object.create(n.prototype),t.Extension=b;var T=function(e,t,r,n){o.call(this,e,t,r,n),this.className="Service",this.clazz=null};(T.prototype=Object.create(o.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),o=t.getChildren(e.Reflect.Service.RPCMethod),s=0;s<o.length;s++)!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}))}(o[s]);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=T;var v=function(e,t,r,i){n.call(this,e,t,r),this.className="Service.Method",this.options=i||{}};(v.prototype=Object.create(n.prototype)).buildOpt=s.buildOpt,t.Service.Method=v;var R=function(e,t,r,n,i,o,s,a){v.call(this,e,t,r,a),this.className="Service.RPCMethod",this.requestName=n,this.responseName=i,this.requestStream=o,this.responseStream=s,this.resolvedRequestType=null,this.resolvedResponseType=null};return R.prototype=Object.create(v.prototype),t.Service.RPCMethod=R,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 o(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,o(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 o=t.shift();if(n.isMessage(o)){var s=new r.Message(this,this.ptr,o.name,o.options,o.isGroup,o.syntax),a={};o.oneofs&&Object.keys(o.oneofs).forEach((function(e){s.addChild(a[e]=new r.Message.OneOf(this,s,e))}),this),o.fields&&o.fields.forEach((function(e){if(null!==s.getChild(0|e.id))throw Error("duplicate or invalid field id in "+s.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+s.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=a[e.oneof]))throw Error("illegal oneof in "+s.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,s,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,o.syntax),t&&t.fields.push(e),s.addChild(e)}),this);var u=[];if(o.enums&&o.enums.forEach((function(e){u.push(e)})),o.messages&&o.messages.forEach((function(e){u.push(e)})),o.services&&o.services.forEach((function(e){u.push(e)})),o.extensions&&("number"==typeof o.extensions[0]?s.extensions=[o.extensions]:s.extensions=o.extensions),this.ptr.addChild(s),u.length>0){i.push(t),t=u,u=null,this.ptr=s,s=null;continue}u=null}else if(n.isEnum(o))s=new r.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){s.addChild(new r.Enum.Value(this,s,e.name,e.id))}),this),this.ptr.addChild(s);else if(n.isService(o))s=new r.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];s.addChild(new r.Service.RPCMethod(this,s,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(s);else{if(!n.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(s=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(t){if(null!==s.getChild(0|t.id))throw Error("duplicate extended field id in "+s.name+": "+t.id);if(s.extensions){var n=!1;if(s.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)})),!n)throw Error("illegal extended field id in "+s.name+": "+t.id+" (not within valid ranges)")}var i=t.name;this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i));var o=new r.Message.ExtensionField(this,s,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),a=new r.Extension(this,this.ptr,t.name,o);o.extension=a,this.ptr.addChild(a),s.addChild(o)}),this);else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("extended message "+o.ref+" is not defined")}o=null,s=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,s=r.root;if(e.Util.IS_NODE&&(s=require("path").resolve(s)),(s.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(n="\\"),i=e.Util.IS_NODE?require("path").join(s,r.file):s+n+r.file,!0===this.files[i])return this.reset();this.files[i]=!0}if(t.imports&&t.imports.length>0){var a,u=!1;"object"==typeof r?(this.importRoot=r.root,u=!0,a=this.importRoot,r=r.file,(a.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(n="\\")):"string"==typeof r?this.importRoot?a=this.importRoot:r.indexOf("/")>=0?""===(a=r.replace(/\/[^\/]*$/,""))&&(a="/"):r.indexOf("\\")>=0?(a=r.replace(/\\[^\\]*$/,""),n="\\"):a=".":a=null;for(var l=0;l<t.imports.length;l++)if("string"==typeof t.imports[l]){if(!a)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(a,c):a+n+c,!0===this.files[c])continue;/\.proto$/i.test(c)&&!e.DotProto&&(c=c.replace(/\.proto$/,".json"));var d=e.Util.fetch(c);if(null===d)throw Error("failed to import '"+c+"' in '"+r+"': file not found");/\.json$/i.test(c)?this.import(JSON.parse(d+""),c):this.import(e.DotProto.Parser.parse(d),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&&o(t);var _=this.ptr;return t.options&&Object.keys(t.options).forEach((function(e){_.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=_),t.enums&&(this.create(t.enums),this.ptr=_),t.services&&(this.create(t.services),this.ptr=_),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 o=this.keyElem.valueFromString(n[i]),s=this.valueElem.verifyValue(r[n[i]]);this.map[this.keyElem.valueToString(o)]={key:o,value:s}}},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 zo,$o,es,ts,rs,ns,is,os,ss,as="NotifyMsg",us="SyncRequestMsg",ls="UpStreamMessage",cs="DownStreamMessages",ds="ChrmDownStreamMessages",_s="DownStreamMessage",fs="ExtMsgData",ps="GetQNupTokenInput",hs="GetDownloadUrlInput",gs="GetQNupTokenOutput",Es="GetDownloadUrlOutput",bs="ChrmInput",Ts="ChrmOutput",vs="ChrmPullMsg",Rs="RelationQryInput",Is="RelationQryFilter",ms="RelationsOutput",ys="QryRemindListReq",As="QryRemindListResp",Ss="CleanHisMsgInput",Os="CleanMsgBatchReq",Cs="QueryChatRoomInfoInput",Ns="QueryChatRoomInfoOutput",Ps="HistoryMsgInput",Ls="HistoryMsgOuput",Ms="SessionsAttQryInput",ws="SessionsAttOutput",Us="SessionMsgReadInput",Ds="DeleteSessionsInput",xs="QuerySessionsInput",Gs="QuerySessionsOutPut",Vs="RelationDelBatchReq",js="DeleteMsgInput",Fs="SetChrmKV",Bs="SetChrmKVS",Hs="ChrmKVOutput",qs="ChrmKVSOutput",Ys="QueryChrmKV",Ws="SetUserSettingInput",Js="SetUserSettingOutput",Ks="PullUserSettingInput",Qs="PullUserSettingOutput",Xs="SessionReq",Zs="SessionStates",zs="SessionStateModifyReq",$s="GroupUnpushQuery",ea="GroupUnpushSet",ta="GroupUnpushResult",ra="SessionStateModifyResp",na="TypeUnpushInput",ia="TypeUnpushOutput",oa="GrpReadReceiptMsg",sa="ReadReceipt",aa="QueryReceiptReq",ua="QueryReceiptBatchReq",la="ReceiptResp",ca="QueryReceiptBatchResp",da="GrpReadReceiptQryResp",_a="SessionTagAddInput",fa="SessionTagDelInput",pa="UserSettingNotification",ha="ReportSDKInput",ga="UltraGrpPullSes",Ea="UltraGrpPullMsg",ba="MsgChangeReq",Ta="ModifyMsgResp",va="QueryMsgChange",Ra="EventChangeList",Ia="MsgChangeList",ma="MsgQuery",ya="MsgQueryAck",Aa="OperateStatus",Sa="OperateStatusNotify",Oa="SetRtcRoomIdInput",Ca="CallInfoUpStream",Na="CallInfoDownStream",Pa="KvInput",La="KvOutput",Ma="ReadReceiptMsg",wa="ReceiptQryReq",Ua="QueryReceiptResp",Da="ReceiptCntQryReq",xa="ReceiptCntQryResp",Ga="UpdateUserSubReq",Va="UpdateUserSubResp",ja="PullUserSubReq",ka="PUllUserSubResp",Fa="PullSubDataReq",Ba="PullSubDataResp",Ha="SubDataDetail",qa="QrySubDataReq",Ya="UserProfile",Wa="SetUserProfileResp",Ja="PullUserProfileReq",Ka="UserProfiles",Qa="UserProfileInput",Xa="UserProfilePermission",Za="SearchUserProfile",za="ChannelsInput",$a="ChannelsOutput",eu="MultiChannels",tu="ModifyChannelsInput",ru="ChannelsQueryInput",nu="ChannelsListResult",iu="ChannelsInviteStatusInfos",ou="ChannelsUserInfos",su="ChannelsJoinedInfos",au="ChannelsMemberUpdateInput",uu="ChannelsMemberResponseInput",lu="ChannelsMembersInput",cu="FriendInput",du="FriendsInput",_u="FriendsCheckOutput",fu="FriendProfileInput",pu="FriendProfileOutput",hu="FriendQueryInput",gu="FriendsListInput",Eu="FriendLevelSet",bu="FriendUserInfos",Tu="FriendInviteInfos",vu="ChannelApplyInfo",Ru="AddUnpushPeriodInput",Iu="DeleteUnpushPeriodInput",mu="QueryUnpushPeriodInput",yu="QueryUnpushPeriodOutput",Au="MsgReadEvent",Su="ConvertMsgInput",Ou="SpeechToTextInfo",Cu="ConvertMsgOutput",Nu="SpeechToTextResult",Pu="TransReq",Lu="TransResp",Mu="PullModifyMsgReq",wu="PullModifyMsgResp",Uu="SetUserStatusInput",Du="MCFollowInput",xu="RtcQueryListInput",Gu="RtcKeyDeleteInput",Vu="RtcValueInfo",ju="RtcUserListOutput",ku="RtcInput",Fu="RtcQryOutput",Bu="RtcDataInput",Hu="RtcSetDataInput",qu="RtcUserSetDataInput",Yu="RtcOutput",Wu="RtcTokenOutput",Ju="RtcNotifyMsg",Ku="RtcPullKV",Qu="RtcKVOutput",Xu="RtcQueryUserJoinedInput",Zu="RtcQueryUserJoinedOutput",zu="RtcViewerJoinedOutput",$u="RtcInviteInput",el="RtcCancelInviteInput",tl="RtcInviteAnswerInput",rl="RtcEndInviteInput",nl="BotInput",il="BotOutput",ol=function(){function e(e){zo.add(this),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0});var t=Zo.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 c(this,zo,"m",$o).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}();zo=new WeakSet,$o=function e(t,r){var n,i=this;if(t instanceof Array)return t.map((function(t){return c(i,zo,"m",e).call(i,t)}));if(n=t,"[object Object]"!==Object.prototype.toString.call(n))return t;if(t instanceof Zo.ByteBuffer)return t.toArrayBuffer();if(t instanceof Zo.Long)return r?t.toString():t.toNumber();var o={};return Object.keys(t).forEach((function(r){var n=t[r],s=t.$type.name===fs&&"seqId"===r;o[r]=c(i,zo,"m",e).call(i,n,s)})),o},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"}(es||(es={})),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"}(ts||(ts={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(rs||(rs={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags",e[e.AutoTrans=4]="AutoTrans"}(ns||(ns={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(is||(is={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(os||(os={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(ss||(ss={}));var sl,al,ul,ll,cl,dl,_l,fl,pl,hl=new ol("package Modules;\nmessage probuf {\n message SetUserStatusOutput {\n optional int32 nothing=1;\n }\n message GetUserStatusInput {\n optional int32 nothing=1;\n }\n message GetUserStatusOutput {\n optional string status=1;\n optional string subUserId=2;\n }\n message SubUserStatusInput {\n repeated string userid =1;\n }\n message SubUserStatusOutput {\n optional int32 nothing=1;\n }\n message VoipDynamicInput {\n required int32 engineType = 1;\n required string channelName = 2;\n optional string channelExtra = 3;\n }\n message VoipDynamicOutput {\n required string dynamicKey=1;\n }\n message NotifyMsg {\n required int32 type = 1;\n optional int64 time = 2;\n optional string chrmId=3;\n }\n message SyncRequestMsg {\n required int64 syncTime = 1;\n required bool ispolling = 2;\n optional bool isweb=3;\n optional bool isPullSend=4;\n optional bool isKeeping=5;\n optional int64 sendBoxSyncTime=6;\n optional int64 broadcastSyncTime=7;\n optional int64 endTime = 8;\n optional bool compressioEnabled = 9;\n }\n message UpStreamMessage {\n required int32 sessionId = 1;\n required string classname = 2;\n required string content = 3;\n optional string pushText = 4;\n optional string appData = 5;\n repeated string toUserIds = 6;\n optional int64 delMsgTime = 7;\n optional string delMsgId = 8;\n optional int32 configFlag = 9;\n optional int64 clientUniqueId = 10;\n optional string extraContent = 11;\n optional PushExtra pushExt = 12;\n optional string busChannel = 13;\n optional string systemId = 16;\n optional string senderPortrait = 21;\n optional int64 optionBits = 22;\n }\n message PushExtra {\n optional string title = 1;\n optional int32 templateIdNoUse= 2;\n optional string pushId = 3;\n optional string pushConfigs = 4;\n optional string templateId = 5;\n }\n message DownStreamMessages {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n optional bool finished = 3;\n optional int64 broadcastSyncTime = 4;\n optional int64 systemTime = 5;\n optional int64 credibleStartTime = 6;\n optional int64 credibleEndTime = 7;\n optional bool compressioEnabled = 8;\n optional bytes compressedData = 9;\n }\n message ChrmDownStreamMessages {\n repeated bytes list = 1;\n required int64 syncTime = 2;\n optional bool compressioEnabled = 3;\n optional bytes compressedData = 4;\n }\n message DownStreamMessage {\n required string fromUserId = 1;\n required ChannelType type = 2;\n optional string groupId = 3;\n required string classname = 4;\n required string content = 5;\n required int64 dataTime = 6;\n required int64 status = 7;\n optional int64 extra = 8;\n optional string msgId = 9;\n optional int32 direction = 10;\n optional int32 plantform =11;\n optional int32 isRemoved = 12;\n optional string source = 13;\n optional int64 clientUniqueId = 14;\n optional string extraContent = 15;\n optional string pushContent = 16;\n optional int32 configFlag = 17;\n optional PushExtra pushExt = 18;\n optional string busChannel = 19;\n optional int64 extStatus = 20;\n repeated string toUserIds = 21;\n optional int32 groupUnpush = 22;\n optional int64 optionBits = 23;\n optional string convertExt = 24;\n optional ExtMsgData extMsgData = 25;\n }\n message ExtMsgData {\n optional int64 seqId = 1;\n optional int64 sendTime = 2;\n }\n enum ChannelType {\n PERSON = 1;\n PERSONS = 2;\n GROUP = 3;\n TEMPGROUP = 4;\n CUSTOMERSERVICE = 5;\n NOTIFY = 6;\n MC=7;\n MP=8;\n ULTRAGROUP = 10;\n }\n message CreateDiscussionInput {\n optional string name = 1;\n }\n message CreateDiscussionOutput {\n required string id = 1;\n }\n message ChannelInvitationInput {\n repeated string users = 1;\n }\n message LeaveChannelInput {\n required int32 nothing = 1;\n }\n message ChannelEvictionInput {\n required string user = 1;\n }\n message RenameChannelInput {\n required string name = 1;\n }\n message ChannelInfoInput {\n required int32 nothing = 1;\n }\n message ChannelInfoOutput {\n required ChannelType type = 1;\n required string channelId = 2;\n required string channelName = 3;\n required string adminUserId = 4;\n repeated string firstTenUserIds = 5;\n required int32 openStatus = 6;\n }\n message ChannelInfosInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message ChannelInfosOutput {\n repeated ChannelInfoOutput channels = 1;\n required int32 total = 2;\n }\n message MemberInfo {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n required string extension = 4;\n }\n message GroupMembersInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message GroupMembersOutput {\n repeated MemberInfo members = 1;\n required int32 total = 2;\n }\n message GetUserInfoInput {\n required int32 nothing = 1;\n }\n message GetUserInfoOutput {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n }\n message GetSessionIdInput {\n required int32 nothing = 1;\n }\n message GetSessionIdOutput {\n required int32 sessionId = 1;\n }\n enum FileType {\n IMAGE = 1;\n AUDIO = 2;\n VIDEO = 3;\n FILE = 4;\n SIGHT = 5;\n COMBINE_HTML = 6;\n }\n message GetQNupTokenInput {\n required FileType type = 1;\n optional string key = 2;\n optional string httpMethod = 3;\n optional string queryString = 4;\n optional string url = 5;\n optional string ext = 6;\n optional int64 size = 7;\n optional int32 ipType = 8;\n }\n message GetQNdownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message GetDownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n optional string ext = 4;\n optional int64 size = 5;\n optional int32 ipType = 6;\n }\n message GetQNupTokenOutput {\n required int64 deadline = 1;\n required string token = 2;\n optional string bosToken = 3;\n optional string bosDate = 4;\n optional string path = 5;\n\n optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\n\n optional string s3Credential = 10;\n optional string s3Algorithm = 11;\n optional string s3Date = 12;\n optional string s3Policy = 13;\n optional string s3Signature = 14;\n optional string s3BucketName = 15;\n\n optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n optional string minioAuthorization = 20;\n optional string minioContentSha256 = 21;\n optional string minioDate = 22;\n optional string minioBucketName = 23;\n\n optional string downloadAuthInfo = 24;\n optional string ossConfig = 25;\n }\n message GetQNdownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message GetDownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message Add2BlackListInput {\n required string userId = 1;\n }\n message RemoveFromBlackListInput {\n required string userId = 1;\n }\n message QueryBlackListInput {\n required int32 nothing = 1;\n }\n message QueryBlackListOutput {\n repeated string userIds = 1;\n }\n message BlackListStatusInput {\n required string userId = 1;\n }\n message BlockPushInput {\n required string blockeeId = 1;\n }\n message ModifyPermissionInput {\n required int32 openStatus = 1;\n }\n message GroupInput {\n repeated GroupInfo groupInfo = 1;\n }\n message GroupOutput {\n required int32 nothing = 1;\n }\n message GroupInfo {\n required string id = 1;\n required string name = 2;\n }\n message GroupHashInput {\n required string userId = 1;\n required string groupHashCode = 2;\n }\n message GroupHashOutput {\n required GroupHashType result = 1;\n }\n enum GroupHashType {\n GROUP_SUCCESS = 0x00;\n GROUP_FAILURE = 0x01;\n }\n message ChrmInput {\n required int32 nothing = 1;\n optional string extra = 2;\n }\n message ChrmOutput {\n required int32 nothing = 1;\n optional string sessionId = 2;\n optional int64 joinTime = 3;\n optional int64 createTime = 4;\n optional int32 memberCount = 5;\n optional int32 chatroomBanState = 6;\n optional int32 whiteListState = 7;\n }\n message ChrmPullMsg {\n required int64 syncTime = 1;\n required int32 count = 2;\n optional int32 pullMsgType = 3;\n optional bool compressioEnabled = 4;\n }\n message ChrmPullMsgNew {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message RelationQryInput {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n optional bool isEraseMsgContent = 5;\n optional int64 endTime = 6;\n optional bool compressioEnabled = 7;\n optional int32 qryType = 8;\n repeated ChannelType channelType = 9;\n optional int32 botType = 10;\n }\n message RelationQryFilter {\n repeated ChannelType type = 1;\n optional int32 count = 2;\n optional int32 order = 3;\n repeated string tags = 4;\n optional bool isTagTop = 5;\n optional string pageToken = 6;\n optional bool compress = 7;\n }\n message RelationsOutput {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;\n optional int64 pullTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n optional string pageToken = 6;\n }\n message RelationInfo {\n required ChannelType type = 1;\n required string userId = 2;\n optional DownStreamMessage msg =3;\n optional int64 readMsgTime= 4;\n optional int64 unreadCount= 5;\n optional string busChannel = 6;\n optional int64 versionTime = 7;\n optional int64 remindCount = 8;\n optional int32 busChannelType = 9;\n optional UnreadMsgInfo msgInfo = 10;\n optional int32 remindMeCount = 11;\n optional bool isBot = 12;\n }\n message UnreadMsgInfo {\n required string msgId = 1;\n required int64 msgTime= 2;\n optional int32 remindType= 3;\n optional string className = 4;\n }\n message QryRemindListReq {\n required string groupId = 1;\n optional string busChannel = 2;\n optional int64 msgTime = 3;\n optional int32 size = 4;\n }\n message QryRemindListResp {\n repeated UnreadMsgInfo msgInfo = 1;\n }\n message RelationInfoReadTime {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message CleanHisMsgInput {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4;\n }\n message CleanMsgBatchReq {\n repeated CleanHisMsgInput input = 1;\n }\n message HistoryMessageInput {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6; \n optional bytes compressedData = 7;\n }\n message QueryChatRoomInfoInput {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message QueryChatRoomInfoOutput {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput {\n required string id = 1;\n }\n\n message MPFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo {\n required string mpid=1;\n required string name = 2;\n required string type = 3;\n required int64 time=4;\n optional string portraitUrl=5;\n optional string extra =6;\n }\n\n message SearchMpInput {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message HistoryMsgInput {\n optional string targetId = 1;\n optional int64 time = 2;\n optional int32 count = 3;\n optional int32 order = 4;\n optional string busChannel = 5;\n optional bool compressioEnabled = 6;\n optional bool ignoreCmd = 10;\n }\n\n message HistoryMsgOuput {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6;\n optional bytes compressedData = 7;\n }\n message SessionsAttQryInput {\n required int32 nothing = 1;\n }\n message SessionsAttOutput {\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message SessionMsgReadInput {\n required ChannelType type = 1;\n required int64 msgTime = 2;\n required string channelId = 3;\n optional string busChannel = 4;\n }\n message SessionMsgReadOutput {\n optional int32 nothing=1;\n }\n message DeleteSessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message SessionInfo {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 unreadCount = 3;\n optional string busChannel = 4;\n }\n message QuerySessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message QuerySessionsOutPut {\n repeated SessionInfo sessions = 1;\n }\n message DeleteSessionsOutput {\n optional int32 nothing=1;\n }\n message RelationDelBatchReq {\n repeated RelationOpInput relation = 1;\n optional bool cleanMsg = 2;\n }\n message RelationOpInput {\n required string conversationId = 1;\n required ChannelType conversationType = 2;\n optional string busChannel = 3;\n }\n message DeleteMsgInput {\n optional ChannelType type = 1;\n optional string conversationId = 2;\n repeated DeleteMsg msgs = 3;\n optional string busChannel = 4;\n }\n message DeleteMsg {\n optional string msgId = 1;\n optional int64 msgDataTime = 2;\n optional int32 direct = 3;\n }\n message ChrmKVEntity {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n optional int64 version = 6;\n }\n message SetChrmKV {\n required ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message SetChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message DeleteChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ChrmKVOutput {\n repeated ChrmKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message ChrmKVSVersionEntity {\n optional int64 version = 1;\n optional string key = 2;\n }\n\n message ChrmKVSOutput {\n repeated ChrmKVSOutputEntity errorKeys = 1;\n repeated ChrmKVSVersionEntity keysVersion = 2;\n }\n message ChrmKVSOutputEntity {\n optional string key = 1;\n optional int32 errorCode = 2;\n }\n message QueryChrmKV {\n required int64 timestamp = 1;\n optional bool compressioEnabled = 2;\n }\n message SetUserSettingInput {\n required int64 version=1;\n required string value=2;\n optional bool ignoreVersion = 3;\n }\n message SetUserSettingOutput {\n required int64 version=1;\n required bool reserve=2;\n optional bool updateVersion = 3;\n }\n message PullUserSettingInput {\n required int64 version=1;\n optional bool reserve=2;\n optional int32 ipType = 3;\n }\n message PullUserSettingOutput {\n repeated UserSettingItem items = 1;\n required int64 version=2;\n }\n message UserSettingItem {\n required string targetId= 1;\n required ChannelType type = 2;\n required string key = 4;\n required bytes value = 5;\n required int64 version=6;\n required int32 status=7;\n repeated SessionTagItem tags= 8;\n }\n message SessionReq {\n required int64 time = 1;\n }\n message SessionStates {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message SessionState {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 time = 3;\n repeated SessionStateItem stateItem = 4;\n optional string busChannel = 5;\n }\n message SessionStateItem {\n required SessionStateType sessionStateType = 1;\n required string value = 2;\n repeated SessionTagItem tags = 3;\n optional int64 time = 4;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n AutoTrans = 4;\n }\n message SessionStateModifyReq {\n required int64 version=1;\n repeated SessionState state= 2;\n optional bool ignoreVersion = 3;\n }\n message GroupUnpushQuery {\n optional string busChannel = 1;\n }\n message GroupUnpushSet{\n optional string busChannel = 1;\n required int32 unpushLevel = 2;\n }\n message GroupUnpushResult {\n required string groupId = 1;\n optional string busChannel = 2;\n required int32 unpushLevel = 3;\n }\n message SessionStateModifyResp {\n required int64 version=1;\n optional bool updateVersion = 2;\n }\n message TypeUnpushInput {\n required ChannelType type = 1;\n required int64 version = 2;\n required int32 unpushLevel = 3;\n optional bool ignoreVersion = 4;\n }\n message TypeUnpushOutput {\n required int64 version = 1;\n optional bool updateVersion = 2;\n }\n message GrpReadReceiptMsg {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message GrpReadReceiptQryReq {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message ReadReceipt {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string channelId = 3;\n optional int32 readType =4 ;\n repeated string msgIds= 5 ;\n optional string fromId = 6;\n }\n message QueryReceiptReq {\n optional string targetId = 1;\n optional string busChannel =2;\n optional int32 type = 3;\n repeated string msgIds = 4;\n optional int32 qryType = 5;\n optional int32 order =6;\n optional bool compress = 7;\n optional int32 readType = 8;\n optional int32 pageType = 9; \n optional int32 pageSize = 10;\n optional string pageToken = 11;\n repeated string users = 12;\n }\n message QueryReceiptBatchReq {\n repeated QueryReceipt items = 1;\n optional bool compress = 2;\n }\n message QueryReceipt {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 type = 3;\n repeated string msgIds = 4;\n }\n message ReceiptResp {\n repeated QueryReceiptRespItem resp = 1;\n optional bool compress = 2;\n optional bytes compressData = 3;\n optional string pageToken = 4;\n }\n message QueryReceiptBatchResp {\n repeated QueryReceiptBatchRespItem item = 1;\n optional bool compress = 2;\n optional bytes compressData = 3;\n }\n\n message QueryReceiptBatchRespItem {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 type = 3;\n repeated QueryReceiptRespItem msg = 4;\n }\n message QueryReceiptRespItem {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int64 readCnt = 4;\n repeated ReceiptUser readUser = 5;\n repeated string unreadList = 6;\n optional int64 unreadCnt = 7;\n repeated ReceiptUser unreadUser = 8;\n }\n message GrpReadReceiptQryResp {\n required int32 totalMemberNum = 1;\n repeated GrpMsgReadUser list = 2;\n }\n message GrpMsgReadUser {\n required int64 readTime = 1;\n required string userId = 2;\n }\n message SessionTagAddInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n optional bool ignoreVersion = 3;\n }\n message SessionTagItem {\n required string tagId=1;\n optional string name=2;\n optional int64 createdTime=3;\n optional bool isTop=4;\n }\n message SessionTagDelInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n optional bool ignoreVersion = 3;\n }\n message SessionDisTagReq {\n repeated string tagId=1;\n }\n message UserSettingNotification {\n required int64 version=1;\n required bool reserve=2;\n }\n message ReportSDKInput {\n required string sdkInfo=1;\n }\n message ReportSDKOutput {\n optional int32 nothing=1;\n }\n message UltraGrpPullSes {\n required int64 syncTime = 1;\n optional bool isEraseMsgContent = 2;\n }\n message UltraGrpPullMsg {\n required int64 syncTime = 1;\n optional bool compressioEnabled = 2;\n }\n message MsgChangeReq {\n required string fromUserId = 1;\n required string targetId = 2;\n required ChannelType type = 3;\n required string msgUID = 4;\n required int64 msgTime = 5;\n optional string busChannel = 6;\n optional string content = 7;\n }\n message ModifyMsgResp {\n optional int64 modifyTime = 1;\n optional DownStreamMessage msg = 2;\n }\n message QueryMsgChange {\n required int64 syncTime = 1;\n optional int32 needCompress = 2;\n optional int64 onlineTime = 3;\n optional string targetId = 4;\n }\n message EventChangeList {\n repeated EventChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n optional string targetId = 4;\n optional bool isCompress = 5 ;\n }\n message EventChange {\n optional string businessId = 1;\n optional ChannelType channelType = 2;\n optional int64 time = 3;\n optional int32 changeType = 4;\n optional string originalId = 5;\n optional int64 originalTime = 6;\n optional string secondaryId = 7;\n optional bool isAdmin = 8;\n optional bool additionalMark = 9; \n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 secondaryType = 12;\n optional bool isRemindMe = 13;\n repeated string extIds = 14;\n optional int32 remindType = 15;\n optional bytes eventData = 16;\n }\n message MsgChangeList {\n repeated MsgChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n }\n message MsgChange {\n required string targetId = 1;\n required ChannelType type = 2;\n required int64 time = 3;\n required int32 changeType = 4;\n required string msgUID = 5;\n required int64 msgTime = 6;\n optional string busChannel = 7;\n optional bool isAdmin = 8;\n optional bool isDel = 9;\n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 busChannelType = 12;\n optional bool isRemindMe = 13;\n repeated string userGroupIds = 14;\n optional int32 remindType = 15;\n }\n message MsgQuery {\n required string targetId = 1;\n required ChannelType type = 2;\n repeated MessageQueryInfo query = 3; //\n }\n message MessageQueryInfo {\n required int64 msgTime = 1;\n required string msgUID = 2;\n optional string busChannel = 3;\n }\n message MsgQueryAck {\n repeated DownStreamMessage list = 1;\n repeated string notExistMsgId = 2;\n }\n message OperateStatus {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 opType = 3;\n optional string busChannel = 4;\n }\n message OperateStatusNotify {\n optional ChannelType type = 1;\n optional int64 notifyType = 2;\n repeated OperateInfo info = 3 ;\n repeated OperateSummary summary = 4 ;\n }\n message OperateInfo {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional string userId = 3;\n optional int32 opType = 4;\n optional int64 optime = 5;\n }\n \n message OperateSummary {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 count = 3;\n optional int32 opType = 4;\n }\n\n message SetRtcRoomIdInput {\n required string rtcRoomId= 1;\n }\n message SetRtcRoomIdOutput {\n required int32 nothing = 1;\n }\n message CallInfoUpStream {\n required string key= 1;\n required string dataContent=2;\n }\n message CallInfoDownStream {\n required string key= 1;\n required string dataContent=2;\n required int64 maxTime=3;\n }\n message KvInput {\n required int64 syncTime = 1;\n }\n message KvOutput {\n required int64 maxTime = 1;\n repeated KvInfo info = 2;\n }\n message KvInfo {\n required string key =1;\n required string value =2;\n }\n message ReadReceiptMsg {\n required string targetId = 1;\n required ChannelType type = 2;\n optional string busChannel = 3;\n optional string startMsgId = 4;\n optional string endMsgId = 5;\n }\n message ReceiptQryReq {\n required string msgId = 1;\n optional string busChannel = 2;\n required string targetId = 3;\n }\n message QueryReceiptResp {\n optional int32 num = 1;\n repeated ReceiptUser list = 2;\n optional int32 readCnt = 3;\n }\n message ReceiptUser {\n optional int64 receiptTime = 1;\n optional string userId = 2;\n optional string name = 3;\n optional string portrait = 4;\n optional bool mentioned= 5;\n }\n message ReceiptCntQryReq {\n optional ChannelType type = 1;\n optional string channelId = 2;\n optional string busChannel = 3;\n repeated string msgId = 4;\n }\n message ReceiptCntQryResp {\n repeated MsgReadCnt result= 1;\n }\n\n message MsgReadCnt {\n optional string msgId = 1;\n optional int32 cnt = 2;\n optional int32 tmn = 3;\n }\n message UpdateUserSubReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n optional int32 opType = 3;\n optional int32 expiry = 4;\n }\n message UserSubDetail {\n optional string subUserId = 1;\n }\n message UpdateUserSubResp {\n repeated UserSubDetail subUsers = 1;\n optional int64 subTime = 2;\n }\n message PullUserSubReq {\n optional int64 version = 1;\n optional string pageToken = 2;\n }\n message PUllUserSubResp {\n repeated UserSubList list = 1;\n optional int64 version = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message UserSubList {\n repeated UserSubDetail subUsers = 1;\n optional int32 subType = 2;\n optional int64 subTime = 3;\n optional int32 expiry = 4;\n optional int32 opType = 5;\n }\n message PullSubDataReq {\n optional int64 versionTime = 1;\n optional bool needAllData = 2;\n optional string pageToken = 3;\n }\n message PullSubDataResp {\n repeated SubDataDetail list = 1;\n optional int64 versionTime = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message SubDataDetail {\n optional string statusStr = 1;\n optional string subUserId = 2;\n repeated SubData data = 3;\n optional int32 subType = 4;\n }\n\n message SubData {\n optional int32 platformInfo = 1;\n optional int32 value = 2;\n optional int64 versionTime = 3;\n }\n message QrySubDataReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n }\n message UserProfile {\n optional int64 version = 1;\n optional string userId = 2;\n repeated ProfileInfo userProfile = 3;\n repeated ProfileInfo userExtProfile = 4;\n }\n message ProfileInfo {\n optional string key = 1;\n optional string value = 2;\n }\n message SetUserProfileResp {\n optional int64 version = 1;\n optional string key = 2;\n repeated string censorFailedFields = 3;\n }\n message PullUserProfileReq {\n repeated string userId = 1;\n }\n message UserProfiles {\n repeated UserProfile UserProfile = 1;\n }\n message UserProfileInput {\n required int32 nothing = 1;\n }\n message UserProfilePermission {\n optional int32 permission = 1;\n }\n message UserProfileOutput {\n required int32 nothing = 1;\n }\n message SearchUserProfile {\n optional string uniqueId = 1;\n }\n message ChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated ProfileInfo settingProfile = 3;\n repeated ProfileInfo extProfile = 4;\n optional ChannelBaseInfo baseInfo = 5;\n repeated string users = 6;\n }\n\n message ChannelBaseInfo {\n optional string creatorId = 1;\n optional string ownerId = 2;\n optional int64 createTime = 3;\n optional int32 memberCount = 4;\n }\n\n message ChannelsOutput {\n optional int64 operateTime = 1;\n optional int32 flag = 2;\n optional string msg = 3;\n optional int32 processCode = 4;\n optional ChannelsJoinedInfo channelInfo = 5;\n repeated ChannelsUserInfo userInfos = 6;\n optional FriendInviteInfo friendInviteInfo = 7;\n optional FriendUserInfo friendUserInfo = 8;\n repeated string censorFailedFields = 9;\n }\n\n message MultiChannels {\n optional ChannelType type = 1;\n repeated ChannelsInput list = 2;\n }\n\n message ModifyChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional QuitChannelsSetting settingInfo = 3;\n repeated string users = 4;\n optional int32 operateType = 5;\n }\n\n message QuitChannelsSetting {\n optional bool isQuit = 1;\n optional bool isDelBan = 2;\n optional bool isDelWhite = 3;\n optional bool isDelAttention = 4;\n }\n\n message ChannelsQueryInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional ChannelsPageParam page = 3;\n repeated string ids = 4;\n optional int32 roleType = 5;\n optional int32 botType = 6;\n }\n\n message ChannelsPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n optional bool hasNext = 3 ;\n optional int32 total = 4 ;\n optional int32 order = 5 ;\n }\n\n message ChannelsListResult {\n optional int32 listType = 1;\n optional bytes result = 2;\n optional ChannelsPageParam page = 3;\n }\n \n message ChannelsInviteStatusInfos {\n repeated ChannelsInviteStatusInfo list = 1;\n }\n \n message ChannelsUserInfos {\n repeated ChannelsUserInfo list = 1;\n }\n \n message ChannelsJoinedInfos {\n repeated ChannelsJoinedInfo list = 1;\n }\n\n message ChannelsUserInfo {\n optional string userId = 1;\n optional ChannelsUserExtInfo ext = 2;\n optional int64 opTime = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n\n message ChannelsUserExtInfo {\n optional int32 role = 1;\n optional int64 joinTime = 2;\n optional string channelNickName = 3;\n optional string additional = 4;\n optional string remarkName = 5;\n optional bool isBan = 6;\n optional int64 banEndTime = 7;\n optional bool isBot = 8;\n }\n\n message ChannelsMemberUpdateInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional string userId = 3;\n optional string channelNickName = 4;\n optional string additional = 5;\n optional int32 operateType = 6;\n }\n message ChannelsJoinedInfo {\n optional string targetId = 1;\n repeated ProfileInfo settingProfile = 2;\n repeated ProfileInfo extProfile = 3;\n optional ChannelBaseInfo baseInfo = 4;\n optional ChannelsUserExtInfo userInfo = 5;\n }\n message ChannelsInviteStatusInfo {\n optional string targetId = 1;\n optional ChannelsUserInfo joinUserInfo = 2;\n optional ChannelsUserInfo inviterInfo = 3;\n optional int32 status = 4;\n optional int32 directionType = 5;\n optional int32 joinType = 6;\n optional string detail = 7;\n optional int64 applyTime = 8;\n optional ChannelsUserInfo processInfo = 9;\n optional int64 processTime = 10;\n }\n message ChannelsMemberResponseInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 optType = 3;\n optional int32 optResult = 4;\n optional string joinUserId = 5;\n optional string inviterId = 6;\n optional string detail = 7;\n }\n message ChannelsMembersInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string userIds = 3;\n }\n message FriendInput {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string info = 3;\n }\n message FriendsOutput {\n repeated FriendOutput list = 1;\n }\n message FriendOutput {\n optional string userId = 1;\n optional int64 operateTime = 2;\n optional string flag = 3;\n }\n message FriendsInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendsCheckOutput {\n repeated FriendCheckOutput list = 1;\n }\n\n message FriendCheckOutput {\n optional string targetId = 1;\n optional int32 status = 2;\n }\n message FriendProfileInput {\n optional string targetId = 1;\n optional string remarkName = 2;\n repeated ProfileInfo extProfile = 3;\n }\n message FriendProfileOutput {\n repeated string censorFailedFields = 1;\n }\n message FriendQueryInput {\n optional int32 queryType = 1;\n optional ChannelsPageParam page = 2;\n optional int32 friendType= 3;\n }\n message FriendUserInfo {\n optional string userId = 1;\n optional int64 relationTime = 2;\n optional int32 friendType = 3;\n optional int32 flag = 4;\n optional string remarkName = 5;\n optional string name = 6;\n optional string portraitUrl = 7;\n repeated ProfileInfo extProfile = 8;\n \n }\n message FriendInviteInfo {\n optional string userId = 1;\n optional string name = 2;\n optional string portraitUrl = 3;\n optional int32 type = 4;\n optional int32 status = 5;\n optional int64 operateTime = 6;\n optional string info = 7;\n optional int32 friendType = 8;\n }\n message FriendsListInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendLevelSet {\n optional int32 level = 1;\n }\n\n message FriendPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n }\n message FriendUserInfos {\n repeated FriendUserInfo list = 1;\n }\n\n message FriendInviteInfos {\n repeated FriendInviteInfo list = 1;\n }\n \n message FriendApplyEvent {\n optional int32 applyType = 1;\n optional int32 friendType = 2;\n optional string info = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n message UpdateChannnelInfo {\n optional ChannelsJoinedInfo channelInfo = 1;\n optional ChannelsUserInfo userInfo = 2;\n }\n message UpdateUserInfo {\n optional ChannelsUserInfo updatedUserInfo = 1;\n optional ChannelsUserInfo optUserInfo = 2;\n }\n message ChannelApplyInfo {\n repeated ChannelsInviteStatusInfo statusInfo = 1;\n }\n message ChannelEventData {\n optional ChannelsUserInfo optUserInfo = 1;\n optional ChannelsJoinedInfo channelInfo = 2;\n repeated ChannelsUserInfo userInfos = 3;\n optional ChannelsJoinedInfo channelFullInfo = 4;\n }\n message FriendTypeChangeEvent {\n optional string friendId = 1;\n optional int32 friendType = 2;\n }\n message FriendUpdateEvent {\n optional string remarkname = 1;\n repeated ProfileInfo extProfile = 2;\n }\n message AddUnpushPeriodInput {\n required string startTime = 1;\n required int32 spanMinutes = 2;\n optional int32 level = 3;\n optional string timezone = 4;\n }\n message DeleteUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodOutput {\n required int32 isUnpush = 1;\n optional string startTime = 2;\n optional int32 spanMinutes = 3;\n optional int32 level = 4;\n optional string timezone = 5;\n }\n message RelationDel {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string busChannel = 3;\n optional bool cleanMsg = 4;\n }\n message MsgReadEvent {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int32 readCnt = 4;\n optional int32 unreadCnt = 5;\n repeated ReceiptUser readList =6;\n }\n message ConvertMsgInput {\n optional int32 businessType = 1;\n optional bytes businessInfo = 2;\n }\n message SpeechToTextInfo {\n optional string msgId = 1;\n optional string objectName = 2;\n optional string content = 3;\n optional int32 sampleRate = 4;\n optional int32 channelNumber = 5;\n optional string format = 6;\n optional string extra = 7;\n }\n message ConvertMsgOutput {\n optional int32 businessType = 1;\n optional bytes businessResult = 2;\n }\n message SpeechToTextResult {\n optional string result = 1;\n optional string message = 2;\n }\n message TransReq {\n repeated TransInfo transInfos = 1;\n optional int32 model = 2;\n optional bool forceTrans = 3;\n }\n message TransResp {\n repeated TransResult results = 1;\n optional int32 model = 2;\n }\n message TransInfo {\n optional string messageUID = 1;\n optional int32 transType = 2;\n optional string text = 3;\n optional string transFileUrl = 4;\n optional string sourceLan = 5;\n optional string targetLan = 6;\n optional int32 inputSource = 7;\n }\n message TransResult {\n optional string messageUID = 1;\n optional string transResult = 2;\n optional string sourceLan = 3;\n optional string targetLan = 4;\n optional int32 code = 5;\n optional int32 inputSource = 6;\n }\n message PullModifyMsgReq { \n optional int64 pullVersion = 1;\n optional bool compress = 2;\n repeated int32 modifyType = 3;\n }\n message PullModifyMsgResp {\n repeated ModifyMsg msg = 1;\n optional int64 nextVersion = 2;\n optional bool finished = 3;\n optional bool compress = 4;\n optional bytes compressedData = 5;\n }\n message ModifyMsg {\n optional int32 modifyType = 1;\n optional DownStreamMessage msg = 2;\n }\n enum JoinType {\n KICK = 0;\n REFUSE = 1;\n COEXIST = 2;\n }\n enum TargetType {\n ROOM =1 ;\n PERSON = 2;\n }\n message SetUserStatusInput {\n optional int32 status=1;\n }\n message MCFollowInput {\n required string state = 1;\n }\n message RtcQueryListInput {\n optional int32 order=1;\n }\n message RtcKeyDeleteInput {\n repeated string key=1;\n }\n message RtcValueInfo {\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo {\n required string userId=1;\n repeated RtcValueInfo userData=2;\n }\n message RtcUserListOutput {\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4;\n repeated RtcKVEntity entries = 5;\n optional int64 syncTime = 6;\n optional int32 offlineKickTime = 7;\n }\n message RtcRoomInfoOutput {\n optional string roomId = 1;\n repeated RtcValueInfo roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message RtcInput {\n required int32 roomType=1;\n optional int32 broadcastType=2;\n optional RtcValueInfo extraInnerData = 3;\n optional bool needSysChatroom = 4;\n optional IdentityChangeType identityChangeType = 5;\n optional JoinType joinType = 6;\n repeated RtcValueInfo innerDatas = 7;\n repeated RtcValueInfo outerDatas = 8;\n }\n message RtcQryOutput {\n repeated RtcValueInfo outInfo=1;\n }\n message RtcDataInput {\n required bool interior=1;\n required TargetType target=2;\n repeated string key=3;\n optional string objectName=4;\n optional string content=5;\n }\n message RtcSetDataInput {\n required bool interior=1;\n required TargetType target=2;\n required string key=3;\n required string value=4;\n optional string objectName=5;\n optional string content=6;\n }\n message RtcUserSetDataInput {\n repeated RtcValueInfo valueInfo = 1;\n required string objectName = 2;\n repeated RtcValueInfo content = 3;\n }\n message RtcQryInput {\n required bool isInterior=1;\n required TargetType target=2;\n repeated string key=3;\n }\n message RtcDelDataInput {\n repeated string key=1;\n required bool isInterior=2;\n required TargetType target=3;\n }\n message RtcOutput {\n optional int32 nothing=1;\n optional int64 version=2;\n }\n message RtcTokenOutput {\n required string rtcToken=1;\n }\n message RtcSetOutDataInput {\n required TargetType target=1;\n repeated RtcValueInfo valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message RtcQryUserOutDataInput {\n repeated string userId = 1;\n }\n message RtcUserOutDataOutput {\n repeated RtcUserInfo user = 1;\n }\n message RtcNotifyMsg {\n required int32 type= 1;\n optional int64 time= 2;\n optional string roomId=3;\n }\n message RtcPullKV {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n }\n message RtcKVOutput {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType {\n AnchorToViewer = 1;\n ViewerToAnchor = 2;\n }\n message RtcQueryUserJoinedInput {\n required string userId = 1;\n }\n message RtcJoinedInfo {\n required string deviceId = 1;\n required string roomId = 2;\n optional int64 joinTime = 3;\n }\n message RtcQueryUserJoinedOutput {\n repeated RtcJoinedInfo info = 1;\n }\n message RtcViewerJoinedOutput {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;\n optional int64 syncTime = 3;\n }\n message RtcInviteInput {\n required string invitedUserId=1;\n optional int32 timeoutTime=2;\n required string invitedRoomId=3;\n required string inviteInfo=4;\n required string inviteSessionId= 5;\n }\n message RtcCancelInviteInput {\n required string invitedUserId=1;\n required string invitedRoomId=2;\n required string inviteInfo=3;\n required string inviteSessionId=4;\n }\n message RtcInviteAnswerInput {\n required string inviteUserId=1;\n required int32 answerCode=2;\n required string inviteRoomId=3;\n required string inviteSessionId=4;\n required string content=5;\n optional string key=6;\n optional string value=7;\n }\n message RtcEndInviteInput {\n required string inviteRoomId=1;\n required string inviteSessionId=2;\n required string inviteContent=3;\n repeated string inviteRoomKeys=4;\n }\n message BotInput {\n repeated string ids = 1;\n }\n message BotOutput{\n repeated BotInfo bots = 1;\n }\n message BotInfo{\n optional string id = 1; \n optional string name = 2;\n optional string portraitUrl = 3;\n optional string type = 4;\n repeated MetadataInfo metadata = 5;\n optional int64 createTime = 6;\n optional int64 updateTime = 7;\n }\n message MetadataInfo{\n optional string key = 1; \n optional string value = 2;\n }\n}\n");exports.LogLevel=void 0,(sl=exports.LogLevel||(exports.LogLevel={}))[sl.LOG=0]="LOG",sl[sl.DEBUG=0]="DEBUG",sl[sl.INFO=1]="INFO",sl[sl.WARN=2]="WARN",sl[sl.ERROR=3]="ERROR",sl[sl.FATAL=4]="FATAL",sl[sl.STATISTICS=6]="STATISTICS",sl[sl.NONE=1e3]="NONE",exports.LogSource=void 0,(al=exports.LogSource||(exports.LogSource={})).IM="IM",al.RTC="RTC",exports.ConnectionStatus=void 0,(ul=exports.ConnectionStatus||(exports.ConnectionStatus={}))[ul.CONNECTED=0]="CONNECTED",ul[ul.CONNECTING=1]="CONNECTING",ul[ul.DISCONNECTED=2]="DISCONNECTED",ul[ul.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",ul[ul.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",ul[ul.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",ul[ul.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",ul[ul.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",ul[ul.BLOCKED=9]="BLOCKED",ul[ul.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",ul[ul.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",ul[ul.REDIRECT=14]="REDIRECT",ul[ul.USER_LOGOUT=19]="USER_LOGOUT",ul[ul.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",ul[ul.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",ul[ul.ULTRALIMIT=1101]="ULTRALIMIT",ul[ul.REQUEST_NAVI=201]="REQUEST_NAVI",ul[ul.RESPONSE_NAVI=202]="RESPONSE_NAVI",ul[ul.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",ul[ul.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",ul[ul.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",ul[ul.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR",exports.RTCMode=void 0,(ll=exports.RTCMode||(exports.RTCMode={}))[ll.RTC=0]="RTC",ll[ll.LIVE=2]="LIVE",ll[ll.SIP=4]="SIP",ll[ll.CALL=5]="CALL",ll[ll.MEETING=6]="MEETING",ll[ll.CROSS_MUTI=7]="CROSS_MUTI",ll[ll.CROSS_LIVE=8]="CROSS_LIVE",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"}(dl||(dl={})),exports.RTCApiType=void 0,(_l=exports.RTCApiType||(exports.RTCApiType={}))[_l.ROOM=1]="ROOM",_l[_l.PERSON=2]="PERSON",function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(fl||(fl={})),exports.RTCJoinType=void 0,(pl=exports.RTCJoinType||(exports.RTCJoinType={}))[pl.KICK=0]="KICK",pl[pl.REFUSE=1]="REFUSE",pl[pl.COEXIST=2]="COEXIST";var gl=null;function El(e,t,r,n){void 0===r&&(r={});var i=["error","warn","info","debug"][3-e];if(gl&&e<exports.LogLevel.FATAL)try{var o=JSON.stringify(r);gl[i](t,o)}catch(e){console.error(e)}}var bl,Tl,vl,Rl,Il,ml,yl,Al,Sl,Ol,Cl,Nl=El.bind(null,exports.LogLevel.DEBUG),Pl={init:function(e){gl=e},info:El.bind(null,exports.LogLevel.INFO),debug:Nl,warn:El.bind(null,exports.LogLevel.WARN),error:El.bind(null,exports.LogLevel.ERROR),fatal:El.bind(null,exports.LogLevel.FATAL)},Ll=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 o=n[i],s=o.target,a=o.once,c=o.listener;a&&(n.splice(i,1),i-=1);try{c.call.apply(c,l([s],u(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}(),Ml=function(e,t,r){var n=null==r?void 0:r.isReverse;bt(e)&&function(){for(var r in e)t(e[r],r,e)}(),(ht(e)||_t(e))&&function(){if(n)for(var r=e.length-1;r>=0;r--)t(e[r],r);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},wl=function(){function e(e){Object.defineProperty(this,"pbCodec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbCodec=new ol(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}(),Ul=function(e,t,r,n,i){var o=n?Object.keys(n).map((function(e){return{key:e,value:n[e]}})):void 0,s=i?Object.keys(i).map((function(e){return{key:e,value:i[e]}})):void 0;return hl.encode(ku,{roomType:e,broadcastType:t,joinType:r,innerDatas:o,outerDatas:s})},Dl=function(e){var t=hl.decode(ju,e),r=t.users,n=t.token,i=t.sessionId,o=t.roomInfo,s=t.entries,a=t.offlineKickTime,u={};return Ml(r,(function(e){var t=e.userId,r=e.userData,n={};Ml(r,(function(e){var t=e.key,r=e.value;n[t]=r})),u[t]=n})),{users:u,token:n,sessionId:i,roomInfo:o,kvEntries:s,offlineKickTime:a}},xl=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 o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return s(this,(function(s){switch(s.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=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS?(this._isPulling=!1,this._pullTime=a||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}(),Gl=function(){function e(e,t,r){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,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),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 xl(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,"logger",{get:function(){return this._logger},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 o(this,void 0,void 0,(function(){var t,r,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=hl.encode(Ku,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,ri,!0,t)];case 1:return(r=s.sent()).isOk?(i=hl.decode(Qu,r.data),o=i.entries,a=i.syncTime,o=(o||[]).map((function(e){return n(n({},e),{timestamp:e.timestamp})})),this._watcher.onRTCDataChange(o,e),[2,ar(a)]):[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=hl.decode(Ju,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}();exports.StreamMessageResponseEventType=void 0,(bl=exports.StreamMessageResponseEventType||(exports.StreamMessageResponseEventType={})).INIT="INIT",bl.DATA="DATA",bl.END="END";var Vl=function(e){function r(t,r){var n=e.call(this)||this;return Tl.add(n),vl.set(n,void 0),Rl.set(n,new Map),Il.set(n,void 0),d(n,vl,t,"f"),d(n,Il,r,"f"),n}return t(r,e),Object.defineProperty(r.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=c(this,Tl,"a",ml).createTraceId(),c(this,Tl,"a",ml).info(B.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,lr.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(c(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)?ar(e.streamServer.addrs):ur(exports.ErrorCode.STREAM_MESSAGE_DISABLE)})).next((function(t){return c(n,Tl,"m",Cl).call(n,e,t)}))];case 1:return r=i.sent(),c(this,Tl,"a",ml).summary(B.L_REQ_STREAM_MSG_CONTENT_R,r,t,{messageUId:e}),[2,r.wipe()]}}))}))}}),r}(nr);vl=new WeakMap,Rl=new WeakMap,Il=new WeakMap,Tl=new WeakSet,ml=function(){return c(this,vl,"f").logger},yl=function(e,t,r){var n=c(this,Rl,"f").get(e);n&&(c(this,Rl,"f").delete(e),c(this,Tl,"m",Al).call(this,e,exports.StreamMessageResponseEventType.END,t,n.msg))},Al=function(e,t,r,n,i){this.emit("message",{code:r,messageUId:e,type:t,chunk:i,message:n})},Sl=function(e,t){e.content=n(n({},e.content),t),c(this,vl,"f")._innerSetMessageContent(e.messageId,JSON.stringify(e.content),e.messageType)},Ol=function(e,t,r){var n,i,o=c(this,Rl,"f").get(t);switch(e){case"init":o.msg&&c(this,Tl,"m",Sl).call(this,o.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),c(this,Tl,"m",Al).call(this,t,exports.StreamMessageResponseEventType.INIT,exports.ErrorCode.SUCCESS,o.msg);break;case"complete":i=(n=r.length?JSON.parse(r):{}).complete||!1,o.msg&&c(this,Tl,"m",Sl).call(this,o.msg,{stopReason:n.stopReason||0,completeReason:n.completeReason||0,complete:i,isSynced:i}),c(this,Tl,"m",yl).call(this,t,n.stopReason||0,i);break;default:n=JSON.parse(r),o.cached+=n.content,o.msg&&c(this,Tl,"m",Sl).call(this,o.msg,{content:o.cached}),c(this,Tl,"m",Al).call(this,t,exports.StreamMessageResponseEventType.DATA,exports.ErrorCode.SUCCESS,o.msg,{content:n.content,fullContent:o.cached})}},Cl=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return c(this,Rl,"f").has(e)?[2,ur(exports.ErrorCode.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:c(this,Rl,"f").size>=3?[2,ur(exports.ErrorCode.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(r=Xo.createSSEClient({logger:c(this,Tl,"a",ml),msgUId:e,appkey:c(this,vl,"f").appkey,token:c(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);c(d,Tl,"m",Ol).call(d,n,e,i.trim())}}))},onNetworkError:function(t){c(d,Tl,"m",yl).call(d,e,t,!1)}}),r.isOk?(n=r.data,i={client:n,cached:"",msg:void 0},c(this,Rl,"f").set(e,i),c(this,Il,"f")?[4,c(this,vl,"f").getLocalMessage(e)]:[3,2]):[2,r.wipe()]);case 1:if(o=s.sent(),a=o.code,!(u=o.data))return c(this,Rl,"f").delete(e),[2,ur(a,"message not found, msgUId: ".concat(e))];if(u.content.isSynced)return c(this,Rl,"f").delete(e),[2,ur(exports.ErrorCode.STREAM_MESSAGE_SYNCED,"synced")];i.msg=u,s.label=2;case 2:return[4,n.open(t.slice())];case 3:return(l=s.sent()).isOk||c(this,Rl,"f").delete(e),[2,l.wipe()]}}))}))};var jl,kl,Fl=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 wl(t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new ol(e)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(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.32.0"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.32.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.innerSendMessage(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}(),Bl=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,i,a){return o(this,void 0,void 0,(function(){var o,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return o=Ul(t,r,n,i,a),[4,this.rtcSignaling(e,Hn,!0,o)];case 1:return u=s.sent(),l=u.code,c=u.buffer,l===exports.ErrorCode.SUCCESS&&c&&(d=Dl(c)),[2,{code:l,data:d}]}}))}))}}),Object.defineProperty(r.prototype,"quitRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=hl.encode(Uu,{status:0}),[4,this.rtcSignaling(e,qn,!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 o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=hl.encode(Vu,{key:t,value:r}),[4,this.rtcSignaling(e,Yn,!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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=hl.encode(Gu,{key:t}),[4,this.rtcSignaling(e,Wn,!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,i,a){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return o=hl.encode(Hu,{interior:n,target:i,key:t,value:r,objectName:null==a?void 0:a.name,content:null==a?void 0:a.content}),[4,this.rtcSignaling(e,Jn,!1,o)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){switch(s.label){case 0:return o={objectName:n,content:[{key:t.name,value:t.content}],valueInfo:[{key:"uris",value:r},{key:"mcu_uris",value:i}]},a=hl.encode(qu,o),[4,this.rtcSignaling(e,Kn,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=hl.encode(qu,{objectName:t,valueInfo:[{key:"cdn_uris",value:r}]}),[4,this.rtcSignaling(e,Kn,!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 o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return i=hl.encode(Bu,{interior:r,target:n,key:t}),[4,this.rtcSignaling(e,Qn,!0,i)];case 1:return o=s.sent(),a=o.code,u=o.buffer,a===exports.ErrorCode.SUCCESS&&u?(l=hl.decode(Fu,u).outInfo,c={},l.forEach((function(e){c[e.key]=e.value})),[2,{code:a,data:c}]):[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return o=hl.encode(Bu,{interior:r,target:n,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,Xn,!1,o)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=Ul(t,r),[4,this.rtcSignaling(e,Zn,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=hl.decode(Wu,a).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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=hl.encode(Du,{state:t}),[4,this.rtcSignaling(e,zn,!0,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=hl.encode(xu,{order:2}),[4,this.rtcSignaling(e,$n,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=Dl(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 o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return n=Ul(t,r),[4,this.rtcSignaling(e,ei,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=hl.decode(zu,a),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 o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=hl.encode(Uu,{status:0}),[4,this.rtcSignaling(e,ti,!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 o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=hl.encode(ku,{roomType:exports.RTCMode.LIVE,broadcastType:r,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,ni,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=Dl(a),[2,{code:o,data:u}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,a=e.roomId,u=hl.encode($u,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(a,ii,!0,u)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,a=hl.encode(el,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,inviteInfo:i}),[4,this.rtcSignaling(o,oi,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return t=e.inviteUserId,r=e.inviteRoomId,n=e.inviteSessionId,i=e.content,o=e.key,a=e.value,u=e.agree,l=e.roomId,c=hl.encode(tl,{inviteUserId:t,inviteRoomId:r,inviteSessionId:n,content:i,key:o,value:a,answerCode:u?1:0}),[4,this.rtcSignaling(l,si,!0,c)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.endRoomId,r=e.sessionId,n=e.content,i=e.keys,o=e.roomId,a=hl.encode(rl,{inviteRoomId:t,inviteSessionId:r,inviteContent:n,inviteRoomKeys:i}),[4,this.rtcSignaling(o,ai,!0,a)];case 1:return[2,s.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 o(this,void 0,void 0,(function(){var i;return s(this,(function(o){switch(o.label){case 0:return[4,this._context.rtcSignaling(e,t,r,n)];case 1:return[2,{code:(i=o.sent()).code,buffer:i.data}]}}))}))}}),Object.defineProperty(r.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=hl.encode(Xu,{userId:e}),[4,this.rtcSignaling("",ui,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=hl.decode(Zu,i).info,[2,{code:n,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:n}]}}))}))}}),r}(Fl);exports.AssertRules=void 0,(kl=exports.AssertRules||(exports.AssertRules={}))[kl.STRING=0]="STRING",kl[kl.ONLY_STRING=1]="ONLY_STRING",kl[kl.NUMBER=2]="NUMBER",kl[kl.BOOLEAN=3]="BOOLEAN",kl[kl.OBJECT=4]="OBJECT",kl[kl.ARRAY=5]="ARRAY",kl[kl.CALLBACK=6]="CALLBACK",kl[kl.CHANNEL_ID=7]="CHANNEL_ID";var Hl=((jl={})[exports.AssertRules.STRING]=Et,jl[exports.AssertRules.ONLY_STRING]=_t,jl[exports.AssertRules.NUMBER]=ft,jl[exports.AssertRules.BOOLEAN]=function(e){return"boolean"==typeof e},jl[exports.AssertRules.OBJECT]=bt,jl[exports.AssertRules.ARRAY]=ht,jl[exports.AssertRules.CALLBACK]=function(e){var t=!0;return bt(e)||(t=!1),(e=e||{}).onSuccess&&!Tt(e.onSuccess)&&(t=!1),e.onError&&!Tt(e.onError)&&(t=!1),t},jl[exports.AssertRules.CHANNEL_ID]=yt,jl),ql=function(e){function r(t){var r=e.call(this,t)||this;return r.name="RCAssertError",r}return t(r,e),r}(Error),Yl=function(e,t,r,n){void 0===n&&(n=!1),r=Hl[r]||r;var i=n?r(t):vt(t)||null==t||r(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},Wl=function(e,t){var r=cn(e).searchProps;return r&&0!==r.length?r.every((function(e){return void 0!==t[e]}))?ar():ur(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR):ar()},Jl=function(e,t,r){return Kl(lr.create(e),t,r)},Kl=function(e,t,r){return e.isFailed||e.isObject("conversation",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return te(null==t?void 0:t.conversationType,r)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID),e},Ql=function(e,t,r){return e.check((function(e){return Kl(e,t,Z)})).check((function(e){var n=null==t?void 0:t.messageType;Et(n)?n===me.STREAM_MESSAGE&&r.includes("RC_Ext_StreamMsgSummary")&&e.setFailed(exports.ErrorCode.STREAM_MESSAGE_EXPANSION_KEY_ERROR):e.setFailed(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE)})).check((function(e){(null==t?void 0:t.canIncludeExpansion)||e.setFailed(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isNotEmptyString("messageUId",null==t?void 0:t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTimestamp("sentTime",null==t?void 0:t.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP),e},Xl=function(e,t,r){return e.check((function(e){r||e.setFailed(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isObject("expansion",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION).check((function(e){var r=Object.keys(t);if(r.length>20||0===r.length)e.setFailed(exports.ErrorCode.EXPANSION_LIMIT_EXCEET);else if(r.some((function(e){return!/^[A-Za-z0-9_=+-]+$/.test(e)||"string"!=typeof t[e]})))e.setFailed(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION);else{r.some((function(e){return e.length>32||t[e].length>4096}))&&e.setFailed(exports.ErrorCode.EXPANSION_LIMIT_EXCEET)}})),e},Zl=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(exports.ErrorCode.INVALID_PARAMETER_PROXY),e):e};var zl,$l=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},ec=function(){return zl||(zl={set:function(e,t){Xo.localStorage.setItem(e,JSON.stringify(t))},get:function(e){var t;try{t=JSON.parse(Xo.localStorage.getItem(e))}catch(e){t=null}return t},remove:function(e){return Xo.localStorage.removeItem(e)},getKeys:function(){var e=[];for(var t in Xo.localStorage)e.push(t);return e}}),zl},tc=function(){function e(e){Object.defineProperty(this,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),e&&(this._caches=e)}return Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._caches[e]=t}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get(e);return delete this._caches[e],t}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._caches[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=[];for(var t in this._caches)e.push(t);return e}}),e}(),rc=function(){function e(e){var t;Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._rootStorage=ec();var r=this._rootStorage.get(e)||{};this._cache=new tc(((t={})[e]=r,t)),this._storageKey=e}return Object.defineProperty(e.prototype,"_get",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;return this._cache.get(e)||{}}}),Object.defineProperty(e.prototype,"_set",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._get();r[e]=t,this._set(r)}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._get();delete t[e],this._set(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._get()[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._get(),t=[];for(var r in e)t.push(r);return t}}),Object.defineProperty(e.prototype,"getValues",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._get()||{}}}),Object.defineProperty(e.prototype,"update",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e={});var t=this._storageKey;this._cache.set(t,e),this._rootStorage.set(t,e)}}),e}(),nc="",ic=function(){var e="";if(nc)return nc;if("browser"===Xo.tag)return ct;var t="RCDeviceId",r=ec(),n=r.get(t);return n?e=n:(e=lt.genWithLen(22),r.set(t,e)),e},oc="",sc=function(){return oc},ac=function(e,t,r,n,i){var o=0;return e&&(o|=16),t&&(o|=32),r&&(o|=64),n&&(o|=512),i&&(o|=1024),o},uc=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,o=n||i;o&&(t.user.portrait=t.user.portraitUri=o)}return t},lc=function(e){var t={};try{var r=JSON.parse(e);Object.entries(r).forEach((function(e){var r=u(e,2),n=r[0],i=r[1];t[n]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},cc=function(e,t,r,n){var i,o,s=hl.decode(ls,e.pbData),a=Cn(e.topic);if(a===Sn.recallMsg){var u=JSON.parse(s.content);i=u.conversationType,o=u.targetId}else i=function(e){var t;return((t={})[Sn.ppMsgP]=exports.ConversationType.PRIVATE,t[Sn.pgMsgP]=exports.ConversationType.GROUP,t[Sn.chatMsg]=exports.ConversationType.CHATROOM,t[Sn.ugMsg]=exports.ConversationType.ULTRA_GROUP,t[Sn.pcMsgP]=exports.ConversationType.CUSTOMER_SERVICE,t[Sn.pbMsgP]=exports.ConversationType.SYSTEM,t)[e]||exports.ConversationType.PRIVATE}(a),o=e.targetId;var l=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(i),c=l?o:t,d=l?"":o,_=fc(s.sessionId),f=_.isPersited,p=_.isCounted,h=_.isMentioned,g=_.disableNotification,E=_.canIncludeExpansion;return{fromUserId:c,type:i,groupId:d,classname:s.classname,content:s.content,dataTime:r,status:ac(f,p,h,g,E),msgId:n,direction:exports.MessageDirection.SEND,clientUniqueId:s.clientUniqueId,extraContent:s.extraContent,pushContent:s.pushText,configFlag:s.configFlag,pushExt:s.pushExt,busChannel:s.busChannel,toUserIds:s.toUserIds,optionBits:s.optionBits}},dc=function(e,t,r,i){void 0===r&&(r=!1);var o,s,a,u=e.type,l=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(u)?i||e.fromUserId:e.groupId||i,c={isPersited:!!(16&(o=e.status)),isCounted:!!(32&o),isMentioned:!!(64&o),disableNotification:!!(512&o),receivedStatus:2&o?exports.ReceivedStatus.RETRIEVED:exports.ReceivedStatus.UNREAD,canIncludeExpansion:!!(1024&o)},d=c.isMentioned,_=c.disableNotification,f=c.receivedStatus,p=c.canIncludeExpansion,h=e.direction===exports.MessageDirection.SEND?exports.MessageDirection.SEND:exports.MessageDirection.RECEIVE,g=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),o=i.disablePushTitle,s=i.forceShowDetailContent,a=Wt(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:o,forceShowDetailContent:s,templateId:null==r?void 0:r.templateId},a)}(e.configFlag||0,e.pushContent,e.pushExt),E=(s=e.extStatus,{isInterrupt:!!(2&(a=s||0)),isModifyMessage:!!(4&a),isPrivateChannel:!!(8&a),isStatusMessage:!!(64&a)}),b=E.isInterrupt,T=E.isModifyMessage,v=E.isPrivateChannel,R=E.isStatusMessage,I=cn(e.classname),m=I.isCounted,y=I.isPersited,A=I.isStatusMessage;return{conversationType:u,targetId:l,senderUserId:h===exports.MessageDirection.SEND?t:e.fromUserId,messageType:e.classname,messageUId:e.msgId,isPersited:y,isCounted:m,isMentioned:d,sentTime:e.dataTime,messageDirection:h,receivedTime:Date.now(),disableNotification:_,receivedStatus:f,receivedStatusInfo:Ct(f),canIncludeExpansion:p,content:uc(e.content),expansion:e.extraContent?lc(e.extraContent):null,pushConfig:g,channelId:e.busChannel||"",isInterrupt:b,isModifyMessage:T,messageId:e.clientUniqueId||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:r,channelType:v?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,isStatusMessage:R||!!A,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:!!(1&(e.optionBits||0)),needReceipt:!!(2&(e.optionBits||0)),sendReceipt:!!(4&(e.optionBits||0))||void 0,modifyInfo:pc(e.convertExt),extraData:e.extMsgData?{seqId:e.extMsgData.seqId,sentTime:e.extMsgData.sendTime}:void 0}},_c=function(e,t,r,n,i){var o=0,s=cn(e),a=s.isPersited,u=s.isCounted,l=s.isStatusMessage,c=i||l;return a&&!c&&(o|=1),u&&!c&&(o|=2),t&&(o|=4),r&&(o|=32),n&&(o|=64),o},fc=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}},pc=function(e){if(e)try{var t=JSON.parse(e).modify;if(t.time)return{timestamp:t.time,content:{},status:Lr}}catch(t){console.error("parse message modify info error: ".concat(e),t)}},hc=function(e,t){var r=e.content,i=r.sentTime,o=r.messageUId,s=r.isDelete,a=r.isAdmin,u=r.directionalUserIdList,l=r.extra,c={recallTime:i,recallActionTime:e.sentTime,admin:!!a,delete:!!s,isDelete:!!s,operatorId:e.senderUserId,extra:l},d=n(n({},e),{content:c,messageType:me.RECALL_NOTIFICATION_MESSAGE});return t&&(d.messageUId=o,d.sentTime=i,d.directedUserIds=u),d};function gc(e){return 1&~((null==e?void 0:e.sessionMode)||0)?ur(exports.ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):ar()}function Ec(e){return Math.min(e,999)}var bc={};function Tc(){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:Vr.getMiniCmpUrlList().join(",")}}var vc,Rc,Ic,mc,yc,Ac,Sc=function(e){function r(t,r,n,i,o){void 0===i&&(i="default");var s=e.call(this,t,r,n,Xo.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),Xo.useNavi,o)||this;return s._environment=i,s}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return o="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(r),"&callBack=x&v=").concat(Be,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(Xo.tag),this.logger.debug(B.L_REQUEST_T,"req navi => ".concat(o),n),[4,Xo.httpReq({url:o,timeout:1e4,dataType:"text"})];case 1:if(200!==(a=s.sent()).status)return this.logger.debug(B.L_REQUEST_R,"request navi failed: ".concat(a.status),n),!Xo.useNavi&&i?[2,ar(Tc())]:[2,ur(this.transHttpCode(a.status))];try{return 0===(u=a.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(u=JSON.parse('"'.concat(u,'"'))),(l=JSON.parse(u)).protocol=/^https/.test(o)?"https":"http",l.code&&200!==l.code?[2,ur(this.transHttpCode(l.code))]:(Xo.useNavi||(l.server="",l.backupServer=Vr.getMiniCmpUrlList().join(","),l.logSwitch=0),[2,ar(l)])}catch(e){this.logger.error(B.L_PARSE_NAVI_E,a.data,n)}return[2,ur(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return o=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:Xo.tag,protocol:(/^https/.test(e)?H.WSS:H.WS).toString()}),this.logger.debug(B.L_REQUEST_T,"req navi => ".concat(o.url),n),[4,Xo.httpReq(o)];case 1:if(200!==(a=s.sent()).status)return this.logger.debug(B.L_REQUEST_R,"request navi failed: ".concat(a.status),n),!Xo.useNavi&&i?[2,ar(Tc())]:[2,ur(this.transHttpCode(a.status))];try{return u=a.data,(l="object"!=typeof u?JSON.parse(u):u).protocol=/^https/.test(o.url)?"https":"http",Xo.useNavi||(l.logSwitch=0,c=Vr.getMiniCmpUrlList(),l.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?H.WSS:H.WS,weight:c.length-t}}))),[2,ar(l)]}catch(e){this.logger.error(B.L_PARSE_NAVI_E,a.data,n)}return[2,ur(exports.ErrorCode.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(bc[r])return bc[r];var n,i=Ye(this.appkey),o=Xo.localStorage;try{var s=o.getItem(i);n=s?JSON.parse(s):[]}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 bc[r]=a,a}}),Object.defineProperty(r.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this,i=Ye(this.appkey),o=Xo.localStorage;try{var s=o.getItem(i);r=s?JSON.parse(s):[]}catch(e){r=[]}var a=Date.now();r.length>0&&(r=r.filter((function(t){return a-t.timestamp<je&&(e!==t.token||n._environment!==t.environment)})));var u={timestamp:a,naviInfo:t,token:e,environment:this._environment};r.push(u),o.setItem(i,JSON.stringify(r)),bc[this.getCatchKey(e)]=u}}),r}(un),Oc=function(){function e(e){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_sendMessageMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_userId",{enumerable:!0,configurable:!0,writable:!0,value:""})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._userId=e;var t=$e(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)}}),Object.defineProperty(e.prototype,"_getLocalInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Xo.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}}}),Object.defineProperty(e.prototype,"setMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageMap[e]=t;var r=$e(this._appkey,this._userId),n=this._getLocalInfo(r);n[e]=t,Xo.localStorage.setItem(r,JSON.stringify(n))}}),Object.defineProperty(e.prototype,"getSendMessageMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._sendMessageMap}}),Object.defineProperty(e.prototype,"removeByUID",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._sendMessageMap[e]}}),Object.defineProperty(e.prototype,"removeByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=$e(this._appkey,this._userId),r=this._getLocalInfo(t);Object.keys(r).forEach((function(t){r[t]<e&&delete r[t]})),Xo.localStorage.setItem(t,JSON.stringify(r))}}),e}(),Cc=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[exports.SubscribeType.ONLINE_STATUS]={},t[exports.SubscribeType.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={})[exports.SubscribeType.ONLINE_STATUS]={},e[exports.SubscribeType.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===exports.SubscribeType.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].statusMap={}})):e===exports.SubscribeType.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 l([],u(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}(),Nc=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 Cc(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=[],o=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,s,a=e.userId,u=e.subscribeTime,l=e.subscribeType,c=e.expiry;if(e.operationType===exports.SubscribeOperationType.UNSUBSCRIBE)return r._subStore.removeSubscribeUserData(l,a),void o.push(e);var d=r._subStore.getSubscribeUserData(l,a);if(!(d&&d.subscribeTime>=u)){if(l===exports.SubscribeType.ONLINE_STATUS){n.push(a);var _=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};r._subStore.updateSubscribeUserData(l,a,{subscribeTime:u,expiry:c,userId:a,subscribeType:l,statusMap:_})}else{i.push(a);var f=null===(s=d)||void 0===s?void 0:s.profile;r._subStore.updateSubscribeUserData(l,a,{subscribeTime:u,expiry:c,userId:a,subscribeType:l,profile:f,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:n,newSubscribeUserProfileList:i,subscribeUserChangeList:o}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(exports.SubscribeType.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(exports.SubscribeType.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,o=e.data,s=t._subStore.getSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,i);if(s){var a=[],u=n({},s.statusMap);o.forEach((function(e){var t=e.platformInfo,r=e.versionTime,i=u[t];if(!(i&&i.changeTime>r)){var o={eventValue:e.value,changeTime:r};u[t]=o,a.push(n(n({},o),{platform:t}))}})),t._subStore.updateSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,i,{subscribeTime:s.subscribeTime,expiry:s.expiry,userId:i,subscribeType:exports.SubscribeType.ONLINE_STATUS,statusMap:u}),r.push({userId:i,subscribeType:exports.SubscribeType.ONLINE_STATUS,subscribeTime:s.subscribeTime,expiry:s.expiry,details:a})}})),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,o=e.version,s=e.userProfile,a=e.userExtProfile,u=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,i),l=Pt(i,s,a);u?u.profile&&u.profile.version>=o||(t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,i,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:l,version:o},isSubscribed:u.isSubscribed}),u.isSubscribed&&r.push({userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:n({},l)})):t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,i,{subscribeTime:0,expiry:0,userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:l,version:o},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 o=r._subStore.getSubscribeUserData(e,t);if(!o||o.expiry<(Date.now()+r._delayTime-o.subscribeTime)/1e3)r._subStore.removeSubscribeUserData(e,t);else{var s={subscribeTime:o.subscribeTime,expiry:o.expiry,userId:o.userId,subscribeType:o.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var a=o.statusMap,u=Object.keys(a).map((function(e){return n({platform:~~e},a[~~e])}));s.details=Nt(u)}else if(e===exports.SubscribeType.USER_PROFILE&&!o.isSubscribed)return;i.push(s)}})),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 o=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,e);if(o&&o.profile){var s=o.profile,a=s.version,u=s.info;if(o.isSubscribed)return t._delayTime+Date.now()-a>6048e5?void i.push(e):void r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}));t._delayTime+Date.now()-a>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===exports.SubscribeType.ONLINE_STATUS){var i=Object.keys(t.statusMap).map((function(e){return n({platform:~~e},t.statusMap[~~e])}));r.details=Nt(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}(),Pc=function(){function e(e,t,r,n,i,o,s){Object.defineProperty(this,"_connectManager",{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:o}),Object.defineProperty(this,"_subDriven",{enumerable:!0,configurable:!0,writable:!0,value:s}),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 Nc(n)}return Object.defineProperty(e.prototype,"syncData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(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(exports.SubscribeType.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_USER_PROFILE),[2]}}))}))}}),Object.defineProperty(e.prototype,"startSyncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(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),o(this,void 0,void 0,(function(){return s(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=""),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,_,f,p,h;return s(this,(function(s){switch(s.label){case 0:return r=this._subscribeService.getRelationshipStatusVersion(),n=this._logger.createTraceId(),this._logger.info(B.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:r,_pageToken:t}),n),i=hl.encode(ja,{version:r,pageToken:t}),[4,this._connectManager.query(Sn.pullUserSub,this._currentUserId,i,ka)];case 1:return o=s.sent(),this._logger.summary(B.L_PULL_SUBSCRIBED_USER_RELATION_R,o,n),o.isOk?(this._pullRelationshipFailTime=0,a=o.data,u=a.list,l=a.version,c=a.hasNext,d=a.pageToken,e?(_=this._subscribeService.updateSubscribeRelation(u),f=_.newSubscribeOnlineStatusList,p=_.newSubscribeUserProfileList,(h=_.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(h),f.length>0&&this._queryAndUpdateUserOnlineStatus(f),p.length>0&&this._queryAndUpdateUserProfile(p)):this._subscribeService.updateSubscribeRelation(u,!t),this._subscribeService.updateRelationshipStatusVersion(l),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>l})),c?[4,this._pullSubscribeRelationship(e,d)]:[3,3]):(this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:s.sent(),s.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"startsyncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(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),o(this,void 0,void 0,(function(){return s(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=""),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,_,f,p;return s(this,(function(s){switch(s.label){case 0:return r=this._subscribeService.getSubscribeUserStatusVersion(),n=this._logger.createTraceId(),this._logger.info(B.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:r,_pageToken:t,needAllData:e}),n),i=hl.encode(Fa,{versionTime:r,needAllData:e,pageToken:t}),[4,this._connectManager.query(Sn.pullSubData,this._currentUserId,i,Ba)];case 1:return(o=s.sent()).isOk?(this._pullSubUserStatusFailTime=0,a=o.data,u=a.list,l=a.versionTime,c=a.hasNext,d=a.pageToken,_=a.isFull,this._logger.info(B.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),f=[],p=[],u.forEach((function(e){switch(e.subType){case exports.SubscribeType.ONLINE_STATUS:f.push(e);break;case exports.SubscribeType.USER_PROFILE:p.push(e.subUserId);case exports.SubscribeType.FRIEND_ONLINE_STATUS:case exports.SubscribeType.FRIEND_USER_PROFILE:}})),_&&""===t&&this._subscribeService.clearSubscribeStatus(),f.length>0&&this._updateUserOnlineStatus(f,!_),p.length>0?[4,this._queryAndUpdateUserProfile(p,!_)]:[3,3]):(this._logger.warn(B.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:s.sent(),s.label=3;case 3:return c?[4,this._pullSubscribeUserStatus(e,d)]:[3,5];case 4:s.sent(),s.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return t=this._logger.createTraceId(),this._logger.info(B.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),r=hl.encode(qa,{subType:exports.SubscribeType.ONLINE_STATUS,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._connectManager.query(Sn.qrySubData,this._currentUserId,r,Ba)];case 1:return n=i.sent(),this._logger.summary(B.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),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this._logger.createTraceId(),this._logger.info(B.L_PULL_USER_PROFILE_T,JSON.stringify(e),r),n=hl.encode(Ja,{userId:e}),i=new $i(Sn.pullUserProfile,n,this._currentUserId),[4,this._connectManager.send(i,Ka)];case 1:return o=s.sent(),a=o.code,u=o.data,this._logger.info(B.L_PULL_USER_PROFILE_R,JSON.stringify({code:a,data:u}),r),a!==exports.ErrorCode.SUCCESS?[2,ur(a)]:(l=this._subscribeService.updateSubscribeUserProfile(u.UserProfile),t&&l.length>0&&this._event.subscribeUserStatusChanged(l),[2,ar(u.UserProfile)])}}))}))}}),Object.defineProperty(e.prototype,"updateUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return(t=hl.decode(Ha,e.pbData)).subType!==exports.SubscribeType.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==exports.SubscribeType.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==exports.SubscribeType.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!==exports.SubscribeType.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:n=o.sent(),(i=n.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Pt(t.subUserId,i[0].userProfile,i[0].userExtProfile)}]),o.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),o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return i=hl.encode(Ga,{subType:t,opType:r,expiry:n,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._connectManager.query(Sn.updUserSub,this._currentUserId,i,Va)];case 1:return o=s.sent(),a=o.code,u=o.data,l=o.isOk,a===exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT?[2,ur(a,"",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===exports.SubscribeOperationType.SUBSCRIBE&&(t===exports.SubscribeType.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===exports.SubscribeType.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 o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._subscribeService.getUserProfiles(e),r=t.needQueryUserIds,n=t.list,0===r.length?[2,ar(n)]:[4,this._queryAndUpdateUserProfile(r,!1)];case 1:return(i=s.sent()).isOk?(o=i.data.map((function(e){return Pt(e.userId,e.userProfile,e.userExtProfile)})),[2,ar(l(l([],u(n),!1),u(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),o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(B.L_PULL_OWN_PROFILE_T,"",t),r=hl.encode(Qa,{nothing:1}),[4,this._connectManager.query(Sn.pullOwnProfile,this._currentUserId,r,Ya)]):[2,ur(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE)];case 1:return n=s.sent(),this._logger.summary(B.L_PULL_OWN_PROFILE_R,n,t),n.isOk?(i=n.data,o=i.userExtProfile,a=i.userProfile,u=i.version,l=i.userId,c=Pt(l,a,o),this._subscribeService.updateOwnProfile(c,u),e&&this._event.ownUserProfileChanged(c),[2,ar(c)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,ar(e)]:[2,this.syncOwnProfile()]}))}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),Lc=function(){function e(e,t,r){Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._storage=new rc(it(e,t)),this._delayTime=r,this.clear()}return Object.defineProperty(e.prototype,"_getConversationKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"".concat(e.targetId,"_").concat(e.channelId)}}),Object.defineProperty(e.prototype,"_removeExcessData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=Object.keys(e).map((function(t){return{key:t,value:e[t]}})).sort((function(e,t){return e.value.t-t.value.t})).slice(-30),i={};try{for(var o=a(n),s=o.next();!s.done;s=o.next()){var u=s.value;i[u.key]=u.value}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i}}),Object.defineProperty(e.prototype,"insert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o){var s;if(!(i<Date.now()-this._delayTime-qe)){var a=this._getConversationKey(e),u=this._storage.get(a)||{};if(!u[t]){var l={t:i,d:r};o&&(l.sId=o);var c=n(n({},u),((s={})[t]=l,s));Object.keys(c).length>30&&(c=this._removeExcessData(c)),this._storage.set(a,c)}}}}),Object.defineProperty(e.prototype,"addReadedUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var i,o=this._getConversationKey(e),s=this._storage.get(o)||{},a=s[t];if(a){if(a.us){if(a.us.includes(r))return}else a.us=[];a.us.push(r),this._storage.set(o,n(n({},s),((i={})[t]=a,i)))}}}),Object.defineProperty(e.prototype,"getReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._getConversationKey(e),n=(this._storage.get(r)||{})[t];return n?{time:n.t,direction:n.d,users:n.us||[],senderId:n.sId}:null}}),Object.defineProperty(e.prototype,"getReceiptMessageDic",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._getConversationKey(e),r=this._storage.get(t)||{},n={};for(var i in r){var o=r[i];o.d===exports.MessageDirection.RECEIVE&&(n[o.sId]||(n[o.sId]=[]),n[o.sId].push(i))}return n}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._getConversationKey(e),n=this._storage.get(r)||{};n[t]&&(delete n[t],0===Object.keys(n).length?this._storage.remove(r):this._storage.set(r,n))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storage.getValues(),t={};for(var r in e){var n=e[r],i={};for(var o in n){var s=n[o];Date.now()-this._delayTime-s.t<qe&&(i[o]=s)}Object.keys(i).length&&(t[r]=i)}this._storage.update(t)}}),e}(),Mc=function(e){function r(t,r){var n=e.call(this,t,r)||this;return Object.defineProperty(n,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:""}),n._storageKey=rt(t),n}return t(r,e),Object.defineProperty(r.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Xo.localStorage.getItem(this._storageKey)}}),Object.defineProperty(r.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){Xo.localStorage.setItem(this._storageKey,e)}}),Object.defineProperty(r.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){Xo.localStorage.removeItem(this._storageKey)}}),Object.defineProperty(r.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return[4,Xo.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 o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Zt(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(B.L_GET_STATIC_CONF_E,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),r}(jr),wc=((vc={})[L.GROUP_OPERATION]=function(e){return"ChannelEventData"},vc[L.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},vc[b.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},vc),Uc=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&&hl.decode(t,e),Tt(i)&&(n=i.call(this,n,r))}catch(e){this.logger.error(B.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,o=e.changeType,s=e.originalId,a=e.originalTime,u=e.secondaryId,l=e.isAdmin,c=e.additionalMark,d=e.operatorId,_=e.subChangeType,f=e.secondaryType,p=e.remindType,h=e.isRemindMe,g=e.extIds,E=e.eventData;return E&&(r=t._formatEventData(E,o,_)),{businessId:n,changeType:o,originalId:s,time:i,originalTime:a,secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:d,subChangeType:_,userGroupIds:g,secondaryType:f,remindType:p,isRemindMe:h,eventData:r}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n={};return e&&wc[t]&&wc[t](r)&&(n=hl.decode(wc[t](r),e)||{}),n}}),e}(),Dc=((Rc={})[Pi]=exports.ErrorCode.RC_DISCONN_KICK,Rc[Li]=exports.ErrorCode.RC_DISCONN_EXCEPTION,Rc[wi]=exports.ErrorCode.RC_DISCONN_EXCEPTION,Rc[Ui]=exports.ErrorCode.RC_CONN_REDIRECTED,Rc[Di]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,Rc[xi]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,Rc[Gi]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,Rc),xc=((Ic={})[li]=exports.ErrorCode.SUCCESS,Ic[ci]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,Ic[di]=exports.ErrorCode.RC_CONN_IDENTIFIER_REJECTED,Ic[_i]=exports.ErrorCode.RC_CONN_SERVER_UNAVAILABLE,Ic[fi]=exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,Ic[pi]=exports.ErrorCode.RC_CONN_NOT_AUTHRORIZED,Ic[hi]=exports.ErrorCode.RC_CONN_REDIRECTED,Ic[gi]=exports.ErrorCode.RC_CONN_PACKAGE_NAME_INVALID,Ic[Ei]=exports.ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED,Ic[bi]=exports.ErrorCode.RC_CONN_USER_BLOCKED,Ic[Ti]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,Ic[vi]=exports.ErrorCode.RC_CONN_DEVICE_ERROR,Ic[Ri]=exports.ErrorCode.RC_CONN_HOSTNAME_ERROR,Ic[Ii]=exports.ErrorCode.RC_DISCONN_SAME_CLIENT_ON_LINE,Ic[mi]=exports.ErrorCode.RC_LISCENSE_COUNT_OUT_OF_LIMIT,Ic[yi]=exports.ErrorCode.RC_CONN_WRONG_CLUSTER,Ic[Ai]=exports.ErrorCode.RC_APP_AUTH_NOT_PASS,Ic[Si]=exports.ErrorCode.RC_OTP_USED,Ic[Oi]=exports.ErrorCode.RC_PLATFORM_ERROR,Ic[Ci]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,Ic[Ni]=exports.ErrorCode.RC_LICENSE_EXPIRED,Ic),Gc=function(e){return[Sn.ppMsgS,Sn.pgMsgS,Sn.chatMsgS,Sn.prMsgS].includes(e)},Vc=function(e){function r(t,r,n){var i=e.call(this,t,r,n)||this;return Object.defineProperty(i,"_socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_socketIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_serverSessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_localConnectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"codec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_idCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_generateMessageId",{enumerable:!0,configurable:!0,writable:!0,value:function(){return i._idCount>=65535&&(i._idCount=0),++i._idCount}}),Object.defineProperty(i,"_pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_messageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"_syncMessageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),i.codec=new Uc(i.logger),i}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 o(this,void 0,void 0,(function(){var r,i,o,a,u,l,c,d,_,f;return s(this,(function(p){switch(p.label){case 0:if(r=t.openAnti,i=t.type,o=t.baggageEnabled,a=this.getCmpList(t),this.logger.debug(B.L_NAVI_CMP_R,JSON.stringify(a),n),0===(u=a.filter((function(e,t){return a.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(B.L_NAVI_CONF_E,"no service available",n),[2,ur(exports.ErrorCode.SERVER_UNAVAILABLE)];l=1===r?Fn:Bn,c=function(t){var r,a,c,_,f,p,h,g,E,b,T;return s(this,(function(s){switch(s.label){case 0:return r=u[t],a=r.protocol,c=r.addr,_=r.weight,f=function(e,t,r,n,i,o,s,a){var u,l=s?"&protocolVer=".concat(s):"",c=ic(),d=sc();return"".concat(e,"://").concat(t,"/websocket?appId=").concat(r,"&token=").concat(encodeURIComponent(n),"&sdkVer=").concat(Be,"&pid=").concat(o,"&deviceId=").concat(encodeURIComponent(c)).concat(1===a?"&baggage=".concat(encodeURIComponent("cid=".concat(i))):"","&apiVer=").concat(encodeURIComponent((null===(u=Xo.getApiVer)||void 0===u?void 0:u.call(Xo))||"||")).concat(Xo.connectPlatform?"&platform=".concat(Xo.connectPlatform):"").concat(l).concat(Xo.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(d)):"")}(a===H.WS?"ws":"wss",c,d.appkey,e,d.cid,"",l,o),p=Date.now(),[4,d.connectWebSocket(f,l,n)];case 1:return h=s.sent(),g=h.code,E=h.data,b=d.cmpWeightCache.findIndex((function(e){return e.addr===c})),T={bid:Xt(),ptc:Se.WS,cod:g,net:d.getNetwork().type,dur:Date.now()-p,spr:0,pr:i||0,hos:c,idx:b,rct:d.retryCount?Ne.RECONNECT:Ne.CONNECT,cid:d.cid,v:Ce.CURRENT,rsn:d._doConnectReason,count:d.retryCount,weight:_,ssid:d._serverSessionId},d.logger.record(ve.IM_WEBSOCKET,JSON.stringify(T),n),g===exports.ErrorCode.RC_SOCKET_DISCONNECTED||g===exports.ErrorCode.TIMEOUT?[2,"continue"]:g!==exports.ErrorCode.SUCCESS?[2,{value:ur(g)}]:(d._localConnectedTime=Math.floor((Date.now()+p)/2),d._socket=E.socket,d.updateCmpWeight(u[t].addr,!0),d.curCmpUrl=u[t].addr,[2,{value:ar(E.userId)}])}}))},d=this,_=0,p.label=1;case 1:return _<u.length?[5,c(_)]:[3,4];case 2:if("object"==typeof(f=p.sent()))return[2,f.value];p.label=3;case 3:return _+=1,[3,1];case 4:return[2,ur(exports.ErrorCode.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(r.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,_,f=this;return s(this,(function(s){switch(s.label){case 0:return this.logger.info(B.L_CONNECT_O,"connect start: ".concat(e),r),n=fr(),i=n.resolve,o=n.promise,[4,Xo.createWebSocket(e)];case 1:return a=s.sent(),u=a.data,l=a.code,c=a.msg,l===exports.ErrorCode.SUCCESS&&u?(this._socketIndex=u.id,d=exports.ErrorCode.SUCCESS,_=setTimeout((function(){f.logger.warn(B.L_CONNECT_S,"timeout",r),d=exports.ErrorCode.TIMEOUT,u.close()}),5e3),u.onOpen((function(){f.logger.info(B.L_CONNECT_S,"socket opened",r),clearTimeout(_)})),u.onError((function(e){f.logger.info(B.L_CONNECT_S,"socket error",r),clearTimeout(_);var t=exports.ErrorCode.RC_SOCKET_DISCONNECTED;i(ur(t)),f.onSocketEnd(u,t)})),u.onClose((function(){f.logger.info(B.L_CONNECT_S,"socket close",r);var e=d===exports.ErrorCode.SUCCESS?exports.ErrorCode.RC_SOCKET_DISCONNECTED:d;i(ur(e)),f.onSocketEnd(u,e)})),u.onMessage((function(e){if(f._socketIndex===u.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var n=oo(e,t);if(n){if(n instanceof qi){var o=n.status;if(o!==li)return f.logger.warn(B.L_CONNECT_O,"connect failed: ".concat(o),r),d=xc[o],u.close(),void i(ur(d));f.logger.info(B.L_CONNECT_O,"connect success",r);var s=n.timestamp,a=n.userId,l=n.messageId,c=n.sessionId;return f._serverSessionId=c,f._connectedTime=s,f._idCount=l,void i(ar({userId:a,socket:u}))}if(n instanceof Wi){var _=n.status;return f.logger.info(B.T,"recv disconnect signal -> status: ".concat(_)),void f.onRecvDisconnect(_,u)}f._onReceiveSignal(n)}}}else f.logger.warn(B.L_WS_DISACCORD_E,JSON.stringify({socketIndex:f._socketIndex,curSocketId:u.id}))})),[2,o]):[2,ur(l,c)]}}))}))}}),Object.defineProperty(r.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==Pn)return e instanceof Zi&&!e.syncMsg?(this.logger.debug(B.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new ro(e.messageId))):void(e instanceof io&&this._messageIds[e.messageId]&&(this.logger.debug(B.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new no(e.messageId))))}}),Object.defineProperty(r.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return t=e.syncMsg,r=e.topic,n=e.messageId,this.logger.debug(B.O,"recv PublishReader -> messageId: ".concat(n," ").concat(r)),r===Kn?[2]:!t||Gc(Cn(r))?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[n]=e}))];case 1:return i=s.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 o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return e instanceof Ki&&this._pingResolve?(this._pingResolve(exports.ErrorCode.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof to||e instanceof io)&&(t=e.messageId,this.logger.debug(B.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 Zi?[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 Dc[e]}(e)))}}),Object.defineProperty(r.prototype,"onSocketEnd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===e&&(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0))}}),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(exports.ErrorCode.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(exports.ErrorCode.TIMEOUT)}),e),t.sendOnly(new Ji)}))}}),Object.defineProperty(r.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof eo||e instanceof $i)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(r.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.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(exports.ErrorCode.TIMEOUT)}),3e4)}))]):[2,ur(exports.ErrorCode.RC_NET_CHANNEL_INVALID)];case 1:return r=o.sent(),n="number"==typeof r?r:r.status,exports.ErrorCode.SUCCESS,"number"==typeof r?[2,ur(r)]:[2,n===exports.ErrorCode.SUCCESS?ar(r):ur(n,"",r)]}}))}))}}),Object.defineProperty(r.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u;return s(this,(function(s){switch(s.label){case 0:return this.logger.createTraceId(),Nn(e),o=new $i(e,r,t),i&&o.setHeaderQos(i),[4,this._sendHandler(o)];case 1:return a=s.sent(),u=a.data,a.isOk&&void 0!==n?[2,ar(hl.decode(n,u.pbData))]:[2,a]}}))}))}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return[4,this._sendHandler(e)];case 1:return(r=s.sent()).data?r.data instanceof to?[2,r]:(n=r.data,i=t&&n.pbData&&[exports.ErrorCode.SUCCESS,exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,exports.ErrorCode.RC_USER_PROFILE_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,exports.ErrorCode.RC_USER_PROFILE_VALUE_EXCEED_RANGE,exports.ErrorCode.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(n.status)>=0,o=i?hl.decode(t,n.pbData):n,0!==n.status?[2,ur(n.status,void 0,t&&n.pbData?o:null)]:[2,ar(o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return r?[4,this.sendOnly(new Yi(Mi))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),r}(sn),jc=function(e){function r(t,r,n){var i=e.call(this,r,t,n)||this;Object.defineProperty(i,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_mrtr",{enumerable:!0,configurable:!0,writable:!0,value:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}});var o=Xo.runtimeInfo,s=o.type,a=o.version;return i.deviceId=ic(),i.model="Web|".concat(s,"|").concat(a),i.init(),i}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,_,f;return s(this,(function(s){switch(s.label){case 0:return(i=n).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},a=this.logger.createTraceId(),this.logger.info(B.L_REQUEST_T,JSON.stringify(o),a),[4,Xo.httpReq(o)];case 1:u=s.sent(),l=u.status,c=u.data,d=void 0===c?"":c,this.logger.info(B.L_REQUEST_R,JSON.stringify({status:l,data:d}),a);try{return _=JSON.parse(d),f=_.data,[2,{code:parseInt(_.code,10),data:f}]}catch(e){return this.logger.warn(B.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:l,data:d,error:e})),[2,{code:l,msg:e}]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nt(this.appkey);Xo.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(B.L_CLOUD_SET_CACHE_O,JSON.stringify(e))}}),Object.defineProperty(r.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=nt(this.appkey),t=Xo.localStorage.getItem(e);return this.logger.info(B.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t}}),Object.defineProperty(r.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(B.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}(nn),kc=function(e){function r(t,r,n,i){var o=e.call(this,t,r,n,i)||this;return Object.defineProperty(o,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_id",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_type",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:i}),mc.set(o,void 0),yc.set(o,dt),d(o,mc,new rc(ot(t)),"f"),o}return t(r,e),Object.defineProperty(r.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){d(this,yc,e,"f")}}),Object.defineProperty(r.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,yc,"f")}}),Object.defineProperty(r.prototype,"setConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{return c(this,mc,"f").set(e,t),!0}catch(e){return!1}}}),Object.defineProperty(r.prototype,"getConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return{success:!0,value:c(this,mc,"f").get(e)}}catch(e){return{success:!1}}}}),r}(Br);mc=new WeakMap,yc=new WeakMap;var Fc=null,Bc="RC_LOGS",Hc="RC_STATISTICS",qc=((Ac={})[Bc]=["level","time"],Ac[Hc]=["level","time"],Ac),Yc=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),o=IDBKeyRange.upperBound(Date.now()-r),s=i.openCursor(o);s.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},s.onerror=function(){n()}}))},Wc=null,Jc=function(e){return o(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return[4,Fc];case 1:return(t=n.sent())?(r=t.db,[4,Yc(r,Bc,e)]):[2];case 2:return n.sent(),[4,Yc(r,Hc,e)];case 3:return n.sent(),Wc=setTimeout((function(){return Jc(e)}),6e5),[2]}}))}))},Kc=function(e,t,r){void 0===r&&(r=168),Fc||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==Xo.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 o="RC_LOGS_".concat(e),s=i.open(o,2);s.onerror=function(e){t.error(B.L_LOGDB_OPEN_FAILED_E,e.target.error),n(null)},s.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){Fc=null,t.warn(B.L_LOGDB_CLOSED_S)},o.onerror=function(e){Fc=null,t.error(B.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(B.L_LOGDB_ABORT_S,e.target.error)},Jc(3600*Math.max(24,Math.min(168,r))*1e3),n({appkey:e,db:o})):n(null)},s.onupgradeneeded=function(e){var t=e.target.result;Object.keys(qc).forEach((function(e){t.objectStoreNames.contains(e)&&t.deleteObjectStore(e);var r=t.createObjectStore(e,{autoIncrement:!0});qc[e].forEach((function(e){return r.createIndex(e,e,{unique:!1})}))}))}})):t.warn(B.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 o=i.objectStore(t);r.forEach((function(e){try{o.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},Zc=[],zc=!1,$c=function(e){return o(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return zc||0===Zc.length?[2]:(zc=!0,t=Zc.filter((function(e){return e.level<exports.LogL.FATAL})),r=Zc.filter((function(e){return e.level>=exports.LogL.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]}}))}))},ed=function(){var e=Qr();return e.setLogReader((function(e,t,r,n,i){return void 0===i&&(i=Bc),o(void 0,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return[4,Fc];case 1:return(o=s.sent())?[2,new Promise((function(s){var a=o.db.transaction(i,"readonly").objectStore(i),u=[],l=IDBKeyRange.bound(e,t),c=a.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===ct:i.level>=0)&&u.push(i),t.continue()}else s({logs:u})},c.onerror=function(){s({logs:[]})}}))]:[2,{logs:[]}]}}))}))})),e.setLogWriter((function(e){!function(e){o(void 0,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,Fc];case 1:if(!(t=r.sent()))return[2];if(e.content&&_t(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return Zc.push(e),$c(t.db),[2]}}))}))}(e)})),e},td="REPORT_SESSION",rd=function(e,t){return o(void 0,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){return r="".concat(td,"_").concat(e),n=t.getSessionId(),i=t.getConf(r),o=i.success,a=i.value,o?(n===(null==a?void 0:a.sessionId)||t.setConf(r,{sessionId:n}),[2]):[2]}))}))},nd=function(e,t){return o(void 0,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){return r=t.getSessionId(),n=t.getConf("".concat(td,"_").concat(e)),i=n.success,o=n.value,[2,i&&(null==o?void 0:o.sessionId)===r]}))}))},id=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,r){return void 0===t&&(t=Date.now()-id),void 0===r&&(r=Date.now()),o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=t<0?Date.now()+t:t,(r=r<=0?Date.now():r)-t>id&&(t=r-id),n=Qr(),(i=new kc(e,"RC-IM","IM",n)).debug(B.T,"get logs: startTime ".concat(t," endTime ").concat(r)),Kc(e,i),[4,n.read(t,r,exports.LogL.DEBUG,!1)];case 1:return o=s.sent().logs,i.debug(B.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,o=e.tag,s=e.traceId,a=e.loggerId,u=e.content;return"".concat(t,",").concat(r,",").concat(n,",").concat(i,",").concat(o,",").concat(s,",").concat(a,',"').concat(u,'"\n')})),n=new Blob(r,{type:"text/csv"}),i=URL.createObjectURL(n),o=document.createElement("a");o.href=i,o.download="".concat(e,".csv"),document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)}("".concat(e,"-").concat(t,"-").concat(r),o),[2]}}))}))}}}}var od,sd,ad,ud,ld,cd=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),dd=48,_d=64,fd=80,pd=96,hd="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",gd=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=[],o=[],s=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=bd(e.length),r=String.fromCharCode(fd|t.length);i.push(r+t)}else{var n=String.fromCharCode(pd|e.length);i.push(n)}i.push(e)}},a=0;a<e.length;){var u=Ed(t,e,a);if(u.length<2)o.push(e.charAt(a++));else if(u.length<4)o.push(e.substr(a,u.length)),a+=u.length;else{var l=bd(a-u.offset),c=bd(u.length);if(l.length+c.length>=u.length)o.push(e.substr(a,u.length)),a+=u.length;else{s();var d=String.fromCharCode(_d|l.length<<2|c.length);i.push(d+l+c),a+=u.length}}}s();var _=bd(e.length),f=String.fromCharCode(dd|_.length);return i.push(f+_),i.join("")},Ed=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 o=t.length-r,s=0,a=i.length;s<a;s++){var u=i[s],l=r-u;if(!(l>238327)){var c=Math.min(o,l);if(c<=n.length)break;if(!(n.length>2&&t.charAt(u+n.length-1)!==t.charAt(r+n.length-1))){for(var d=2,_=d;_<c&&t.charAt(u+_)===t.charAt(r+_);_++)d++;d>=n.length&&(n.length=d,n.offset=u)}}}return n},bd=function(e){var t=[],r=0;do{r=e%62,t.push(hd.charAt(r)),e=(e-r)/62}while(e>0);return t.join("")},Td=function(e){function r(t,r,n,i){var o,s=ic(),a=Xo.runtimeInfo,u=a.type,l=a.version,c="".concat(u,"|").concat(l,"|").concat(r.getSessionId(),"|").concat(Xo.connectPlatform);return o=e.call(this,t,s,c,i,r)||this,Object.defineProperty(o,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:n}),o}return t(r,e),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Xo.httpReq(e)}}),Object.defineProperty(r.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,rd(t.userId,this.logger)];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 o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,{success:!0,data:gd(e.map(qr).join(""))}]}))}))}}),Object.defineProperty(r.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,r,n,this.tableName)]}))}))}}),r}(Hr),vd=function(e){function r(t,r,n){return e.call(this,t,r,Bc,n)||this}return t(r,e),Object.defineProperty(r.prototype,"isReporter",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,nd(this.userId,this.logger)];case 1:return[2,e.sent()]}}))}))}}),Object.defineProperty(r.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n,i,a,u,l){return void 0===l&&(l=!1),o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return[4,this.isReporter()];case 1:return o=s.sent(),this.userId&&!o?[2]:[2,e.prototype.report.call(this,t,r,n,i,a,u,l)]}}))}))}}),r}(Td),Rd=function(e){function r(t,r,n){return e.call(this,t,r,Hc,n)||this}return t(r,e),r}(Td),Id=function(e){function r(t,r){var n=e.call(this,"WebConversationSettings")||this;return od.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}),sd.set(n,!1),n._ctx.on("sCmd",c(n,od,"m",ud),n),n._ctx.on("onConnected",c(n,od,"m",ad),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,c(this,od,"m",ld).call(this,e)];case 1:return[2,t.sent().trans((function(e){return{version:e.version}}))]}}))}))}}),Object.defineProperty(r.prototype,"syncDataFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=this._storage.get("conversationStatusVersion"),[4,c(this,od,"m",ld).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),r}(ir);sd=new WeakMap,od=new WeakSet,ad=function(){d(this,sd,!0,"f")},ud=function(e,t){var r=t.type,n=t.time;if(3===r)this.push(n),e.stopPropagation()},ld=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),t.info(B.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),r),n=hl.encode(Xs,{time:e}),[4,this._ctx.query(Sn.pullSeAtts,this._ctx.currentUserId,n,Zs)];case 1:return i=s.sent(),t.summary(B.L_PULL_CONVERSATION_SETTINGS_R,i,r,{version:e},(function(t){return{syncTime:t.version,version:e}})),i.isOk&&(o=this._storage.updateBySessionStates(i.data)).length&&this._ctx.emit("conversationStatusChanged",o),c(this,sd,"f")&&(d(this,sd,!1,"f"),this._ctx.emit("conversationStatusSynced",i.code)),[2,i]}}))}))};var md,yd,Ad,Sd,Od=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 o=i?JSON.stringify(t):t;Xo.localStorage.setItem(n,o)}}),e}(),Cd=function(e){var t;return"".concat(null!==(t=e.channelId)&&void 0!==t?t:"","_").concat(e.conversationType,"_").concat(e.targetId)},Nd=function(e){var t=u(e.split("_")),r=t[0],n=t[1],i=t.slice(2);return{channelId:r,conversationType:parseInt(n,10),targetId:i.join("_")}};function Pd(e){if(e){if(Array.isArray(e))return e;var t=Object.entries(e).map((function(e){var t=u(e,2);return{tagId:t[0],isTop:t[1].isTop}}));return t}}var Ld=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:exports.NotificationLevel.NOT_SET,translateStrategy:Tn.DEFAULT,tags:[],channelType:exports.UltraGroupChannelType.PUBLIC,operationTime:0,draft:"",hidden:!1,includeRobot:!1}},Md=function(){function e(e){md.set(this,void 0),yd.set(this,void 0),Ad.set(this,void 0),Sd.set(this,Ld()),d(this,md,e.conversationType,"f"),d(this,yd,e.targetId,"f"),d(this,Ad,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return c(this,md,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return c(this,yd,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return c(this,Ad,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return c(this,Sd,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!c(this,Sd,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!c(this,Sd,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return c(this,Sd,"f").notificationLevel||exports.NotificationLevel.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateStrategy",{get:function(){return c(this,Sd,"f").translateStrategy||Tn.DEFAULT},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(c(this,Sd,"f").tags||[]).map((function(e){return{tagId:e.tagId,isTop:e.isTop}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadCount",{get:function(){return c(this,Sd,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return c(this,Sd,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return c(this,Sd,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!c(this,Sd,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return c(this,Sd,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return c(this,Sd,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return c(this,Sd,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return c(this,Sd,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return c(this,Sd,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return c(this,Sd,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return c(this,Sd,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return c(this,Sd,"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:c(this,md,"f"),targetId:c(this,yd,"f"),channelId:c(this,Ad,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return Cd(this.identifier)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"includeRobot",{get:function(){return!!c(this,Sd,"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!==exports.NotificationLevel.NOT_SET&&(e.nl=this.notificationLevel),this.tags.length>0&&(e.tg=this.tags),this.translateStrategy!==Tn.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({},Ld()),{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){return this.updateAttrs({unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:e,firstUnreadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0},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};return Object.entries(i).forEach((function(i){var o=u(i,2),s=o[0],a=o[1],l=s;if(Object.prototype.hasOwnProperty.call(e,l)){var d=e[l];c(r,Sd,"f")[l]!==d&&(c(r,Sd,"f")[l]=d,a&&(n[a]={time:t,val:d}))}})),Object.keys(n).length>0?n:null}}),e}();md=new WeakMap,yd=new WeakMap,Ad=new WeakMap,Sd=new WeakMap;var wd,Ud,Dd,xd=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),t}}),r}(Md),Gd=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}(Md),Vd=function(e){function r(t){var r=e.call(this)||this;return wd.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}),r}return t(r,e),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Xo.localStorage,r=e.appkey,n=e.currentUserId,i=e.isDisableEmptyUGChannelId,o=Ze(r,n),s=Xe(r,n),a=ze(r,n),u=Je(r,n),l=We(r,n),d=Ke(r,n),_=Qe(r,n),f=t.getItem(o)||"0",p=t.getItem(s)||"0",h=t.getItem(a)||"1",g=t.getItem(l)||"0",E=JSON.parse(t.getItem(_)||"{}"),b=JSON.parse(t.getItem(u)||"{}"),T=JSON.parse(t.getItem(d)||"{}");return c(this,wd,"m",Ud).call(this,b,T,E,i),{inboxTime:{value:parseInt(f,10)||0,key:o},outboxTime:{value:parseInt(p,10)||0,key:s},broadcastTime:{value:parseInt(h,10)||0,key:a},conversationStatus:{value:b,key:u,stringify:!0},ultraGroupStatus:{value:T,key:d,stringify:!0},conversationStatusVersion:{value:parseInt(g,10)||0,key:l},conversationTypeGlobalSettings:{value:E,key:_,stringify:!0}}}}),Object.defineProperty(r.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),this.models.clear(),c(this,wd,"m",Dd).call(this)}}),Object.defineProperty(r.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("conversationTypeGlobalSettings");t===exports.NotificationLevel.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)||exports.NotificationLevel.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===exports.ConversationType.ULTRA_GROUP?new Gd(e):new xd(e);var o=(r===exports.ConversationType.PRIVATE||r===exports.ConversationType.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===n}));i.updateAttrs({includeRobot:o}),t&&this.models.set(Cd(e),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,o=e.toStoragItem(),s=Object.keys(o),a=0===s.length||1===s.length&&"h"===s[0],u=n===exports.ConversationType.ULTRA_GROUP?t:r;a?delete u[i]:u[i]=o})),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,r=e.version,n=e.state;if(this.set("conversationStatusVersion",r),!(null==n?void 0:n.length))return[];var i=new Map,o=new Set;return n.forEach((function(e){var n=e.channelId,s=e.busChannel,a=e.type,u=e.stateItem;e.time;var l={};if(null==u||u.forEach((function(e){var t=e.tags,r=e.sessionStateType,n=e.value;switch(r){case ns.IsSilent:l.notificationLevel=parseInt(n,10);break;case ns.IsTop:l.isTop="1"===n;break;case ns.Tags:l.tags=t;break;case ns.AutoTrans:l.translateStrategy=parseInt(n,10)}})),n){var c={conversationType:a,targetId:n,channelId:s},d=t.getOrCreateModel(c,!0);o.add(d);var _=d.updateAttrs(l,r);if(_)if(i.has(d)){var f=i.get(d);Object.assign(f,_)}else i.set(d,_)}else void 0!==l.notificationLevel&&t.setConversationTypeNotificationLevel(a,l.notificationLevel)})),this.updateConversationStorage(Array.from(o)),Array.from(i.entries()).map((function(e){var t=u(e,2),r=t[0],n=t[1];return{conversation:r.toIReceivedConversation(),updatedItems:n}}))}}),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,o={conversationType:i,targetId:n,channelId:e.busChannel},s=r.getOrCreateModel(o,!0),a=function(e,t){var r,n,i,o=e.msg,s=e.isBot;return{latestMessage:o?dc(o,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:!!s}}(e,t);i===exports.ConversationType.ULTRA_GROUP?s.updateAttrs(a):s.updateAttrs({latestMessage:a.latestMessage,operationTime:a.operationTime,includeRobot:a.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:exports.ConversationType.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===exports.ConversationType.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!==exports.ConversationType.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=Cd(e),i=this.models.get(n);if(!i)return null;var o=(t===exports.ConversationType.PRIVATE||t===exports.ConversationType.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===r}));return i.updateAttrs({includeRobot:o}),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,o=n.conversationType;e.includes(o)&&(n.notificationLevel>exports.NotificationLevel.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}(Od);wd=new WeakSet,Ud=function(e,t,r,n){Object.keys(e).forEach((function(t){var n=Nd(t);te(n.conversationType,W)?n.targetId||(r[n.conversationType]={nl:e[t].nl||exports.NotificationLevel.NOT_SET},delete e[t]):delete e[t]})),Object.keys(t).forEach((function(e){var i=Nd(e);if(i.conversationType===exports.ConversationType.ULTRA_GROUP)return i.targetId?void(n&&!i.channelId&&delete t[e]):(r[i.conversationType]={nl:t[e].nl||exports.NotificationLevel.NOT_SET},void delete t[e]);delete t[e]}))},Dd=function(){var e=this,t=Object.entries(this.get("conversationStatus")),r=Object.entries(this.get("ultraGroupStatus"));l(l([],u(t),!1),u(r),!1).forEach((function(t){var r,n,i,o,s,a,l,c,d,_,f,p,h,g,E,b=u(t,2),T=b[0],v=b[1],R=Nd(T);te(R.conversationType,K)&&e.getOrCreateModel(R,!0).updateAttrs((n=(r=v).c,i=r.mc,o=r.mmc,s=r.hm,a=r.m,l=r.fut,c=r.fuid,d=r.fumt,_=r.nl,f=r.to,p=r.tg,h=r.rt,g=r.h,E=r.ts,{isTop:f,notificationLevel:_,tags:Pd(p),unreadCount:n,unreadMentionedCount:i,unreadMentionedMeCount:o,hasMentioned:s,mentionedInfo:a,firstUnreadTime:l,firstUnreadMessageUId:c,firstUnreadMessageType:d,lastReadTime:h,hidden:g,translateStrategy:E}),0)}))};function kd(e){let t=e.length;for(;--t>=0;)e[t]=0}const Fd=256,Bd=286,Hd=30,qd=15,Yd=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]),Wd=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]),Jd=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Kd=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Qd=new Array(576);kd(Qd);const Xd=new Array(60);kd(Xd);const Zd=new Array(512);kd(Zd);const zd=new Array(256);kd(zd);const $d=new Array(29);kd($d);const e_=new Array(Hd);function t_(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 r_,n_,i_;function o_(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}kd(e_);const s_=e=>e<256?Zd[e]:Zd[256+(e>>>7)],a_=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},u_=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,a_(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)},l_=(e,t,r)=>{u_(e,r[2*t],r[2*t+1])},c_=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},d_=(e,t,r)=>{const n=new Array(16);let i,o,s=0;for(i=1;i<=qd;i++)s=s+r[i-1]<<1,n[i]=s;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=c_(n[t]++,t))}},__=e=>{let t;for(t=0;t<Bd;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Hd;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?a_(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},p_=(e,t,r,n)=>{const i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]},h_=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&p_(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!p_(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},g_=(e,t,r)=>{let n,i,o,s,a=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+a++],n+=(255&e.pending_buf[e.sym_buf+a++])<<8,i=e.pending_buf[e.sym_buf+a++],0===n?l_(e,i,t):(o=zd[i],l_(e,o+Fd+1,t),s=Yd[o],0!==s&&(i-=$d[o],u_(e,i,s)),n--,o=s_(n),l_(e,o,r),s=Wd[o],0!==s&&(n-=e_[o],u_(e,n,s)))}while(a<e.sym_next);l_(e,256,t)},E_=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let s,a,u,l=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<o;s++)0!==r[2*s]?(e.heap[++e.heap_len]=l=s,e.depth[s]=0):r[2*s+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,s=e.heap_len>>1;s>=1;s--)h_(e,r,s);u=o;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],h_(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,r[2*u]=r[2*s]+r[2*a],e.depth[u]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,r[2*s+1]=r[2*a+1]=u,e.heap[1]=u++,h_(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,o=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,d,_,f,p,h=0;for(_=0;_<=qd;_++)e.bl_count[_]=0;for(r[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],_=r[2*r[2*c+1]+1]+1,_>u&&(_=u,h++),r[2*c+1]=_,c>n||(e.bl_count[_]++,f=0,c>=a&&(f=s[c-a]),p=r[2*c],e.opt_len+=p*(_+f),o&&(e.static_len+=p*(i[2*c+1]+f)));if(0!==h){do{for(_=u-1;0===e.bl_count[_];)_--;e.bl_count[_]--,e.bl_count[_+1]+=2,e.bl_count[u]--,h-=2}while(h>0);for(_=u;0!==_;_--)for(c=e.bl_count[_];0!==c;)d=e.heap[--l],d>n||(r[2*d+1]!==_&&(e.opt_len+=(_-r[2*d+1])*r[2*d],r[2*d+1]=_),c--)}})(e,t),d_(r,l,e.bl_count)},b_=(e,t,r)=>{let n,i,o=-1,s=t[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a<u&&i===s||(a<l?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=i,0===s?(u=138,l=3):i===s?(u=6,l=3):(u=7,l=4))},T_=(e,t,r)=>{let n,i,o=-1,s=t[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++a<u&&i===s)){if(a<l)do{l_(e,i,e.bl_tree)}while(0!=--a);else 0!==i?(i!==o&&(l_(e,i,e.bl_tree),a--),l_(e,16,e.bl_tree),u_(e,a-3,2)):a<=10?(l_(e,17,e.bl_tree),u_(e,a-3,3)):(l_(e,18,e.bl_tree),u_(e,a-11,7));a=0,o=i,0===s?(u=138,l=3):i===s?(u=6,l=3):(u=7,l=4)}};let v_=!1;const R_=(e,t,r,n)=>{u_(e,0+(n?1:0),3),f_(e),a_(e,r),a_(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};var I_=(e,t,r,n)=>{let i,o,s=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<Fd;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),E_(e,e.l_desc),E_(e,e.d_desc),s=(e=>{let t;for(b_(e,e.dyn_ltree,e.l_desc.max_code),b_(e,e.dyn_dtree,e.d_desc.max_code),E_(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Kd[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?R_(e,t,r,n):4===e.strategy||o===i?(u_(e,2+(n?1:0),3),g_(e,Qd,Xd)):(u_(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(u_(e,t-257,5),u_(e,r-1,5),u_(e,n-4,4),i=0;i<n;i++)u_(e,e.bl_tree[2*Kd[i]+1],3);T_(e,e.dyn_ltree,t-1),T_(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),g_(e,e.dyn_ltree,e.dyn_dtree)),__(e),n&&f_(e)},m_={_tr_init:e=>{v_||((()=>{let e,t,r,n,i;const o=new Array(16);for(r=0,n=0;n<28;n++)for($d[n]=r,e=0;e<1<<Yd[n];e++)zd[r++]=n;for(zd[r-1]=n,i=0,n=0;n<16;n++)for(e_[n]=i,e=0;e<1<<Wd[n];e++)Zd[i++]=n;for(i>>=7;n<Hd;n++)for(e_[n]=i<<7,e=0;e<1<<Wd[n]-7;e++)Zd[256+i++]=n;for(t=0;t<=qd;t++)o[t]=0;for(e=0;e<=143;)Qd[2*e+1]=8,e++,o[8]++;for(;e<=255;)Qd[2*e+1]=9,e++,o[9]++;for(;e<=279;)Qd[2*e+1]=7,e++,o[7]++;for(;e<=287;)Qd[2*e+1]=8,e++,o[8]++;for(d_(Qd,287,o),e=0;e<Hd;e++)Xd[2*e+1]=5,Xd[2*e]=c_(e,5);r_=new t_(Qd,Yd,257,Bd,qd),n_=new t_(Xd,Wd,0,Hd,qd),i_=new t_(new Array(0),Jd,0,19,7)})(),v_=!0),e.l_desc=new o_(e.dyn_ltree,r_),e.d_desc=new o_(e.dyn_dtree,n_),e.bl_desc=new o_(e.bl_tree,i_),e.bi_buf=0,e.bi_valid=0,__(e)},_tr_stored_block:R_,_tr_flush_block:I_,_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*(zd[r]+Fd+1)]++,e.dyn_dtree[2*s_(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{u_(e,2,3),l_(e,256,Qd),(e=>{16===e.bi_valid?(a_(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 y_=(e,t,r,n)=>{let i=65535&e,o=e>>>16&65535,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{i=i+t[n++]|0,o=o+i|0}while(--s);i%=65521,o%=65521}return i|o<<16};const A_=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 S_=(e,t,r,n)=>{const i=A_,o=n+r;e^=-1;for(let r=n;r<o;r++)e=e>>>8^i[255&(e^t[r])];return~e},O_={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"},C_={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:N_,_tr_stored_block:P_,_tr_flush_block:L_,_tr_tally:M_,_tr_align:w_}=m_,{Z_NO_FLUSH:U_,Z_PARTIAL_FLUSH:D_,Z_FULL_FLUSH:x_,Z_FINISH:G_,Z_BLOCK:V_,Z_OK:j_,Z_STREAM_END:k_,Z_STREAM_ERROR:F_,Z_DATA_ERROR:B_,Z_BUF_ERROR:H_,Z_DEFAULT_COMPRESSION:q_,Z_FILTERED:Y_,Z_HUFFMAN_ONLY:W_,Z_RLE:J_,Z_FIXED:K_,Z_DEFAULT_STRATEGY:Q_,Z_UNKNOWN:X_,Z_DEFLATED:Z_}=C_,z_=258,$_=262,ef=42,tf=113,rf=666,nf=(e,t)=>(e.msg=O_[t],t),of=e=>2*e-(e>4?9:0),sf=e=>{let t=e.length;for(;--t>=0;)e[t]=0},af=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 uf=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const lf=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))},cf=(e,t)=>{L_(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,lf(e.strm)},df=(e,t)=>{e.pending_buf[e.pending++]=t},_f=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},ff=(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=y_(e.adler,t,i,r):2===e.state.wrap&&(e.adler=S_(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},pf=(e,t)=>{let r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match;const u=e.strstart>e.w_size-$_?e.strstart-(e.w_size-$_):0,l=e.window,c=e.w_mask,d=e.prev,_=e.strstart+z_;let f=l[o+s-1],p=l[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(r=t,l[r+s]===p&&l[r+s-1]===f&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&o<_);if(n=z_-(_-o),o=_-z_,n>s){if(e.match_start=t,s=n,n>=a)break;f=l[o+s-1],p=l[o+s]}}}while((t=d[t&c])>u&&0!=--i);return s<=e.lookahead?s:e.lookahead},hf=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-$_)&&(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),af(e),n+=t),0===e.strm.avail_in)break;if(r=ff(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=uf(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=uf(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<$_&&0!==e.strm.avail_in)},gf=(e,t)=>{let r,n,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=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<o&&(0===r&&t!==G_||t===U_||r!==n+e.strm.avail_in))break;s=t===G_&&r===n+e.strm.avail_in?1:0,P_(e,0,0,s),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,lf(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&&(ff(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===s);return a-=e.strm.avail_in,a&&(a>=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<=a&&(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-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==U_&&t!==G_&&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&&(ff(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,o=i>e.w_size?e.w_size:i,n=e.strstart-e.block_start,(n>=o||(n||t===G_)&&t!==U_&&0===e.strm.avail_in&&n<=i)&&(r=n>i?i:n,s=t===G_&&0===e.strm.avail_in&&r===n?1:0,P_(e,e.block_start,r,s),e.block_start+=r,lf(e.strm)),s?3:1)},Ef=(e,t)=>{let r,n;for(;;){if(e.lookahead<$_){if(hf(e),e.lookahead<$_&&t===U_)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=uf(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-$_&&(e.match_length=pf(e,r)),e.match_length>=3)if(n=M_(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=uf(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=uf(e,e.ins_h,e.window[e.strstart+1]);else n=M_(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(cf(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===G_?(cf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(cf(e,!1),0===e.strm.avail_out)?1:2},bf=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<$_){if(hf(e),e.lookahead<$_&&t===U_)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=uf(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-$_&&(e.match_length=pf(e,r),e.match_length<=5&&(e.strategy===Y_||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=M_(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=uf(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&&(cf(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=M_(e,0,e.window[e.strstart-1]),n&&cf(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=M_(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===G_?(cf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(cf(e,!1),0===e.strm.avail_out)?1:2};function Tf(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 vf=[new Tf(0,0,0,0,gf),new Tf(4,4,8,4,Ef),new Tf(4,5,16,8,Ef),new Tf(4,6,32,32,Ef),new Tf(4,4,16,16,bf),new Tf(8,16,32,32,bf),new Tf(8,16,128,128,bf),new Tf(8,32,128,256,bf),new Tf(32,128,258,1024,bf),new Tf(32,258,258,4096,bf)];function Rf(){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=Z_,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),sf(this.dyn_ltree),sf(this.dyn_dtree),sf(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),sf(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),sf(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 If=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==ef&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==tf&&t.status!==rf?1:0},mf=e=>{if(If(e))return nf(e,F_);e.total_in=e.total_out=0,e.data_type=X_;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?ef:tf,e.adler=2===t.wrap?0:1,t.last_flush=-2,N_(t),j_},yf=e=>{const t=mf(e);var r;return t===j_&&((r=e.state).window_size=2*r.w_size,sf(r.head),r.max_lazy_match=vf[r.level].max_lazy,r.good_match=vf[r.level].good_length,r.nice_match=vf[r.level].nice_length,r.max_chain_length=vf[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},Af=(e,t,r,n,i,o)=>{if(!e)return F_;let s=1;if(t===q_&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||r!==Z_||n<8||n>15||t<0||t>9||o<0||o>K_||8===n&&1!==s)return nf(e,F_);8===n&&(n=9);const a=new Rf;return e.state=a,a.strm=e,a.status=ef,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=o,a.method=r,yf(e)};var Sf={deflateInit:(e,t)=>Af(e,t,Z_,15,8,Q_),deflateInit2:Af,deflateReset:yf,deflateResetKeep:mf,deflateSetHeader:(e,t)=>If(e)||2!==e.state.wrap?F_:(e.state.gzhead=t,j_),deflate:(e,t)=>{if(If(e)||t>V_||t<0)return e?nf(e,F_):F_;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===rf&&t!==G_)return nf(e,0===e.avail_out?H_:F_);const n=r.last_flush;if(r.last_flush=t,0!==r.pending){if(lf(e),0===e.avail_out)return r.last_flush=-1,j_}else if(0===e.avail_in&&of(t)<=of(n)&&t!==G_)return nf(e,H_);if(r.status===rf&&0!==e.avail_in)return nf(e,H_);if(r.status===ef&&0===r.wrap&&(r.status=tf),r.status===ef){let t=Z_+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=W_||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,_f(r,t),0!==r.strstart&&(_f(r,e.adler>>>16),_f(r,65535&e.adler)),e.adler=1,r.status=tf,lf(e),0!==r.pending)return r.last_flush=-1,j_}if(57===r.status)if(e.adler=0,df(r,31),df(r,139),df(r,8),r.gzhead)df(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)),df(r,255&r.gzhead.time),df(r,r.gzhead.time>>8&255),df(r,r.gzhead.time>>16&255),df(r,r.gzhead.time>>24&255),df(r,9===r.level?2:r.strategy>=W_||r.level<2?4:0),df(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(df(r,255&r.gzhead.extra.length),df(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=S_(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(df(r,0),df(r,0),df(r,0),df(r,0),df(r,0),df(r,9===r.level?2:r.strategy>=W_||r.level<2?4:0),df(r,3),r.status=tf,lf(e),0!==r.pending)return r.last_flush=-1,j_;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=S_(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=i,lf(e),0!==r.pending)return r.last_flush=-1,j_;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=S_(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=S_(e.adler,r.pending_buf,r.pending-n,n)),lf(e),0!==r.pending)return r.last_flush=-1,j_;n=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,df(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=S_(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=S_(e.adler,r.pending_buf,r.pending-n,n)),lf(e),0!==r.pending)return r.last_flush=-1,j_;n=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,df(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=S_(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&&(lf(e),0!==r.pending))return r.last_flush=-1,j_;df(r,255&e.adler),df(r,e.adler>>8&255),e.adler=0}if(r.status=tf,lf(e),0!==r.pending)return r.last_flush=-1,j_}if(0!==e.avail_in||0!==r.lookahead||t!==U_&&r.status!==rf){let n=0===r.level?gf(r,t):r.strategy===W_?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(hf(e),0===e.lookahead)){if(t===U_)return 1;break}if(e.match_length=0,r=M_(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(cf(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===G_?(cf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(cf(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===J_?((e,t)=>{let r,n,i,o;const s=e.window;for(;;){if(e.lookahead<=z_){if(hf(e),e.lookahead<=z_&&t===U_)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){o=e.strstart+z_;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);e.match_length=z_-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=M_(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=M_(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(cf(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===G_?(cf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(cf(e,!1),0===e.strm.avail_out)?1:2})(r,t):vf[r.level].func(r,t);if(3!==n&&4!==n||(r.status=rf),1===n||3===n)return 0===e.avail_out&&(r.last_flush=-1),j_;if(2===n&&(t===D_?w_(r):t!==V_&&(P_(r,0,0,!1),t===x_&&(sf(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),lf(e),0===e.avail_out))return r.last_flush=-1,j_}return t!==G_?j_:r.wrap<=0?k_:(2===r.wrap?(df(r,255&e.adler),df(r,e.adler>>8&255),df(r,e.adler>>16&255),df(r,e.adler>>24&255),df(r,255&e.total_in),df(r,e.total_in>>8&255),df(r,e.total_in>>16&255),df(r,e.total_in>>24&255)):(_f(r,e.adler>>>16),_f(r,65535&e.adler)),lf(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?j_:k_)},deflateEnd:e=>{if(If(e))return F_;const t=e.state.status;return e.state=null,t===tf?nf(e,B_):j_},deflateSetDictionary:(e,t)=>{let r=t.length;if(If(e))return F_;const n=e.state,i=n.wrap;if(2===i||1===i&&n.status!==ef||n.lookahead)return F_;if(1===i&&(e.adler=y_(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(sf(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 o=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,hf(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=uf(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,hf(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=s,e.input=a,e.avail_in=o,n.wrap=i,j_},deflateInfo:"pako deflate (from Nodeca project)"};const Of=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Cf={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)Of(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 Nf=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Nf=!1}const Pf=new Uint8Array(256);for(let e=0;e<256;e++)Pf[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Pf[254]=Pf[254]=1;var Lf={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,o,s=e.length,a=0;for(i=0;i<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(a),o=0,i=0;o<a;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=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 o=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){o[i++]=t;continue}let s=Pf[t];if(s>4)o[i++]=65533,n+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&n<r;)t=t<<6|63&e[n++],s--;s>1?o[i++]=65533:t<65536?o[i++]=t:(t-=65536,o[i++]=55296|t>>10&1023,o[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Nf)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})(o,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+Pf[e[r]]>t?r:t}};var Mf=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 wf=Object.prototype.toString,{Z_NO_FLUSH:Uf,Z_SYNC_FLUSH:Df,Z_FULL_FLUSH:xf,Z_FINISH:Gf,Z_OK:Vf,Z_STREAM_END:jf,Z_DEFAULT_COMPRESSION:kf,Z_DEFAULT_STRATEGY:Ff,Z_DEFLATED:Bf}=C_;function Hf(e){this.options=Cf.assign({level:kf,method:Bf,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ff},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 Mf,this.strm.avail_out=0;let r=Sf.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Vf)throw new Error(O_[r]);if(t.header&&Sf.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Lf.string2buf(t.dictionary):"[object ArrayBuffer]"===wf.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=Sf.deflateSetDictionary(this.strm,e),r!==Vf)throw new Error(O_[r]);this._dict_set=!0}}Hf.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Gf:Uf,"string"==typeof e?r.input=Lf.string2buf(e):"[object ArrayBuffer]"===wf.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),(o===Df||o===xf)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Sf.deflate(r,o),i===jf)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Sf.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Vf;if(0!==r.avail_out){if(o>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},Hf.prototype.onData=function(e){this.chunks.push(e)},Hf.prototype.onEnd=function(e){e===Vf&&(this.result=Cf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const qf=16209;var Yf=function(e,t){let r,n,i,o,s,a,u,l,c,d,_,f,p,h,g,E,b,T,v,R,I,m,y,A;const S=e.state;r=e.next_in,y=e.input,n=r+(e.avail_in-5),i=e.next_out,A=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),a=S.dmax,u=S.wsize,l=S.whave,c=S.wnext,d=S.window,_=S.hold,f=S.bits,p=S.lencode,h=S.distcode,g=(1<<S.lenbits)-1,E=(1<<S.distbits)-1;e:do{f<15&&(_+=y[r++]<<f,f+=8,_+=y[r++]<<f,f+=8),b=p[_&g];t:for(;;){if(T=b>>>24,_>>>=T,f-=T,T=b>>>16&255,0===T)A[i++]=65535&b;else{if(!(16&T)){if(64&T){if(32&T){S.mode=16191;break e}e.msg="invalid literal/length code",S.mode=qf;break e}b=p[(65535&b)+(_&(1<<T)-1)];continue t}for(v=65535&b,T&=15,T&&(f<T&&(_+=y[r++]<<f,f+=8),v+=_&(1<<T)-1,_>>>=T,f-=T),f<15&&(_+=y[r++]<<f,f+=8,_+=y[r++]<<f,f+=8),b=h[_&E];;){if(T=b>>>24,_>>>=T,f-=T,T=b>>>16&255,16&T){if(R=65535&b,T&=15,f<T&&(_+=y[r++]<<f,f+=8,f<T&&(_+=y[r++]<<f,f+=8)),R+=_&(1<<T)-1,R>a){e.msg="invalid distance too far back",S.mode=qf;break e}if(_>>>=T,f-=T,T=i-o,R>T){if(T=R-T,T>l&&S.sane){e.msg="invalid distance too far back",S.mode=qf;break e}if(I=0,m=d,0===c){if(I+=u-T,T<v){v-=T;do{A[i++]=d[I++]}while(--T);I=i-R,m=A}}else if(c<T){if(I+=u+c-T,T-=c,T<v){v-=T;do{A[i++]=d[I++]}while(--T);if(I=0,c<v){T=c,v-=T;do{A[i++]=d[I++]}while(--T);I=i-R,m=A}}}else if(I+=c-T,T<v){v-=T;do{A[i++]=d[I++]}while(--T);I=i-R,m=A}for(;v>2;)A[i++]=m[I++],A[i++]=m[I++],A[i++]=m[I++],v-=3;v&&(A[i++]=m[I++],v>1&&(A[i++]=m[I++]))}else{I=i-R;do{A[i++]=A[I++],A[i++]=A[I++],A[i++]=A[I++],v-=3}while(v>2);v&&(A[i++]=A[I++],v>1&&(A[i++]=A[I++]))}break}if(64&T){e.msg="invalid distance code",S.mode=qf;break e}b=h[(65535&b)+(_&(1<<T)-1)]}}break}}while(r<n&&i<s);v=f>>3,r-=v,f-=v<<3,_&=(1<<f)-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<s?s-i+257:257-(i-s),S.hold=_,S.bits=f};const Wf=15,Jf=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]),Kf=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]),Qf=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]),Xf=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 Zf=(e,t,r,n,i,o,s,a)=>{const u=a.bits;let l,c,d,_,f,p,h=0,g=0,E=0,b=0,T=0,v=0,R=0,I=0,m=0,y=0,A=null;const S=new Uint16Array(16),O=new Uint16Array(16);let C,N,P,L=null;for(h=0;h<=Wf;h++)S[h]=0;for(g=0;g<n;g++)S[t[r+g]]++;for(T=u,b=Wf;b>=1&&0===S[b];b--);if(T>b&&(T=b),0===b)return i[o++]=20971520,i[o++]=20971520,a.bits=1,0;for(E=1;E<b&&0===S[E];E++);for(T<E&&(T=E),I=1,h=1;h<=Wf;h++)if(I<<=1,I-=S[h],I<0)return-1;if(I>0&&(0===e||1!==b))return-1;for(O[1]=0,h=1;h<Wf;h++)O[h+1]=O[h]+S[h];for(g=0;g<n;g++)0!==t[r+g]&&(s[O[t[r+g]]++]=g);if(0===e?(A=L=s,p=20):1===e?(A=Jf,L=Kf,p=257):(A=Qf,L=Xf,p=0),y=0,g=0,h=E,f=o,v=T,R=0,d=-1,m=1<<T,_=m-1,1===e&&m>852||2===e&&m>592)return 1;for(;;){C=h-R,s[g]+1<p?(N=0,P=s[g]):s[g]>=p?(N=L[s[g]-p],P=A[s[g]-p]):(N=96,P=0),l=1<<h-R,c=1<<v,E=c;do{c-=l,i[f+(y>>R)+c]=C<<24|N<<16|P}while(0!==c);for(l=1<<h-1;y&l;)l>>=1;if(0!==l?(y&=l-1,y+=l):y=0,g++,0==--S[h]){if(h===b)break;h=t[r+s[g]]}if(h>T&&(y&_)!==d){for(0===R&&(R=T),f+=E,v=h-R,I=1<<v;v+R<b&&(I-=S[v+R],!(I<=0));)v++,I<<=1;if(m+=1<<v,1===e&&m>852||2===e&&m>592)return 1;d=y&_,i[d]=T<<24|v<<16|f-o}}return 0!==y&&(i[f+y]=h-R<<24|64<<16),a.bits=T,0};const{Z_FINISH:zf,Z_BLOCK:$f,Z_TREES:ep,Z_OK:tp,Z_STREAM_END:rp,Z_NEED_DICT:np,Z_STREAM_ERROR:ip,Z_DATA_ERROR:op,Z_MEM_ERROR:sp,Z_BUF_ERROR:ap,Z_DEFLATED:up}=C_,lp=16180,cp=16190,dp=16191,_p=16192,fp=16194,pp=16199,hp=16200,gp=16206,Ep=16209,bp=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Tp(){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 vp=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<lp||t.mode>16211?1:0},Rp=e=>{if(vp(e))return ip;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=lp,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,tp},Ip=e=>{if(vp(e))return ip;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Rp(e)},mp=(e,t)=>{let r;if(vp(e))return ip;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ip:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Ip(e))},yp=(e,t)=>{if(!e)return ip;const r=new Tp;e.state=r,r.strm=e,r.window=null,r.mode=lp;const n=mp(e,t);return n!==tp&&(e.state=null),n};let Ap,Sp,Op=!0;const Cp=e=>{if(Op){Ap=new Int32Array(512),Sp=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(Zf(1,e.lens,0,288,Ap,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Zf(2,e.lens,0,32,Sp,0,e.work,{bits:5}),Op=!1}e.lencode=Ap,e.lenbits=9,e.distcode=Sp,e.distbits=5},Np=(e,t,r,n)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(t.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(t.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(t.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var Pp={inflateReset:Ip,inflateReset2:mp,inflateResetKeep:Rp,inflateInit:e=>yp(e,15),inflateInit2:yp,inflate:(e,t)=>{let r,n,i,o,s,a,u,l,c,d,_,f,p,h,g,E,b,T,v,R,I,m,y=0;const A=new Uint8Array(4);let S,O;const C=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(vp(e)||!e.output||!e.input&&0!==e.avail_in)return ip;r=e.state,r.mode===dp&&(r.mode=_p),s=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,l=r.hold,c=r.bits,d=a,_=u,m=tp;e:for(;;)switch(r.mode){case lp:if(0===r.wrap){r.mode=_p;break}for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<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=S_(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=Ep;break}if((15&l)!==up){e.msg="unknown compression method",r.mode=Ep;break}if(l>>>=4,c-=4,I=8+(15&l),0===r.wbits&&(r.wbits=I),I>15||I>r.wbits){e.msg="invalid window size",r.mode=Ep;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&l?16189:dp,l=0,c=0;break;case 16181:for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(r.flags=l,(255&r.flags)!==up){e.msg="unknown compression method",r.mode=Ep;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=Ep;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=S_(r.check,A,2,0)),l=0,c=0,r.mode=16182;case 16182:for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<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=S_(r.check,A,4,0)),l=0,c=0,r.mode=16183;case 16183:for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<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=S_(r.check,A,2,0)),l=0,c=0,r.mode=16184;case 16184:if(1024&r.flags){for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<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=S_(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&&(f=r.length,f>a&&(f=a),f&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+f),I)),512&r.flags&&4&r.wrap&&(r.check=S_(r.check,n,f,o)),a-=f,o+=f,r.length-=f),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===a)break e;f=0;do{I=n[o+f++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I))}while(I&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=S_(r.check,n,f,o)),a-=f,o+=f,I)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===a)break e;f=0;do{I=n[o+f++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I))}while(I&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=S_(r.check,n,f,o)),a-=f,o+=f,I)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=Ep;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=dp;break;case 16189:for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}e.adler=r.check=bp(l),l=0,c=0,r.mode=cp;case cp:if(0===r.havedict)return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,np;e.adler=r.check=1,r.mode=dp;case dp:if(t===$f||t===ep)break e;case _p:if(r.last){l>>>=7&c,c-=7&c,r.mode=gp;break}for(;c<3;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}switch(r.last=1&l,l>>>=1,c-=1,3&l){case 0:r.mode=16193;break;case 1:if(Cp(r),r.mode=pp,t===ep){l>>>=2,c-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=Ep}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Ep;break}if(r.length=65535&l,l=0,c=0,r.mode=fp,t===ep)break e;case fp:r.mode=16195;case 16195:if(f=r.length,f){if(f>a&&(f=a),f>u&&(f=u),0===f)break e;i.set(n.subarray(o,o+f),s),a-=f,o+=f,u-=f,s+=f,r.length-=f;break}r.mode=dp;break;case 16196:for(;c<14;){if(0===a)break e;a--,l+=n[o++]<<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=Ep;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;c<3;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.lens[C[r.have++]]=7&l,l>>>=3,c-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},m=Zf(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,m){e.msg="invalid code lengths set",r.mode=Ep;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],g=y>>>24,E=y>>>16&255,b=65535&y,!(g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(b<16)l>>>=g,c-=g,r.lens[r.have++]=b;else{if(16===b){for(O=g+2;c<O;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(l>>>=g,c-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=Ep;break}I=r.lens[r.have-1],f=3+(3&l),l>>>=2,c-=2}else if(17===b){for(O=g+3;c<O;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=g,c-=g,I=0,f=3+(7&l),l>>>=3,c-=3}else{for(O=g+7;c<O;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=g,c-=g,I=0,f=11+(127&l),l>>>=7,c-=7}if(r.have+f>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Ep;break}for(;f--;)r.lens[r.have++]=I}}if(r.mode===Ep)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Ep;break}if(r.lenbits=9,S={bits:r.lenbits},m=Zf(1,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,m){e.msg="invalid literal/lengths set",r.mode=Ep;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},m=Zf(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,m){e.msg="invalid distances set",r.mode=Ep;break}if(r.mode=pp,t===ep)break e;case pp:r.mode=hp;case hp:if(a>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,Yf(e,_),s=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,l=r.hold,c=r.bits,r.mode===dp&&(r.back=-1);break}for(r.back=0;y=r.lencode[l&(1<<r.lenbits)-1],g=y>>>24,E=y>>>16&255,b=65535&y,!(g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(E&&!(240&E)){for(T=g,v=E,R=b;y=r.lencode[R+((l&(1<<T+v)-1)>>T)],g=y>>>24,E=y>>>16&255,b=65535&y,!(T+g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=T,c-=T,r.back+=T}if(l>>>=g,c-=g,r.back+=g,r.length=b,0===E){r.mode=16205;break}if(32&E){r.back=-1,r.mode=dp;break}if(64&E){e.msg="invalid literal/length code",r.mode=Ep;break}r.extra=15&E,r.mode=16201;case 16201:if(r.extra){for(O=r.extra;c<O;){if(0===a)break e;a--,l+=n[o++]<<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],g=y>>>24,E=y>>>16&255,b=65535&y,!(g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(!(240&E)){for(T=g,v=E,R=b;y=r.distcode[R+((l&(1<<T+v)-1)>>T)],g=y>>>24,E=y>>>16&255,b=65535&y,!(T+g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=T,c-=T,r.back+=T}if(l>>>=g,c-=g,r.back+=g,64&E){e.msg="invalid distance code",r.mode=Ep;break}r.offset=b,r.extra=15&E,r.mode=16203;case 16203:if(r.extra){for(O=r.extra;c<O;){if(0===a)break e;a--,l+=n[o++]<<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=Ep;break}r.mode=16204;case 16204:if(0===u)break e;if(f=_-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Ep;break}f>r.wnext?(f-=r.wnext,p=r.wsize-f):p=r.wnext-f,f>r.length&&(f=r.length),h=r.window}else h=i,p=s-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do{i[s++]=h[p++]}while(--f);0===r.length&&(r.mode=hp);break;case 16205:if(0===u)break e;i[s++]=r.length,u--,r.mode=hp;break;case gp:if(r.wrap){for(;c<32;){if(0===a)break e;a--,l|=n[o++]<<c,c+=8}if(_-=u,e.total_out+=_,r.total+=_,4&r.wrap&&_&&(e.adler=r.check=r.flags?S_(r.check,i,_,s-_):y_(r.check,i,_,s-_)),_=u,4&r.wrap&&(r.flags?l:bp(l))!==r.check){e.msg="incorrect data check",r.mode=Ep;break}l=0,c=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=Ep;break}l=0,c=0}r.mode=16208;case 16208:m=rp;break e;case Ep:m=op;break e;case 16210:return sp;default:return ip}return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,(r.wsize||_!==e.avail_out&&r.mode<Ep&&(r.mode<gp||t!==zf))&&Np(e,e.output,e.next_out,_-e.avail_out),d-=e.avail_in,_-=e.avail_out,e.total_in+=d,e.total_out+=_,r.total+=_,4&r.wrap&&_&&(e.adler=r.check=r.flags?S_(r.check,i,_,e.next_out-_):y_(r.check,i,_,e.next_out-_)),e.data_type=r.bits+(r.last?64:0)+(r.mode===dp?128:0)+(r.mode===pp||r.mode===fp?256:0),(0===d&&0===_||t===zf)&&m===tp&&(m=ap),m},inflateEnd:e=>{if(vp(e))return ip;let t=e.state;return t.window&&(t.window=null),e.state=null,tp},inflateGetHeader:(e,t)=>{if(vp(e))return ip;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,tp):ip},inflateSetDictionary:(e,t)=>{const r=t.length;let n,i,o;return vp(e)?ip:(n=e.state,0!==n.wrap&&n.mode!==cp?ip:n.mode===cp&&(i=1,i=y_(i,t,r,0),i!==n.check)?op:(o=Np(e,t,r,r),o?(n.mode=16210,sp):(n.havedict=1,tp)))},inflateInfo:"pako inflate (from Nodeca project)"};var Lp=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 Mp=Object.prototype.toString,{Z_NO_FLUSH:wp,Z_FINISH:Up,Z_OK:Dp,Z_STREAM_END:xp,Z_NEED_DICT:Gp,Z_STREAM_ERROR:Vp,Z_DATA_ERROR:jp,Z_MEM_ERROR:kp}=C_;function Fp(e){this.options=Cf.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 Mf,this.strm.avail_out=0;let r=Pp.inflateInit2(this.strm,t.windowBits);if(r!==Dp)throw new Error(O_[r]);if(this.header=new Lp,Pp.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Lf.string2buf(t.dictionary):"[object ArrayBuffer]"===Mp.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Pp.inflateSetDictionary(this.strm,t.dictionary),r!==Dp)))throw new Error(O_[r])}function Bp(e,t){const r=new Fp(t);if(r.push(e),r.err)throw r.msg||O_[r.err];return r.result}Fp.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,s,a;if(this.ended)return!1;for(s=t===~~t?t:!0===t?Up:wp,"[object ArrayBuffer]"===Mp.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),o=Pp.inflate(r,s),o===Gp&&i&&(o=Pp.inflateSetDictionary(r,i),o===Dp?o=Pp.inflate(r,s):o===jp&&(o=Gp));r.avail_in>0&&o===xp&&r.state.wrap>0&&0!==e[r.next_in];)Pp.inflateReset(r),o=Pp.inflate(r,s);switch(o){case Vp:case jp:case Gp:case kp:return this.onEnd(o),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||o===xp))if("string"===this.options.to){let e=Lf.utf8border(r.output,r.next_out),t=r.next_out-e,i=Lf.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(o!==Dp||0!==a){if(o===xp)return o=Pp.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Fp.prototype.onData=function(e){this.chunks.push(e)},Fp.prototype.onEnd=function(e){e===Dp&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Cf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Hp={Inflate:Fp,inflate:Bp,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Bp(e,t)},ungzip:Bp,constants:C_};const{Inflate:qp,inflate:Yp,inflateRaw:Wp,ungzip:Jp}=Hp;var Kp=Jp;function Qp(e){return Object.keys(e).map((function(t){var r=e[t];return"string"!=typeof r&&(r="".concat(r)),{key:t,value:r}}))}function Xp(e,t,r,n){return hl.encode(za,{targetId:e,type:exports.ConversationType.GROUP,users:n,extProfile:r?Qp(r):void 0,settingProfile:Qp(t)})}var Zp,zp,$p,eh,th,rh,nh,ih,oh,sh=function(e,t){return hl.encode(Us,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},ah=function(e){var t=hl.decode(ms,e),r=t.compressioEnabled,n=t.compressedData,i=t.info,o=t.pullTime,s=t.isFinished,a=t.pageToken;if(r){var u=Kp(n);return ah(u)}return{info:i,pullTime:o,isFinished:s,pageToken:a}},uh=function(e){var t=hl.decode(cs,e);if(t.compressioEnabled){var r=Kp(t.compressedData);return uh(r)}return t},lh=function(e){var t=hl.decode(ds,e);if(t.compressioEnabled){var r=Kp(t.compressedData);return lh(r)}return{syncTime:t.syncTime,list:t.list.map((function(e){return hl.decode(_s,new Uint8Array(e))}))}},ch=function(e){return hl.encode(aa,n(n({},e),{compress:cd.enable()}))},dh=function(e){var t=hl.decode(la,e);if(t.compress){var r=Kp(t.compressData);return dh(r)}return t},_h=function(e){var t=hl.decode(ca,e);if(t.compress){var r=Kp(t.compressData);return _h(r)}return t},fh=function(e){var t=e.listType,r=e.result,i=e.page,o=new Uint8Array(r),s=[];switch(t){case 1:s=hl.decode(ou,o).list;break;case 2:s=hl.decode(iu,o).list;break;case 3:s=hl.decode(su,o).list;break;case 11:s=hl.decode(bu,o).list;break;case 12:s=hl.decode(Tu,o).list}return n(n({},i),{list:s})},ph=function(e){return hl.encode(Ps,n(n({},e),{compressioEnabled:cd.enable(),ignoreCmd:!0}))},hh=function(e){var t=hl.decode(Ls,e);if(t.compressioEnabled){var r=Kp(t.compressedData);return hh(r)}return t},gh=function(e,t){return hl.encode(zs,{ignoreVersion:!0,version:e,state:t})},Eh=function(e){var t=hl.decode(wu,e);if(t.compress){var r=Kp(t.compressedData);return Eh(r)}return t},bh=function(e){return hl.encode(Ys,{timestamp:e,compressioEnabled:cd.enable()})},Th=function(e){var t=hl.decode(Hs,e);if(t.compressioEnabled){var r=Kp(t.compressedData);return Th(r)}return t},vh=function(e,t){var r,n,i,o,s=e.targetId,l=e.conversationType,c=e.channelId,d=t.messageType,_=t.isMentioned,f=t.disableNotification,p=t.canIncludeExpansion,h=t.pushConfig,g=t.directionalUserIdList,E=t.isVoipPush,b=t.isFilerWhiteBlacklist,T=t.content,v=t.pushContent,R=t.pushData,I=t.expansion,m=t.messageId,y=t.needReceipt,A=t.disableUpdateLastMessage,S=t.isStatusMessage,O=cn(d).isPersited,C=_c(d,_,f,p,S),N=function(e,t,r,n){var i=0;return e&&(i|=1),t&&(i|=2),r&&(i|=4),n&&(i|=8),i}(!!E,!b,!!(null==h?void 0:h.disablePushTitle),!!(null==h?void 0:h.forceShowDetailContent));if(T.user&&T.user.portraitUri&&(T.user.portrait=T.user.portraitUri),p&&I){i={};try{for(var P=a(Object.entries(I)),L=P.next();!L.done;L=P.next()){var M=u(L.value,2),w=M[0],U=M[1];i[w]={v:U}}}catch(e){r={error:e}}finally{try{L&&!L.done&&(n=P.return)&&n.call(P)}finally{if(r)throw r.error}}}if(h){var D=h.pushTitle,x=h.iOSConfig,G=h.androidConfig,V=h.templateId,j=h.harmonyOSConfig;o={title:D,pushConfigs:Yt(x,G,j),pushId:null==G?void 0:G.notificationId,templateId:V}}var k=l===exports.ConversationType.SYSTEM?s:void 0,F=0;return O&&A&&(F|=1),y&&(F|=2),hl.encode(ls,{sessionId:C,pushText:(null==h?void 0:h.pushContent)||v,appData:(null==h?void 0:h.pushData)||R,toUserIds:g,configFlag:N,classname:d,content:JSON.stringify(T),extraContent:i?JSON.stringify(i):void 0,pushExt:o,clientUniqueId:m,busChannel:c,systemId:k,optionBits:F})},Rh=function(e){return hl.encode(ru,n(n({},e),{type:exports.ConversationType.GROUP}))},Ih=function(e){return hl.encode(au,n(n({},e),{type:exports.ConversationType.GROUP}))},mh=function(e){return hl.encode(tu,n(n({},e),{type:exports.ConversationType.GROUP}))},yh=function(e){function r(t,r){var n=e.call(this,"WebSGModule")||this;return Zp.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("sNtf",c(n,Zp,"m",eh),n),n._ctx.on("sMsg",c(n,Zp,"m",$p),n),n._ctx.on("syncMsg",c(n,Zp,"m",zp),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c,d,_,f,p,h,g,E,b,T,v;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx,r=t.logger,n=t.currentUserId,i=t.connectedTime,o=this._storage.get("inboxTime"),a=this._storage.get("outboxTime"),u=this._storage.get("broadcastTime"),l=r.createTraceId(),r.info(B.L_PULL_MSG_T,JSON.stringify({inboxTime:o,outboxTime:a,broadcastTime:u}),l),c=hl.encode(us,{ispolling:!1,isPullSend:!0,syncTime:o,sendBoxSyncTime:a,broadcastSyncTime:u,compressioEnabled:cd.enable()}),[4,this._ctx.query(Sn.pullMsg,this._ctx.currentUserId,c)];case 1:return(d=s.sent()).isOk?(_=uh(d.data.pbData),p=(f=_).list,h=f.finished,g=f.syncTime,E=f.broadcastSyncTime,b=a,T=p.map((function(e){var t=dc(e,n,e.dataTime<i);return t.messageDirection===exports.MessageDirection.SEND&&(b=Math.max(b,t.sentTime)),t})),this._storage.set("inboxTime",g),this._storage.set("broadcastTime",E||1),this._storage.set("outboxTime",b),r.info(B.L_PULL_MSG_R,JSON.stringify({code:0,inboxTime:g,broadcastTime:E,outboxTime:b,msgCount:T.length,hasNext:!!h}),l),v=Math.max(g,E||1,b),this._ctx.emit("messagesFromSG",T,!!h,e),[2,ar({version:v,hasNext:!h})]):(r.warn(B.L_PULL_MSG_R,JSON.stringify({code:d.code}),l),[2,d.wipe()])}}))}))}}),r}(ir);Zp=new WeakSet,zp=function(e,t,r){var n=t.conversationType,i=t.sentTime;n!==exports.ConversationType.ULTRA_GROUP&&n!==exports.ConversationType.CHATROOM&&(n===exports.ConversationType.RTC_ROOM||Gc(r)||(e.stopPropagation(),this.push(i)))},$p=function(e,t){var r=t.conversationType,n=t.sentTime,i=t.isStatusMessage;r!==exports.ConversationType.CHATROOM&&(e.stopPropagation(),i||r===exports.ConversationType.RTC_ROOM?this._ctx.emit("smsgFromSignalGroup",t):this.push(n))},eh=function(e,t){1===t.type&&(e.stopPropagation(),this.push(t.time))};var Ah,Sh,Oh=function(e){function r(t){var r=e.call(this,"WebUGModule")||this;return th.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r._ctx.on("syncMsg",c(r,th,"m",nh),r),r._ctx.on("sCmd",c(r,th,"m",rh),r),r}return t(r,e),Object.defineProperty(r.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,th,"m",oh).call(this,0)];case 1:return(e=s.sent()).isOk?(this._ctx.logger.info(B.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,c(this,th,"m",ih).call(this,0,[])]):(this._ctx.logger.warn(B.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(r=s.sent()).isOk?(n=r.data,i=n.length>0?n[n.length-1].versionTime:0,o=Math.max(t,i),[2,ar({relations:n,msgVersion:o})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){switch(r.label){case 0:return[4,c(this,th,"m",oh).call(this,e)];case 1:return[2,r.sent().trans((function(e){var r=e,n=r.syncTime,i=r.finished,o=r.list;if(null==o?void 0:o.length){var s=t._ctx.currentUserId,a=o.map((function(e){return dc(e,s,!1)}));t._ctx.emit("messagesFromUG",a,n)}return{version:n,hasNext:!i}}))]}}))}))}}),r}(ir);th=new WeakSet,rh=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},nh=function(e,t){t.conversationType===exports.ConversationType.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},ih=function e(t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,d,_,f,p,h;return s(this,(function(s){switch(s.label){case 0:return(n=this._ctx).currentUserId,i=n.logger,o=i.createTraceId(),i.info(B.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),o),a=hl.encode(ga,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query(Sn.pullUgSes,this._ctx.currentUserId,a,void 0)];case 1:return d=s.sent(),i.summary(B.L_PULL_UG_RELATIONS_R,d,o,{ver:t}),d.isOk?(_=ah(d.data.pbData),f=_.info,p=_.isFinished,r.push.apply(r,l([],u(f),!1)),p?[2,ar(r)]:(h=f[f.length-1].versionTime,[2,c(this,th,"m",e).call(this,h,r)])):[2,d.wipe()]}}))}))},oh=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=n.createTraceId(),n.info(B.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),l=e,o=hl.encode(Ea,{syncTime:l,compressioEnabled:cd.enable()}),[4,this._ctx.query(Sn.pullUgMsg,r,o)];case 1:return a=s.sent(),n.summary(B.L_PULL_ULTRA_MSG_R,a,i,{version:e}),a.isOk?(u=a.data,[2,ar(uh(u.pbData))]):[2,a.wipe()]}var l}))}))};var Ch,Nh,Ph,Lh=13,Mh=36,wh=41,Uh=function(e){function r(t,r){var n=e.call(this,"WebServerEventHandler")||this;return Ah.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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,l,d=this;return s(this,(function(s){switch(s.label){case 0:return t=this._logger.createTraceId(),this._logger.info(B.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,c(this,Ah,"m",Sh).call(this,e)];case 1:return r=s.sent(),this._logger.summary(B.L_PULL_EVENT_CHANGE_R,r,t,{version:e}),r.isOk?(n=r.data,i=n.list,o=n.syncTime,a=n.hasNext,i.length&&(l=new Map,i.forEach((function(e){var t=e.changeType;l.has(t)?l.get(t).push(e):l.set(t,[e])})),Array.from(l.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1];d.emit("serverEvent",r,n)}))),[2,ar({version:o,hasNext:a})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"noticeOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return e=this._logger.createTraceId(),this._logger.info(B.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,c(this,Ah,"m",Sh).call(this,0)];case 1:return t=r.sent(),this._logger.summary(B.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),r}(ir);Ah=new WeakSet,Sh=function(e){var t=hl.encode(va,{syncTime:e});return this._con.query(Sn.pullEventChange,this._con.getCurrentUserId(),t,Ra)};var Dh=function(e){function r(t){var r=e.call(this,"WebUGServerEventHandler")||this;return Ch.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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=hl.encode(va,{syncTime:e}),[4,this._ctx.query(Sn.qryMsgChange,this._ctx.currentUserId,t,Ia)];case 1:return(r=s.sent()).isOk?(n=r.data,i=n.list,o=n.syncTime,a=n.hasNext,i&&i.length&&c(this,Ch,"m",Nh).call(this,i),[2,ar({version:o,hasNext:a})]):[2,r.wipe()]}}))}))}}),r}(ir);Ch=new WeakSet,Nh=function(e){var t=[],r=[],n=[],i=[],o=[];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:o.push(e)}})),r.length&&c(this,Ch,"m",Ph).call(this,r,1),t.length&&c(this,Ch,"m",Ph).call(this,t,2),n.length&&this.emit("ugMsgRecalled",e),i.length&&this._ctx.emit("ugChannelChanged",i),o.length&&this._ctx.emit("ugUserGroupChanged",o)},Ph=function(e,t){var r=this,n=new Map;e.forEach((function(e){var t=e.targetId,r=e.busChannel,i=e.msgUID,o="".concat(t,"-").concat(r),s=n.get(o);s?s.messageUIds.push(i):n.set(o,{conversationIdentifier:{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:t,channelId:r},messageUIds:[i]})})),Array.from(n.entries()).forEach((function(e){var n=u(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 xh,Gh,Vh,jh,kh,Fh,Bh,Hh,qh,Yh,Wh,Jh,Kh,Qh,Xh,Zh,zh,$h,eg,tg,rg,ng,ig,og,sg,ag,ug,lg,cg,dg,_g,fg,pg,hg,gg,Eg,bg,Tg=function(){return o(void 0,void 0,void 0,(function(){return s(this,(function(e){return[2,exports.ErrorCode.NOT_SUPPORT]}))}))},vg=function(){return o(void 0,void 0,void 0,(function(){return s(this,(function(e){return[2,ur(exports.ErrorCode.NOT_SUPPORT,"Not support")]}))}))},Rg=function(e){function r(t,r){var n=e.call(this,"WebSGMsgModifyReceiver")||this;return xh.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}),Gh.set(n,0),Vh.set(n,!0),n._ctx.on("onConnected",c(n,xh,"m",jh),n),n._ctx.on("messagesFromSG",c(n,xh,"m",kh),n),n}return t(r,e),Object.defineProperty(r.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.setInitVersion(c(this,Gh,"f"),!0)}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger.createTraceId(),this._ctx.logger.info(B.L_PULL_MODIFY_MSG_T,JSON.stringify({time:e}),t),_={pullVersion:e},r=hl.encode(Mu,n(n({},_),{modifyType:[1],compress:cd.enable()})),[4,this._ctx.query(Sn.pullModifyMsg,this._ctx.currentUserId,r,void 0)];case 1:return i=s.sent(),this._ctx.logger.summary(B.L_PULL_MODIFY_MSG_R,i,t),i.isOk?(o=Eh(i.data.pbData),a=o.msg,u=o.nextVersion,l=o.finished,a&&a.length&&c(this,xh,"m",Fh).call(this,a),c(this,Vh,"f")&&(this._ctx.emit("messageModifiedSyncCompleted",!l),d(this,Vh,!1,"f")),[2,ar({version:u,hasNext:!l})]):[2,i.wipe()]}var _}))}))}}),r}(ir);Gh=new WeakMap,Vh=new WeakMap,xh=new WeakSet,jh=function(e,t){d(this,Vh,!0,"f"),t||(this.reset(),d(this,Gh,this._ctx.connectedTime,"f"))},kh=function(e,t,r,n){0===n&&t.length>0&&d(this,Gh,t[0].sentTime,"f")},Fh=function(e){var t=this,r=[],n=this._ctx.currentUserId;e.forEach((function(e){var i=e.msg;if(1===e.modifyType){var o=dc(i,n,!1);r.push(o);var s=o.conversationType,a=o.targetId,u=o.channelId,l=t.storage.getModel({conversationType:s,targetId:a,channelId:u});if(l&&l.latestMessage){var c=l.latestMessage,d=c.messageUId,_=c.messageType,f=c.content;if(d!==o.messageUId){if(_===me.REFERENCE){if(f.referMsgUid!==o.messageUId)return;f.referMsg=o.content}}else l.updateAttrs({latestMessage:o})}}})),r.length&&this._ctx.emit("messageModified",r)};var Ig=18e4,mg=function(){function e(e,t){Hh.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_userSettins",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),qh.set(this,void 0),Yh.set(this,void 0),Wh.set(this,void 0),Jh.set(this,void 0),$h.set(this,1),Object.defineProperty(this,"getConversationListByPageIndex",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"getUntaggedConversationListByPage",{enumerable:!0,configurable:!0,writable:!0,value:vg}),fg.set(this,new Set),Object.defineProperty(this,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"setMessageSpeechToTextVisible",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"syncRemoteConversations",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"getMessagesAroundTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"deleteLocalUGMessagesForAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"getUnreadMentionedMessages",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"saveEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"getEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"clearEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:vg}),this.storage=new Vd(e),this.settings=new Id(this._ctx,this.storage),d(this,qh,new Oh(this._ctx),"f"),d(this,Yh,new yh(this._ctx,this.storage),"f"),d(this,Wh,new Dh(this._ctx),"f"),d(this,Jh,new Rg(this._ctx,this.storage),"f"),c(this,Wh,"f").on("ugMsgModify",c(this,Hh,"m",rg),this),c(this,Wh,"f").on("ugMsgExpansion",c(this,Hh,"m",ng),this),c(this,Wh,"f").on("ugMsgRecalled",c(this,Hh,"m",ig),this),this._ctx.on("onConnected",c(this,Hh,"m",zh),this),this._ctx.on("onDisconnected",c(this,Hh,"m",ag),this),this._ctx.on("onSuspend",c(this,Hh,"m",ag),this),this._ctx.on("sCmd",c(this,Hh,"m",ug),this),this._ctx.on("signal",c(this,Hh,"m",lg),this),this._ctx.on("serverEvent",c(this,Hh,"m",Qh),this),this._ctx.on("robotsSynced",c(this,Hh,"m",Kh),this)}return Object.defineProperty(e.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,Jh,"f").startPullModifyMsg()}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,d;return s(this,(function(s){return r=e.count,n=e.startTime,i=e.order,o=e.conversationTypes,t?(a=0!==n||i?n:Number.MAX_SAFE_INTEGER,u=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>a:e.operationTime<a)})).sort((function(e,t){return e.operationTime-t.operationTime})),l=Math.min(u.length,r),d=i?u.slice(0,l):u.slice(u.length-l),i||d.reverse(),[2,ar(d.map((function(e){return e.toIReceivedConversation()})))]):[2,c(this,Hh,"m",cg).call(this,n,r,i||0,o)]}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){return n=((null==t?void 0:t.length)||0)>0?t:ee(e?K:W),i="string"==typeof r&&""!==r,o=this.storage.getAllModels().filter((function(t){return t.isTop&&!t.hidden&&n.includes(t.conversationType)&&(t.conversationType!==exports.ConversationType.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,c(this,Hh,"m",dg).call(this,o)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>exports.NotificationLevel.NOT_SET&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,Hh,"m",dg).call(this,t)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){return r=((null==t?void 0:t.length)||0)>0?t:ee(e?K:W),n=this.storage.getAllModels().filter((function(t){return t.unreadCount>0&&r.includes(t.conversationType)&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,Hh,"m",dg).call(this,n)]}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(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===exports.ConversationType.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,ar(n)]):[4,c(this,Hh,"m",cg).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(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=0,this.storage.getAllModels().forEach((function(i){i.unreadCount>0&&e.includes(i.conversationType)&&(i.conversationType!==exports.ConversationType.ULTRA_GROUP&&(!r&&!i.channelId||i.channelId===r)||i.conversationType===exports.ConversationType.ULTRA_GROUP&&(""===i.channelId||"RCDefault"===i.channelId))&&(t||i.notificationLevel<=exports.NotificationLevel.NOT_SET)&&(n+=i.unreadCount)})),[2,ar(n)]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return t=this.storage.getOrCreateModel(e,!1),r=t.toIReceivedConversation(),[4,c(this,Hh,"m",dg).call(this,[r])];case 1:return(n=i.sent()).isOk?[2,n.trans((function(e){return e[0]}))]:[2,ar(r)]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var r,i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,c(this,Hh,"m",_g).call(this,e,r,t)];case 1:return(i=s.sent()).isOk?(o=i.data,a=o.version,u=o.updateVersion,l=e.map((function(e){var r=d.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(l),u&&this.storage.set("conversationStatusVersion",a),[2,ar()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,c(this,Hh,"m",_g).call(this,e,r,void 0,t)];case 1:return(n=s.sent()).isOk?(i=n.data,o=i.version,a=i.updateVersion,u=e.map((function(e){var r=l.storage.getOrCreateModel(e,!0);return r.updateAttrs({notificationLevel:t}),r})),this.storage.updateConversationStorage(u),a&&this.storage.set("conversationStatusVersion",o),[2,ar()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,c(this,Hh,"m",_g).call(this,e,r,void 0,void 0,t)];case 1:return(n=s.sent()).isOk?(i=n.data,o=i.version,a=i.updateVersion,u=e.map((function(e){var r=l.storage.getOrCreateModel(e,!0);return r.updateAttrs({translateStrategy:t}),r})),this.storage.updateConversationStorage(u),a&&this.storage.set("conversationStatusVersion",o),[2,ar()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this.storage.getOrCreateModel(e,!1),[2,ar(t.notificationLevel)]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this.storage.getConversationTypeNotificationLevel(e),[2,ar(t)]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=this._ctx.currentUserId,i=hl.encode(na,{type:e,unpushLevel:t,version:r,ignoreVersion:!0}),[4,this._ctx.query(Sn.setTypeUnpush,n,i,ia)];case 1:return(o=s.sent()).isOk?(a=o.data,u=a.version,l=a.updateVersion,this.storage.setConversationTypeNotificationLevel(e,t),l&&this.storage.set("conversationStatusVersion",u),[2,ar()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(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,ar()]}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return r=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),n=hl.encode(js,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:r}),i=e.conversationType===exports.ConversationType.ULTRA_GROUP?Sn.delUgMsg:Sn.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,n)];case 1:return(o=s.sent()).isOk?this._ctx.includeUg?((a=this.storage.getModel(e))&&(u=a.latestMessage)&&t.some((function(e){return e.messageUId===u.messageUId}))&&a.updateAttrs({latestMessage:null}),[2,ar()]):[2,ar()]:[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=hl.encode(Ss,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),n=Pg[e.conversationType],[4,this._ctx.query(n,this._ctx.currentUserId,r)];case 1:return(i=s.sent()).isOk?this._ctx.includeUg?((o=this.storage.getModel(e))&&(a=o.latestMessage)&&(0===t||a.sentTime<=t)&&o.updateAttrs({latestMessage:null}),[2,ar()]):[2,ar()]:[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=hl.encode(Os,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query(Sn.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,ar()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=hl.encode(sa,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),n=t[0],[4,this._ctx.query(Sn.readReceipt,n,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,l;return s(this,(function(s){switch(s.label){case 0:return t=new Map,e.forEach((function(e){var r=Cd(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=u(e,2),r=t[0],n=t[1],i=Nd(r);return{targetId:i.targetId,type:i.conversationType,busChannel:i.channelId,msgIds:Array.from(n)}})),n=function(e){return hl.encode(ua,{items:e,compress:cd.enable()})}(r),[4,this._ctx.query(Sn.qryReceiptBatch,e[0].messageUId,n)];case 1:return(i=s.sent()).isOk?(o=i.data,a=_h(o.pbData).item,l=[],a.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,o=e.totalCnt;l.push({identifier:r,messageUId:t,unreadCount:n,readCount:i,totalCount:o})}))})),[2,ar(l)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return n=0===r.readStatus?1:2,i=ch({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(Sn.qryReceipt,t,i)];case 1:return(o=s.sent()).isOk?(a=o.data,u=dh(a.pbData),l=u.resp,c=u.pageToken,d=l[0],[2,ar({pageToken:c||"",totalCount:1===n?d.readCnt:d.unreadCnt,users:(1===n?d.readUser:d.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(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,c;return s(this,(function(s){switch(s.label){case 0:return n=ch({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:r}),[4,this._ctx.query(Sn.qryReceipt,t,n)];case 1:return(i=s.sent()).isOk?(o=i.data,a=dh(o.pbData).resp,c=a[0],[2,ar({pageToken:"",totalCount:0,users:l(l([],u(c.readUser),!1),u(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(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=lr.create("requestSpeechToTextForMessage").isObject("option",t,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").validate("messageType",null==t?void 0:t.messageType,(function(e){return e===me.HQ_VOICE||e===me.VOICE}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){if(t.messageType===me.HQ_VOICE)e.validate("numberOfChannels",t.numberOfChannels,(function(e){return 1===e}),!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"numberOfChannels invalid").validate("sampleRate",t.sampleRate,(function(e){return 16e3===e||8e3===e}),!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"sampleRate invalid").isString("format",t.format).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"format invalid").isHttpUrl("remoteUrl",t.remoteUrl,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"remoteUrl invalid");else{var r=t.content;e.isNotEmptyString("content",r,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"content invalid")}})).isLimitedInteger("duration",t.duration,1,60,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"duration invalid").result()).isOk?c(this,fg,"f").has(e)?[2,ur(exports.ErrorCode.SPEECH_TO_TEXT_REQUEST_IN_PROCESS,"speech to text request in process")]:(c(this,Hh,"m",pg).call(this,e,t),[2,ar()]):[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=e.messageUId,r=e.messageContent,n=e.conversation,i=hl.encode(ba,{targetId:n.targetId,type:n.conversationType,busChannel:n.channelId,msgUID:t,msgTime:0,content:JSON.stringify(r),fromUserId:""}),[4,this._ctx.query(Sn.modifyMsg,this._ctx.currentUserId,i,Ta)];case 1:return(o=s.sent()).isOk?((a=this.storage.getModel(n))&&(u=a.latestMessage,l=a.conversationType,u&&u.messageUId===t&&(u.content=r,u.isModifyMessage=!0,u.modifyInfo=l===exports.ConversationType.ULTRA_GROUP?void 0:{timestamp:o.data.modifyTime,status:Lr,content:{}},a.updateAttrs({latestMessage:u}))),[2,ar()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a=this;return s(this,(function(s){return(o=lr.create("refreshReferenceMessageWithParams").validate("messageInfoMap",i,(function(t){return t&&e.every((function(e){return t[e]&&Et(t[e])}))}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_INFO_MAP).result()).isOk?(setTimeout((function(){n([]),c(a,Hh,"m",gg).call(a,e,t,r,i)}),0),[2,ar()]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,l,c,d,_,f,p,h,g=this;return s(this,(function(s){switch(s.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:ns.Tags,value:"",tags:[{tagId:e}]}]}})),a=gh(r,o),[4,this._ctx.query(Sn.addTag,i,a,ra)]):[2,ur(exports.ErrorCode.TAG_NOT_EXIST)];case 1:return(l=s.sent()).isOk?(c=l.data,d=c.version,_=c.updateVersion,f=new Map,t.forEach((function(t){var r=g.storage.getOrCreateModel(t,!0),n={},i=r.tags;i.some((function(t){return t.tagId===e}))||(n.tags=i.concat({tagId:e}),f.set(r,n))})),p=[],h=[],Array.from(f.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1];h.push(r);var i=r.updateAttrs(n,d);i&&p.push({conversation:r.toIReceivedConversation(),updatedItems:i})})),this.storage.updateConversationStorage(h),_&&this.storage.set("conversationStatusVersion",d),p.length>0&&this._ctx.emit("conversationStatusChanged",p),[2,ar()]):[2,l.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(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,ar(n)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,_,f,p;return s(this,(function(s){switch(s.label){case 0:return n=this.storage.get("conversationStatusVersion"),i=r.isTop,o=this.storage.getOrCreateModel(t,!1),a=o.tags,(u=a.find((function(t){return t.tagId===e})))?(l=gh(n,[{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:ns.Tags,value:"",tags:[{tagId:e,isTop:i}]}]}]),c=this._ctx.currentUserId,[4,this._ctx.query(Sn.addTag,c,l,ra)]):[2,ur(exports.ErrorCode.NO_TAG_IN_CONVER)];case 1:return(d=s.sent()).isOk?(_=d.data,f=_.version,p=_.updateVersion,u.isTop=i,o.updateAttrs({tags:a},f),this.storage.updateConversationStorage([o]),p&&this.storage.set("conversationStatusVersion",f),[2,ar()]):[2,d.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d=this;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=gh(r,t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:ns.Tags,value:"",tags:[{tagId:e}]}]}}))),i=this._ctx.currentUserId,[4,this._ctx.query(Sn.delTag,i,n,ra)];case 1:return(o=s.sent()).isOk?(a=o.data,u=a.version,l=a.updateVersion,c=t.map((function(t){var r=d.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,ar()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,_;return s(this,(function(s){switch(s.label){case 0:return r=this._ctx.currentUserId,n=this.storage.get("conversationStatusVersion"),i=gh(n,[{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:Date.now(),stateItem:[{sessionStateType:ns.Tags,value:"",tags:t.map((function(e){return{tagId:e}}))}]}]),[4,this._ctx.query(Sn.delTag,r,i,ra)];case 1:return(o=s.sent()).isOk?(a=o.data,u=a.version,l=a.updateVersion,c=this.storage.getOrCreateModel(e,!0),d=c.tags,_={tags:d.filter((function(e){return!t.includes(e.tagId)}))},c.updateAttrs(_,u),this.storage.updateConversationStorage([c]),l&&this.storage.set("conversationStatusVersion",u),[2,ar()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){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,ar([])]:(a=o.map((function(t){return n(n({},t.toIReceivedConversation()),{isTopInTag:t.tags.some((function(t){return t.tagId===e&&t.isTop}))})})),[2,c(this,Hh,"m",dg).call(this,a)])):[2,ar([])]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(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>exports.NotificationLevel.NOT_SET&&!t)return;r+=null!==(i=n.unreadCount)&&void 0!==i?i:0}})),[2,ar(r)]}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return t=e.identifiers,r=e.deleteMessages,n=hl.encode(Vs,{relation:t.map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),cleanMsg:r}),[4,this._ctx.query(Sn.delRelationBatch,this._ctx.currentUserId,n,void 0)];case 1:return(i=s.sent()).isOk&&t.forEach((function(e){var t=o.storage.getModel(e);t&&o.storage.removeConversation(t)})),[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=hl.encode(oa,{msgId:t,channelId:r}),[4,this._ctx.query(Sn.rrMsg,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=e.conversationType,r=e.channelId,n=e.targetId,i=hl.encode(Aa,{targetId:n,type:t,busChannel:r||"",opType:0}),(o=new eo(Sn.operate,i,n)).setHeaderQos(Ln),[4,this._ctx.send(o)];case 1:return[2,s.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(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=Ec(t.unreadMentionedCount||0),t.unreadMessageCount=Ec(t.unreadMessageCount||0),t.unreadMentionedMeCount=Ec(t.unreadMentionedMeCount||0),t})),[2,ar(n)]}))}))}}),Object.defineProperty(e.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=this._ctx.currentUserId,[4,c(this,Hh,"m",hg).call(this,e,t)];case 1:return(n=s.sent()).isOk?(i=n.data,o=i.list,i.notExistMsgId,a=o.map((function(t){return dc(t,r,!1,e.targetId)})),[2,ar(a)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.targetId,r=e.channelId,n=e.sentTime,i=e.count,o=hl.encode(ys,{groupId:t,busChannel:r,msgTime:n,size:i}),[4,this._ctx.query(Sn.qryUgUal,this._ctx.currentUserId,o,As)];case 1:return(a=s.sent()).isOk?(u=a.data.msgInfo,[2,ar(u.map((function(e){return{messageUId:e.msgId,sentTime:e.msgTime,messageType:e.className,mentionedType:e.remindType}})))]):[2,a.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var i;return o(this,void 0,void 0,(function(){var o,a,u,l,c,d,_,f;return s(this,(function(s){switch(s.label){case 0:return o=this._ctx.currentUserId,a=t.mid,u=t.put,l=t.del,c=t.clear,d=hl.encode(ba,{fromUserId:o,targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgUID:a,msgTime:r,content:JSON.stringify(t)}),[4,this._ctx.query(Sn.upMsgEx,e.targetId,d)];case 1:return(_=s.sent()).isOk&&(null==(f=null===(i=this.storage.getModel(e))||void 0===i?void 0:i.latestMessage)?void 0:f.messageUId)===a&&(c?f.expansion={}:u?f.expansion=n(n({},f.expansion),u):l&&f.expansion&&l.forEach((function(e){delete f.expansion[e]}))),[2,_.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=hl.encode(ea,{unpushLevel:t,busChannel:r}),[4,this._ctx.query(Sn.ugUnpushSet,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return r=hl.encode($s,{busChannel:t}),[4,this._ctx.query(Sn.ugUnpushQuery,e,r,ta)];case 1:return(n=o.sent()).isOk?(i=n.data.unpushLevel,[2,ar(i)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return r=this.storage.getModel(e),[2,ar(null!==(t=null==r?void 0:r.unreadMentionedCount)&&void 0!==t?t:0)]}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return e=this.storage.getAllSGModels().reduce((function(e,t){return e+t.unreadMentionedCount}),0),[2,ar(e)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=0,this.storage.getAllModels().forEach((function(i){if(e.includes(i.conversationType)){var o=i.notificationLevel,s=i.unreadCount,a=i.unreadMentionedCount;(0===t.length||t.includes(o))&&(n+=r?a:s)}})),[2,ar(n)]}))}))}}),Object.defineProperty(e.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this.storage.getModel(e),[2,ar(t?t.unreadCount:0)]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){return(t=this.storage.getModel(e))?(r=t.firstUnreadMessage,[2,ar(r?{messageUId:r.messageUId||"",sentTime:r.sentTime}:null)]):[2,ar(null)]}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return n=this.storage.getAllUGModels(),i=n.reduce((function(n,i){var o=r?i.unreadMentionedCount:i.unreadCount;if(!o||i.targetId!==e)return n;var s=i.notificationLevel||exports.NotificationLevel.NOT_SET;return!t.length||t.includes(s)?n+o:n}),0),[2,ar(Ec(i))]}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(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:Ec(e.unreadCount||0),mentionedCount:Ec(e.unreadMentionedCount||0),mentionedMeCount:Ec(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||exports.NotificationLevel.NOT_SET}})),[2,ar(t)]}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){return t=this.storage.getModel(e),(r=null==t?void 0:t.firstUnreadMessage)?[2,ar(r)]:[2,ur(exports.ErrorCode.RC_DB_DATA_NOT_FOUND)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return e=this.storage.getAllUGModels().filter((function(e){return e.notificationLevel>exports.NotificationLevel.NOT_SET})).map((function(e){return e.toIReceivedConversation()})),[2,ar(e)]}))}))}}),Object.defineProperty(e.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return t=this._ctx.serverTime,e.conversationType!==exports.ConversationType.ULTRA_GROUP?[3,2]:(r=sh(e,t),(n=new eo(Sn.updUgRTime,r,this._ctx.currentUserId)).setHeaderQos(Ln),[4,this._ctx.send(n)]);case 1:if(!(i=o.sent()).isOk)return[2,i.wipe()];o.label=2;case 2:return this.storage.clearConversationUnreadCount(e,t),[2,ar()]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,Hh,"m",bg).call(this,t,r,e,[],xe.ALL,Sn.qrySessions)];case 1:return(i=s.sent()).isOk?(o=this._ctx.currentUserId,a=i.data.info.map((function(e){var t=e.unreadCount,r=e.busChannel,i=e.type,s=e.userId,a=e.versionTime,l=e.msg,c=u.storage.getOrCreateModel({conversationType:i,targetId:s,channelId:r||""},!1);return n(n({},c.toIReceivedConversation()),{unreadMessageCount:t,operationTime:a,latestMessage:l?dc(l,o,!1,s):null})})).sort((function(e,t){var n,i,o=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0,s=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===r?s-o:o-s})),[2,ar(a)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=hl.encode(Ms,{nothing:1}),[4,this._ctx.query(Sn.qrySessionsAtt,this._ctx.currentUserId,e,ws)];case 1:return[2,t.sent().trans((function(e){return e.totalUnreadCount}))]}}))}))}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return t=this._ctx.serverTime,this.storage.clearConversationUnreadCount(e,this._ctx.serverTime),r=sh(e,t),n=new eo(Sn.updRRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=hl.encode(Ds,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(Sn.delSessions,this._ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=hl.encode(xs,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(Sn.qrySessionsUnread,this._ctx.currentUserId,t,Gs)];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(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){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!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r),[2,ar(o.map((function(e){return e.toIReceivedConversation()})))]):(a=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=a.map((function(e){return e.toIReceivedConversation()})),[2,c(this,Hh,"m",dg).call(this,u)])}))}))}}),Object.defineProperty(e.prototype,"loadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,_=this;return s(this,(function(s){switch(s.label){case 0:return i=function(e,t,r){var n=r.conversationTypes,i=r.tagFilter,o=void 0===i?{}:i,s=r.order;r.channelId;var a=o.tagIds,u=o.topPriority;return hl.encode(Is,{type:n,count:t,order:s,tags:a,isTagTop:!!u,pageToken:e,compress:cd.enable()})}(e,t,r),[4,this._ctx.query(Sn.qryRelationFilter,this._ctx.currentUserId,i,void 0)];case 1:return(o=s.sent()).isOk?(a=ah(o.data.pbData),u=a.pageToken,l=a.isFinished,c=a.info,d=c.map((function(e){var t=e.busChannel,r=e.type,i=e.userId,o={conversationType:r,targetId:i,channelId:t||""},s=_.storage.getOrCreateModel(o,!1);return n(n({},s.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?dc(e.msg,_._ctx.currentUserId,!1,i):null})})),[2,ar({pageToken:u||"",finished:!!l,list:d})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=sh(e,t),n=new eo(Sn.updRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=hl.encode(oa,{msgId:[t],channelId:r}),[4,this._ctx.query(Sn.rrList,e,n,da)];case 1:return[2,i.sent().trans((function(e){return{totalMemberCount:e.totalMemberNum,list:e.list}}))]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=e.conversationType,i=e.targetId,o=e.channelId,a=hl.encode(Ma,{targetId:i,type:n,busChannel:o,startMsgId:t,endMsgId:r}),u=new eo(Sn.sendMsgRead,a,i),[4,this._ctx.send(u)];case 1:return[2,s.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return r=e.targetId,n=e.channelId,i=void 0===n?"":n,o=hl.encode(wa,{targetId:r,busChannel:i,msgId:t}),[4,this._ctx.query(Sn.qryMsgRead,r,o,Ua)];case 1:return[2,s.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(e.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=e.targetId,i=e.conversationType,o=e.channelId,a=hl.encode(Da,{type:i,busChannel:o,msgId:t}),[4,this._ctx.query(Sn.qryMsgReadCntBatch,r,a,xa)];case 1:return[2,s.sent().trans((function(t){return t.result.map((function(t){return n({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){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,ar(i.map((function(e){return e.toIReceivedConversation()})))]):[2,c(this,Hh,"m",cg).call(this,e.timestamp,t,0,r,xe.ROBOT_ONLY)]}))}))}}),e}();qh=new WeakMap,Yh=new WeakMap,Wh=new WeakMap,Jh=new WeakMap,$h=new WeakMap,fg=new WeakMap,Hh=new WeakSet,Kh=function(e,t,r){if(t===exports.ErrorCode.SUCCESS&&this._ctx.includeUg&&0!==r.length){var n=[exports.ConversationType.PRIVATE,exports.ConversationType.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})}))}},Qh=function(e,t,r){if(t===Mh){e.stopPropagation();var n=[];r.forEach((function(e){if(0===e.subChangeType){var t=hl.decode(Au,new Uint8Array(e.eventData)),r=t.msgId,i=t.unreadCnt,o=t.readCnt,s=t.readList,a=t.totalCnt;n.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:r,users:s.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}})),readCount:o,unreadCount:i,totalCount:a})}})),this._ctx.emit("readReceiptResponseV5",n)}},Xh=function(e){e||(c(this,Yh,"f").setInitVersion(0),this._ctx.includeUg&&c(this,Hh,"m",eg).call(this)),c(this,Yh,"f").startInterval(Ig,!0)},Zh=function(e){return o(this,void 0,void 0,(function(){var t;return s(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(Ig,!0),[2]}}))}))},zh=function(e,t){t||this.storage.syncDataFromLocalStorage(this._ctx),c(this,Hh,"m",Zh).call(this,t),c(this,Hh,"m",Xh).call(this,t),this._ctx.ugEnabel&&c(this,Hh,"m",sg).call(this,t)},eg=function e(){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,_=this;return s(this,(function(s){switch(s.label){case 0:return this._ctx.isConnected?(t=this._ctx.logger,r=t.createTraceId(),n=c(this,$h,"f"),t.info(B.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:n}),r),[4,c(this,Hh,"m",bg).call(this,n,1,1e3)]):[2];case 1:return(i=s.sent()).isOk?(o=i.data,a=o.info,u=o.isFinished,l=o.pullTime,d(this,$h,l,"f"),t.info(B.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:n,isFinished:u,pullTime:l}),r),this.storage.addRelations(a,this._ctx.currentUserId),u?(this._ctx.emit("sgRelationsSynced",exports.ErrorCode.SUCCESS),[2]):[2,c(this,Hh,"m",e).call(this)]):(t.warn(B.L_PULL_SG_RELATIONS_R,i.errmsg(),r),setTimeout((function(){return c(_,Hh,"m",e).call(_)}),1e3),[2])}}))}))},tg=function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,Hh,"m",hg).call(this,e,t)];case 1:return(n=s.sent()).isOk?(i=n.data.list.map((function(t){return dc(t,u._ctx.currentUserId,!1,e.targetId)})),(o=this.storage.getModel(e))&&o.latestMessage&&(a=i.find((function(e){return e.messageUId===o.latestMessage.messageUId})))&&o.updateAttrs({latestMessage:a}),2===r?this._ctx.emit("messageModified",i):1===r&&this._ctx.emit("ugMsgExpansionUpdated",i),[2]):[2]}}))}))},rg=function(e,t,r){c(this,Hh,"m",tg).call(this,t,r,2)},ng=function(e,t,r){c(this,Hh,"m",tg).call(this,t,r,1)},ig=function(e,t){var r=this,i=t.map((function(e){var t=e.targetId,i=e.busChannel,o=e.msgUID,s=e.msgTime,a=e.operatorId,u=e.remindType,l={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:t,channelId:i||""},d=n(n({},l),{messageUId:o,sentTime:s}),_=n(n({},l),{sentTime:s,messageUId:o,senderUserId:a,content:d,messageDirection:1,messageType:me.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Ct(exports.ReceivedStatus.UNREAD)}),f=r.storage.getModel(l);return f&&c(r,Hh,"m",og).call(r,f,_,u),_}));this._ctx.emit("ugMsgRecalled",i)},og=function(e,t,r){var n={},i=t.content,o=i.messageUId,s=i.sentTime,a=e.latestMessage;a&&a.messageUId===o&&(n.latestMessage=hc(t,!0)),s&&e.lastReadTime<s&&e.unreadCount&&(n.unreadCount=e.unreadCount-1,r!==exports.MentionedType.ALL&&r!==exports.MentionedType.SINGAL||!e.unreadMentionedCount||(n.unreadMentionedCount=e.unreadMentionedCount-1),r===exports.MentionedType.SINGAL&&e.unreadMentionedCount&&(n.unreadMentionedMeCount=e.unreadMentionedMeCount-1));var u=e.updateAttrs(n,s);this.storage.updateConversationStorage([e]),u&&this._ctx.emit("conversation",[{conversation:e.toIReceivedConversation(),updatedItems:u}])},sg=function(e){return o(this,void 0,void 0,(function(){var e,t,r,n;return s(this,(function(i){switch(i.label){case 0:return[4,c(this,qh,"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),this._ctx.emit("ultraGroupEnable"),c(this,qh,"f").setInitVersion(n),c(this,qh,"f").startInterval(Ig,!0),c(this,Wh,"f").setInitVersion(n),c(this,Wh,"f").startInterval(Ig,!0),[2]):[2]}}))}))},ag=function(){this.settings.stopInterval(),c(this,qh,"f").reset(),c(this,Yh,"f").reset(),c(this,Wh,"f").reset()},ug=function(e,t){return 3===t.type?(e.stopPropagation(),void this.settings.push(t.time)):7===t.type?(e.stopPropagation(),void c(this,Wh,"f").push(t.time)):void(12===t.type&&(e.stopPropagation(),c(this,Jh,"f").push(t.time)))},lg=function(e,t,r){var n=t.syncMsg,i=Cn(t.topic);if(n&&i===Sn.updUgRTime){e.stopPropagation();var o=hl.decode(Us,t.pbData),s=o.channelId,a=o.busChannel,u=o.msgTime,l=this.storage.clearConversationUnreadCount({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:s,channelId:a||""},u);l&&this._ctx.emit("conversationStatusChanged",[l])}},cg=function(e,t,r,i,a){return o(this,void 0,void 0,(function(){var o,u,l,d,_,f=this;return s(this,(function(s){switch(s.label){case 0:return o=this._ctx.currentUserId,[4,c(this,Hh,"m",bg).call(this,e,r||0,t,i,a)];case 1:return(u=s.sent()).isOk?(l=u.data,d=l.info,l.isFinished,l.pullTime,_=d.map((function(e){var t=e.userId,r=e.type,i=e.busChannel,s=f.storage.getOrCreateModel({conversationType:r,targetId:t,channelId:i},!1);return n(n({},s.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?dc(e.msg,o,!1,t):null})})),[2,ar(_)]):[2,u.wipe()]}}))}))},dg=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._ctx.includeUg?[2,ar(e)]:(t=this._ctx.currentUserId,r=e.filter((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP})).map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),0===r.length?[2,ar(e)]:(n=hl.encode(Vs,{relation:r}),[4,this._ctx.query(Sn.qryRLBatch,this._ctx.currentUserId,n,void 0)]));case 1:return(i=o.sent()).isOk?(c(this,Hh,"m",Eg).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=dc(r.msg,t,!1,r.userId),n.includeRobot=!!r.isBot}})),[2,ar(e)]):[2,i.wipe()]}}))}))},_g=function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){return o=[],void 0!==r&&o.push({sessionStateType:ns.IsTop,value:r?"1":"0"}),void 0!==n&&o.push({sessionStateType:ns.IsSilent,value:n.toString()}),void 0!==i&&o.push({sessionStateType:ns.AutoTrans,value:i.toString()}),a=gh(t,e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:o}}))),[2,this._ctx.query(Sn.setSeAtt,this._ctx.currentUserId,a,ra)]}))}))},pg=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return c(this,fg,"f").add(e),r=t.messageType===me.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=hl.encode(Su,{businessType:1,businessInfo:hl.encode(Ou,r)}),[4,this._ctx.query(Sn.upConvertMsg,e,n,Cu)];case 1:return i=s.sent(),c(this,fg,"f").delete(e),o=i.code,i.isOk?(u=hl.decode(Nu,new Uint8Array(i.data.businessResult)),a={status:Ge.SUCCESS,text:u.result}):a={status:Ge.FAILED,text:""},this._ctx.emit("speechToTextResponse",{code:o,messageUId:e,sttInfo:a}),[2]}}))}))},hg=function(e,t){var r=e.targetId,n=e.conversationType,i=e.channelId,o=hl.encode(ma,{targetId:r,type:n,query:t.map((function(e){return{msgTime:0,msgUID:e,busChannel:i}}))});return this._ctx.query(Sn.qryMsg,this._ctx.currentUserId,o,ya)},gg=function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,d,_,f,p,h,g,E,b,T=this;return s(this,(function(s){switch(s.label){case 0:return i=Object.values(n),o=l([],u(new Set(l(l([],u(e),!1),u(i),!1))),!1),[4,c(this,Hh,"m",hg).call(this,t,o)];case 1:return a=s.sent(),d=a.isOk,_=a.code,f=a.data,d?(h=(p=f).list,g=p.notExistMsgId,E=new Map(h.map((function(e){var r=dc(e,T._ctx.currentUserId,!1,t.targetId);return[r.messageUId,r]}))),b=e.map((function(e){var t=E.get(e);if(!t)return g.includes(e)?{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR};if(t.messageType!==me.REFERENCE)return{messageUId:e,code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE};var r=n[e],i=E.get(r),o=t.content;return i?(o.referMsg=i.content,o.referMsgStatus=i.isModifyMessage?Mr.MODIFIED:Mr.DEFAULT,{messageUId:e,message:t,code:exports.ErrorCode.SUCCESS}):g.includes(r)?(o.referMsgStatus=Mr.DELETE,{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND,message:t}):(o.referMsgStatus=Mr.DEFAULT,{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR,message:t})})),r(b),[2]):(r(e.map((function(e){return{messageUId:e,code:_}}))),[2])}}))}))},Eg=function(e){var t=ah(e);return this._ctx.getNaviInfoFromCache().supportRecallRefactor&&t.info.forEach((function(e){var t=e.msg;if(t&&t.classname===me.RECALL){var r=JSON.parse(t.content),n=r.messageUId,i=r.sentTime,o=r.extra,s={recallTime:i,recallActionTime:t.dataTime,admin:!!r.isAdmin,delete:!!r.isDelete,isDelete:!!r.isDelete,operatorId:t.fromUserId,extra:o};t.classname=me.RECALL_NOTIFICATION_MESSAGE,t.content=JSON.stringify(s),t.msgId=n,t.dataTime=i||t.dataTime}})),t},bg=function(e,t,r,n,i,a){return void 0===a&&(a=Sn.qryRelationR),o(this,void 0,void 0,(function(){var o,u,l=this;return s(this,(function(s){switch(s.label){case 0:return o=this._ctx.currentUserId,u=function(e,t,r,n,i){return hl.encode(Rs,{startTime:e,order:t,count:r,compressioEnabled:cd.enable(),channelType:n,botType:i})}(e,t,r,n,i),[4,this._ctx.query(a,o,u)];case 1:return[2,s.sent().trans((function(e){return c(l,Hh,"m",Eg).call(l,e.pbData)}))]}}))}))};var yg,Ag,Sg,Og,Cg,Ng,Pg=((Bh={})[exports.ConversationType.PRIVATE]=Sn.cleanPMsg,Bh[exports.ConversationType.GROUP]=Sn.cleanGMsg,Bh[exports.ConversationType.CUSTOMER_SERVICE]=Sn.cleanCMsg,Bh[exports.ConversationType.SYSTEM]=Sn.cleanSMsg,Bh[exports.ConversationType.APP_PUBLIC_SERVICE]=Sn.cleanMCMsg,Bh[exports.ConversationType.PUBLIC_SERVICE]=Sn.cleanMPMsg,Bh[exports.ConversationType.ULTRA_GROUP]=Sn.cleanGMsg,Bh),Lg=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})};function Mg(e){var t=!(1&~(e.ugMsg||0)),r=!(1&~(e.sessionCfg||0));return t&&r}var wg,Ug,Dg,xg=[Sn.chatMsg,Sn.ugMsg,Sn.recallMsg,Sn.ppMsgS,Sn.pgMsgS,Sn.ppMsgP,Sn.pgMsgP,Sn.pcMsgP,Sn.prMsgS,Sn.pbMsgP,Sn.chatMsgS],Gg=function(e){function r(t,r,n,i){var o=e.call(this)||this;return yg.add(o),Object.defineProperty(o,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_navi",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"send",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"query",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"userStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Ag.set(o,void 0),Object.defineProperty(o,"_robots",{enumerable:!0,configurable:!0,writable:!0,value:{robots:[],isSynced:!1}}),o.userStorage=new Lg,d(o,Ag,new Uh(r,i),"f"),c(o,Ag,"f").pipe(o),o.on("onConnected",c(o,yg,"m",Sg),o,100),o.on("onDisconnected",c(o,yg,"m",Cg),o,100),o.on("onSuspend",c(o,yg,"m",Og),o,100),o.send=o._connMgr.send.bind(o._connMgr),o.query=o._connMgr.query.bind(o._connMgr),o.on("signal",c(o,yg,"m",Ng),o),o}return t(r,e),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._connMgr.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentToken",{get:function(){return this._connMgr.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectedTime",{get:function(){return this._connMgr.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 Mg(this.getNaviInfoFromCache())},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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,c;return s(this,(function(s){switch(s.label){case 0:return t=this._robots.robots.slice(),!e&&this._robots.isSynced?[2,ar(t)]:(r=hl.encode(nl,{ids:[]}),[4,this._connMgr.query(Sn.qAppBot,this.currentUserId,r,il)]);case 1:return(n=s.sent()).isOk?(i=Math.max.apply(Math,l([],u(t.map((function(e){return e.updateTime}))),!1)),o=[],a=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!a.some((function(t){return t.robotId===e.robotId}))})),this._robots.isSynced=!0,this._robots.robots=a,e&&this.emit("robotsSynced",n.code,a.slice(),o,c),[2,ar(a.slice())]):(e&&this.emit("robotsSynced",n.code,[],[],[]),[2,ur(n.code,n.msg,t)])}}))}))}}),r}(nr);Ag=new WeakMap,yg=new WeakSet,Sg=function(e,t){return o(this,void 0,void 0,(function(){var e,r,n,i;return s(this,(function(o){switch(o.label){case 0:return t||this.getAllRobots(!0),[4,c(this,Ag,"f").noticeOnline()];case 1:return(e=o.sent()).isOk?(t?c(this,Ag,"f").startInterval(18e4,!0):(r=e.data,n=r.syncTime,i=r.hasNext,c(this,Ag,"f").setInitVersion(n),c(this,Ag,"f").startInterval(18e4,!!i)),[2]):[2]}}))}))},Og=function(e,t){c(this,Ag,"f").stopInterval()},Cg=function(e){this._robots.isSynced=!1,this._robots.robots=[],c(this,Ag,"f").reset()},Ng=function(e,t,r){var n=t.topic,i=t.syncMsg,o=Cn(n);if(o||(this.logger.warn(B.L_RECV_RMTP_E,"unknown topic: ".concat(n)),e.stopPropagation()),this.logger.debug(B.L_RECV_RMTP_O,n),i&&xg.includes(o)){e.stopPropagation();var s=r||{},a=s.timestamp,u=void 0===a?this.serverTime:a,l=s.messageUId,d=void 0===l?"":l,_=cc(t,this.currentUserId,u,d),f=dc(_,this.currentUserId,!1,t.targetId);this.emit("syncMsg",f,o)}else{if(o===Sn.s_ntf){e.stopPropagation();var p=(E=hl.decode(as,t.pbData)).type,h=E.chrmId,g=E.time;return this.logger.info(B.L_RECV_S_NTF_O,"type: ".concat(p,", chrmId: ").concat(h,", time: ").concat(g)),void this.emit("sNtf",E)}if(o===Sn.s_cmd){e.stopPropagation();var E;p=(E=hl.decode(as,t.pbData)).type,h=E.chrmId,g=E.time;if(this.logger.info(B.L_RECV_S_CMD_O,"type: ".concat(p,", chrmId: ").concat(h,", time: ").concat(g)),11===p)return void c(this,Ag,"f").push(g);this.emit("sCmd",E)}if(o===Sn.s_msg){e.stopPropagation();_=hl.decode(_s,t.pbData),f=dc(_,this.currentUserId,!1);this.emit("sMsg",f)}}};var Vg,jg=function(e,t,r){var n=0;return e&&(n|=1),t&&(n|=2),r&&(n|=4),n},kg=function(e,t,r){return{chatroomId:e,key:t.key,value:t.value,timestamp:t.version,type:r?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE}},Fg=function(e){function r(t,r){var n=e.call(this,"WebChatroomKVStore")||this;return wg.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Ug.set(n,new Map),Object.defineProperty(n,"_emittedEntriesSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l,d,_,f,p=this;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),i=this._chatroomId,o={chatroomId:i,timestamp:e},t.info(B.L_PULL_CHATROOM_KV_T,JSON.stringify(o),r),[4,this._ctx.query(Sn.pullKV,i,bh(e),void 0)];case 1:return(a=s.sent()).isOk?(u=Th(a.data.pbData),l=u.bFullUpdate,d=u.entries,_=u.syncTime,t.info(B.L_PULL_CHATROOM_KV_R,JSON.stringify(n(n({},o),{newVersion:_})),r),f=new Map,l&&(Array.from(c(this,Ug,"f").values()).forEach((function(e){f.set(e.key,kg(i,e,!0))})),c(this,Ug,"f").clear()),Array.from(d.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?c(p,Ug,"f").delete(n.key):c(p,Ug,"f").set(n.key,n),f.set(n.key,kg(i,n,r))})),this._emittedEntriesSynced||(this._emittedEntriesSynced=!0,this._ctx.emit("chatroom",{entriesSynced:i})),f.size>0&&this._ctx.emit("chatroom",{updatedEntries:Array.from(f.values())}),[2,ar({version:_})]):(t.warn(B.L_PULL_CHATROOM_KV_R,JSON.stringify(n(n({},o),{code:a.code})),r),[2,a.wipe()])}}))}))}}),Object.defineProperty(r.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,c(this,wg,"m",Dg).call(this,e,t,!1)];case 1:return(r=n.sent()).isOk&&c(this,Ug,"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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,c(this,wg,"m",Dg).call(this,{key:e.key,value:"",isAutoDelete:!1,isSendNotification:e.isSendNotification,notificationExtra:e.notificationExtra},t,!0)];case 1:return(r=n.sent()).isOk&&c(this,Ug,"f").delete(e.key),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.serverTime,r=e.entries.map((function(r){var n,i=c(l,Ug,"f").get(r.key);return{key:r.key,value:r.value,uid:l._ctx.currentUserId,version:null!==(n=null==i?void 0:i.version)&&void 0!==n?n:t,status:jg(!!e.isAutoDelete,e.isForce||!1,!1)}})),n=hl.encode(Bs,{entry:r}),[4,this._ctx.query(Sn.setKVS,this._chatroomId,n,qs)];case 1:return(i=s.sent()).isOk||i.code===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?((o=i.data).errorKeys,a=o.keysVersion,u=new Map,null==a||a.forEach((function(e){u.set(e.key,e.version)})),e.entries.forEach((function(e){var t=e.key,r=u.get(t);r&&c(l,Ug,"f").set(t,{key:t,value:e.value,userId:l._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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return t=jg(!1,!1,!0),r=this._ctx.serverTime,n=hl.encode(Bs,{entry:e.keys.map((function(e){var n,i=c(u,Ug,"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(Sn.delKVS,this._chatroomId,n,qs)];case 1:return(i=s.sent()).isOk||i.code===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?(o=i.data.errorKeys,a=new Set,null==o||o.forEach((function(e){return a.add(e.key)})),e.keys.forEach((function(e){a.has(e)||c(u,Ug,"f").delete(e)})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,Ug,"f").has(e)?c(this,Ug,"f").get(e).value:null}}),Object.defineProperty(r.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Array.from(c(this,Ug,"f").entries()).map((function(e){var t=u(e,2);return[t[0],t[1].value]}));return Object.fromEntries(e)}}),r}(ir);Ug=new WeakMap,wg=new WeakSet,Dg=function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._ctx.serverTime,o=c(this,Ug,"f").get(e.key),a=jg(!!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:a}},e.isSendNotification&&(u.type=exports.ConversationType.CHATROOM,u.bNotify=!0,u.notification={sessionId:_c(me.CHRM_KV_NOTIFY,!1,!1,!1),classname:me.CHRM_KV_NOTIFY,content:JSON.stringify({key:e.key,value:e.value,extra:e.notificationExtra,type:r?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE})}),l=hl.encode(Fs,u),[4,this._ctx.query(r?Sn.delKV:Sn.setKV,this._chatroomId,l)];case 1:return[2,s.sent().wipe()]}}))}))};var Bg,Hg,qg,Yg,Wg=function(e){function r(t,r,n,i){var o=e.call(this,"WebChatroomMessageReceiver")||this;return Object.defineProperty(o,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_handler",{enumerable:!0,configurable:!0,writable:!0,value:i}),Vg.set(o,0),d(o,Vg,n,"f"),o}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,d,_,f=this;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),n={chatroomId:this._chatroomId,version:e},t.info(B.L_PULL_CHATROOM_MSG_T,JSON.stringify(n),r),i=function(e,t){return hl.encode(vs,{syncTime:e,count:t,compressioEnabled:cd.enable()})}(e,c(this,Vg,"f")),[4,this._ctx.query(Sn.chrmPull,this._chatroomId,i,void 0)];case 1:return o=s.sent(),t.summary(B.L_PULL_CHATROOM_MSG_R,o,r,n),o.isOk?(a=this._ctx.currentUserId,u=lh(o.data.pbData),l=u.list,d=u.syncTime,l.length>0&&(_=l.map((function(e){return dc(e,a,!1,f._chatroomId)})),this._handler(_,this._chatroomId)),[2,ar({version:d})]):[2,o.wipe()]}}))}))}}),r}(ir);Vg=new WeakMap;var Jg,Kg,Qg,Xg,Zg,zg,$g,eE,tE,rE,nE,iE,oE,sE,aE,uE=function(e){function r(t,r,n,i,o){var s=e.call(this)||this;return Bg.add(s),Object.defineProperty(s,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(s,"roomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(s,"initCount",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(s,"extra",{enumerable:!0,configurable:!0,writable:!0,value:o}),Hg.set(s,void 0),qg.set(s,void 0),d(s,Hg,new Wg(s._ctx,s.roomId,n,i),"f"),d(s,qg,new Fg(s._ctx,s.roomId),"f"),s}return t(r,e),Object.defineProperty(r.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;c(this,Hg,"f").setInitVersion(0),c(this,Hg,"f").startInterval(e,!0),c(this,Bg,"a",Yg)&&(c(this,qg,"f").setInitVersion(0),c(this,qg,"f").startInterval(e,!0))}}),Object.defineProperty(r.prototype,"restartInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;this.stopInterval(),c(this,qg,"f").startInterval(e,!0),c(this,Hg,"f").startInterval(e,!0)}}),Object.defineProperty(r.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,Hg,"f").stopInterval(),c(this,qg,"f").stopInterval()}}),Object.defineProperty(r.prototype,"handleMessageNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,Hg,"f").push(e)}}),Object.defineProperty(r.prototype,"handleKVNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,qg,"f").push(e)}}),Object.defineProperty(r.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,c(this,qg,"f").setEntry(e,t)]}))}))}}),Object.defineProperty(r.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,c(this,qg,"f").setEntries(e)]}))}))}}),Object.defineProperty(r.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,c(this,qg,"f").removeEntry(e,t)]}))}))}}),Object.defineProperty(r.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,c(this,qg,"f").removeEntries(e)]}))}))}}),Object.defineProperty(r.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,qg,"f").getEntry(e)}}),Object.defineProperty(r.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,qg,"f").getAllEntries()}}),r}(nr);Hg=new WeakMap,qg=new WeakMap,Bg=new WeakSet,Yg=function(){var e;return!!(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.kvStorage)};var lE,cE,dE,_E,fE=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))}},pE=function(e){function r(t){var r=e.call(this)||this;return Jg.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Kg.set(r,new Map),Object.defineProperty(r,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:vg}),r.logger=t.logger,r._ctx.on("onConnected",c(r,Jg,"m",Zg),r),r._ctx.on("onDisconnected",c(r,Jg,"m",Qg),r),r._ctx.on("onSuspend",c(r,Jg,"m",Xg),r),r._ctx.on("sNtf",c(r,Jg,"m",eE),r),r._ctx.on("sCmd",c(r,Jg,"m",tE),r),r._ctx.on("syncMsg",c(r,Jg,"m",$g),r),r._ctx.on("sMsg",c(r,Jg,"m",zg),r),r}return t(r,e),Object.defineProperty(r.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,Jg,"m",iE).call(this,e,r,n)];case 1:return(i=s.sent()).isOk?((o=c(this,Kg,"f").get(e))||(o=new uE(this._ctx,e,t,c(this,Jg,"m",rE).bind(this),n),c(this,Kg,"f").set(e,o),o.startInterval()),[2,i.trans(fE)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return c(this,Kg,"f").get(e)?(c(this,Jg,"m",oE).call(this,e),r=hl.encode(bs,{nothing:1,extra:t}),[4,this._ctx.query(Sn.exitChrm,e,r)]):[2,ar()];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=hl.encode(Cs,{count:t,order:r}),[4,this._ctx.query(Sn.queryChrmI,e,n,Ns)];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 o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,c(this,Jg,"m",sE).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 o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,c(this,Jg,"m",sE).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 o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,c(this,Jg,"m",sE).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 o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,c(this,Jg,"m",sE).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 o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return(r=c(this,Kg,"f").get(e))?null===(n=r.getEntry(t))?[2,ur(exports.ErrorCode.CHATROOM_KEY_NOT_EXIST)]:[2,ar(n)]:[4,c(this,Jg,"m",aE).call(this,e)];case 1:return[2,i.sent().tryTrans((function(e){var r=e[t];return void 0===r?ur(exports.ErrorCode.CHATROOM_KEY_NOT_EXIST):ar(r)}))]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=c(this,Kg,"f").get(e))?[2,ar(t.getAllEntries())]:[2,c(this,Jg,"m",aE).call(this,e)]}))}))}}),Object.defineProperty(r.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return i=ph({targetId:e,time:t,count:r,order:n}),o=this._ctx.currentUserId,[4,this._ctx.query(Sn.qryCHMsg,e,i)];case 1:return(a=s.sent()).isOk?(u=hh(a.data.pbData),[2,ar({hasMore:!!u.hasMsg,list:u.list.map((function(t){return dc(t,o,!1,e)}))})]):[2,a.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=hl.encode(Oa,{rtcRoomId:e.rtcRoomId}),[4,this._ctx.query(Sn.setRtcRoomId,e.chatRoomId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),r}(nr);Kg=new WeakMap,Jg=new WeakSet,Qg=function(){var e,t;try{for(var r=a(c(this,Kg,"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}}c(this,Kg,"f").clear()},Xg=function(){var e,t;try{for(var r=a(c(this,Kg,"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}}},Zg=function(e,t){var r,n;if(t)try{for(var i=a(c(this,Kg,"f").values()),o=i.next();!o.done;o=i.next()){var s=o.value;c(this,Jg,"m",nE).call(this,s)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},zg=function(e,t){var r=t.conversationType,n=t.targetId;(t.messageType,r===exports.ConversationType.CHATROOM)&&(e.stopPropagation(),c(this,Kg,"f").get(n)&&c(this,Jg,"m",rE).call(this,[t],n))},$g=function(e,t){t.conversationType===exports.ConversationType.CHATROOM&&(e.stopPropagation(),this.emit("message",[t],t.targetId))},eE=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r){e.stopPropagation();var o=c(this,Kg,"f").get(n);o&&o.handleMessageNotify(i)}},tE=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r||4===r){e.stopPropagation();var o=c(this,Kg,"f").get(n);if(o)return 4===r?(c(this,Kg,"f").delete(n),void this._ctx.emit("chatroom",{chatroomDestroyed:n})):void o.handleKVNotify(i)}},rE=function(e,t){var r=this,n=e.filter((function(e){var n,i=e.messageType;if(i===me.CHATROOM_MERGE_CHANGE){var o=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._ctx.emit("chatroom",{userChange:o}),!1}if(i===me.CHATROOM_MERGE_BAN){var s=function(e){var t=e.content;return{chatroomId:t.chatroomId,banType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return r._ctx.emit("chatroom",{chatroomNotifyBan:s}),!1}if(i===me.CHATROOM_SYNC_MSG){var a=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._ctx.emit("chatroom",{chatroomNotifyMultiLoginSync:a}),!1}if(i===me.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===exports.ChrmMemOperateType.Blocked&&(null===(n=null==u?void 0:u.userIdList)||void 0===n?void 0:n.includes(r._ctx.currentUserId))&&c(r,Jg,"m",oE).call(r,t),r._ctx.emit("chatroom",{chatroomNotifyBlock:u}),!1}return!0}));this.emit("message",n,t)},nE=function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l,d;return s(this,(function(s){switch(s.label){case 0:return t=e.roomId,r=e.extra,i=this.logger.createTraceId(),this.logger.info(B.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:t}),i),[4,c(this,Jg,"m",iE).call(this,t,!1,r)];case 1:return o=s.sent(),this.logger.summary(B.L_REJOIN_CHATROOM_R,o,i,{chatroomId:t}),a=o.code,u=o.isOk,l=o.data,u?(e.restartInterval(),d=fE(l),this._ctx.emit("chatroom",{rejoinedRoom:n(n({chatroomId:t},d),{count:e.initCount})}),[2]):(a!==exports.ErrorCode.RC_CHATROOM_USER_KICKED&&a!==exports.ErrorCode.RC_CHATROOM_NOT_EXIST||c(this,Kg,"f").delete(t),this._ctx.emit("chatroom",{rejoinedRoom:{chatroomId:t,errorCode:a}}),[2])}}))}))},iE=function(e,t,r){var n=hl.encode(bs,{extra:r,nothing:1}),i=t?Sn.joinChrm:Sn.joinChrmR;return this._ctx.query(i,e,n,Ts)},oE=function(e){var t=c(this,Kg,"f").get(e);t&&(t.stopInterval(),c(this,Kg,"f").delete(e))},sE=function(e){var t=c(this,Kg,"f").get(e);return t?ar(t):ur(exports.ErrorCode.NOT_IN_CHATROOM)},aE=function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return[4,this._ctx.query(Sn.pullKV,e,bh(0),void 0)];case 1:return(t=n.sent()).isOk?(r=Th(t.data.pbData).entries,[2,ar(r.reduce((function(e,t){return e[t.key]=t.value,e}),{}))]):[2,t.wipe()]}}))}))};var hE=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=Xo.localStorage,r=e.appkey,n=e.currentUserId,i=et(r,n),o=t.getItem(i)||"{}",s=JSON.parse(o);return{value:{value:{version:s.version||0,tags:s.tags||{},transLan:s.transLan||"zh",autoTrans:s.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,o=r.transLan;n[e.tagId]={tagName:e.tagName,createdTime:t},this.set("value",{version:t,tags:n,autoTrans:i,transLan:o})}}),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,o=r.transLan;delete n[e],this.set("value",{version:t,tags:n,autoTrans:i,transLan:o})}}),r}(Od),gE=function(e){function r(t){var r=e.call(this,"UserSettings")||this;return lE.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}),cE.set(r,!1),r.storage=new hE,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),d(this,cE,!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(Cn(t.topic)===Sn.s_us){var r=hl.decode(pa,t.pbData).version;this.push(r),e.stopPropagation()}}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,d,_,f,p,h,g,E,b,T,v,R;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=this._ctx.getNaviInfoFromCache(),o=n.createTraceId(),n.info(B.L_SYNC_USER_SETTINGS_T,"version: ".concat(e),o),a=hl.encode(Ks,{version:e,ipType:i.ipType||0}),[4,this._ctx.query(Sn.pullUS,r,a,Qs)];case 1:return u=s.sent(),n.summary(B.L_SYNC_USER_SETTINGS_R,u,o),u.isOk?(l=u.data,d=l.version,_=l.items,f=!1,p=!1,h=!1,g="",E=this.storage.get("value"),b=E.transLan,T=E.autoTrans,v=E.tags,R={version:d,transLan:b,autoTrans:T,tags:v},null==_||_.forEach((function(e){var t=e.key,r=e.value;switch(t){case"Tag":R.tags={},e.tags.forEach((function(e){R.tags[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),f=!0;break;case"transLan":h=!0,R.transLan=Vi.readUTF(new Uint8Array(r));break;case"autoTrans":p=!0,R.autoTrans="1"===Vi.readUTF(new Uint8Array(r));break;case"VoipInfo":g=Vi.readUTF(new Uint8Array(r))}})),this.storage.set("value",R),f&&this.emit("tagsChanged"),h&&this.emit("userSettingsChanged",{key:wr.TranslationLanguage,value:R.transLan}),p&&this.emit("userSettingsChanged",{key:wr.AutoTranslateEnable,value:R.autoTrans}),g&&this.emit("voipInfoChanged",g),c(this,lE,"m",dE).call(this,u.code),[2,ar({version:d})]):(c(this,lE,"m",dE).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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=hl.encode(_a,{version:t,tags:[{tagId:e.tagId,name:e.tagName}],ignoreVersion:!0}),[4,this._ctx.query(Sn.addSeTag,r,n,Js)];case 1:return(i=s.sent()).isOk&&(o=i.data,a=o.version,u=o.updateVersion,this.storage.addTag(e,u?a:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=hl.encode(fa,{version:t,tags:[{tagId:e}],ignoreVersion:!0}),[4,this._ctx.query(Sn.delSeTag,r,n,Js)];case 1:return(i=s.sent()).isOk&&(o=i.data,a=o.version,u=o.updateVersion,this.storage.deleteTag(e,u?a:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,c(this,lE,"m",_E).call(this,Sn.transLan,e)]}))}))}}),Object.defineProperty(r.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ar(this.storage.get("value").transLan||"zh")]}))}))}}),Object.defineProperty(r.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,c(this,lE,"m",_E).call(this,Sn.autoTrans,e?"1":"0")]}))}))}}),Object.defineProperty(r.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ar(this.storage.get("value").autoTrans)]}))}))}}),r}(ir);cE=new WeakMap,lE=new WeakSet,dE=function(e){c(this,cE,"f")&&(d(this,cE,!1,"f"),this.emit("userSettingsSynced",e))},_E=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,_,f,p,h;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.version,n=this._ctx.currentUserId,i=hl.encode(Ws,{version:r,value:t,ignoreVersion:!0}),[4,this._ctx.query(e,n,i,Js)];case 1:if((o=s.sent()).isOk){switch(a=o.data,u=a.version,l=a.updateVersion,c=this.storage.get("value"),d=c.transLan,_=c.autoTrans,f=c.tags,p=c.version,h={version:l?u:p,transLan:d,autoTrans:_,tags:f},e){case Sn.transLan:h.transLan=t;break;case Sn.autoTrans:h.autoTrans="1"===t}this.storage.set("value",h)}return[2,o.wipe()]}}))}))};var EE,bE=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}},TE=function(e){var t,r,n=e.targetId,i=e.settingProfile,o=e.extProfile,s=e.baseInfo,a=e.userInfo,u=kt(i||[]),l=kt(o||[]);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==s?void 0:s.creatorId)||"",ownerId:(null==s?void 0:s.ownerId)||"",createTime:(null==s?void 0:s.createTime)||0,membersCount:(null==s?void 0:s.memberCount)||0,remark:null!==(t=null==a?void 0:a.remarkName)&&void 0!==t?t:"",joinedTime:(null==a?void 0:a.joinTime)||0,role:null!==(r=null==a?void 0:a.role)&&void 0!==r?r:exports.GroupMemberRole.UNDEF}},vE=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:vg}),Object.defineProperty(this,"searchGroupMembers",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(this,"searchJoinedGroups",{enumerable:!0,configurable:!0,writable:!0,value:vg})}return Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=hl.encode(Xa,{permission:e}),[4,this.ctx.query(Sn.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 o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=hl.encode(Qa,{nothing:1}),[4,this.ctx.query(Sn.qProfilePermiss,this.ctx.currentUserId,e,Xa)];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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=hl.encode(Za,{uniqueId:e}),[4,this.ctx.query(Sn.searchUserProfile,this.ctx.currentUserId,t,Ya)];case 1:return(r=s.sent()).isOk?(n=r.data,i=n.userId,o=n.userProfile,a=n.userExtProfile,u=Pt(i,o,a),[2,ar(u)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return i=Xp(e,t,r,n),[4,this.ctx.query(Sn.channelCreate,e,i,void 0)];case 1:return(o=s.sent()).isOk||!o.data?[2,o.wipe()]:(a=hl.decode($a,o.data.pbData),u={errorKeys:a.censorFailedFields,processCode:a.processCode||0},[2,ur(o.code,o.msg,u)])}}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=Xp(e,t,r),[4,this.ctx.query(Sn.upChannelInfo,e,n,void 0)];case 1:return(i=s.sent()).isOk||!i.data?[2,i.wipe()]:(o=hl.decode($a,i.data.pbData),[2,ur(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return t=hl.encode(eu,{type:exports.ConversationType.GROUP,list:e.map((function(e){return{targetId:e}}))}),[4,this.ctx.query(Sn.qChannelInfo,e[0],t,nu)];case 1:return(r=i.sent()).isOk?(n=fh(r.data).list,[2,ar(n.map(TE))]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=mh({targetId:e,users:t,settingInfo:{isQuit:!0,isDelBan:r.removeMuteStatus,isDelAttention:r.removeFollow,isDelWhite:r.removeWhiteList}}),[4,this.ctx.query(Sn.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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=mh({targetId:e,settingInfo:{isQuit:!0,isDelBan:t.removeMuteStatus,isDelAttention:t.removeFollow,isDelWhite:t.removeWhiteList}}),[4,this.ctx.query(Sn.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 o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=mh({targetId:e}),[4,this.ctx.query(Sn.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 o(this,void 0,void 0,(function(){var i;return s(this,(function(o){switch(o.label){case 0:return i=mh({targetId:e,settingInfo:{isQuit:r,isDelBan:n.removeMuteStatus,isDelAttention:n.removeFollow,isDelWhite:n.removeWhiteList},users:[t]}),[4,this.ctx.query(Sn.channelTransfer,e,i)];case 1:return[2,o.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=hl.encode(tu,{targetId:t,type:exports.ConversationType.GROUP,users:r,operateType:e}),[4,this.ctx.query(Sn.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 o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=hl.encode(tu,{targetId:t,type:exports.ConversationType.GROUP,users:r,operateType:e}),[4,this.ctx.query(Sn.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 o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return t=Rh({targetId:e}),[4,this.ctx.query(Sn.qChannelFollow,e,t,nu)];case 1:return(r=o.sent()).isOk?(n=fh(r.data).list,i=n.map((function(e){return{userId:e.userId,time:e.opTime}})),[2,ar(i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=Ih({targetId:e,operateType:t?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE,channelNickName:t}),[4,this.ctx.query(Sn.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 o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=hl.encode(cu,{targetId:e,type:t,info:r}),[4,this.ctx.query(Sn.friendAdd,this.ctx.currentUserId,n,$a)];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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=hl.encode(du,{targetId:e,type:t}),[4,this.ctx.query(Sn.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 o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=hl.encode(cu,{targetId:e,type:1}),[4,this.ctx.query(Sn.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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=hl.encode(cu,{targetId:e,type:2,info:t}),[4,this.ctx.query(Sn.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 o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=hl.encode(fu,{targetId:e,remarkName:t,extProfile:Object.entries(r).map((function(e){var t=u(e,2);return{key:t[0],value:t[1]}}))}),[4,this.ctx.query(Sn.friendSetPf,this.ctx.currentUserId,n,void 0)];case 1:return(i=s.sent()).isOk||!i.data?[2,i.wipe()]:(o=hl.decode(pu,i.data.pbData),[2,ur(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=hl.encode(du,{targetId:e,type:t}),[4,this.ctx.query(Sn.friendCheck,this.ctx.currentUserId,r,_u)];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 o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=hl.encode(hu,{queryType:11,friendType:e,page:{size:t.count,order:t.order?0:1,pageToken:t.pageToken}}),[4,this.ctx.query(Sn.friendsQuery,this.ctx.currentUserId,r,nu)];case 1:return(n=s.sent()).isOk?(i=n.data.page,o=i.pageToken,a=i.hasNext,u=fh(n.data).list,l={pageToken:a&&o?o:"",data:u.map(bE)},[2,ar(l)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=hl.encode(hu,{queryType:12,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query(Sn.friendsQuery,this.ctx.currentUserId,t,nu)];case 1:return(r=s.sent()).isOk?(n=r.data.page,i=n.pageToken,o=n.hasNext,a=fh(r.data).list,u={pageToken:o&&i?i:"",data:a.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,ar(u)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=hl.encode(gu,{targetId:e}),[4,this.ctx.query(Sn.friendsInfoQry,this.ctx.currentUserId,t,bu)];case 1:return[2,r.sent().trans((function(e){return e.list.map(bE)}))]}}))}))}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=hl.encode(Eu,{level:e}),[4,this.ctx.query(Sn.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 o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return e=this.ctx.currentUserId,t=hl.encode(cu,{targetId:e}),[4,this.ctx.query(Sn.friendAuthGet,e,t,Eu)];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 o(this,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return r=Rh({targetId:e,ids:t}),[4,this.ctx.query(Sn.qChannelSpeMem,e,r,nu)];case 1:return(n=s.sent()).isOk?(i=fh(n.data).list,o=i.map(Vt),[2,ar(o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return i=Ih({targetId:e,userId:t,channelNickName:r,additional:n}),[4,this.ctx.query(Sn.upChannelMem,e,i,void 0)];case 1:return(o=s.sent()).isOk||!o.data?[2,o.wipe()]:(a=hl.decode($a,o.data.pbData),[2,ur(o.code,o.msg,{errorKeys:a.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return n=Rh({targetId:e,roleType:t,botType:r.filterRobotType,page:{size:r.count,order:r.order?0:1,pageToken:r.pageToken}}),[4,this.ctx.query(Sn.qChannelMem,e,n,nu)];case 1:return(i=s.sent()).isOk?(o=i.data.page,a=o.pageToken,u=o.hasNext,l=fh(i.data).list,c={pageToken:u&&a?a:"",data:l.map(Vt)},[2,ar(c)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=hl.encode(lu,{targetId:e,type:exports.ConversationType.GROUP}),[4,this.ctx.query(Sn.channelMemJoin,e,t,$a)];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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=hl.encode(lu,{targetId:e,type:exports.ConversationType.GROUP,userIds:t}),[4,this.ctx.query(Sn.channelMemInvite,e,r,$a)];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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.groupId,r=e.inviterId,n=e.optType,i=e.optResult,o=e.joinUserId,a=e.reason,u=hl.encode(uu,{targetId:t,type:exports.ConversationType.GROUP,optType:n,optResult:i,inviterId:r,joinUserId:o,detail:a}),[4,this.ctx.query(Sn.channelApplyResp,t,u,$a)];case 1:return[2,s.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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=Rh({page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query(Sn.qChannelApplyList,this.ctx.currentUserId,t,nu)];case 1:return(r=s.sent()).isOk?(n=fh(r.data),i=n.pageToken,o=n.hasNext,a=n.list,u=a.map(jt),[2,ar({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 o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=Rh({roleType:e,page:{size:t.count,pageToken:t.pageToken,order:t.order?1:0}}),[4,this.ctx.query(Sn.qChannelMemJoin,this.ctx.currentUserId,r,nu)];case 1:return(n=s.sent()).isOk?(i=n.data.page,o=i.pageToken,a=i.hasNext,u=fh(n.data).list,l=u.map(TE),[2,ar({data:l,pageToken:a&&o?o:""})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return t=hl.encode(ru,{type:exports.ConversationType.GROUP,ids:e}),[4,this.ctx.query(Sn.qChannelMemSpeJoin,this.ctx.currentUserId,t,nu)];case 1:return(r=o.sent()).isOk?(n=fh(r.data).list,i=n.map(TE),[2,ar(i)]):[2,r.wipe()]}}))}))}}),e}(),RE=((EE={})[exports.ConversationType.PRIVATE]=Sn.qryPMsg,EE[exports.ConversationType.GROUP]=Sn.qryGMsg,EE[exports.ConversationType.CHATROOM]=Sn.qryCHMsg,EE[exports.ConversationType.CUSTOMER_SERVICE]=Sn.qryCMsg,EE[exports.ConversationType.SYSTEM]=Sn.qrySMsg,EE[exports.ConversationType.APP_PUBLIC_SERVICE]=Sn.qryMCMsg,EE[exports.ConversationType.PUBLIC_SERVICE]=Sn.qryMPMsg,EE[exports.ConversationType.ULTRA_GROUP]=Sn.qryUgMsg,EE),IE=function(e,t,r,n,i,o){var s=cn(t.messageType),a=s.isCounted,u=s.isPersited,l=s.isStatusMessage;return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:i,messageDirection:exports.MessageDirection.SEND,isCounted:a,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:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Ct(exports.ReceivedStatus.UNREAD),pushConfig:t.pushConfig,isInterrupt:t.isInterrupt,messageId:o||0,sentStatus:exports.SentStatus.SENT,directedUserIds:t.directionalUserIdList,disableUpdateLastMessage:t.disableUpdateLastMessage,needReceipt:t.needReceipt}},mE=[L.GROUP_OPERATION,L.GROUP_PROFILE_CHANGE,L.GROUP_APPLICATION_INVITATION,L.GROUP_FOLLOW_USER_CHANGE],yE=[b.FRIEND_APPLICATION];function AE(){return function(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._isConnected?[2,n.apply(this,e)]:[2,Promise.resolve(ur(exports.ErrorCode.RC_NET_UNAVAILABLE))]}))}))},r}}var SE,OE=function(e){function r(t,r){var n=this,i=r.loggerProxy?r.loggerProxy:ed();n=e.call(this,t,r,new kc(r.appkey,"IMLib","IM",i))||this,d.add(n),Object.defineProperty(n,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_sendMessageStore",{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,"_readReceiptManager",{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,"_reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(n,"_pullOfflineFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(n,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"reporterStatistic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(n,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(n,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),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,"_loggerProxy",{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,i=t.messageType,o=e.conversationType;if(i===me.SYNC_READ_STATUS&&function(e){return[exports.ConversationType.GROUP,exports.ConversationType.DISCUSSION,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE].includes(e)}(o)&&(t.directionalUserIdList=[n.currentUserId]),i===me.READ_RECEIPT_RESPONSE){if(!t.content.receiptMessageDic||0===Object.keys(t.content.receiptMessageDic).length){var s=null===(r=n._readReceiptManager)||void 0===r?void 0:r.getReceiptMessageDic(e);t.content.receiptMessageDic=s||{}}for(var a in t.directionalUserIdList=[],t.content.receiptMessageDic)t.directionalUserIdList.push(a)}return t}}),Object.defineProperty(n,"_ultraMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(n,"setProxy",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"getProxy",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"testProxy",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"setUserStatusListener",{enumerable:!0,configurable:!0,writable:!0,value:Tg}),Object.defineProperty(n,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Tg}),Object.defineProperty(n,"subscribeUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Tg}),Object.defineProperty(n,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"getLocalMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"deleteLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"deleteLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"batchClearLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"clearLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:Tg}),Object.defineProperty(n,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:vg}),n._loggerProxy=i;var o=r.appkey,s=r.logOutputLevel,a=r.logExpireTime,u=r.navigators,l=r.areaCode,b=r.logServerUrl,T=r.miniCMPProxy,m=r.environment,y=r.useNaviV2,A=void 0!==y&&y,S=r.enableReadReceiptStorage;n._environment=m||"default",n._enableReadReceiptStorage=S,n.logger.setOutputLevel(s),Vr.init({areaCode:l,navigators:u,logServerUrl:b,miniCMPProxy:T}),r.loggerProxy||Kc(o,n.logger,a),n.reporter=new vd(o,n.logger,n._loggerProxy),n.navi=new Sc(o,n.logger,new Mc(o,n.logger),n._environment,A),n.reporterStatistic=new Rd(o,n.logger,n._loggerProxy),n._sendMessageStore=new Oc(o);var O=n._connMgr=new Vc(o,n.navi,n.logger),C=n._ctx=new Gg(n._appkey,O,n.navi,n.logger);return n._connMgr.pipe(C),"browser"===Xo.tag&&n._initCloudController(),n._userSettings=new gE(C),n._chat=new mg(C,n._userSettings),n._chatroom=new pE(C),n._dataHosting=new vE(C),n._chatroom.on("message",n._handleChatroomMessages,n),C.on("conversationStatusChanged",n._conversationStatusChanged,n),C.on("sCmd",n._handleSCmdNotify,n),C.on("signal",n._handleSignal,n),C.on("onConnected",n.onConnected,n),C.on("onDisconnected",n.onDisconnected,n),C.on("onConnecting",n.onConnecting,n),C.on("onSuspend",n.onSuspend,n),C.on("ultraGroupEnable",n._handleUltraGroupEnable,n),C.on("messagesFromUG",n._handleMessagesFromUltraGroup,n),C.on("messagesFromSG",n._handleMessagesFromSignalGroup,n),C.on("smsgFromSignalGroup",n._handleSmsgFromSignalGroup,n),C.on("syncMsg",n._handleSyncMsg,n),C.on("sgRelationsSynced",n._handleSGRelationsSynced,n),C.on("serverEvent",c(n,d,"m",I),n),C.on("readReceiptResponseV5",c(n,d,"m",f),n),C.on("speechToTextResponse",c(n,d,"m",p),n),C.on("ugUserGroupChanged",n._handleUserGroupStatus,n),C.on("ugChannelChanged",n._handleUltraChannelChange,n),C.on("conversationStatusSynced",(function(e,t){return n._watcher.conversationStatusSynced(t)}),n),C.on("messageModified",c(n,d,"m",h),n),C.on("messageModifiedSyncCompleted",c(n,d,"m",g),n),C.on("ugMsgExpansionUpdated",c(n,d,"m",E),n),C.on("ugMsgRecalled",c(n,d,"m",v),n),C.on("conversation",c(n,d,"m",R),n),C.on("chatroom",n._handlerChatroomEvent,n),C.on("robotsSynced",c(n,d,"m",_),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}var d,_,f,p,h,g,E,v,R,I,m,y;return t(r,e),Object.defineProperty(r.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"userSettings",{get:function(){return this._userSettings},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dataHosting",{get:function(){return this._dataHosting},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"usingCppEngine",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;e=u(Vr.getCloudControllerUrl(),1),this.cloudControllerUri=e[0],this.cloudController=new jc(this._appkey,this.logger,this.reporter),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Xr.init)}}),Object.defineProperty(r.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.navi.getNaviInfoFromCache(this._connMgr.getToken());this._pullOfflineFinished=!1,this._readReceiptManager||(this._readReceiptManager=new Lc(this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(r),this._sendMessageStore.init(this.currentUserId),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(),this.reporter.checkStart(r),this.reporterStatistic.checkStart(r)}}),Object.defineProperty(r.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resetMemoryState(),this._watcher.onDisconnected(t)}}),Object.defineProperty(r.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.onSuspend(t)}}),Object.defineProperty(r.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(r.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.conversation(t);var r=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));r&&this._watcher.conversationTag()}}),Object.defineProperty(r.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new Pc(this._connMgr,{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._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(r.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new kc(this._appkey,e,t,this._loggerProxy)}}),Object.defineProperty(r.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(r.prototype,"naviInfo",{get:function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectionStatus",{get:function(){return this._connMgr.getConnectionStatus()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return this._openCallPlus=r,[2,this._connMgr.connect(e,t,r,n)]}))}))}}),Object.defineProperty(r.prototype,"_handleUltraGroupEnable",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.ultraGroupEnable()}}),Object.defineProperty(r.prototype,"_handleSGRelationsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.sgRelationsSynced(t)}}),Object.defineProperty(r.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=new Map,o=[];t.forEach((function(e){var t,r,s,a=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,d=e.isMentioned,_=e.isCounted,f=e.senderUserId,p=e.messageType,h=e.sentTime,g=e.channelType,E=e.isPersited;if(n._ultraMsgMap[l])delete n._ultraMsgMap[l];else{var b={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:a,channelId:c||""},T=n._chat.storage.getOrCreateModel(b,!0),v=i.get(T)||{params:{channelType:g},time:h};i.set(T,v),v.time=h;var R=v.params;if(E&&(R.hidden=!1,R.latestMessage=e,R.operationTime=h),_&&f!==n.currentUserId&&p!==me.RECALL_NOTIFICATION_MESSAGE){R.unreadCount=(R.unreadCount||T.unreadCount)+1;var I=(null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===exports.MentionedType.ALL;d&&(I||(null===(s=null===(r=null==u?void 0:u.mentionedInfo)||void 0===r?void 0:r.userIdList)||void 0===s?void 0:s.includes(n.currentUserId)))&&(R.unreadMentionedCount=(R.unreadMentionedCount||T.unreadMentionedCount)+1,I||(R.unreadMentionedMeCount=(R.unreadMentionedMeCount||T.unreadMentionedMeCount)+1),R.hasMentioned=!0,R.mentionedInfo=null==u?void 0:u.mentionedInfo),T.firstUnreadMessage||R.firstUnreadMessageUId||(R.firstUnreadMessageType=p,R.firstUnreadMessageUId=l,R.firstUnreadTime=h)}o.push(e)}}));var s=[],a=[];Array.from(i.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1],i=n.params,o=n.time;s.push(r);var l=r.updateAttrs(i,o);l&&a.push({conversation:r.toIReceivedConversation(),updatedItems:l})})),this._chat.storage.updateConversationStorage(s),a.length>0&&this._watcher.conversation(a),this._batchMessage(o)}}),Object.defineProperty(r.prototype,"_handleChatroomMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=this._connMgr.getConnectedTime(),o=[];if(t.forEach((function(e){e.sentTime>=i&&n._writeMessagesLog(exports.ConversationType.CHATROOM,e.messageUId)&&o.push(e.messageUId)})),o.length>0){var s=Date.now();this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:s,server_deltatime:s-this._connMgr.getCrtServerTime(),msg_ids:o.join(",")}))}this._watcher.batchMessage(t)}}),Object.defineProperty(r.prototype,"_handlerChatroomEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.chatroom(t)}}),Object.defineProperty(r.prototype,"_handleMessagesFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=this._messageProcessor(t),o=i.newOutboxTime;i.messageUIds;var s=i.messages,a=i.messageExpansionList,u=i.RSMsgList,l=i.msgUIds2Statistic;l.length>0&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:l.join(",")})),this._batchMessage(s),a.forEach((function(e){n._receiveMessageExpansion(e)})),u.forEach((function(e){n._processRSMsg(e)})),this._sendMessageStore.removeByTimestamp(o),r&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this.logger.info(B.L_PULL_OFFLINE_MESSAGE_FINISHED_S),this._watcher.pullFinished(),this._chat.startPullModifyMsg())}}),Object.defineProperty(r.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=t.syncMsg,o=t.topic;if(i)this._receiveSyncMsg(t,r);else switch(Cn(o)){case Sn.rtc_ntf:this._receiveRtcKv(t.pbData);break;case Sn.s_opNtf:this._pullOperateStatusNotify(t);break;case Sn.s_pubCall:this._pubCallInfo(t);break;case Sn.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(t)}}}),Object.defineProperty(r.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n,i,o=t.time;switch(t.type){case 8:null===(r=this._subscribeManager)||void 0===r||r.startsyncSubscribeUserStatus(o);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(o);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(r.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,o=e.targetId,s=t.put,a=t.del,u=t.mid;s&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:s,channelId:n,conversationType:i,targetId:o}}),a&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:a,channelId:n,conversationType:i,targetId:o}})}}),Object.defineProperty(r.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this._chat.storage.clearConversationUnreadCount({conversationType:e,targetId:t,channelId:r},i);n&&o&&this._watcher.conversation([o])}}),Object.defineProperty(r.prototype,"_setConversationCacheByMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.isPersited,i=e.targetId,o=e.channelId,s=e.sentTime,a=e.disableUpdateLastMessage,u=e.senderUserId,l=e.messageType,c=e.isCounted,d=e.messageUId,_=e.content,f=e.isMentioned;if(te(t,W)){var p=this.naviInfo,h=this._chat.storage.getOrCreateModel({conversationType:t,targetId:i,channelId:o},!0),g={},E=u===this.currentUserId,b=l===me.RECALL,T=h.lastReadTime>s;if(c&&!gc(p).isOk&&!b&&!E&&!T&&(0===h.unreadCount&&(g.firstUnreadMessageUId=d,g.firstUnreadTime=s,g.firstUnreadMessageType=l),g.unreadCount=h.unreadCount+1,f&&bt(_)&&_.mentionedInfo)){g.hasMentioned=!0,g.mentionedInfo=_.mentionedInfo;var v=_.mentionedInfo,R=v.type,I=v.userIdList;(R===exports.MentionedType.ALL||(I||[]).includes(this.currentUserId))&&(g.unreadMentionedCount=h.unreadMentionedCount+1)}if(b&&bt(_)&&!E){var m=_,y=m.sentTime,A=m.messageUId;!this._ctx.userStorage.recallMsgMap.has(A)&&h.unreadCount>0&&y>h.lastReadTime&&(this._ctx.userStorage.recallMsgMap.add(A),g.unreadCount=h.unreadCount-1,0===h.unreadCount&&(g.firstUnreadMessageUId="",g.firstUnreadTime=0,g.firstUnreadMessageType=""))}if(r){b&&!h.hidden||(g.operationTime=s),g.hidden=!1;var S=b?_.sentTime:s;a||h.latestMessage&&!(h.latestMessage.sentTime<=S)||(g.latestMessage=p.supportRecallRefactor&&b?hc(e,!0):e)}if(this._ctx.includeUg&&l===me.EXPANSION_NOTIFY&&h.latestMessage&&h.latestMessage.messageUId===d){var O=_,C=O.put,N=O.del;O.clear?h.latestMessage.expansion={}:C?h.latestMessage.expansion=n(n({},h.latestMessage.expansion),C):N&&h.latestMessage.expansion&&N.forEach((function(e){delete h.latestMessage.expansion[e]}))}var P=h.updateAttrs(g,e.sentTime);this._chat.storage.updateConversationStorage([h]),P&&r&&!a&&this._watcher.conversation([{conversation:h.toIReceivedConversation(),updatedItems:P}])}}}),Object.defineProperty(r.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;switch(Cn(e.topic)){case Sn.updRTime:this._receivesyncReadStatus(e);break;case Sn.updUserSub:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(r.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,r=[],n=[],i=[],o=e.length-1;o>=0;o-=1){var s=e[o];s.messageType===me.LOG_COMMAND&&s.senderUserId===He?n.unshift(s):s.messageType===me.CLOUD_CONTROL&&s.senderUserId===He?i.push(s):r.unshift(s)}this._watcher.batchMessage(r),n.forEach((function(e){var r=e.content,n=r.startTime,i=r.endTime,o=r.platform,s=r.logId,a=r.uri;t.reporter.report(parseInt(n,10),parseInt(i,10),o,a,s,e.messageUId)})),i.length>0&&this._ccMsgHandler(i)}}),Object.defineProperty(r.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return e.shift()?(r=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,Xr.other,r)]):[3,2];case 1:n=o.sent()||0,(i=e.filter((function(e){return e.sentTime>n}))).length>0&&this._ccMsgHandler(i),o.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(r.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=hl.decode(Na,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(r.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=hl.decode(Us,e.pbData),r=t.type,n=t.channelId,i=t.msgTime,o=t.busChannel;this._clearConversationUnreadCount(r,n,o||"",!0,i),this._watcher.syncReadStatus({conversationType:r,targetId:n,channelId:o,timestamp:i})}}),Object.defineProperty(r.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n;return s(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=hl.encode(Pa,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._connMgr.query(Sn.pullKvMsg,this.currentUserId,e,La)]):[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(r.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_filterMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType;return t===me.DELIVERED||t===me.DELIVERED_MSG||t===me.SYNC_READ_STATUS&&!this._processSRSMsg(e)}}),Object.defineProperty(r.prototype,"_messageProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=0,n=[],i=[],o=[],s=[],a=[];return e.forEach((function(e){var u=e.conversationType,l=e.targetId,c=e.channelId,d=e.messageDirection,_=e.messageUId,f=e.messageType,p=e.sentTime,h=e.senderUserId,g=e.content;if(n.push(_),d===exports.MessageDirection.SEND){r=Math.max(p,r);var E=t._sendMessageStore.getSendMessageMap(),b=f===me.RECALL?"Cmd:".concat(g.messageUId):_;if(E[b])return void t._sendMessageStore.removeByUID(b)}if(!t._filterMessage(e)){switch(p>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,_)&&a.push(_),f){case me.EXPANSION_NOTIFY:return void o.push(e);case me.READ_RECEIPT:h===t.currentUserId&&t._clearConversationUnreadCount(u,l,c,!0,p);break;case me.READ_STATE:return void s.push(e);case me.READ_RECEIPT_REQUEST:t._enableReadReceiptStorage&&t._processRRReqMsg(e);break;case me.READ_RECEIPT_RESPONSE:t._enableReadReceiptStorage&&t._processRRRspMsg(e)}t._setConversationCacheByMessage(e),i.push(e)}})),{newOutboxTime:r,messageUIds:n,messages:i,messageExpansionList:o,RSMsgList:s,msgUIds2Statistic:a}}}),Object.defineProperty(r.prototype,"_processSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=e.content,o=e.senderUserId,s=e.sentTime;if(o!==this.currentUserId)return!1;var a=this.naviInfo;return this._clearConversationUnreadCount(t,r,n,!0,s),1!==a.sesDriven||(s>this.connectedTime||this._watcher.syncReadStatus({conversationType:t,targetId:r,channelId:n,timestamp:i.lastMessageSendTime}),!1)}}),Object.defineProperty(r.prototype,"_processRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,i=e.channelId,o=e.content,s={conversationType:t,targetId:r,channelId:i};this._watcher.messageReadReceipt(t===exports.ConversationType.PRIVATE?{privateReadReceipt:n(n({},s),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:n(n({},s),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})}}),Object.defineProperty(r.prototype,"_processRRReqMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.conversationType,n=e.channelId,i=e.targetId,o=e.content,s=e.sentTime,a=e.messageDirection,u=e.senderUserId;null===(t=this._readReceiptManager)||void 0===t||t.insert({conversationType:r,channelId:n,targetId:i},o.messageUId,a,s,u)}}),Object.defineProperty(r.prototype,"_processRRRspMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i=this,o=e.conversationType,s=e.channelId,u=e.targetId,l=e.content,c=e.senderUserId,d=l.receiptMessageDic,_=void 0===d?{}:d;if(c===this.currentUserId)for(var f in _){var p=_[f];try{for(var h=(t=void 0,a(p)),g=h.next();!g.done;g=h.next()){var E=g.value;null===(n=this._readReceiptManager)||void 0===n||n.remove({conversationType:o,channelId:s,targetId:u},E)}}catch(e){t={error:e}}finally{try{g&&!g.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}}else(_[this.currentUserId]||[]).forEach((function(e){var t;null===(t=i._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:o,channelId:s,targetId:u},e,c)}))}}),Object.defineProperty(r.prototype,"_handleSmsgFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.conversationType,n=t.senderUserId,i=t.messageUId,o=t.sentTime;this._writeMessagesLog(r,i)&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:i})),n!==this.currentUserId||t.isStatusMessage||this._sendMessageStore.setMessage(i,o),this._handleNotNotifyMsg(t)||(this._handleReadReceiptStorage(t),this._setConversationCacheByMessage(t),this._batchMessage([t]))}}),Object.defineProperty(r.prototype,"_handleReadReceiptStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._enableReadReceiptStorage){var t=e.messageType;t===me.READ_RECEIPT_REQUEST&&this._processRRReqMsg(e),t===me.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(e)}}}),Object.defineProperty(r.prototype,"_handleSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageStore.setMessage(t.messageUId,t.sentTime),this.logger.info(B.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),t.messageType!==me.EXPANSION_NOTIFY?((t.messageType===me.SYNC_READ_STATUS||t.messageType===me.READ_RECEIPT&&t.senderUserId===this.currentUserId)&&this._clearConversationUnreadCount(t.conversationType,t.targetId,t.channelId,!0,t.sentTime),t.messageType===me.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),t.messageType===me.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._setConversationCacheByMessage(t),this._batchMessage([t])):this._receiveMessageExpansion(t)}}),Object.defineProperty(r.prototype,"_handleNotNotifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType,r=e.senderUserId;return t===me.DELIVERED||(t===me.DELIVERED_MSG||(t===me.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===me.SYNC_READ_STATUS&&r!==this.currentUserId||t===me.READ_STATE&&(this._processRSMsg(e),!0)))}}),Object.defineProperty(r.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,_,f,p,h,g=this;return s(this,(function(s){switch(s.label){case 0:return r=e.conversationType,n=e.targetId,i=e.channelId,o=t.timestamp,a=t.count,u=t.order,l=RE[r],c=this.currentUserId,d=ph({targetId:n,busChannel:i,time:o||(1===u?1:this._connMgr.getCrtServerTime()+6e4),count:a,order:u}),_=r===exports.ConversationType.CHATROOM?n:c,[4,this._connMgr.query(l,_,d,void 0)];case 1:return(f=s.sent()).isOk?(p=hh(f.data.pbData),h=p.list.map((function(e){var t,r=dc(e,c,!1,n),i=null===(t=g._readReceiptManager)||void 0===t?void 0:t.getReadReceiptInfo(r,r.messageUId);if(i){var o=i.users;r.readReceiptInfo={isReceiptRequestMessage:!0,readerList:o}}return r})),[2,ar({hasMore:!!p.hasMsg,list:0===u?h.reverse():h})]):[2,f.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=(t=this).currentUserId,n=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(B.L_VER_REPORT_T,o,i),a=hl.encode(ha,{sdkInfo:o}),u=new $i(Sn.reportsdk,a,r),[4,n.send(u)]):[2];case 1:return(l=s.sent().code)!==exports.ErrorCode.SUCCESS&&this.logger.warn(B.L_VER_REPORT_R,l,i),[2]}}))}))}}),Object.defineProperty(r.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return this._chat.storage.setDrafts(e,t),[2,ar()]}))}))}}),Object.defineProperty(r.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this._chat.storage.getDrafts(e),[2,ar(t)]}))}))}}),Object.defineProperty(r.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._chat.storage.deleteDrafts(e),[2,ar()]}))}))}}),Object.defineProperty(r.prototype,"_writeMessagesLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=null===(r=this.cloudController)||void 0===r?void 0:r.getMRTRConfig();if(!n)return!1;var i=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),o=0;switch(e){case exports.ConversationType.PRIVATE:o=n.private;break;case exports.ConversationType.GROUP:o=n.group;break;case exports.ConversationType.CHATROOM:o=n.chatroom;break;case exports.ConversationType.ULTRA_GROUP:o=n.ultraGroup}return!!o&&i%(1/o)==0}}),Object.defineProperty(r.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var r,o,a,u,l,c,d,_,f,p,h,g,E,b,T,v;return s(this,(function(s){switch(s.label){case 0:return r=e.conversationType,o=e.targetId,t=this._handleInnerMsgOptions(e,t),a=!1,[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP].includes(r)&&(t.isStatusMessage||cn(t.messageType).isStatusMessage)&&(a=!0),u=a?function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=Sn.ppMsgS,t[exports.ConversationType.GROUP]=Sn.pgMsgS,t)[e]}(r):function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=Sn.ppMsgP,t[exports.ConversationType.GROUP]=Sn.pgMsgP,t[exports.ConversationType.CHATROOM]=Sn.chatMsg,t[exports.ConversationType.CUSTOMER_SERVICE]=Sn.pcMsgP,t[exports.ConversationType.RTC_ROOM]=Sn.prMsgS,t[exports.ConversationType.SYSTEM]=Sn.pbMsgP,t)[e]}(r)||Sn.ppMsgP,t.messageId||(t.messageId=Qt()),l=t.messageId,c=vh(e,t),(d=new eo(Sn[u],c,r===exports.ConversationType.SYSTEM?this.currentUserId:o)).setHeaderQos(Ln),a?(this._connMgr.sendOnly(d),[2,ar(IE(e,n(n({},t),{isStatusMessage:a}),"",0,this.currentUserId,l))]):(_=this._connMgr.getCrtServerTime(),f=IE(e,n(n({},t),{isStatusMessage:a}),"",_,this.currentUserId,l),null==i||i(l),p=Date.now(),[4,this._connMgr.send(d)]);case 1:return h=s.sent(),g=h.code,E=h.isOk,b=h.msg,T=h.data,E?(v=T,this._sendMessageSuccessHandle(f,v),this._writeMessagesLog(r,v.messageUId)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:v.messageUId,channel:r,start_ts:p,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:g})),[2,ar(f)]):(this._writeMessagesLog(r)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({channel:r,start_ts:p,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:g})),f.sentStatus=exports.SentStatus.FAILED,[2,ur(g,b,f)])}}))}))}}),Object.defineProperty(r.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this;this._sendMessageStore.setMessage(t.messageUId,t.timestamp),e.sentTime=t.timestamp,e.messageUId=t.messageUId,this._setConversationCacheByMessage(e);var i=e.messageType,o=e.conversationType,s=e.targetId,a=e.channelId,u=e.sentTime,l=e.content,c=e.messageDirection;if(this._enableReadReceiptStorage){if(i===me.READ_RECEIPT_REQUEST){var d=l.messageUId;null===(r=this._readReceiptManager)||void 0===r||r.insert({conversationType:o,targetId:s,channelId:a},d,c,u)}if(i===me.READ_RECEIPT_RESPONSE){var _=l.receiptMessageDic;if(!_)return;for(var f in _)_[f].forEach((function(e){var t;null===(t=n._readReceiptManager)||void 0===t||t.remove({conversationType:o,targetId:s,channelId:a},e)}))}}}}),Object.defineProperty(r.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,_,f,p,h,g,E,b,T,v,R,I,m;return s(this,(function(s){switch(s.label){case 0:return r=e.targetId,n=e.conversationType,i=e.channelId||"",o=t.user,a=t.extra,u=t.isDelete,l=t.directionalUserIdList,c=t.disableUpdateLastMessage,d=t.messageUId,_=t.sentTime,f=t.disableNotification,p=t.pushConfig,h=t.pushContent,g=t.isAdmin,E={conversationType:n,targetId:r,messageUId:d,sentTime:_,channelId:i,isDelete:!!u,isAdmin:!!g},o&&(E.user=o),a&&(E.extra=a),b={content:E,messageType:me.RECALL,disableNotification:f,pushConfig:p,pushContent:(null==p?void 0:p.pushContent)||h,disableUpdateLastMessage:c,directionalUserIdList:[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP].includes(n)?l:void 0},T=vh(e,b),(v=new eo(Sn.recallMsg,T,this.currentUserId)).setHeaderQos(Ln),[4,this._connMgr.send(v)];case 1:return(R=s.sent()).isOk?(I=R.data,n!==exports.ConversationType.ULTRA_GROUP&&(I.messageUId="Cmd:".concat(d)),m=IE(e,b,I.messageUId,I.timestamp,this.currentUserId),n===exports.ConversationType.ULTRA_GROUP?(this._ultraMsgMap[I.messageUId]=I.timestamp,this._updateUltraGroupWhenRecallMsg(m)):(this._sendMessageStore.setMessage(I.messageUId,I.timestamp),this._setConversationCacheByMessage(m)),[2,ar(m)]):[2,R.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._connMgr.getToken();this.navi.updateVoipCallInfo(r,t);var i=this.navi.getNaviInfoFromCache(r);this._watcher.onNaviDataChange(n({},i))}}),Object.defineProperty(r.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,a,u){return o(this,void 0,void 0,(function(){var o,l,c,d,_;return s(this,(function(s){switch(s.label){case 0:return o=i&&"uploads"!==i?t||"":qt(e,t),l=this.naviInfo,c=$t(l,this.logger),d="",c||(d=JSON.stringify({uploadDomain:c})),_=hl.encode(ps,{type:e,key:o,httpMethod:r||"",queryString:i||"",url:a||"",ext:d,size:u?Math.ceil(u):0,ipType:l.ipType||0}),[4,this._connMgr.query(Sn.qnTkn,this.currentUserId,_,gs)];case 1:return[2,s.sent().trans((function(e){return n(n({},e),{fileName:o,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(r.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this.naviInfo,a="",u="",t===exports.UploadMethod.QINIU?o=Sn.qnUrl:t===exports.UploadMethod.AWS?o=Sn.s3Url:t===exports.UploadMethod.STC?o=Sn.stcUrl:t===exports.UploadMethod.MINIO?(o=Sn.minioUrl,a=$t(i,this.logger),u=JSON.stringify({url:a})):o=Sn.aliUrl,l=hl.encode(hs,{type:e,key:r,fileName:n,ext:u,size:-1,ipType:i.ipType||0}),[4,this._connMgr.query(o,this.currentUserId,l,Es)];case 1:return[2,s.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect(e,t)];case 1:return r.sent(),this._resetMemoryState(),[2,ar()]}}))}))}}),Object.defineProperty(r.prototype,"_resetMemoryState",{enumerable:!1,configurable:!0,writable:!0,value:function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager}}),Object.defineProperty(r.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(r.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"userId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,ur(exports.ErrorCode.TAG_EXISTS)]:[2,this._userSettings.createTag(e)]}))}))}}),Object.defineProperty(r.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._userSettings.hasTag(e)?[2,this._userSettings.removeTag(e)]:[2,ur(exports.ErrorCode.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(r.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,this._userSettings.createTag(e)]:[2,ur(exports.ErrorCode.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(r.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){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,ar(n)]}))}))}}),Object.defineProperty(r.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var r,o,a,u,l,c,d,_,f,p,h,g,E;return s(this,(function(s){switch(s.label){case 0:return r=e.targetId,t.messageId||(t.messageId=Qt()),o=t.messageId,a=vh(e,t),(u=new eo(Sn.ugMsg,a,r)).setHeaderQos(Ln),l=this._connMgr.getCrtServerTime(),c=IE(e,n({},t),"",l,this.currentUserId,o),i&&i(o),d=Date.now(),[4,this._connMgr.send(u)];case 1:return _=s.sent(),f=_.code,p=_.data,f!==exports.ErrorCode.SUCCESS?(this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({channel:exports.ConversationType.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:f})),c.sentStatus=exports.SentStatus.FAILED,[2,ur(f,void 0,c)]):(h=p,this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP,h.messageUId)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:h.messageUId,channel:exports.ConversationType.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:f})),c.sentTime=h.timestamp,c.messageUId=h.messageUId,this._ultraMsgMap[h.messageUId]=h.timestamp,g=this._chat.storage.getOrCreateModel(e,!0),(E=g.updateAttrs({operationTime:h.timestamp,latestMessage:n({},c)},h.timestamp))&&this._watcher.conversation([{conversation:g.toIReceivedConversation(),updatedItems:E}]),[2,ar(c)])}}))}))}}),Object.defineProperty(r.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._isConnected){var t=function(e){var t=e,r=t.type,n=t.notifyType,i=t.info,o=t.summary,s=[],a=[],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,o=t.opType,a=t.optime;s.push({targetId:r,channelId:n,userId:i,operationType:o,operationTime:a})})),u&&Array.isArray(o)&&o.forEach((function(e){var t=e,r=t.targetId,n=t.busChannel,i=t.count,o=t.opType;a.push({targetId:r,channelId:n,count:i,operationType:o})})),{conversationType:r,info:s,summary:a,hasInfo:l,hasSummary:u}}(hl.decode(Sa,e.pbData));this._watcher.operateStatus(t)}}}),Object.defineProperty(r.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=hl.decode(Lu,new Uint8Array(e.eventData)).results;n.push.apply(n,l([],u(t.map((function(e){return{identifier:e.messageUID,from:e.inputSource,code:e.code,translateInfo:{targetLanguage:e.targetLan,translatedText:e.transResult||"",status:e.code===exports.ErrorCode.SUCCESS?bn.SUCCESS:bn.FAILED}}}))),!1))})),n.length&&(null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,n))}}),Object.defineProperty(r.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:mE},Friend:{map:{},types:yE}},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(r.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=L.GROUP_OPERATION,r=L.GROUP_PROFILE_CHANGE,n=L.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[r]&&this._handleGroupProfileChange(e[r]),e[n]&&this._handleFollowUserChange(e[n])}}),Object.defineProperty(r.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,o,s,a,u,l,c,d,_=e.subChangeType,f=e.businessId,p=e.time,h=e.eventData,g=T.FRIEND_APPLY,E=T.FRIEND_REFUSE,b=T.FRIEND_USER_INFO,v=T.FRIENDS_INPUT,R=T.FRIEND_CLEAR,I=T.FRIEND_INFO_CHANGE,m=T.FRIEND_INFO_CHANGE_SYNC;switch(_){case g:case E:var y=_===g?exports.FriendApplicationStatus.UNHANDLED:exports.FriendApplicationStatus.REFUSED;null===(n=(r=t._watcher).friendApplicationStatusChanged)||void 0===n||n.call(r,{userId:f,applicationType:h.applyType,applicationStatus:y,directionType:h.friendType,operationTime:p,extra:h.info||""});break;case b:null===(o=(i=t._watcher).friendAdd)||void 0===o||o.call(i,{userId:f,name:h.name,portraitUri:h.portraitUrl,directionType:h.friendType,operationTime:p});break;case v:null===(a=(s=t._watcher).friendDelete)||void 0===a||a.call(s,{userIds:h.targetId,directionType:h.type,operationTime:p});break;case R:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,p);break;case I:break;case m:null===(d=(c=t._watcher).friendInfoChangedSync)||void 0===d||d.call(c,{userId:f,remark:h.remarkname,extProfile:h.extProfile,operationTime:p})}}))}}),Object.defineProperty(r.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,s=e.subChangeType,a=e.businessId,l=e.time,c=e.eventData,d=c.optUserInfo,_=c.channelInfo,f=c.userInfos,p={groupId:a,operation:s,operationTime:l};d&&(r=u(xt([d]),1),p.operatorInfo=r[0]),s===exports.GroupOperation.CREATE&&(n=u(function(e){return void 0===e&&(e=[]),e.map((function(e){var t,r,n,i,o,s,a,u,l,c=Gt(e.settingProfile)||{},d=e.extProfile||[],_=e.targetId,f=e.baseInfo,p=e.userInfo;return{groupId:_,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:Gt(d),joinPermission:~~c.joinPerm,removeMemberPermission:~~c.removePerm,invitePermission:~~c.memInvitePerm,inviteHandlePermission:~~c.invitePerm,groupInfoEditPermission:~~c.profilePerm,memberInfoEditPermission:~~c.memProfilePerm,creatorId:null!==(o=null==f?void 0:f.creatorId)&&void 0!==o?o:"",ownerId:null!==(s=null==f?void 0:f.ownerId)&&void 0!==s?s:"",createTime:(null==f?void 0:f.createTime)||0,membersCount:null!==(a=null==f?void 0:f.memberCount)&&void 0!==a?a:0,remark:null!==(u=null==p?void 0:p.remarkName)&&void 0!==u?u:"",joinedTime:(null==p?void 0:p.joinTime)||0,role:null!==(l=null==p?void 0:p.role)&&void 0!==l?l:exports.GroupMemberRole.UNDEF}}))}([_]),1),p.groupInfo=n[0]),[exports.GroupOperation.CREATE,exports.GroupOperation.DISMISS].includes(s)||(p.memberInfos=xt(f)),null===(o=(i=t._watcher).groupOperation)||void 0===o||o.call(i,p)}))}}),Object.defineProperty(r.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,s,a,l=e.businessId,c=e.time,d=e.eventData,_=e.subChangeType,f=e.secondaryId;switch(_){case S.GROUP_INFO_CHANGE:var p=u(xt([d.optUserInfo]),1)[0],h=u(wt([d.channelInfo]),1)[0],g=u(d.channelFullInfo?wt([d.channelFullInfo]):[void 0],1)[0];null===(n=(r=t._watcher).groupInfoChanged)||void 0===n||n.call(r,{operatorInfo:p,groupInfo:h,changedGroupInfo:h,operationTime:c,fullGroupInfo:g});break;case S.MEMBER_PROFILE_CHANGE:p=u(xt([d.optUserInfo]),1)[0];var E=xt(d.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:l,operatorInfo:p,memberInfo:E,operationTime:c});break;case S.GROUP_REMARK_DELETE:case S.GROUP_REMARK_SET:var b=_===S.GROUP_REMARK_SET?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(a=(s=t._watcher).groupRemarkChangedSync)||void 0===a||a.call(s,{groupId:l,operationType:b,operationTime:c,groupRemark:f})}}))}}),Object.defineProperty(r.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i=e.subChangeType,o=e.businessId,s=e.time,a=e.userGroupIds,u=1===i?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(n=(r=t._watcher).groupFollowsChangedSync)||void 0===n||n.call(r,{groupId:o,operationType:u,operationTime:s,userIds:a})}))}}),Object.defineProperty(r.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],i=[],o=[];t.forEach((function(e){var t=e.subChangeType,s=e.targetId;e.msgTime;var a=e.operatorId,u=e.busChannelType,l=e.time,c=e.busChannel||"",d={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:s,channelId:c},_=r._chat.storage.getModel(d);switch(t){case oe.PRIVATE_TO_PUBLIC:null==_||_.updateAttrs({channelType:exports.UltraGroupChannelType.PUBLIC}),n.push({targetId:s,channelId:c,changeType:exports.UltraGroupChannelChangeType.PRIVATE_TO_PUBLIC,channelType:exports.UltraGroupChannelType.PUBLIC});break;case oe.PUBLIC_TO_PRIVATE:null==_||_.updateAttrs({channelType:exports.UltraGroupChannelType.PRIVATE}),n.push({targetId:s,channelId:c,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE,channelType:exports.UltraGroupChannelType.PRIVATE});break;case oe.PUBLIC_TO_PRIVATE_USER_NOT_IN:_&&r._chat.storage.removeConversation(_),n.push({targetId:s,channelId:c,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:u});break;case oe.CHANNEL_DELETE:_&&r._chat.storage.removeConversation(_),i.push({targetId:s,channelId:c,channelType:u,deleteTime:l});break;case oe.CHANNEL_USER_KICKED:o.push({targetId:s,channelId:c,userId:a,channelType:exports.UltraGroupChannelType.PRIVATE}),a===r.currentUserId&&_&&r._chat.storage.removeConversation(_);case oe.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),i.length>0&&this._watcher.ultraGroupChannelDelete(i),o.length>0&&this._watcher.ultraGroupChannelUserKicked(o)}}),Object.defineProperty(r.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var e,r,n,i,o,a;return s(this,(function(s){return e=[],r=[],n=[],i=[],o=[],t.forEach((function(t){var s=t.type,a=t.targetId,u=t.busChannelType,l=t.busChannel,c=t.userGroupIds;switch(t.subChangeType){case se.REMOVE_USER_GROUP:e.push({conversation:{conversationType:s,targetId:a},userGroupIds:c});break;case se.JOIN_USER_GROUP:r.push({conversation:{conversationType:s,targetId:a},userGroupIds:c});break;case se.EXIT_USER_GROUP:n.push({conversation:{conversationType:s,targetId:a},userGroupIds:c});break;case se.CHANNEL_BIND_USER_GROUP:i.push({conversation:{conversationType:s,targetId:a,channelId:l},channelType:u,userGroupIds:c});break;case se.CHANNEL_UNBIND_USER_GROUP:o.push({conversation:{conversationType:s,targetId:a,channelId:l},channelType:u,userGroupIds:c})}})),a={},e.length>0&&(a.userGroupDisband=e),r.length>0&&(a.userAdded=r),n.length>0&&(a.userRemoved=n),i.length>0&&(a.userGroupBindChannel=i),o.length>0&&(a.userGroupUnBindChannel=o),this._watcher.userGroupStatus(a),[2]}))}))}}),Object.defineProperty(r.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,o=i.messageUId,s=i.sentTime,a=r.latestMessage;a&&a.messageUId===o&&(n.latestMessage=hc(e,!0)),s&&r.lastReadTime<s&&r.unreadCount&&(n.unreadCount=r.unreadCount-1,t!==ae.ALL&&t!==ae.ME||!r.unreadMentionedCount||(n.unreadMentionedCount=r.unreadMentionedCount-1),t===ae.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(r.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.SUBSCRIBE,r)]}))}))}}),Object.defineProperty(r.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.UNSUBSCRIBE)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i;return s(this,(function(o){return i=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserList(e,t,r),[2,ar(i)]}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserStatus(e,t),[2,ar(n||[])]}))}))}}),Object.defineProperty(r.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=hl.encode(Ya,c(this,d,"m",m).call(this,e)),[4,this._connMgr.query(Sn.updUserProfile,this.currentUserId,r,void 0)];case 1:return(n=s.sent()).data?(i=hl.decode(Wa,n.data.pbData),n.isOk?(o=i.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,o),[2,n.wipe()]):(a=i.censorFailedFields,[2,ur(n.code,"",a&&0!==a.length?{errorKeys:a,errorKey:a[0]}:void 0)])):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subscribeManager.getOwnProfile()}}),Object.defineProperty(r.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._subscribeManager.getUserProfiles(e)]}))}))}}),Object.defineProperty(r.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return r?[3,2]:[4,this._connMgr.send(new eo(t,n,e))];case 1:return[2,i.sent().wipe()];case 2:return[4,this._connMgr.query(t,e,n,void 0)];case 3:return[2,i.sent().trans((function(e){return e.pbData}))]}}))}))}}),Object.defineProperty(r.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=Ul(t,r),[4,this.rtcSignaling(e,Sn[Sn.rtcPing],!0,n)];case 1:return(i=s.sent()).isOk?(o=hl.decode(Yu,i.data),[2,ar(o)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"deviceId",{get:function(){return ic()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;(t=e.deviceId)&&(nc=t),r=e.packageName,oc=r}}),Object.defineProperty(r.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){o(void 0,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return Fc?(Wc&&(clearTimeout(Wc),Wc=null),[4,Fc]):[2];case 1:return(e=r.sent())&&(t=e.db,Qc.push(t)),Fc=null,[2]}}))}))}}),Object.defineProperty(r.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;if(this._connMgr.setNetwork(e,t),e.status&&this.cloudControllerUri){var n=this._connMgr.getToken();null===(r=this.cloudController)||void 0===r||r.request(this.cloudControllerUri,Xr.newWorkChange,n)}}}),Object.defineProperty(r.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n=hl.encode(Ca,{key:t,dataContent:r}),[4,this._connMgr.query(Sn.reqCall,e,n,Ca)];case 1:return(i=o.sent()).isOk?[2,i.trans((function(e){return{key:e.key,value:e.dataContent}}))]:[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=hl.encode(Ru,e),[4,this._connMgr.query(Sn.addUnpush,this.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=hl.encode(Iu,{nothing:0}),[4,this._connMgr.query(Sn.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=hl.encode(mu,{nothing:0}),[4,this._connMgr.query(Sn.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,o=e.timezone;return t?{spanMinutes:r,startTime:n,level:i,timezone:o}:{spanMinutes:0,startTime:"",level:exports.PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(r.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ar(Vr.getStatsUrlList(this.naviInfo))]}))}))}}),Object.defineProperty(r.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,_=this;return s(this,(function(s){switch(s.label){case 0:return i=0===n?e[0].identifier:this.currentUserId,o=this.userSettings.storage.get("value").transLan,a=[],u=[],e.forEach((function(e){var t=e.sourceLanguage,r=e.content,i=e.targetLanguage||o;t!==i?r?a.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:exports.ErrorCode.TRANSLATION_TEXT_INVALID,translateInfo:{targetLanguage:i,translatedText:"",status:bn.NONE}}):u.push({identifier:e.identifier,from:n,code:exports.ErrorCode.TRANSLATION_LANGUAGE_SAME,translateInfo:{targetLanguage:i,translatedText:"",status:bn.NONE}})})),0!==a.length?[3,1]:(l=ar(),[3,3]);case 1:return c=hl.encode(Su,{businessType:3,businessInfo:hl.encode(Pu,{forceTrans:r,transInfos:a,model:t})}),[4,this._connMgr.query(Sn.upConvertMsg,i,c,Cu)];case 2:d=s.sent(),l=d.wipe(),s.label=3;case 3:return u.length>0&&setTimeout((function(){return _._watcher.translateResponse(u)}),0),[2,l]}}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._subscribeManager?(t=[],r=new Set,this._subscribeManager.getSubscribeUserStatus(exports.SubscribeType.ONLINE_STATUS,e).forEach((function(e){var n=e.userId,i=e.details,o=(void 0===i?[]:i).map((function(e){return{platform:e.platform,isOnline:!!e.eventValue,updateTime:e.changeTime}})),s=o.some((function(e){return e.isOnline})),a={userId:n,isOnline:s,details:o};t.push(a),r.add(n)})),0===(n=e.filter((function(e){return!r.has(e)}))).length?[2,ar(t)]:[4,c(this,d,"m",y).call(this,exports.SubscribeType.FRIEND_ONLINE_STATUS,n)]):[2,ar([])];case 1:return(i=o.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}})),o=i.some((function(e){return e.isOnline}));t.push((r={userId:n,isOnline:o,details:i},[exports.Platform.iOS,exports.Platform.Android,exports.Platform.Web,exports.Platform.PC,exports.Platform.Mini,exports.Platform.HarmonyOS].forEach((function(e){r.details.some((function(t){return t.platform===e}))||r.details.push({platform:e,isOnline:!1,updateTime:0})})),r))})),[2,ar(t)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._ctx.getAllRobots(!1)]}))}))}}),d=new WeakSet,_=function(e,t,r,n,i){this._watcher.robotsSynced(t,n)},f=function(e,t){this._watcher.readReceiptResponseV5(t)},p=function(e,t){this._watcher.speechToTextResponse(t)},h=function(e,t){this._watcher.messagesModified(t)},g=function(e){this._watcher.messageModifiedSyncCompleted()},E=function(e,t){this._watcher.ultraGroupMessageExpansionUpdated(t)},v=function(e,t){this._watcher.ultraGroupMessageRecalled(t)},R=function(e,t){this._watcher.conversation(t)},I=function(e,t,r){var n=this;t!==Lh?t!==wh?this._handleEventChangeList(this._connMgr.codec.formatEventChangeList(r)):this._handleConvertEvent(r):r.forEach((function(e){hl.decode(vu,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,r,i=jt(e);null===(r=(t=n._watcher).groupApplicationEvent)||void 0===r||r.call(t,i)}))}))},m=function(e){var t={},r=e.extraProfile;return r&&(delete e.extraProfile,t.userExtProfile=Qp(r)),t.userProfile=Qp(e),t},y=function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=hl.encode(qa,{subType:e,subUsers:t.map((function(e){return{subUserId:e}}))}),[4,this._connMgr.query(Sn.qrySubData,this.currentUserId,r,Ba)];case 1:return[2,n.sent()]}}))}))},i([AE()],r.prototype,"setNotificationQuietHoursWithSetting",null),i([AE()],r.prototype,"removeNotificationQuietHoursSetting",null),i([AE()],r.prototype,"getNotificationQuietHoursSetting",null),r}(Gl),CE=function(){function e(e){SE.set(this,void 0),d(this,SE,e,"f")}return Object.defineProperty(e.prototype,"isSpeechToTextEnabled",{get:function(){return!!(1&(c(this,SE,"f").AIBusinessSub||0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConversationListIncludeUltraGroup",{get:function(){return Mg(c(this,SE,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messageModifiableMinutes",{get:function(){return c(this,SE,"f").msgModifyMinute||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readReceiptVersion",{get:function(){return e=(e=c(this,SE,"f").grpRRVer)||0,Object.values(Ve).includes(e)?e:Ve.UNKNOWN;var e},enumerable:!1,configurable:!0}),e}();SE=new WeakMap;var NE,PE,LE,ME,wE,UE,DE,xE=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===exports.RCConnectionStatus.CONNECTED||this.ctx.userId&&e?ar(this.ctx.naviInfo):ur(exports.ErrorCode.RC_NET_UNAVAILABLE)}}),e}(),GE=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 o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,extra:n,createIfNotExist:r}),i),[4,lr.create("joinChatroom").validate("chatroomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNumber("count",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("extra",n).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){var i=Math.max(Math.min(t,50),-1)||10;return a.svr.joinChatroom(e,i,r,n)}))];case 1:return o=s.sent(),this.logger.summary(B.A_JOIN_CHATROOM_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_QUIT_CHATROOM_T,JSON.stringify({roomId:e}),r),[4,lr.create("quitChatroom").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isString("extra",t).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.quitChatroom(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_INFO_T,JSON.stringify({roomId:e,count:t,order:r}),n),[4,lr.create("getChatroomInfo").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,0,20).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,2).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).next((function(){return o.svr.getChatroomInfo(e,t||0,r||1)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,lr.create("setChatroomEntry").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("key",null==t?void 0:t.key,Jt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).validate("value",null==t?void 0:t.value,Kt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_VALUE).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).isBoolean("isAutoDelete",null==t?void 0:t.isAutoDelete).fail(exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE).isBoolean("isSendNotification",null==t?void 0:t.isSendNotification).fail(exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION).result().tryTrans(this.validateConnected).next((function(){return o.svr.setChatroomEntry(e,t,r)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,lr.create("setChatroomEntries").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isTypedArray("entries",null==t?void 0:t.entries,(function(e){return Jt(null==e?void 0:e.key)&&Kt(null==e?void 0:e.value)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_ENTRIES).isLimitedArray("entryOptions.entries",null==t?void 0:t.entries,10,!0).fail(exports.ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT).isBoolean("entryOptions.isForce",null==t?void 0:t.isForce).fail(exports.ErrorCode.INVALID_PARAMETER_IS_FORCE).isBoolean("entryOptions.isAutoDelete",null==t?void 0:t.isAutoDelete).fail(exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE).result().tryTrans(this.validateConnected).next((function(){return i.svr.setChatroomEntries(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,lr.create("removeChatroomEntry").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("entry.key",null==t?void 0:t.key,Jt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).isBoolean("entry.isSendNotification",null==t?void 0:t.isSendNotification).fail(exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION).isLimitedString("entry.notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return o.svr.removeChatroomEntry(e,t,r)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,lr.create("removeChatroomEntries").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("keys",null==t?void 0:t.keys,10,Jt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYS).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.removeChatroomEntries(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,key:t}),r),[4,lr.create("getChatroomEntry").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("key",t,Jt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).result().tryTrans(this.validateConnected).next((function(){return i.svr.getChatroomEntry(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_CHATROOM_ENTRY_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e}),t),[4,lr.create("getAllChatroomEntries").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.getAllChatroomEntries(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_HISTORY_MESSAGES_T,JSON.stringify({roomId:e,count:t,order:r,timestamp:n}),i),[4,lr.create("getChatroomHistoryMessages").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isTimestamp("timestamp",n).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return a.svr.getChatroomHistoryMessages(e,n||0,t||20,r||0)}))];case 1:return o=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BIND_RTC_FOR_CHATROOM_T,JSON.stringify({option:e}),t),[4,lr.create("bindRTCRoomForChatroom").validate("chatRoomId",null==e?void 0:e.chatRoomId,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.bindRTCRoomForChatroom(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_BIND_RTC_FOR_CHATROOM_R,r,t),[2,r]}}))}))}}),r}(xE),VE=function(e){e.groupId;var t=e.groupName,r=e.portraitUri,n=e.introduction,i=e.notice;e.extProfile;var o=e.joinPermission,s=e.removeMemberPermission,a=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:o,removePerm:s,memInvitePerm:a,invitePerm:u,profilePerm:l,memProfilePerm:c}))},jE=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)}},kE=function(e,t,r){return e.validate("groupId",null==t?void 0:t.groupId,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("groupName",null==t?void 0:t.groupName,1,64,r).fail(exports.ErrorCode.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(!bt(e))return!1;var t=Object.entries(e);return t.length<=10&&t.every((function(e){var t=u(e,2);t[0];var r=t[1];return _t(r)}))})).isNumberEnum("joinPermission",null==t?void 0:t.joinPermission,exports.GroupJoinPermission).isNumberEnum("removeMemberPermission",null==t?void 0:t.removeMemberPermission,exports.GroupOperationPermission).isNumberEnum("invitePermission",null==t?void 0:t.invitePermission,exports.GroupOperationPermission).isNumberEnum("inviteHandlePermission",null==t?void 0:t.inviteHandlePermission,exports.GroupInviteHandlePermission).isNumberEnum("groupInfoEditPermission",null==t?void 0:t.groupInfoEditPermission,exports.GroupOperationPermission).isNumberEnum("memberInfoEditPermission",null==t?void 0:t.memberInfoEditPermission,exports.GroupMemberInfoEditPermission).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_INFO)},FE=function(e,t,r,n,i){return e.isObject("option",n,i).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("count",null==n?void 0:n.count,1,t,r).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",null==n?void 0:n.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isBoolean("order",null==n?void 0:n.order).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER)},BE=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)?ar():ur(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MY_USER_PROFILE_VISIBILITY_T,e,t),[4,lr.create("updateMyUserProfileVisibility").isNumberEnum("visibility",e,exports.UserProfileVisibility,!0).fail(exports.ErrorCode.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(B.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 o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.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(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T,e,t),[4,lr.create("searchUserProfileByUniqueId").isNotEmptyString("uniqueId",e,!0).fail(exports.ErrorCode.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(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_ADD_FRIEND_T,JSON.stringify({userId:e,directionType:t,extra:r}),n),[4,lr.create("addFriend").validate("userId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isNumberEnum("directionType",t,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).isLimitedString("extra",r,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.addFriend(e,t,r||"")}))];case 1:return i=s.sent(),this.svr.addFriend(e,t,r||""),this.logger.summary(B.A_ADD_FRIEND_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DELETE_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),r),[4,lr.create("deleteFriends").isLimitedTypedArray("userIds",e,100,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.deleteFriends(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_DELETE_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_FRIEND_REQUEST_T,e,t),[4,lr.create("acceptFriendRequest").validate("userId",e,At,!0).fail(exports.ErrorCode.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(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_FRIEND_REQUEST_T,JSON.stringify({userId:e,reason:t}),r),[4,lr.create("refuseFriendApplication").validate("userId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isString("reason",t).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.refuseFriendRequest(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_FRIEND_INFO_T,JSON.stringify({userId:e,remark:t,extProfile:r}),n),[4,lr.create("setFriendInfo").validate("userId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("remark",t,0,64,!0).fail(exports.ErrorCode.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=u(e,2);t[0];var r=t[1];return!_t(r)})))})).fail(exports.ErrorCode.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_CHECK_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),r),[4,lr.create("checkFriends").isLimitedTypedArray("userIds",e,20,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.checkFriends(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_CHECK_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIENDS_T,JSON.stringify({directionType:e,option:t}),r),[4,lr.create("getFriends").isNumberEnum("directionType",e,exports.QueryFriendsDirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE).check((function(e){return FE(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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIEND_APPLICATIONS_T,JSON.stringify({option:e,types:t,status:r}),n),[4,lr.create("getFriendApplications").check((function(t){return FE(t,100,!1,e)})).check((function(e){e.isTypedArray("types",t,(function(t){return!e.isNumberEnum("type",t,exports.FriendApplicationType,!0).isFailed})).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE).isTypedArray("status",r,(function(t){return!e.isNumberEnum("status",t,exports.FriendApplicationStatus,!0).isFailed})).fail(exports.ErrorCode.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],s=r&&0!==r.length?r:[0,1,2,3];return o.svr.getFriendApplications(n,i,s)}))];case 1:return i=s.sent(),this.logger.summary(B.A_GET_FRIEND_APPLICATIONS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIENDS_INFO_T,JSON.stringify({userIds:e}),t),[4,lr.create("getFriendsInfo").isLimitedTypedArray("userIds",e,100,At,!0).fail(exports.ErrorCode.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(B.A_GET_FRIENDS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_FRIENDS_INFO_T,JSON.stringify({nickname:e}),t),[4,lr.create("searchFriendsInfo").isLimitedString("nickname",e,1,64,!0).fail(exports.ErrorCode.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(B.A_SEARCH_FRIENDS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_FRIEND_ADD_PERMISSION_T,JSON.stringify({permission:e}),t),[4,lr.create("setFriendAddPermission").isNumberEnum("permission",e,exports.FriendAddPermission,!0).fail(exports.ErrorCode.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(B.A_SET_FRIEND_ADD_PERMISSION_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIEND_ADD_PERMISSION_T,JSON.stringify({}),e),[4,lr.create("getFriendAddPermission").result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getFriendAddPermission()}))];case 1:return t=n.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_CREATE_GROUP_T,JSON.stringify({groupInfo:e,inviteeUserIds:t}),r),[4,lr.create("createGroup").check((function(t){return kE(t,e,!0)})).isLimitedTypedArray("inviteeUserIds",t,30,At,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r=VE(e);return i.svr.createGroup(e.groupId,r,e.extProfile||{},t||[])}))];case 1:return n=o.sent(),this.logger.summary(B.A_CREATE_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_GROUP_INFO_T,JSON.stringify({groupInfo:e}),t),[4,lr.create("updateGroupInfo").check((function(t){return kE(t,e,!1)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var t=VE(e);return n.svr.updateGroupInfo(e.groupId,t,e.extProfile)}))];case 1:return r=i.sent(),this.logger.summary(B.A_UPDATE_GROUP_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUPS_INFO_T,JSON.stringify({groupIds:e}),t),[4,lr.create("getGroupsInfo").isLimitedTypedArray("groupIds",e,20,St,!0,1).fail(exports.ErrorCode.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(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_KICK_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t,config:r}),n),[4,lr.create("kickGroupMembers").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,At,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.kickGroupMembers(e,t,jE(r))}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_QUIT_GROUP_T,JSON.stringify({groupId:e,config:t}),r),[4,lr.create("quitGroup").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.quitGroup(e,jE(t))}))];case 1:return n=o.sent(),this.logger.summary(B.A_QUIT_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_DISMISS_GROUP_T,JSON.stringify({groupId:e}),t),[4,lr.create("dismissGroup").validate("groupId",e,St,!0).fail(exports.ErrorCode.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(B.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 o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_TRANSFER_GROUP_OWNER_T,JSON.stringify({groupId:e,newOwnerId:t,quit:r,config:n}),i),[4,lr.create("transferGroupOwner").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("newOwnerId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return a.svr.transferGroupOwner(e,t,!!r,jE(n))}))];case 1:return o=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ADD_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,lr.create("addGroupManagers").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,At,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(exports.GroupOperationType.ADD,e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,lr.create("removeGroupManagers").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,At,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(exports.GroupOperationType.REMOVE,e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,lr.create("getGroupMembers").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,At,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.getGroupMembers(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_SET_GROUP_MEMBER_INFO_T,JSON.stringify({groupId:e,userId:t,nickname:r,extra:n}),i),[4,lr.create("setGroupMemberInfo").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("userId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("nickname",r,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NICK_NAME).isLimitedString("extra",n,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return a.svr.setGroupMemberInfo(e,t,r,n)}))];case 1:return o=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_GROUP_MEMBERS_T,JSON.stringify({groupId:e,nickName:t,option:r}),n),[4,lr.create("searchGroupMembers").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("nickName",t,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NICK_NAME).check((function(e){return FE(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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_MEMBERS_BY_ROLE_T,JSON.stringify({groupId:e,role:t,option:r}),n),[4,lr.create("getGroupMembersByRole").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isNumberEnum("role",t,exports.GroupMemberRole,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_MEMBER_ROLE).isLimitedInteger("count",r.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",r.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isNumberEnum("filterRobotType",r.filterRobotType,xe).fail(exports.ErrorCode.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||xe.ALL};return o.svr.getGroupMembersByRole(e,t,n)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ADD_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,lr.create("addGroupFollows").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(exports.GroupOperationType.ADD,e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,lr.create("removeGroupFollows").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(exports.GroupOperationType.REMOVE,e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_REMOVE_GROUP_FOLLOWS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_FOLLOWS_T,JSON.stringify({groupId:e}),t),[4,lr.create("getGroupFollows").validate("groupId",e,St,!0).fail(exports.ErrorCode.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(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_GROUP_REMARK_T,JSON.stringify({groupId:e,remark:t}),r),[4,lr.create("setGroupRemark").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("remark",t,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_REMARK).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupRemark(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_SET_GROUP_REMARK_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_JOIN_GROUP_T,JSON.stringify({groupId:e}),t),[4,lr.create("joinGroup").validate("groupId",e,St,!0).fail(exports.ErrorCode.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(B.A_JOIN_GROUP_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_INVITE_USERS_TO_GROUP_T,JSON.stringify({groupId:e,userIds:t}),r),[4,lr.create("inviteUsersToGroup").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,30,At,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.inviteUsersToGroup(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t}),r),[4,lr.create("acceptGroupInvite").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.memberInviteResponse({groupId:e,inviterId:t,optType:exports.GroupOperationRole.APPLICANT,optResult:exports.GroupOperationStatus.ACCEPT})}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t,reason:r}),n),[4,lr.create("refuseGroupInvite").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("reason",r,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,inviterId:t,optType:exports.GroupOperationRole.APPLICANT,optResult:exports.GroupOperationStatus.REFUSE,reason:r})}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:r}),n),[4,lr.create("acceptGroupApplication").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).validate("inviterId",r,At).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r||"",optType:exports.GroupOperationRole.MANAGER,optResult:exports.GroupOperationStatus.ACCEPT})}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:r,reason:n}),i),[4,lr.create("refuseGroupApplication").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).validate("inviterId",r,At).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("reason",n,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return a.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r||"",optType:exports.GroupOperationRole.MANAGER,optResult:exports.GroupOperationStatus.REFUSE,reason:n})}))];case 1:return o=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_APPLICATIONS_T,JSON.stringify({option:e,directions:t,status:r}),n),i=this.ctx.usingCppEngine,[4,lr.create("getGroupApplications").check((function(t){return FE(t,200,!0,e,!0)})).check((function(e){i&&e.isLimitedTypedArray("directions",t,Object.keys(exports.GroupApplicationDirection).length,(function(t){return!e.isNumberEnum("directions",t,exports.GroupApplicationDirection,!0).isFailed}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION).isLimitedTypedArray("status",r,Object.keys(exports.GroupApplicationStatus).length,(function(t){return!e.isNumberEnum("status",t,exports.GroupApplicationStatus,!0).isFailed}),!0,1).fail(exports.ErrorCode.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 a.svr.getGroupApplications(n,t||[],r||[])}))];case 1:return o=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_JOINED_GROUPS_BY_ROLES_T,JSON.stringify({role:e,option:t}),r),[4,lr.create("getJoinedGroupsByRole").isNumberEnum("role",e,exports.GroupMemberRole,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_MEMBER_ROLE).check((function(e){return FE(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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_JOINED_GROUPS_T,JSON.stringify({groupName:e,option:t}),r),[4,lr.create("searchJoinedGroups").isLimitedString("groupName",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_NAME).check((function(e){return FE(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=o.sent(),this.logger.summary(B.A_SEARCH_JOINED_GROUPS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_JOINED_GROUPS_T,JSON.stringify({groupIds:e}),t),[4,lr.create("getJoinedGroups").isLimitedTypedArray("groupIds",e,20,St,!0,1).fail(exports.ErrorCode.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(B.A_GET_JOINED_GROUPS_R,r,t),[2,r]}}))}))}}),r}(xE),HE=0,qE=function(e){function r(t,r,i){var o=e.call(this,i)||this;return Object.defineProperty(o,"_svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),NE.set(o,void 0),PE.set(o,!1),LE.set(o,!0),ME.set(o,""),Object.defineProperty(o,"_id",{enumerable:!0,configurable:!0,writable:!0,value:++HE}),d(o,NE,n(n({},t),{tagFilter:n({},t.tagFilter)}),"f"),o}return t(r,e),Object.defineProperty(r.prototype,"hasMore",{get:function(){return c(this,LE,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isLoading",{get:function(){return c(this,PE,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"load",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return c(this,PE,"f")?[2,ur(exports.ErrorCode.METHOD_BUSY)]:(d(this,PE,!0,"f"),t=this.logger.createTraceId(),this.logger.info(B.A_LOAD_CONVERSATION_LIST_T,JSON.stringify({count:e,loaderId:this._id,pageToken:c(this,ME,"f")}),t),[4,lr.create("ConversationListLoader.load").isLimitedInteger("count",e,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){return u._svr.loadConversationList(c(u,ME,"f"),e,c(u,NE,"f"))}))]);case 1:return r=s.sent(),this.logger.summary(B.A_LOAD_CONVERSATION_LIST_R,r,t,{loaderId:this._id},(function(e){return{pageToken:e.pageToken,finished:e.finished}})),d(this,PE,!1,"f"),r.isOk?(n=r.data,i=n.pageToken,o=n.finished,a=n.list,d(this,ME,i,"f"),d(this,LE,!o,"f"),[2,ar(a)]):[2,r.wipe()]}}))}))}}),r}(xE);NE=new WeakMap,PE=new WeakMap,LE=new WeakMap,ME=new WeakMap;var YE,WE,JE,KE,QE,XE,ZE,zE,$E,eb=function(e){function r(t,r){var n=e.call(this,t)||this;return wE.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SAVE_EDITED_MSG_DRAFT_T,JSON.stringify({draft:e,identifier:t}),r),[4,lr.create("saveEditedMessageDraft").check((function(e){return Kl(e,t,Z)})).isString("draft",null==e?void 0:e.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DRAFT).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateLogin).next((function(){return i.svr.saveEditedMessageDraft(e,c(i,wE,"m",DE).call(i,t))}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,lr.create("getEditedMessageDraft").check((function(t){return Kl(t,e,Z)})).result().next((function(){return n.svr.getEditedMessageDraft(c(n,wE,"m",DE).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,lr.create("clearEditedMessageDraft").check((function(t){return Kl(t,e,Z)})).result().next((function(){return n.svr.clearEditedMessageDraft(c(n,wE,"m",DE).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return r=(t=e||{}).conversationTypes,i=t.order,o=t.channelId,a=t.tagFilter,[4,lr.create("createConversationListLoader").isTypedArray("conversationTypes",r,(function(e){return te(e,W)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("order",i,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).validate("channelId",o,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).check((function(e){if(a){var t=a.tagIds;e.isLimitedTypedArray("tagIds",t,20,Et,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID)}})).result().tryTrans(this.validateConnected).trans((function(){return new qE(n(n({},e),{tagFilter:n({},a)}),u.svr,u.ctx)}))];case 1:return[2,s.sent()]}}))}))}}),Object.defineProperty(r.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.conversationType,this.logger.info(B.A_SEND_UG_TYPING_T,JSON.stringify(e),t),[4,lr.create("sendUltraGroupTypingStatus").check((function(t){return Kl(t,e,X)})).validate("conversationType",r,(function(){return r===exports.ConversationType.ULTRA_GROUP}),!0).fail(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT).result().tryTrans(this.validateConnected).next((function(){var t=c(i,wE,"m",DE).call(i,e);return i.svr.sendUltraGroupTypingStatus(t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_TYPING_STATUS_T,JSON.stringify({identifier:e,typingContentType:t}),r),[4,lr.create("sendTypingStatus").check((function(t){return Kl(t,e,W)})).isString("typingContentType",t,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SYNC_READ_STATUS_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,lr.create("sendSyncReadStatusMessage").check((function(t){return Kl(t,e,W)})).isNumber("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(n){return o(i,void 0,void 0,(function(){var i;return s(this,(function(o){switch(o.label){case 0:return 1===n.sesDriven?[2,this.svr.updateConversationReadTime(e,t)]:(i={messageType:me.SYNC_READ_STATUS,content:{lastMessageSendTime:t},directionalUserIdList:[this.ctx.userId]},[4,this.ctx.sendMessage(e,i,r)]);case 1:return[2,o.sent().wipe()]}}))}))}))];case 1:return n=a.sent(),this.logger.summary(B.A_SYNC_READ_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_UNREAD_COUNT_BY_TIME_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,lr.create("clearUnreadCountByTimestamp").check((function(t){return Kl(t,e,W)})).isTimestamp("timestamp",t).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i.svr.clearUnreadCountByTimestamp(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_REQ_T,JSON.stringify({identifier:e,messageUId:t}),r),[4,lr.create("sendReadReceiptRequest").check((function(t){return Kl(t,e,z)})).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(){var n={messageType:me.READ_RECEIPT_REQUEST,content:{messageUId:t}};return i.ctx.sendMessage(e,n,r)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageUId:t,timestamp:r}),n),[4,lr.create("sendReadReceiptMessage").check((function(t){return Kl(t,e,$)})).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("timestamp",r,1,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var i={messageType:me.READ_RECEIPT,content:{messageUId:t,lastMessageSendTime:r,type:1}};return o.ctx.sendMessage(e,i,n)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageList:t}),r),[4,lr.create("sendReadReceipt").check((function(t){return Kl(t,e,z)})).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).check((function(e){bt(t)&&!Object.keys(t).some((function(r){var n=t[r];return e.isLimitedTypedArray("messageList",n,Number.MAX_SAFE_INTEGER,Et,!0).isFailed}))||e.setFailed(exports.ErrorCode.MSG_LIMIT_ERROR)})).result().tryTrans(this.validateConnected).next((function(n){return o(i,void 0,void 0,(function(){var i,o;return s(this,(function(s){switch(s.label){case 0:return 0!==(i=n.grpRRVer||0)&&1!==i?[2,ur(exports.ErrorCode.READ_RECEIPT_ERROR)]:1===i?(o=[],Object.keys(t).forEach((function(e){o.push.apply(o,l([],u(t[e]),!1))})),[2,this.svr.sendReadReceiptV2(e.targetId,o,e.channelId)]):[4,this.ctx.sendMessage(e,{messageType:me.READ_RECEIPT_RESPONSE,content:{receiptMessageDic:t}},r)];case 1:return[2,s.sent().wipe()]}}))}))}))];case 1:return n=a.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_MSG_READER_T,JSON.stringify({targetId:e,messageUId:t,channelId:r}),n),[4,lr.create("getMessageReader").validate("targetId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return o(a,void 0,void 0,(function(){return s(this,(function(i){return 1!==n.grpRRVer?[2,ur(exports.ErrorCode.READ_RECEIPT_ERROR)]:[2,this.svr.getMessageReader(e,t,r||"")]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_MSG_READER_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,endMsgUid:t,startMsgUid:r}),n),[4,lr.create("sendReadReceiptMessageV4").check((function(t){return Kl(t,e,W)})).isNotEmptyString("endMsgUid",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_END_MESSAGE_UID).isNotEmptyString("startMsgUid",r).fail(exports.ErrorCode.INVALID_PARAMETER_START_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(n){return o(a,void 0,void 0,(function(){return s(this,(function(i){return 3!==n.grpRRVer?[2,ur(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.sendReadReceiptMessageV4(e,r||"",t)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_V4_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,messageUId:t}),r),[4,lr.create("getMessageReadReceiptV4").check((function(t){return Kl(t,e,z)})).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){return s(this,(function(n){return 3!==r.grpRRVer?[2,ur(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.getMessageReadReceiptV4(e,t)]}))}))}))];case 1:return n=a.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_GET_READ_RECEIPT_INFO_V4_T,JSON.stringify({conversation:e,messageUIds:t}),r),[4,lr.create("batchGetMessageReadReceiptInfoV4").check((function(t){return Kl(t,e,z)})).isTypedArray("messageUIds",t,Et,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){return s(this,(function(n){return 3!==r.grpRRVer?[2,ur(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}))];case 1:return n=a.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T,JSON.stringify({options:e}),t),[4,lr.create("getConversationsIncludingRobots").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,2,(function(e){return[exports.ConversationType.PRIVATE,exports.ConversationType.SYSTEM].includes(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R,r,t),[2,r]}}))}))}}),r}(xE);function tb(e){return n({},e)}wE=new WeakSet,UE=function(e){var t;return!!(2&((null===(t=this.ctx.naviInfo)||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e},DE=function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP?e:n(n({},e),{channelId:c(this,wE,"m",UE).call(this,e.channelId)})};var rb=function(){function e(e){var t,r,i=this;YE.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,"_ugSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[me.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),t[me.INTERCEPT]=this._processInterceptMessage.bind(this),t)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(r={},r[me.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),r[me.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),r[me.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 o={onConnected:function(){return i._onConnectionStatusChange(exports.RCConnectionStatus.CONNECTED)},onConnecting:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.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)},s=Ot();this._engine=s?new RCCppEngine(o,this._options):new OE(o,this._options),this.logger=this._engine.logger,this._options.eventLoopBlockingCheck&&Zr.start(this.logger),this.sse=new Vl(this,s),this.chatroom=new GE(this._engine,this._engine.chatroom),this.dataHosting=new BE(this._engine,this._engine.dataHosting),this.chat=new eb(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(B.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(B.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(B.L_IMSDK_VER_O,JSON.stringify({commitId:"3a2c6fc3b07dfb5651302458dffca3edfc17abc8",version:"5.32.0"}));var r=this._context._engine;return Xo.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 o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(B.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(B.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),r),this._pluginInstanseMap[e.tag])return this.logger.warn(B.L_INSTALL_PLUGIN_R,"repeat install",r),this._pluginInstanseMap[e.tag];var n="RCRTC"===e.tag?new Bl(this):new Fl(this),i=null;try{if(!e.verify(Xo))return null;i=e.setup(n,Xo,t)}catch(e){this.logger.error(B.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 CE(e)}))}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;this._ugSynced=!1,this.logger.warn(B.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(tb(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===exports.ConversationType.ULTRA_GROUP){var r=e.content.sourceType;if(t.sourceType=r,(r===exports.MessageBlockSourceType.MSG_EXPANSION||r===exports.MessageBlockSourceType.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(B.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,o,s,a=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(tb(e))}catch(e){return a.logger.error(B.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(s=(o=this._watcher).message)||void 0===s||s.call(o,tb(e),t,r),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=[],o=[],s=[me.READ_RECEIPT,me.READ_RECEIPT_REQUEST,me.READ_RECEIPT_RESPONSE];e.forEach((function(e){var a=n._messageReceiver(e,t,r);a&&s.includes(a.messageType)?o.push(a):a&&i.push(a)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(B.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.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(B.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;this._ugSynced=!0,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(B.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(B.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(B.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(B.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(B.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]=Tt(n)||bt(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,o=e.channelId,s=i.typingContentType,a=o||"",u="".concat(r,"#").concat(n,"#").concat(a);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===s?this._typingInfo[u][l].timestamp=Date.now():(l>=0&&this._typingInfo[u].splice(l,1),this._typingInfo[u].push({userId:t,messageType:s,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?ur(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE):ar(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===exports.RCConnectionStatus.CONNECTED||this._engine.userId&&e?ar(this._engine.naviInfo):ur(exports.ErrorCode.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 o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,c(this,YE,"m",WE).call(this,e,t,r)];case 1:return n=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){return s(this,(function(r){return this.logger.info(B.A_DISCONNECT_O,JSON.stringify({closeDB:e,disablePush:t})),[2,c(this,YE,"m",JE).call(this,e,t)]}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_RECONNECT_T,JSON.stringify({reconnectKickEnable:e}),t),[4,c(this,YE,"m",WE).call(this,this.token,!!e,t)];case 1:return r=n.sent(),this.logger.summary(B.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!==exports.ConversationType.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,o){void 0===i&&(i=[]),void 0===o&&(o=!1);var s,a,u,l={isPersited:t,isCounted:r,searchProps:i,isStatusMessage:o};s=e,a=l,(u=ln.get(s))&&!u.isCustom&&console.warn("Builtin message type '".concat(s,"' cannot be registered")),a.isStatusMessage&&(a.isCounted=a.isPersited=!1),ln.set(s,n(n({},a),{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,"innerSendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.L_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),n),[4,c(this,YE,"m",QE).call(this,e,t,n,r)];case 1:return i=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),n),[4,c(this,YE,"m",QE).call(this,e,t,n,r)];case 1:return i=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,i,o=this;return s(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MSG_EXPANSION_T,JSON.stringify({expansion:e,attrs:t}),r),[4,lr.create("updateMessageExpansion").check((function(r){return Ql(r,t,Object.keys(e||{}))})).check((function(r){return Xl(r,e,t.canIncludeExpansion)})).result().tryTrans(this.validateConnected).next((function(){var i={put:e,mid:t.messageUId},s=n(n({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===exports.ConversationType.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(s,i,t.sentTime):c(o,YE,"m",ZE).call(o,s,i,r)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,i,o=this;return s(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_MSG_EXPANSION_T,JSON.stringify({keys:e,attrs:t}),r),[4,lr.create("removeMessageExpansion").isLimitedTypedArray("keys",e,20,(function(e){return"string"==typeof e&&/^[A-Za-z0-9_=+-]+$/.test(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYS).check((function(r){return Ql(r,t,e)})).result().tryTrans(this.validateConnected).next((function(){var i={del:e,mid:t.messageUId},s=n(n({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===exports.ConversationType.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(s,i,t.sentTime):c(o,YE,"m",ZE).call(o,s,i,r)}))];case 1:return i=s.sent(),this.logger.summary(B.A_REMOVE_MSG_EXPANSION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeAllMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_ALL_MSG_EXPANSION_T,JSON.stringify({attrs:e}),t),[4,lr.create("removeAllMessageExpansion").check((function(t){return Ql(t,e,[])})).check((function(t){e.conversationType!==exports.ConversationType.ULTRA_GROUP&&t.setFailed(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){var r={clear:1,mid:e.messageUId},o=n(n({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)});return e.conversationType===exports.ConversationType.ULTRA_GROUP?i._engine.chat.updateUGMessageExpansion(o,r,e.sentTime):c(i,YE,"m",ZE).call(i,o,r,t)}))];case 1:return r=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=n||this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_V2_T,JSON.stringify({targetId:e,messageUIds:t,channelId:r}),n),[4,lr.create("sendReadReceiptV2").validate("targetId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("messageUIds",t,Number.MAX_SAFE_INTEGER,Et,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return o(a,void 0,void 0,(function(){return s(this,(function(i){return 1!==n.grpRRVer?[2,ur(exports.ErrorCode.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 i=u.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_V2_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"_destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){switch(t.label){case 0:return Zr.stop(),this._resetWatcher(),this._engine.destroy(),Xo.removeNetworkStatusListener(),[4,c(this,YE,"m",JE).call(this)];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(B.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 o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.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,a=this.logger.createTraceId(),this.logger.info(B.A_GET_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),a),[4,lr.create("getHistoryMessage").check((function(t){return Kl(t,e,Q)})).isLimitedInteger("timestamp",r,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isLimitedInteger("count",n,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isNotEmptyString("messageType",o).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:r||0,count:n||20,order:i||0,messageType:o||""},s=c(l,YE,"m",KE).call(l,e);return l._engine.getHistoryMessage(s,t,!0)}))];case 1:return u=s.sent(),this.logger.summary(B.A_GET_HISTORY_MSG_R,u,a),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_CONTINUOUS_MSGS_T,JSON.stringify({conversation:e,options:t}),r),[4,lr.create("getContinuousMessages").check((function(t){return Kl(t,e,J)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateLogin).next((function(){var r=c(i,YE,"m",KE).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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_HIS_MSGS_BY_OBJ_NAMES_T,JSON.stringify({conversation:e,option:t}),r),[4,lr.create("getHistoryMessagesByObjectNames").check((function(t){return Kl(t,e,X)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isTypedArray("messageTypes",null==t?void 0:t.messageTypes,Et).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateLogin).next((function(){var r=c(i,YE,"m",KE).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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_TOP_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e,channelId:t}),r),[4,lr.create("getTopConversationList").isTypedArray("conversationTypes",e,(function(e){return te(e,K)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",t,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=Mg(r))&&!this._ugSynced?[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTopConversationList(n,e,t)]}))}))}))];case 1:return n=a.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e}),t),[4,lr.create("getUnreadConversationList").isTypedArray("conversationTypes",e,(function(e){return te(e,K)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).next((function(t){return o(n,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=Mg(t))&&!this._ugSynced?[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getUnreadConversationList(r,e)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_UNREAD_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLOCKED_CONVERSATION_LIST_T,"",e),[4,lr.create("getBlockedConversationList").result().tryTrans(this.validateConnected).next((function(e){return o(r,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=Mg(e))&&!this._ugSynced?[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getBlockedConversationList(t)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){switch(n.label){case 0:return[4,lr.create("getConversationListByPageIndex").isInteger("index",e,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",t,!0).fail(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_ALL_CONVERSATION_LIST_T,JSON.stringify({channelId:e}),t),[4,lr.create("getAllConversationList").validate("channelId",e,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateLogin).next((function(t){return o(n,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=Mg(t))&&!this._ugSynced?[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getAllConversationList(r,e)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_LIST_OLD_T,JSON.stringify(e),t),[4,Ot()&&"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(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_LIST_BY_TIME_T,JSON.stringify(e),t),[4,lr.create("getConversationListByTimestamp").isObject("params",e,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"params must be an object").isInteger("startTime",null==e?void 0:e.startTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).isInteger("count",null==e?void 0:e.count,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==e?void 0:e.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).validate("channelId",null==e?void 0:e.channelId,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,(function(e){return te(e,K)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans((function(){return n.checkAuthed(Ot())})).next((function(t){return o(n,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=Mg(t))&&!this._ugSynced?[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getConversationListByTimestamp(e,r)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_T,JSON.stringify(e),t),[4,lr.create("getConversation").check((function(t){return Kl(t,e,Q)})).result().tryTrans(this.validateConnected).next((function(){var t=c(n,YE,"m",KE).call(n,e);return n._engine.chat.getConversation(t)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CONVERSATION_T,JSON.stringify(e),r),[4,lr.create("removeConversation").check((function(t){return Kl(t,e,K)})).result().tryTrans(this.validateConnected).next((function(){var r=c(i,YE,"m",KE).call(i,e);return i._engine.chat.batchDeleteConversations({identifiers:[r],deleteRemotely:!!t,deleteMessages:!1})}))];case 1:return n=o.sent(),this.logger.summary(B.A_REMOVE_CONVERSATION_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,a,u=this;return s(this,(function(l){switch(l.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),i=this.logger.createTraceId(),this.logger.info(B.A_BATCH_DEL_CONVERS_T,JSON.stringify({identifiers:t,deleteRemotely:r,deleteMessages:n}),i),[4,lr.create("batchDeleteConversations").isLimitedArray("identifiers",t,100,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans(this.validateConnected).next((function(){return o(u,void 0,void 0,(function(){var e,i=this;return s(this,(function(o){return 0===(e=t.filter((function(e){return Jl("",e,K).result().isOk})).map((function(e){return c(i,YE,"m",KE).call(i,e)}))).length?[2,ar()]:[2,this._engine.chat.batchDeleteConversations({identifiers:e,deleteRemotely:r,deleteMessages:n})]}))}))}))];case 1:return a=l.sent(),this.logger.summary(B.A_BATCH_DEL_CONVERS_R,a,i),[2,a.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,a=this;return s(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(B.A_GET_UG_LIST_T,JSON.stringify({targetId:t,channelType:r}),n),[4,lr.create("getUltraGroupList").validate("targetId",t,At).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNumberEnum("channelType",r,exports.UltraGroupChannelType).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_TYPE).result().tryTrans(this.validateLogin).next((function(){return o(a,void 0,void 0,(function(){return s(this,(function(t){return this._ugSynced?[2,this._engine.chat.getUltraGroupList(e)]:[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_UG_LIST_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLOCKED_UG_LIST_T,"",e),[4,lr.create("getBlockedUGList").result().tryTrans(this.validateConnected).next((function(){return o(r,void 0,void 0,(function(){return s(this,(function(e){return this._ugSynced?[2,this._engine.chat.getBlockedUGList()]:[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_BLOCKED_UG_LIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_UNREAD_COUNT_T,JSON.stringify(e),t),[4,lr.create("clearUnreadCount").check((function(t){return Kl(t,e,X)})).result().tryTrans((function(){return n.checkAuthed(e.conversationType!==exports.ConversationType.ULTRA_GROUP)})).next((function(){return o(n,void 0,void 0,(function(){var t;return s(this,(function(r){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._ugSynced?(t=c(this,YE,"m",KE).call(this,e),[2,this._engine.chat.clearConversationUnreadCount(t)]):[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_CLEAR_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_ALL_UNREAD_COUNT_T,null,e),[4,lr.create("clearAllUnreadCount").result().tryTrans(this.validateLogin).next((function(){return o(r,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.chat.clearAllSGUnreadCount()]}))}))}))];case 1:return t=n.sent(),this.logger.summary(B.A_CLEAR_ALL_UNREAD_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_COUNT_T,JSON.stringify(e),t),[4,lr.create("getUnreadCount").check((function(t){return Kl(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){return o(n,void 0,void 0,(function(){var t;return s(this,(function(r){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._ugSynced?(t=c(this,YE,"m",KE).call(this,e),[2,this._engine.chat.getConversationUnreadCount(t)]):[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_TOTAL_UNREAD_COUNT_T,JSON.stringify({conversationTypes:e,includeMuted:t,channelId:r}),n),[4,lr.create("getTotalUnreadCount").validate("channelId",r,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",e,(function(e){return te(e,X)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin).next((function(n){return o(a,void 0,void 0,(function(){var i,o;return s(this,(function(s){return!(i=Mg(n))&&e&&e.includes(exports.ConversationType.ULTRA_GROUP)?[2,ur(exports.ErrorCode.METHOD_NOT_SUPPORT)]:(o=e&&e.length>0?e:ee(i?K:W)).includes(exports.ConversationType.ULTRA_GROUP)&&!this._ugSynced?[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCount(o,!!t,r)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_TOTAL_UNREAD_COUNT_R,i,n,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T,JSON.stringify({conversationTypes:e,levels:t,isMentioned:r}),n),[4,lr.create("getTotalUnreadCountByLevels").isLimitedTypedArray("conversationTypes",e,20,(function(e){return te(e,K)}),!0).fail(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT).isTypedArray("levels",t,mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return o(a,void 0,void 0,(function(){return s(this,(function(n){return e.includes(exports.ConversationType.ULTRA_GROUP)&&!this._ugSynced?[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCountByLevels(e,t,r)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R,i,n,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FIRST_UNREAD_MEG_T,JSON.stringify(e),t),[4,lr.create("getFirstUnreadMessage").check((function(t){return Kl(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(n,YE,"m",KE).call(n,e);return n._engine.chat.getFirstUnreadMessage(t)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,lr.create("getFirstUnreadMessageDigest").check((function(t){return Kl(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(n,YE,"m",KE).call(n,e);return n._engine.chat.getFirstUnreadMessageDigest(t)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:t}),r),[4,lr.create("batchSetConversationNotificationLevel").isLimitedTypedArray("conversations",e,20,(function(e){return!Jl("batchSetConversationNotificationLevel",e,K).isFailed}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("notificationLevel",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var r=e.map((function(e){return c(i,YE,"m",KE).call(i,e)}));return i._engine.chat.batchSetConversationNotificationLevel(r,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return i=lr.create("batchSetConversationToTop"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return Jl("batchSetConversationToTop",e,K).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?ar():ur(exports.ErrorCode.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(a=this.logger.createTraceId(),u=e.map((function(e){return c(d,YE,"m",KE).call(d,e)})),this.logger.info(B.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:u,isTop:t,isUpdateTime:r,isCreateConversation:n}),a),[4,this._engine.chat.batchSetConversationToTop(u,t,r,n)]):[2,o.wipe()];case 1:return l=s.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_TO_TOP_R,l,a),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return r=lr.create("batchSetConversationTranslateStrategy"),(n=r.isLimitedTypedArray("conversations",e,20,(function(e){return Jl("",e,K).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("strategy",t,Tn,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_STRATEGY).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),this.logger.info(B.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T,JSON.stringify({conversations:e,strategy:t}),i),o=e.map((function(e){return c(u,YE,"m",KE).call(u,e)})),[4,this._engine.chat.batchSetConversationTranslateStrategy(o,t)]):[2,n.wipe()];case 1:return a=s.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R,a,i),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){switch(n.label){case 0:return[4,Jl("saveTextMessageDraft",e,X).isString("draft",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DRAFT).result().tryTrans(this.validateLogin).next((function(){var n=c(r,YE,"m",KE).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 o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){switch(r.label){case 0:return[4,Jl("getTextMessageDraft",e,X).result().tryTrans(this.validateLogin).next((function(){var r=c(t,YE,"m",KE).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 o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){switch(r.label){case 0:return[4,Jl("clearTextMessageDraft",e,X).result().tryTrans(this.validateLogin).next((function(){var r=c(t,YE,"m",KE).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 o(this,void 0,void 0,(function(){var r,n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),n={conversation:e,messageUId:null==t?void 0:t.messageUId},this.logger.info(B.A_RECALL_MESSAGE_T,JSON.stringify(n),r),[4,lr.create("recallMessage").check((function(t){return Kl(t,e,Q)})).isNotEmptyString("messageUId",t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",t.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",t.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,At,!1,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){var r=c(o,YE,"m",KE).call(o,e);return o._engine.recallMsg(r,t)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DEL_REMOTE_MSGS_T,JSON.stringify({conversation:e,messages:t}),r),[4,lr.create("deleteRemoteMessage").check((function(t){return Kl(t,e,K)})).isLimitedTypedArray("messages",t,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,r=e.sentTime,n=e.messageDirection;return Et(t)&&(n===exports.MessageDirection.SEND||n===exports.MessageDirection.RECEIVE)&&pt({min:0})(r)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=c(i,YE,"m",KE).call(i,e);return i._engine.chat.deleteRemoteMessage(r,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DEL_REMOTE_MSGS_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,lr.create("deleteRemoteMessageByTimestamp").check((function(t){return Kl(t,e,Q)})).isInteger("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var r=c(i,YE,"m",KE).call(i,e);return i._engine.chat.deleteRemoteMessageByTimestamp(r,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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,i,a){return o(this,void 0,void 0,(function(){var u=this;return s(this,(function(l){return[2,lr.create("getFileToken").isNumberEnum("fileType",e,exports.FileType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).validate("httpMethod",r,(function(e){return"POST"===e||"PUT"===e})).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`httpMethod` is invalid").isString("queryString",n).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`queryString` is invalid").isString("url",i).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`url` is invalid").isInteger("size",a).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`size` is invalid").result().tryTrans(this.validateConnected).next((function(l){return o(u,void 0,void 0,(function(){var o,u;return s(this,(function(s){switch(s.label){case 0:return o=l.uploadServer||"",u=l.ossConfig||"",[4,this._engine.getFileToken(e,t,r,n,i,a)];case 1:return[2,s.sent().trans((function(e){return Object.assign(e,{qiniu:o,ossConfig:e.ossConfig||u})}))]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i=this;return s(this,(function(o){switch(o.label){case 0:return[4,lr.create("getFileUrl").isNumberEnum("fileType",e,exports.FileType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).isString("saveName",n).fail(exports.ErrorCode.INVALID_PARAMETER_SAVE_NAME).isNumberEnum("serverType",r,exports.UploadMethod,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SERVER_TYPE).result().tryTrans(this.validateConnected).next((function(){return i._engine.getFileUrl(e,r,t,n||"")}))];case 1:return[2,o.sent()]}}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ADD_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,lr.create("createTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.createTag(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_ADD_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_TAG_T,JSON.stringify({tagId:e}),t),[4,lr.create("removeTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeTag(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_REMOVE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,lr.create("updateTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.updateTag(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_UPDATE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_TAGS_T,"",e),[4,this.validateLogin().next((function(){return r._engine.getTagList()}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_TAGS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return(r=lr.create("addTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isTypedArray("conversations",t,(function(e){return Jl("",e,W).result().isOk}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS).isLimitedInteger("conversations",null==t?void 0:t.length,1,1e3,!0).fail(exports.ErrorCode.CONVER_OUT_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(n=t.map((function(e){return c(a,YE,"m",KE).call(a,e)})),i=this.logger.createTraceId(),this.logger.info(B.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return(r=lr.create("removeTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedTypedArray("conversations",t,1e3,(function(e){return Jl("",e,W).result().isOk}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS).result().tryTrans(this.validateConnected)).isOk?(n=t.map((function(e){return c(a,YE,"m",KE).call(a,e)})),i=this.logger.createTraceId(),this.logger.info(B.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return(r=Jl("removeTagsForConversation",e,W).isTypedArray("tagIds",t,(function(e){return _t(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected)).isOk?(n=this.logger.createTraceId(),i=c(this,YE,"m",KE).call(this,e),this.logger.info(B.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){return(n=lr.create("getConversationListByTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isInteger("count",r,!0).fail(exports.ErrorCode.CONVER_OUT_LIMIT_ERROR).isLimitedInteger("startTime",t,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).result().tryTrans((function(){return o.checkAuthed(Ot())}))).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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_COUNT_BY_TAG_T,JSON.stringify({tagId:e,containMuted:t}),r),[4,lr.create("getUnreadCountByTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isBoolean("containMuted",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONTAIN_MUTED).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.getUnreadCountByTag(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return(n=Jl("setConversationStatusInTag",t,W).isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isBoolean("isTop",null==r?void 0:r.isTop,!0).fail(exports.ErrorCode.INVALID_PARAMETER_IS_TOP).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),o=c(this,YE,"m",KE).call(this,t),this.logger.info(B.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 a=s.sent(),this.logger.summary(B.A_SET_CONVER_TO_TOP_IN_TAG_R,a,i),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return(t=Jl("getTagsForConversation",e,W).result().tryTrans(this.validateLogin)).isOk?(r=this.logger.createTraceId(),n=c(this,YE,"m",KE).call(this,e),this.logger.info(B.A_GET_TAGS_OF_CONVERSATION_T,JSON.stringify(n),r),[4,this._engine.chat.getTagsForConversation(n)]):[2,t.wipe()];case 1:return i=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTIONED_COUNT_T,JSON.stringify(e),t),[4,lr.create("getUnreadMentionedCount").check((function(t){return Kl(t,e,Z)})).result().tryTrans(this.validateLogin).next((function(){return o(n,void 0,void 0,(function(){var t;return s(this,(function(r){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._ugSynced?(t=c(this,YE,"m",KE).call(this,e),[2,this._engine.chat.getUnreadMentionedCount(t)]):[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_UNREAD_MENTIONED_COUNT_R,r,t),[2,r.trans(Ec)]}}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.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(B.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 o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.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,a=null==e?void 0:e.channelId,this.logger.info(B.A_GET_UG_MSGS_BY_UID_T,JSON.stringify({conversationType:i,targetId:o,channelId:a,messageUIds:n}),r),[4,lr.create("getUltraGroupMessageListByMessageUId").check((function(t){return Kl(t,e,K)})).isTypedArray("messages",t,(function(e){return Et(null==e?void 0:e.messageUId)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messages",null==t?void 0:t.length,1,20,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=c(l,YE,"m",KE).call(l,e);return l._engine.chat.getRemoteMessagesByUIds(r,t.map((function(e){return e.messageUId})))}))];case 1:return u=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T,JSON.stringify({targetId:e,levels:r,isGetMentioned:t}),n),[4,lr.create("getUGUnreadCountForAllChannels").validate("targetId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).check((function(e){e.isTypedArray("levels",r,(function(t){return!e.isNumberEnum("",t,exports.NotificationLevel,!0).isFailed}))})).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return o(a,void 0,void 0,(function(){return s(this,(function(n){return this._ugSynced?[2,this._engine.chat.getUGUnreadCountForAllChannels(e,r||[],t)]:[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u=this;return s(this,(function(s){switch(s.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(B.A_GET_UG_UNREAD_MENTIONED_DIGEST_T,JSON.stringify({targetId:t,channelId:r,sentTime:n,count:i}),o),[4,lr.create("getUGUnreadMentionedDigest").validate("targetId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedInteger("count",i,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("sentTime",n,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return e.channelId=u._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r),u._engine.chat.getUGUnreadMentionedDigest(e)}))];case 1:return a=s.sent(),this.logger.summary(B.A_GET_UG_UNREAD_MENTIONED_DIGEST_R,a,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i=this;return s(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,lr.create("getUGFirstUnreadMessageDigest").validate("targetId",null==e?void 0:e.targetId,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==e?void 0:e.channelId,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){return o(i,void 0,void 0,(function(){var t;return s(this,(function(r){return this._ugSynced?(t=c(this,YE,"m",KE).call(this,n(n({},e),{conversationType:exports.ConversationType.ULTRA_GROUP})),[2,this._engine.chat.getUGFirstUnreadMessageDigest(t)]):[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=a.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_INFO_LIST_T,JSON.stringify({targetIds:e}),t),[4,lr.create("getUGUnreadInfoList").isLimitedTypedArray("targetIds",e,20,(function(e){return At(e)}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateLogin).next((function(){return o(n,void 0,void 0,(function(){var t;return s(this,(function(r){return this._ugSynced?(t=new Set(e),[2,this._engine.chat.getUGUnreadInfoList(Array.from(t))]):[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.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 exports.SubscribeType.ONLINE_STATUS:return 1&n?ar(e):ur(exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);case exports.SubscribeType.USER_PROFILE:return 2&n?ar(e):ur(exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);default:return ur(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE)}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t,expiry:r}),n),[4,lr.create("subscribeUser").isLimitedTypedArray("userIds",e,200,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("expiry",r,60,2592e3,!0).fail(exports.ErrorCode.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_UNSUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t}),r),[4,lr.create("unSubscribeUser").isLimitedTypedArray("userIds",e,200,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,exports.SubscribeType,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_SUBSCRIBE_USER_STATUS_LIST_T,JSON.stringify({subscribeType:e,count:t,offset:r}),n),[4,lr.create("getSubscribeUserList").isNumberEnum("subscribeType",e,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("count",t,1,200,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE).isLimitedInteger("offset",r,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_SUB_USERS_STATUS_T,JSON.stringify({subscribeType:e,userIds:t}),r),[4,lr.create("getSubscribeUserStatus").isNumberEnum("subscribeType",e,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedTypedArray("userIds",t,200,At,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_SUB_USERS_ONLINE_STATUS_T,JSON.stringify({userIds:e}),t),[4,lr.create("getSubscribeUsersOnlineStatus").isLimitedTypedArray("userIds",e,200,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){return n._engine.getSubscribeUsersOnlineStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MY_USER_PROFILE_T,JSON.stringify({profile:e}),t),[4,lr.create("updateMyUserProfile").isObject("profile",e,!0).check((function(t){var r=e.name,n=e.portraitUri,i=e.email,o=e.birthday,s=e.gender,a=e.location,l=e.role,c=e.level,d=e.extraProfile;t.isString("name",r).isString("portraitUri",n).isString("email",i).isString("birthday",o).isNumber("gender",s).isString("location",a).isNumber("role",l).isNumber("level",c).isObject("extraProfile",d),!t.isFailed&&d&&Object.entries(d).forEach((function(e){var r=u(e,2);r[0];var n=r[1];t.isString("extraProfile",n,!0)}))})).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_USER_PROFILES_T,JSON.stringify({userIds:e}),t),[4,lr.create("getUserProfiles").isLimitedTypedArray("userIds",e,100,At,!0).fail(exports.ErrorCode.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(B.A_GET_USER_PROFILES_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_MY_USER_PROFILE_T,void 0,e),[4,lr.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(B.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 o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.chat.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){r.logger.error(B.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ADD_TO_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,lr.create("addToBlacklist").validate("userId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.addToBlacklist(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_ADD_TO_BLACKLIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_FROM_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,lr.create("removeFromBlacklist").validate("userId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeFromBlacklist(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_REMOVE_FROM_BLACKLIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLACKLIST_T,void 0,e),[4,lr.create("getBlacklist").result().tryTrans(this.validateConnected).next((function(){return r._engine.getBlacklist()}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_BLACKLIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_BLACKLIST_STATUS_T,JSON.stringify({userId:e}),t),[4,lr.create("getBlacklistStatus").validate("userId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.getBlacklistStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_INSERT_MSG_T,JSON.stringify({conversation:e,params:t}),r),[4,lr.create("insertMessage").check((function(t){return Kl(t,e,X)})).validate("senderUserId",t.senderUserId,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isNotEmptyString("messageType",t.messageType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isNumberEnum("messageDirection",t.messageDirection,exports.MessageDirection,!0).fail(exports.ErrorCode.INVALID_MESSAGE_DIRECTION).check((function(e){t.canIncludeExpansion&&t.expansion&&Xl(e,t.expansion,!0)})).isTimestamp("sentTime",t.sentTime).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isNumberEnum("sentStatus",t.sentStatus,exports.SentStatus).fail(exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS).isTypedArray("directedUserIds",t.directedUserIds,At).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isString("searchContent",t.searchContent).fail(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR).result().tryTrans((function(){return Wl(t.messageType,t.content)})).tryTrans(this.validateLogin).next((function(){var r=c(i,YE,"m",KE).call(i,e);return i._engine.insertMessage(r,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_INSERT_MSG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_INSERT_MSGS_T,JSON.stringify({count:null==e?void 0:e.length,checkDuplicate:t}),r),i=lr.create(""),[4,lr.create("batchInsertMessage").isLimitedTypedArray("messages",e,500,(function(e){return"object"==typeof e&&(Kl(i,e,X),i.validate("senderUserId",e.senderUserId,At,!0).isNotEmptyString("messageType",e.messageType,!0).isObject("content",e.content,!0).isNumberEnum("messageDirection",e.messageDirection,exports.MessageDirection,!0).check((function(t){e.canIncludeExpansion&&e.expansion&&Xl(t,e.expansion,!0)})).isTimestamp("sentTime",e.sentTime).isNumberEnum("sentStatus",e.sentStatus,exports.SentStatus).isString("searchContent",e.searchContent).isNumber("receivedStatus",e.receivedStatus).isObject("receivedStatusInfo",e.receivedStatusInfo).isTypedArray("directedUserIds",e.directedUserIds,At),!i.isFailed)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateLogin).next((function(){var r=e.map((function(e){return n(n({},e),{channelId:a._channelIdConvert(e.conversationType,e.channelId)})}));return a._engine.batchInsertMessage(r,t)}))];case 1:return o=s.sent(),this.logger.summary(B.A_BATCH_INSERT_MSGS_R,o,r),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_LOCAL_MSG_COUNT_T,JSON.stringify({conversation:e}),t),[4,lr.create("getMessageCount").check((function(t){return Kl(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(n,YE,"m",KE).call(n,e);return n._engine.getLocalMessageCount(t)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_DELETE_LOCAL_MSGS_T,JSON.stringify({messageIds:e}),t),[4,lr.create("deleteLocalMessages").isTypedArray("messageIds",e,(function(e){return Number.isInteger(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ARRAY).result().tryTrans(this.validateLogin).next((function(){return n._engine.deleteLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_DEL_LOCAL_MSGS_BY_TIME_T,JSON.stringify({conversation:e,timestamp:t,cleanSpace:r}),n),[4,lr.create("deleteLocalMessagesByTimestamp").check((function(t){return Kl(t,e,X)})).isTimestamp("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){var n=c(o,YE,"m",KE).call(o,e);return o._engine.deleteLocalMessagesByTimestamp(n,t,!!r)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T,JSON.stringify({options:e}),t),[4,lr.create("batchClearLocalMessagesByTimestamp").check((function(t){t.isLimitedTypedArray("options",e,20,(function(e){return Kl(t,e,K),!t.isFailed&&pt({min:0})(e.timestamp)})).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),r),[4,lr.create("batchClearRemoteHistoryMessages").isLimitedArray("options",e,20,!0,1).check((function(t){e.forEach((function(e){Kl(t,e,K).isTimestamp("timestamp",null==e?void 0:e.timestamp)}))})).fail(exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,void 0,!0).check((function(t){e.some((function(e){return e.conversationType===exports.ConversationType.ULTRA_GROUP}))&&t.setFailed(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.batchClearRemoteHistoryMessages(e,!!t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_LOCAL_MSG_T,JSON.stringify({conversation:e}),t),[4,lr.create("clearLocalMessages").check((function(t){return Kl(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){return n._engine.clearLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_CLEAR_LOCAL_MSG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),t),[4,lr.create("getLocalMessage").validate("messageId",e,(function(){return Et(e)||ft(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result().next((function(){return n._engine.getMessage(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_MSG_CONTENT_T,JSON.stringify({messageId:e,messageType:r}),n),[4,lr.create("setMessageContent").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isNotEmptyString("messageType",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t,!0).fail(exports.ErrorCode.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_E_SET_MSG_SENT_STATUS_T,JSON.stringify({messageId:e,sentStatus:t}),r),[4,lr.create("setMessageSentStatus").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isNumberEnum("sentStatus",t,exports.SentStatus,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageSentStatus(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_E_SET_MSG_RECEIVED_STATUS_T,JSON.stringify({messageId:e,receivedStatus:t}),r),[4,lr.create("setMessageReceivedStatus").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isInteger("receivedStatus",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageReceivedStatus(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return(r=Jl("setMessageStatusToRead",e,W).isNumber("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(n=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,a=e.channelId,this.logger.info(B.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),n),[4,this._engine.updateMessageReceiptStatus(i,o,t,a)]):[2,r.wipe()];case 1:return u=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"subscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return(i=lr.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return Et(e)})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",r,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",n,(function(e){return te(e,K)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(B.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:[me.TEXT,me.FILE],r||"",n&&0!==n.length?n:ee(K))]):[2,i.wipe()];case 1:return a=s.sent(),this.logger.summary(B.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,i,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[me.TEXT,me.FILE],r&&0!==r.length?r:ee(K))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,i;return o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){switch(s.label){case 0:return(o=Jl("searchMessages",e,X).isLimitedString("keyword",null==t?void 0:t.keyword,0,1e3,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==t?void 0:t.limit,1,st,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==t?void 0:t.offset,0,st).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==t?void 0:t.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",t.timeRange).validate("timeRange",t.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!ft(t)||r&&!ft(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.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(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(i=null==t?void 0:t.messageFilter)||void 0===i?void 0:i.senderIds,At).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans((function(){return Ot()?ar():ur(exports.ErrorCode.NOT_SUPPORT,"Only support electron platform.")})).tryTrans(this.validateLogin)).isOk?(a=c(this,YE,"m",KE).call(this,e),[4,c(this,YE,"m",zE).call(this,n(n({},t),{conversationFilter:{conversationTypes:[a.conversationType],targetIds:[a.targetId],channelIds:"string"==typeof a.channelId?[a.channelId]:[]}}))]):[2,o.wipe()];case 1:return[2,s.sent().orSync((function(){return ar({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,a,u;return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){return(o=lr.create("searchMessagesWithParams").isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,st,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,st).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(exports.ErrorCode.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&&!ft(t)||r&&!ft(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(t=null==e?void 0:e.conversationFilter)||void 0===t?void 0:t.conversationTypes,(function(e){return te(e,X)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(r=null==e?void 0:e.conversationFilter)||void 0===r?void 0:r.targetIds,20,At,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.channelIds,10,yt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(i=null==e?void 0:e.messageFilter)||void 0===i?void 0:i.senderIds,20,At,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(a=null==e?void 0:e.messageFilter)||void 0===a?void 0:a.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(exports.ErrorCode.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,c(this,YE,"m",zE).call(this,e)]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_GET_MSGS_AROUND_TIMESTAMP_T,JSON.stringify({conversation:e,timestamp:t,beforeCount:r,afterCount:n}),i),[4,lr.create("getMessagesAroundTimestamp").check((function(t){return Kl(t,e,X)})).isLimitedInteger("timestamp",t,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("beforeCount",r,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_BEFORE).isLimitedInteger("afterCount",n,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_AFTER).result().tryTrans(this.validateLogin).next((function(){var i=c(a,YE,"m",KE).call(a,e);return a._engine.chat.getMessagesAroundTimestamp(i,t,r,n)}))];case 1:return o=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTIONED_MSGS_T,JSON.stringify(e),t),[4,lr.create("getUnreadMentionedMessages").check((function(t){return Kl(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(n,YE,"m",KE).call(n,e);return n._engine.chat.getUnreadMentionedMessages(t)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,channelId:t}),r),[4,lr.create("getUltraGroupDefaultNotificationLevel").validate("targetId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",t,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){var r="string"==typeof t?i._channelIdConvert(exports.ConversationType.ULTRA_GROUP,t):t;return i._engine.chat.getUGDefaultNotificationLevel(e,r)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,notificationLevel:t,channelId:r}),n),[4,lr.create("setUltraGroupDefaultNotificationLevel").validate("targetId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isNumberEnum("notificationLevel",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var n="string"==typeof r?o._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r):r;return o._engine.chat.setUGDefaultNotificationLevel(e,t,n)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=Jl("getConversationNotificationLevel",e,K).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(c(this,YE,"m",KE).call(this,e))]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=lr.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return te(e,K)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).isNumberEnum("level",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=lr.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return te(e,K)}),!0).fail(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var r,n,i,o,a,u=this;return s(this,(function(s){switch(s.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(B.A_GET_REMOTE_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),o),[4,lr.create("getRemoteHistoryMessages").check((function(t){return Kl(t,e,Q)})).isLimitedInteger("timestamp",r,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isLimitedInteger("count",n,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:r||0,count:n||20,order:i||0,messageType:""},o=c(u,YE,"m",KE).call(u,e);return u._engine.getHistoryMessage(o,t,!1)}))];case 1:return a=s.sent(),this.logger.summary(B.A_GET_REMOTE_HISTORY_MSG_R,a,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATIONS_T,JSON.stringify({identifiers:e}),t),[4,lr.create("getConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,100,(function(e){return!Kl(t,e,X).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return c(n,YE,"m",KE).call(n,e)}));return n._engine.chat.getConversations(t)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var i=this;return s(this,(function(o){switch(o.label){case 0:return[4,this.validateConnected().next((function(){return i._engine.rtcSignaling(e,t,r,n)}))];case 1:return[2,o.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_PROXY_T,JSON.stringify({proxy:e}),t),[4,lr.create("setProxy").check((function(t){return Zl(t,e)})).result().next((function(){return n._engine.setProxy(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_SET_PROXY_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_PROXY_T,JSON.stringify({}),e),[4,this._engine.getProxy()];case 1:return t=r.sent(),this.logger.summary(B.A_GET_PROXY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_TEST_PROXY_T,JSON.stringify({proxy:e,testHost:t}),r),[4,lr.create("testProxy").check((function(t){return Zl(t,e)})).isString("testHost",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TESTHOST).result().next((function(){return i._engine.testProxy(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_REALTIME_CONVERSATIONS_T,JSON.stringify({count:e,startTime:t,order:r}),n),[4,lr.create("getRealtimeConversations").isLimitedInteger("count",e,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isTimestamp("startTime",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",r,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).tryTrans(gc).next((function(){return o._engine.chat.getRealtimeConversations(e,t,r)}))];case 1:return i=s.sent(),this.logger.summary(B.A_GET_REALTIME_CONVERSATIONS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T,"",e),[4,this.validateConnected().tryTrans(gc).next((function(){return r._engine.chat.getRealtimeConTotalUnreadCount()}))];case 1:return t=n.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,this.validateConnected().tryTrans(gc).next((function(){return n._engine.chat.clearRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_REALTIME_CONVERSATIONS_T,JSON.stringify(e),t),[4,lr.create("removeRealtimeConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,20,(function(e){return!Kl(t,e,X).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(gc).next((function(){return n._engine.chat.removeRealtimeConversations(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_REMOVE_REALTIME_CONVERSATIONS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,lr.create("batchGetRealtimeConUnreadCount").check((function(t){t.isLimitedTypedArray("identifiers",e,10,(function(e){return!Kl(t,e,X).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(gc).next((function(){return n._engine.chat.batchGetRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 lr.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SPAN_MINUTES).isNumberEnum("level",e.level,exports.PushNotificationQuietHoursLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.removeNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=Jl("sendReadReceiptResponseV5",e,J).isTypedArray("messageUIdArray",t,(function(e){return At(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ar():ur(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){return(r=Jl("getMessageReadReceiptInfoV5",e,J).isTypedArray("messageUIdArray",t,(function(e){return At(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ar():ur(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){return t=lr.create(""),(r=lr.create("getMessageReadReceiptInfoV5ByIdentifiers").isTypedArray("identifiers",e,(function(e){return Kl(t,e.identifier,J).isNotEmptyString("messageUId",e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().isOk}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",e.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ar():ur(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=Jl("getMessageReadReceiptInfoV5",e,J).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("option",r,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",r.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",r.pageCount,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ar():ur(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=Jl("getMessagesReadReceiptByUsersV5",e,J).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",r,(function(e){return At(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",r.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ar():ur(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T,JSON.stringify({messageUId:e,option:t}),r),[4,lr.create("requestSpeechToTextForMessage").isNotEmptyString("messageUId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).tryTrans((function(e){return!!(1&(e.AIBusinessSub||0))?ar():ur(exports.ErrorCode.SPEECH_TO_TEXT_DISABLE)})).next((function(){return i._engine.chat.requestSpeechToTextForMessage(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){switch(n.label){case 0:return[4,lr.create("setMessageSpeechToTextVisible").isNumber("messageId",e,!0).fail(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T,JSON.stringify({timestamp:e,count:t,topPriority:r}),n),[4,lr.create("getUntaggedConversationListByPage").isLimitedInteger("timestamp",e,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isInteger("count",t,!0).fail(exports.ErrorCode.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=Ot(),[4,lr.create("translateMessagesWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof gn&&e.isValid(!r)}),!0).fail(exports.ErrorCode.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(exports.ErrorCode.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,pn).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(n=s.sent()).isOk?(i=e.list,o=e.force,a=e.mode,[2,c(this,YE,"m",$E).call(this,i,0,a,o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"translateTextsWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return[4,lr.create("translateTextsWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof En&&e.isValid(!0)}),!0).fail(exports.ErrorCode.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(exports.ErrorCode.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,pn).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(r=o.sent()).isOk?(n=e.list,i=e.mode,[2,c(this,YE,"m",$E).call(this,n,1,i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_TRANSLATION_LANGUAGE_T,JSON.stringify({language:e}),t),[4,lr.create("setTranslationLanguage").isLimitedString("language",e,1,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LAUGUAGE).result().tryTrans(this.validateConnected).next((function(){return n._engine.userSettings.setTranslationLanguage(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_SET_TRANSLATION_LANGUAGE_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.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(B.A_GET_TRANSLATION_LANGUAGE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.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(B.A_SET_AUTO_TRANSLATE_ENABLED_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.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(B.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 o(this,void 0,void 0,(function(){var t,r,n,i,o=this;return s(this,(function(s){switch(s.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(B.A_MODIFY_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUId:r,conversation:null==e?void 0:e.conversation}),t),[4,lr.create("modifyMessageWithParams").check((function(t){return Kl(t,null==e?void 0:e.conversation,Z)})).isNotEmptyString("messageUId",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("messageContent",n,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isLimitedInteger("messageContent",$l(JSON.stringify(n)),1,Fe,!0).fail(exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT).result().tryTrans(this.validateConnected).next((function(){return o._engine.chat.modifyMessageWithParams(e)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.messageUIds,this.logger.info(B.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUIds:r}),t),[4,Jl("refreshReferenceMessageWithParams",null==e?void 0:e.conversationIdentifier,Z).isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isTypedArray("messageUIds",r,(function(e){return Et(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==r?void 0:r.length,1,20,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.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(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T,JSON.stringify({targetId:e,timestamp:t}),r),[4,lr.create("deleteLocalUGMessagesForAllChannel").isNotEmptyString("targetId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isTimestamp("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.deleteLocalUGMessagesForAllChannel(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T,JSON.stringify({params:e}),t),[4,lr.create("getUnreadMentionMeConversationList").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,Number.MAX_SAFE_INTEGER,(function(e){return te(e,K)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(t){return o(n,void 0,void 0,(function(){var r;return s(this,(function(n){if(r=Mg(t)){if(!this._ugSynced)return[2,ur(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}else if(e.conversationTypes=e.conversationTypes.filter((function(e){return e!==exports.ConversationType.ULTRA_GROUP})),0===e.conversationTypes.length)return[2,ar([])];return[2,this._engine.chat.getUnreadMentionMeConversationList(e,r)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.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(B.A_GET_ALL_ROBOTS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getRobotById",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_ROBOT_BY_ID_T,JSON.stringify({id:e}),t),[4,lr.create("getRobotById").validate("id",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return o(i,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.getAllRobots()]}))}))}))];case 1:return r=a.sent(),n=r.trans((function(t){return t.find((function(t){return t.robotId===e}))||null})),this.logger.summary(B.A_GET_ROBOT_BY_ID_R,r,t,{id:e,robot:n.data}),[2,n]}}))}))}}),e}();YE=new WeakSet,WE=function(e,t,r){var n,i;return o(this,void 0,void 0,(function(){var a,u,l=this;return s(this,(function(c){switch(c.label){case 0:return[4,lr.create("connect").isNotEmptyString("token",e).fail(exports.ErrorCode.RC_CONN_TOKEN_INCORRECT).result().next((function(){return o(l,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return this._token=e,[4,Xo.getNetworkType()];case 1:return n=o.sent(),this._engine.setNetwork({status:!0,type:n},!0),i=!!this._pluginInstanseMap.RCCallPlus,[2,this._engine.connect(e,t,i,r)]}}))}))}))];case 1:return(a=c.sent()).isOk&&1!==this._engine.naviInfo.type&&(u=ut.getInfo(),null===(i=(n=this._engine).reportSDKInfo)||void 0===i||i.call(n,u)),[2,a]}}))}))},JE=function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(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(B.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},KE=function(e){return n(n({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)})},QE=function(e,t,r,n){return o(this,void 0,void 0,(function(){var i=this;return s(this,(function(o){switch(o.label){case 0:return[4,lr.create("sendMessage").check((function(t){return Kl(t,e,X)})).isObject("content",t.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isString("messageType",t.messageType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){var r=Wl(t.messageType,t.content);r.isOk||e.setFailed(r.code)})).isNumber("messageId",t.messageId).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isBoolean("isStatusMessage",t.isStatusMessage).fail(exports.ErrorCode.INVALID_PARAMETER_IS_STATUS_MESSAGE).isBoolean("disableNotification",t.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isString("pushContent",t.pushContent).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONTENT).isString("pushData",t.pushData).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_DATA).isObject("pushConfig",t.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("isVoipPush",t.isVoipPush).fail(exports.ErrorCode.INVALID_PARAMETER_IS_VOIP_PUSH).isBoolean("canIncludeExpansion",t.canIncludeExpansion).fail(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION).check((function(e){t.canIncludeExpansion&&t.expansion&&Xl(e,t.expansion,!0)})).check((function(r){r.isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE),r.isFailed||e.conversationType===exports.ConversationType.ULTRA_GROUP&&t.disableUpdateLastMessage&&r.setFailed(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE)})).check((function(r){if(!r.isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,At,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isFailed&&t.directionalUserIdList&&0!==t.directionalUserIdList.length){var n=e.conversationType;[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.APP_PUBLIC_SERVICE,exports.ConversationType.PUBLIC_SERVICE].includes(n)||r.setFailed(exports.ErrorCode.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE)}})).isBoolean("isMentioned",t.isMentioned).fail(exports.ErrorCode.INVALID_PARAMETER_IS_MENTIONED).check((function(r){var n=e.conversationType;if(!t.isMentioned||n!==exports.ConversationType.GROUP&&n!==exports.ConversationType.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,exports.MentionedType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MENTIONED_TYPE).isTypedArray("mentionedUserIdList",null==i?void 0:i.userIdList,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isString("mentionedContent",null==i?void 0:i.mentionedContent).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isFailed&&(t.content.mentionedInfo=i)}})).result().tryTrans(this.validateConnected).tryTrans((function(r){if(!t.needReceipt)return ar(r);if(r.grpRRVer!==Ve.V5)return ur(exports.ErrorCode.READ_RECEIPT_ERROR);var n=e.conversationType,i=cn(t.messageType),o=i.isPersited,s=i.isStatusMessage;return(n!==exports.ConversationType.GROUP&&n!==exports.ConversationType.PRIVATE||t.isStatusMessage||s||!o||n===exports.ConversationType.GROUP&&t.directionalUserIdList&&t.directionalUserIdList.length>0)&&(t.needReceipt=!1),ar(r)})).tryTrans((function(r){var n=e.conversationType,i=t.messageType;if(n===exports.ConversationType.SYSTEM&&i!==me.SYNC_READ_STATUS)return ur(exports.ErrorCode.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE);if(i===me.STREAM_MESSAGE)return ur(exports.ErrorCode.MESSAGE_NOT_SUPPORT_SENDING);if(i===me.READ_RECEIPT_RESPONSE&&r.grpRRVer)return ur(exports.ErrorCode.READ_RECEIPT_ERROR);var o=JSON.stringify(t.content);return $l(o)>Fe?ur(exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT):ar()})).next((function(){return c(i,YE,"m",XE).call(i,e,t,r,n)}))];case 1:return[2,o.sent()]}}))}))},XE=function(e,t,r,n){var i=c(this,YE,"m",KE).call(this,e);return i.conversationType===exports.ConversationType.ULTRA_GROUP?this._engine.sendUltraMessage(i,t,r,n):this._engine.sendMessage(i,t,r,n)},ZE=function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this._engine.sendMessage(e,{content:t,messageType:me.EXPANSION_NOTIFY},r)];case 1:return[2,n.sent().wipe()]}}))}))},zE=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.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(B.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return a=s.sent(),this.logger.summary(B.A_SEARCH_MSGS_BY_PARAMS_R,a,o),[2,a]}}))}))},$E=function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,this._engine.translateWithParams(e.map((function(e){return e.toInnerParam()})),r||pn.MECHANICAL,!!n,t)]}))}))},exports.APIContext=rb,exports.AppStorage=rc,exports.BasicEngine=Gl,exports.BasicLogger=Br,exports.Codec=wl,exports.EventEmitter=Ll,exports.FilterRobotType=xe,exports.GroupReadReceiptVersion=Ve,exports.LogDBProxy=Kr,exports.LogTagId=B,exports.MAX_MESSAGE_CONTENT_BYTES=Fe,exports.MAX_U32_INTEGER=st,exports.MAX_UPLOAD_FILE_SIZE=5368709120,exports.MessageAuditType={DISALLOW:0,ALLOW:1},exports.MessageType=me,exports.PBCodec=ol,exports.PluginContext=Fl,exports.RCResult=sr,exports.RTCPluginContext=Bl,exports.ReferenceMessageStatus=Mr,exports.SpeechToTextStatus=Ge,exports.SuspendablePromise=or,exports.TranslateMessageParam=gn,exports.TranslateMode=pn,exports.TranslateStatus=bn,exports.TranslateStrategy=Tn,exports.TranslateTextParam=En,exports.UPLOAD_FILE_CHUNK_SIZE=10485760,exports.UUId=lt,exports.UserSettingsChangedKey=wr,exports.UserType={NORMAL:0,ROBOT:1},exports.Validator=lr,exports.VersionManage=ut,exports.assert=function(e,t,r,n){if(void 0===n&&(n=!1),!Yl(e,t,r,n))throw new ql("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},exports.createLogDBProxy=Qr,exports.fail=ur,exports.fixUrlProtocol=zt,exports.forEach=Ml,exports.getMessageTypeDescription=cn,exports.getUUID=function(){return lt.gen()},exports.getUUID22=function(){return lt.genWithLen(22)},exports.hasMessageTypeDescription=function(e){return ln.has(e)},exports.httpRequest=Cr,exports.isArray=ht,exports.isBoolean=function(e){return"boolean"==typeof e},exports.isFunction=Tt,exports.isHttpUrl=Rt,exports.isInteger=pt,exports.isLimitedString=gt,exports.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},exports.isNumber=ft,exports.isObject=bt,exports.isString=_t,exports.isUndefined=vt,exports.isValidConversationType=function(e){return ft(e)&&Object.prototype.hasOwnProperty.call(exports.ConversationType,e)},exports.isValidEnum=function(e){return Object.values(e.type).includes(e.value)},exports.isValidFileType=function(e){return ft(e)&&Object.prototype.hasOwnProperty.call(exports.FileType,e)},exports.isValidGroupId=St,exports.isValidTargetId=At,exports.logger=Pl,exports.map=function(e,t){return Ml(e,(function(r,n){e[n]=t(r,n)})),e},exports.notEmptyArray=function(e){return ht(e)&&e.length>0},exports.notEmptyObject=It,exports.notEmptyString=Et,exports.ok=ar,exports.promiseWithResolvers=fr,exports.runtime=Xo,exports.trans2IReceivedStatusInfo=Ct,exports.trans2NotificationLevel=function(e){return e===exports.NotificationStatus.OPEN?exports.NotificationLevel.AT_MESSAGE_NOTIFICATION:exports.NotificationLevel.NOT_SET},exports.trans2NotificationStatus=we,exports.transformReceivedStatusFlag=function(e){var t=exports.ReceivedStatus.UNREAD;return(null==e?void 0:e.isRead)&&(t|=exports.ReceivedStatus.READ),(null==e?void 0:e.isListened)&&(t|=exports.ReceivedStatus.LISTENED),(null==e?void 0:e.isDownload)&&(t|=exports.ReceivedStatus.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=exports.ReceivedStatus.RETRIEVED),t},exports.usingCppEngine=Ot,exports.validate=Yl;
16
+ 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){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function o(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function s(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function a(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 u(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function l(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function c(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 d(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}exports.UploadMethod=void 0,(r=exports.UploadMethod||(exports.UploadMethod={}))[r.QINIU=1]="QINIU",r[r.ALI=2]="ALI",r[r.AWS=3]="AWS",r[r.STC=4]="STC",r[r.MINIO=5]="MINIO";var _,f,p,h,g,E,b,T,v,R,I,m,y,A,S,O,C,N,P,L,M,w,U,D,x,G,V,j,k,F,B={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_CALL_MAIN_SYNC_O:"L_CALL_MAIN_SYNC_O",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_CACHE_O:"L-cloud_set_cache-O",L_CLOUD_GET_CACHE_O:"L-cloud_get_cache-O",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"};exports.DirectionType=void 0,(_=exports.DirectionType||(exports.DirectionType={}))[_.BOTH=2]="BOTH",exports.QueryFriendsDirectionType=void 0,(f=exports.QueryFriendsDirectionType||(exports.QueryFriendsDirectionType={}))[f.BOTH=2]="BOTH",exports.FriendAddPermission=void 0,(p=exports.FriendAddPermission||(exports.FriendAddPermission={}))[p.FREE=1]="FREE",p[p.NEED_VERIFY=2]="NEED_VERIFY",p[p.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.FriendRelationType=void 0,(h=exports.FriendRelationType||(exports.FriendRelationType={}))[h.NONE=0]="NONE",h[h.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",h[h.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",h[h.BOTH_WAY=3]="BOTH_WAY",exports.FriendApplicationType=void 0,(g=exports.FriendApplicationType||(exports.FriendApplicationType={}))[g.SENT=1]="SENT",g[g.RECEIVED=2]="RECEIVED",exports.FriendApplicationStatus=void 0,(E=exports.FriendApplicationStatus||(exports.FriendApplicationStatus={}))[E.UNHANDLED=0]="UNHANDLED",E[E.ACCEPTED=1]="ACCEPTED",E[E.REFUSED=2]="REFUSED",E[E.EXPIRED=3]="EXPIRED",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"}(T||(T={})),exports.GroupJoinPermission=void 0,(v=exports.GroupJoinPermission||(exports.GroupJoinPermission={}))[v.OWNER_VERIFY=0]="OWNER_VERIFY",v[v.FREE=1]="FREE",v[v.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",v[v.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED",exports.GroupOperationPermission=void 0,(R=exports.GroupOperationPermission||(exports.GroupOperationPermission={}))[R.OWNER=0]="OWNER",R[R.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",R[R.EVERYONE=2]="EVERYONE",exports.GroupMemberInfoEditPermission=void 0,(I=exports.GroupMemberInfoEditPermission||(exports.GroupMemberInfoEditPermission={}))[I.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",I[I.OWNER_OR_SELF=1]="OWNER_OR_SELF",I[I.SELF=2]="SELF",exports.GroupInviteHandlePermission=void 0,(m=exports.GroupInviteHandlePermission||(exports.GroupInviteHandlePermission={}))[m.FREE=0]="FREE",m[m.INVITEE_VERIFY=1]="INVITEE_VERIFY",exports.GroupMemberRole=void 0,(y=exports.GroupMemberRole||(exports.GroupMemberRole={}))[y.UNDEF=0]="UNDEF",y[y.NORMAL=1]="NORMAL",y[y.MANAGER=2]="MANAGER",y[y.OWNER=3]="OWNER",exports.GroupOperation=void 0,(A=exports.GroupOperation||(exports.GroupOperation={}))[A.CREATE=0]="CREATE",A[A.JOIN=1]="JOIN",A[A.KICK=2]="KICK",A[A.QUIT=3]="QUIT",A[A.DISMISS=4]="DISMISS",A[A.ADD_MANAGER=5]="ADD_MANAGER",A[A.REMOVE_MANAGER=6]="REMOVE_MANAGER",A[A.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER",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"}(S||(S={})),exports.GroupOperationType=void 0,(O=exports.GroupOperationType||(exports.GroupOperationType={}))[O.ADD=1]="ADD",O[O.REMOVE=2]="REMOVE",exports.GroupApplicationStatus=void 0,(C=exports.GroupApplicationStatus||(exports.GroupApplicationStatus={}))[C.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",C[C.MANAGER_REFUSED=1]="MANAGER_REFUSED",C[C.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",C[C.INVITEE_REFUSED=3]="INVITEE_REFUSED",C[C.JOINED=4]="JOINED",C[C.EXPIRED=5]="EXPIRED",exports.GroupOperationStatus=void 0,(N=exports.GroupOperationStatus||(exports.GroupOperationStatus={}))[N.REFUSE=0]="REFUSE",N[N.ACCEPT=1]="ACCEPT",exports.GroupOperationRole=void 0,(P=exports.GroupOperationRole||(exports.GroupOperationRole={}))[P.APPLICANT=0]="APPLICANT",P[P.MANAGER=1]="MANAGER",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"}(L||(L={})),exports.GroupApplicationType=void 0,(M=exports.GroupApplicationType||(exports.GroupApplicationType={}))[M.APPLICATION=0]="APPLICATION",M[M.INVITATION=1]="INVITATION",exports.GroupApplicationDirection=void 0,(w=exports.GroupApplicationDirection||(exports.GroupApplicationDirection={}))[w.APPLICATION_SENT=0]="APPLICATION_SENT",w[w.INVITATION_SENT=1]="INVITATION_SENT",w[w.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",w[w.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED",exports.ChatroomEntryType=void 0,(U=exports.ChatroomEntryType||(exports.ChatroomEntryType={}))[U.UPDATE=1]="UPDATE",U[U.DELETE=2]="DELETE",exports.ChrmSyncStatus=void 0,(D=exports.ChrmSyncStatus||(exports.ChrmSyncStatus={}))[D.QUIT=0]="QUIT",D[D.JOIN=1]="JOIN",exports.ChatroomSyncStatusReason=void 0,(x=exports.ChatroomSyncStatusReason||(exports.ChatroomSyncStatusReason={}))[x.LeaveOnMyOwn=0]="LeaveOnMyOwn",x[x.OtherDeviceLogin=1]="OtherDeviceLogin",exports.ChatroomUserChangeType=void 0,(G=exports.ChatroomUserChangeType||(exports.ChatroomUserChangeType={}))[G.QUIT=0]="QUIT",G[G.JOIN=1]="JOIN",exports.ChrmMemBanType=void 0,(V=exports.ChrmMemBanType||(exports.ChrmMemBanType={}))[V.UnmuteUsers=0]="UnmuteUsers",V[V.MuteUsers=1]="MuteUsers",V[V.UnmuteAll=2]="UnmuteAll",V[V.MuteAll=3]="MuteAll",V[V.RemoveWhitelist=4]="RemoveWhitelist",V[V.AddWhitelist=5]="AddWhitelist",V[V.UnmuteGloble=6]="UnmuteGloble",V[V.MuteGloble=7]="MuteGloble",exports.ChrmMemOperateType=void 0,(j=exports.ChrmMemOperateType||(exports.ChrmMemOperateType={}))[j.Deblock=0]="Deblock",j[j.Blocked=1]="Blocked",exports.ErrorCode=void 0,(k=exports.ErrorCode||(exports.ErrorCode={}))[k.SUCCESS=0]="SUCCESS",k[k.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",k[k.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",k[k.NOT_IN_WHITELIST=407]="NOT_IN_WHITELIST",k[k.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",k[k.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",k[k.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",k[k.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",k[k.MESSAGE_OVER_MODIFY_TIME_FAIL=20114]="MESSAGE_OVER_MODIFY_TIME_FAIL",k[k.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",k[k.MESSAGE_UNSUPPORTED_MODIFY=20116]="MESSAGE_UNSUPPORTED_MODIFY",k[k.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",k[k.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",k[k.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",k[k.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",k[k.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",k[k.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",k[k.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",k[k.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",k[k.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",k[k.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",k[k.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",k[k.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",k[k.NOT_IN_GROUP=22406]="NOT_IN_GROUP",k[k.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",k[k.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",k[k.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",k[k.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",k[k.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",k[k.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",k[k.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",k[k.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",k[k.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",k[k.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",k[k.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",k[k.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",k[k.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",k[k.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",k[k.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",k[k.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",k[k.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",k[k.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",k[k.HAVNODEVICEID=24001]="HAVNODEVICEID",k[k.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",k[k.FEILD=24009]="FEILD",k[k.INTERNALERRROR=24015]="INTERNALERRROR",k[k.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",k[k.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",k[k.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",k[k.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",k[k.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",k[k.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",k[k.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",k[k.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",k[k.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",k[k.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",k[k.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",k[k.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",k[k.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",k[k.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",k[k.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",k[k.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",k[k.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",k[k.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",k[k.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",k[k.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",k[k.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",k[k.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",k[k.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",k[k.RECALL_MESSAGE=25101]="RECALL_MESSAGE",k[k.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",k[k.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",k[k.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",k[k.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",k[k.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",k[k.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",k[k.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",k[k.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",k[k.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",k[k.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",k[k.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",k[k.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",k[k.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",k[k.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",k[k.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",k[k.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",k[k.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",k[k.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",k[k.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",k[k.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",k[k.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",k[k.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",k[k.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",k[k.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",k[k.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",k[k.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",k[k.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",k[k.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",k[k.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",k[k.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",k[k.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",k[k.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",k[k.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",k[k.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",k[k.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",k[k.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",k[k.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",k[k.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",k[k.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",k[k.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",k[k.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",k[k.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",k[k.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",k[k.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",k[k.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",k[k.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",k[k.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",k[k.RC_FRIEND_NOT_SUPPORT_ROBOT=25474]="RC_FRIEND_NOT_SUPPORT_ROBOT",k[k.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",k[k.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",k[k.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",k[k.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",k[k.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",k[k.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",k[k.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",k[k.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",k[k.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",k[k.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",k[k.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",k[k.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",k[k.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",k[k.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",k[k.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",k[k.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",k[k.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",k[k.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",k[k.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",k[k.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",k[k.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",k[k.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",k[k.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",k[k.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",k[k.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",k[k.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",k[k.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",k[k.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",k[k.TRANS_FAILED=28401]="TRANS_FAILED",k[k.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",k[k.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",k[k.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",k[k.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",k[k.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",k[k.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",k[k.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",k[k.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",k[k.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",k[k.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",k[k.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",k[k.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",k[k.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",k[k.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",k[k.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",k[k.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",k[k.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",k[k.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",k[k.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",k[k.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",k[k.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",k[k.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",k[k.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",k[k.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",k[k.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",k[k.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",k[k.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",k[k.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",k[k.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",k[k.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",k[k.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",k[k.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",k[k.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",k[k.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",k[k.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",k[k.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",k[k.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",k[k.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",k[k.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",k[k.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",k[k.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",k[k.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",k[k.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",k[k.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",k[k.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",k[k.RC_OTP_USED=31027]="RC_OTP_USED",k[k.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",k[k.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",k[k.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",k[k.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",k[k.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",k[k.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",k[k.RC_TCP_RESET=32054]="RC_TCP_RESET",k[k.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",k[k.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",k[k.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",k[k.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",k[k.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",k[k.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",k[k.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",k[k.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",k[k.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",k[k.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",k[k.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",k[k.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",k[k.TAG_EXISTS=33101]="TAG_EXISTS",k[k.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",k[k.METHOD_BUSY=33103]="METHOD_BUSY",k[k.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",k[k.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",k[k.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",k[k.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",k[k.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",k[k.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",k[k.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",k[k.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",k[k.UPLOAD_FAIL=34011]="UPLOAD_FAIL",k[k.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",k[k.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",k[k.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",k[k.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",k[k.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",k[k.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",k[k.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",k[k.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",k[k.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",k[k.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",k[k.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",k[k.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",k[k.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",k[k.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",k[k.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",k[k.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",k[k.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",k[k.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",k[k.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",k[k.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",k[k.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",k[k.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",k[k.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",k[k.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",k[k.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",k[k.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",k[k.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",k[k.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",k[k.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",k[k.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",k[k.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",k[k.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",k[k.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",k[k.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",k[k.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",k[k.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",k[k.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",k[k.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",k[k.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",k[k.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",k[k.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",k[k.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",k[k.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",k[k.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",k[k.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",k[k.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",k[k.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",k[k.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",k[k.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",k[k.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",k[k.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",k[k.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",k[k.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",k[k.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",k[k.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",k[k.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",k[k.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",k[k.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",k[k.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",k[k.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",k[k.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",k[k.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",k[k.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",k[k.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",k[k.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",k[k.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",k[k.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",k[k.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",k[k.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",k[k.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",k[k.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",k[k.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",k[k.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",k[k.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",k[k.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",k[k.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",k[k.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",k[k.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",k[k.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",k[k.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",k[k.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",k[k.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",k[k.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",k[k.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",k[k.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",k[k.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",k[k.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",k[k.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",k[k.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",k[k.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",k[k.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",k[k.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",k[k.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",k[k.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",k[k.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",k[k.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",k[k.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",k[k.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",k[k.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",k[k.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",k[k.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",k[k.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",k[k.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",k[k.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",k[k.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",k[k.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",k[k.NOT_SUPPORT=35004]="NOT_SUPPORT",k[k.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",k[k.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",k[k.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",k[k.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",k[k.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",k[k.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",k[k.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",k[k.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",k[k.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",k[k.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",k[k.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",k[k.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",k[k.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",k[k.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",k[k.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",k[k.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",k[k.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",k[k.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",k[k.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",k[k.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",k[k.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",k[k.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",k[k.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",k[k.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",k[k.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",k[k.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",k[k.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",k[k.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",k[k.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",k[k.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",k[k.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",k[k.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",k[k.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",k[k.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",k[k.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",k[k.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",k[k.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",k[k.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",k[k.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",k[k.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",k[k.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",k[k.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",k[k.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",k[k.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",k[k.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",k[k.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",k[k.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",k[k.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",k[k.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",k[k.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",k[k.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",k[k.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",k[k.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",k[k.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",k[k.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",k[k.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",k[k.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",k[k.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",k[k.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",k[k.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",k[k.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",k[k.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",k[k.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",k[k.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",k[k.TIMEOUT=-1]="TIMEOUT",exports.ConversationType=void 0,(F=exports.ConversationType||(exports.ConversationType={}))[F.NONE=0]="NONE",F[F.PRIVATE=1]="PRIVATE",F[F.DISCUSSION=2]="DISCUSSION",F[F.GROUP=3]="GROUP",F[F.CHATROOM=4]="CHATROOM",F[F.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",F[F.SYSTEM=6]="SYSTEM",F[F.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",F[F.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",F[F.ULTRA_GROUP=10]="ULTRA_GROUP",F[F.RTC_ROOM=12]="RTC_ROOM";var H,q,Y,W=0,J=1,K=2,Q=3,X=4,Z=5,z=6,$=7,ee=function(e){var t=[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.SYSTEM,exports.ConversationType.PUBLIC_SERVICE,exports.ConversationType.APP_PUBLIC_SERVICE];switch(e){case W:return t;case J:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP];case K:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP],!1);case Q:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM],!1);case X:return l(l([],u(t),!1),[exports.ConversationType.ULTRA_GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.CUSTOMER_SERVICE,exports.ConversationType.DISCUSSION],!1);case Z:return[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP];case z:return[exports.ConversationType.GROUP];case $:return[exports.ConversationType.PRIVATE]}},te=function(e,t){return ee(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"}(H||(H={})),exports.FileType=void 0,(q=exports.FileType||(exports.FileType={}))[q.IMAGE=1]="IMAGE",q[q.AUDIO=2]="AUDIO",q[q.VIDEO=3]="VIDEO",q[q.FILE=4]="FILE",q[q.SIGHT=5]="SIGHT",q[q.COMBINE_HTML=6]="COMBINE_HTML",exports.MentionedType=void 0,(Y=exports.MentionedType||(exports.MentionedType={}))[Y.ALL=1]="ALL",Y[Y.SINGAL=2]="SINGAL";var re,ne,ie,oe,se,ae,ue,le,ce,de,_e,fe,pe,he,ge,Ee,be,Te,ve,Re,Ie,me={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"};exports.UltraGroupChannelType=void 0,(re=exports.UltraGroupChannelType||(exports.UltraGroupChannelType={}))[re.PUBLIC=0]="PUBLIC",re[re.PRIVATE=1]="PRIVATE",exports.UltraGroupChannelChangeType=void 0,(ne=exports.UltraGroupChannelChangeType||(exports.UltraGroupChannelChangeType={}))[ne.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",ne[ne.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",ne[ne.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN",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"}(ie||(ie={})),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"}(oe||(oe={})),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"}(se||(se={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(ae||(ae={})),exports.SentStatus=void 0,(ue=exports.SentStatus||(exports.SentStatus={}))[ue.SENDING=10]="SENDING",ue[ue.FAILED=20]="FAILED",ue[ue.SENT=30]="SENT",ue[ue.RECEIVED=40]="RECEIVED",ue[ue.READ=50]="READ",ue[ue.DESTROYED=60]="DESTROYED",exports.OperateStatus=void 0,(le=exports.OperateStatus||(exports.OperateStatus={}))[le.typing=0]="typing",exports.OnlineStatus=void 0,(ce=exports.OnlineStatus||(exports.OnlineStatus={}))[ce.ONLINE=1]="ONLINE",ce[ce.OFFLINE=0]="OFFLINE",exports.Platform=void 0,(de=exports.Platform||(exports.Platform={}))[de.Other=0]="Other",de[de.iOS=1]="iOS",de[de.Android=2]="Android",de[de.Web=3]="Web",de[de.PC=4]="PC",de[de.Mini=5]="Mini",de[de.HarmonyOS=6]="HarmonyOS",exports.SubscribeType=void 0,(_e=exports.SubscribeType||(exports.SubscribeType={}))[_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",exports.SubscribeOperationType=void 0,(fe=exports.SubscribeOperationType||(exports.SubscribeOperationType={}))[fe.SUBSCRIBE=0]="SUBSCRIBE",fe[fe.UNSUBSCRIBE=1]="UNSUBSCRIBE",exports.UserProfileVisibility=void 0,(pe=exports.UserProfileVisibility||(exports.UserProfileVisibility={}))[pe.NOT_SET=0]="NOT_SET",pe[pe.INVISIBLE=1]="INVISIBLE",pe[pe.EVERYONE=2]="EVERYONE",pe[pe.FriendVisible=3]="FriendVisible",exports.RCConnectionStatus=void 0,(he=exports.RCConnectionStatus||(exports.RCConnectionStatus={}))[he.CONNECTED=0]="CONNECTED",he[he.CONNECTING=1]="CONNECTING",he[he.DISCONNECTED=2]="DISCONNECTED",he[he.SUSPENDED=3]="SUSPENDED",exports.MessageBlockType=void 0,(ge=exports.MessageBlockType||(exports.MessageBlockType={}))[ge.GLOBAL=1]="GLOBAL",ge[ge.CUSTOM=2]="CUSTOM",ge[ge.THIRD_PARTY=3]="THIRD_PARTY",exports.MessageBlockSourceType=void 0,(Ee=exports.MessageBlockSourceType||(exports.MessageBlockSourceType={}))[Ee.MSG_ORIGINAL=0]="MSG_ORIGINAL",Ee[Ee.MSG_EXPANSION=1]="MSG_EXPANSION",Ee[Ee.MSG_MODIFY=2]="MSG_MODIFY",exports.MessageDirection=void 0,(be=exports.MessageDirection||(exports.MessageDirection={}))[be.SEND=1]="SEND",be[be.RECEIVE=2]="RECEIVE",exports.PushImportanceHonor=void 0,(Te=exports.PushImportanceHonor||(exports.PushImportanceHonor={})).NORMAL="NORMAL",Te.LOW="LOW",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"}(ve||(ve={})),exports.NotificationLevel=void 0,(Re=exports.NotificationLevel||(exports.NotificationLevel={}))[Re.ALL_MESSAGE=-1]="ALL_MESSAGE",Re[Re.NOT_SET=0]="NOT_SET",Re[Re.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",Re[Re.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",Re[Re.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",Re[Re.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION",exports.NotificationStatus=void 0,(Ie=exports.NotificationStatus||(exports.NotificationStatus={}))[Ie.OPEN=1]="OPEN",Ie[Ie.CLOSE=2]="CLOSE";var ye,Ae,Se,Oe,Ce,Ne,Pe,Le,Me,we=function(e){return e<=exports.NotificationLevel.NOT_SET?exports.NotificationStatus.CLOSE:exports.NotificationStatus.OPEN};exports.ReceivedStatus=void 0,(ye=exports.ReceivedStatus||(exports.ReceivedStatus={}))[ye.READ=1]="READ",ye[ye.LISTENED=2]="LISTENED",ye[ye.DOWNLOADED=4]="DOWNLOADED",ye[ye.RETRIEVED=8]="RETRIEVED",ye[ye.UNREAD=0]="UNREAD",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"}(Se||(Se={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(Oe||(Oe={})),function(e){e[e.CURRENT=2]="CURRENT"}(Ce||(Ce={})),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"}(Pe||(Pe={})),exports.InterruptionLevel=void 0,(Le=exports.InterruptionLevel||(exports.InterruptionLevel={})).PASSIVE="passive",Le.ACTIVE="active",Le.TIME_SENSITIVE="time-sensitive",Le.CRITICAL="critical",exports.PushNotificationQuietHoursLevel=void 0,(Me=exports.PushNotificationQuietHoursLevel||(exports.PushNotificationQuietHoursLevel={}))[Me.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",Me[Me.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",Me[Me.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED";var Ue,De,xe={ALL:0,EXCLUDE_ROBOT:1,ROBOT_ONLY:2},Ge={NOT_CONVERTED:0,CONVERTING:1,SUCCESS:2,FAILED:3},Ve={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={})),exports.HttpMethod=void 0,(De=exports.HttpMethod||(exports.HttpMethod={})).GET="GET",De.POST="POST",De.PUT="PUT";var je=72e5,ke=6e4,Fe=131072,Be="5.32.1-c-test-alpha.1".replace(/-.+$/,""),He="rongcloudsystem",qe=864e5,Ye=function(e){return"navi_".concat(e)},We=function(e,t){return"RC-con-stat-ver-".concat(e,"-").concat(t)},Je=function(e,t){return"RCV4-CONVER-".concat(e,"-").concat(t)},Ke=function(e,t){return"RCV4-ultragroupconversation-".concat(e,"-").concat(t)},Qe=function(e,t){return"RC-con-type-settings-".concat(e,"-").concat(t)},Xe=function(e,t){return"outbox_".concat(e,"_").concat(t)},Ze=function(e,t){return"inbox_".concat(e,"_").concat(t)},ze=function(e,t){return"broadcastbox_".concat(e,"_").concat(t)},$e=function(e,t){return"send_msg_".concat(e,"_").concat(t)},et=function(e,t){return"RC-us-".concat(e,"-").concat(t)},rt=function(e){return"rc-static-config-".concat(e)},nt=function(e){return"RC-cc-".concat(e)},it=function(e,t){return"RC-RR-".concat(e,"-").concat(t)},ot=function(e){return"RC-LI-".concat(e)},st=Math.pow(2,31)-1,at="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};at.engine="5.32.1-c-test-alpha.1";var ut=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)&&(at[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 at.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 at}}),e}();var lt={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),o=e-n.length-i.length;return[i,n,o>0?(t=o,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}},ct=lt.genWithLen(22),dt=Date.now(),_t=function(e){return"string"==typeof e},ft=function(e){return"number"==typeof e&&!Number.isNaN(e)},pt=function(e){return function(t){return Number.isInteger(t)&&(void 0===e.min||t>=e.min)&&(void 0===e.max||t<=e.max)}},ht=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},gt=function(e){return function(t){return _t(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))}},Et=function(e){return _t(e)&&e.length>0},bt=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Tt=function(e){return"function"==typeof e},vt=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},Rt=function(e){return _t(e)&&/https?:\/\//.test(e)},It=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},mt=function(e){return ft(e)&&Object.prototype.hasOwnProperty.call(exports.NotificationLevel,e)},yt=function(e){var t=!1;return _t(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},At=function(e){return gt({minLength:1,maxLength:64})(e)},St=function(e){return gt({minLength:1,maxLength:64})(e)&&/^[a-zA-Z0-9+=\-_|:]*$/.test(e)},Ot=function(){return"undefined"!=typeof RCCppEngine},Ct=function(e){return{isRead:(e&exports.ReceivedStatus.READ)===exports.ReceivedStatus.READ,isListened:(e&exports.ReceivedStatus.LISTENED)===exports.ReceivedStatus.LISTENED,isDownload:(e&exports.ReceivedStatus.DOWNLOADED)===exports.ReceivedStatus.DOWNLOADED,isRetrieved:(e&exports.ReceivedStatus.RETRIEVED)===exports.ReceivedStatus.RETRIEVED}},Nt=function(e){return[exports.Platform.iOS,exports.Platform.Android,exports.Platform.Web,exports.Platform.PC,exports.Platform.Mini,exports.Platform.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]}))},Pt=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},Lt=function(e,t,r){return t?1===r?H.TLS:H.RMTP:"http"===e?H.WS:H.WSS},Mt=function(e,t){var r=e.server,n=e.backupServer,i=e.bs,o=e.serverAddr,s=e.protocol,a=e.openTLS;if(o)return l([],u(o.filter((function(e){return e.addr}))),!1);var c=[],d=[];return r&&d.push(r),(n||i||"").split(",").forEach((function(e){d.indexOf(e)<0&&d.push(e)})),d.forEach((function(e,n){e&&c.push({addr:e,protocol:Lt(s,t,a),weight:r.length-n,race:!1})})),l([],u(c),!1)},wt=function(e){return void 0===e&&(e=[]),e.map((function(e){var t=Gt(e.settingProfile),r=e.extProfile||[],i=e.targetId,o=e.baseInfo,s=e.userInfo;return JSON.parse(JSON.stringify(n(n({groupId:i},Dt(t)),{extProfile:r.length>0?Gt(r):void 0,creatorId:null==o?void 0:o.creatorId,ownerId:null==o?void 0:o.ownerId,createTime:null==o?void 0:o.createTime,membersCount:null==o?void 0:o.memberCount,remark:null==s?void 0:s.remarkName})))}))},Ut=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},Dt=function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Ut(e.joinPerm),removeMemberPermission:Ut(e.removePerm),invitePermission:Ut(e.memInvitePerm),inviteHandlePermission:Ut(e.invitePerm),groupInfoEditPermission:Ut(e.profilePerm),memberInfoEditPermission:Ut(e.memProfilePerm)}))},xt=function(e){return void 0===e&&(e=[]),e.map(Vt)},Gt=function(e){var t={};return e&&0!==e.length?(e.forEach((function(e){t[e.key]=e.value})),t):t},Vt=function(e){var t=e.userId,r=e.name,n=e.portraitUrl,i=e.ext||{},o=i.role,s=i.joinTime,a=i.channelNickName,u=i.additional,l=i.isBot;return{userId:t,name:r||"",portraitUri:n||"",nickname:a||"",extra:u||"",role:o||exports.GroupMemberRole.UNDEF,joinedTime:s||0,isRobot:!!l}},jt=function(e){var t=e.joinUserInfo,r=e.inviterInfo,n=e.processInfo;return{groupId:e.targetId,joinMemberInfo:Vt(t),inviterInfo:r&&r.userId?Vt(r):void 0,operatorInfo:n&&n.userId?Vt(n):void 0,status:e.status,direction:e.directionType,type:e.joinType,operationTime:e.applyTime||0,reason:e.detail||""}},kt=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},Ft=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 Bt(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 Ht,qt=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=lt.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)}(),o=(new Date).getTime(),s="";if(t){var a=t.split(".");s=".".concat(a[a.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(r,"_").concat(o).concat(n).concat(s)},Yt=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,s=t.typeVivo,a=t.importanceHW,u=t.categoryHW,l=t.imageUrlHW,c=t.categoryVivo,d=t.importanceHonor,_=t.imageUrlHonor,f=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var r=e.threadId,n=e.apnsCollapseId,i=e.category,o=e.richMediaUri,s=e.interruptionLevel,a=t.googleConfig,u={};u["thread-id"]=r||"",u["apns-collapse-id"]=n||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=s||"active";var l={};l.collapse_key=null==a?void 0:a.collapseKey,l.imageUrl=null==a?void 0:a.imageUrl;var c=null==a?void 0:a.priority;return c&&!["high","normal"].includes(c)&&(c="normal"),l.priority=c,{APNS:u,FCM:l}}(e,t),p=[{HW:{channelId:i||"",importance:a||"NORMAL",image:l||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:s||"",category:c||""}},{APNS:f.APNS},{FCM:f.FCM},{HONOR:{importance:d||exports.PushImportanceHonor.NORMAL,image:_||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(p)},Wt=function(e,t){var r={},n={notificationId:t||""},i={};if(!e)return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,s,a,u,l,c,d,_,f,p,h,g=Object.keys(e);if(0!==g.length){var E=g[0];switch(E){case"HW":return n.channelIdHW=null===(t=e[E])||void 0===t?void 0:t.channelId,n.importanceHW=null===(o=e[E])||void 0===o?void 0:o.importance,n.imageUrlHW=null===(s=e[E])||void 0===s?void 0:s.image,void(n.categoryHW=null===(a=e[E])||void 0===a?void 0:a.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===(d=e[E])||void 0===d?void 0:d.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===(_=e[E])||void 0===_?void 0:_.importance,void(n.imageUrlHonor=null===(f=e[E])||void 0===f?void 0:f.image);case"OHOS":i.category=null===(p=e[E])||void 0===p?void 0:p.category,i.image=null===(h=e[E])||void 0===h?void 0:h.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}},Jt=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),r=e.length;return t&&(r<=128&&r>=1)},Kt=function(e){var t=e.length;return t<=4096&&t>=1},Qt=(Ht=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,8)-1)),r=e+Ht.toString(2).padStart(11,"0")+t.toString(2).padStart(8,"0");return Ht=2047&++Ht,parseInt(r,2)}),Xt=function(){var e=ut.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t},Zt=function(e,t,r){return o(void 0,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return[4,window.crypto.subtle.importKey("raw",(new TextEncoder).encode(t),"AES-CBC",!0,["decrypt"])];case 1:return n=o.sent(),[4,window.crypto.subtle.decrypt({name:"AES-CBC",iv:(new TextEncoder).encode(r)},n,Bt(e))];case 2:return i=o.sent(),[2,(new TextDecoder).decode(i)]}}))}))};function zt(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!==H.HTTP||n?"https://".concat(e):"http://".concat(e)}var $t=function(e,t){if(!e)return"";var r=e.ossConfig,n=void 0===r?"":r,i="";try{var o=JSON.parse(n);if(o.length>0){var s=o.find((function(e){return e.minio}));s&&(i=s.minio)}}catch(e){t.warn(B.L_PARSE_JSON_E,JSON.stringify({ossConfig:n,error:e}))}return i};var er,tr=function(e,t){return t&&0!==t.length?[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.APP_PUBLIC_SERVICE,exports.ConversationType.PUBLIC_SERVICE].includes(e)?t:[]:t||[]},rr=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),nr=function(){function e(){er.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){d(this,er,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return c(this,er,"f")},enumerable:!1,configurable:!0}),e}();er=new WeakMap;var ir=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 Set})}return Object.defineProperty(e.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===i&&(i=0);var o=Symbol(),s=this._map.get(e)||this._map.set(e,[]).get(e),a={symbol:o,priority:Math.min(i,100),listener:t.bind(n),once:r},u=s.findIndex((function(e){return e.priority>i}));return-1===u?s.push(a):s.splice(u,0,a),o}}),Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!1,r,n)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!0,r,n)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;try{for(var n=a(this._map),i=n.next();!i.done;i=n.next()){var o=u(i.value,2),s=(o[0],o[1]),l=s.findIndex((function(t){return t.symbol===e}));if(-1!==l)return void s.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 nr,o=0;o<n.length;o+=1){var s=n[o],a=s.once,c=s.listener;a&&n.splice(o,1);try{c.apply(void 0,l([i],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}l([],u(this._piped.values()),!1).forEach((function(r){return r.emit.apply(r,l([e],u(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){this._piped.add(e)}}),e}(),or=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){return void 0===t&&(t=!1),o(this,void 0,void 0,(function(){return s(this,(function(r){return-1!==this._dataVersion||(this._dataVersion=e,t&&this._execPulling()),[2]}))}))}}),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 o(this,void 0,void 0,(function(){var e,t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return this._pullingPromise?[2]:(this._pullingPromise=this._handleSyncData(this._dataVersion),[4,this._pullingPromise]);case 1:if(e=s.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=l([],u(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}(ir),sr=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}(),ar=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 o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){return s(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?ur(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?ur(void 0,this.msg):lr(this.code,this.msg)}}),e}(),ur=function(e,t){return new ar(0,t||"success",e)},lr=function(e,t,r){return new ar(e,t||"fail: ".concat(e),r)},cr=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?lr(this._code,this._errmsg):ur()}}),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 rr.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"isHttpUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isNotEmptyString(e,t,r).validate(e,t,(function(e){return/^https?:\/\//.test(e)}))}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isString(e,t,r).validate(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assertString(e,t,r),this.assert(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isLimitedInteger(e,t,0,Number.MAX_SAFE_INTEGER,r)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.isArray(e,t,n).validate(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isArray(e,t,n).validate(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,r,i,o).validate(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,r,i,o),this.assert(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"isStringEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isString(e,t,n).validate(e,t,(function(e){return Object.values(r).includes(e)}),n)}}),Object.defineProperty(e.prototype,"isNumberEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isNumber(e,t,n).validate(e,t,(function(e){return Object.values(r).includes(e)}),n)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"function"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"function"==typeof e}),r)}}),e}(),dr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function _r(e){var t,r,n,i,o,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=dr.indexOf(e.charAt(u++))<<2|(i=dr.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(o=dr.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(s=dr.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==o&&(a+=String.fromCharCode(r)),64!==s&&(a+=String.fromCharCode(n));return a}var fr,pr=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},hr=1732584193,gr=4023233417,Er=2562383102,br=271733878,Tr=[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],vr=[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 Rr(e,t){return e<<t|e>>>32-t}function Ir(e,t,r){return e&r|t&~r}function mr(e,t,r){return e^t^r}function yr(e,t,r){return t^(e|~r)}function Ar(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 Sr(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 Or(e){var t=8*e.length,r=e.length%64<56?56-e.length%64:120-e.length%64,n=new Uint8Array(e.length+r+8);n.set(e),n[e.length]=128;for(var i=1;i<r;i++)n[e.length+i]=0;var o=new Uint8Array(8),s=4294967295&t,a=4294967295&Math.floor(t/4294967296);o.set(Sr(s),0),o.set(Sr(a),4),n.set(o,e.length+r);var u,l=hr,c=gr,d=Er,_=br;for(i=0;i<n.length;i+=64){for(var f=Ar(n.slice(i,i+64)),p=l,h=c,g=d,E=_,b=0;b<64;b++){var T=void 0,v=void 0;b<16?(T=(u=c)&d|~u&_,v=b):b<32?(T=Ir(c,d,_),v=(5*b+1)%16):b<48?(T=mr(c,d,_),v=(3*b+5)%16):(T=yr(c,d,_),v=7*b%16);var R=_;_=d,d=c,c+=Rr(l+T+vr[b]+f[v]&4294967295,Tr[b]),l=R}l=l+p&4294967295,c=c+h&4294967295,d=d+g&4294967295,_=_+E&4294967295}var I=new Uint8Array(16);return I.set(Sr(l),0),I.set(Sr(c),4),I.set(Sr(d),8),I.set(Sr(_),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(I)}function Cr(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 Or(t)}function Nr(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||ke,n=e.headers,i=e.query,o=e.body,s=e.onProgress,a=Ft(e.url,i),u=new XMLHttpRequest;if(u.open(t,a),n&&u.setRequestHeader)for(var l in n)u.setRequestHeader(l,n[l]);return function(e,t,r,n){return new sr((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,o,s)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(fr||(fr={}));var Pr,Lr,Mr=0,wr={DEFAULT:0,MODIFIED:1,RECALLED:2,DELETE:3},Ur={TranslationLanguage:0,AutoTranslateEnable:1};exports.AreaCode=void 0,(Lr=exports.AreaCode||(exports.AreaCode={}))[Lr.BJ=1]="BJ",Lr[Lr.SG=2]="SG",Lr[Lr.NA=3]="NA",Lr[Lr.SG_A=4]="SG_A",Lr[Lr.SG_B=4]="SG_B",Lr[Lr.SA=5]="SA",Lr[Lr.OM=6]="OM";var Dr=((Pr={})[exports.AreaCode.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},Pr[exports.AreaCode.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},Pr[exports.AreaCode.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},Pr[exports.AreaCode.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},Pr[exports.AreaCode.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},Pr[exports.AreaCode.OM]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5vbS1saWdodC1lZGdlLmNvbQ==","bmF2LWIub20tbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ub20tbGlnaHQtZWRnZS5jb20=",protocol:H.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLm9tLWxpZ2h0LWVkZ2UuY29t","d3MtYi5vbS1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5vbS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIub20tbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9kdWFsc3RhY2stc3RhdHMub20tbGlnaHQtZWRnZS5jb20="]},Pr);function xr(e){return exports.AreaCode[e]?e:exports.AreaCode.BJ}var Gr,Vr=function(){function e(){Object.defineProperty(this,"initOption",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.initOption=e}}),Object.defineProperty(e.prototype,"getNaviUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this.initOption||{},i=n.areaCode,o=n.navigators,s=(r=i,void 0===r&&(r=exports.AreaCode.BJ),Dr[xr(r)].naviUrlBase64).map((function(e){return _r(e)})),a=[],c=u(e.split("@"),2)[1];t&&(a=c?c.split(";"):[]);var d=o&&o.length>0?l(l([],u(a),!1),u(o),!1):l(l([],u(a),!1),u(s),!1);return d.filter((function(e,t){return d.indexOf(e)===t})).map((function(e){return zt(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,i=e||{},o=i.log,s=i.logPolicy,a=this.initOption||{},c=a.areaCode,d=a.logServerUrl,_=(r=c,void 0===r&&(r=exports.AreaCode.BJ),Dr[xr(r)].logUrlBase64).map((function(e){return n(n({},e),{addr:_r(e.addr)})})),f=[],p={level:1,itv:6,times:5};if(o)f.push.apply(f,l([],u(o.addrs),!1)),Object.assign(p,o.policy);else if(s)try{var h=JSON.parse(s);f.push({addr:h.url,protocol:H.HTTPS,weight:1}),p.level=h.level,p.itv=h.itv,p.times=h.times}catch(r){t.warn(B.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}var g=d?l([{addr:d,protocol:H.HTTPS,weight:101}],u(f),!1):l(l([],u(f),!1),u(_),!1);return{policy:p,addrs:g.filter((function(e,t){return g.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return n(n({},e),{addr:zt(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=exports.AreaCode.BJ),Dr[xr(t)].miniCmpBase64).map((function(e){return _r(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=exports.AreaCode.BJ),Dr[xr(t)].staticConfigUrlBase64).map((function(e){return _r(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=exports.AreaCode.BJ),Dr[xr(r)].cloudControllerUrlBase64).map((function(e){return _r(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:exports.AreaCode.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!exports.AreaCode[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=e||{},i=n.active,o=n.activeServer,s=(null==i?void 0:i.addrs)||[],a=(r=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===r&&(r=exports.AreaCode.BJ),Dr[xr(r)].statsUrlBase64).map((function(e){return _r(e)})),c=[];return 0!==s.length?c.push.apply(c,l([],u(s.sort((function(e,t){return t.weight-e.weight})).map((function(e){return zt(e.addr,e.protocol)}))),!1)):o&&c.push(zt(o,H.HTTPS)),a.forEach((function(e){c.includes(e)||c.push(e)})),c}}),e}(),jr=new Vr,kr=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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:if(!(t=this.getCache()))return[3,6];s.label=1;case 1:return s.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=s.sent(),(i=n.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return zt(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=s.sent(),this.logger.error(B.L_GET_STATIC_CONF_E,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),s.label=6;case 6:return[4,this._requestHandle()];case 7:return(a=s.sent())?[4,this.decryptData(a)]:[2];case 8:return(null==(u=s.sent())?void 0:u.areaCode)!==jr.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:a})),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 zt(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o,c,d,_,f,p;return s(this,(function(s){switch(s.label){case 0:e=(e=l(l([],u(this.staticUrls),!1),u(jr.getStaticConfigUrl()),!1).map((function(e){return zt(e)}))).filter((function(t,r){return e.indexOf(t)===r})),s.label=1;case 1:s.trys.push([1,6,7,8]),t=a(e),r=t.next(),s.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(B.L_GET_STATIC_CONF_T,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(o=s.sent(),c=o.code,d=o.data,200===c)return this.logger.info(B.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),[2,d];this.logger.warn(B.L_GET_STATIC_CONF_R,JSON.stringify({url:n,code:c,duration:Date.now()-i})),s.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return _=s.sent(),f={error:_},[3,8];case 7:try{r&&!r.done&&(p=t.return)&&p.call(t)}finally{if(f)throw f.error}return[7];case 8:return[2]}}))}))}}),e}();exports.LogL=void 0,(Gr=exports.LogL||(exports.LogL={}))[Gr.STATISTICS=-2]="STATISTICS",Gr[Gr.RECORD=-1]="RECORD",Gr[Gr.FATAL=0]="FATAL",Gr[Gr.ERROR=1]="ERROR",Gr[Gr.WARN=2]="WARN",Gr[Gr.INFO=3]="INFO",Gr[Gr.DEBUG=4]="DEBUG";var Fr,Br,Hr=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,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:exports.LogL.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,exports.LogL.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!==exports.LogL.DEBUG&&this.logDB.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 ct}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,r=e.tag,n=e.content,i=e.traceId,o=e.level,s=e.loggerId;if(console&&!(o<=exports.LogL.FATAL||o>this.outputLevel)){var a=["error","warn","info","debug"][o-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=s?s:this._id,"][").concat((a||"stat").toUpperCase(),"]: ").concat(r," | ").concat(n," | ").concat(i);console[a||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){(function(e){return[exports.LogL.DEBUG,exports.LogL.INFO,exports.LogL.WARN,exports.LogL.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,o,s){if(void 0===i&&(i={}),t.isOk){var a=null==o?void 0:o(t.data);this.info(e,JSON.stringify(n(n({isOk:!0},i),a)),r)}else{a=null==s?void 0:s(t.data);this.warn(e,JSON.stringify(n(n({code:t.code,msg:t.msg},i),a)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),qr=function(){function e(e,t,r,n,i,o){void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}return Object.defineProperty(e.prototype,"_getLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,a){return o(this,void 0,void 0,(function(){var i,o;return s(this,(function(s){switch(s.label){case 0:i=[],s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.logDB.read(e,t,r,n,a)];case 2:return o=s.sent(),ht(o.logs)&&(i=o.logs.filter((function(e){return!(!e||"object"!=typeof e)}))),[3,4];case 3:return s.sent(),[3,4];case 4:return[2,{logs:i}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=jr.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 o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,_,f,p;return s(this,(function(s){switch(s.label){case 0:return[4,this.compressLogs(e)];case 1:return i=s.sent(),o=i.success,a=i.data,o?(u=Rt(r)?r:"https://".concat(r),u+="?version=".concat("5.32.1-c-test-alpha.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:u,body:a,method:"POST"})]):[2,{isOk:!1,itv:n}];case 2:if(l=s.sent(),c=l.status,d=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,d)try{(p=JSON.parse(d)).nextTime&&(n=p.nextTime),_=p.level,f=p.logSwitch}catch(e){this.logger.warn(B.L_PARSE_JSON_E,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:_,logSwitch:f}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,c,d,_,f,p,h,g,E=this;return s(this,(function(s){switch(s.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||dt,a=Math.max(i-3e4,o+1),c=this.logger.createTraceId(),[4,this._getLogs(o,a,t,!0,c,n)];case 1:return 0!==(d=s.sent().logs).length?[3,2]:[3,4];case 2:return d.length>0?[4,this._sendLogs2Realtime(d,c,e,r)]:[3,4];case 3:_=s.sent(),f=_.itv,p=_.level,h=_.logSwitch,_.isOk&&(g=Math.max.apply(Math,l([],u(d.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(g+1),0===h&&(this.started=!1),void 0!==p&&(t=p)),r=f,s.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,i,a,u){return void 0===u&&(u=!1),o(this,void 0,void 0,(function(){var o,l,c,d,_,f,p,h;return s(this,(function(s){switch(s.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(o=this.logger.createTraceId(),this.logger.info(B.L_REPORT_FULL_LOG_T,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:a,isCloudControl:u}),o),[4,this._getLogs(e,t,exports.LogL.DEBUG,!1,o)]);case 1:return l=s.sent().logs,this.logger.info(B.L_REPORT_FULL_LOG_O,JSON.stringify({count:l.length}),o),c=Rt(n)?n:"https://".concat(n),c+="?version=".concat("5.32.1-c-test-alpha.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),l.length>0?[4,this.compressLogs(l)]:[3,3];case 2:return _=s.sent(),f=_.success,p=_.data,d=f?p:"compress failed",[3,4];case 3:d="no data or no database",s.label=4;case 4:return this.logger.debug(B.L_REPORT_FULL_LOG_O,"compress done",o),u&&(c+="&source=cloud"),[4,this.send({url:c,body:d,method:"POST"})];case 5:return h=s.sent().status,this.logger.info(B.L_REPORT_FULL_LOG_R,JSON.stringify({status:h}),o),[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}(),Yr=function(e){var t=e.sessionId,r=e.level,n=e.loggerId,i=e.traceId,o=e.time,s=e.tag,a=e.type,u=e.content;_t(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(o,",").concat(a,",").concat(r,",").concat(s,",").concat(l,"\n")};function Wr(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 Jr(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{logs:[]}]}))}))}function Kr(){}var Qr=function(){function e(e,t){Fr.set(this,void 0),Br.set(this,void 0),d(this,Fr,e,"f"),d(this,Br,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,c(this,Fr,"f").call(this,e,t,r,n,i)];case 1:return(o=s.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(Wr)}]:[2,{logs:[]}];case 2:return a=s.sent(),console.error("[LogDBProxy] read error",a),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{c(this,Br,"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&&d(this,Fr,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&d(this,Br,e,"f"),this}}),e}();function Xr(){return new Qr(Jr,Kr)}Fr=new WeakMap,Br=new WeakMap;var Zr,zr=function(){function e(){}var t,r,n,i,o,s;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,t,"f",r)||(d(this,t,e,"f",r),e.info(B.L_EVENT_LOOP_BLOCKING_S,"start"),c(this,t,"m",s).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,t,"f",r)&&(c(this,t,"f",r).info(B.L_EVENT_LOOP_BLOCKING_S,"stop"),d(this,t,null,"f",r),c(this,t,"f",n)&&(clearTimeout(c(this,t,"f",n)),d(this,t,null,"f",n)))}}),t=e,s=function e(){var s=this,a=Date.now();d(this,t,setTimeout((function(){var n=Date.now()-a;n>=c(s,t,"f",o)&&c(s,t,"f",r).warn(B.L_EVENT_LOOP_BLOCKING_S,"delta time: ".concat(n,"ms")),c(s,t,"m",e).call(s)}),c(this,t,"f",i)),"f",n)},r={value:null},n={value:null},i={value:30},o={value:1500},e}();!function(e){e[e.init=1]="init",e[e.newWorkChange=2]="newWorkChange",e[e.other=3]="other"}(Zr||(Zr={}));var $r=function(){function e(e){Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"uploadTask",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"taskLock",{enumerable:!0,configurable:!0,writable:!0,value:!0})}return Object.defineProperty(e.prototype,"uploadLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.uploadTask.push(e),this.enqueueTask()}}),Object.defineProperty(e.prototype,"reportLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o=this;this.taskLock=!1;var s=null!==(t=e.startTime)&&void 0!==t?t:0,a=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(s,a,u,l,e.logId,"",!0).finally((function(){o.taskLock=!0,o.uploadTask.length>0&&o.enqueueTask()})))}}),Object.defineProperty(e.prototype,"enqueueTask",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.taskLock){var e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}}}),e}();var en,tn,rn,nn,on=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 $r(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===me.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,It(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 o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,_,f;return s(this,(function(s){switch(s.label){case 0:return!this.isEable&&t===Zr.init&&this.isExire()?(this.logger.info(B.L_CLOUD_DISABLED,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===Zr.newWorkChange&&this.isOverclock()?(this.logger.info(B.L_CLOUD_OVERCLOCK,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=zt(e),this.lastRequestTime=(new Date).getTime(),i="".concat(n,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},r&&(o["RC-Token"]=r),a={platform:"web",version:"5.32.1-c-test-alpha.1",timestamp:this.timestamp},this.logger.record(ve.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,exports.HttpMethod.POST,o,a)]);case 1:return u=s.sent(),l=u.code,c=u.data,this.logger.record(ve.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),l===exports.ErrorCode.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(d=c.targetRegion,this.changeAreaCode===d?[2,this.timestamp]:(_=jr.setAreaCode(d),this.logger.info(B.L_CLOUD_SET_AREA_CODE_O,JSON.stringify({isChangeSuccess:_,originAreaCode:jr.getAreaCode(),newAreaCode:d})),this.changeAreaCode=d,(f=jr.getCloudControllerUrl(d))[0]?[2,this.request(f[0],Zr.other)]:(this.logger.info(B.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}(),sn=function(e){return e===exports.ErrorCode.RC_CONN_REDIRECTED},an=function(e){function r(t,r,n){var i=e.call(this)||this;return en.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:""}),nn.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:exports.RCConnectionStatus.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===exports.RCConnectionStatus.DISCONNECTED&&e===exports.RCConnectionStatus.CONNECTING&&(this._doConnectReason=Pe.CONNECT,c(this,en,"m",rn).call(this)),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED&&e===exports.RCConnectionStatus.SUSPENDED&&(t===exports.ErrorCode.RC_PING_EXCEED_LIMIT?this._doConnectReason=Pe.TIMEOUT:t===exports.ErrorCode.RC_CONN_REDIRECTED?this._doConnectReason=Pe.REDIRECTED:this._doConnectReason=Pe.RECONNECT),this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED){var r={bid:Xt(),cod:t,net:this.getNetwork().type,dur:Date.now()-c(this,nn,"f"),cid:this.cid};this.logger.record(ve.IM_CONNECTION_DURATION,JSON.stringify(r)),e===exports.RCConnectionStatus.SUSPENDED&&c(this,en,"m",rn).call(this)}switch(this._crtConnectionStatus=e,e){case exports.RCConnectionStatus.CONNECTED:this.logger.info(B.L_CONNECT_S,"status: ".concat(e)),this.checkAlive(),c(this,en,"m",tn).call(this).emit("onConnected",this._fromSuspend);break;case exports.RCConnectionStatus.CONNECTING:this.logger.warn(B.L_CONNECT_S,"status: ".concat(e)),c(this,en,"m",tn).call(this).emit("onConnecting");break;case exports.RCConnectionStatus.SUSPENDED:this._fromSuspend=!0,this.logger.warn(B.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),sn(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,en,"m",tn).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(B.L_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),c(this,en,"m",tn).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===exports.RCConnectionStatus.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(ve.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 o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus===exports.RCConnectionStatus.CONNECTED?[2,ur(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[4,this.try2Connect(e,t,!1,n,!0)]);case 1:return i=s.sent(),o=i.code,a=i.data,o!==exports.ErrorCode.SUCCESS?(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2,lr(o)]):(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2,ur(a)])}}))}))}}),Object.defineProperty(r.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,r,n,i),[4,this._crtConnectionTask]);case 1:return o=s.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(r.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c,_,f,p,h,g;return s(this,(function(s){switch(s.label){case 0:return o={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0},this.logger.record(ve.IM_STATS_CS,JSON.stringify(o)),a={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,r,!1,n,a)];case 1:return u=s.sent(),l=u.code,c=u.data,l!==exports.ErrorCode.SUCCESS?[2,lr(l)]:1===(_=c).type?[2,lr(exports.ErrorCode.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(B.L_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),_,t,n)]);case 2:return f=s.sent(),p=f.code,h=f.data,i||p===exports.ErrorCode.SUCCESS||(this.retryCount+=1),sn(p)?(this.logger.warn(B.L_CONNECT_R,"redirect code: ".concat(p),n),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,n,i)]):[exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP,exports.ErrorCode.CONNECTION_REFUSED].includes(p)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),g=this.cmpWeightCache.every((function(e){return e.failed})),i&&g?(this.logger.warn(B.L_CONNECT_R,"cpp code:".concat(p,",reture code:").concat(exports.ErrorCode.SERVER_UNAVAILABLE),n),[2,lr(exports.ErrorCode.SERVER_UNAVAILABLE)]):(this.logger.warn(B.L_CONNECT_R,"cmp ack timeout, code: ".concat(p),n),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,p),this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,i)])):p!==exports.ErrorCode.SUCCESS?(this.logger.warn(B.L_CONNECT_R,"code: ".concat(p),n),[2,lr(p)]):(this.logger.info(B.L_CONNECT_R,"userId: ".concat(h),n),d(this,nn,Date.now(),"f"),this._crtUserId=h,[2,ur(h)])}}))}))}}),Object.defineProperty(r.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){return r=this.logger.createTraceId(),this.logger.debug(B.T,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return o(i,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.SUSPENDED?[2]:(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=s.sent(),o=i.code,a=i.isOk,this.reconnectTimer=null,a?(this.setConnectionStatus(exports.RCConnectionStatus.CONNECTED),[2]):[exports.ErrorCode.SERVER_UNAVAILABLE,exports.ErrorCode.TIMEOUT,exports.ErrorCode.RC_SOCKET_DISCONNECTED,exports.ErrorCode.RC_SOCKET_NOT_CREATED,exports.ErrorCode.RC_CONN_ACK_TIMEOUT,exports.ErrorCode.RC_TCP_RESET,exports.ErrorCode.RC_NAVI_REQ_FAILED,exports.ErrorCode.RC_NETWORK_DOWN,exports.ErrorCode.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTING||(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,o),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,o),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(r.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return sn(e)?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===exports.ErrorCode.RC_UDP_DISCONNECTED?(this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(exports.RCConnectionStatus.DISCONNECTED,e)}}),Object.defineProperty(r.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(r.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?(this._failedCount=0,this.logger.debug(B.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(B.L_CHECK_ALIVE_IM_T,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===exports.ErrorCode.SUCCESS?(this.logger.debug(B.L_CHECK_ALIVE_IM_R,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==exports.RCConnectionStatus.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(B.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(B.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(exports.RCConnectionStatus.SUSPENDED,exports.ErrorCode.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,exports.ErrorCode.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(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(exports.RCConnectionStatus.DISCONNECTED,exports.ErrorCode.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 l([],u(this.cmpWeightCache),!1);var r=Mt(e,t);return this.cmpWeightCache=l([],u(r),!1),l([],u(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===H.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var o=Math.min.apply(Math,l([],u(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==o&&(n.weight=o-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}(ir);nn=new WeakMap,en=new WeakSet,tn=function(){return this},rn=function(){this.uuid=lt.gen(),this.retryCount=0};var un=function(e){return e.replace(/@.+$/,"@")},ln=function(){function e(e,t,r,n,i,o){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isUseDynamicNaviUrl",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"crtRequest",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:"default"})}return Object.defineProperty(e.prototype,"getCatchKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e+(this._environment?"-".concat(this._environment):"")}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,r,n,i),[4,this.crtRequest]);case 1:return o=s.sent(),this.crtRequest=null,[2,o]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var a;return o(this,void 0,void 0,(function(){var o,u,l,c,d,_,f,p,h,g,E,b,T,v,R,I,m;return s(this,(function(s){switch(s.label){case 0:return o=un(e),u=this.getNaviCache(o),!t&&u&&(l=u.timestamp,c=u.naviInfo,r||Date.now()-l<je)?(this.logger.info(B.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:c}),n),i&&(d=i.uuid,_=i.retryCount,f=i.reason,p={bid:Xt(),ptc:Se.NAVI,cod:exports.ErrorCode.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(a=c.type)&&void 0!==a?a:0,hos:"",cache:Oe.LOCAL,v:Ce.CURRENT,rsn:f,cid:"".concat(d,"_").concat(_),count:_},this.logger.record(ve.IM_NAVI,JSON.stringify(p),n)),[2,ur(c)]):(h=jr.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(B.L_GET_NAVI_T,JSON.stringify({token:e,uris:h}),n),[4,this.requestHandler(h,e,n,i)]);case 1:return g=s.sent(),E=g.code,b=g.data,E===exports.ErrorCode.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(T=s.sent())?void 0:T.navi)&&(null==T?void 0:T.navi.length)>0?(v=T.navi,[4,this.requestHandler(v,e,n,i)]):[3,4];case 3:R=s.sent(),E=R.code,b=R.data,s.label=4;case 4:return E!==exports.ErrorCode.SUCCESS?(this.logger.warn(B.L_GET_NAVI_R,E,n),[2,lr(E)]):(I=b).code&&200!==I.code?(this.logger.warn(B.L_GET_NAVI_R,I.code,n),[2,lr(this.transHttpCode(I.code))]):Mt(I).length>0?(this.logger.info(B.L_GET_NAVI_R,JSON.stringify({naviInfo:I}),n),this.setNaviCache(o,I),[2,ur(I)]):(m={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(B.L_GET_NAVI_R,"navi server address invalid: ".concat(JSON.stringify(m)),n),[2,lr(exports.ErrorCode.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,_,f;return s(this,(function(s){switch(s.label){case 0:i=0,o=e.length,s.label=1;case 1:return i<o?(a=i===e.length-1,u=this.useV2Navi()?this.httpRequestV2:this.httpRequest,l=Date.now(),[4,u.call(this,e[i],this.appkey,t,r,a)]):[3,4];case 2:if(c=s.sent(),d=c.code,_=c.data,f={bid:Xt(),ptc:Se.NAVI,cod:d,net:null==n?void 0:n.type,dur:Date.now()-l,spr:0,pr:(null==_?void 0:_.type)||0,hos:e[i],cache:Oe.REQUEST,v:Ce.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(ve.IM_NAVI,JSON.stringify(f),r),[exports.ErrorCode.SUCCESS,exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,exports.ErrorCode.RC_LICENSE_EXPIRED].includes(d))return[2,d===exports.ErrorCode.SUCCESS?ur(_):lr(d)];s.label=3;case 3:return i+=1,[3,1];case 4:return[2,lr(exports.ErrorCode.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 exports.ErrorCode.RC_CONN_TOKEN_INCORRECT;case 416:return exports.ErrorCode.RC_LICENSE_EXPIRED;default:return exports.ErrorCode.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(un(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(un(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,o=e.protocol,s=e.mac;t="".concat(r,"/v2/navi.json?cloud=").concat(0);var a="token=".concat(encodeURIComponent(n),"&v=").concat(Be,"&platfrom=").concat(i);return s&&(a+="&m=".concat(s)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(o,";rtc=4;log=2;iptype=v4,v6")},body:a,url:t,timeout:1e4}}}),Object.defineProperty(e.prototype,"useV2Navi",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),cn=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 dn(e){return cn.get(e)||{isCustom:!0,isPersited:!1,isCounted:!1,isStatusMessage:!1}}var _n,fn,pn,hn={MECHANICAL:0,INTELLIGENT:1},gn=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}(),En=function(e){function r(t,r,n,i){return e.call(this,t,r,n,i)||this}return t(r,e),r}(gn),bn=function(e){function r(t,r,n){return e.call(this,Cr(t),r,n,t)||this}return t(r,e),r}(gn),Tn={NONE:0,TRANSLATING:1,SUCCESS:2,FAILED:3},vn={DEFAULT:0,AUTO_ON:1,AUTO_OFF:2},Rn=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))},In=function(){function e(e){_n.add(this),fn.set(this,void 0),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),d(this,fn,e,"f"),this._logger=e.logger}return Object.defineProperty(e.prototype,"open",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return e=e.sort((function(e,t){return t.weight-e.weight})),[2,c(this,_n,"m",pn).call(this,e,c(this,fn,"f"))]}))}))}}),e}();fn=new WeakMap,_n=new WeakSet,pn=function e(t,r){return o(this,void 0,void 0,(function(){var n,i,a,u=this;return s(this,(function(l){switch(l.label){case 0:return 0===t.length?[2,lr(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL,"All addrs failed")]:(n=t.shift(),i=zt(n.addr,n.protocol),i="".concat(i,"/v3/message/get_stream.json?sdkVersion=").concat("5.32.1-c-test-alpha.1","&platform=Websocket&messageUID=").concat(r.msgUId),this._logger.info(B.L_REQ_STREAM_MSG_CONTENT_O,"try open -> ".concat(i)),[4,this._openHandler(i,r)]);case 1:return[2,(a=l.sent()).or((function(n){return o(u,void 0,void 0,(function(){return s(this,(function(i){return-1===n?[2,c(this,_n,"m",e).call(this,t,r)]:[2,a]}))}))}))]}}))}))};var mn=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 o(this,void 0,void 0,(function(){var r,n,i,o,a=this;return s(this,(function(s){return r=pr(),n=r.resolve,i=r.promise,(o=new XMLHttpRequest).open("GET",e,!0),o.timeout=t.timeout,o.ontimeout=function(){a._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"timeout -> ".concat(e)),n(lr(-1,"timeout"))},o.onreadystatechange=function(r){if(o.readyState===XMLHttpRequest.HEADERS_RECEIVED){var i=o.getResponseHeader("Content-Type"),s=null==i?void 0:i.startsWith("text/event-stream");if(200===o.status&&s){n(ur());var u=0;o.onprogress=function(e){var r=o.response.slice(u);u=o.response.length,t.onRawContent(r)},o.onerror=function(r){a._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"network error in transit -> ".concat(e)),o.onprogress=null,o.abort(),t.onNetworkError(exports.ErrorCode.STREAM_MESSAGE_REQUEST_FAIL)}}else o.onloadend=function(){var e=JSON.parse(o.response);n(lr(e.code,e.message))}}},o.onerror=function(t){a._logger.warn(B.L_REQ_STREAM_MSG_CONTENT_E,"req fail -> ".concat(e)),n(lr(-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}(In),yn=Rn();var An=null,Sn=function(e){return o(void 0,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,Cn.getNetworkType()];case 1:return t=r.sent(),An({status:"online"===e.type,type:t}),[2]}}))}))};var On,Cn={tag:"browser",httpReq:function(e){return Nr(e).result()},get localStorage(){return localStorage},get sessionStorage(){return sessionStorage},useNavi:!0,connectPlatform:"",isFromUniapp:yn,createWebSocket:function(e,t){var r=new WebSocket(e,t);return r.binaryType="arraybuffer",Promise.resolve(ur({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){An=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",Sn),window.addEventListener("online",Sn))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",Sn),window.removeEventListener("online",Sn)),An=null},createSSEClient:function(e){return ur(new mn(e))},getApiVer:function(){var e=Cn.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 o=r.match(n[i]);if(o){t=i,e=o[1]||o[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.pullSeAtts=58]="pullSeAtts",e[e.setSeAtt=59]="setSeAtt",e[e.qnTkn=60]="qnTkn",e[e.qnUrl=61]="qnUrl",e[e.aliUrl=62]="aliUrl",e[e.s3Url=63]="s3Url",e[e.stcUrl=64]="stcUrl",e[e.minioUrl=65]="minioUrl",e[e.cleanPMsg=66]="cleanPMsg",e[e.cleanGMsg=67]="cleanGMsg",e[e.cleanCMsg=68]="cleanCMsg",e[e.cleanSMsg=69]="cleanSMsg",e[e.cleanMCMsg=70]="cleanMCMsg",e[e.cleanMPMsg=71]="cleanMPMsg",e[e.cleanMsgBatch=72]="cleanMsgBatch",e[e.rtcPing=73]="rtcPing",e[e.rtc_ntf=74]="rtc_ntf",e[e.rtcSetOutData=75]="rtcSetOutData",e[e.rtcQryUserOutData=76]="rtcQryUserOutData",e[e.addSeTag=77]="addSeTag",e[e.delSeTag=78]="delSeTag",e[e.addTag=79]="addTag",e[e.delTag=80]="delTag",e[e.reportsdk=81]="reportsdk",e[e.pullUgSes=82]="pullUgSes",e[e.pullUgMsg=83]="pullUgMsg",e[e.ugMsg=84]="ugMsg",e[e.qryUgMsg=85]="qryUgMsg",e[e.updUgRTime=86]="updUgRTime",e[e.upMsgEx=87]="upMsgEx",e[e.modifyMsg=88]="modifyMsg",e[e.qryMsgChange=89]="qryMsgChange",e[e.qryMsg=90]="qryMsg",e[e.operate=91]="operate",e[e.s_opNtf=92]="s_opNtf",e[e.ugUnpushQuery=93]="ugUnpushQuery",e[e.ugUnpushSet=94]="ugUnpushSet",e[e.setRtcRoomId=95]="setRtcRoomId",e[e.qryUgUal=96]="qryUgUal",e[e.updUserSub=97]="updUserSub",e[e.pullUserSub=98]="pullUserSub",e[e.pullSubData=99]="pullSubData",e[e.qrySubData=100]="qrySubData",e[e.pullUserProfile=101]="pullUserProfile",e[e.pullOwnProfile=102]="pullOwnProfile",e[e.updProfilePermiss=103]="updProfilePermiss",e[e.qProfilePermiss=104]="qProfilePermiss",e[e.searchUserProfile=105]="searchUserProfile",e[e.updUserProfile=106]="updUserProfile",e[e.pullEventChange=107]="pullEventChange",e[e.channelCreate=108]="channelCreate",e[e.upChannelInfo=109]="upChannelInfo",e[e.qChannelInfo=110]="qChannelInfo",e[e.channelMemKick=111]="channelMemKick",e[e.channelMemQuit=112]="channelMemQuit",e[e.channelDismiss=113]="channelDismiss",e[e.channelTransfer=114]="channelTransfer",e[e.upChannelManager=115]="upChannelManager",e[e.qChannelMem=116]="qChannelMem",e[e.qChannelSpeMem=117]="qChannelSpeMem",e[e.upChannelMem=118]="upChannelMem",e[e.channelMemJoin=119]="channelMemJoin",e[e.channelMemInvite=120]="channelMemInvite",e[e.channelApplyResp=121]="channelApplyResp",e[e.qChannelApplyList=122]="qChannelApplyList",e[e.qChannelMemJoin=123]="qChannelMemJoin",e[e.qChannelMemSpeJoin=124]="qChannelMemSpeJoin",e[e.upChannelRemark=125]="upChannelRemark",e[e.qChannelRemark=126]="qChannelRemark",e[e.upChannelFollow=127]="upChannelFollow",e[e.qChannelFollow=128]="qChannelFollow",e[e.qSimpleUserProfile=129]="qSimpleUserProfile",e[e.friendAdd=130]="friendAdd",e[e.friendDel=131]="friendDel",e[e.friendHandle=132]="friendHandle",e[e.friendSetPf=133]="friendSetPf",e[e.friendCheck=134]="friendCheck",e[e.friendsQuery=135]="friendsQuery",e[e.friendApplyDel=136]="friendApplyDel",e[e.friendsInfoQry=137]="friendsInfoQry",e[e.friendAuthSet=138]="friendAuthSet",e[e.friendAuthGet=139]="friendAuthGet",e[e.addUnpush=140]="addUnpush",e[e.qryUnpush=141]="qryUnpush",e[e.delUnpush=142]="delUnpush",e[e.s_pubCall=143]="s_pubCall",e[e.reqCall=144]="reqCall",e[e.pullKvMsg=145]="pullKvMsg",e[e.readReceipt=146]="readReceipt",e[e.qryReceipt=147]="qryReceipt",e[e.qryReceiptBatch=148]="qryReceiptBatch",e[e.upConvertMsg=149]="upConvertMsg",e[e.pullModifyMsg=150]="pullModifyMsg",e[e.qAppBot=151]="qAppBot",e[e.qBot=152]="qBot"}(On||(On={}));var Nn=function(e){var t=On[e];return t},Pn=function(e){return On[e]},Ln=0,Mn=1,wn=2,Un=3,Dn=4,xn=5,Gn=6,Vn=7,jn=12,kn=13,Fn=14,Bn=4,Hn=3,qn="rtcRJoin_data",Yn="rtcRExit",Wn="rtcUPut",Jn="rtcUDel",Kn="rtcSetData",Qn="userSetData",Xn="rtcQryData",Zn="rtcDelData",zn="rtcToken",$n="rtcUserState",ei="rtcUList",ti="viewerJoinR",ri="viewerExitR",ni="rtcPullKv",ii="rtcIdentityChange",oi="rtcInvite",si="rtcCancelInvite",ai="rtcInviteAnswer",ui="rtcEndInvite",li="rtcQueryJoined",ci=0,di=1,_i=2,fi=3,pi=4,hi=5,gi=6,Ei=7,bi=8,Ti=9,vi=10,Ri=11,Ii=12,mi=13,yi=14,Ai=15,Si=16,Oi=17,Ci=18,Ni=19,Pi=20,Li=1,Mi=2,wi=4,Ui=5,Di=6,xi=7,Gi=8,Vi=9,ji=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,o=r.length;i<o;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 o=e.charCodeAt(n);o>=0&&o<=127?(r+=1,t.push(o)):o>=128&&o<=2047?(r+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(r+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}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,o=e,s="";++i<o.length;){var a=Number(o[i]);if(a===(127&a)||(240&~a?224&~a?192&~a||(a=(a^=192)<<6|128^o[++i]):a=(a=(a^=224)<<6|128^o[++i])<<6|128^o[++i]:a=(a=(a=(a^=240)<<6|128^o[++i])<<6|128^o[++i])<<6|128^o[++i]),!Number.isFinite(a)||a<0||a>1114111||Math.floor(a)!==a)throw RangeError("Invalid code point: ".concat(a));a<=65535?n.push(a):(t=(a-=65536)>>10|55296,r=a%1024|56320,n.push(t,r)),(i+1===o.length||n.length>16384)&&(s+=String.fromCharCode.apply(null,n),n.length=0)}return s}}),e}(),ki=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 ji.readUTF(r)}}),Object.defineProperty(e.prototype,"readAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._pool.subarray(this._position,this._poolLen)}}),e}(),Fi=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(l([],u(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=ji.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}(),Bi=function(){function e(e,t,r,n){void 0===t&&(t=Mn),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}(),Hi=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}(),qi=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 Bi(e,Ln)}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 Fi;this.write(e);var t=e.getBytesArray();return new Int8Array(t).buffer}}),e}(),Yi=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===Bn){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}(Hi),Wi=function(e){function r(t){var r=e.call(this,Fn)||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}(qi),Ji=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}(Hi),Ki=function(e){function r(){return e.call(this,jn)||this}return t(r,e),Object.defineProperty(r.prototype,"writeMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){}}),r}(qi),Qi=function(e){function r(t){return e.call(this,t)||this}return t(r,e),r}(Hi),Xi=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}(Hi),Zi=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}(qi),zi=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}(Xi),$i=function(e){function r(t,r,n,i){var o=e.call(this,t)||this;return Object.defineProperty(o,"targetId",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"pbData",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"topic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o.topic="string"==typeof r?r:Pn(r),o}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}(Zi),eo=function(e){function r(t,r,n){return e.call(this,xn,t,n,r)||this}return t(r,e),r}($i),to=function(e){function r(t,r,n){return e.call(this,Un,t,n,r)||this}return t(r,e),r}($i),ro=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}(Xi),no=function(e){function r(t){var r=e.call(this,Dn)||this;return r.messageId=t,r}return t(r,e),r}(Zi),io=function(e){function r(t){var r=e.call(this,Vn)||this;return r.messageId=t,r}return t(r,e),r}(Zi),oo=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}(Xi),so=function(e,t){var r=new Uint8Array(e),n=new ki(r),i=n.readByte(),o=function(e){var t,r=e.command;switch(r){case wn:t=new Yi(e);break;case Un:t=new zi(e);break;case Dn:t=new ro(e);break;case Gn:t=new oo(e);break;case kn:t=new Qi(e);break;case Fn:t=new Ji(e);break;default:console.error("No support for deserializing ".concat(r," messages"))}return t}(Bi.parse(i));return o&&o.read(n,r.length-1,t),o},ao=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=pr(),n=r.resolve,i=r.promise,o=this._logger,s=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(ur());else{var r=JSON.parse(e.data),i=r.code,o=r.message;n(lr(i,o))}},fail:function(t){var r=t.errMsg,i=t.errno;o.warn(B.L_REQ_STREAM_MSG_CONTENT_E,JSON.stringify({url:e,errMsg:r,errno:i})),n(lr(-1,t.errMsg))},complete:function(){o.debug(B.L_REQ_STREAM_MSG_CONTENT_O,"req complete -> ".concat(e))}});return s.onChunkReceived((function(e){var r=ji.readUTF(new Uint8Array(e.data));o.debug(B.L_REQ_STREAM_MSG_CONTENT_O,"chunk received -> ".concat(r)),t.onRawContent(r)})),i}}),r}(In),uo=Rn(),lo=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return wx[e].apply(wx,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},co={setItem:lo("setStorageSync"),getItem:lo("getStorageSync"),removeItem:lo("removeStorageSync"),clear:lo("clearStorageSync")},_o=null,fo=function(e){var t=e.isConnected,r=e.networkType;_o({status:t,type:r})};var po={tag:"wechat",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||ke,n=e.headers,i=e.query,o=e.body,s=Ft(e.url,i);return new Promise((function(e){wx.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:co,sessionStorage:co,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:uo,createWebSocket:function(e,t){var r=wx.connectSocket({url:e,protocols:t});return Promise.resolve(ur({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){_o=e,wx.onNetworkStatusChange(fo)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(fo),_o=null},createSSEClient:function(e){return ur(new ao(e))},get runtimeInfo(){return{type:po.tag,version:"Unknown"}}},ho=Rn(),go=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var n=my[e]({key:t[0]}).data;return n?JSON.stringify(n):n}catch(e){}}},Eo={setItem:go("setStorageSync"),getItem:go("getStorageSync"),removeItem:go("removeStorageSync"),clear:go("clearStorageSync")},bo=null,To=function(e){var t=e.isConnected,r=e.networkType;bo({status:t,type:r})};var vo={tag:"alipay",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||ke,n=e.headers,i=e.query,o=e.body,s=Ft(e.url,i),a=e.dataType||"json";return new Promise((function(e){my.request({url:s,method:t,headers:n,timeout:r,data:o,dataType:a,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Eo,sessionStorage:Eo,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ho,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return Promise.resolve(ur({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){bo=e,my.onNetworkStatusChange(To)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(To),bo=null},createSSEClient:function(e){return lr(exports.ErrorCode.NOT_SUPPORT,"Not supported yet")},get runtimeInfo(){return{type:vo.tag,version:"Unknown"}}},Ro=Rn(),Io=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return tt[e].apply(tt,l([],u(t),!1))}catch(e){}}},mo={setItem:Io("setStorageSync"),getItem:Io("getStorageSync"),removeItem:Io("removeStorageSync"),clear:Io("clearStorageSync")},yo=null,Ao=function(e){var t=e.isConnected,r=e.networkType;yo({status:t,type:r})};var So={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ro,localStorage:mo,sessionStorage:mo,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:exports.ErrorCode.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(lr(exports.ErrorCode.RC_SOCKET_DISCONNECTED,e.errMsg))}});r(ur({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){yo=e,tt.onNetworkStatusChange(Ao)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(Ao),yo=null},createSSEClient:function(e){return lr(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:So.tag,version:"Unknown"}}},Oo=Rn(),Co=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return swan[e].apply(swan,l([],u(t),!1))}catch(e){}}},No={setItem:Co("setStorageSync"),getItem:Co("getStorageSync"),removeItem:Co("removeStorageSync"),clear:Co("clearStorageSync")},Po=null,Lo=function(e){var t=e.isConnected,r=e.networkType;Po({status:t,type:r})};var Mo={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Oo,localStorage:No,sessionStorage:No,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:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=swan.connectSocket({url:e,protocols:t});return Promise.resolve(ur({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 o(this,void 0,void 0,(function(){return s(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){Po=e,swan.onNetworkStatusChange(Lo)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Lo),Po=null},createSSEClient:function(e){return lr(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Mo.tag,version:"Unknown"}}},wo=Rn(),Uo=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return jd[e].apply(jd,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Do={setItem:Uo("setStorageSync"),getItem:Uo("getStorageSync"),removeItem:Uo("removeStorageSync"),clear:Uo("clearStorageSync")},xo=null,Go=function(e){var t=e.isConnected,r=e.networkType;xo({status:t,type:r})};var Vo={tag:"jingdong",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||ke,n=e.headers,i=e.query,o=e.body,s=Ft(e.url,i);return new Promise((function(e){jd.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Do,sessionStorage:Do,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:wo,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),Promise.resolve(ur({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){xo=e,jd.onNetworkStatusChange(Go)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Go),xo=null},createSSEClient:function(e){return lr(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:Vo.tag,version:"Unknown"}}},jo=Rn(),ko=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return ks[e].apply(ks,l([],u(t),!1))}catch(e){}}},Fo={setItem:ko("setStorageSync"),getItem:ko("getStorageSync"),removeItem:ko("removeStorageSync"),clear:ko("clearStorageSync")},Bo=null,Ho=function(e){var t=e.isConnected,r=e.networkType;Bo({status:t,type:r})};var qo={tag:"kuaishou",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:jo,localStorage:Fo,sessionStorage:Fo,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:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var r=ks.connectSocket({url:e,protocols:t});return Promise.resolve(ur({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){Bo=e,ks.onNetworkStatusChange(Ho)},removeNetworkStatusListener:function(){ks.offNetworkStatusChange(Ho),Bo=null},createSSEClient:function(e){return lr(exports.ErrorCode.NOT_SUPPORT)},get runtimeInfo(){return{type:qo.tag,version:"Unknown"}}},Yo=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{return uni[e].apply(uni,l([],u(t),!1))}catch(e){null===console||void 0===console||console.error(e)}}},Wo={setItem:Yo("setStorageSync"),getItem:Yo("getStorageSync"),removeItem:Yo("removeStorageSync"),clear:Yo("clearStorageSync")},Jo=null,Ko=function(e){var t=e.isConnected,r=e.networkType;Jo({status:t,type:r})};var Qo={tag:"uniapp",httpReq:function(e){var t=e.method||exports.HttpMethod.GET,r=e.timeout||ke,n=e.headers,i=e.query,o=e.body,s=Ft(e.url,i);return new Promise((function(e){uni.request({url:s,method:t,header:n,timeout:r,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:exports.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:Wo,sessionStorage:Wo,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(ur({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){Jo=e,uni.onNetworkStatusChange(Ko)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Ko),Jo=null},createSSEClient:function(e){return lr(exports.ErrorCode.NOT_SUPPORT)},getApiVer:function(){var e=uni.getSystemInfoSync(),t=e.osAndroidAPILevel,r=e.deviceModel,n=e.deviceBrand,i=e.osVersion,o="android"===e.osName?t:i;return"".concat(n||"","|").concat(r||"","|").concat(o||"","|||uniapp").replace(/-/g,"_")},get runtimeInfo(){return{type:Qo.tag,version:"Unknown"}}},Xo=function(e){return e&&e.request&&e.getSystemInfo},Zo="undefined"!=typeof uni&&Xo(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":case"app":case"app-harmony":return Qo;case"mp-jd":return Vo;case"mp-baidu":return Mo;case"mp-toutiao":return So;case"mp-alipay":return vo;case"mp-weixin":return po;case"mp-kuaishou":return qo;default:return Cn}}():"undefined"!=typeof jd&&Xo(jd)?Vo:"undefined"!=typeof my&&Xo(my)?vo:"undefined"!=typeof tt&&Xo(tt)?So:"undefined"!=typeof ks&&Xo(ks)?qo:"undefined"!=typeof swan&&Xo(swan)?Mo:"undefined"!=typeof wx&&Xo(wx)?po:Cn;const zo=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 o(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function s(){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 a(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,d=r?i-1:0,_=r?-1:1,f=e[t+d];for(d+=_,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+e[t+d],d+=_,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+d],d+=_,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=l}return(f?-1:1)*s*Math.pow(2,o-n)}function u(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,d=c>>1,_=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+d>=1?_/u:_*Math.pow(2,1-d))*u>=2&&(s++,u/=2),s+d>=c?(a=0,s=c):s+d>=1?(a=(t*u-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+f]=255&s,f+=p,s/=256,l-=8);e[r+f-p]|=128*h}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 o,s=0,a=0,u=e.length;a<u;++a)t.isByteBuffer(e[a])||(e[a]=t.wrap(e[a],r)),(o=e[a].limit-e[a].offset)>0&&(s+=o);if(0===s)return new t(0,n,i);var l,c=new t(s,n,i);for(a=0;a<u;)(o=(l=e[a++]).limit-l.offset)<=0||(c.view.set(l.view.subarray(l.offset,l.limit),c.offset),c.offset+=o);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,o){if("string"!=typeof n&&(o=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 s;if(t.isByteBuffer(e))return(s=r.clone.call(e)).markedOffset=-1,s;if(e instanceof Uint8Array)s=new t(0,i,o),e.length>0&&(s.buffer=e.buffer,s.offset=e.byteOffset,s.limit=e.byteOffset+e.byteLength,s.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)s=new t(0,i,o),e.byteLength>0&&(s.buffer=e,s.offset=0,s.limit=e.byteLength,s.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(s=new t(e.length,i,o)).limit=e.length;for(var a=0;a<e.length;++a)s.view[a]=e[a]}return s},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,o=e.length,s=o>>3,a=0;for(t+=this.writeVarint32(o,t);s--;)n=1&!!e[a++]|(1&!!e[a++])<<1|(1&!!e[a++])<<2|(1&!!e[a++])<<3|(1&!!e[a++])<<4|(1&!!e[a++])<<5|(1&!!e[a++])<<6|(1&!!e[a++])<<7,this.writeByte(n,t++);if(a<o){var u=0;for(n=0;a<o;)n|=(1&!!e[a++])<<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,o=i>>3,s=0,a=[];for(e+=n.length;o--;)r=this.readByte(e++),a[s++]=!!(1&r),a[s++]=!!(2&r),a[s++]=!!(4&r),a[s++]=!!(8&r),a[s++]=!!(16&r),a[s++]=!!(32&r),a[s++]=!!(64&r),a[s++]=!!(128&r);if(s<i){var u=0;for(r=this.readByte(e++);s<i;)a[s++]=!!(r>>u++&1)}return t&&(this.offset=e),a},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 o=t.low,s=t.high;return this.littleEndian?(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,r+=4,this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s):(this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s,r+=4,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),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 o=new e(n,i,!1);return r&&(this.offset+=8),o},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 o=t.low,s=t.high;return this.littleEndian?(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,r+=4,this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s):(this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s,r+=4,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),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 o=new e(n,i,!0);return r&&(this.offset+=8),o},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=a(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=a(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,o=t.calculateVarint32(e);r+=o;var s=this.buffer.byteLength;for(r>s&&this.resize((s*=2)>r?s:r),r-=o,e>>>=0;e>=128;)i=127&e|128,this.view[r++]=i,e>>>=7;return this.view[r++]=e,n?(this.offset=r,this):o},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 o=Error("Truncated");throw o.truncated=!0,o}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 o=t.calculateVarint64(r),s=r.toInt()>>>0,a=r.shiftRightUnsigned(28).toInt()>>>0,u=r.shiftRightUnsigned(56).toInt()>>>0;n+=o;var l=this.buffer.byteLength;switch(n>l&&this.resize((l*=2)>n?l:n),n-=o,o){case 10:this.view[n+9]=u>>>7&1;case 9:this.view[n+8]=9!==o?128|u:127&u;case 8:this.view[n+7]=8!==o?a>>>21|128:a>>>21&127;case 7:this.view[n+6]=7!==o?a>>>14|128:a>>>14&127;case 6:this.view[n+5]=6!==o?a>>>7|128:a>>>7&127;case 5:this.view[n+4]=5!==o?128|a:127&a;case 4:this.view[n+3]=4!==o?s>>>21|128:s>>>21&127;case 3:this.view[n+2]=3!==o?s>>>14|128:s>>>14&127;case 2:this.view[n+1]=2!==o?s>>>7|128:s>>>7&127;case 1:this.view[n]=1!==o?128|s:127&s}return i?(this.offset+=o,this):o},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,o=0,s=0,a=0;if(i=127&(a=this.view[t++]),128&a&&(i|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(o=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(s=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<7,128&a||this.noAssert&&void 0===a))))))))))throw Error("Buffer overrun");var u=e.fromBits(i|o<<28,o>>>4|s<<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(o(e))[1],t+=i+1;var s=this.buffer.byteLength;return t>s&&this.resize((s*=2)>t?s:t),t-=i+1,c.encodeUTF16toUTF8(o(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=s(),!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(o(e),this.noAssert)[1],t+=4+n;var s=this.buffer.byteLength;if(t>s&&this.resize((s*=2)>t?s: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(o(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),o=this.readUTF8String(i,t.METRICS_BYTES,e+=4);return e+=o.length,r?(this.offset=e,o.string):{string:o.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(o(e))[1],t+=r;var s=this.buffer.byteLength;return t>s&&this.resize((s*=2)>t?s:t),t-=r,c.encodeUTF16toUTF8(o(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(o(e))[0]},t.calculateUTF8Bytes=function(e){return c.calculateUTF16asUTF8(o(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 o,a=0,u=n;if(r===t.METRICS_CHARS){if(o=s(),c.decodeUTF8(function(){return a<e&&n<this.limit?this.view[n++]:null}.bind(this),(function(e){++a,c.UTF8toUTF16(e,o)})),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return i?(this.offset=n,o()):{string:o(),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),o=s(),this.noAssert),n!==l)throw RangeError("Illegal range: Truncated data, "+n+" == "+l);return i?(this.offset=n,o()):{string:o(),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,s,a=r;i=c.calculateUTF16asUTF8(o(e),this.noAssert)[1],s=t.calculateVarint32(i),r+=s+i;var u=this.buffer.byteLength;if(r>u&&this.resize((u*=2)>r?u:r),r-=s+i,r+=this.writeVarint32(i,r),c.encodeUTF16toUTF8(o(e),function(e){this.view[r++]=e}.bind(this)),r!==a+i+s)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+i+s));return n?(this.offset=r,this):r-a},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),o=this.readUTF8String(i.value,t.METRICS_BYTES,e+=i.length);return e+=o.length,r?(this.offset=e,o.string):{string:o.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 o=e.limit-e.offset;if(o<=0)return this;n+=o;var s=this.buffer.byteLength;return n>s&&this.resize((s*=2)>n?s:n),n-=o,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=o,i&&(this.offset+=o),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),o=new Uint8Array(i);return o.set(this.view.subarray(e,t)),this.buffer=i,this.view=o,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 o,s;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(s=void 0===r)?e.offset:0|r,n=(o=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 a=i-n;return 0===a?e:(e.ensureCapacity(r+a),e.view.set(this.view.subarray(n,i),r),o&&(this.offset+=a),s&&(e.offset+=a),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 o=e.limit-e.offset;if(o<=0)return this;var s=o-n;if(s>0){var a=new ArrayBuffer(this.buffer.byteLength+s),u=new Uint8Array(a);u.set(this.view.subarray(n,this.buffer.byteLength),o),this.buffer=a,this.view=u,this.offset+=s,this.markedOffset>=0&&(this.markedOffset+=s),this.limit+=s,n+=s}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),n-o),e.offset=e.limit,i&&(this.offset-=o),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,o;function s(e){throw Error("Illegal character code: "+e)}for(;null!==(n=e());)if(void 0===(i=r[n])&&s(n),null!==(n=e())&&(void 0===(o=r[n])&&s(n),t(i<<2>>>0|(48&o)>>4),null!==(n=e()))){if(void 0===(i=r[n])){if(61===n)break;s(n)}if(t((15&o)<<4>>>0|(60&i)>>2),null!==(n=e())){if(void 0===(o=r[n])){if(61===n)break;s(n)}t((3&i)<<6>>>0|o)}}},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=s()),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(o(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,o=e.length,s=new t(o,r);i<o;){if((n=e.charCodeAt(i))>255)throw RangeError("illegal char code: "+n);s.view[i++]=n}return s.limit=o,s},r.toDebug=function(e){for(var t,r=-1,n=this.buffer.byteLength,i="",o="",s="";r<n;){if(-1!==r&&(i+=(t=this.view[r])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==n){for(;i.length<51;)i+=" ";s+=i+o+"\n",i=o=""}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+=" ";s+=i+o+"\n"}return e?s:i},t.fromDebug=function(e,r,n){for(var i,o,s=e.length,a=new t((s+1)/3|0,r,n),u=0,l=0,c=!1,d=!1,_=!1,f=!1,p=!1;u<s;){switch(i=e.charAt(u++)){case"!":if(!n){if(d||_||f){p=!0;break}d=_=f=!0}a.offset=a.markedOffset=a.limit=l,c=!1;break;case"|":if(!n){if(d||f){p=!0;break}d=f=!0}a.offset=a.limit=l,c=!1;break;case"[":if(!n){if(d||_){p=!0;break}d=_=!0}a.offset=a.markedOffset=l,c=!1;break;case"<":if(!n){if(d){p=!0;break}d=!0}a.offset=l,c=!1;break;case"]":if(!n){if(f||_){p=!0;break}f=_=!0}a.limit=a.markedOffset=l,c=!1;break;case">":if(!n){if(f){p=!0;break}f=!0}a.limit=l,c=!1;break;case"'":if(!n){if(_){p=!0;break}_=!0}a.markedOffset=l,c=!1;break;case" ":c=!1;break;default:if(!n&&c){p=!0;break}if(o=parseInt(i+e.charAt(u++),16),!n&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[l++]=o,c=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+u)}if(!n){if(!d||!f)throw TypeError("Illegal str: Missing offset or limit");if(l<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+l+" < "+s)}return a},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,o=e.length,s=new t(o/2|0,r),a=0,u=0;a<o;a+=2){if(i=parseInt(e.substring(a,a+2),16),!n&&(!isFinite(i)||i<0||i>255))throw TypeError("Illegal str: Contains non-hex characters");s.view[u++]=i}return s.limit=u,s};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,o,s=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())&&s([r,n]),t((31&r)<<6|63&n);else if(224==(240&r))(null===(n=e())||null===(i=e()))&&s([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===(o=e()))&&s([r,n,i,o]),t((7&r)<<18|(63&n)<<12|(63&i)<<6|63&o)}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=s())}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(o(e),!0)[1],r,n),s=0;return c.encodeUTF16toUTF8(o(e),(function(e){i.view[s++]=e})),i.limit=s,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,o,a;return t?(a=0<=(e>>>=0)&&e<256)&&(o=n[e])?o:(i=s(e,(0|e)<0?-1:0,!0),a&&(n[e]=i),i):(a=-128<=(e|=0)&&e<128)&&(o=r[e])?o:(i=s(e,e<0?-1:0,!1),a&&(r[e]=i),i)}function o(e,t){if(isNaN(e)||!isFinite(e))return t?h:p;if(t){if(e<0)return h;if(e>=d)return v}else{if(e<=-_)return R;if(e+1>=_)return T}return e<0?o(-e,t).neg():s(e%c|0,e/c|0,t)}function s(t,r,n){return new e(t,r,n)}e.fromInt=i,e.fromNumber=o,e.fromBits=s;var a=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 p;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=o(a(r,8)),s=p,l=0;l<e.length;l+=8){var c=Math.min(8,e.length-l),d=parseInt(e.substring(l,l+c),r);if(c<8){var _=o(a(r,c));s=s.mul(_).add(o(d))}else s=(s=s.mul(i)).add(o(d))}return s.unsigned=t,s}function l(t){return t instanceof e?t:"number"==typeof t?o(t):"string"==typeof t?u(t):s(t.low,t.high,t.unsigned)}e.fromString=u,e.fromValue=l;var c=4294967296,d=c*c,_=d/2,f=i(1<<24),p=i(0);e.ZERO=p;var h=i(0,!0);e.UZERO=h;var g=i(1);e.ONE=g;var E=i(1,!0);e.UONE=E;var b=i(-1);e.NEG_ONE=b;var T=s(-1,2147483647,!1);e.MAX_VALUE=T;var v=s(-1,-1,!0);e.MAX_UNSIGNED_VALUE=v;var R=s(0,-2147483648,!1);e.MIN_VALUE=R;var I=e.prototype;return I.toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},I.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(R)){var t=o(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=o(a(e,6),this.unsigned),s=this,u="";;){var l=s.div(i),c=(s.sub(l.mul(i)).toInt()>>>0).toString(e);if((s=l).isZero())return c+u;for(;c.length<6;)c="0"+c;u=""+c+u}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){if(this.isNegative())return this.eq(R)?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},I.isZero=function(){return 0===this.high&&0===this.low},I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return!(1&~this.low)},I.isEven=function(){return!(1&this.low)},I.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)},I.eq=I.equals,I.notEquals=function(e){return!this.eq(e)},I.neq=I.notEquals,I.lessThan=function(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.greaterThan=function(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.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},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(R)?R:this.not().add(g)},I.neg=I.negate,I.add=function(e){t(e)||(e=l(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,a=e.high>>>16,u=65535&e.high,c=e.low>>>16,d=0,_=0,f=0,p=0;return f+=(p+=o+(65535&e.low))>>>16,_+=(f+=i+c)>>>16,d+=(_+=n+u)>>>16,d+=r+a,s((f&=65535)<<16|(p&=65535),(d&=65535)<<16|(_&=65535),this.unsigned)},I.subtract=function(e){return t(e)||(e=l(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){if(this.isZero())return p;if(t(e)||(e=l(e)),e.isZero())return p;if(this.eq(R))return e.isOdd()?R:p;if(e.eq(R))return this.isOdd()?R:p;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(f)&&e.lt(f))return o(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,c=65535&e.high,d=e.low>>>16,_=65535&e.low,h=0,g=0,E=0,b=0;return E+=(b+=a*_)>>>16,g+=(E+=i*_)>>>16,E&=65535,g+=(E+=a*d)>>>16,h+=(g+=n*_)>>>16,g&=65535,h+=(g+=i*d)>>>16,g&=65535,h+=(g+=a*c)>>>16,h+=r*_+n*d+i*c+a*u,s((E&=65535)<<16|(b&=65535),(h&=65535)<<16|(g&=65535),this.unsigned)},I.mul=I.multiply,I.divide=function(e){if(t(e)||(e=l(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?h:p;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return h;if(e.gt(this.shru(1)))return E;i=h}else{if(this.eq(R))return e.eq(g)||e.eq(b)?R:e.eq(R)?g:(r=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?g:b:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(R))return this.unsigned?h:p;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=p}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),u=s<=48?1:a(2,s-48),c=o(r),d=c.mul(e);d.isNegative()||d.gt(n);)d=(c=o(r-=u,this.unsigned)).mul(e);c.isZero()&&(c=g),i=i.add(c),n=n.sub(d)}return i},I.div=I.divide,I.modulo=function(e){return t(e)||(e=l(e)),this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.not=function(){return s(~this.low,~this.high,this.unsigned)},I.and=function(e){return t(e)||(e=l(e)),s(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return t(e)||(e=l(e)),s(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return t(e)||(e=l(e)),s(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?s(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):s(0,this.low<<e-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?s(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):s(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var r=this.high;return e<32?s(this.low>>>e|r<<32-e,r>>>e,this.unsigned):s(32===e?r:r>>>e-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.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]},I.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 o=this.source.substring(this.index,this.index=i);return'"'!==o&&"'"!==o||(this._stringOpen=o),o},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 o=function(e){this.tn=new n(e),this.proto3=!1},s=o.prototype;function a(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 s.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},o.parse=function(e){return new o(e).parse()},s._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},s._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)},s._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 o=n;i&&(this.tn.skip(")"),o="("+o+")",n=this.tn.peek(),t.FQTYPEREF.test(n)&&(o+=n,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,o),r||this.tn.skip(";")},s._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)}},s._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)},s._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,o={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),"stream"===(n=this.tn.next()).toLowerCase()&&(o.request_stream=!0,n=this.tn.next()),!t.TYPEREF.test(n))throw Error("illegal rpc service request type: "+n);if(o.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()&&(o.response_stream=!0,n=this.tn.next()),o.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(o)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[r]&&(e[r]={}),e[r][i]=o},s._parseMessage=function(e,r){var n=!!r,i=this.tn.next(),o={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(i))throw Error("illegal "+(n?"group":"message")+" name: "+i);for(o.name=i,n&&(this.tn.skip("="),r.id=a(this.tn.next()),o.isGroup=!0),"["===(i=this.tn.peek())&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(i=this.tn.next());)if(t.RULE.test(i))this._parseMessageField(o,i);else if("oneof"===i)this._parseMessageOneOf(o);else if("enum"===i)this._parseEnum(o);else if("message"===i)this._parseMessage(o);else if("option"===i)this._parseOption(o);else if("service"===i)this._parseService(o);else if("extensions"===i)o.hasOwnProperty("extensions")?o.extensions=o.extensions.concat(this._parseExtensionRanges()):o.extensions=this._parseExtensionRanges();else if("reserved"===i)this._parseIgnored();else if("extend"===i)this._parseExtend(o);else{if(!t.TYPEREF.test(i))throw Error("illegal message token: "+i);if(!this.proto3)throw Error("illegal field rule: "+i);this._parseMessageField(o,"optional",i)}return this.tn.omit(";"),e.messages.push(o),o},s._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},s._parseMessageField=function(e,r,n){if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);var i,o={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(o.keytype=i,this.tn.skip(","),i=this.tn.next(),!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field: "+i);if(o.type=i,this.tn.skip(">"),i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);o.name=i,this.tn.skip("="),o.id=a(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(n=void 0!==n?n:this.tn.next())){var s=this._parseMessage(e,o);if(!/^[A-Z]/.test(s.name))throw Error("illegal group name: "+s.name);o.type=s.name,o.name=s.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(n)&&!t.TYPEREF.test(n))throw Error("illegal message field type: "+n);if(o.type=n,i=this.tn.next(),!t.NAME.test(i))throw Error("illegal message field name: "+i);o.name=i,this.tn.skip("="),o.id=a(this.tn.next()),"["===(i=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},s._parseMessageOneOf=function(e){var r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal oneof name: "+r);var n,i=r,o=[];for(this.tn.skip("{");"}"!==(r=this.tn.next());)(n=this._parseMessageField(e,"optional",r)).oneof=i,o.push(n.id);this.tn.omit(";"),e.oneofs[i]=o},s._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()},s._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:a(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)},s._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},s._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},s.toString=function(){return"Parser at line "+this.tn.line},r.Parser=o,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 o=function(e,t,r,i,o){n.call(this,e,t,r),this.className="Namespace",this.children=[],this.options=i||{},this.syntax=o||"proto2"},s=o.prototype=Object.create(n.prototype);s.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},s.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)},s.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},s.resolve=function(e,r){var n,i="string"==typeof e?e.split("."):e,o=this,s=0;if(""===i[s]){for(;null!==o.parent;)o=o.parent;s++}do{do{if(!(o instanceof t.Namespace)){o=null;break}if(!(n=o.getChild(i[s]))||!(n instanceof t.T)||r&&!(n instanceof t.Namespace)){o=null;break}o=n,s++}while(s<i.length);if(null!=o)break;if(null!==this.parent)return this.parent.resolve(e,r)}while(null!=o);return o},s.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 o=r.slice(r.length-i);if(e===this.resolve(o,e instanceof t.Namespace))return o.join(".")}return e.fqn()},s.build=function(){for(var e,t={},r=this.children,n=0,i=r.length;n<i;++n)(e=r[n])instanceof o&&(t[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(t,"$options",{value:this.buildOpt()}),t},s.buildOpt=function(){for(var e={},t=Object.keys(this.options),r=0,n=t.length;r<n;++r){var i=t[r],o=this.options[t[r]];e[i]=o}return e},s.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},t.Namespace=o;var a=function(t,r,n,i,o){if(this.type=t,this.resolvedType=r,this.isMapKey=n,this.syntax=i,this.name=o,n&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},u=a.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")}a.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 o=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(a=0;a<o.length;a++){if(o[a].name==t)return o[a].id;if(o[a].id==t)return o[a].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 s={};for(var a in t)t.hasOwnProperty(a)&&(s[a]=t[a]);t=s}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 o=n.offset;i.writeVarint32(n.remaining()),i.append(n),n.offset=o;break;case e.TYPES.message:var s=(new r).LE();this.resolvedType.encode(n,s),i.writeVarint32(s.offset),i.append(s.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,o;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(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return(i=t.clone()).limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);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=a;var c=function(e,t,r,n,i,s){o.call(this,e,t,r,n,s),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},d=c.prototype=Object.create(o.prototype);function _(t,r){var n=r.readVarint32(),i=7&n,o=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:_(o,r);break;case e.WIRE_TYPES.ENDGROUP:if(o===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+o+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:r.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+i)}return!0}d.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),o=function(s,a){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 d;if(arguments.length>0)if(1!==arguments.length||null===s||"object"!=typeof s||!("function"!=typeof s.encode||s instanceof o)||Array.isArray(s)||s instanceof e.Map||r.isByteBuffer(s)||s instanceof ArrayBuffer||e.Long&&s instanceof e.Long)for(u=0,l=arguments.length;u<l;++u)void 0!==(d=arguments[u])&&this.$set(n[u].name,d);else this.$set(s)},s=o.prototype=Object.create(e.Builder.Message.prototype);s.add=function(r,n,i){var o=t._fieldsByName[r];if(!i){if(!o)throw Error(this+"#"+r+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+r+" is not a repeated field");n=o.verifyValue(n,!0)}return null===this[r]&&(this[r]=[]),this[r].push(n),this},s.$add=s.add,s.set=function(r,n,i){if(r&&"object"==typeof r){for(var o in i=n,r)r.hasOwnProperty(o)&&void 0!==(n=r[o])&&void 0===t._oneofsByName[o]&&this.$set(o,n,i);return this}var s=t._fieldsByName[r];if(i)this[r]=n;else{if(!s)throw Error(this+"#"+r+" is not a field: undefined");if(!(s instanceof e.Reflect.Message.Field))throw Error(this+"#"+r+" is not a field: "+s.toString(!0));this[s.name]=n=s.verifyValue(n)}if(s&&s.oneof){var a=this[s.oneof.name];null!==n?(null!==a&&a!==s.name&&(this[a]=null),this[s.oneof.name]=s.name):a===r&&(this[s.oneof.name]=null)}return this},s.$set=s.set,s.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]},s.$get=s.get;for(var a=0;a<n.length;a++){var u=n[a];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},o=function(){return this[e.name]};null===t.getChild("set"+r)&&(s["set"+r]=i),null===t.getChild("set_"+n)&&(s["set_"+n]=i),null===t.getChild("get"+r)&&(s["get"+r]=o),null===t.getChild("get_"+n)&&(s["get_"+n]=o)}(u)}function l(t,n,i,o){if(null===t||"object"!=typeof t){if(o&&o instanceof e.Reflect.Enum){var s=e.Reflect.Enum.getName(o.object,t);if(null!==s)return s}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 a;if(Array.isArray(t))return a=[],t.forEach((function(e,t){a[t]=l(e,n,i,o)})),a;if(a={},t instanceof e.Map){for(var u=t.entries(),c=u.next();!c.done;c=u.next())a[t.keyElem.valueToString(c.value[0])]=l(c.value[1],n,i,t.valueElem.resolvedType);return a}var d=t.$type,_=void 0;for(var f in t)t.hasOwnProperty(f)&&(d&&(_=d.getChild(f))?a[f]=l(t[f],n,i,_.resolvedType):a[f]=l(t[f],n,i));return a}return s.encode=function(e,n){"boolean"==typeof e&&(n=e,e=void 0);var i=!1;e||(e=new r,i=!0);var o=e.littleEndian;try{return t.encode(this,e.LE(),n),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},o.encode=function(e,t,r){return new o(e).encode(t,r)},s.calculate=function(){return t.calculate(this)},s.encodeDelimited=function(e,n){var i=!1;e||(e=new r,i=!0);var o=(new r).LE();return t.encode(this,o,n).flip(),e.writeVarint32(o.remaining()),e.append(o),i?e.flip():e},s.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},s.toArrayBuffer=s.encodeAB,s.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},s.toBuffer=s.encodeNB,s.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},s.toBase64=s.encode64,s.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},s.toHex=s.encodeHex,s.toRaw=function(e,t){return l(this,!!e,!!t,this.$type)},s.encodeJSON=function(){return JSON.stringify(l(this,!0,!0,this.$type))},o.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 o=e.littleEndian;try{var s=t.decode(e.LE(),n);return e.LE(o),s}catch(t){throw e.LE(o),t}},o.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,o=e.readVarint32();if(e.remaining()<o)return e.offset=i,null;try{var s=t.decode(e.slice(e.offset,e.offset+o).LE());return e.offset+=o,s}catch(t){throw e.offset+=o,t}},o.decode64=function(e){return o.decode(e,"base64")},o.decodeHex=function(e){return o.decode(e,"hex")},o.decodeJSON=function(e){return new o(JSON.parse(e))},s.toString=function(){return t.toString()},Object.defineProperty&&(Object.defineProperty(o,"$options",{value:t.buildOpt()}),Object.defineProperty(s,"$options",{value:o.$options}),Object.defineProperty(o,"$type",{value:t}),Object.defineProperty(s,"$type",{value:t})),o}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={},this._oneofsByName={};for(var i,o=0,s=this.children.length;o<s;o++)if((i=this.children[o])instanceof g||i instanceof c||i instanceof T){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 b))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[o].toString(!0));return this.clazz=n},d.encode=function(e,t,r){for(var n,i,o=null,s=0,a=this._fields.length;s<a;++s)i=e[(n=this._fields[s]).name],n.required&&null===i?null===o&&(o=n):n.encode(r?i:n.verifyValue(i),t,e);if(null!==o){var u=Error("Missing at least one required field for "+this.toString(!0)+": "+o);throw u.encoded=t,u}return t},d.calculate=function(e){for(var t,r,n=0,i=0,o=this._fields.length;i<o;++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},d.decode=function(t,r,n){"number"!=typeof r&&(r=-1);for(var i,o,s,a,u=t.offset,l=new this.clazz;t.offset<u+r||-1===r&&t.remaining()>0;){if(s=(i=t.readVarint32())>>>3,(o=7&i)===e.WIRE_TYPES.ENDGROUP){if(s!==n)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+s+" ("+(n?n+" expected":"not a group")+")");break}if(a=this._fieldsById[s]){if(a.repeated&&!a.options.packed)l[a.name].push(a.decode(o,t));else if(a.map){var c=a.decode(o,t);l[a.name].set(c[0],c[1])}else if(l[a.name]=a.decode(o,t),a.oneof){var d=l[a.oneof.name];null!==d&&d!==a.name&&(l[d]=null),l[a.oneof.name]=a.name}}else switch(o){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 f=t.readVarint32();t.offset+=f;break;case e.WIRE_TYPES.STARTGROUP:for(;_(s,t););break;default:throw Error("Illegal wire type for unknown field "+s+" in "+this.toString(!0)+"#decode: "+o)}}for(var p=0,h=this._fields.length;p<h;++p)if(null===l[(a=this._fields[p]).name])if("proto3"===this.syntax)l[a.name]=a.defaultValue;else{if(a.required){var g=Error("Missing at least one required field for "+this.toString(!0)+": "+a.name);throw g.decoded=l,g}e.populateDefaults&&null!==a.defaultValue&&(l[a.name]=a.defaultValue)}return l},t.Message=c;var f=function(t,r,i,o,s,a,u,l,d,_){n.call(this,t,r,a),this.className="Message.Field",this.required="required"===i,this.repeated="repeated"===i,this.map="map"===i,this.keyType=o||null,this.type=s,this.resolvedType=null,this.id=u,this.options=l||{},this.defaultValue=null,this.oneof=d||null,this.syntax=_||"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))},p=f.prototype=Object.create(n.prototype);p.build=function(){this.element=new a(this.type,this.resolvedType,!1,this.syntax,this.name),this.map&&(this.keyElement=new a(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=a.defaultFieldValue(this.type)},p.verifyValue=function(t,r){r=r||!1;var n,i=this;function o(e,t){throw Error("Illegal value for "+i.toString(!0)+" of type "+i.type.name+": "+e+" ("+t+")")}if(null===t)return this.required&&o(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&o(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!r){Array.isArray(t)||(t=[t]);var s=[];for(n=0;n<t.length;n++)s.push(this.element.verifyValue(t[n]));return s}return this.map&&!r?t instanceof e.Map?t:(t instanceof Object||o(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&o(typeof t,"no array expected"),this.element.verifyValue(t))},p.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}},p.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 o;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 s=n.offset;for(o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],n);var a=n.offset-s,u=r.calculateVarint32(a);if(u>1){var l=n.slice(s,n.offset);s+=u-1,n.offset=s,n.append(l)}n.writeVarint32(a,s-u)}else for(o=0;o<t.length;o++)n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[o],n);else this.map?t.forEach((function(t,i,o){var s=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(s),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},p.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 o,s;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),s=0,o=0;o<t.length;o++)s+=this.element.calculateLength(this.id,t[o]);i+=r.calculateVarint32(s),i+=s}else for(o=0;o<t.length;o++)i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[o]);else this.map?t.forEach((function(t,n,o){var s=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(s),i+=s}),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},p.decode=function(t,r,n){var i,o;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){o=r.readVarint32(),o=r.offset+o;for(var s=[];r.offset<o;)s.push(this.decode(this.type.wireType,r,!0));return s}if(this.map){var u=a.defaultFieldValue(this.keyType);if(i=a.defaultFieldValue(this.type),o=r.readVarint32(),r.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+r.remaining());var l=r.clone();for(l.limit=l.offset+o,r.offset+=o;l.remaining()>0;){var c=l.readVarint32();t=7&c;var d=c>>>3;if(1===d)u=this.keyElement.decode(l,t,d);else{if(2!==d)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(l,t,d)}}return[u,i]}return this.element.decode(r,t,this.id)},t.Message.Field=f;var h=function(e,t,r,n,i,o,s){f.call(this,e,t,r,null,n,i,o,s),this.extension};h.prototype=Object.create(f.prototype),t.Message.ExtensionField=h;t.Message.OneOf=function(e,t,r){n.call(this,e,t,r),this.fields=[]};var g=function(e,t,r,n,i){o.call(this,e,t,r,n,i),this.className="Enum",this.object=null};g.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},(g.prototype=Object.create(o.prototype)).build=function(t){if(this.object&&!t)return this.object;for(var r=new e.Builder.Enum,n=this.getChildren(g.Value),i=0,o=n.length;i<o;++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=g;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 b=function(e,t,r,i){n.call(this,e,t,r),this.field=i};b.prototype=Object.create(n.prototype),t.Extension=b;var T=function(e,t,r,n){o.call(this,e,t,r,n),this.className="Service",this.clazz=null};(T.prototype=Object.create(o.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),o=t.getChildren(e.Reflect.Service.RPCMethod),s=0;s<o.length;s++)!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}))}(o[s]);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=T;var v=function(e,t,r,i){n.call(this,e,t,r),this.className="Service.Method",this.options=i||{}};(v.prototype=Object.create(n.prototype)).buildOpt=s.buildOpt,t.Service.Method=v;var R=function(e,t,r,n,i,o,s,a){v.call(this,e,t,r,a),this.className="Service.RPCMethod",this.requestName=n,this.responseName=i,this.requestStream=o,this.responseStream=s,this.resolvedRequestType=null,this.resolvedResponseType=null};return R.prototype=Object.create(v.prototype),t.Service.RPCMethod=R,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 o(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,o(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 o=t.shift();if(n.isMessage(o)){var s=new r.Message(this,this.ptr,o.name,o.options,o.isGroup,o.syntax),a={};o.oneofs&&Object.keys(o.oneofs).forEach((function(e){s.addChild(a[e]=new r.Message.OneOf(this,s,e))}),this),o.fields&&o.fields.forEach((function(e){if(null!==s.getChild(0|e.id))throw Error("duplicate or invalid field id in "+s.name+": "+e.id);if(e.options&&"object"!=typeof e.options)throw Error("illegal field options in "+s.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=a[e.oneof]))throw Error("illegal oneof in "+s.name+"#"+e.name+": "+e.oneof);e=new r.Message.Field(this,s,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,o.syntax),t&&t.fields.push(e),s.addChild(e)}),this);var u=[];if(o.enums&&o.enums.forEach((function(e){u.push(e)})),o.messages&&o.messages.forEach((function(e){u.push(e)})),o.services&&o.services.forEach((function(e){u.push(e)})),o.extensions&&("number"==typeof o.extensions[0]?s.extensions=[o.extensions]:s.extensions=o.extensions),this.ptr.addChild(s),u.length>0){i.push(t),t=u,u=null,this.ptr=s,s=null;continue}u=null}else if(n.isEnum(o))s=new r.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){s.addChild(new r.Enum.Value(this,s,e.name,e.id))}),this),this.ptr.addChild(s);else if(n.isService(o))s=new r.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];s.addChild(new r.Service.RPCMethod(this,s,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(s);else{if(!n.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(s=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(t){if(null!==s.getChild(0|t.id))throw Error("duplicate extended field id in "+s.name+": "+t.id);if(s.extensions){var n=!1;if(s.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(n=!0)})),!n)throw Error("illegal extended field id in "+s.name+": "+t.id+" (not within valid ranges)")}var i=t.name;this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i));var o=new r.Message.ExtensionField(this,s,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),a=new r.Extension(this,this.ptr,t.name,o);o.extension=a,this.ptr.addChild(a),s.addChild(o)}),this);else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("extended message "+o.ref+" is not defined")}o=null,s=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,s=r.root;if(e.Util.IS_NODE&&(s=require("path").resolve(s)),(s.indexOf("\\")>=0||r.file.indexOf("\\")>=0)&&(n="\\"),i=e.Util.IS_NODE?require("path").join(s,r.file):s+n+r.file,!0===this.files[i])return this.reset();this.files[i]=!0}if(t.imports&&t.imports.length>0){var a,u=!1;"object"==typeof r?(this.importRoot=r.root,u=!0,a=this.importRoot,r=r.file,(a.indexOf("\\")>=0||r.indexOf("\\")>=0)&&(n="\\")):"string"==typeof r?this.importRoot?a=this.importRoot:r.indexOf("/")>=0?""===(a=r.replace(/\/[^\/]*$/,""))&&(a="/"):r.indexOf("\\")>=0?(a=r.replace(/\\[^\\]*$/,""),n="\\"):a=".":a=null;for(var l=0;l<t.imports.length;l++)if("string"==typeof t.imports[l]){if(!a)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(a,c):a+n+c,!0===this.files[c])continue;/\.proto$/i.test(c)&&!e.DotProto&&(c=c.replace(/\.proto$/,".json"));var d=e.Util.fetch(c);if(null===d)throw Error("failed to import '"+c+"' in '"+r+"': file not found");/\.json$/i.test(c)?this.import(JSON.parse(d+""),c):this.import(e.DotProto.Parser.parse(d),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&&o(t);var _=this.ptr;return t.options&&Object.keys(t.options).forEach((function(e){_.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=_),t.enums&&(this.create(t.enums),this.ptr=_),t.services&&(this.create(t.services),this.ptr=_),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 o=this.keyElem.valueFromString(n[i]),s=this.valueElem.verifyValue(r[n[i]]);this.map[this.keyElem.valueToString(o)]={key:o,value:s}}},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 $o,es,ts,rs,ns,is,os,ss,as,us="NotifyMsg",ls="SyncRequestMsg",cs="UpStreamMessage",ds="DownStreamMessages",_s="ChrmDownStreamMessages",fs="DownStreamMessage",ps="ExtMsgData",hs="GetQNupTokenInput",gs="GetDownloadUrlInput",Es="GetQNupTokenOutput",bs="GetDownloadUrlOutput",Ts="ChrmInput",vs="ChrmOutput",Rs="ChrmPullMsg",Is="RelationQryInput",ms="RelationQryFilter",ys="RelationsOutput",As="QryRemindListReq",Ss="QryRemindListResp",Os="CleanHisMsgInput",Cs="CleanMsgBatchReq",Ns="QueryChatRoomInfoInput",Ps="QueryChatRoomInfoOutput",Ls="HistoryMsgInput",Ms="HistoryMsgOuput",ws="SessionsAttQryInput",Us="SessionsAttOutput",Ds="SessionMsgReadInput",xs="DeleteSessionsInput",Gs="QuerySessionsInput",Vs="QuerySessionsOutPut",js="RelationDelBatchReq",Fs="DeleteMsgInput",Bs="SetChrmKV",Hs="SetChrmKVS",qs="ChrmKVOutput",Ys="ChrmKVSOutput",Ws="QueryChrmKV",Js="SetUserSettingInput",Ks="SetUserSettingOutput",Qs="PullUserSettingInput",Xs="PullUserSettingOutput",Zs="SessionReq",zs="SessionStates",$s="SessionStateModifyReq",ea="GroupUnpushQuery",ta="GroupUnpushSet",ra="GroupUnpushResult",na="SessionStateModifyResp",ia="TypeUnpushInput",oa="TypeUnpushOutput",sa="GrpReadReceiptMsg",aa="ReadReceipt",ua="QueryReceiptReq",la="QueryReceiptBatchReq",ca="ReceiptResp",da="QueryReceiptBatchResp",_a="GrpReadReceiptQryResp",fa="SessionTagAddInput",pa="SessionTagDelInput",ha="UserSettingNotification",ga="ReportSDKInput",Ea="UltraGrpPullSes",ba="UltraGrpPullMsg",Ta="MsgChangeReq",va="ModifyMsgResp",Ra="QueryMsgChange",Ia="EventChangeList",ma="MsgChangeList",ya="MsgQuery",Aa="MsgQueryAck",Sa="OperateStatus",Oa="OperateStatusNotify",Ca="SetRtcRoomIdInput",Na="CallInfoUpStream",Pa="CallInfoDownStream",La="KvInput",Ma="KvOutput",wa="ReadReceiptMsg",Ua="ReceiptQryReq",Da="QueryReceiptResp",xa="ReceiptCntQryReq",Ga="ReceiptCntQryResp",Va="UpdateUserSubReq",ja="UpdateUserSubResp",ka="PullUserSubReq",Fa="PUllUserSubResp",Ba="PullSubDataReq",Ha="PullSubDataResp",qa="SubDataDetail",Ya="QrySubDataReq",Wa="UserProfile",Ja="SetUserProfileResp",Ka="PullUserProfileReq",Qa="UserProfiles",Xa="UserProfileInput",Za="UserProfilePermission",za="SearchUserProfile",$a="ChannelsInput",eu="ChannelsOutput",tu="MultiChannels",ru="ModifyChannelsInput",nu="ChannelsQueryInput",iu="ChannelsListResult",ou="ChannelsInviteStatusInfos",su="ChannelsUserInfos",au="ChannelsJoinedInfos",uu="ChannelsMemberUpdateInput",lu="ChannelsMemberResponseInput",cu="ChannelsMembersInput",du="FriendInput",_u="FriendsInput",fu="FriendsCheckOutput",pu="FriendProfileInput",hu="FriendProfileOutput",gu="FriendQueryInput",Eu="FriendsListInput",bu="FriendLevelSet",Tu="FriendUserInfos",vu="FriendInviteInfos",Ru="ChannelApplyInfo",Iu="AddUnpushPeriodInput",mu="DeleteUnpushPeriodInput",yu="QueryUnpushPeriodInput",Au="QueryUnpushPeriodOutput",Su="MsgReadEvent",Ou="ConvertMsgInput",Cu="SpeechToTextInfo",Nu="ConvertMsgOutput",Pu="SpeechToTextResult",Lu="TransReq",Mu="TransResp",wu="PullModifyMsgReq",Uu="PullModifyMsgResp",Du="SetUserStatusInput",xu="MCFollowInput",Gu="RtcQueryListInput",Vu="RtcKeyDeleteInput",ju="RtcValueInfo",ku="RtcUserListOutput",Fu="RtcInput",Bu="RtcQryOutput",Hu="RtcDataInput",qu="RtcSetDataInput",Yu="RtcUserSetDataInput",Wu="RtcOutput",Ju="RtcTokenOutput",Ku="RtcNotifyMsg",Qu="RtcPullKV",Xu="RtcKVOutput",Zu="RtcQueryUserJoinedInput",zu="RtcQueryUserJoinedOutput",$u="RtcViewerJoinedOutput",el="RtcInviteInput",tl="RtcCancelInviteInput",rl="RtcInviteAnswerInput",nl="RtcEndInviteInput",il="BotInput",ol="BotOutput",sl=function(){function e(e){$o.add(this),Object.defineProperty(this,"pbModules",{enumerable:!0,configurable:!0,writable:!0,value:void 0});var t=zo.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 c(this,$o,"m",es).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}();$o=new WeakSet,es=function e(t,r){var n,i=this;if(t instanceof Array)return t.map((function(t){return c(i,$o,"m",e).call(i,t)}));if(n=t,"[object Object]"!==Object.prototype.toString.call(n))return t;if(t instanceof zo.ByteBuffer)return t.toArrayBuffer();if(t instanceof zo.Long)return r?t.toString():t.toNumber();var o={};return Object.keys(t).forEach((function(r){var n=t[r],s=t.$type.name===ps&&"seqId"===r;o[r]=c(i,$o,"m",e).call(i,n,s)})),o},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"}(ts||(ts={})),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"}(rs||(rs={})),function(e){e[e.GROUP_SUCCESS=0]="GROUP_SUCCESS",e[e.GROUP_FAILURE=1]="GROUP_FAILURE"}(ns||(ns={})),function(e){e[e.IsSilent=1]="IsSilent",e[e.IsTop=2]="IsTop",e[e.Tags=3]="Tags",e[e.AutoTrans=4]="AutoTrans"}(is||(is={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(os||(os={})),function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(ss||(ss={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(as||(as={}));var al,ul,ll,cl,dl,_l,fl,pl,hl,gl=new sl("package Modules;\nmessage probuf {\n message SetUserStatusOutput {\n optional int32 nothing=1;\n }\n message GetUserStatusInput {\n optional int32 nothing=1;\n }\n message GetUserStatusOutput {\n optional string status=1;\n optional string subUserId=2;\n }\n message SubUserStatusInput {\n repeated string userid =1;\n }\n message SubUserStatusOutput {\n optional int32 nothing=1;\n }\n message VoipDynamicInput {\n required int32 engineType = 1;\n required string channelName = 2;\n optional string channelExtra = 3;\n }\n message VoipDynamicOutput {\n required string dynamicKey=1;\n }\n message NotifyMsg {\n required int32 type = 1;\n optional int64 time = 2;\n optional string chrmId=3;\n }\n message SyncRequestMsg {\n required int64 syncTime = 1;\n required bool ispolling = 2;\n optional bool isweb=3;\n optional bool isPullSend=4;\n optional bool isKeeping=5;\n optional int64 sendBoxSyncTime=6;\n optional int64 broadcastSyncTime=7;\n optional int64 endTime = 8;\n optional bool compressioEnabled = 9;\n }\n message UpStreamMessage {\n required int32 sessionId = 1;\n required string classname = 2;\n required string content = 3;\n optional string pushText = 4;\n optional string appData = 5;\n repeated string toUserIds = 6;\n optional int64 delMsgTime = 7;\n optional string delMsgId = 8;\n optional int32 configFlag = 9;\n optional int64 clientUniqueId = 10;\n optional string extraContent = 11;\n optional PushExtra pushExt = 12;\n optional string busChannel = 13;\n optional string systemId = 16;\n optional string senderPortrait = 21;\n optional int64 optionBits = 22;\n }\n message PushExtra {\n optional string title = 1;\n optional int32 templateIdNoUse= 2;\n optional string pushId = 3;\n optional string pushConfigs = 4;\n optional string templateId = 5;\n }\n message DownStreamMessages {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n optional bool finished = 3;\n optional int64 broadcastSyncTime = 4;\n optional int64 systemTime = 5;\n optional int64 credibleStartTime = 6;\n optional int64 credibleEndTime = 7;\n optional bool compressioEnabled = 8;\n optional bytes compressedData = 9;\n }\n message ChrmDownStreamMessages {\n repeated bytes list = 1;\n required int64 syncTime = 2;\n optional bool compressioEnabled = 3;\n optional bytes compressedData = 4;\n }\n message DownStreamMessage {\n required string fromUserId = 1;\n required ChannelType type = 2;\n optional string groupId = 3;\n required string classname = 4;\n required string content = 5;\n required int64 dataTime = 6;\n required int64 status = 7;\n optional int64 extra = 8;\n optional string msgId = 9;\n optional int32 direction = 10;\n optional int32 plantform =11;\n optional int32 isRemoved = 12;\n optional string source = 13;\n optional int64 clientUniqueId = 14;\n optional string extraContent = 15;\n optional string pushContent = 16;\n optional int32 configFlag = 17;\n optional PushExtra pushExt = 18;\n optional string busChannel = 19;\n optional int64 extStatus = 20;\n repeated string toUserIds = 21;\n optional int32 groupUnpush = 22;\n optional int64 optionBits = 23;\n optional string convertExt = 24;\n optional ExtMsgData extMsgData = 25;\n }\n message ExtMsgData {\n optional int64 seqId = 1;\n optional int64 sendTime = 2;\n }\n enum ChannelType {\n PERSON = 1;\n PERSONS = 2;\n GROUP = 3;\n TEMPGROUP = 4;\n CUSTOMERSERVICE = 5;\n NOTIFY = 6;\n MC=7;\n MP=8;\n ULTRAGROUP = 10;\n }\n message CreateDiscussionInput {\n optional string name = 1;\n }\n message CreateDiscussionOutput {\n required string id = 1;\n }\n message ChannelInvitationInput {\n repeated string users = 1;\n }\n message LeaveChannelInput {\n required int32 nothing = 1;\n }\n message ChannelEvictionInput {\n required string user = 1;\n }\n message RenameChannelInput {\n required string name = 1;\n }\n message ChannelInfoInput {\n required int32 nothing = 1;\n }\n message ChannelInfoOutput {\n required ChannelType type = 1;\n required string channelId = 2;\n required string channelName = 3;\n required string adminUserId = 4;\n repeated string firstTenUserIds = 5;\n required int32 openStatus = 6;\n }\n message ChannelInfosInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message ChannelInfosOutput {\n repeated ChannelInfoOutput channels = 1;\n required int32 total = 2;\n }\n message MemberInfo {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n required string extension = 4;\n }\n message GroupMembersInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message GroupMembersOutput {\n repeated MemberInfo members = 1;\n required int32 total = 2;\n }\n message GetUserInfoInput {\n required int32 nothing = 1;\n }\n message GetUserInfoOutput {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n }\n message GetSessionIdInput {\n required int32 nothing = 1;\n }\n message GetSessionIdOutput {\n required int32 sessionId = 1;\n }\n enum FileType {\n IMAGE = 1;\n AUDIO = 2;\n VIDEO = 3;\n FILE = 4;\n SIGHT = 5;\n COMBINE_HTML = 6;\n }\n message GetQNupTokenInput {\n required FileType type = 1;\n optional string key = 2;\n optional string httpMethod = 3;\n optional string queryString = 4;\n optional string url = 5;\n optional string ext = 6;\n optional int64 size = 7;\n optional int32 ipType = 8;\n }\n message GetQNdownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message GetDownloadUrlInput {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n optional string ext = 4;\n optional int64 size = 5;\n optional int32 ipType = 6;\n }\n message GetQNupTokenOutput {\n required int64 deadline = 1;\n required string token = 2;\n optional string bosToken = 3;\n optional string bosDate = 4;\n optional string path = 5;\n\n optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\n\n optional string s3Credential = 10;\n optional string s3Algorithm = 11;\n optional string s3Date = 12;\n optional string s3Policy = 13;\n optional string s3Signature = 14;\n optional string s3BucketName = 15;\n\n optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n optional string minioAuthorization = 20;\n optional string minioContentSha256 = 21;\n optional string minioDate = 22;\n optional string minioBucketName = 23;\n\n optional string downloadAuthInfo = 24;\n optional string ossConfig = 25;\n }\n message GetQNdownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message GetDownloadUrlOutput {\n required string downloadUrl = 1;\n }\n message Add2BlackListInput {\n required string userId = 1;\n }\n message RemoveFromBlackListInput {\n required string userId = 1;\n }\n message QueryBlackListInput {\n required int32 nothing = 1;\n }\n message QueryBlackListOutput {\n repeated string userIds = 1;\n }\n message BlackListStatusInput {\n required string userId = 1;\n }\n message BlockPushInput {\n required string blockeeId = 1;\n }\n message ModifyPermissionInput {\n required int32 openStatus = 1;\n }\n message GroupInput {\n repeated GroupInfo groupInfo = 1;\n }\n message GroupOutput {\n required int32 nothing = 1;\n }\n message GroupInfo {\n required string id = 1;\n required string name = 2;\n }\n message GroupHashInput {\n required string userId = 1;\n required string groupHashCode = 2;\n }\n message GroupHashOutput {\n required GroupHashType result = 1;\n }\n enum GroupHashType {\n GROUP_SUCCESS = 0x00;\n GROUP_FAILURE = 0x01;\n }\n message ChrmInput {\n required int32 nothing = 1;\n optional string extra = 2;\n }\n message ChrmOutput {\n required int32 nothing = 1;\n optional string sessionId = 2;\n optional int64 joinTime = 3;\n optional int64 createTime = 4;\n optional int32 memberCount = 5;\n optional int32 chatroomBanState = 6;\n optional int32 whiteListState = 7;\n }\n message ChrmPullMsg {\n required int64 syncTime = 1;\n required int32 count = 2;\n optional int32 pullMsgType = 3;\n optional bool compressioEnabled = 4;\n }\n message ChrmPullMsgNew {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message RelationQryInput {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n optional bool isEraseMsgContent = 5;\n optional int64 endTime = 6;\n optional bool compressioEnabled = 7;\n optional int32 qryType = 8;\n repeated ChannelType channelType = 9;\n optional int32 botType = 10;\n }\n message RelationQryFilter {\n repeated ChannelType type = 1;\n optional int32 count = 2;\n optional int32 order = 3;\n repeated string tags = 4;\n optional bool isTagTop = 5;\n optional string pageToken = 6;\n optional bool compress = 7;\n }\n message RelationsOutput {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;\n optional int64 pullTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n optional string pageToken = 6;\n }\n message RelationInfo {\n required ChannelType type = 1;\n required string userId = 2;\n optional DownStreamMessage msg =3;\n optional int64 readMsgTime= 4;\n optional int64 unreadCount= 5;\n optional string busChannel = 6;\n optional int64 versionTime = 7;\n optional int64 remindCount = 8;\n optional int32 busChannelType = 9;\n optional UnreadMsgInfo msgInfo = 10;\n optional int32 remindMeCount = 11;\n optional bool isBot = 12;\n }\n message UnreadMsgInfo {\n required string msgId = 1;\n required int64 msgTime= 2;\n optional int32 remindType= 3;\n optional string className = 4;\n }\n message QryRemindListReq {\n required string groupId = 1;\n optional string busChannel = 2;\n optional int64 msgTime = 3;\n optional int32 size = 4;\n }\n message QryRemindListResp {\n repeated UnreadMsgInfo msgInfo = 1;\n }\n message RelationInfoReadTime {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message CleanHisMsgInput {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4;\n }\n message CleanMsgBatchReq {\n repeated CleanHisMsgInput input = 1;\n }\n message HistoryMessageInput {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6; \n optional bytes compressedData = 7;\n }\n message QueryChatRoomInfoInput {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message QueryChatRoomInfoOutput {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput {\n required string id = 1;\n }\n\n message MPFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo {\n required string mpid=1;\n required string name = 2;\n required string type = 3;\n required int64 time=4;\n optional string portraitUrl=5;\n optional string extra =6;\n }\n\n message SearchMpInput {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message HistoryMsgInput {\n optional string targetId = 1;\n optional int64 time = 2;\n optional int32 count = 3;\n optional int32 order = 4;\n optional string busChannel = 5;\n optional bool compressioEnabled = 6;\n optional bool ignoreCmd = 10;\n }\n\n message HistoryMsgOuput {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n optional int64 credibleStartTime = 4;\n optional int64 credibleEndTime = 5;\n optional bool compressioEnabled = 6;\n optional bytes compressedData = 7;\n }\n message SessionsAttQryInput {\n required int32 nothing = 1;\n }\n message SessionsAttOutput {\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message SessionMsgReadInput {\n required ChannelType type = 1;\n required int64 msgTime = 2;\n required string channelId = 3;\n optional string busChannel = 4;\n }\n message SessionMsgReadOutput {\n optional int32 nothing=1;\n }\n message DeleteSessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message SessionInfo {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 unreadCount = 3;\n optional string busChannel = 4;\n }\n message QuerySessionsInput {\n repeated SessionInfo sessions = 1;\n }\n message QuerySessionsOutPut {\n repeated SessionInfo sessions = 1;\n }\n message DeleteSessionsOutput {\n optional int32 nothing=1;\n }\n message RelationDelBatchReq {\n repeated RelationOpInput relation = 1;\n optional bool cleanMsg = 2;\n }\n message RelationOpInput {\n required string conversationId = 1;\n required ChannelType conversationType = 2;\n optional string busChannel = 3;\n }\n message DeleteMsgInput {\n optional ChannelType type = 1;\n optional string conversationId = 2;\n repeated DeleteMsg msgs = 3;\n optional string busChannel = 4;\n }\n message DeleteMsg {\n optional string msgId = 1;\n optional int64 msgDataTime = 2;\n optional int32 direct = 3;\n }\n message ChrmKVEntity {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n optional int64 version = 6;\n }\n message SetChrmKV {\n required ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message SetChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message DeleteChrmKVS {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ChrmKVOutput {\n repeated ChrmKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3;\n optional bool compressioEnabled = 4; \n optional bytes compressedData = 5;\n }\n message ChrmKVSVersionEntity {\n optional int64 version = 1;\n optional string key = 2;\n }\n\n message ChrmKVSOutput {\n repeated ChrmKVSOutputEntity errorKeys = 1;\n repeated ChrmKVSVersionEntity keysVersion = 2;\n }\n message ChrmKVSOutputEntity {\n optional string key = 1;\n optional int32 errorCode = 2;\n }\n message QueryChrmKV {\n required int64 timestamp = 1;\n optional bool compressioEnabled = 2;\n }\n message SetUserSettingInput {\n required int64 version=1;\n required string value=2;\n optional bool ignoreVersion = 3;\n }\n message SetUserSettingOutput {\n required int64 version=1;\n required bool reserve=2;\n optional bool updateVersion = 3;\n }\n message PullUserSettingInput {\n required int64 version=1;\n optional bool reserve=2;\n optional int32 ipType = 3;\n }\n message PullUserSettingOutput {\n repeated UserSettingItem items = 1;\n required int64 version=2;\n }\n message UserSettingItem {\n required string targetId= 1;\n required ChannelType type = 2;\n required string key = 4;\n required bytes value = 5;\n required int64 version=6;\n required int32 status=7;\n repeated SessionTagItem tags= 8;\n }\n message SessionReq {\n required int64 time = 1;\n }\n message SessionStates {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message SessionState {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 time = 3;\n repeated SessionStateItem stateItem = 4;\n optional string busChannel = 5;\n }\n message SessionStateItem {\n required SessionStateType sessionStateType = 1;\n required string value = 2;\n repeated SessionTagItem tags = 3;\n optional int64 time = 4;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n AutoTrans = 4;\n }\n message SessionStateModifyReq {\n required int64 version=1;\n repeated SessionState state= 2;\n optional bool ignoreVersion = 3;\n }\n message GroupUnpushQuery {\n optional string busChannel = 1;\n }\n message GroupUnpushSet{\n optional string busChannel = 1;\n required int32 unpushLevel = 2;\n }\n message GroupUnpushResult {\n required string groupId = 1;\n optional string busChannel = 2;\n required int32 unpushLevel = 3;\n }\n message SessionStateModifyResp {\n required int64 version=1;\n optional bool updateVersion = 2;\n }\n message TypeUnpushInput {\n required ChannelType type = 1;\n required int64 version = 2;\n required int32 unpushLevel = 3;\n optional bool ignoreVersion = 4;\n }\n message TypeUnpushOutput {\n required int64 version = 1;\n optional bool updateVersion = 2;\n }\n message GrpReadReceiptMsg {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message GrpReadReceiptQryReq {\n repeated string msgId=1;\n optional string channelId = 2;\n }\n message ReadReceipt {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string channelId = 3;\n optional int32 readType =4 ;\n repeated string msgIds= 5 ;\n optional string fromId = 6;\n }\n message QueryReceiptReq {\n optional string targetId = 1;\n optional string busChannel =2;\n optional int32 type = 3;\n repeated string msgIds = 4;\n optional int32 qryType = 5;\n optional int32 order =6;\n optional bool compress = 7;\n optional int32 readType = 8;\n optional int32 pageType = 9; \n optional int32 pageSize = 10;\n optional string pageToken = 11;\n repeated string users = 12;\n }\n message QueryReceiptBatchReq {\n repeated QueryReceipt items = 1;\n optional bool compress = 2;\n }\n message QueryReceipt {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 type = 3;\n repeated string msgIds = 4;\n }\n message ReceiptResp {\n repeated QueryReceiptRespItem resp = 1;\n optional bool compress = 2;\n optional bytes compressData = 3;\n optional string pageToken = 4;\n }\n message QueryReceiptBatchResp {\n repeated QueryReceiptBatchRespItem item = 1;\n optional bool compress = 2;\n optional bytes compressData = 3;\n }\n\n message QueryReceiptBatchRespItem {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 type = 3;\n repeated QueryReceiptRespItem msg = 4;\n }\n message QueryReceiptRespItem {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int64 readCnt = 4;\n repeated ReceiptUser readUser = 5;\n repeated string unreadList = 6;\n optional int64 unreadCnt = 7;\n repeated ReceiptUser unreadUser = 8;\n }\n message GrpReadReceiptQryResp {\n required int32 totalMemberNum = 1;\n repeated GrpMsgReadUser list = 2;\n }\n message GrpMsgReadUser {\n required int64 readTime = 1;\n required string userId = 2;\n }\n message SessionTagAddInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n optional bool ignoreVersion = 3;\n }\n message SessionTagItem {\n required string tagId=1;\n optional string name=2;\n optional int64 createdTime=3;\n optional bool isTop=4;\n }\n message SessionTagDelInput {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n optional bool ignoreVersion = 3;\n }\n message SessionDisTagReq {\n repeated string tagId=1;\n }\n message UserSettingNotification {\n required int64 version=1;\n required bool reserve=2;\n }\n message ReportSDKInput {\n required string sdkInfo=1;\n }\n message ReportSDKOutput {\n optional int32 nothing=1;\n }\n message UltraGrpPullSes {\n required int64 syncTime = 1;\n optional bool isEraseMsgContent = 2;\n }\n message UltraGrpPullMsg {\n required int64 syncTime = 1;\n optional bool compressioEnabled = 2;\n }\n message MsgChangeReq {\n required string fromUserId = 1;\n required string targetId = 2;\n required ChannelType type = 3;\n required string msgUID = 4;\n required int64 msgTime = 5;\n optional string busChannel = 6;\n optional string content = 7;\n }\n message ModifyMsgResp {\n optional int64 modifyTime = 1;\n optional DownStreamMessage msg = 2;\n }\n message QueryMsgChange {\n required int64 syncTime = 1;\n optional int32 needCompress = 2;\n optional int64 onlineTime = 3;\n optional string targetId = 4;\n }\n message EventChangeList {\n repeated EventChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n optional string targetId = 4;\n optional bool isCompress = 5 ;\n }\n message EventChange {\n optional string businessId = 1;\n optional ChannelType channelType = 2;\n optional int64 time = 3;\n optional int32 changeType = 4;\n optional string originalId = 5;\n optional int64 originalTime = 6;\n optional string secondaryId = 7;\n optional bool isAdmin = 8;\n optional bool additionalMark = 9; \n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 secondaryType = 12;\n optional bool isRemindMe = 13;\n repeated string extIds = 14;\n optional int32 remindType = 15;\n optional bytes eventData = 16;\n }\n message MsgChangeList {\n repeated MsgChange list = 1;\n required int64 syncTime = 2;\n optional bool hasNext = 3 ;\n }\n message MsgChange {\n required string targetId = 1;\n required ChannelType type = 2;\n required int64 time = 3;\n required int32 changeType = 4;\n required string msgUID = 5;\n required int64 msgTime = 6;\n optional string busChannel = 7;\n optional bool isAdmin = 8;\n optional bool isDel = 9;\n optional string operatorId = 10;\n optional int32 subChangeType = 11;\n optional int32 busChannelType = 12;\n optional bool isRemindMe = 13;\n repeated string userGroupIds = 14;\n optional int32 remindType = 15;\n }\n message MsgQuery {\n required string targetId = 1;\n required ChannelType type = 2;\n repeated MessageQueryInfo query = 3; //\n }\n message MessageQueryInfo {\n required int64 msgTime = 1;\n required string msgUID = 2;\n optional string busChannel = 3;\n }\n message MsgQueryAck {\n repeated DownStreamMessage list = 1;\n repeated string notExistMsgId = 2;\n }\n message OperateStatus {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 opType = 3;\n optional string busChannel = 4;\n }\n message OperateStatusNotify {\n optional ChannelType type = 1;\n optional int64 notifyType = 2;\n repeated OperateInfo info = 3 ;\n repeated OperateSummary summary = 4 ;\n }\n message OperateInfo {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional string userId = 3;\n optional int32 opType = 4;\n optional int64 optime = 5;\n }\n \n message OperateSummary {\n optional string targetId = 1;\n optional string busChannel = 2;\n optional int32 count = 3;\n optional int32 opType = 4;\n }\n\n message SetRtcRoomIdInput {\n required string rtcRoomId= 1;\n }\n message SetRtcRoomIdOutput {\n required int32 nothing = 1;\n }\n message CallInfoUpStream {\n required string key= 1;\n required string dataContent=2;\n }\n message CallInfoDownStream {\n required string key= 1;\n required string dataContent=2;\n required int64 maxTime=3;\n }\n message KvInput {\n required int64 syncTime = 1;\n }\n message KvOutput {\n required int64 maxTime = 1;\n repeated KvInfo info = 2;\n }\n message KvInfo {\n required string key =1;\n required string value =2;\n }\n message ReadReceiptMsg {\n required string targetId = 1;\n required ChannelType type = 2;\n optional string busChannel = 3;\n optional string startMsgId = 4;\n optional string endMsgId = 5;\n }\n message ReceiptQryReq {\n required string msgId = 1;\n optional string busChannel = 2;\n required string targetId = 3;\n }\n message QueryReceiptResp {\n optional int32 num = 1;\n repeated ReceiptUser list = 2;\n optional int32 readCnt = 3;\n }\n message ReceiptUser {\n optional int64 receiptTime = 1;\n optional string userId = 2;\n optional string name = 3;\n optional string portrait = 4;\n optional bool mentioned= 5;\n }\n message ReceiptCntQryReq {\n optional ChannelType type = 1;\n optional string channelId = 2;\n optional string busChannel = 3;\n repeated string msgId = 4;\n }\n message ReceiptCntQryResp {\n repeated MsgReadCnt result= 1;\n }\n\n message MsgReadCnt {\n optional string msgId = 1;\n optional int32 cnt = 2;\n optional int32 tmn = 3;\n }\n message UpdateUserSubReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n optional int32 opType = 3;\n optional int32 expiry = 4;\n }\n message UserSubDetail {\n optional string subUserId = 1;\n }\n message UpdateUserSubResp {\n repeated UserSubDetail subUsers = 1;\n optional int64 subTime = 2;\n }\n message PullUserSubReq {\n optional int64 version = 1;\n optional string pageToken = 2;\n }\n message PUllUserSubResp {\n repeated UserSubList list = 1;\n optional int64 version = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message UserSubList {\n repeated UserSubDetail subUsers = 1;\n optional int32 subType = 2;\n optional int64 subTime = 3;\n optional int32 expiry = 4;\n optional int32 opType = 5;\n }\n message PullSubDataReq {\n optional int64 versionTime = 1;\n optional bool needAllData = 2;\n optional string pageToken = 3;\n }\n message PullSubDataResp {\n repeated SubDataDetail list = 1;\n optional int64 versionTime = 2;\n optional bool hasNext = 3;\n optional string pageToken = 4;\n optional bool isFull = 5;\n }\n message SubDataDetail {\n optional string statusStr = 1;\n optional string subUserId = 2;\n repeated SubData data = 3;\n optional int32 subType = 4;\n }\n\n message SubData {\n optional int32 platformInfo = 1;\n optional int32 value = 2;\n optional int64 versionTime = 3;\n }\n message QrySubDataReq {\n optional int32 subType = 1;\n repeated UserSubDetail subUsers = 2;\n }\n message UserProfile {\n optional int64 version = 1;\n optional string userId = 2;\n repeated ProfileInfo userProfile = 3;\n repeated ProfileInfo userExtProfile = 4;\n }\n message ProfileInfo {\n optional string key = 1;\n optional string value = 2;\n }\n message SetUserProfileResp {\n optional int64 version = 1;\n optional string key = 2;\n repeated string censorFailedFields = 3;\n }\n message PullUserProfileReq {\n repeated string userId = 1;\n }\n message UserProfiles {\n repeated UserProfile UserProfile = 1;\n }\n message UserProfileInput {\n required int32 nothing = 1;\n }\n message UserProfilePermission {\n optional int32 permission = 1;\n }\n message UserProfileOutput {\n required int32 nothing = 1;\n }\n message SearchUserProfile {\n optional string uniqueId = 1;\n }\n message ChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated ProfileInfo settingProfile = 3;\n repeated ProfileInfo extProfile = 4;\n optional ChannelBaseInfo baseInfo = 5;\n repeated string users = 6;\n }\n\n message ChannelBaseInfo {\n optional string creatorId = 1;\n optional string ownerId = 2;\n optional int64 createTime = 3;\n optional int32 memberCount = 4;\n }\n\n message ChannelsOutput {\n optional int64 operateTime = 1;\n optional int32 flag = 2;\n optional string msg = 3;\n optional int32 processCode = 4;\n optional ChannelsJoinedInfo channelInfo = 5;\n repeated ChannelsUserInfo userInfos = 6;\n optional FriendInviteInfo friendInviteInfo = 7;\n optional FriendUserInfo friendUserInfo = 8;\n repeated string censorFailedFields = 9;\n }\n\n message MultiChannels {\n optional ChannelType type = 1;\n repeated ChannelsInput list = 2;\n }\n\n message ModifyChannelsInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional QuitChannelsSetting settingInfo = 3;\n repeated string users = 4;\n optional int32 operateType = 5;\n }\n\n message QuitChannelsSetting {\n optional bool isQuit = 1;\n optional bool isDelBan = 2;\n optional bool isDelWhite = 3;\n optional bool isDelAttention = 4;\n }\n\n message ChannelsQueryInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional ChannelsPageParam page = 3;\n repeated string ids = 4;\n optional int32 roleType = 5;\n optional int32 botType = 6;\n }\n\n message ChannelsPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n optional bool hasNext = 3 ;\n optional int32 total = 4 ;\n optional int32 order = 5 ;\n }\n\n message ChannelsListResult {\n optional int32 listType = 1;\n optional bytes result = 2;\n optional ChannelsPageParam page = 3;\n }\n \n message ChannelsInviteStatusInfos {\n repeated ChannelsInviteStatusInfo list = 1;\n }\n \n message ChannelsUserInfos {\n repeated ChannelsUserInfo list = 1;\n }\n \n message ChannelsJoinedInfos {\n repeated ChannelsJoinedInfo list = 1;\n }\n\n message ChannelsUserInfo {\n optional string userId = 1;\n optional ChannelsUserExtInfo ext = 2;\n optional int64 opTime = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n\n message ChannelsUserExtInfo {\n optional int32 role = 1;\n optional int64 joinTime = 2;\n optional string channelNickName = 3;\n optional string additional = 4;\n optional string remarkName = 5;\n optional bool isBan = 6;\n optional int64 banEndTime = 7;\n optional bool isBot = 8;\n }\n\n message ChannelsMemberUpdateInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional string userId = 3;\n optional string channelNickName = 4;\n optional string additional = 5;\n optional int32 operateType = 6;\n }\n message ChannelsJoinedInfo {\n optional string targetId = 1;\n repeated ProfileInfo settingProfile = 2;\n repeated ProfileInfo extProfile = 3;\n optional ChannelBaseInfo baseInfo = 4;\n optional ChannelsUserExtInfo userInfo = 5;\n }\n message ChannelsInviteStatusInfo {\n optional string targetId = 1;\n optional ChannelsUserInfo joinUserInfo = 2;\n optional ChannelsUserInfo inviterInfo = 3;\n optional int32 status = 4;\n optional int32 directionType = 5;\n optional int32 joinType = 6;\n optional string detail = 7;\n optional int64 applyTime = 8;\n optional ChannelsUserInfo processInfo = 9;\n optional int64 processTime = 10;\n }\n message ChannelsMemberResponseInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n optional int32 optType = 3;\n optional int32 optResult = 4;\n optional string joinUserId = 5;\n optional string inviterId = 6;\n optional string detail = 7;\n }\n message ChannelsMembersInput {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string userIds = 3;\n }\n message FriendInput {\n optional string targetId = 1;\n optional int32 type = 2;\n optional string info = 3;\n }\n message FriendsOutput {\n repeated FriendOutput list = 1;\n }\n message FriendOutput {\n optional string userId = 1;\n optional int64 operateTime = 2;\n optional string flag = 3;\n }\n message FriendsInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendsCheckOutput {\n repeated FriendCheckOutput list = 1;\n }\n\n message FriendCheckOutput {\n optional string targetId = 1;\n optional int32 status = 2;\n }\n message FriendProfileInput {\n optional string targetId = 1;\n optional string remarkName = 2;\n repeated ProfileInfo extProfile = 3;\n }\n message FriendProfileOutput {\n repeated string censorFailedFields = 1;\n }\n message FriendQueryInput {\n optional int32 queryType = 1;\n optional ChannelsPageParam page = 2;\n optional int32 friendType= 3;\n }\n message FriendUserInfo {\n optional string userId = 1;\n optional int64 relationTime = 2;\n optional int32 friendType = 3;\n optional int32 flag = 4;\n optional string remarkName = 5;\n optional string name = 6;\n optional string portraitUrl = 7;\n repeated ProfileInfo extProfile = 8;\n \n }\n message FriendInviteInfo {\n optional string userId = 1;\n optional string name = 2;\n optional string portraitUrl = 3;\n optional int32 type = 4;\n optional int32 status = 5;\n optional int64 operateTime = 6;\n optional string info = 7;\n optional int32 friendType = 8;\n }\n message FriendsListInput {\n repeated string targetId = 1;\n optional int32 type = 2;\n }\n message FriendLevelSet {\n optional int32 level = 1;\n }\n\n message FriendPageParam {\n optional int32 size = 1;\n optional string pageToken = 2;\n }\n message FriendUserInfos {\n repeated FriendUserInfo list = 1;\n }\n\n message FriendInviteInfos {\n repeated FriendInviteInfo list = 1;\n }\n \n message FriendApplyEvent {\n optional int32 applyType = 1;\n optional int32 friendType = 2;\n optional string info = 3;\n optional string name = 4;\n optional string portraitUrl = 5;\n }\n message UpdateChannnelInfo {\n optional ChannelsJoinedInfo channelInfo = 1;\n optional ChannelsUserInfo userInfo = 2;\n }\n message UpdateUserInfo {\n optional ChannelsUserInfo updatedUserInfo = 1;\n optional ChannelsUserInfo optUserInfo = 2;\n }\n message ChannelApplyInfo {\n repeated ChannelsInviteStatusInfo statusInfo = 1;\n }\n message ChannelEventData {\n optional ChannelsUserInfo optUserInfo = 1;\n optional ChannelsJoinedInfo channelInfo = 2;\n repeated ChannelsUserInfo userInfos = 3;\n optional ChannelsJoinedInfo channelFullInfo = 4;\n }\n message FriendTypeChangeEvent {\n optional string friendId = 1;\n optional int32 friendType = 2;\n }\n message FriendUpdateEvent {\n optional string remarkname = 1;\n repeated ProfileInfo extProfile = 2;\n }\n message AddUnpushPeriodInput {\n required string startTime = 1;\n required int32 spanMinutes = 2;\n optional int32 level = 3;\n optional string timezone = 4;\n }\n message DeleteUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodInput {\n required int32 nothing = 1;\n }\n message QueryUnpushPeriodOutput {\n required int32 isUnpush = 1;\n optional string startTime = 2;\n optional int32 spanMinutes = 3;\n optional int32 level = 4;\n optional string timezone = 5;\n }\n message RelationDel {\n optional string targetId = 1;\n optional ChannelType type = 2;\n repeated string busChannel = 3;\n optional bool cleanMsg = 4;\n }\n message MsgReadEvent {\n optional string msgId = 1;\n optional int64 msgTime = 2;\n optional int32 totalCnt = 3;\n optional int32 readCnt = 4;\n optional int32 unreadCnt = 5;\n repeated ReceiptUser readList =6;\n }\n message ConvertMsgInput {\n optional int32 businessType = 1;\n optional bytes businessInfo = 2;\n }\n message SpeechToTextInfo {\n optional string msgId = 1;\n optional string objectName = 2;\n optional string content = 3;\n optional int32 sampleRate = 4;\n optional int32 channelNumber = 5;\n optional string format = 6;\n optional string extra = 7;\n }\n message ConvertMsgOutput {\n optional int32 businessType = 1;\n optional bytes businessResult = 2;\n }\n message SpeechToTextResult {\n optional string result = 1;\n optional string message = 2;\n }\n message TransReq {\n repeated TransInfo transInfos = 1;\n optional int32 model = 2;\n optional bool forceTrans = 3;\n }\n message TransResp {\n repeated TransResult results = 1;\n optional int32 model = 2;\n }\n message TransInfo {\n optional string messageUID = 1;\n optional int32 transType = 2;\n optional string text = 3;\n optional string transFileUrl = 4;\n optional string sourceLan = 5;\n optional string targetLan = 6;\n optional int32 inputSource = 7;\n }\n message TransResult {\n optional string messageUID = 1;\n optional string transResult = 2;\n optional string sourceLan = 3;\n optional string targetLan = 4;\n optional int32 code = 5;\n optional int32 inputSource = 6;\n }\n message PullModifyMsgReq { \n optional int64 pullVersion = 1;\n optional bool compress = 2;\n repeated int32 modifyType = 3;\n }\n message PullModifyMsgResp {\n repeated ModifyMsg msg = 1;\n optional int64 nextVersion = 2;\n optional bool finished = 3;\n optional bool compress = 4;\n optional bytes compressedData = 5;\n }\n message ModifyMsg {\n optional int32 modifyType = 1;\n optional DownStreamMessage msg = 2;\n }\n enum JoinType {\n KICK = 0;\n REFUSE = 1;\n COEXIST = 2;\n }\n enum TargetType {\n ROOM =1 ;\n PERSON = 2;\n }\n message SetUserStatusInput {\n optional int32 status=1;\n }\n message MCFollowInput {\n required string state = 1;\n }\n message RtcQueryListInput {\n optional int32 order=1;\n }\n message RtcKeyDeleteInput {\n repeated string key=1;\n }\n message RtcValueInfo {\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo {\n required string userId=1;\n repeated RtcValueInfo userData=2;\n }\n message RtcUserListOutput {\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4;\n repeated RtcKVEntity entries = 5;\n optional int64 syncTime = 6;\n optional int32 offlineKickTime = 7;\n }\n message RtcRoomInfoOutput {\n optional string roomId = 1;\n repeated RtcValueInfo roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message RtcInput {\n required int32 roomType=1;\n optional int32 broadcastType=2;\n optional RtcValueInfo extraInnerData = 3;\n optional bool needSysChatroom = 4;\n optional IdentityChangeType identityChangeType = 5;\n optional JoinType joinType = 6;\n repeated RtcValueInfo innerDatas = 7;\n repeated RtcValueInfo outerDatas = 8;\n }\n message RtcQryOutput {\n repeated RtcValueInfo outInfo=1;\n }\n message RtcDataInput {\n required bool interior=1;\n required TargetType target=2;\n repeated string key=3;\n optional string objectName=4;\n optional string content=5;\n }\n message RtcSetDataInput {\n required bool interior=1;\n required TargetType target=2;\n required string key=3;\n required string value=4;\n optional string objectName=5;\n optional string content=6;\n }\n message RtcUserSetDataInput {\n repeated RtcValueInfo valueInfo = 1;\n required string objectName = 2;\n repeated RtcValueInfo content = 3;\n }\n message RtcQryInput {\n required bool isInterior=1;\n required TargetType target=2;\n repeated string key=3;\n }\n message RtcDelDataInput {\n repeated string key=1;\n required bool isInterior=2;\n required TargetType target=3;\n }\n message RtcOutput {\n optional int32 nothing=1;\n optional int64 version=2;\n }\n message RtcTokenOutput {\n required string rtcToken=1;\n }\n message RtcSetOutDataInput {\n required TargetType target=1;\n repeated RtcValueInfo valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message RtcQryUserOutDataInput {\n repeated string userId = 1;\n }\n message RtcUserOutDataOutput {\n repeated RtcUserInfo user = 1;\n }\n message RtcNotifyMsg {\n required int32 type= 1;\n optional int64 time= 2;\n optional string roomId=3;\n }\n message RtcPullKV {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n }\n message RtcKVOutput {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType {\n AnchorToViewer = 1;\n ViewerToAnchor = 2;\n }\n message RtcQueryUserJoinedInput {\n required string userId = 1;\n }\n message RtcJoinedInfo {\n required string deviceId = 1;\n required string roomId = 2;\n optional int64 joinTime = 3;\n }\n message RtcQueryUserJoinedOutput {\n repeated RtcJoinedInfo info = 1;\n }\n message RtcViewerJoinedOutput {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;\n optional int64 syncTime = 3;\n }\n message RtcInviteInput {\n required string invitedUserId=1;\n optional int32 timeoutTime=2;\n required string invitedRoomId=3;\n required string inviteInfo=4;\n required string inviteSessionId= 5;\n }\n message RtcCancelInviteInput {\n required string invitedUserId=1;\n required string invitedRoomId=2;\n required string inviteInfo=3;\n required string inviteSessionId=4;\n }\n message RtcInviteAnswerInput {\n required string inviteUserId=1;\n required int32 answerCode=2;\n required string inviteRoomId=3;\n required string inviteSessionId=4;\n required string content=5;\n optional string key=6;\n optional string value=7;\n }\n message RtcEndInviteInput {\n required string inviteRoomId=1;\n required string inviteSessionId=2;\n required string inviteContent=3;\n repeated string inviteRoomKeys=4;\n }\n message BotInput {\n repeated string ids = 1;\n }\n message BotOutput{\n repeated BotInfo bots = 1;\n }\n message BotInfo{\n optional string id = 1; \n optional string name = 2;\n optional string portraitUrl = 3;\n optional string type = 4;\n repeated MetadataInfo metadata = 5;\n optional int64 createTime = 6;\n optional int64 updateTime = 7;\n }\n message MetadataInfo{\n optional string key = 1; \n optional string value = 2;\n }\n}\n");exports.LogLevel=void 0,(al=exports.LogLevel||(exports.LogLevel={}))[al.LOG=0]="LOG",al[al.DEBUG=0]="DEBUG",al[al.INFO=1]="INFO",al[al.WARN=2]="WARN",al[al.ERROR=3]="ERROR",al[al.FATAL=4]="FATAL",al[al.STATISTICS=6]="STATISTICS",al[al.NONE=1e3]="NONE",exports.LogSource=void 0,(ul=exports.LogSource||(exports.LogSource={})).IM="IM",ul.RTC="RTC",exports.ConnectionStatus=void 0,(ll=exports.ConnectionStatus||(exports.ConnectionStatus={}))[ll.CONNECTED=0]="CONNECTED",ll[ll.CONNECTING=1]="CONNECTING",ll[ll.DISCONNECTED=2]="DISCONNECTED",ll[ll.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",ll[ll.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",ll[ll.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",ll[ll.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",ll[ll.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",ll[ll.BLOCKED=9]="BLOCKED",ll[ll.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",ll[ll.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",ll[ll.REDIRECT=14]="REDIRECT",ll[ll.USER_LOGOUT=19]="USER_LOGOUT",ll[ll.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",ll[ll.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",ll[ll.ULTRALIMIT=1101]="ULTRALIMIT",ll[ll.REQUEST_NAVI=201]="REQUEST_NAVI",ll[ll.RESPONSE_NAVI=202]="RESPONSE_NAVI",ll[ll.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",ll[ll.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",ll[ll.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",ll[ll.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR",exports.RTCMode=void 0,(cl=exports.RTCMode||(exports.RTCMode={}))[cl.RTC=0]="RTC",cl[cl.LIVE=2]="LIVE",cl[cl.SIP=4]="SIP",cl[cl.CALL=5]="CALL",cl[cl.MEETING=6]="MEETING",cl[cl.CROSS_MUTI=7]="CROSS_MUTI",cl[cl.CROSS_LIVE=8]="CROSS_LIVE",function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(dl||(dl={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(_l||(_l={})),exports.RTCApiType=void 0,(fl=exports.RTCApiType||(exports.RTCApiType={}))[fl.ROOM=1]="ROOM",fl[fl.PERSON=2]="PERSON",function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(pl||(pl={})),exports.RTCJoinType=void 0,(hl=exports.RTCJoinType||(exports.RTCJoinType={}))[hl.KICK=0]="KICK",hl[hl.REFUSE=1]="REFUSE",hl[hl.COEXIST=2]="COEXIST";var El=null;function bl(e,t,r,n){void 0===r&&(r={});var i=["error","warn","info","debug"][3-e];if(El&&e<exports.LogLevel.FATAL)try{var o=JSON.stringify(r);El[i](t,o)}catch(e){console.error(e)}}var Tl,vl,Rl,Il,ml,yl,Al,Sl,Ol,Cl,Nl,Pl=bl.bind(null,exports.LogLevel.DEBUG),Ll={init:function(e){El=e},info:bl.bind(null,exports.LogLevel.INFO),debug:Pl,warn:bl.bind(null,exports.LogLevel.WARN),error:bl.bind(null,exports.LogLevel.ERROR),fatal:bl.bind(null,exports.LogLevel.FATAL)},Ml=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 o=n[i],s=o.target,a=o.once,c=o.listener;a&&(n.splice(i,1),i-=1);try{c.call.apply(c,l([s],u(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}(),wl=function(e,t,r){var n=null==r?void 0:r.isReverse;bt(e)&&function(){for(var r in e)t(e[r],r,e)}(),(ht(e)||_t(e))&&function(){if(n)for(var r=e.length-1;r>=0;r--)t(e[r],r);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},Ul=function(){function e(e){Object.defineProperty(this,"pbCodec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pbCodec=new sl(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}(),Dl=function(e,t,r,n,i){var o=n?Object.keys(n).map((function(e){return{key:e,value:n[e]}})):void 0,s=i?Object.keys(i).map((function(e){return{key:e,value:i[e]}})):void 0;return gl.encode(Fu,{roomType:e,broadcastType:t,joinType:r,innerDatas:o,outerDatas:s})},xl=function(e){var t=gl.decode(ku,e),r=t.users,n=t.token,i=t.sessionId,o=t.roomInfo,s=t.entries,a=t.offlineKickTime,u={};return wl(r,(function(e){var t=e.userId,r=e.userData,n={};wl(r,(function(e){var t=e.key,r=e.value;n[t]=r})),u[t]=n})),{users:u,token:n,sessionId:i,roomInfo:o,kvEntries:s,offlineKickTime:a}},Gl=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 o(this,void 0,void 0,(function(){var e,t,r,n,i,o,a;return s(this,(function(s){switch(s.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=s.sent(),o=i.code,a=i.data,o===exports.ErrorCode.SUCCESS?(this._isPulling=!1,this._pullTime=a||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}(),Vl=function(){function e(e,t,r){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,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),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 Gl(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,"logger",{get:function(){return this._logger},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 o(this,void 0,void 0,(function(){var t,r,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=gl.encode(Qu,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,ni,!0,t)];case 1:return(r=s.sent()).isOk?(i=gl.decode(Xu,r.data),o=i.entries,a=i.syncTime,o=(o||[]).map((function(e){return n(n({},e),{timestamp:e.timestamp})})),this._watcher.onRTCDataChange(o,e),[2,ur(a)]):[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=gl.decode(Ku,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}();exports.StreamMessageResponseEventType=void 0,(Tl=exports.StreamMessageResponseEventType||(exports.StreamMessageResponseEventType={})).INIT="INIT",Tl.DATA="DATA",Tl.END="END";var jl=function(e){function r(t,r){var n=e.call(this)||this;return vl.add(n),Rl.set(n,void 0),Il.set(n,new Map),ml.set(n,void 0),d(n,Rl,t,"f"),d(n,ml,r,"f"),n}return t(r,e),Object.defineProperty(r.prototype,"requestStreamMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=c(this,vl,"a",yl).createTraceId(),c(this,vl,"a",yl).info(B.L_REQ_STREAM_MSG_CONTENT_T,"messageUId: ".concat(e),t),[4,cr.create("requestStreamMessageContent").isLimitedString("messageUId",e,1,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID,"messageUId is invalid.").result().tryTrans(c(this,Rl,"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)?ur(e.streamServer.addrs):lr(exports.ErrorCode.STREAM_MESSAGE_DISABLE)})).next((function(t){return c(n,vl,"m",Nl).call(n,e,t)}))];case 1:return r=i.sent(),c(this,vl,"a",yl).summary(B.L_REQ_STREAM_MSG_CONTENT_R,r,t,{messageUId:e}),[2,r.wipe()]}}))}))}}),r}(ir);Rl=new WeakMap,Il=new WeakMap,ml=new WeakMap,vl=new WeakSet,yl=function(){return c(this,Rl,"f").logger},Al=function(e,t,r){var n=c(this,Il,"f").get(e);n&&(c(this,Il,"f").delete(e),c(this,vl,"m",Sl).call(this,e,exports.StreamMessageResponseEventType.END,t,n.msg))},Sl=function(e,t,r,n,i){this.emit("message",{code:r,messageUId:e,type:t,chunk:i,message:n})},Ol=function(e,t){e.content=n(n({},e.content),t),c(this,Rl,"f")._innerSetMessageContent(e.messageId,JSON.stringify(e.content),e.messageType)},Cl=function(e,t,r){var n,i,o=c(this,Il,"f").get(t);switch(e){case"init":o.msg&&c(this,vl,"m",Ol).call(this,o.msg,{content:"",stopReason:0,completeReason:0,isSynced:!1}),c(this,vl,"m",Sl).call(this,t,exports.StreamMessageResponseEventType.INIT,exports.ErrorCode.SUCCESS,o.msg);break;case"complete":i=(n=r.length?JSON.parse(r):{}).complete||!1,o.msg&&c(this,vl,"m",Ol).call(this,o.msg,{stopReason:n.stopReason||0,completeReason:n.completeReason||0,complete:i,isSynced:i}),c(this,vl,"m",Al).call(this,t,n.stopReason||0,i);break;default:n=JSON.parse(r),o.cached+=n.content,o.msg&&c(this,vl,"m",Ol).call(this,o.msg,{content:o.cached}),c(this,vl,"m",Sl).call(this,t,exports.StreamMessageResponseEventType.DATA,exports.ErrorCode.SUCCESS,o.msg,{content:n.content,fullContent:o.cached})}},Nl=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return c(this,Il,"f").has(e)?[2,lr(exports.ErrorCode.STREAM_MESSAGE_REQUEST_IN_PROCESS,"Request in process, msgUId: ".concat(e))]:c(this,Il,"f").size>=3?[2,lr(exports.ErrorCode.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED,"The request queue is full")]:(r=Zo.createSSEClient({logger:c(this,vl,"a",yl),msgUId:e,appkey:c(this,Rl,"f").appkey,token:c(this,Rl,"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);c(d,vl,"m",Cl).call(d,n,e,i.trim())}}))},onNetworkError:function(t){c(d,vl,"m",Al).call(d,e,t,!1)}}),r.isOk?(n=r.data,i={client:n,cached:"",msg:void 0},c(this,Il,"f").set(e,i),c(this,ml,"f")?[4,c(this,Rl,"f").getLocalMessage(e)]:[3,2]):[2,r.wipe()]);case 1:if(o=s.sent(),a=o.code,!(u=o.data))return c(this,Il,"f").delete(e),[2,lr(a,"message not found, msgUId: ".concat(e))];if(u.content.isSynced)return c(this,Il,"f").delete(e),[2,lr(exports.ErrorCode.STREAM_MESSAGE_SYNCED,"synced")];i.msg=u,s.label=2;case 2:return[4,n.open(t.slice())];case 3:return(l=s.sent()).isOk||c(this,Il,"f").delete(e),[2,l.wipe()]}}))}))};var kl,Fl,Bl=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 Ul(t)}}),Object.defineProperty(e.prototype,"createPBCodec",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new sl(e)}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(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.32.1-c-test-alpha.1"}}),Object.defineProperty(e.prototype,"getAPIVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"5.32.1-c-test-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}(),Hl=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,i,a){return o(this,void 0,void 0,(function(){var o,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return o=Dl(t,r,n,i,a),[4,this.rtcSignaling(e,qn,!0,o)];case 1:return u=s.sent(),l=u.code,c=u.buffer,l===exports.ErrorCode.SUCCESS&&c&&(d=xl(c)),[2,{code:l,data:d}]}}))}))}}),Object.defineProperty(r.prototype,"quitRTCRoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=gl.encode(Du,{status:0}),[4,this.rtcSignaling(e,Yn,!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 o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=gl.encode(ju,{key:t,value:r}),[4,this.rtcSignaling(e,Wn,!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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=gl.encode(Vu,{key:t}),[4,this.rtcSignaling(e,Jn,!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,i,a){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return o=gl.encode(qu,{interior:n,target:i,key:t,value:r,objectName:null==a?void 0:a.name,content:null==a?void 0:a.content}),[4,this.rtcSignaling(e,Kn,!1,o)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCTotalRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=""),o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){switch(s.label){case 0:return o={objectName:n,content:[{key:t.name,value:t.content}],valueInfo:[{key:"uris",value:r},{key:"mcu_uris",value:i}]},a=gl.encode(Yu,o),[4,this.rtcSignaling(e,Qn,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCCDNUris",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=gl.encode(Yu,{objectName:t,valueInfo:[{key:"cdn_uris",value:r}]}),[4,this.rtcSignaling(e,Qn,!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 o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return i=gl.encode(Hu,{interior:r,target:n,key:t}),[4,this.rtcSignaling(e,Xn,!0,i)];case 1:return o=s.sent(),a=o.code,u=o.buffer,a===exports.ErrorCode.SUCCESS&&u?(l=gl.decode(Bu,u).outInfo,c={},l.forEach((function(e){c[e.key]=e.value})),[2,{code:a,data:c}]):[2,{code:a}]}}))}))}}),Object.defineProperty(r.prototype,"removeRTCData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return o=gl.encode(Hu,{interior:r,target:n,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,Zn,!1,o)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"setRTCOutData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=Dl(t,r),[4,this.rtcSignaling(e,zn,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=gl.decode(Ju,a).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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=gl.encode(xu,{state:t}),[4,this.rtcSignaling(e,$n,!0,r)];case 1:return[2,n.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"getRTCUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=gl.encode(Gu,{order:2}),[4,this.rtcSignaling(e,ei,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=xl(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 o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return n=Dl(t,r),[4,this.rtcSignaling(e,ti,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=gl.decode($u,a),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 o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=gl.encode(Du,{status:0}),[4,this.rtcSignaling(e,ri,!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 o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=gl.encode(Fu,{roomType:exports.RTCMode.LIVE,broadcastType:r,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,ii,!0,n)];case 1:return i=s.sent(),o=i.code,a=i.buffer,o===exports.ErrorCode.SUCCESS&&a?(u=xl(a),[2,{code:o,data:u}]):[2,{code:o}]}}))}))}}),Object.defineProperty(r.prototype,"requestRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,a=e.roomId,u=gl.encode(el,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(a,oi,!0,u)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"cancelRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.invitedRoomId,r=e.invitedUserId,n=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,a=gl.encode(tl,{invitedRoomId:t,invitedUserId:r,inviteSessionId:n,inviteInfo:i}),[4,this.rtcSignaling(o,si,!0,a)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"responseRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return t=e.inviteUserId,r=e.inviteRoomId,n=e.inviteSessionId,i=e.content,o=e.key,a=e.value,u=e.agree,l=e.roomId,c=gl.encode(rl,{inviteUserId:t,inviteRoomId:r,inviteSessionId:n,content:i,key:o,value:a,answerCode:u?1:0}),[4,this.rtcSignaling(l,ai,!0,c)];case 1:return[2,s.sent().code]}}))}))}}),Object.defineProperty(r.prototype,"endRoomPK",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=e.endRoomId,r=e.sessionId,n=e.content,i=e.keys,o=e.roomId,a=gl.encode(nl,{inviteRoomId:t,inviteSessionId:r,inviteContent:n,inviteRoomKeys:i}),[4,this.rtcSignaling(o,ui,!0,a)];case 1:return[2,s.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 o(this,void 0,void 0,(function(){var i;return s(this,(function(o){switch(o.label){case 0:return[4,this._context.rtcSignaling(e,t,r,n)];case 1:return[2,{code:(i=o.sent()).code,buffer:i.data}]}}))}))}}),Object.defineProperty(r.prototype,"getRTCJoinedUserInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=gl.encode(Zu,{userId:e}),[4,this.rtcSignaling("",li,!0,t)];case 1:return r=s.sent(),n=r.code,i=r.buffer,n===exports.ErrorCode.SUCCESS&&i?(o=gl.decode(zu,i).info,[2,{code:n,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:e.joinTime}}))}]):[2,{code:n}]}}))}))}}),r}(Bl);exports.AssertRules=void 0,(Fl=exports.AssertRules||(exports.AssertRules={}))[Fl.STRING=0]="STRING",Fl[Fl.ONLY_STRING=1]="ONLY_STRING",Fl[Fl.NUMBER=2]="NUMBER",Fl[Fl.BOOLEAN=3]="BOOLEAN",Fl[Fl.OBJECT=4]="OBJECT",Fl[Fl.ARRAY=5]="ARRAY",Fl[Fl.CALLBACK=6]="CALLBACK",Fl[Fl.CHANNEL_ID=7]="CHANNEL_ID";var ql=((kl={})[exports.AssertRules.STRING]=Et,kl[exports.AssertRules.ONLY_STRING]=_t,kl[exports.AssertRules.NUMBER]=ft,kl[exports.AssertRules.BOOLEAN]=function(e){return"boolean"==typeof e},kl[exports.AssertRules.OBJECT]=bt,kl[exports.AssertRules.ARRAY]=ht,kl[exports.AssertRules.CALLBACK]=function(e){var t=!0;return bt(e)||(t=!1),(e=e||{}).onSuccess&&!Tt(e.onSuccess)&&(t=!1),e.onError&&!Tt(e.onError)&&(t=!1),t},kl[exports.AssertRules.CHANNEL_ID]=yt,kl),Yl=function(e){function r(t){var r=e.call(this,t)||this;return r.name="RCAssertError",r}return t(r,e),r}(Error),Wl=function(e,t,r,n){void 0===n&&(n=!1),r=ql[r]||r;var i=n?r(t):vt(t)||null==t||r(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},Jl=function(e,t){var r=dn(e).searchProps;return r&&0!==r.length?r.every((function(e){return void 0!==t[e]}))?ur():lr(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR):ur()},Kl=function(e,t,r){return Ql(cr.create(e),t,r)},Ql=function(e,t,r){return e.isFailed||e.isObject("conversation",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION).validate("conversationType",null==t?void 0:t.conversationType,(function(){return te(null==t?void 0:t.conversationType,r)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).validate("targetId",null==t?void 0:t.targetId,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==t?void 0:t.channelId,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID),e},Xl=function(e,t,r){return e.check((function(e){return Ql(e,t,Z)})).check((function(e){var n=null==t?void 0:t.messageType;Et(n)?n===me.STREAM_MESSAGE&&r.includes("RC_Ext_StreamMsgSummary")&&e.setFailed(exports.ErrorCode.STREAM_MESSAGE_EXPANSION_KEY_ERROR):e.setFailed(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE)})).check((function(e){(null==t?void 0:t.canIncludeExpansion)||e.setFailed(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isNotEmptyString("messageUId",null==t?void 0:t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTimestamp("sentTime",null==t?void 0:t.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP),e},Zl=function(e,t,r){return e.check((function(e){r||e.setFailed(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION)})).isObject("expansion",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION).check((function(e){var r=Object.keys(t);if(r.length>20||0===r.length)e.setFailed(exports.ErrorCode.EXPANSION_LIMIT_EXCEET);else if(r.some((function(e){return!/^[A-Za-z0-9_=+-]+$/.test(e)||"string"!=typeof t[e]})))e.setFailed(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_EXPANSION);else{r.some((function(e){return e.length>32||t[e].length>4096}))&&e.setFailed(exports.ErrorCode.EXPANSION_LIMIT_EXCEET)}})),e},zl=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(exports.ErrorCode.INVALID_PARAMETER_PROXY),e):e};var $l,ec=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},tc=function(){return $l||($l={set:function(e,t){Zo.localStorage.setItem(e,JSON.stringify(t))},get:function(e){var t;try{t=JSON.parse(Zo.localStorage.getItem(e))}catch(e){t=null}return t},remove:function(e){return Zo.localStorage.removeItem(e)},getKeys:function(){var e=[];for(var t in Zo.localStorage)e.push(t);return e}}),$l},rc=function(){function e(e){Object.defineProperty(this,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),e&&(this._caches=e)}return Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._caches[e]=t}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.get(e);return delete this._caches[e],t}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._caches[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=[];for(var t in this._caches)e.push(t);return e}}),e}(),nc=function(){function e(e){var t;Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._rootStorage=tc();var r=this._rootStorage.get(e)||{};this._cache=new rc(((t={})[e]=r,t)),this._storageKey=e}return Object.defineProperty(e.prototype,"_get",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;return this._cache.get(e)||{}}}),Object.defineProperty(e.prototype,"_set",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._get();r[e]=t,this._set(r)}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._get();delete t[e],this._set(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._get()[e]}}),Object.defineProperty(e.prototype,"getKeys",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._get(),t=[];for(var r in e)t.push(r);return t}}),Object.defineProperty(e.prototype,"getValues",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._get()||{}}}),Object.defineProperty(e.prototype,"update",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e={});var t=this._storageKey;this._cache.set(t,e),this._rootStorage.set(t,e)}}),e}(),ic="",oc=function(){var e="";if(ic)return ic;if("browser"===Zo.tag)return ct;var t="RCDeviceId",r=tc(),n=r.get(t);return n?e=n:(e=lt.genWithLen(22),r.set(t,e)),e},sc="",ac=function(){return sc},uc=function(e,t,r,n,i){var o=0;return e&&(o|=16),t&&(o|=32),r&&(o|=64),n&&(o|=512),i&&(o|=1024),o},lc=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,o=n||i;o&&(t.user.portrait=t.user.portraitUri=o)}return t},cc=function(e){var t={};try{var r=JSON.parse(e);Object.entries(r).forEach((function(e){var r=u(e,2),n=r[0],i=r[1];t[n]=i.v}))}catch(t){console.error("parseMessageExpansion error: ".concat(e),t)}return t},dc=function(e,t,r,n){var i,o,s=gl.decode(cs,e.pbData),a=Nn(e.topic);if(a===On.recallMsg){var u=JSON.parse(s.content);i=u.conversationType,o=u.targetId}else i=function(e){var t;return((t={})[On.ppMsgP]=exports.ConversationType.PRIVATE,t[On.pgMsgP]=exports.ConversationType.GROUP,t[On.chatMsg]=exports.ConversationType.CHATROOM,t[On.ugMsg]=exports.ConversationType.ULTRA_GROUP,t[On.pcMsgP]=exports.ConversationType.CUSTOMER_SERVICE,t[On.pbMsgP]=exports.ConversationType.SYSTEM,t)[e]||exports.ConversationType.PRIVATE}(a),o=e.targetId;var l=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(i),c=l?o:t,d=l?"":o,_=pc(s.sessionId),f=_.isPersited,p=_.isCounted,h=_.isMentioned,g=_.disableNotification,E=_.canIncludeExpansion;return{fromUserId:c,type:i,groupId:d,classname:s.classname,content:s.content,dataTime:r,status:uc(f,p,h,g,E),msgId:n,direction:exports.MessageDirection.SEND,clientUniqueId:s.clientUniqueId,extraContent:s.extraContent,pushContent:s.pushText,configFlag:s.configFlag,pushExt:s.pushExt,busChannel:s.busChannel,toUserIds:s.toUserIds,optionBits:s.optionBits}},_c=function(e,t,r,i){void 0===r&&(r=!1);var o,s,a,u=e.type,l=![exports.ConversationType.GROUP,exports.ConversationType.CHATROOM,exports.ConversationType.RTC_ROOM,exports.ConversationType.ULTRA_GROUP].includes(u)?i||e.fromUserId:e.groupId||i,c={isPersited:!!(16&(o=e.status)),isCounted:!!(32&o),isMentioned:!!(64&o),disableNotification:!!(512&o),receivedStatus:2&o?exports.ReceivedStatus.RETRIEVED:exports.ReceivedStatus.UNREAD,canIncludeExpansion:!!(1024&o)},d=c.isMentioned,_=c.disableNotification,f=c.receivedStatus,p=c.canIncludeExpansion,h=e.direction===exports.MessageDirection.SEND?exports.MessageDirection.SEND:exports.MessageDirection.RECEIVE,g=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),o=i.disablePushTitle,s=i.forceShowDetailContent,a=Wt(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:o,forceShowDetailContent:s,templateId:null==r?void 0:r.templateId},a)}(e.configFlag||0,e.pushContent,e.pushExt),E=(s=e.extStatus,{isInterrupt:!!(2&(a=s||0)),isModifyMessage:!!(4&a),isPrivateChannel:!!(8&a),isStatusMessage:!!(64&a)}),b=E.isInterrupt,T=E.isModifyMessage,v=E.isPrivateChannel,R=E.isStatusMessage,I=dn(e.classname),m=I.isCounted,y=I.isPersited,A=I.isStatusMessage;return{conversationType:u,targetId:l,senderUserId:h===exports.MessageDirection.SEND?t:e.fromUserId,messageType:e.classname,messageUId:e.msgId,isPersited:y,isCounted:m,isMentioned:d,sentTime:e.dataTime,messageDirection:h,receivedTime:Date.now(),disableNotification:_,receivedStatus:f,receivedStatusInfo:Ct(f),canIncludeExpansion:p,content:lc(e.content),expansion:e.extraContent?cc(e.extraContent):null,pushConfig:g,channelId:e.busChannel||"",isInterrupt:b,isModifyMessage:T,messageId:e.clientUniqueId||0,sentStatus:exports.SentStatus.SENT,isOffLineMessage:r,channelType:v?exports.UltraGroupChannelType.PRIVATE:exports.UltraGroupChannelType.PUBLIC,isStatusMessage:R||!!A,readReceiptInfo:void 0,directedUserIds:e.toUserIds,disableUpdateLastMessage:!!(1&(e.optionBits||0)),needReceipt:!!(2&(e.optionBits||0)),sendReceipt:!!(4&(e.optionBits||0))||void 0,modifyInfo:hc(e.convertExt),extraData:e.extMsgData?{seqId:e.extMsgData.seqId,sentTime:e.extMsgData.sendTime}:void 0}},fc=function(e,t,r,n,i){var o=0,s=dn(e),a=s.isPersited,u=s.isCounted,l=s.isStatusMessage,c=i||l;return a&&!c&&(o|=1),u&&!c&&(o|=2),t&&(o|=4),r&&(o|=32),n&&(o|=64),o},pc=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e),isMentioned:!!(4&e)}},hc=function(e){if(e)try{var t=JSON.parse(e).modify;if(t.time)return{timestamp:t.time,content:{},status:Mr}}catch(t){console.error("parse message modify info error: ".concat(e),t)}},gc=function(e,t){var r=e.content,i=r.sentTime,o=r.messageUId,s=r.isDelete,a=r.isAdmin,u=r.directionalUserIdList,l=r.extra,c={recallTime:i,recallActionTime:e.sentTime,admin:!!a,delete:!!s,isDelete:!!s,operatorId:e.senderUserId,extra:l},d=n(n({},e),{content:c,messageType:me.RECALL_NOTIFICATION_MESSAGE});return t&&(d.messageUId=o,d.sentTime=i,d.directedUserIds=u),d};function Ec(e){return 1&~((null==e?void 0:e.sessionMode)||0)?lr(exports.ErrorCode.RC_REAL_TIME_CONVERSATION_UNAVAILABLE):ur()}function bc(e){return Math.min(e,999)}var Tc={};function vc(){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:jr.getMiniCmpUrlList().join(",")}}var Rc,Ic,mc,yc,Ac,Sc,Oc=function(e){function r(t,r,n,i,o){void 0===i&&(i="default");var s=e.call(this,t,r,n,Zo.useNavi&&"https:"===(null===window||void 0===window?void 0:window.location.protocol),Zo.useNavi,o)||this;return s._environment=i,s}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return o="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(r),"&callBack=x&v=").concat(Be,"&r=").concat(Date.now(),"&env=").concat(this._environment,"&p=").concat(Zo.tag),this.logger.debug(B.L_REQUEST_T,"req navi => ".concat(o),n),[4,Zo.httpReq({url:o,timeout:1e4,dataType:"text"})];case 1:if(200!==(a=s.sent()).status)return this.logger.debug(B.L_REQUEST_R,"request navi failed: ".concat(a.status),n),!Zo.useNavi&&i?[2,ur(vc())]:[2,lr(this.transHttpCode(a.status))];try{return 0===(u=a.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(u=JSON.parse('"'.concat(u,'"'))),(l=JSON.parse(u)).protocol=/^https/.test(o)?"https":"http",l.code&&200!==l.code?[2,lr(this.transHttpCode(l.code))]:(Zo.useNavi||(l.server="",l.backupServer=jr.getMiniCmpUrlList().join(","),l.logSwitch=0),[2,ur(l)])}catch(e){this.logger.error(B.L_PARSE_NAVI_E,a.data,n)}return[2,lr(exports.ErrorCode.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(r.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return o=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:Zo.tag,protocol:(/^https/.test(e)?H.WSS:H.WS).toString()}),this.logger.debug(B.L_REQUEST_T,"req navi => ".concat(o.url),n),[4,Zo.httpReq(o)];case 1:if(200!==(a=s.sent()).status)return this.logger.debug(B.L_REQUEST_R,"request navi failed: ".concat(a.status),n),!Zo.useNavi&&i?[2,ur(vc())]:[2,lr(this.transHttpCode(a.status))];try{return u=a.data,(l="object"!=typeof u?JSON.parse(u):u).protocol=/^https/.test(o.url)?"https":"http",Zo.useNavi||(l.logSwitch=0,c=jr.getMiniCmpUrlList(),l.serverAddr=c.map((function(e,t){return{addr:e,protocol:/^https/.test(o.url)?H.WSS:H.WS,weight:c.length-t}}))),[2,ur(l)]}catch(e){this.logger.error(B.L_PARSE_NAVI_E,a.data,n)}return[2,lr(exports.ErrorCode.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(Tc[r])return Tc[r];var n,i=Ye(this.appkey),o=Zo.localStorage;try{var s=o.getItem(i);n=s?JSON.parse(s):[]}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 Tc[r]=a,a}}),Object.defineProperty(r.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this,i=Ye(this.appkey),o=Zo.localStorage;try{var s=o.getItem(i);r=s?JSON.parse(s):[]}catch(e){r=[]}var a=Date.now();r.length>0&&(r=r.filter((function(t){return a-t.timestamp<je&&(e!==t.token||n._environment!==t.environment)})));var u={timestamp:a,naviInfo:t,token:e,environment:this._environment};r.push(u),o.setItem(i,JSON.stringify(r)),Tc[this.getCatchKey(e)]=u}}),r}(ln),Cc=function(){function e(e){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_sendMessageMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_userId",{enumerable:!0,configurable:!0,writable:!0,value:""})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._userId=e;var t=$e(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)}}),Object.defineProperty(e.prototype,"_getLocalInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Zo.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}}}),Object.defineProperty(e.prototype,"setMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageMap[e]=t;var r=$e(this._appkey,this._userId),n=this._getLocalInfo(r);n[e]=t,Zo.localStorage.setItem(r,JSON.stringify(n))}}),Object.defineProperty(e.prototype,"getSendMessageMap",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._sendMessageMap}}),Object.defineProperty(e.prototype,"removeByUID",{enumerable:!1,configurable:!0,writable:!0,value:function(e){delete this._sendMessageMap[e]}}),Object.defineProperty(e.prototype,"removeByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=$e(this._appkey,this._userId),r=this._getLocalInfo(t);Object.keys(r).forEach((function(t){r[t]<e&&delete r[t]})),Zo.localStorage.setItem(t,JSON.stringify(r))}}),e}(),Nc=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[exports.SubscribeType.ONLINE_STATUS]={},t[exports.SubscribeType.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={})[exports.SubscribeType.ONLINE_STATUS]={},e[exports.SubscribeType.USER_PROFILE]={},e)}}),Object.defineProperty(e.prototype,"clearSubscribeStatusData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e===exports.SubscribeType.ONLINE_STATUS?Object.keys(this.subscribeData[e]).forEach((function(r){t.subscribeData[e][r].statusMap={}})):e===exports.SubscribeType.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 l([],u(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}(),Pc=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 Nc(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=[],o=[];return t&&this._subStore.clearSubscribeRelation(),this._filterSubscribeRelationData(e).forEach((function(e){var t,s,a=e.userId,u=e.subscribeTime,l=e.subscribeType,c=e.expiry;if(e.operationType===exports.SubscribeOperationType.UNSUBSCRIBE)return r._subStore.removeSubscribeUserData(l,a),void o.push(e);var d=r._subStore.getSubscribeUserData(l,a);if(!(d&&d.subscribeTime>=u)){if(l===exports.SubscribeType.ONLINE_STATUS){n.push(a);var _=(null===(t=d)||void 0===t?void 0:t.statusMap)||{};r._subStore.updateSubscribeUserData(l,a,{subscribeTime:u,expiry:c,userId:a,subscribeType:l,statusMap:_})}else{i.push(a);var f=null===(s=d)||void 0===s?void 0:s.profile;r._subStore.updateSubscribeUserData(l,a,{subscribeTime:u,expiry:c,userId:a,subscribeType:l,profile:f,isSubscribed:!0})}o.push(e)}})),{newSubscribeOnlineStatusList:n,newSubscribeUserProfileList:i,subscribeUserChangeList:o}}}),Object.defineProperty(e.prototype,"clearSubscribeStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subStore.clearSubscribeStatusData(exports.SubscribeType.ONLINE_STATUS),this._subStore.clearSubscribeStatusData(exports.SubscribeType.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,o=e.data,s=t._subStore.getSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,i);if(s){var a=[],u=n({},s.statusMap);o.forEach((function(e){var t=e.platformInfo,r=e.versionTime,i=u[t];if(!(i&&i.changeTime>r)){var o={eventValue:e.value,changeTime:r};u[t]=o,a.push(n(n({},o),{platform:t}))}})),t._subStore.updateSubscribeUserData(exports.SubscribeType.ONLINE_STATUS,i,{subscribeTime:s.subscribeTime,expiry:s.expiry,userId:i,subscribeType:exports.SubscribeType.ONLINE_STATUS,statusMap:u}),r.push({userId:i,subscribeType:exports.SubscribeType.ONLINE_STATUS,subscribeTime:s.subscribeTime,expiry:s.expiry,details:a})}})),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,o=e.version,s=e.userProfile,a=e.userExtProfile,u=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,i),l=Pt(i,s,a);u?u.profile&&u.profile.version>=o||(t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,i,{subscribeTime:u.subscribeTime,expiry:u.expiry,userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:l,version:o},isSubscribed:u.isSubscribed}),u.isSubscribed&&r.push({userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,subscribeTime:u.subscribeTime,expiry:u.expiry,userProfile:n({},l)})):t._subStore.updateSubscribeUserData(exports.SubscribeType.USER_PROFILE,i,{subscribeTime:0,expiry:0,userId:i,subscribeType:exports.SubscribeType.USER_PROFILE,profile:{info:l,version:o},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 o=r._subStore.getSubscribeUserData(e,t);if(!o||o.expiry<(Date.now()+r._delayTime-o.subscribeTime)/1e3)r._subStore.removeSubscribeUserData(e,t);else{var s={subscribeTime:o.subscribeTime,expiry:o.expiry,userId:o.userId,subscribeType:o.subscribeType};if(e===exports.SubscribeType.ONLINE_STATUS){var a=o.statusMap,u=Object.keys(a).map((function(e){return n({platform:~~e},a[~~e])}));s.details=Nt(u)}else if(e===exports.SubscribeType.USER_PROFILE&&!o.isSubscribed)return;i.push(s)}})),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 o=t._subStore.getSubscribeUserData(exports.SubscribeType.USER_PROFILE,e);if(o&&o.profile){var s=o.profile,a=s.version,u=s.info;if(o.isSubscribed)return t._delayTime+Date.now()-a>6048e5?void i.push(e):void r.push(n(n({},u),{extraProfile:n({},u.extraProfile)}));t._delayTime+Date.now()-a>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===exports.SubscribeType.ONLINE_STATUS){var i=Object.keys(t.statusMap).map((function(e){return n({platform:~~e},t.statusMap[~~e])}));r.details=Nt(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}(),Lc=function(){function e(e,t,r,n,i,o,s){Object.defineProperty(this,"_connectManager",{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:o}),Object.defineProperty(this,"_subDriven",{enumerable:!0,configurable:!0,writable:!0,value:s}),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 Pc(n)}return Object.defineProperty(e.prototype,"syncData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(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(exports.SubscribeType.ONLINE_STATUS),2&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.USER_PROFILE),3&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_ONLINE_STATUS),4&this._subDriven&&this._event.syncSubscribeUserStatusFinished(exports.SubscribeType.FRIEND_USER_PROFILE),[2]}}))}))}}),Object.defineProperty(e.prototype,"startSyncSubscribeRelationship",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(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),o(this,void 0,void 0,(function(){return s(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=""),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,_,f,p,h;return s(this,(function(s){switch(s.label){case 0:return r=this._subscribeService.getRelationshipStatusVersion(),n=this._logger.createTraceId(),this._logger.info(B.L_PULL_SUBSCRIBED_USER_RELATION_T,JSON.stringify({version:r,_pageToken:t}),n),i=gl.encode(ka,{version:r,pageToken:t}),[4,this._connectManager.query(On.pullUserSub,this._currentUserId,i,Fa)];case 1:return o=s.sent(),this._logger.summary(B.L_PULL_SUBSCRIBED_USER_RELATION_R,o,n),o.isOk?(this._pullRelationshipFailTime=0,a=o.data,u=a.list,l=a.version,c=a.hasNext,d=a.pageToken,e?(_=this._subscribeService.updateSubscribeRelation(u),f=_.newSubscribeOnlineStatusList,p=_.newSubscribeUserProfileList,(h=_.subscribeUserChangeList).length>0&&this._event.subscribeRelationChanged(h),f.length>0&&this._queryAndUpdateUserOnlineStatus(f),p.length>0&&this._queryAndUpdateUserProfile(p)):this._subscribeService.updateSubscribeRelation(u,!t),this._subscribeService.updateRelationshipStatusVersion(l),this._pullRelationshipQueue=this._pullRelationshipQueue.filter((function(e){return e>l})),c?[4,this._pullSubscribeRelationship(e,d)]:[3,3]):(this._pullRelationshipFailTime++,this._pullRelationshipFailTime>5?(this._pullRelationshipFailTime=0,[2]):[2,this._pullSubscribeRelationship(e,t)]);case 2:s.sent(),s.label=3;case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"startsyncSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(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),o(this,void 0,void 0,(function(){return s(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=""),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,_,f,p;return s(this,(function(s){switch(s.label){case 0:return r=this._subscribeService.getSubscribeUserStatusVersion(),n=this._logger.createTraceId(),this._logger.info(B.L_PULL_SUBSCRIBED_USER_STATUS_T,JSON.stringify({version:r,_pageToken:t,needAllData:e}),n),i=gl.encode(Ba,{versionTime:r,needAllData:e,pageToken:t}),[4,this._connectManager.query(On.pullSubData,this._currentUserId,i,Ha)];case 1:return(o=s.sent()).isOk?(this._pullSubUserStatusFailTime=0,a=o.data,u=a.list,l=a.versionTime,c=a.hasNext,d=a.pageToken,_=a.isFull,this._logger.info(B.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),f=[],p=[],u.forEach((function(e){switch(e.subType){case exports.SubscribeType.ONLINE_STATUS:f.push(e);break;case exports.SubscribeType.USER_PROFILE:p.push(e.subUserId);case exports.SubscribeType.FRIEND_ONLINE_STATUS:case exports.SubscribeType.FRIEND_USER_PROFILE:}})),_&&""===t&&this._subscribeService.clearSubscribeStatus(),f.length>0&&this._updateUserOnlineStatus(f,!_),p.length>0?[4,this._queryAndUpdateUserProfile(p,!_)]:[3,3]):(this._logger.warn(B.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:s.sent(),s.label=3;case 3:return c?[4,this._pullSubscribeUserStatus(e,d)]:[3,5];case 4:s.sent(),s.label=5;case 5:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_queryAndUpdateUserOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return t=this._logger.createTraceId(),this._logger.info(B.L_QUERY_SUBSCRIBE_DATA_T,JSON.stringify(e),t),r=gl.encode(Ya,{subType:exports.SubscribeType.ONLINE_STATUS,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._connectManager.query(On.qrySubData,this._currentUserId,r,Ha)];case 1:return n=i.sent(),this._logger.summary(B.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),o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this._logger.createTraceId(),this._logger.info(B.L_PULL_USER_PROFILE_T,JSON.stringify(e),r),n=gl.encode(Ka,{userId:e}),i=new eo(On.pullUserProfile,n,this._currentUserId),[4,this._connectManager.send(i,Qa)];case 1:return o=s.sent(),a=o.code,u=o.data,this._logger.info(B.L_PULL_USER_PROFILE_R,JSON.stringify({code:a,data:u}),r),a!==exports.ErrorCode.SUCCESS?[2,lr(a)]:(l=this._subscribeService.updateSubscribeUserProfile(u.UserProfile),t&&l.length>0&&this._event.subscribeUserStatusChanged(l),[2,ur(u.UserProfile)])}}))}))}}),Object.defineProperty(e.prototype,"updateUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return(t=gl.decode(qa,e.pbData)).subType!==exports.SubscribeType.ONLINE_STATUS?[3,1]:(this._updateUserOnlineStatus([t]),[3,5]);case 1:return t.subType!==exports.SubscribeType.USER_PROFILE?[3,2]:(this._queryAndUpdateUserProfile([t.subUserId]),[3,5]);case 2:return t.subType!==exports.SubscribeType.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!==exports.SubscribeType.FRIEND_USER_PROFILE?[3,5]:[4,this._queryAndUpdateUserProfile([t.subUserId])];case 4:n=o.sent(),(i=n.data)&&this._event.subscribeUserStatusChanged([{userId:t.subUserId,subscribeType:t.subType,subscribeTime:0,expiry:0,userProfile:Pt(t.subUserId,i[0].userProfile,i[0].userExtProfile)}]),o.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),o(this,void 0,void 0,(function(){var i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return i=gl.encode(Va,{subType:t,opType:r,expiry:n,subUsers:e.map((function(e){return{subUserId:e}}))}),[4,this._connectManager.query(On.updUserSub,this._currentUserId,i,ja)];case 1:return o=s.sent(),a=o.code,u=o.data,l=o.isOk,a===exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT?[2,lr(a,"",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===exports.SubscribeOperationType.SUBSCRIBE&&(t===exports.SubscribeType.ONLINE_STATUS?this._queryAndUpdateUserOnlineStatus(e):t===exports.SubscribeType.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 o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._subscribeService.getUserProfiles(e),r=t.needQueryUserIds,n=t.list,0===r.length?[2,ur(n)]:[4,this._queryAndUpdateUserProfile(r,!1)];case 1:return(i=s.sent()).isOk?(o=i.data.map((function(e){return Pt(e.userId,e.userProfile,e.userExtProfile)})),[2,ur(l(l([],u(n),!1),u(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),o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return this._isOpenUserProfile?(t=this._logger.createTraceId(),this._logger.info(B.L_PULL_OWN_PROFILE_T,"",t),r=gl.encode(Xa,{nothing:1}),[4,this._connectManager.query(On.pullOwnProfile,this._currentUserId,r,Wa)]):[2,lr(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE)];case 1:return n=s.sent(),this._logger.summary(B.L_PULL_OWN_PROFILE_R,n,t),n.isOk?(i=n.data,o=i.userExtProfile,a=i.userProfile,u=i.version,l=i.userId,c=Pt(l,a,o),this._subscribeService.updateOwnProfile(c,u),e&&this._event.ownUserProfileChanged(c),[2,ur(c)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return(e=this._subscribeService.getOwnProfile())?[2,ur(e)]:[2,this.syncOwnProfile()]}))}))}}),Object.defineProperty(e.prototype,"updateOwnProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return this._subscribeService.updateOwnProfile(e,t),[2]}))}))}}),e}(),Mc=function(){function e(e,t,r){Object.defineProperty(this,"_storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_delayTime",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._storage=new nc(it(e,t)),this._delayTime=r,this.clear()}return Object.defineProperty(e.prototype,"_getConversationKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"".concat(e.targetId,"_").concat(e.channelId)}}),Object.defineProperty(e.prototype,"_removeExcessData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=Object.keys(e).map((function(t){return{key:t,value:e[t]}})).sort((function(e,t){return e.value.t-t.value.t})).slice(-30),i={};try{for(var o=a(n),s=o.next();!s.done;s=o.next()){var u=s.value;i[u.key]=u.value}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i}}),Object.defineProperty(e.prototype,"insert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,o){var s;if(!(i<Date.now()-this._delayTime-qe)){var a=this._getConversationKey(e),u=this._storage.get(a)||{};if(!u[t]){var l={t:i,d:r};o&&(l.sId=o);var c=n(n({},u),((s={})[t]=l,s));Object.keys(c).length>30&&(c=this._removeExcessData(c)),this._storage.set(a,c)}}}}),Object.defineProperty(e.prototype,"addReadedUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var i,o=this._getConversationKey(e),s=this._storage.get(o)||{},a=s[t];if(a){if(a.us){if(a.us.includes(r))return}else a.us=[];a.us.push(r),this._storage.set(o,n(n({},s),((i={})[t]=a,i)))}}}),Object.defineProperty(e.prototype,"getReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._getConversationKey(e),n=(this._storage.get(r)||{})[t];return n?{time:n.t,direction:n.d,users:n.us||[],senderId:n.sId}:null}}),Object.defineProperty(e.prototype,"getReceiptMessageDic",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._getConversationKey(e),r=this._storage.get(t)||{},n={};for(var i in r){var o=r[i];o.d===exports.MessageDirection.RECEIVE&&(n[o.sId]||(n[o.sId]=[]),n[o.sId].push(i))}return n}}),Object.defineProperty(e.prototype,"remove",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._getConversationKey(e),n=this._storage.get(r)||{};n[t]&&(delete n[t],0===Object.keys(n).length?this._storage.remove(r):this._storage.set(r,n))}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._storage.getValues(),t={};for(var r in e){var n=e[r],i={};for(var o in n){var s=n[o];Date.now()-this._delayTime-s.t<qe&&(i[o]=s)}Object.keys(i).length&&(t[r]=i)}this._storage.update(t)}}),e}(),wc=function(e){function r(t,r){var n=e.call(this,t,r)||this;return Object.defineProperty(n,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"_storageKey",{enumerable:!0,configurable:!0,writable:!0,value:""}),n._storageKey=rt(t),n}return t(r,e),Object.defineProperty(r.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Zo.localStorage.getItem(this._storageKey)}}),Object.defineProperty(r.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){Zo.localStorage.setItem(this._storageKey,e)}}),Object.defineProperty(r.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){Zo.localStorage.removeItem(this._storageKey)}}),Object.defineProperty(r.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return[4,Zo.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 o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Zt(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(B.L_GET_STATIC_CONF_E,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),r}(kr),Uc=((Rc={})[L.GROUP_OPERATION]=function(e){return"ChannelEventData"},Rc[L.GROUP_PROFILE_CHANGE]=function(e){return"ChannelEventData"},Rc[b.FRIEND_APPLICATION]=function(e){return{0:"FriendApplyEvent",1:"FriendApplyEvent",2:"FriendUserInfo",3:"FriendsInput",5:"FriendTypeChangeEvent",6:"FriendUpdateEvent"}[e]},Rc),Dc=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&&gl.decode(t,e),Tt(i)&&(n=i.call(this,n,r))}catch(e){this.logger.error(B.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,o=e.changeType,s=e.originalId,a=e.originalTime,u=e.secondaryId,l=e.isAdmin,c=e.additionalMark,d=e.operatorId,_=e.subChangeType,f=e.secondaryType,p=e.remindType,h=e.isRemindMe,g=e.extIds,E=e.eventData;return E&&(r=t._formatEventData(E,o,_)),{businessId:n,changeType:o,originalId:s,time:i,originalTime:a,secondaryId:u||"",isAdmin:l,additionalMark:c,operatorId:d,subChangeType:_,userGroupIds:g,secondaryType:f,remindType:p,isRemindMe:h,eventData:r}}))}}),Object.defineProperty(e.prototype,"_formatEventData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n={};return e&&Uc[t]&&Uc[t](r)&&(n=gl.decode(Uc[t](r),e)||{}),n}}),e}(),xc=((Ic={})[Li]=exports.ErrorCode.RC_DISCONN_KICK,Ic[Mi]=exports.ErrorCode.RC_DISCONN_EXCEPTION,Ic[Ui]=exports.ErrorCode.RC_DISCONN_EXCEPTION,Ic[Di]=exports.ErrorCode.RC_CONN_REDIRECTED,Ic[xi]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,Ic[Gi]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,Ic[Vi]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,Ic),Gc=((mc={})[ci]=exports.ErrorCode.SUCCESS,mc[di]=exports.ErrorCode.RC_CONN_PROTO_VERSION_ERROR,mc[_i]=exports.ErrorCode.RC_CONN_IDENTIFIER_REJECTED,mc[fi]=exports.ErrorCode.RC_CONN_SERVER_UNAVAILABLE,mc[pi]=exports.ErrorCode.RC_CONN_TOKEN_INCORRECT,mc[hi]=exports.ErrorCode.RC_CONN_NOT_AUTHRORIZED,mc[gi]=exports.ErrorCode.RC_CONN_REDIRECTED,mc[Ei]=exports.ErrorCode.RC_CONN_PACKAGE_NAME_INVALID,mc[bi]=exports.ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED,mc[Ti]=exports.ErrorCode.RC_CONN_USER_BLOCKED,mc[vi]=exports.ErrorCode.RC_CONN_TOKEN_EXPIRED,mc[Ri]=exports.ErrorCode.RC_CONN_DEVICE_ERROR,mc[Ii]=exports.ErrorCode.RC_CONN_HOSTNAME_ERROR,mc[mi]=exports.ErrorCode.RC_DISCONN_SAME_CLIENT_ON_LINE,mc[yi]=exports.ErrorCode.RC_LISCENSE_COUNT_OUT_OF_LIMIT,mc[Ai]=exports.ErrorCode.RC_CONN_WRONG_CLUSTER,mc[Si]=exports.ErrorCode.RC_APP_AUTH_NOT_PASS,mc[Oi]=exports.ErrorCode.RC_OTP_USED,mc[Ci]=exports.ErrorCode.RC_PLATFORM_ERROR,mc[Ni]=exports.ErrorCode.RC_ACCOUNT_CANCELLATION,mc[Pi]=exports.ErrorCode.RC_LICENSE_EXPIRED,mc),Vc=function(e){return[On.ppMsgS,On.pgMsgS,On.chatMsgS,On.prMsgS].includes(e)},jc=function(e){function r(t,r,n){var i=e.call(this,t,r,n)||this;return Object.defineProperty(i,"_socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_socketIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_serverSessionId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_localConnectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"codec",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_idCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_generateMessageId",{enumerable:!0,configurable:!0,writable:!0,value:function(){return i._idCount>=65535&&(i._idCount=0),++i._idCount}}),Object.defineProperty(i,"_pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_messageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(i,"_syncMessageIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),i.codec=new Dc(i.logger),i}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 o(this,void 0,void 0,(function(){var r,i,o,a,u,l,c,d,_,f;return s(this,(function(p){switch(p.label){case 0:if(r=t.openAnti,i=t.type,o=t.baggageEnabled,a=this.getCmpList(t),this.logger.debug(B.L_NAVI_CMP_R,JSON.stringify(a),n),0===(u=a.filter((function(e,t){return a.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(B.L_NAVI_CONF_E,"no service available",n),[2,lr(exports.ErrorCode.SERVER_UNAVAILABLE)];l=1===r?Bn:Hn,c=function(t){var r,a,c,_,f,p,h,g,E,b,T;return s(this,(function(s){switch(s.label){case 0:return r=u[t],a=r.protocol,c=r.addr,_=r.weight,f=function(e,t,r,n,i,o,s,a){var u,l=s?"&protocolVer=".concat(s):"",c=oc(),d=ac();return"".concat(e,"://").concat(t,"/websocket?appId=").concat(r,"&token=").concat(encodeURIComponent(n),"&sdkVer=").concat(Be,"&pid=").concat(o,"&deviceId=").concat(encodeURIComponent(c)).concat(1===a?"&baggage=".concat(encodeURIComponent("cid=".concat(i))):"","&apiVer=").concat(encodeURIComponent((null===(u=Zo.getApiVer)||void 0===u?void 0:u.call(Zo))||"||")).concat(Zo.connectPlatform?"&platform=".concat(Zo.connectPlatform):"").concat(l).concat(Zo.isFromUniapp?"&appIdentifier=".concat(encodeURIComponent(d)):"")}(a===H.WS?"ws":"wss",c,d.appkey,e,d.cid,"",l,o),p=Date.now(),[4,d.connectWebSocket(f,l,n)];case 1:return h=s.sent(),g=h.code,E=h.data,b=d.cmpWeightCache.findIndex((function(e){return e.addr===c})),T={bid:Xt(),ptc:Se.WS,cod:g,net:d.getNetwork().type,dur:Date.now()-p,spr:0,pr:i||0,hos:c,idx:b,rct:d.retryCount?Ne.RECONNECT:Ne.CONNECT,cid:d.cid,v:Ce.CURRENT,rsn:d._doConnectReason,count:d.retryCount,weight:_,ssid:d._serverSessionId},d.logger.record(ve.IM_WEBSOCKET,JSON.stringify(T),n),g===exports.ErrorCode.RC_SOCKET_DISCONNECTED||g===exports.ErrorCode.TIMEOUT?[2,"continue"]:g!==exports.ErrorCode.SUCCESS?[2,{value:lr(g)}]:(d._localConnectedTime=Math.floor((Date.now()+p)/2),d._socket=E.socket,d.updateCmpWeight(u[t].addr,!0),d.curCmpUrl=u[t].addr,[2,{value:ur(E.userId)}])}}))},d=this,_=0,p.label=1;case 1:return _<u.length?[5,c(_)]:[3,4];case 2:if("object"==typeof(f=p.sent()))return[2,f.value];p.label=3;case 3:return _+=1,[3,1];case 4:return[2,lr(exports.ErrorCode.SERVER_UNAVAILABLE)]}}))}))}}),Object.defineProperty(r.prototype,"connectWebSocket",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,_,f=this;return s(this,(function(s){switch(s.label){case 0:return this.logger.info(B.L_CONNECT_O,"connect start: ".concat(e),r),n=pr(),i=n.resolve,o=n.promise,[4,Zo.createWebSocket(e)];case 1:return a=s.sent(),u=a.data,l=a.code,c=a.msg,l===exports.ErrorCode.SUCCESS&&u?(this._socketIndex=u.id,d=exports.ErrorCode.SUCCESS,_=setTimeout((function(){f.logger.warn(B.L_CONNECT_S,"timeout",r),d=exports.ErrorCode.TIMEOUT,u.close()}),5e3),u.onOpen((function(){f.logger.info(B.L_CONNECT_S,"socket opened",r),clearTimeout(_)})),u.onError((function(e){f.logger.info(B.L_CONNECT_S,"socket error",r),clearTimeout(_);var t=exports.ErrorCode.RC_SOCKET_DISCONNECTED;i(lr(t)),f.onSocketEnd(u,t)})),u.onClose((function(){f.logger.info(B.L_CONNECT_S,"socket close",r);var e=d===exports.ErrorCode.SUCCESS?exports.ErrorCode.RC_SOCKET_DISCONNECTED:d;i(lr(e)),f.onSocketEnd(u,e)})),u.onMessage((function(e){if(f._socketIndex===u.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var n=so(e,t);if(n){if(n instanceof Yi){var o=n.status;if(o!==ci)return f.logger.warn(B.L_CONNECT_O,"connect failed: ".concat(o),r),d=Gc[o],u.close(),void i(lr(d));f.logger.info(B.L_CONNECT_O,"connect success",r);var s=n.timestamp,a=n.userId,l=n.messageId,c=n.sessionId;return f._serverSessionId=c,f._connectedTime=s,f._idCount=l,void i(ur({userId:a,socket:u}))}if(n instanceof Ji){var _=n.status;return f.logger.info(B.T,"recv disconnect signal -> status: ".concat(_)),void f.onRecvDisconnect(_,u)}f._onReceiveSignal(n)}}}else f.logger.warn(B.L_WS_DISACCORD_E,JSON.stringify({socketIndex:f._socketIndex,curSocketId:u.id}))})),[2,o]):[2,lr(l,c)]}}))}))}}),Object.defineProperty(r.prototype,"_qosNeedAck",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.header.qos!==Ln)return e instanceof zi&&!e.syncMsg?(this.logger.debug(B.O,"send pubAck -> ".concat(e.messageId," ").concat(e.topic)),void this.sendOnly(new no(e.messageId))):void(e instanceof oo&&this._messageIds[e.messageId]&&(this.logger.debug(B.O,"send queryCon -> ".concat(e.messageId)),this.sendOnly(new io(e.messageId))))}}),Object.defineProperty(r.prototype,"_publishReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return t=e.syncMsg,r=e.topic,n=e.messageId,this.logger.debug(B.O,"recv PublishReader -> messageId: ".concat(n," ").concat(r)),r===Qn?[2]:!t||Vc(Nn(r))?(this.emit("signal",e),[2]):[4,new Promise((function(e){o._syncMessageIds[n]=e}))];case 1:return i=s.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 o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return e instanceof Qi&&this._pingResolve?(this._pingResolve(exports.ErrorCode.SUCCESS),this._pingResolve=void 0,[2]):(this._qosNeedAck(e),(e instanceof ro||e instanceof oo)&&(t=e.messageId,this.logger.debug(B.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 zi?[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 xc[e]}(e)))}}),Object.defineProperty(r.prototype,"onSocketEnd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._socket&&this._socket===e&&(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t),this._pingResolve&&(this._pingResolve(t),this._pingResolve=void 0))}}),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(exports.ErrorCode.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(exports.ErrorCode.TIMEOUT)}),e),t.sendOnly(new Ki)}))}}),Object.defineProperty(r.prototype,"sendOnly",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._socket&&((e instanceof to||e instanceof eo)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getArrayBuffer()))}}),Object.defineProperty(r.prototype,"_sendHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.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(exports.ErrorCode.TIMEOUT)}),3e4)}))]):[2,lr(exports.ErrorCode.RC_NET_CHANNEL_INVALID)];case 1:return r=o.sent(),n="number"==typeof r?r:r.status,exports.ErrorCode.SUCCESS,"number"==typeof r?[2,lr(r)]:[2,n===exports.ErrorCode.SUCCESS?ur(r):lr(n,"",r)]}}))}))}}),Object.defineProperty(r.prototype,"query",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a,u;return s(this,(function(s){switch(s.label){case 0:return this.logger.createTraceId(),Pn(e),o=new eo(e,r,t),i&&o.setHeaderQos(i),[4,this._sendHandler(o)];case 1:return a=s.sent(),u=a.data,a.isOk&&void 0!==n?[2,ur(gl.decode(n,u.pbData))]:[2,a]}}))}))}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return[4,this._sendHandler(e)];case 1:return(r=s.sent()).data?r.data instanceof ro?[2,r]:(n=r.data,i=t&&n.pbData&&[exports.ErrorCode.SUCCESS,exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS,exports.ErrorCode.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT,exports.ErrorCode.RC_USER_PROFILE_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_EXT_KEY_NOT_EXIST,exports.ErrorCode.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS,exports.ErrorCode.RC_USER_PROFILE_VALUE_EXCEED_RANGE,exports.ErrorCode.RC_GROUP_PARAMETER_FORMAT_ERROR].indexOf(n.status)>=0,o=i?gl.decode(t,n.pbData):n,0!==n.status?[2,lr(n.status,void 0,t&&n.pbData?o:null)]:[2,ur(o)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return r?[4,this.sendOnly(new Wi(wi))]:[3,2];case 1:e.sent(),e.label=2;case 2:return this._socket&&(this._socket.close(),this._socket=null),this.clearResolves(),[2]}}))}))}}),r}(an),kc=function(e){function r(t,r,n){var i=e.call(this,r,t,n)||this;Object.defineProperty(i,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"model",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_mrtr",{enumerable:!0,configurable:!0,writable:!0,value:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}});var o=Zo.runtimeInfo,s=o.type,a=o.version;return i.deviceId=oc(),i.model="Web|".concat(s,"|").concat(a),i.init(),i}return t(r,e),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,_,f;return s(this,(function(s){switch(s.label){case 0:return(i=n).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},a=this.logger.createTraceId(),this.logger.info(B.L_REQUEST_T,JSON.stringify(o),a),[4,Zo.httpReq(o)];case 1:u=s.sent(),l=u.status,c=u.data,d=void 0===c?"":c,this.logger.info(B.L_REQUEST_R,JSON.stringify({status:l,data:d}),a);try{return _=JSON.parse(d),f=_.data,[2,{code:parseInt(_.code,10),data:f}]}catch(e){return this.logger.warn(B.L_CLOUD_CONFIG_DATA_E,JSON.stringify({status:l,data:d,error:e})),[2,{code:l,msg:e}]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=nt(this.appkey);Zo.localStorage.setItem(t,JSON.stringify(e)),this.logger.info(B.L_CLOUD_SET_CACHE_O,JSON.stringify(e))}}),Object.defineProperty(r.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=nt(this.appkey),t=Zo.localStorage.getItem(e);return this.logger.info(B.L_CLOUD_SET_CACHE_O,JSON.stringify({appkey:this.appkey,key:e,data:t})),t}}),Object.defineProperty(r.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.info(B.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}(on),Fc=function(e){function r(t,r,n,i){var o=e.call(this,t,r,n,i)||this;return Object.defineProperty(o,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_id",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_type",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:i}),yc.set(o,void 0),Ac.set(o,dt),d(o,yc,new nc(ot(t)),"f"),o}return t(r,e),Object.defineProperty(r.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){d(this,Ac,e,"f")}}),Object.defineProperty(r.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,Ac,"f")}}),Object.defineProperty(r.prototype,"setConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){try{return c(this,yc,"f").set(e,t),!0}catch(e){return!1}}}),Object.defineProperty(r.prototype,"getConf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return{success:!0,value:c(this,yc,"f").get(e)}}catch(e){return{success:!1}}}}),r}(Hr);yc=new WeakMap,Ac=new WeakMap;var Bc=null,Hc="RC_LOGS",qc="RC_STATISTICS",Yc=((Sc={})[Hc]=["level","time"],Sc[qc]=["level","time"],Sc),Wc=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite").objectStore(t).index("time"),o=IDBKeyRange.upperBound(Date.now()-r),s=i.openCursor(o);s.onsuccess=function(e){var t=e.target.result;t?(t.delete(),t.continue()):n()},s.onerror=function(){n()}}))},Jc=null,Kc=function(e){return o(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return[4,Bc];case 1:return(t=n.sent())?(r=t.db,[4,Wc(r,Hc,e)]):[2];case 2:return n.sent(),[4,Wc(r,qc,e)];case 3:return n.sent(),Jc=setTimeout((function(){return Kc(e)}),6e5),[2]}}))}))},Qc=function(e,t,r){void 0===r&&(r=168),Bc||("undefined"!=typeof window&&window&&window.indexedDB&&"IE"!==Zo.runtimeInfo.type?Bc=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 o="RC_LOGS_".concat(e),s=i.open(o,2);s.onerror=function(e){t.error(B.L_LOGDB_OPEN_FAILED_E,e.target.error),n(null)},s.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){Bc=null,t.warn(B.L_LOGDB_CLOSED_S)},o.onerror=function(e){Bc=null,t.error(B.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(B.L_LOGDB_ABORT_S,e.target.error)},Kc(3600*Math.max(24,Math.min(168,r))*1e3),n({appkey:e,db:o})):n(null)},s.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(B.L_UNSUPPORT_INDEXDB_O))},Xc=[],Zc=function(e,t,r){return new Promise((function(n){var i=e.transaction(t,"readwrite");i.oncomplete=n,i.onabort=n;var o=i.objectStore(t);r.forEach((function(e){try{o.add(e)}catch(t){null===console||void 0===console||console.error("write failed ->",e,t)}}))}))},zc=[],$c=!1,ed=function(e){return o(void 0,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return $c||0===zc.length?[2]:($c=!0,t=zc.filter((function(e){return e.level<exports.LogL.FATAL})),r=zc.filter((function(e){return e.level>=exports.LogL.FATAL})),zc.length=0,[4,Zc(e,Hc,r)]);case 1:return n.sent(),[4,Zc(e,qc,t)];case 2:return n.sent(),$c=!1,0===zc.length&&Xc.length>0&&(Xc.forEach((function(e){return e.close()})),Xc.length=0),setTimeout((function(){return ed(e)})),[2]}}))}))},td=function(){var e=Xr();return e.setLogReader((function(e,t,r,n,i){return void 0===i&&(i=Hc),o(void 0,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return[4,Bc];case 1:return(o=s.sent())?[2,new Promise((function(s){var a=o.db.transaction(i,"readonly").objectStore(i),u=[],l=IDBKeyRange.bound(e,t),c=a.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===ct:i.level>=0)&&u.push(i),t.continue()}else s({logs:u})},c.onerror=function(){s({logs:[]})}}))]:[2,{logs:[]}]}}))}))})),e.setLogWriter((function(e){!function(e){o(void 0,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return[4,Bc];case 1:if(!(t=r.sent()))return[2];if(e.content&&_t(e.content))try{e.content=JSON.parse(e.content)}catch(e){}return zc.push(e),ed(t.db),[2]}}))}))}(e)})),e},rd="REPORT_SESSION",nd=function(e,t){return o(void 0,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){return r="".concat(rd,"_").concat(e),n=t.getSessionId(),i=t.getConf(r),o=i.success,a=i.value,o?(n===(null==a?void 0:a.sessionId)||t.setConf(r,{sessionId:n}),[2]):[2]}))}))},id=function(e,t){return o(void 0,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){return r=t.getSessionId(),n=t.getConf("".concat(rd,"_").concat(e)),i=n.success,o=n.value,[2,i&&(null==o?void 0:o.sessionId)===r]}))}))},od=144e5;if("undefined"!=typeof window){window.__rongcloud_devtools__={logger:{get:function(e,t,r){return void 0===t&&(t=Date.now()-od),void 0===r&&(r=Date.now()),o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=t<0?Date.now()+t:t,(r=r<=0?Date.now():r)-t>od&&(t=r-od),n=Xr(),(i=new Fc(e,"RC-IM","IM",n)).debug(B.T,"get logs: startTime ".concat(t," endTime ").concat(r)),Qc(e,i),[4,n.read(t,r,exports.LogL.DEBUG,!1)];case 1:return o=s.sent().logs,i.debug(B.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,o=e.tag,s=e.traceId,a=e.loggerId,u=e.content;return"".concat(t,",").concat(r,",").concat(n,",").concat(i,",").concat(o,",").concat(s,",").concat(a,',"').concat(u,'"\n')})),n=new Blob(r,{type:"text/csv"}),i=URL.createObjectURL(n),o=document.createElement("a");o.href=i,o.download="".concat(e,".csv"),document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)}("".concat(e,"-").concat(t,"-").concat(r),o),[2]}}))}))}}}}var sd,ad,ud,ld,cd,dd=function(){function e(){}return Object.defineProperty(e,"enable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),_d=48,fd=64,pd=80,hd=96,gd="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ed=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=[],o=[],s=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=Td(e.length),r=String.fromCharCode(pd|t.length);i.push(r+t)}else{var n=String.fromCharCode(hd|e.length);i.push(n)}i.push(e)}},a=0;a<e.length;){var u=bd(t,e,a);if(u.length<2)o.push(e.charAt(a++));else if(u.length<4)o.push(e.substr(a,u.length)),a+=u.length;else{var l=Td(a-u.offset),c=Td(u.length);if(l.length+c.length>=u.length)o.push(e.substr(a,u.length)),a+=u.length;else{s();var d=String.fromCharCode(fd|l.length<<2|c.length);i.push(d+l+c),a+=u.length}}}s();var _=Td(e.length),f=String.fromCharCode(_d|_.length);return i.push(f+_),i.join("")},bd=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 o=t.length-r,s=0,a=i.length;s<a;s++){var u=i[s],l=r-u;if(!(l>238327)){var c=Math.min(o,l);if(c<=n.length)break;if(!(n.length>2&&t.charAt(u+n.length-1)!==t.charAt(r+n.length-1))){for(var d=2,_=d;_<c&&t.charAt(u+_)===t.charAt(r+_);_++)d++;d>=n.length&&(n.length=d,n.offset=u)}}}return n},Td=function(e){var t=[],r=0;do{r=e%62,t.push(gd.charAt(r)),e=(e-r)/62}while(e>0);return t.join("")},vd=function(e){function r(t,r,n,i){var o,s=oc(),a=Zo.runtimeInfo,u=a.type,l=a.version,c="".concat(u,"|").concat(l,"|").concat(r.getSessionId(),"|").concat(Zo.connectPlatform);return o=e.call(this,t,s,c,i,r)||this,Object.defineProperty(o,"tableName",{enumerable:!0,configurable:!0,writable:!0,value:n}),o}return t(r,e),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Zo.httpReq(e)}}),Object.defineProperty(r.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,nd(t.userId,this.logger)];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 o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,{success:!0,data:Ed(e.map(Yr).join(""))}]}))}))}}),Object.defineProperty(r.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,r,n,this.tableName)]}))}))}}),r}(qr),Rd=function(e){function r(t,r,n){return e.call(this,t,r,Hc,n)||this}return t(r,e),Object.defineProperty(r.prototype,"isReporter",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,id(this.userId,this.logger)];case 1:return[2,e.sent()]}}))}))}}),Object.defineProperty(r.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n,i,a,u,l){return void 0===l&&(l=!1),o(this,void 0,void 0,(function(){var o;return s(this,(function(s){switch(s.label){case 0:return[4,this.isReporter()];case 1:return o=s.sent(),this.userId&&!o?[2]:[2,e.prototype.report.call(this,t,r,n,i,a,u,l)]}}))}))}}),r}(vd),Id=function(e){function r(t,r,n){return e.call(this,t,r,qc,n)||this}return t(r,e),r}(vd),md=function(e){function r(t,r){var n=e.call(this,"WebConversationSettings")||this;return sd.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}),ad.set(n,!1),n._ctx.on("sCmd",c(n,sd,"m",ld),n),n._ctx.on("onConnected",c(n,sd,"m",ud),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){switch(r.label){case 0:return[4,c(this,sd,"m",cd).call(this,e)];case 1:return[2,r.sent().trans((function(e){return{version:t._storage.get("conversationStatusVersion")}}))]}}))}))}}),Object.defineProperty(r.prototype,"syncDataFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=this._storage.get("conversationStatusVersion"),[4,c(this,sd,"m",cd).call(this,e)];case 1:return t.sent(),[2,this._storage.get("conversationStatusVersion")]}}))}))}}),r}(or);ad=new WeakMap,sd=new WeakSet,ud=function(){d(this,ad,!0,"f")},ld=function(e,t){var r=t.type,n=t.time;if(3===r)this.push(n),e.stopPropagation()},cd=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),t.info(B.L_PULL_CONVERSATION_SETTINGS_T,JSON.stringify({version:e}),r),n=gl.encode(Zs,{time:e}),[4,this._ctx.query(On.pullSeAtts,this._ctx.currentUserId,n,zs)];case 1:return i=s.sent(),t.summary(B.L_PULL_CONVERSATION_SETTINGS_R,i,r,{version:e},(function(t){return{syncTime:t.version,version:e}})),i.isOk&&(o=this._storage.updateBySessionStates(i.data)).length&&this._ctx.emit("conversationStatusChanged",o),c(this,ad,"f")&&(d(this,ad,!1,"f"),this._ctx.emit("conversationStatusSynced",i.code)),[2,i]}}))}))};var yd,Ad,Sd,Od,Cd=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 o=i?JSON.stringify(t):t;Zo.localStorage.setItem(n,o)}}),e}(),Nd=function(e){var t;return"".concat(null!==(t=e.channelId)&&void 0!==t?t:"","_").concat(e.conversationType,"_").concat(e.targetId)},Pd=function(e){var t=u(e.split("_")),r=t[0],n=t[1],i=t.slice(2);return{channelId:r,conversationType:parseInt(n,10),targetId:i.join("_")}};function Ld(e){if(e){if(Array.isArray(e))return e;var t=Object.entries(e).map((function(e){var t=u(e,2);return{tagId:t[0],isTop:t[1].isTop}}));return t}}var Md=function(){return{latestMessage:null,lastReadTime:0,firstUnreadMessageType:"",firstUnreadMessageUId:"",firstUnreadTime:0,unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,isTop:!1,notificationLevel:exports.NotificationLevel.NOT_SET,translateStrategy:vn.DEFAULT,tags:[],channelType:exports.UltraGroupChannelType.PUBLIC,operationTime:0,draft:"",hidden:!1,includeRobot:!1}},wd=function(){function e(e){yd.set(this,void 0),Ad.set(this,void 0),Sd.set(this,void 0),Od.set(this,Md()),d(this,yd,e.conversationType,"f"),d(this,Ad,e.targetId,"f"),d(this,Sd,e.channelId||"","f")}return Object.defineProperty(e.prototype,"conversationType",{get:function(){return c(this,yd,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetId",{get:function(){return c(this,Ad,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelId",{get:function(){return c(this,Sd,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelType",{get:function(){return c(this,Od,"f").channelType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hidden",{get:function(){return!!c(this,Od,"f").hidden},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isTop",{get:function(){return!!c(this,Od,"f").isTop},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationLevel",{get:function(){return c(this,Od,"f").notificationLevel||exports.NotificationLevel.NOT_SET},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"translateStrategy",{get:function(){return c(this,Od,"f").translateStrategy||vn.DEFAULT},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tags",{get:function(){return(c(this,Od,"f").tags||[]).map((function(e){return{tagId:e.tagId,isTop:e.isTop}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadCount",{get:function(){return c(this,Od,"f").unreadCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedCount",{get:function(){return c(this,Od,"f").unreadMentionedCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unreadMentionedMeCount",{get:function(){return c(this,Od,"f").unreadMentionedMeCount||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasMentioned",{get:function(){return!!c(this,Od,"f").hasMentioned},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mentionedInfo",{get:function(){return c(this,Od,"f").mentionedInfo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastReadTime",{get:function(){return c(this,Od,"f").lastReadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadTime",{get:function(){return c(this,Od,"f").firstUnreadTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageUId",{get:function(){return c(this,Od,"f").firstUnreadMessageUId||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstUnreadMessageType",{get:function(){return c(this,Od,"f").firstUnreadMessageType||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"latestMessage",{get:function(){return c(this,Od,"f").latestMessage||null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"operationTime",{get:function(){return c(this,Od,"f").operationTime||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"draft",{get:function(){return c(this,Od,"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:c(this,yd,"f"),targetId:c(this,Ad,"f"),channelId:c(this,Sd,"f")}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return Nd(this.identifier)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"includeRobot",{get:function(){return!!c(this,Od,"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!==exports.NotificationLevel.NOT_SET&&(e.nl=this.notificationLevel),this.tags.length>0&&(e.tg=this.tags),this.translateStrategy!==vn.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({},Md()),{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){return this.updateAttrs({unreadCount:0,unreadMentionedCount:0,unreadMentionedMeCount:0,hasMentioned:!1,mentionedInfo:void 0,lastReadTime:e,firstUnreadTime:0,firstUnreadMessageType:void 0,firstUnreadMessageUId:void 0},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};return Object.entries(i).forEach((function(i){var o=u(i,2),s=o[0],a=o[1],l=s;if(Object.prototype.hasOwnProperty.call(e,l)){var d=e[l];c(r,Od,"f")[l]!==d&&(c(r,Od,"f")[l]=d,a&&(n[a]={time:t,val:d}))}})),Object.keys(n).length>0?n:null}}),e}();yd=new WeakMap,Ad=new WeakMap,Sd=new WeakMap,Od=new WeakMap;var Ud,Dd,xd,Gd=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),t}}),r}(wd),Vd=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}(wd),kd=function(e){function r(t){var r=e.call(this)||this;return Ud.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}),r}return t(r,e),Object.defineProperty(r.prototype,"_syncDataHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Zo.localStorage,r=e.appkey,n=e.currentUserId,i=e.isDisableEmptyUGChannelId;t.removeItem("RC-con-s-ver-".concat(r,"-").concat(n));var o=Ze(r,n),s=Xe(r,n),a=ze(r,n),u=Je(r,n),l=We(r,n),d=Ke(r,n),_=Qe(r,n),f=t.getItem(o)||"0",p=t.getItem(s)||"0",h=t.getItem(a)||"1",g=t.getItem(l)||"0",E=JSON.parse(t.getItem(_)||"{}"),b=JSON.parse(t.getItem(u)||"{}"),T=JSON.parse(t.getItem(d)||"{}");return c(this,Ud,"m",Dd).call(this,b,T,E,i),{inboxTime:{value:parseInt(f,10)||0,key:o},outboxTime:{value:parseInt(p,10)||0,key:s},broadcastTime:{value:parseInt(h,10)||0,key:a},conversationStatus:{value:b,key:u,stringify:!0},ultraGroupStatus:{value:T,key:d,stringify:!0},conversationStatusVersion:{value:parseInt(g,10)||0,key:l},conversationTypeGlobalSettings:{value:E,key:_,stringify:!0}}}}),Object.defineProperty(r.prototype,"syncDataFromLocalStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(t){e.prototype.syncDataFromLocalStorage.call(this,t),this.models.clear(),c(this,Ud,"m",xd).call(this)}}),Object.defineProperty(r.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.get("conversationTypeGlobalSettings");t===exports.NotificationLevel.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)||exports.NotificationLevel.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===exports.ConversationType.ULTRA_GROUP?new Vd(e):new Gd(e);var o=(r===exports.ConversationType.PRIVATE||r===exports.ConversationType.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===n}));i.updateAttrs({includeRobot:o}),t&&this.models.set(Nd(e),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,o=e.toStoragItem(),s=Object.keys(o),a=0===s.length||1===s.length&&"h"===s[0],u=n===exports.ConversationType.ULTRA_GROUP?t:r;a?delete u[i]:u[i]=o})),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,r=e.version,n=e.state;if(!(null==n?void 0:n.length))return[];var i=this.get("conversationStatusVersion"),o=new Map,s=new Set;n.forEach((function(e){var n=e.channelId,a=e.busChannel,u=e.type,l=e.stateItem,c=e.time;i=Math.max(i,c);var d={};if(null==l||l.forEach((function(e){var t=e.tags,r=e.sessionStateType,n=e.value;switch(r){case is.IsSilent:d.notificationLevel=parseInt(n,10);break;case is.IsTop:d.isTop="1"===n;break;case is.Tags:d.tags=t;break;case is.AutoTrans:d.translateStrategy=parseInt(n,10)}})),n){var _={conversationType:u,targetId:n,channelId:a},f=t.getOrCreateModel(_,!0);s.add(f);var p=f.updateAttrs(d,r);if(p)if(o.has(f)){var h=o.get(f);Object.assign(h,p)}else o.set(f,p)}else void 0!==d.notificationLevel&&t.setConversationTypeNotificationLevel(u,d.notificationLevel)})),this.set("conversationStatusVersion",i),this.updateConversationStorage(Array.from(s));var a=Array.from(o.entries()).map((function(e){var t=u(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,o={conversationType:i,targetId:n,channelId:e.busChannel},s=r.getOrCreateModel(o,!0),a=function(e,t){var r,n,i,o=e.msg,s=e.isBot;return{latestMessage:o?_c(o,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:!!s}}(e,t);i===exports.ConversationType.ULTRA_GROUP?s.updateAttrs(a):s.updateAttrs({latestMessage:a.latestMessage,operationTime:a.operationTime,includeRobot:a.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:exports.ConversationType.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===exports.ConversationType.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!==exports.ConversationType.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=Nd(e),i=this.models.get(n);if(!i)return null;var o=(t===exports.ConversationType.PRIVATE||t===exports.ConversationType.SYSTEM)&&this._ctx.robots.some((function(e){return e.robotId===r}));return i.updateAttrs({includeRobot:o}),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,o=n.conversationType;e.includes(o)&&(n.notificationLevel>exports.NotificationLevel.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}(Cd);Ud=new WeakSet,Dd=function(e,t,r,n){Object.keys(e).forEach((function(t){var n=Pd(t);te(n.conversationType,W)?n.targetId||(r[n.conversationType]={nl:e[t].nl||exports.NotificationLevel.NOT_SET},delete e[t]):delete e[t]})),Object.keys(t).forEach((function(e){var i=Pd(e);if(i.conversationType===exports.ConversationType.ULTRA_GROUP)return i.targetId?void(n&&!i.channelId&&delete t[e]):(r[i.conversationType]={nl:t[e].nl||exports.NotificationLevel.NOT_SET},void delete t[e]);delete t[e]}))},xd=function(){var e=this,t=Object.entries(this.get("conversationStatus")),r=Object.entries(this.get("ultraGroupStatus"));l(l([],u(t),!1),u(r),!1).forEach((function(t){var r,n,i,o,s,a,l,c,d,_,f,p,h,g,E,b=u(t,2),T=b[0],v=b[1],R=Pd(T);te(R.conversationType,K)&&e.getOrCreateModel(R,!0).updateAttrs((n=(r=v).c,i=r.mc,o=r.mmc,s=r.hm,a=r.m,l=r.fut,c=r.fuid,d=r.fumt,_=r.nl,f=r.to,p=r.tg,h=r.rt,g=r.h,E=r.ts,{isTop:f,notificationLevel:_,tags:Ld(p),unreadCount:n,unreadMentionedCount:i,unreadMentionedMeCount:o,hasMentioned:s,mentionedInfo:a,firstUnreadTime:l,firstUnreadMessageUId:c,firstUnreadMessageType:d,lastReadTime:h,hidden:g,translateStrategy:E}),0)}))};function Fd(e){let t=e.length;for(;--t>=0;)e[t]=0}const Bd=256,Hd=286,qd=30,Yd=15,Wd=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]),Jd=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]),Kd=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Qd=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Xd=new Array(576);Fd(Xd);const Zd=new Array(60);Fd(Zd);const zd=new Array(512);Fd(zd);const $d=new Array(256);Fd($d);const e_=new Array(29);Fd(e_);const t_=new Array(qd);function r_(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 n_,i_,o_;function s_(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}Fd(t_);const a_=e=>e<256?zd[e]:zd[256+(e>>>7)],u_=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},l_=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,u_(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)},c_=(e,t,r)=>{l_(e,r[2*t],r[2*t+1])},d_=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},__=(e,t,r)=>{const n=new Array(16);let i,o,s=0;for(i=1;i<=Yd;i++)s=s+r[i-1]<<1,n[i]=s;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=d_(n[t]++,t))}},f_=e=>{let t;for(t=0;t<Hd;t++)e.dyn_ltree[2*t]=0;for(t=0;t<qd;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},p_=e=>{e.bi_valid>8?u_(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},h_=(e,t,r,n)=>{const i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]},g_=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&h_(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!h_(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},E_=(e,t,r)=>{let n,i,o,s,a=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+a++],n+=(255&e.pending_buf[e.sym_buf+a++])<<8,i=e.pending_buf[e.sym_buf+a++],0===n?c_(e,i,t):(o=$d[i],c_(e,o+Bd+1,t),s=Wd[o],0!==s&&(i-=e_[o],l_(e,i,s)),n--,o=a_(n),c_(e,o,r),s=Jd[o],0!==s&&(n-=t_[o],l_(e,n,s)))}while(a<e.sym_next);c_(e,256,t)},b_=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let s,a,u,l=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<o;s++)0!==r[2*s]?(e.heap[++e.heap_len]=l=s,e.depth[s]=0):r[2*s+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,s=e.heap_len>>1;s>=1;s--)g_(e,r,s);u=o;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],g_(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=a,r[2*u]=r[2*s]+r[2*a],e.depth[u]=(e.depth[s]>=e.depth[a]?e.depth[s]:e.depth[a])+1,r[2*s+1]=r[2*a+1]=u,e.heap[1]=u++,g_(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,o=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,d,_,f,p,h=0;for(_=0;_<=Yd;_++)e.bl_count[_]=0;for(r[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)c=e.heap[l],_=r[2*r[2*c+1]+1]+1,_>u&&(_=u,h++),r[2*c+1]=_,c>n||(e.bl_count[_]++,f=0,c>=a&&(f=s[c-a]),p=r[2*c],e.opt_len+=p*(_+f),o&&(e.static_len+=p*(i[2*c+1]+f)));if(0!==h){do{for(_=u-1;0===e.bl_count[_];)_--;e.bl_count[_]--,e.bl_count[_+1]+=2,e.bl_count[u]--,h-=2}while(h>0);for(_=u;0!==_;_--)for(c=e.bl_count[_];0!==c;)d=e.heap[--l],d>n||(r[2*d+1]!==_&&(e.opt_len+=(_-r[2*d+1])*r[2*d],r[2*d+1]=_),c--)}})(e,t),__(r,l,e.bl_count)},T_=(e,t,r)=>{let n,i,o=-1,s=t[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a<u&&i===s||(a<l?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=i,0===s?(u=138,l=3):i===s?(u=6,l=3):(u=7,l=4))},v_=(e,t,r)=>{let n,i,o=-1,s=t[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++a<u&&i===s)){if(a<l)do{c_(e,i,e.bl_tree)}while(0!=--a);else 0!==i?(i!==o&&(c_(e,i,e.bl_tree),a--),c_(e,16,e.bl_tree),l_(e,a-3,2)):a<=10?(c_(e,17,e.bl_tree),l_(e,a-3,3)):(c_(e,18,e.bl_tree),l_(e,a-11,7));a=0,o=i,0===s?(u=138,l=3):i===s?(u=6,l=3):(u=7,l=4)}};let R_=!1;const I_=(e,t,r,n)=>{l_(e,0+(n?1:0),3),p_(e),u_(e,r),u_(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};var m_=(e,t,r,n)=>{let i,o,s=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<Bd;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),b_(e,e.l_desc),b_(e,e.d_desc),s=(e=>{let t;for(T_(e,e.dyn_ltree,e.l_desc.max_code),T_(e,e.dyn_dtree,e.d_desc.max_code),b_(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Qd[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?I_(e,t,r,n):4===e.strategy||o===i?(l_(e,2+(n?1:0),3),E_(e,Xd,Zd)):(l_(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(l_(e,t-257,5),l_(e,r-1,5),l_(e,n-4,4),i=0;i<n;i++)l_(e,e.bl_tree[2*Qd[i]+1],3);v_(e,e.dyn_ltree,t-1),v_(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),E_(e,e.dyn_ltree,e.dyn_dtree)),f_(e),n&&p_(e)},y_={_tr_init:e=>{R_||((()=>{let e,t,r,n,i;const o=new Array(16);for(r=0,n=0;n<28;n++)for(e_[n]=r,e=0;e<1<<Wd[n];e++)$d[r++]=n;for($d[r-1]=n,i=0,n=0;n<16;n++)for(t_[n]=i,e=0;e<1<<Jd[n];e++)zd[i++]=n;for(i>>=7;n<qd;n++)for(t_[n]=i<<7,e=0;e<1<<Jd[n]-7;e++)zd[256+i++]=n;for(t=0;t<=Yd;t++)o[t]=0;for(e=0;e<=143;)Xd[2*e+1]=8,e++,o[8]++;for(;e<=255;)Xd[2*e+1]=9,e++,o[9]++;for(;e<=279;)Xd[2*e+1]=7,e++,o[7]++;for(;e<=287;)Xd[2*e+1]=8,e++,o[8]++;for(__(Xd,287,o),e=0;e<qd;e++)Zd[2*e+1]=5,Zd[2*e]=d_(e,5);n_=new r_(Xd,Wd,257,Hd,Yd),i_=new r_(Zd,Jd,0,qd,Yd),o_=new r_(new Array(0),Kd,0,19,7)})(),R_=!0),e.l_desc=new s_(e.dyn_ltree,n_),e.d_desc=new s_(e.dyn_dtree,i_),e.bl_desc=new s_(e.bl_tree,o_),e.bi_buf=0,e.bi_valid=0,f_(e)},_tr_stored_block:I_,_tr_flush_block:m_,_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*($d[r]+Bd+1)]++,e.dyn_dtree[2*a_(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{l_(e,2,3),c_(e,256,Xd),(e=>{16===e.bi_valid?(u_(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 A_=(e,t,r,n)=>{let i=65535&e,o=e>>>16&65535,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{i=i+t[n++]|0,o=o+i|0}while(--s);i%=65521,o%=65521}return i|o<<16};const S_=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 O_=(e,t,r,n)=>{const i=S_,o=n+r;e^=-1;for(let r=n;r<o;r++)e=e>>>8^i[255&(e^t[r])];return~e},C_={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"},N_={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:P_,_tr_stored_block:L_,_tr_flush_block:M_,_tr_tally:w_,_tr_align:U_}=y_,{Z_NO_FLUSH:D_,Z_PARTIAL_FLUSH:x_,Z_FULL_FLUSH:G_,Z_FINISH:V_,Z_BLOCK:j_,Z_OK:k_,Z_STREAM_END:F_,Z_STREAM_ERROR:B_,Z_DATA_ERROR:H_,Z_BUF_ERROR:q_,Z_DEFAULT_COMPRESSION:Y_,Z_FILTERED:W_,Z_HUFFMAN_ONLY:J_,Z_RLE:K_,Z_FIXED:Q_,Z_DEFAULT_STRATEGY:X_,Z_UNKNOWN:Z_,Z_DEFLATED:z_}=N_,$_=258,ef=262,tf=42,rf=113,nf=666,of=(e,t)=>(e.msg=C_[t],t),sf=e=>2*e-(e>4?9:0),af=e=>{let t=e.length;for(;--t>=0;)e[t]=0},uf=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 lf=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const cf=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))},df=(e,t)=>{M_(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,cf(e.strm)},_f=(e,t)=>{e.pending_buf[e.pending++]=t},ff=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},pf=(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=A_(e.adler,t,i,r):2===e.state.wrap&&(e.adler=O_(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},hf=(e,t)=>{let r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match;const u=e.strstart>e.w_size-ef?e.strstart-(e.w_size-ef):0,l=e.window,c=e.w_mask,d=e.prev,_=e.strstart+$_;let f=l[o+s-1],p=l[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(r=t,l[r+s]===p&&l[r+s-1]===f&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&o<_);if(n=$_-(_-o),o=_-$_,n>s){if(e.match_start=t,s=n,n>=a)break;f=l[o+s-1],p=l[o+s]}}}while((t=d[t&c])>u&&0!=--i);return s<=e.lookahead?s:e.lookahead},gf=e=>{const t=e.w_size;let r,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-ef)&&(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),uf(e),n+=t),0===e.strm.avail_in)break;if(r=pf(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=lf(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=lf(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<ef&&0!==e.strm.avail_in)},Ef=(e,t)=>{let r,n,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=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<o&&(0===r&&t!==V_||t===D_||r!==n+e.strm.avail_in))break;s=t===V_&&r===n+e.strm.avail_in?1:0,L_(e,0,0,s),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,cf(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&&(pf(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===s);return a-=e.strm.avail_in,a&&(a>=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<=a&&(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-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==D_&&t!==V_&&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&&(pf(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,o=i>e.w_size?e.w_size:i,n=e.strstart-e.block_start,(n>=o||(n||t===V_)&&t!==D_&&0===e.strm.avail_in&&n<=i)&&(r=n>i?i:n,s=t===V_&&0===e.strm.avail_in&&r===n?1:0,L_(e,e.block_start,r,s),e.block_start+=r,cf(e.strm)),s?3:1)},bf=(e,t)=>{let r,n;for(;;){if(e.lookahead<ef){if(gf(e),e.lookahead<ef&&t===D_)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=lf(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-ef&&(e.match_length=hf(e,r)),e.match_length>=3)if(n=w_(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=lf(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=lf(e,e.ins_h,e.window[e.strstart+1]);else n=w_(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(df(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===V_?(df(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(df(e,!1),0===e.strm.avail_out)?1:2},Tf=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<ef){if(gf(e),e.lookahead<ef&&t===D_)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=lf(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-ef&&(e.match_length=hf(e,r),e.match_length<=5&&(e.strategy===W_||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=w_(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=lf(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&&(df(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=w_(e,0,e.window[e.strstart-1]),n&&df(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=w_(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===V_?(df(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(df(e,!1),0===e.strm.avail_out)?1:2};function vf(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 Rf=[new vf(0,0,0,0,Ef),new vf(4,4,8,4,bf),new vf(4,5,16,8,bf),new vf(4,6,32,32,bf),new vf(4,4,16,16,Tf),new vf(8,16,32,32,Tf),new vf(8,16,128,128,Tf),new vf(8,32,128,256,Tf),new vf(32,128,258,1024,Tf),new vf(32,258,258,4096,Tf)];function If(){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=z_,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),af(this.dyn_ltree),af(this.dyn_dtree),af(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),af(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),af(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 mf=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==tf&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==rf&&t.status!==nf?1:0},yf=e=>{if(mf(e))return of(e,B_);e.total_in=e.total_out=0,e.data_type=Z_;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?tf:rf,e.adler=2===t.wrap?0:1,t.last_flush=-2,P_(t),k_},Af=e=>{const t=yf(e);var r;return t===k_&&((r=e.state).window_size=2*r.w_size,af(r.head),r.max_lazy_match=Rf[r.level].max_lazy,r.good_match=Rf[r.level].good_length,r.nice_match=Rf[r.level].nice_length,r.max_chain_length=Rf[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},Sf=(e,t,r,n,i,o)=>{if(!e)return B_;let s=1;if(t===Y_&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||r!==z_||n<8||n>15||t<0||t>9||o<0||o>Q_||8===n&&1!==s)return of(e,B_);8===n&&(n=9);const a=new If;return e.state=a,a.strm=e,a.status=tf,a.wrap=s,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=t,a.strategy=o,a.method=r,Af(e)};var Of={deflateInit:(e,t)=>Sf(e,t,z_,15,8,X_),deflateInit2:Sf,deflateReset:Af,deflateResetKeep:yf,deflateSetHeader:(e,t)=>mf(e)||2!==e.state.wrap?B_:(e.state.gzhead=t,k_),deflate:(e,t)=>{if(mf(e)||t>j_||t<0)return e?of(e,B_):B_;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===nf&&t!==V_)return of(e,0===e.avail_out?q_:B_);const n=r.last_flush;if(r.last_flush=t,0!==r.pending){if(cf(e),0===e.avail_out)return r.last_flush=-1,k_}else if(0===e.avail_in&&sf(t)<=sf(n)&&t!==V_)return of(e,q_);if(r.status===nf&&0!==e.avail_in)return of(e,q_);if(r.status===tf&&0===r.wrap&&(r.status=rf),r.status===tf){let t=z_+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=J_||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,ff(r,t),0!==r.strstart&&(ff(r,e.adler>>>16),ff(r,65535&e.adler)),e.adler=1,r.status=rf,cf(e),0!==r.pending)return r.last_flush=-1,k_}if(57===r.status)if(e.adler=0,_f(r,31),_f(r,139),_f(r,8),r.gzhead)_f(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)),_f(r,255&r.gzhead.time),_f(r,r.gzhead.time>>8&255),_f(r,r.gzhead.time>>16&255),_f(r,r.gzhead.time>>24&255),_f(r,9===r.level?2:r.strategy>=J_||r.level<2?4:0),_f(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(_f(r,255&r.gzhead.extra.length),_f(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=O_(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(_f(r,0),_f(r,0),_f(r,0),_f(r,0),_f(r,0),_f(r,9===r.level?2:r.strategy>=J_||r.level<2?4:0),_f(r,3),r.status=rf,cf(e),0!==r.pending)return r.last_flush=-1,k_;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=O_(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=i,cf(e),0!==r.pending)return r.last_flush=-1,k_;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=O_(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=O_(e.adler,r.pending_buf,r.pending-n,n)),cf(e),0!==r.pending)return r.last_flush=-1,k_;n=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,_f(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=O_(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=O_(e.adler,r.pending_buf,r.pending-n,n)),cf(e),0!==r.pending)return r.last_flush=-1,k_;n=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,_f(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=O_(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&&(cf(e),0!==r.pending))return r.last_flush=-1,k_;_f(r,255&e.adler),_f(r,e.adler>>8&255),e.adler=0}if(r.status=rf,cf(e),0!==r.pending)return r.last_flush=-1,k_}if(0!==e.avail_in||0!==r.lookahead||t!==D_&&r.status!==nf){let n=0===r.level?Ef(r,t):r.strategy===J_?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(gf(e),0===e.lookahead)){if(t===D_)return 1;break}if(e.match_length=0,r=w_(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(df(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===V_?(df(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(df(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===K_?((e,t)=>{let r,n,i,o;const s=e.window;for(;;){if(e.lookahead<=$_){if(gf(e),e.lookahead<=$_&&t===D_)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i])){o=e.strstart+$_;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);e.match_length=$_-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=w_(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=w_(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(df(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===V_?(df(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(df(e,!1),0===e.strm.avail_out)?1:2})(r,t):Rf[r.level].func(r,t);if(3!==n&&4!==n||(r.status=nf),1===n||3===n)return 0===e.avail_out&&(r.last_flush=-1),k_;if(2===n&&(t===x_?U_(r):t!==j_&&(L_(r,0,0,!1),t===G_&&(af(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),cf(e),0===e.avail_out))return r.last_flush=-1,k_}return t!==V_?k_:r.wrap<=0?F_:(2===r.wrap?(_f(r,255&e.adler),_f(r,e.adler>>8&255),_f(r,e.adler>>16&255),_f(r,e.adler>>24&255),_f(r,255&e.total_in),_f(r,e.total_in>>8&255),_f(r,e.total_in>>16&255),_f(r,e.total_in>>24&255)):(ff(r,e.adler>>>16),ff(r,65535&e.adler)),cf(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?k_:F_)},deflateEnd:e=>{if(mf(e))return B_;const t=e.state.status;return e.state=null,t===rf?of(e,H_):k_},deflateSetDictionary:(e,t)=>{let r=t.length;if(mf(e))return B_;const n=e.state,i=n.wrap;if(2===i||1===i&&n.status!==tf||n.lookahead)return B_;if(1===i&&(e.adler=A_(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(af(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 o=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,gf(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=lf(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,gf(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=s,e.input=a,e.avail_in=o,n.wrap=i,k_},deflateInfo:"pako deflate (from Nodeca project)"};const Cf=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Nf={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)Cf(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 Pf=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Pf=!1}const Lf=new Uint8Array(256);for(let e=0;e<256;e++)Lf[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Lf[254]=Lf[254]=1;var Mf={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,o,s=e.length,a=0;for(i=0;i<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(a),o=0,i=0;o<a;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<s&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=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 o=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){o[i++]=t;continue}let s=Lf[t];if(s>4)o[i++]=65533,n+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&n<r;)t=t<<6|63&e[n++],s--;s>1?o[i++]=65533:t<65536?o[i++]=t:(t-=65536,o[i++]=55296|t>>10&1023,o[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Pf)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})(o,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+Lf[e[r]]>t?r:t}};var wf=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 Uf=Object.prototype.toString,{Z_NO_FLUSH:Df,Z_SYNC_FLUSH:xf,Z_FULL_FLUSH:Gf,Z_FINISH:Vf,Z_OK:jf,Z_STREAM_END:kf,Z_DEFAULT_COMPRESSION:Ff,Z_DEFAULT_STRATEGY:Bf,Z_DEFLATED:Hf}=N_;function qf(e){this.options=Nf.assign({level:Ff,method:Hf,chunkSize:16384,windowBits:15,memLevel:8,strategy:Bf},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 wf,this.strm.avail_out=0;let r=Of.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==jf)throw new Error(C_[r]);if(t.header&&Of.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Mf.string2buf(t.dictionary):"[object ArrayBuffer]"===Uf.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=Of.deflateSetDictionary(this.strm,e),r!==jf)throw new Error(C_[r]);this._dict_set=!0}}qf.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Vf:Df,"string"==typeof e?r.input=Mf.string2buf(e):"[object ArrayBuffer]"===Uf.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),(o===xf||o===Gf)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Of.deflate(r,o),i===kf)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Of.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===jf;if(0!==r.avail_out){if(o>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},qf.prototype.onData=function(e){this.chunks.push(e)},qf.prototype.onEnd=function(e){e===jf&&(this.result=Nf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Yf=16209;var Wf=function(e,t){let r,n,i,o,s,a,u,l,c,d,_,f,p,h,g,E,b,T,v,R,I,m,y,A;const S=e.state;r=e.next_in,y=e.input,n=r+(e.avail_in-5),i=e.next_out,A=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),a=S.dmax,u=S.wsize,l=S.whave,c=S.wnext,d=S.window,_=S.hold,f=S.bits,p=S.lencode,h=S.distcode,g=(1<<S.lenbits)-1,E=(1<<S.distbits)-1;e:do{f<15&&(_+=y[r++]<<f,f+=8,_+=y[r++]<<f,f+=8),b=p[_&g];t:for(;;){if(T=b>>>24,_>>>=T,f-=T,T=b>>>16&255,0===T)A[i++]=65535&b;else{if(!(16&T)){if(64&T){if(32&T){S.mode=16191;break e}e.msg="invalid literal/length code",S.mode=Yf;break e}b=p[(65535&b)+(_&(1<<T)-1)];continue t}for(v=65535&b,T&=15,T&&(f<T&&(_+=y[r++]<<f,f+=8),v+=_&(1<<T)-1,_>>>=T,f-=T),f<15&&(_+=y[r++]<<f,f+=8,_+=y[r++]<<f,f+=8),b=h[_&E];;){if(T=b>>>24,_>>>=T,f-=T,T=b>>>16&255,16&T){if(R=65535&b,T&=15,f<T&&(_+=y[r++]<<f,f+=8,f<T&&(_+=y[r++]<<f,f+=8)),R+=_&(1<<T)-1,R>a){e.msg="invalid distance too far back",S.mode=Yf;break e}if(_>>>=T,f-=T,T=i-o,R>T){if(T=R-T,T>l&&S.sane){e.msg="invalid distance too far back",S.mode=Yf;break e}if(I=0,m=d,0===c){if(I+=u-T,T<v){v-=T;do{A[i++]=d[I++]}while(--T);I=i-R,m=A}}else if(c<T){if(I+=u+c-T,T-=c,T<v){v-=T;do{A[i++]=d[I++]}while(--T);if(I=0,c<v){T=c,v-=T;do{A[i++]=d[I++]}while(--T);I=i-R,m=A}}}else if(I+=c-T,T<v){v-=T;do{A[i++]=d[I++]}while(--T);I=i-R,m=A}for(;v>2;)A[i++]=m[I++],A[i++]=m[I++],A[i++]=m[I++],v-=3;v&&(A[i++]=m[I++],v>1&&(A[i++]=m[I++]))}else{I=i-R;do{A[i++]=A[I++],A[i++]=A[I++],A[i++]=A[I++],v-=3}while(v>2);v&&(A[i++]=A[I++],v>1&&(A[i++]=A[I++]))}break}if(64&T){e.msg="invalid distance code",S.mode=Yf;break e}b=h[(65535&b)+(_&(1<<T)-1)]}}break}}while(r<n&&i<s);v=f>>3,r-=v,f-=v<<3,_&=(1<<f)-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<s?s-i+257:257-(i-s),S.hold=_,S.bits=f};const Jf=15,Kf=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]),Qf=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]),Xf=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]),Zf=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 zf=(e,t,r,n,i,o,s,a)=>{const u=a.bits;let l,c,d,_,f,p,h=0,g=0,E=0,b=0,T=0,v=0,R=0,I=0,m=0,y=0,A=null;const S=new Uint16Array(16),O=new Uint16Array(16);let C,N,P,L=null;for(h=0;h<=Jf;h++)S[h]=0;for(g=0;g<n;g++)S[t[r+g]]++;for(T=u,b=Jf;b>=1&&0===S[b];b--);if(T>b&&(T=b),0===b)return i[o++]=20971520,i[o++]=20971520,a.bits=1,0;for(E=1;E<b&&0===S[E];E++);for(T<E&&(T=E),I=1,h=1;h<=Jf;h++)if(I<<=1,I-=S[h],I<0)return-1;if(I>0&&(0===e||1!==b))return-1;for(O[1]=0,h=1;h<Jf;h++)O[h+1]=O[h]+S[h];for(g=0;g<n;g++)0!==t[r+g]&&(s[O[t[r+g]]++]=g);if(0===e?(A=L=s,p=20):1===e?(A=Kf,L=Qf,p=257):(A=Xf,L=Zf,p=0),y=0,g=0,h=E,f=o,v=T,R=0,d=-1,m=1<<T,_=m-1,1===e&&m>852||2===e&&m>592)return 1;for(;;){C=h-R,s[g]+1<p?(N=0,P=s[g]):s[g]>=p?(N=L[s[g]-p],P=A[s[g]-p]):(N=96,P=0),l=1<<h-R,c=1<<v,E=c;do{c-=l,i[f+(y>>R)+c]=C<<24|N<<16|P}while(0!==c);for(l=1<<h-1;y&l;)l>>=1;if(0!==l?(y&=l-1,y+=l):y=0,g++,0==--S[h]){if(h===b)break;h=t[r+s[g]]}if(h>T&&(y&_)!==d){for(0===R&&(R=T),f+=E,v=h-R,I=1<<v;v+R<b&&(I-=S[v+R],!(I<=0));)v++,I<<=1;if(m+=1<<v,1===e&&m>852||2===e&&m>592)return 1;d=y&_,i[d]=T<<24|v<<16|f-o}}return 0!==y&&(i[f+y]=h-R<<24|64<<16),a.bits=T,0};const{Z_FINISH:$f,Z_BLOCK:ep,Z_TREES:tp,Z_OK:rp,Z_STREAM_END:np,Z_NEED_DICT:ip,Z_STREAM_ERROR:op,Z_DATA_ERROR:sp,Z_MEM_ERROR:ap,Z_BUF_ERROR:up,Z_DEFLATED:lp}=N_,cp=16180,dp=16190,_p=16191,fp=16192,pp=16194,hp=16199,gp=16200,Ep=16206,bp=16209,Tp=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function vp(){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 Rp=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<cp||t.mode>16211?1:0},Ip=e=>{if(Rp(e))return op;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=cp,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,rp},mp=e=>{if(Rp(e))return op;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Ip(e)},yp=(e,t)=>{let r;if(Rp(e))return op;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?op:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,mp(e))},Ap=(e,t)=>{if(!e)return op;const r=new vp;e.state=r,r.strm=e,r.window=null,r.mode=cp;const n=yp(e,t);return n!==rp&&(e.state=null),n};let Sp,Op,Cp=!0;const Np=e=>{if(Cp){Sp=new Int32Array(512),Op=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(zf(1,e.lens,0,288,Sp,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;zf(2,e.lens,0,32,Op,0,e.work,{bits:5}),Cp=!1}e.lencode=Sp,e.lenbits=9,e.distcode=Op,e.distbits=5},Pp=(e,t,r,n)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(t.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(t.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(t.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var Lp={inflateReset:mp,inflateReset2:yp,inflateResetKeep:Ip,inflateInit:e=>Ap(e,15),inflateInit2:Ap,inflate:(e,t)=>{let r,n,i,o,s,a,u,l,c,d,_,f,p,h,g,E,b,T,v,R,I,m,y=0;const A=new Uint8Array(4);let S,O;const C=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Rp(e)||!e.output||!e.input&&0!==e.avail_in)return op;r=e.state,r.mode===_p&&(r.mode=fp),s=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,l=r.hold,c=r.bits,d=a,_=u,m=rp;e:for(;;)switch(r.mode){case cp:if(0===r.wrap){r.mode=fp;break}for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<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=O_(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=bp;break}if((15&l)!==lp){e.msg="unknown compression method",r.mode=bp;break}if(l>>>=4,c-=4,I=8+(15&l),0===r.wbits&&(r.wbits=I),I>15||I>r.wbits){e.msg="invalid window size",r.mode=bp;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&l?16189:_p,l=0,c=0;break;case 16181:for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(r.flags=l,(255&r.flags)!==lp){e.msg="unknown compression method",r.mode=bp;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=bp;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=O_(r.check,A,2,0)),l=0,c=0,r.mode=16182;case 16182:for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<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=O_(r.check,A,4,0)),l=0,c=0,r.mode=16183;case 16183:for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<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=O_(r.check,A,2,0)),l=0,c=0,r.mode=16184;case 16184:if(1024&r.flags){for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<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=O_(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&&(f=r.length,f>a&&(f=a),f&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+f),I)),512&r.flags&&4&r.wrap&&(r.check=O_(r.check,n,f,o)),a-=f,o+=f,r.length-=f),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===a)break e;f=0;do{I=n[o+f++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I))}while(I&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=O_(r.check,n,f,o)),a-=f,o+=f,I)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===a)break e;f=0;do{I=n[o+f++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I))}while(I&&f<a);if(512&r.flags&&4&r.wrap&&(r.check=O_(r.check,n,f,o)),a-=f,o+=f,I)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;c<16;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(65535&r.check)){e.msg="header crc mismatch",r.mode=bp;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=_p;break;case 16189:for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}e.adler=r.check=Tp(l),l=0,c=0,r.mode=dp;case dp:if(0===r.havedict)return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,ip;e.adler=r.check=1,r.mode=_p;case _p:if(t===ep||t===tp)break e;case fp:if(r.last){l>>>=7&c,c-=7&c,r.mode=Ep;break}for(;c<3;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}switch(r.last=1&l,l>>>=1,c-=1,3&l){case 0:r.mode=16193;break;case 1:if(Np(r),r.mode=hp,t===tp){l>>>=2,c-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=bp}l>>>=2,c-=2;break;case 16193:for(l>>>=7&c,c-=7&c;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=bp;break}if(r.length=65535&l,l=0,c=0,r.mode=pp,t===tp)break e;case pp:r.mode=16195;case 16195:if(f=r.length,f){if(f>a&&(f=a),f>u&&(f=u),0===f)break e;i.set(n.subarray(o,o+f),s),a-=f,o+=f,u-=f,s+=f,r.length-=f;break}r.mode=_p;break;case 16196:for(;c<14;){if(0===a)break e;a--,l+=n[o++]<<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=bp;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;c<3;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}r.lens[C[r.have++]]=7&l,l>>>=3,c-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},m=zf(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,m){e.msg="invalid code lengths set",r.mode=bp;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],g=y>>>24,E=y>>>16&255,b=65535&y,!(g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(b<16)l>>>=g,c-=g,r.lens[r.have++]=b;else{if(16===b){for(O=g+2;c<O;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(l>>>=g,c-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=bp;break}I=r.lens[r.have-1],f=3+(3&l),l>>>=2,c-=2}else if(17===b){for(O=g+3;c<O;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=g,c-=g,I=0,f=3+(7&l),l>>>=3,c-=3}else{for(O=g+7;c<O;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=g,c-=g,I=0,f=11+(127&l),l>>>=7,c-=7}if(r.have+f>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=bp;break}for(;f--;)r.lens[r.have++]=I}}if(r.mode===bp)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=bp;break}if(r.lenbits=9,S={bits:r.lenbits},m=zf(1,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,m){e.msg="invalid literal/lengths set",r.mode=bp;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},m=zf(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,m){e.msg="invalid distances set",r.mode=bp;break}if(r.mode=hp,t===tp)break e;case hp:r.mode=gp;case gp:if(a>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,Wf(e,_),s=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,l=r.hold,c=r.bits,r.mode===_p&&(r.back=-1);break}for(r.back=0;y=r.lencode[l&(1<<r.lenbits)-1],g=y>>>24,E=y>>>16&255,b=65535&y,!(g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(E&&!(240&E)){for(T=g,v=E,R=b;y=r.lencode[R+((l&(1<<T+v)-1)>>T)],g=y>>>24,E=y>>>16&255,b=65535&y,!(T+g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=T,c-=T,r.back+=T}if(l>>>=g,c-=g,r.back+=g,r.length=b,0===E){r.mode=16205;break}if(32&E){r.back=-1,r.mode=_p;break}if(64&E){e.msg="invalid literal/length code",r.mode=bp;break}r.extra=15&E,r.mode=16201;case 16201:if(r.extra){for(O=r.extra;c<O;){if(0===a)break e;a--,l+=n[o++]<<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],g=y>>>24,E=y>>>16&255,b=65535&y,!(g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(!(240&E)){for(T=g,v=E,R=b;y=r.distcode[R+((l&(1<<T+v)-1)>>T)],g=y>>>24,E=y>>>16&255,b=65535&y,!(T+g<=c);){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}l>>>=T,c-=T,r.back+=T}if(l>>>=g,c-=g,r.back+=g,64&E){e.msg="invalid distance code",r.mode=bp;break}r.offset=b,r.extra=15&E,r.mode=16203;case 16203:if(r.extra){for(O=r.extra;c<O;){if(0===a)break e;a--,l+=n[o++]<<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=bp;break}r.mode=16204;case 16204:if(0===u)break e;if(f=_-u,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=bp;break}f>r.wnext?(f-=r.wnext,p=r.wsize-f):p=r.wnext-f,f>r.length&&(f=r.length),h=r.window}else h=i,p=s-r.offset,f=r.length;f>u&&(f=u),u-=f,r.length-=f;do{i[s++]=h[p++]}while(--f);0===r.length&&(r.mode=gp);break;case 16205:if(0===u)break e;i[s++]=r.length,u--,r.mode=gp;break;case Ep:if(r.wrap){for(;c<32;){if(0===a)break e;a--,l|=n[o++]<<c,c+=8}if(_-=u,e.total_out+=_,r.total+=_,4&r.wrap&&_&&(e.adler=r.check=r.flags?O_(r.check,i,_,s-_):A_(r.check,i,_,s-_)),_=u,4&r.wrap&&(r.flags?l:Tp(l))!==r.check){e.msg="incorrect data check",r.mode=bp;break}l=0,c=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;c<32;){if(0===a)break e;a--,l+=n[o++]<<c,c+=8}if(4&r.wrap&&l!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=bp;break}l=0,c=0}r.mode=16208;case 16208:m=np;break e;case bp:m=sp;break e;case 16210:return ap;default:return op}return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=a,r.hold=l,r.bits=c,(r.wsize||_!==e.avail_out&&r.mode<bp&&(r.mode<Ep||t!==$f))&&Pp(e,e.output,e.next_out,_-e.avail_out),d-=e.avail_in,_-=e.avail_out,e.total_in+=d,e.total_out+=_,r.total+=_,4&r.wrap&&_&&(e.adler=r.check=r.flags?O_(r.check,i,_,e.next_out-_):A_(r.check,i,_,e.next_out-_)),e.data_type=r.bits+(r.last?64:0)+(r.mode===_p?128:0)+(r.mode===hp||r.mode===pp?256:0),(0===d&&0===_||t===$f)&&m===rp&&(m=up),m},inflateEnd:e=>{if(Rp(e))return op;let t=e.state;return t.window&&(t.window=null),e.state=null,rp},inflateGetHeader:(e,t)=>{if(Rp(e))return op;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,rp):op},inflateSetDictionary:(e,t)=>{const r=t.length;let n,i,o;return Rp(e)?op:(n=e.state,0!==n.wrap&&n.mode!==dp?op:n.mode===dp&&(i=1,i=A_(i,t,r,0),i!==n.check)?sp:(o=Pp(e,t,r,r),o?(n.mode=16210,ap):(n.havedict=1,rp)))},inflateInfo:"pako inflate (from Nodeca project)"};var Mp=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 wp=Object.prototype.toString,{Z_NO_FLUSH:Up,Z_FINISH:Dp,Z_OK:xp,Z_STREAM_END:Gp,Z_NEED_DICT:Vp,Z_STREAM_ERROR:jp,Z_DATA_ERROR:kp,Z_MEM_ERROR:Fp}=N_;function Bp(e){this.options=Nf.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 wf,this.strm.avail_out=0;let r=Lp.inflateInit2(this.strm,t.windowBits);if(r!==xp)throw new Error(C_[r]);if(this.header=new Mp,Lp.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Mf.string2buf(t.dictionary):"[object ArrayBuffer]"===wp.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Lp.inflateSetDictionary(this.strm,t.dictionary),r!==xp)))throw new Error(C_[r])}function Hp(e,t){const r=new Bp(t);if(r.push(e),r.err)throw r.msg||C_[r.err];return r.result}Bp.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,s,a;if(this.ended)return!1;for(s=t===~~t?t:!0===t?Dp:Up,"[object ArrayBuffer]"===wp.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),o=Lp.inflate(r,s),o===Vp&&i&&(o=Lp.inflateSetDictionary(r,i),o===xp?o=Lp.inflate(r,s):o===kp&&(o=Vp));r.avail_in>0&&o===Gp&&r.state.wrap>0&&0!==e[r.next_in];)Lp.inflateReset(r),o=Lp.inflate(r,s);switch(o){case jp:case kp:case Vp:case Fp:return this.onEnd(o),this.ended=!0,!1}if(a=r.avail_out,r.next_out&&(0===r.avail_out||o===Gp))if("string"===this.options.to){let e=Mf.utf8border(r.output,r.next_out),t=r.next_out-e,i=Mf.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(o!==xp||0!==a){if(o===Gp)return o=Lp.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Bp.prototype.onData=function(e){this.chunks.push(e)},Bp.prototype.onEnd=function(e){e===xp&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Nf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var qp={Inflate:Bp,inflate:Hp,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Hp(e,t)},ungzip:Hp,constants:N_};const{Inflate:Yp,inflate:Wp,inflateRaw:Jp,ungzip:Kp}=qp;var Qp=Kp;function Xp(e){return Object.keys(e).map((function(t){var r=e[t];return"string"!=typeof r&&(r="".concat(r)),{key:t,value:r}}))}function Zp(e,t,r,n){return gl.encode($a,{targetId:e,type:exports.ConversationType.GROUP,users:n,extProfile:r?Xp(r):void 0,settingProfile:Xp(t)})}var zp,$p,eh,th,rh,nh,ih,oh,sh,ah=function(e,t){return gl.encode(Ds,{type:e.conversationType,msgTime:t,channelId:e.targetId,busChannel:e.channelId||""})},uh=function(e){var t=gl.decode(ys,e),r=t.compressioEnabled,n=t.compressedData,i=t.info,o=t.pullTime,s=t.isFinished,a=t.pageToken;if(r){var u=Qp(n);return uh(u)}return{info:i,pullTime:o,isFinished:s,pageToken:a}},lh=function(e){var t=gl.decode(ds,e);if(t.compressioEnabled){var r=Qp(t.compressedData);return lh(r)}return t},ch=function(e){var t=gl.decode(_s,e);if(t.compressioEnabled){var r=Qp(t.compressedData);return ch(r)}return{syncTime:t.syncTime,list:t.list.map((function(e){return gl.decode(fs,new Uint8Array(e))}))}},dh=function(e){return gl.encode(ua,n(n({},e),{compress:dd.enable()}))},_h=function(e){var t=gl.decode(ca,e);if(t.compress){var r=Qp(t.compressData);return _h(r)}return t},fh=function(e){var t=gl.decode(da,e);if(t.compress){var r=Qp(t.compressData);return fh(r)}return t},ph=function(e){var t=e.listType,r=e.result,i=e.page,o=new Uint8Array(r),s=[];switch(t){case 1:s=gl.decode(su,o).list;break;case 2:s=gl.decode(ou,o).list;break;case 3:s=gl.decode(au,o).list;break;case 11:s=gl.decode(Tu,o).list;break;case 12:s=gl.decode(vu,o).list}return n(n({},i),{list:s})},hh=function(e){return gl.encode(Ls,n(n({},e),{compressioEnabled:dd.enable(),ignoreCmd:!0}))},gh=function(e){var t=gl.decode(Ms,e);if(t.compressioEnabled){var r=Qp(t.compressedData);return gh(r)}return t},Eh=function(e,t){return gl.encode($s,{ignoreVersion:!0,version:e,state:t})},bh=function(e){var t=gl.decode(Uu,e);if(t.compress){var r=Qp(t.compressedData);return bh(r)}return t},Th=function(e){return gl.encode(Ws,{timestamp:e,compressioEnabled:dd.enable()})},vh=function(e){var t=gl.decode(qs,e);if(t.compressioEnabled){var r=Qp(t.compressedData);return vh(r)}return t},Rh=function(e,t){var r,n,i,o,s=e.targetId,l=e.conversationType,c=e.channelId,d=t.messageType,_=t.isMentioned,f=t.disableNotification,p=t.canIncludeExpansion,h=t.pushConfig,g=t.directionalUserIdList,E=t.isVoipPush,b=t.isFilerWhiteBlacklist,T=t.content,v=t.pushContent,R=t.pushData,I=t.expansion,m=t.messageId,y=t.needReceipt,A=t.disableUpdateLastMessage,S=t.isStatusMessage,O=dn(d).isPersited,C=fc(d,_,f,p,S),N=function(e,t,r,n){var i=0;return e&&(i|=1),t&&(i|=2),r&&(i|=4),n&&(i|=8),i}(!!E,!b,!!(null==h?void 0:h.disablePushTitle),!!(null==h?void 0:h.forceShowDetailContent));if(T.user&&T.user.portraitUri&&(T.user.portrait=T.user.portraitUri),p&&I){i={};try{for(var P=a(Object.entries(I)),L=P.next();!L.done;L=P.next()){var M=u(L.value,2),w=M[0],U=M[1];i[w]={v:U}}}catch(e){r={error:e}}finally{try{L&&!L.done&&(n=P.return)&&n.call(P)}finally{if(r)throw r.error}}}if(h){var D=h.pushTitle,x=h.iOSConfig,G=h.androidConfig,V=h.templateId,j=h.harmonyOSConfig;o={title:D,pushConfigs:Yt(x,G,j),pushId:null==G?void 0:G.notificationId,templateId:V}}var k=l===exports.ConversationType.SYSTEM?s:void 0,F=0;return O&&A&&(F|=1),y&&(F|=2),gl.encode(cs,{sessionId:C,pushText:(null==h?void 0:h.pushContent)||v,appData:(null==h?void 0:h.pushData)||R,toUserIds:g,configFlag:N,classname:d,content:JSON.stringify(T),extraContent:i?JSON.stringify(i):void 0,pushExt:o,clientUniqueId:m,busChannel:c,systemId:k,optionBits:F})},Ih=function(e){return gl.encode(nu,n(n({},e),{type:exports.ConversationType.GROUP}))},mh=function(e){return gl.encode(uu,n(n({},e),{type:exports.ConversationType.GROUP}))},yh=function(e){return gl.encode(ru,n(n({},e),{type:exports.ConversationType.GROUP}))},Ah=function(e){function r(t,r){var n=e.call(this,"WebSGModule")||this;return zp.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("sNtf",c(n,zp,"m",th),n),n._ctx.on("sMsg",c(n,zp,"m",eh),n),n._ctx.on("syncMsg",c(n,zp,"m",$p),n),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,c,d,_,f,p,h,g,E,b,T,v;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx,r=t.logger,n=t.currentUserId,i=t.connectedTime,o=this._storage.get("inboxTime"),a=this._storage.get("outboxTime"),u=this._storage.get("broadcastTime"),l=r.createTraceId(),r.info(B.L_PULL_MSG_T,JSON.stringify({inboxTime:o,outboxTime:a,broadcastTime:u}),l),c=gl.encode(ls,{ispolling:!1,isPullSend:!0,syncTime:o,sendBoxSyncTime:a,broadcastSyncTime:u,compressioEnabled:dd.enable()}),[4,this._ctx.query(On.pullMsg,this._ctx.currentUserId,c)];case 1:return(d=s.sent()).isOk?(_=lh(d.data.pbData),p=(f=_).list,h=f.finished,g=f.syncTime,E=f.broadcastSyncTime,b=a,T=p.map((function(e){var t=_c(e,n,e.dataTime<i);return t.messageDirection===exports.MessageDirection.SEND&&(b=Math.max(b,t.sentTime)),t})),this._storage.set("inboxTime",g),this._storage.set("broadcastTime",E||1),this._storage.set("outboxTime",b),r.info(B.L_PULL_MSG_R,JSON.stringify({code:0,inboxTime:g,broadcastTime:E,outboxTime:b,msgCount:T.length,hasNext:!!h}),l),v=Math.max(g,E||1,b),this._ctx.emit("messagesFromSG",T,!!h,e),[2,ur({version:v,hasNext:!h})]):(r.warn(B.L_PULL_MSG_R,JSON.stringify({code:d.code}),l),[2,d.wipe()])}}))}))}}),r}(or);zp=new WeakSet,$p=function(e,t,r){var n=t.conversationType,i=t.sentTime;n!==exports.ConversationType.ULTRA_GROUP&&n!==exports.ConversationType.CHATROOM&&(n===exports.ConversationType.RTC_ROOM||Vc(r)||(e.stopPropagation(),this.push(i)))},eh=function(e,t){var r=t.conversationType,n=t.sentTime,i=t.isStatusMessage;r!==exports.ConversationType.CHATROOM&&(e.stopPropagation(),i||r===exports.ConversationType.RTC_ROOM?this._ctx.emit("smsgFromSignalGroup",t):this.push(n))},th=function(e,t){1===t.type&&(e.stopPropagation(),this.push(t.time))};var Sh,Oh,Ch=function(e){function r(t){var r=e.call(this,"WebUGModule")||this;return rh.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),r._ctx.on("syncMsg",c(r,rh,"m",ih),r),r._ctx.on("sCmd",c(r,rh,"m",nh),r),r}return t(r,e),Object.defineProperty(r.prototype,"markOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,rh,"m",sh).call(this,0)];case 1:return(e=s.sent()).isOk?(this._ctx.logger.info(B.L_NOTIFY_ULTRA_ONLINE_S,"success"),t=e.data.syncTime,[4,c(this,rh,"m",oh).call(this,0,[])]):(this._ctx.logger.warn(B.L_NOTIFY_ULTRA_ONLINE_S,"fail to pull ug msg, code: ".concat(e.code)),[2,e.wipe()]);case 2:return(r=s.sent()).isOk?(n=r.data,i=n.length>0?n[n.length-1].versionTime:0,o=Math.max(t,i),[2,ur({relations:n,msgVersion:o})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){switch(r.label){case 0:return[4,c(this,rh,"m",sh).call(this,e)];case 1:return[2,r.sent().trans((function(e){var r=e,n=r.syncTime,i=r.finished,o=r.list;if(null==o?void 0:o.length){var s=t._ctx.currentUserId,a=o.map((function(e){return _c(e,s,!1)}));t._ctx.emit("messagesFromUG",a,n)}return{version:n,hasNext:!i}}))]}}))}))}}),r}(or);rh=new WeakSet,nh=function(e,t){if(6===t.type)this.push(t.time),e.stopPropagation()},ih=function(e,t){t.conversationType===exports.ConversationType.ULTRA_GROUP&&(this.push(t.sentTime),e.stopPropagation())},oh=function e(t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,d,_,f,p,h;return s(this,(function(s){switch(s.label){case 0:return(n=this._ctx).currentUserId,i=n.logger,o=i.createTraceId(),i.info(B.L_PULL_UG_RELATIONS_T,JSON.stringify({ver:t}),o),a=gl.encode(Ea,{syncTime:t,isEraseMsgContent:!1}),[4,this._ctx.query(On.pullUgSes,this._ctx.currentUserId,a,void 0)];case 1:return d=s.sent(),i.summary(B.L_PULL_UG_RELATIONS_R,d,o,{ver:t}),d.isOk?(_=uh(d.data.pbData),f=_.info,p=_.isFinished,r.push.apply(r,l([],u(f),!1)),p?[2,ur(r)]:(h=f[f.length-1].versionTime,[2,c(this,rh,"m",e).call(this,h,r)])):[2,d.wipe()]}}))}))},sh=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=n.createTraceId(),n.info(B.L_PULL_ULTRA_MSG_T,JSON.stringify({version:e}),i),l=e,o=gl.encode(ba,{syncTime:l,compressioEnabled:dd.enable()}),[4,this._ctx.query(On.pullUgMsg,r,o)];case 1:return a=s.sent(),n.summary(B.L_PULL_ULTRA_MSG_R,a,i,{version:e}),a.isOk?(u=a.data,[2,ur(lh(u.pbData))]):[2,a.wipe()]}var l}))}))};var Nh,Ph,Lh,Mh=13,wh=36,Uh=41,Dh=function(e){function r(t,r){var n=e.call(this,"WebServerEventHandler")||this;return Sh.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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,l,d=this;return s(this,(function(s){switch(s.label){case 0:return t=this._logger.createTraceId(),this._logger.info(B.L_PULL_EVENT_CHANGE_T,JSON.stringify({version:e}),t),[4,c(this,Sh,"m",Oh).call(this,e)];case 1:return r=s.sent(),this._logger.summary(B.L_PULL_EVENT_CHANGE_R,r,t,{version:e}),r.isOk?(n=r.data,i=n.list,o=n.syncTime,a=n.hasNext,i.length&&(l=new Map,i.forEach((function(e){var t=e.changeType;l.has(t)?l.get(t).push(e):l.set(t,[e])})),Array.from(l.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1];d.emit("serverEvent",r,n)}))),[2,ur({version:o,hasNext:a})]):[2,r.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"noticeOnline",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return e=this._logger.createTraceId(),this._logger.info(B.L_SERVER_EVENT_NOTIFY_ONLINE_T,JSON.stringify({version:0}),e),[4,c(this,Sh,"m",Oh).call(this,0)];case 1:return t=r.sent(),this._logger.summary(B.L_SERVER_EVENT_NOTIFY_ONLINE_R,t,e,{version:0}),[2,t]}}))}))}}),r}(or);Sh=new WeakSet,Oh=function(e){var t=gl.encode(Ra,{syncTime:e});return this._con.query(On.pullEventChange,this._con.getCurrentUserId(),t,Ia)};var xh=function(e){function r(t){var r=e.call(this,"WebUGServerEventHandler")||this;return Nh.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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return t=gl.encode(Ra,{syncTime:e}),[4,this._ctx.query(On.qryMsgChange,this._ctx.currentUserId,t,ma)];case 1:return(r=s.sent()).isOk?(n=r.data,i=n.list,o=n.syncTime,a=n.hasNext,i&&i.length&&c(this,Nh,"m",Ph).call(this,i),[2,ur({version:o,hasNext:a})]):[2,r.wipe()]}}))}))}}),r}(or);Nh=new WeakSet,Ph=function(e){var t=[],r=[],n=[],i=[],o=[];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:o.push(e)}})),r.length&&c(this,Nh,"m",Lh).call(this,r,1),t.length&&c(this,Nh,"m",Lh).call(this,t,2),n.length&&this.emit("ugMsgRecalled",e),i.length&&this._ctx.emit("ugChannelChanged",i),o.length&&this._ctx.emit("ugUserGroupChanged",o)},Lh=function(e,t){var r=this,n=new Map;e.forEach((function(e){var t=e.targetId,r=e.busChannel,i=e.msgUID,o="".concat(t,"-").concat(r),s=n.get(o);s?s.messageUIds.push(i):n.set(o,{conversationIdentifier:{conversationType:exports.ConversationType.ULTRA_GROUP,targetId:t,channelId:r},messageUIds:[i]})})),Array.from(n.entries()).forEach((function(e){var n=u(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 Gh,Vh,jh,kh,Fh,Bh,Hh,qh,Yh,Wh,Jh,Kh,Qh,Xh,Zh,zh,$h,eg,tg,rg,ng,ig,og,sg,ag,ug,lg,cg,dg,_g,fg,pg,hg,gg,Eg,bg,Tg,vg=function(){return o(void 0,void 0,void 0,(function(){return s(this,(function(e){return[2,exports.ErrorCode.NOT_SUPPORT]}))}))},Rg=function(){return o(void 0,void 0,void 0,(function(){return s(this,(function(e){return[2,lr(exports.ErrorCode.NOT_SUPPORT,"Not support")]}))}))},Ig=function(e){function r(t,r){var n=e.call(this,"WebSGMsgModifyReceiver")||this;return Gh.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}),Vh.set(n,0),jh.set(n,!0),n._ctx.on("onConnected",c(n,Gh,"m",kh),n),n._ctx.on("messagesFromSG",c(n,Gh,"m",Fh),n),n}return t(r,e),Object.defineProperty(r.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.setInitVersion(c(this,Vh,"f"),!0)}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger.createTraceId(),this._ctx.logger.info(B.L_PULL_MODIFY_MSG_T,JSON.stringify({time:e}),t),_={pullVersion:e},r=gl.encode(wu,n(n({},_),{modifyType:[1],compress:dd.enable()})),[4,this._ctx.query(On.pullModifyMsg,this._ctx.currentUserId,r,void 0)];case 1:return i=s.sent(),this._ctx.logger.summary(B.L_PULL_MODIFY_MSG_R,i,t),i.isOk?(o=bh(i.data.pbData),a=o.msg,u=o.nextVersion,l=o.finished,a&&a.length&&c(this,Gh,"m",Bh).call(this,a),c(this,jh,"f")&&(this._ctx.emit("messageModifiedSyncCompleted",!l),d(this,jh,!1,"f")),[2,ur({version:u,hasNext:!l})]):[2,i.wipe()]}var _}))}))}}),r}(or);Vh=new WeakMap,jh=new WeakMap,Gh=new WeakSet,kh=function(e,t){d(this,jh,!0,"f"),t||(this.reset(),d(this,Vh,this._ctx.connectedTime,"f"))},Fh=function(e,t,r,n){0===n&&t.length>0&&d(this,Vh,t[0].sentTime,"f")},Bh=function(e){var t=this,r=[],n=this._ctx.currentUserId;e.forEach((function(e){var i=e.msg;if(1===e.modifyType){var o=_c(i,n,!1);r.push(o);var s=o.conversationType,a=o.targetId,u=o.channelId,l=t.storage.getModel({conversationType:s,targetId:a,channelId:u});if(l&&l.latestMessage){var c=l.latestMessage,d=c.messageUId,_=c.messageType,f=c.content;if(d!==o.messageUId){if(_===me.REFERENCE){if(f.referMsgUid!==o.messageUId)return;f.referMsg=o.content}}else l.updateAttrs({latestMessage:o})}}})),r.length&&this._ctx.emit("messageModified",r)};var mg=18e4,yg=function(){function e(e,t){qh.add(this),Object.defineProperty(this,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_userSettins",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Yh.set(this,void 0),Wh.set(this,void 0),Jh.set(this,void 0),Kh.set(this,void 0),eg.set(this,1),Object.defineProperty(this,"getConversationListByPageIndex",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"getUntaggedConversationListByPage",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),pg.set(this,new Set),Object.defineProperty(this,"searchConversationByContent",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"setMessageSpeechToTextVisible",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"syncRemoteConversations",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"getHistoryMessagesByObjectNames",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"getContinuousMessages",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"getMessagesAroundTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"deleteLocalUGMessagesForAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"getUnreadMentionedMessages",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"getFirstUnreadMessage",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"getConversations",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"clearConversations",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"saveEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"getEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"clearEditedMessageDraft",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"clearUnreadCountByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),this.storage=new kd(e),this.settings=new md(this._ctx,this.storage),d(this,Yh,new Ch(this._ctx),"f"),d(this,Wh,new Ah(this._ctx,this.storage),"f"),d(this,Jh,new xh(this._ctx),"f"),d(this,Kh,new Ig(this._ctx,this.storage),"f"),c(this,Jh,"f").on("ugMsgModify",c(this,qh,"m",ng),this),c(this,Jh,"f").on("ugMsgExpansion",c(this,qh,"m",ig),this),c(this,Jh,"f").on("ugMsgRecalled",c(this,qh,"m",og),this),this._ctx.on("onConnected",c(this,qh,"m",$h),this),this._ctx.on("onDisconnected",c(this,qh,"m",ug),this),this._ctx.on("onSuspend",c(this,qh,"m",ug),this),this._ctx.on("sCmd",c(this,qh,"m",lg),this),this._ctx.on("signal",c(this,qh,"m",cg),this),this._ctx.on("serverEvent",c(this,qh,"m",Xh),this),this._ctx.on("robotsSynced",c(this,qh,"m",Qh),this)}return Object.defineProperty(e.prototype,"startPullModifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,Kh,"f").startPullModifyMsg()}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,d;return s(this,(function(s){return r=e.count,n=e.startTime,i=e.order,o=e.conversationTypes,t?(a=0!==n||i?n:Number.MAX_SAFE_INTEGER,u=this.storage.getAllModels().filter((function(e){return!e.hidden&&(e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)&&(i?e.operationTime>a:e.operationTime<a)})).sort((function(e,t){return e.operationTime-t.operationTime})),l=Math.min(u.length,r),d=i?u.slice(0,l):u.slice(u.length-l),i||d.reverse(),[2,ur(d.map((function(e){return e.toIReceivedConversation()})))]):[2,c(this,qh,"m",dg).call(this,n,r,i||0,o)]}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){return n=((null==t?void 0:t.length)||0)>0?t:ee(e?K:W),i="string"==typeof r&&""!==r,o=this.storage.getAllModels().filter((function(t){return t.isTop&&!t.hidden&&n.includes(t.conversationType)&&(t.conversationType!==exports.ConversationType.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,c(this,qh,"m",_g).call(this,o)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){return e=this._ctx.includeUg,t=this.storage.getAllModels().filter((function(t){return!t.hidden&&t.notificationLevel>exports.NotificationLevel.NOT_SET&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,qh,"m",_g).call(this,t)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){return r=((null==t?void 0:t.length)||0)>0?t:ee(e?K:W),n=this.storage.getAllModels().filter((function(t){return t.unreadCount>0&&r.includes(t.conversationType)&&(t.conversationType!==exports.ConversationType.ULTRA_GROUP||e&&(!t.channelId||"RCDefault"===t.channelId))})).sort((function(e,t){return e.operationTime-t.operationTime})).map((function(e){return e.toIReceivedConversation()})),[2,c(this,qh,"m",_g).call(this,n)]}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(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===exports.ConversationType.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,ur(n)]):[4,c(this,qh,"m",dg).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(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=0,this.storage.getAllModels().forEach((function(i){i.unreadCount>0&&e.includes(i.conversationType)&&(i.conversationType!==exports.ConversationType.ULTRA_GROUP&&(!r&&!i.channelId||i.channelId===r)||i.conversationType===exports.ConversationType.ULTRA_GROUP&&(""===i.channelId||"RCDefault"===i.channelId))&&(t||i.notificationLevel<=exports.NotificationLevel.NOT_SET)&&(n+=i.unreadCount)})),[2,ur(n)]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return t=this.storage.getOrCreateModel(e,!1),r=t.toIReceivedConversation(),[4,c(this,qh,"m",_g).call(this,[r])];case 1:return(n=i.sent()).isOk?[2,n.trans((function(e){return e[0]}))]:[2,ur(r)]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var r,i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,c(this,qh,"m",fg).call(this,e,r,t)];case 1:return(i=s.sent()).isOk?(o=i.data,a=o.version,u=o.updateVersion,l=e.map((function(e){var r=d.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(l),u&&this.storage.set("conversationStatusVersion",a),[2,ur()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,c(this,qh,"m",fg).call(this,e,r,void 0,t)];case 1:return(n=s.sent()).isOk?(i=n.data,o=i.version,a=i.updateVersion,u=e.map((function(e){var r=l.storage.getOrCreateModel(e,!0);return r.updateAttrs({notificationLevel:t}),r})),this.storage.updateConversationStorage(u),a&&this.storage.set("conversationStatusVersion",o),[2,ur()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),[4,c(this,qh,"m",fg).call(this,e,r,void 0,void 0,t)];case 1:return(n=s.sent()).isOk?(i=n.data,o=i.version,a=i.updateVersion,u=e.map((function(e){var r=l.storage.getOrCreateModel(e,!0);return r.updateAttrs({translateStrategy:t}),r})),this.storage.updateConversationStorage(u),a&&this.storage.set("conversationStatusVersion",o),[2,ur()]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this.storage.getOrCreateModel(e,!1),[2,ur(t.notificationLevel)]}))}))}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this.storage.getConversationTypeNotificationLevel(e),[2,ur(t)]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=this._ctx.currentUserId,i=gl.encode(ia,{type:e,unpushLevel:t,version:r,ignoreVersion:!0}),[4,this._ctx.query(On.setTypeUnpush,n,i,oa)];case 1:return(o=s.sent()).isOk?(a=o.data,u=a.version,l=a.updateVersion,this.storage.setConversationTypeNotificationLevel(e,t),l&&this.storage.set("conversationStatusVersion",u),[2,ur()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(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,ur()]}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return r=t.map((function(e){return{msgDataTime:e.sentTime,msgId:e.messageUId,direct:e.messageDirection}})),n=gl.encode(Fs,{type:e.conversationType,busChannel:e.channelId,conversationId:e.targetId,msgs:r}),i=e.conversationType===exports.ConversationType.ULTRA_GROUP?On.delUgMsg:On.delMsg,[4,this._ctx.query(i,this._ctx.currentUserId,n)];case 1:return(o=s.sent()).isOk?this._ctx.includeUg?((a=this.storage.getModel(e))&&(u=a.latestMessage)&&t.some((function(e){return e.messageUId===u.messageUId}))&&a.updateAttrs({latestMessage:null}),[2,ur()]):[2,ur()]:[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=gl.encode(Os,{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:t}),n=Lg[e.conversationType],[4,this._ctx.query(n,this._ctx.currentUserId,r)];case 1:return(i=s.sent()).isOk?this._ctx.includeUg?((o=this.storage.getModel(e))&&(a=o.latestMessage)&&(0===t||a.sentTime<=t)&&o.updateAttrs({latestMessage:null}),[2,ur()]):[2,ur()]:[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=gl.encode(Cs,{input:e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,busChannel:e.channelId,dataTime:e.timestamp||0}}))}),[4,this._ctx.query(On.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,ur()]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=gl.encode(aa,{targetId:e.targetId,type:e.conversationType,channelId:e.channelId,readType:0,msgIds:t}),n=t[0],[4,this._ctx.query(On.readReceipt,n,r)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,l;return s(this,(function(s){switch(s.label){case 0:return t=new Map,e.forEach((function(e){var r=Nd(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=u(e,2),r=t[0],n=t[1],i=Pd(r);return{targetId:i.targetId,type:i.conversationType,busChannel:i.channelId,msgIds:Array.from(n)}})),n=function(e){return gl.encode(la,{items:e,compress:dd.enable()})}(r),[4,this._ctx.query(On.qryReceiptBatch,e[0].messageUId,n)];case 1:return(i=s.sent()).isOk?(o=i.data,a=fh(o.pbData).item,l=[],a.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,o=e.totalCnt;l.push({identifier:r,messageUId:t,unreadCount:n,readCount:i,totalCount:o})}))})),[2,ur(l)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d;return s(this,(function(s){switch(s.label){case 0:return n=0===r.readStatus?1:2,i=dh({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(On.qryReceipt,t,i)];case 1:return(o=s.sent()).isOk?(a=o.data,u=_h(a.pbData),l=u.resp,c=u.pageToken,d=l[0],[2,ur({pageToken:c||"",totalCount:1===n?d.readCnt:d.unreadCnt,users:(1===n?d.readUser:d.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(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,c;return s(this,(function(s){switch(s.label){case 0:return n=dh({targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgIds:[t],qryType:2,users:r}),[4,this._ctx.query(On.qryReceipt,t,n)];case 1:return(i=s.sent()).isOk?(o=i.data,a=_h(o.pbData).resp,c=a[0],[2,ur({pageToken:"",totalCount:0,users:l(l([],u(c.readUser),!1),u(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(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=cr.create("requestSpeechToTextForMessage").isObject("option",t,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").validate("messageType",null==t?void 0:t.messageType,(function(e){return e===me.HQ_VOICE||e===me.VOICE}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){if(t.messageType===me.HQ_VOICE)e.validate("numberOfChannels",t.numberOfChannels,(function(e){return 1===e}),!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"numberOfChannels invalid").validate("sampleRate",t.sampleRate,(function(e){return 16e3===e||8e3===e}),!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"sampleRate invalid").isString("format",t.format).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"format invalid").isHttpUrl("remoteUrl",t.remoteUrl,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"remoteUrl invalid");else{var r=t.content;e.isNotEmptyString("content",r,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"content invalid")}})).isLimitedInteger("duration",t.duration,1,60,!0).fail(exports.ErrorCode.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED,"duration invalid").result()).isOk?c(this,pg,"f").has(e)?[2,lr(exports.ErrorCode.SPEECH_TO_TEXT_REQUEST_IN_PROCESS,"speech to text request in process")]:(c(this,qh,"m",hg).call(this,e,t),[2,ur()]):[2,r.wipe()]}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return t=e.messageUId,r=e.messageContent,n=e.conversation,i=gl.encode(Ta,{targetId:n.targetId,type:n.conversationType,busChannel:n.channelId,msgUID:t,msgTime:0,content:JSON.stringify(r),fromUserId:""}),[4,this._ctx.query(On.modifyMsg,this._ctx.currentUserId,i,va)];case 1:return(o=s.sent()).isOk?((a=this.storage.getModel(n))&&(u=a.latestMessage,l=a.conversationType,u&&u.messageUId===t&&(u.content=r,u.isModifyMessage=!0,u.modifyInfo=l===exports.ConversationType.ULTRA_GROUP?void 0:{timestamp:o.data.modifyTime,status:Mr,content:{}},a.updateAttrs({latestMessage:u}))),[2,ur()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a=this;return s(this,(function(s){return(o=cr.create("refreshReferenceMessageWithParams").validate("messageInfoMap",i,(function(t){return t&&e.every((function(e){return t[e]&&Et(t[e])}))}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_INFO_MAP).result()).isOk?(setTimeout((function(){n([]),c(a,qh,"m",Eg).call(a,e,t,r,i)}),0),[2,ur()]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,l,c,d,_,f,p,h,g=this;return s(this,(function(s){switch(s.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:is.Tags,value:"",tags:[{tagId:e}]}]}})),a=Eh(r,o),[4,this._ctx.query(On.addTag,i,a,na)]):[2,lr(exports.ErrorCode.TAG_NOT_EXIST)];case 1:return(l=s.sent()).isOk?(c=l.data,d=c.version,_=c.updateVersion,f=new Map,t.forEach((function(t){var r=g.storage.getOrCreateModel(t,!0),n={},i=r.tags;i.some((function(t){return t.tagId===e}))||(n.tags=i.concat({tagId:e}),f.set(r,n))})),p=[],h=[],Array.from(f.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1];h.push(r);var i=r.updateAttrs(n,d);i&&p.push({conversation:r.toIReceivedConversation(),updatedItems:i})})),this.storage.updateConversationStorage(h),_&&this.storage.set("conversationStatusVersion",d),p.length>0&&this._ctx.emit("conversationStatusChanged",p),[2,ur()]):[2,l.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(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,ur(n)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c,d,_,f,p;return s(this,(function(s){switch(s.label){case 0:return n=this.storage.get("conversationStatusVersion"),i=r.isTop,o=this.storage.getOrCreateModel(t,!1),a=o.tags,(u=a.find((function(t){return t.tagId===e})))?(l=Eh(n,[{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:is.Tags,value:"",tags:[{tagId:e,isTop:i}]}]}]),c=this._ctx.currentUserId,[4,this._ctx.query(On.addTag,c,l,na)]):[2,lr(exports.ErrorCode.NO_TAG_IN_CONVER)];case 1:return(d=s.sent()).isOk?(_=d.data,f=_.version,p=_.updateVersion,u.isTop=i,o.updateAttrs({tags:a},f),this.storage.updateConversationStorage([o]),p&&this.storage.set("conversationStatusVersion",f),[2,ur()]):[2,d.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d=this;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.get("conversationStatusVersion"),n=Eh(r,t.map((function(t){return{type:t.conversationType,channelId:t.targetId,busChannel:t.channelId,time:Date.now(),stateItem:[{sessionStateType:is.Tags,value:"",tags:[{tagId:e}]}]}}))),i=this._ctx.currentUserId,[4,this._ctx.query(On.delTag,i,n,na)];case 1:return(o=s.sent()).isOk?(a=o.data,u=a.version,l=a.updateVersion,c=t.map((function(t){var r=d.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,ur()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,_;return s(this,(function(s){switch(s.label){case 0:return r=this._ctx.currentUserId,n=this.storage.get("conversationStatusVersion"),i=Eh(n,[{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,time:Date.now(),stateItem:[{sessionStateType:is.Tags,value:"",tags:t.map((function(e){return{tagId:e}}))}]}]),[4,this._ctx.query(On.delTag,r,i,na)];case 1:return(o=s.sent()).isOk?(a=o.data,u=a.version,l=a.updateVersion,c=this.storage.getOrCreateModel(e,!0),d=c.tags,_={tags:d.filter((function(e){return!t.includes(e.tagId)}))},c.updateAttrs(_,u),this.storage.updateConversationStorage([c]),l&&this.storage.set("conversationStatusVersion",u),[2,ur()]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){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,ur([])]:(a=o.map((function(t){return n(n({},t.toIReceivedConversation()),{isTopInTag:t.tags.some((function(t){return t.tagId===e&&t.isTop}))})})),[2,c(this,qh,"m",_g).call(this,a)])):[2,ur([])]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(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>exports.NotificationLevel.NOT_SET&&!t)return;r+=null!==(i=n.unreadCount)&&void 0!==i?i:0}})),[2,ur(r)]}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return t=e.identifiers,r=e.deleteMessages,n=gl.encode(js,{relation:t.map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),cleanMsg:r}),[4,this._ctx.query(On.delRelationBatch,this._ctx.currentUserId,n,void 0)];case 1:return(i=s.sent()).isOk&&t.forEach((function(e){var t=o.storage.getModel(e);t&&o.storage.removeConversation(t)})),[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=gl.encode(sa,{msgId:t,channelId:r}),[4,this._ctx.query(On.rrMsg,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return t=e.conversationType,r=e.channelId,n=e.targetId,i=gl.encode(Sa,{targetId:n,type:t,busChannel:r||"",opType:0}),(o=new to(On.operate,i,n)).setHeaderQos(Mn),[4,this._ctx.send(o)];case 1:return[2,s.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(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=bc(t.unreadMentionedCount||0),t.unreadMessageCount=bc(t.unreadMessageCount||0),t.unreadMentionedMeCount=bc(t.unreadMentionedMeCount||0),t})),[2,ur(n)]}))}))}}),Object.defineProperty(e.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=this._ctx.currentUserId,[4,c(this,qh,"m",gg).call(this,e,t)];case 1:return(n=s.sent()).isOk?(i=n.data,o=i.list,i.notExistMsgId,a=o.map((function(t){return _c(t,r,!1,e.targetId)})),[2,ur(a)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.targetId,r=e.channelId,n=e.sentTime,i=e.count,o=gl.encode(As,{groupId:t,busChannel:r,msgTime:n,size:i}),[4,this._ctx.query(On.qryUgUal,this._ctx.currentUserId,o,Ss)];case 1:return(a=s.sent()).isOk?(u=a.data.msgInfo,[2,ur(u.map((function(e){return{messageUId:e.msgId,sentTime:e.msgTime,messageType:e.className,mentionedType:e.remindType}})))]):[2,a.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var i;return o(this,void 0,void 0,(function(){var o,a,u,l,c,d,_,f;return s(this,(function(s){switch(s.label){case 0:return o=this._ctx.currentUserId,a=t.mid,u=t.put,l=t.del,c=t.clear,d=gl.encode(Ta,{fromUserId:o,targetId:e.targetId,type:e.conversationType,busChannel:e.channelId,msgUID:a,msgTime:r,content:JSON.stringify(t)}),[4,this._ctx.query(On.upMsgEx,e.targetId,d)];case 1:return(_=s.sent()).isOk&&(null==(f=null===(i=this.storage.getModel(e))||void 0===i?void 0:i.latestMessage)?void 0:f.messageUId)===a&&(c?f.expansion={}:u?f.expansion=n(n({},f.expansion),u):l&&f.expansion&&l.forEach((function(e){delete f.expansion[e]}))),[2,_.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=gl.encode(ta,{unpushLevel:t,busChannel:r}),[4,this._ctx.query(On.ugUnpushSet,e,n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return r=gl.encode(ea,{busChannel:t}),[4,this._ctx.query(On.ugUnpushQuery,e,r,ra)];case 1:return(n=o.sent()).isOk?(i=n.data.unpushLevel,[2,ur(i)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return r=this.storage.getModel(e),[2,ur(null!==(t=null==r?void 0:r.unreadMentionedCount)&&void 0!==t?t:0)]}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return e=this.storage.getAllSGModels().reduce((function(e,t){return e+t.unreadMentionedCount}),0),[2,ur(e)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=0,this.storage.getAllModels().forEach((function(i){if(e.includes(i.conversationType)){var o=i.notificationLevel,s=i.unreadCount,a=i.unreadMentionedCount;(0===t.length||t.includes(o))&&(n+=r?a:s)}})),[2,ur(n)]}))}))}}),Object.defineProperty(e.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this.storage.getModel(e),[2,ur(t?t.unreadCount:0)]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){return(t=this.storage.getModel(e))?(r=t.firstUnreadMessage,[2,ur(r?{messageUId:r.messageUId||"",sentTime:r.sentTime}:null)]):[2,ur(null)]}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){return n=this.storage.getAllUGModels(),i=n.reduce((function(n,i){var o=r?i.unreadMentionedCount:i.unreadCount;if(!o||i.targetId!==e)return n;var s=i.notificationLevel||exports.NotificationLevel.NOT_SET;return!t.length||t.includes(s)?n+o:n}),0),[2,ur(bc(i))]}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(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:bc(e.unreadCount||0),mentionedCount:bc(e.unreadMentionedCount||0),mentionedMeCount:bc(e.unreadMentionedMeCount||0),notificationLevel:e.notificationLevel||exports.NotificationLevel.NOT_SET}})),[2,ur(t)]}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){return t=this.storage.getModel(e),(r=null==t?void 0:t.firstUnreadMessage)?[2,ur(r)]:[2,lr(exports.ErrorCode.RC_DB_DATA_NOT_FOUND)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){return e=this.storage.getAllUGModels().filter((function(e){return e.notificationLevel>exports.NotificationLevel.NOT_SET})).map((function(e){return e.toIReceivedConversation()})),[2,ur(e)]}))}))}}),Object.defineProperty(e.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return t=this._ctx.serverTime,e.conversationType!==exports.ConversationType.ULTRA_GROUP?[3,2]:(r=ah(e,t),(n=new to(On.updUgRTime,r,this._ctx.currentUserId)).setHeaderQos(Mn),[4,this._ctx.send(n)]);case 1:if(!(i=o.sent()).isOk)return[2,i.wipe()];o.label=2;case 2:return this.storage.clearConversationUnreadCount(e,t),[2,ur()]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,qh,"m",Tg).call(this,t,r,e,[],xe.ALL,On.qrySessions)];case 1:return(i=s.sent()).isOk?(o=this._ctx.currentUserId,a=i.data.info.map((function(e){var t=e.unreadCount,r=e.busChannel,i=e.type,s=e.userId,a=e.versionTime,l=e.msg,c=u.storage.getOrCreateModel({conversationType:i,targetId:s,channelId:r||""},!1);return n(n({},c.toIReceivedConversation()),{unreadMessageCount:t,operationTime:a,latestMessage:l?_c(l,o,!1,s):null})})).sort((function(e,t){var n,i,o=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0,s=(null===(i=t.latestMessage)||void 0===i?void 0:i.sentTime)||0;return 0===r?s-o:o-s})),[2,ur(a)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=gl.encode(ws,{nothing:1}),[4,this._ctx.query(On.qrySessionsAtt,this._ctx.currentUserId,e,Us)];case 1:return[2,t.sent().trans((function(e){return e.totalUnreadCount}))]}}))}))}}),Object.defineProperty(e.prototype,"clearRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return t=this._ctx.serverTime,this.storage.clearConversationUnreadCount(e,this._ctx.serverTime),r=ah(e,t),n=new to(On.updRRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"removeRealtimeConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=gl.encode(xs,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(On.delSessions,this._ctx.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=gl.encode(Gs,{sessions:e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId}}))}),[4,this._ctx.query(On.qrySessionsUnread,this._ctx.currentUserId,t,Vs)];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(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){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!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId)})).sort((function(e,t){return t.operationTime-e.operationTime})).slice(0,r),[2,ur(o.map((function(e){return e.toIReceivedConversation()})))]):(a=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=a.map((function(e){return e.toIReceivedConversation()})),[2,c(this,qh,"m",_g).call(this,u)])}))}))}}),Object.defineProperty(e.prototype,"loadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,_=this;return s(this,(function(s){switch(s.label){case 0:return i=function(e,t,r){var n=r.conversationTypes,i=r.tagFilter,o=void 0===i?{}:i,s=r.order;r.channelId;var a=o.tagIds,u=o.topPriority;return gl.encode(ms,{type:n,count:t,order:s,tags:a,isTagTop:!!u,pageToken:e,compress:dd.enable()})}(e,t,r),[4,this._ctx.query(On.qryRelationFilter,this._ctx.currentUserId,i,void 0)];case 1:return(o=s.sent()).isOk?(a=uh(o.data.pbData),u=a.pageToken,l=a.isFinished,c=a.info,d=c.map((function(e){var t=e.busChannel,r=e.type,i=e.userId,o={conversationType:r,targetId:i,channelId:t||""},s=_.storage.getOrCreateModel(o,!1);return n(n({},s.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?_c(e.msg,_._ctx.currentUserId,!1,i):null})})),[2,ur({pageToken:u||"",finished:!!l,list:d})]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=ah(e,t),n=new to(On.updRTime,r,this._ctx.currentUserId),[4,this._ctx.send(n)];case 1:return[2,i.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=gl.encode(sa,{msgId:[t],channelId:r}),[4,this._ctx.query(On.rrList,e,n,_a)];case 1:return[2,i.sent().trans((function(e){return{totalMemberCount:e.totalMemberNum,list:e.list}}))]}}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return n=e.conversationType,i=e.targetId,o=e.channelId,a=gl.encode(wa,{targetId:i,type:n,busChannel:o,startMsgId:t,endMsgId:r}),u=new to(On.sendMsgRead,a,i),[4,this._ctx.send(u)];case 1:return[2,s.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return r=e.targetId,n=e.channelId,i=void 0===n?"":n,o=gl.encode(Ua,{targetId:r,busChannel:i,msgId:t}),[4,this._ctx.query(On.qryMsgRead,r,o,Da)];case 1:return[2,s.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(e.prototype,"batchGetMessageReadReceiptInfoV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=e.targetId,i=e.conversationType,o=e.channelId,a=gl.encode(xa,{type:i,busChannel:o,msgId:t}),[4,this._ctx.query(On.qryMsgReadCntBatch,r,a,Ga)];case 1:return[2,s.sent().trans((function(t){return t.result.map((function(t){return n({messageUId:t.msgId,readedCount:t.cnt,totalCount:t.tmn},e)}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){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,ur(i.map((function(e){return e.toIReceivedConversation()})))]):[2,c(this,qh,"m",dg).call(this,e.timestamp,t,0,r,xe.ROBOT_ONLY)]}))}))}}),e}();Yh=new WeakMap,Wh=new WeakMap,Jh=new WeakMap,Kh=new WeakMap,eg=new WeakMap,pg=new WeakMap,qh=new WeakSet,Qh=function(e,t,r){if(t===exports.ErrorCode.SUCCESS&&this._ctx.includeUg&&0!==r.length){var n=[exports.ConversationType.PRIVATE,exports.ConversationType.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})}))}},Xh=function(e,t,r){if(t===wh){e.stopPropagation();var n=[];r.forEach((function(e){if(0===e.subChangeType){var t=gl.decode(Su,new Uint8Array(e.eventData)),r=t.msgId,i=t.unreadCnt,o=t.readCnt,s=t.readList,a=t.totalCnt;n.push({identifier:{conversationType:e.channelType,targetId:e.businessId,channelId:e.secondaryId},messageUId:r,users:s.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}})),readCount:o,unreadCount:i,totalCount:a})}})),this._ctx.emit("readReceiptResponseV5",n)}},Zh=function(e){e||(c(this,Wh,"f").setInitVersion(0),this._ctx.includeUg&&c(this,qh,"m",tg).call(this)),c(this,Wh,"f").startInterval(mg,!0)},zh=function(e){return o(this,void 0,void 0,(function(){var t;return s(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(mg,!0),[2]}}))}))},$h=function(e,t){t||this.storage.syncDataFromLocalStorage(this._ctx),c(this,qh,"m",zh).call(this,t),c(this,qh,"m",Zh).call(this,t),this._ctx.ugEnabel&&c(this,qh,"m",ag).call(this,t)},tg=function e(){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,_=this;return s(this,(function(s){switch(s.label){case 0:return this._ctx.isConnected?(t=this._ctx.logger,r=t.createTraceId(),n=c(this,eg,"f"),t.info(B.L_PULL_SG_RELATIONS_T,JSON.stringify({startTime:n}),r),[4,c(this,qh,"m",Tg).call(this,n,1,1e3)]):[2];case 1:return(i=s.sent()).isOk?(o=i.data,a=o.info,u=o.isFinished,l=o.pullTime,d(this,eg,l,"f"),t.info(B.L_PULL_SG_RELATIONS_R,JSON.stringify({startTime:n,isFinished:u,pullTime:l}),r),this.storage.addRelations(a,this._ctx.currentUserId),u?(this._ctx.emit("sgRelationsSynced",exports.ErrorCode.SUCCESS),[2]):[2,c(this,qh,"m",e).call(this)]):(t.warn(B.L_PULL_SG_RELATIONS_R,i.errmsg(),r),setTimeout((function(){return c(_,qh,"m",e).call(_)}),1e3),[2])}}))}))},rg=function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,qh,"m",gg).call(this,e,t)];case 1:return(n=s.sent()).isOk?(i=n.data.list.map((function(t){return _c(t,u._ctx.currentUserId,!1,e.targetId)})),(o=this.storage.getModel(e))&&o.latestMessage&&(a=i.find((function(e){return e.messageUId===o.latestMessage.messageUId})))&&o.updateAttrs({latestMessage:a}),2===r?this._ctx.emit("messageModified",i):1===r&&this._ctx.emit("ugMsgExpansionUpdated",i),[2]):[2]}}))}))},ng=function(e,t,r){c(this,qh,"m",rg).call(this,t,r,2)},ig=function(e,t,r){c(this,qh,"m",rg).call(this,t,r,1)},og=function(e,t){var r=this,i=t.map((function(e){var t=e.targetId,i=e.busChannel,o=e.msgUID,s=e.msgTime,a=e.operatorId,u=e.remindType,l={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:t,channelId:i||""},d=n(n({},l),{messageUId:o,sentTime:s}),_=n(n({},l),{sentTime:s,messageUId:o,senderUserId:a,content:d,messageDirection:1,messageType:me.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Ct(exports.ReceivedStatus.UNREAD)}),f=r.storage.getModel(l);return f&&c(r,qh,"m",sg).call(r,f,_,u),_}));this._ctx.emit("ugMsgRecalled",i)},sg=function(e,t,r){var n={},i=t.content,o=i.messageUId,s=i.sentTime,a=e.latestMessage;a&&a.messageUId===o&&(n.latestMessage=gc(t,!0)),s&&e.lastReadTime<s&&e.unreadCount&&(n.unreadCount=e.unreadCount-1,r!==exports.MentionedType.ALL&&r!==exports.MentionedType.SINGAL||!e.unreadMentionedCount||(n.unreadMentionedCount=e.unreadMentionedCount-1),r===exports.MentionedType.SINGAL&&e.unreadMentionedCount&&(n.unreadMentionedMeCount=e.unreadMentionedMeCount-1));var u=e.updateAttrs(n,s);this.storage.updateConversationStorage([e]),u&&this._ctx.emit("conversation",[{conversation:e.toIReceivedConversation(),updatedItems:u}])},ag=function(e){return o(this,void 0,void 0,(function(){var e,t,r,n;return s(this,(function(i){switch(i.label){case 0:return[4,c(this,Yh,"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),this._ctx.emit("ultraGroupEnable"),c(this,Yh,"f").setInitVersion(n),c(this,Yh,"f").startInterval(mg,!0),c(this,Jh,"f").setInitVersion(n),c(this,Jh,"f").startInterval(mg,!0),[2]):[2]}}))}))},ug=function(){this.settings.stopInterval(),c(this,Yh,"f").reset(),c(this,Wh,"f").reset(),c(this,Jh,"f").reset()},lg=function(e,t){return 3===t.type?(e.stopPropagation(),void this.settings.push(t.time)):7===t.type?(e.stopPropagation(),void c(this,Jh,"f").push(t.time)):void(12===t.type&&(e.stopPropagation(),c(this,Kh,"f").push(t.time)))},cg=function(e,t,r){var n=t.syncMsg,i=Nn(t.topic);if(n&&i===On.updUgRTime){e.stopPropagation();var o=gl.decode(Ds,t.pbData),s=o.channelId,a=o.busChannel,u=o.msgTime,l=this.storage.clearConversationUnreadCount({conversationType:exports.ConversationType.ULTRA_GROUP,targetId:s,channelId:a||""},u);l&&this._ctx.emit("conversationStatusChanged",[l])}},dg=function(e,t,r,i,a){return o(this,void 0,void 0,(function(){var o,u,l,d,_,f=this;return s(this,(function(s){switch(s.label){case 0:return o=this._ctx.currentUserId,[4,c(this,qh,"m",Tg).call(this,e,r||0,t,i,a)];case 1:return(u=s.sent()).isOk?(l=u.data,d=l.info,l.isFinished,l.pullTime,_=d.map((function(e){var t=e.userId,r=e.type,i=e.busChannel,s=f.storage.getOrCreateModel({conversationType:r,targetId:t,channelId:i},!1);return n(n({},s.toIReceivedConversation()),{operationTime:e.versionTime,latestMessage:e.msg?_c(e.msg,o,!1,t):null})})),[2,ur(_)]):[2,u.wipe()]}}))}))},_g=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._ctx.includeUg?[2,ur(e)]:(t=this._ctx.currentUserId,r=e.filter((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP})).map((function(e){return{conversationType:e.conversationType,conversationId:e.targetId,busChannel:e.channelId}})),0===r.length?[2,ur(e)]:(n=gl.encode(js,{relation:r}),[4,this._ctx.query(On.qryRLBatch,this._ctx.currentUserId,n,void 0)]));case 1:return(i=o.sent()).isOk?(c(this,qh,"m",bg).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=_c(r.msg,t,!1,r.userId),n.includeRobot=!!r.isBot}})),[2,ur(e)]):[2,i.wipe()]}}))}))},fg=function(e,t,r,n,i){return o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){return o=[],void 0!==r&&o.push({sessionStateType:is.IsTop,value:r?"1":"0"}),void 0!==n&&o.push({sessionStateType:is.IsSilent,value:n.toString()}),void 0!==i&&o.push({sessionStateType:is.AutoTrans,value:i.toString()}),a=Eh(t,e.map((function(e){return{type:e.conversationType,channelId:e.targetId,busChannel:e.channelId,stateItem:o}}))),[2,this._ctx.query(On.setSeAtt,this._ctx.currentUserId,a,na)]}))}))},hg=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return c(this,pg,"f").add(e),r=t.messageType===me.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=gl.encode(Ou,{businessType:1,businessInfo:gl.encode(Cu,r)}),[4,this._ctx.query(On.upConvertMsg,e,n,Nu)];case 1:return i=s.sent(),c(this,pg,"f").delete(e),o=i.code,i.isOk?(u=gl.decode(Pu,new Uint8Array(i.data.businessResult)),a={status:Ge.SUCCESS,text:u.result}):a={status:Ge.FAILED,text:""},this._ctx.emit("speechToTextResponse",{code:o,messageUId:e,sttInfo:a}),[2]}}))}))},gg=function(e,t){var r=e.targetId,n=e.conversationType,i=e.channelId,o=gl.encode(ya,{targetId:r,type:n,query:t.map((function(e){return{msgTime:0,msgUID:e,busChannel:i}}))});return this._ctx.query(On.qryMsg,this._ctx.currentUserId,o,Aa)},Eg=function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,d,_,f,p,h,g,E,b,T=this;return s(this,(function(s){switch(s.label){case 0:return i=Object.values(n),o=l([],u(new Set(l(l([],u(e),!1),u(i),!1))),!1),[4,c(this,qh,"m",gg).call(this,t,o)];case 1:return a=s.sent(),d=a.isOk,_=a.code,f=a.data,d?(h=(p=f).list,g=p.notExistMsgId,E=new Map(h.map((function(e){var r=_c(e,T._ctx.currentUserId,!1,t.targetId);return[r.messageUId,r]}))),b=e.map((function(e){var t=E.get(e);if(!t)return g.includes(e)?{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND}:{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR};if(t.messageType!==me.REFERENCE)return{messageUId:e,code:exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE};var r=n[e],i=E.get(r),o=t.content;return i?(o.referMsg=i.content,o.referMsgStatus=i.isModifyMessage?wr.MODIFIED:wr.DEFAULT,{messageUId:e,message:t,code:exports.ErrorCode.SUCCESS}):g.includes(r)?(o.referMsgStatus=wr.DELETE,{messageUId:e,code:exports.ErrorCode.RC_DB_DATA_NOT_FOUND,message:t}):(o.referMsgStatus=wr.DEFAULT,{messageUId:e,code:exports.ErrorCode.SERVER_DATA_ERROR,message:t})})),r(b),[2]):(r(e.map((function(e){return{messageUId:e,code:_}}))),[2])}}))}))},bg=function(e){var t=uh(e);return this._ctx.getNaviInfoFromCache().supportRecallRefactor&&t.info.forEach((function(e){var t=e.msg;if(t&&t.classname===me.RECALL){var r=JSON.parse(t.content),n=r.messageUId,i=r.sentTime,o=r.extra,s={recallTime:i,recallActionTime:t.dataTime,admin:!!r.isAdmin,delete:!!r.isDelete,isDelete:!!r.isDelete,operatorId:t.fromUserId,extra:o};t.classname=me.RECALL_NOTIFICATION_MESSAGE,t.content=JSON.stringify(s),t.msgId=n,t.dataTime=i||t.dataTime}})),t},Tg=function(e,t,r,n,i,a){return void 0===a&&(a=On.qryRelationR),o(this,void 0,void 0,(function(){var o,u,l=this;return s(this,(function(s){switch(s.label){case 0:return o=this._ctx.currentUserId,u=function(e,t,r,n,i){return gl.encode(Is,{startTime:e,order:t,count:r,compressioEnabled:dd.enable(),channelType:n,botType:i})}(e,t,r,n,i),[4,this._ctx.query(a,o,u)];case 1:return[2,s.sent().trans((function(e){return c(l,qh,"m",bg).call(l,e.pbData)}))]}}))}))};var Ag,Sg,Og,Cg,Ng,Pg,Lg=((Hh={})[exports.ConversationType.PRIVATE]=On.cleanPMsg,Hh[exports.ConversationType.GROUP]=On.cleanGMsg,Hh[exports.ConversationType.CUSTOMER_SERVICE]=On.cleanCMsg,Hh[exports.ConversationType.SYSTEM]=On.cleanSMsg,Hh[exports.ConversationType.APP_PUBLIC_SERVICE]=On.cleanMCMsg,Hh[exports.ConversationType.PUBLIC_SERVICE]=On.cleanMPMsg,Hh[exports.ConversationType.ULTRA_GROUP]=On.cleanGMsg,Hh),Mg=function(){Object.defineProperty(this,"recallMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:new Set})};function wg(e){var t=!(1&~(e.ugMsg||0)),r=!(1&~(e.sessionCfg||0));return t&&r}var Ug,Dg,xg,Gg=[On.chatMsg,On.ugMsg,On.recallMsg,On.ppMsgS,On.pgMsgS,On.ppMsgP,On.pgMsgP,On.pcMsgP,On.prMsgS,On.pbMsgP,On.chatMsgS],Vg=function(e){function r(t,r,n,i){var o=e.call(this)||this;return Ag.add(o),Object.defineProperty(o,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_navi",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"logger",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"send",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"query",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"userStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Sg.set(o,void 0),Object.defineProperty(o,"_robots",{enumerable:!0,configurable:!0,writable:!0,value:{robots:[],isSynced:!1}}),o.userStorage=new Mg,d(o,Sg,new Dh(r,i),"f"),c(o,Sg,"f").pipe(o),o.on("onConnected",c(o,Ag,"m",Og),o,100),o.on("onDisconnected",c(o,Ag,"m",Ng),o,100),o.on("onSuspend",c(o,Ag,"m",Cg),o,100),o.send=o._connMgr.send.bind(o._connMgr),o.query=o._connMgr.query.bind(o._connMgr),o.on("signal",c(o,Ag,"m",Pg),o),o}return t(r,e),Object.defineProperty(r.prototype,"isConnected",{get:function(){return this._connMgr.isConnected},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentToken",{get:function(){return this._connMgr.getToken()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectedTime",{get:function(){return this._connMgr.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 wg(this.getNaviInfoFromCache())},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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,c;return s(this,(function(s){switch(s.label){case 0:return t=this._robots.robots.slice(),!e&&this._robots.isSynced?[2,ur(t)]:(r=gl.encode(il,{ids:[]}),[4,this._connMgr.query(On.qAppBot,this.currentUserId,r,ol)]);case 1:return(n=s.sent()).isOk?(i=Math.max.apply(Math,l([],u(t.map((function(e){return e.updateTime}))),!1)),o=[],a=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!a.some((function(t){return t.robotId===e.robotId}))})),this._robots.isSynced=!0,this._robots.robots=a,e&&this.emit("robotsSynced",n.code,a.slice(),o,c),[2,ur(a.slice())]):(e&&this.emit("robotsSynced",n.code,[],[],[]),[2,lr(n.code,n.msg,t)])}}))}))}}),r}(ir);Sg=new WeakMap,Ag=new WeakSet,Og=function(e,t){return o(this,void 0,void 0,(function(){var e,r,n,i;return s(this,(function(o){switch(o.label){case 0:return t||this.getAllRobots(!0),[4,c(this,Sg,"f").noticeOnline()];case 1:return(e=o.sent()).isOk?(t?c(this,Sg,"f").startInterval(18e4,!0):(r=e.data,n=r.syncTime,i=r.hasNext,c(this,Sg,"f").setInitVersion(n),c(this,Sg,"f").startInterval(18e4,!!i)),[2]):[2]}}))}))},Cg=function(e,t){c(this,Sg,"f").stopInterval()},Ng=function(e){this._robots.isSynced=!1,this._robots.robots=[],c(this,Sg,"f").reset()},Pg=function(e,t,r){var n=t.topic,i=t.syncMsg,o=Nn(n);if(o||(this.logger.warn(B.L_RECV_RMTP_E,"unknown topic: ".concat(n)),e.stopPropagation()),this.logger.debug(B.L_RECV_RMTP_O,n),i&&Gg.includes(o)){e.stopPropagation();var s=r||{},a=s.timestamp,u=void 0===a?this.serverTime:a,l=s.messageUId,d=void 0===l?"":l,_=dc(t,this.currentUserId,u,d),f=_c(_,this.currentUserId,!1,t.targetId);this.emit("syncMsg",f,o)}else{if(o===On.s_ntf){e.stopPropagation();var p=(E=gl.decode(us,t.pbData)).type,h=E.chrmId,g=E.time;return this.logger.info(B.L_RECV_S_NTF_O,"type: ".concat(p,", chrmId: ").concat(h,", time: ").concat(g)),void this.emit("sNtf",E)}if(o===On.s_cmd){e.stopPropagation();var E;p=(E=gl.decode(us,t.pbData)).type,h=E.chrmId,g=E.time;if(this.logger.info(B.L_RECV_S_CMD_O,"type: ".concat(p,", chrmId: ").concat(h,", time: ").concat(g)),11===p)return void c(this,Sg,"f").push(g);this.emit("sCmd",E)}if(o===On.s_msg){e.stopPropagation();_=gl.decode(fs,t.pbData),f=_c(_,this.currentUserId,!1);this.emit("sMsg",f)}}};var jg,kg=function(e,t,r){var n=0;return e&&(n|=1),t&&(n|=2),r&&(n|=4),n},Fg=function(e,t,r){return{chatroomId:e,key:t.key,value:t.value,timestamp:t.version,type:r?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE}},Bg=function(e){function r(t,r){var n=e.call(this,"WebChatroomKVStore")||this;return Ug.add(n),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Dg.set(n,new Map),Object.defineProperty(n,"_emittedEntriesSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),n}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l,d,_,f,p=this;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),i=this._chatroomId,o={chatroomId:i,timestamp:e},t.info(B.L_PULL_CHATROOM_KV_T,JSON.stringify(o),r),[4,this._ctx.query(On.pullKV,i,Th(e),void 0)];case 1:return(a=s.sent()).isOk?(u=vh(a.data.pbData),l=u.bFullUpdate,d=u.entries,_=u.syncTime,t.info(B.L_PULL_CHATROOM_KV_R,JSON.stringify(n(n({},o),{newVersion:_})),r),f=new Map,l&&(Array.from(c(this,Dg,"f").values()).forEach((function(e){f.set(e.key,Fg(i,e,!0))})),c(this,Dg,"f").clear()),Array.from(d.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?c(p,Dg,"f").delete(n.key):c(p,Dg,"f").set(n.key,n),f.set(n.key,Fg(i,n,r))})),this._emittedEntriesSynced||(this._emittedEntriesSynced=!0,this._ctx.emit("chatroom",{entriesSynced:i})),f.size>0&&this._ctx.emit("chatroom",{updatedEntries:Array.from(f.values())}),[2,ur({version:_})]):(t.warn(B.L_PULL_CHATROOM_KV_R,JSON.stringify(n(n({},o),{code:a.code})),r),[2,a.wipe()])}}))}))}}),Object.defineProperty(r.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,c(this,Ug,"m",xg).call(this,e,t,!1)];case 1:return(r=n.sent()).isOk&&c(this,Dg,"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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return[4,c(this,Ug,"m",xg).call(this,{key:e.key,value:"",isAutoDelete:!1,isSendNotification:e.isSendNotification,notificationExtra:e.notificationExtra},t,!0)];case 1:return(r=n.sent()).isOk&&c(this,Dg,"f").delete(e.key),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.serverTime,r=e.entries.map((function(r){var n,i=c(l,Dg,"f").get(r.key);return{key:r.key,value:r.value,uid:l._ctx.currentUserId,version:null!==(n=null==i?void 0:i.version)&&void 0!==n?n:t,status:kg(!!e.isAutoDelete,e.isForce||!1,!1)}})),n=gl.encode(Hs,{entry:r}),[4,this._ctx.query(On.setKVS,this._chatroomId,n,Ys)];case 1:return(i=s.sent()).isOk||i.code===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?((o=i.data).errorKeys,a=o.keysVersion,u=new Map,null==a||a.forEach((function(e){u.set(e.key,e.version)})),e.entries.forEach((function(e){var t=e.key,r=u.get(t);r&&c(l,Dg,"f").set(t,{key:t,value:e.value,userId:l._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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return t=kg(!1,!1,!0),r=this._ctx.serverTime,n=gl.encode(Hs,{entry:e.keys.map((function(e){var n,i=c(u,Dg,"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(On.delKVS,this._chatroomId,n,Ys)];case 1:return(i=s.sent()).isOk||i.code===exports.ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS?(o=i.data.errorKeys,a=new Set,null==o||o.forEach((function(e){return a.add(e.key)})),e.keys.forEach((function(e){a.has(e)||c(u,Dg,"f").delete(e)})),[2,i.wipe()]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,Dg,"f").has(e)?c(this,Dg,"f").get(e).value:null}}),Object.defineProperty(r.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Array.from(c(this,Dg,"f").entries()).map((function(e){var t=u(e,2);return[t[0],t[1].value]}));return Object.fromEntries(e)}}),r}(or);Dg=new WeakMap,Ug=new WeakSet,xg=function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this._ctx.serverTime,o=c(this,Dg,"f").get(e.key),a=kg(!!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:a}},e.isSendNotification&&(u.type=exports.ConversationType.CHATROOM,u.bNotify=!0,u.notification={sessionId:fc(me.CHRM_KV_NOTIFY,!1,!1,!1),classname:me.CHRM_KV_NOTIFY,content:JSON.stringify({key:e.key,value:e.value,extra:e.notificationExtra,type:r?exports.ChatroomEntryType.DELETE:exports.ChatroomEntryType.UPDATE})}),l=gl.encode(Bs,u),[4,this._ctx.query(r?On.delKV:On.setKV,this._chatroomId,l)];case 1:return[2,s.sent().wipe()]}}))}))};var Hg,qg,Yg,Wg,Jg=function(e){function r(t,r,n,i){var o=e.call(this,"WebChatroomMessageReceiver")||this;return Object.defineProperty(o,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(o,"_chatroomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_handler",{enumerable:!0,configurable:!0,writable:!0,value:i}),jg.set(o,0),d(o,jg,n,"f"),o}return t(r,e),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,d,_,f=this;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx.logger,r=t.createTraceId(),n={chatroomId:this._chatroomId,version:e},t.info(B.L_PULL_CHATROOM_MSG_T,JSON.stringify(n),r),i=function(e,t){return gl.encode(Rs,{syncTime:e,count:t,compressioEnabled:dd.enable()})}(e,c(this,jg,"f")),[4,this._ctx.query(On.chrmPull,this._chatroomId,i,void 0)];case 1:return o=s.sent(),t.summary(B.L_PULL_CHATROOM_MSG_R,o,r,n),o.isOk?(a=this._ctx.currentUserId,u=ch(o.data.pbData),l=u.list,d=u.syncTime,l.length>0&&(_=l.map((function(e){return _c(e,a,!1,f._chatroomId)})),this._handler(_,this._chatroomId)),[2,ur({version:d})]):[2,o.wipe()]}}))}))}}),r}(or);jg=new WeakMap;var Kg,Qg,Xg,Zg,zg,$g,eE,tE,rE,nE,iE,oE,sE,aE,uE,lE=function(e){function r(t,r,n,i,o){var s=e.call(this)||this;return Hg.add(s),Object.defineProperty(s,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(s,"roomId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(s,"initCount",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(s,"extra",{enumerable:!0,configurable:!0,writable:!0,value:o}),qg.set(s,void 0),Yg.set(s,void 0),d(s,qg,new Jg(s._ctx,s.roomId,n,i),"f"),d(s,Yg,new Bg(s._ctx,s.roomId),"f"),s}return t(r,e),Object.defineProperty(r.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;c(this,qg,"f").setInitVersion(0),c(this,qg,"f").startInterval(e,!0),c(this,Hg,"a",Wg)&&(c(this,Yg,"f").setInitVersion(0),c(this,Yg,"f").startInterval(e,!0))}}),Object.defineProperty(r.prototype,"restartInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=18e4;this.stopInterval(),c(this,Yg,"f").startInterval(e,!0),c(this,qg,"f").startInterval(e,!0)}}),Object.defineProperty(r.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){c(this,qg,"f").stopInterval(),c(this,Yg,"f").stopInterval()}}),Object.defineProperty(r.prototype,"handleMessageNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,qg,"f").push(e)}}),Object.defineProperty(r.prototype,"handleKVNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){c(this,Yg,"f").push(e)}}),Object.defineProperty(r.prototype,"setEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,c(this,Yg,"f").setEntry(e,t)]}))}))}}),Object.defineProperty(r.prototype,"setEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,c(this,Yg,"f").setEntries(e)]}))}))}}),Object.defineProperty(r.prototype,"removeEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,c(this,Yg,"f").removeEntry(e,t)]}))}))}}),Object.defineProperty(r.prototype,"removeEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,c(this,Yg,"f").removeEntries(e)]}))}))}}),Object.defineProperty(r.prototype,"getEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return c(this,Yg,"f").getEntry(e)}}),Object.defineProperty(r.prototype,"getAllEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(){return c(this,Yg,"f").getAllEntries()}}),r}(ir);qg=new WeakMap,Yg=new WeakMap,Hg=new WeakSet,Wg=function(){var e;return!!(null===(e=this._ctx.getNaviInfoFromCache())||void 0===e?void 0:e.kvStorage)};var cE,dE,_E,fE,pE=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))}},hE=function(e){function r(t){var r=e.call(this)||this;return Kg.add(r),Object.defineProperty(r,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:t}),Qg.set(r,new Map),Object.defineProperty(r,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"setCheckChatRoomDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),r.logger=t.logger,r._ctx.on("onConnected",c(r,Kg,"m",zg),r),r._ctx.on("onDisconnected",c(r,Kg,"m",Xg),r),r._ctx.on("onSuspend",c(r,Kg,"m",Zg),r),r._ctx.on("sNtf",c(r,Kg,"m",tE),r),r._ctx.on("sCmd",c(r,Kg,"m",rE),r),r._ctx.on("syncMsg",c(r,Kg,"m",eE),r),r._ctx.on("sMsg",c(r,Kg,"m",$g),r),r}return t(r,e),Object.defineProperty(r.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o;return s(this,(function(s){switch(s.label){case 0:return[4,c(this,Kg,"m",oE).call(this,e,r,n)];case 1:return(i=s.sent()).isOk?((o=c(this,Qg,"f").get(e))||(o=new lE(this._ctx,e,t,c(this,Kg,"m",nE).bind(this),n),c(this,Qg,"f").set(e,o),o.startInterval()),[2,i.trans(pE)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return c(this,Qg,"f").get(e)?(c(this,Kg,"m",sE).call(this,e),r=gl.encode(Ts,{nothing:1,extra:t}),[4,this._ctx.query(On.exitChrm,e,r)]):[2,ur()];case 1:return[2,n.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=gl.encode(Ns,{count:t,order:r}),[4,this._ctx.query(On.queryChrmI,e,n,Ps)];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 o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,c(this,Kg,"m",aE).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 o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,c(this,Kg,"m",aE).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 o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,c(this,Kg,"m",aE).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 o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,c(this,Kg,"m",aE).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 o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return(r=c(this,Qg,"f").get(e))?null===(n=r.getEntry(t))?[2,lr(exports.ErrorCode.CHATROOM_KEY_NOT_EXIST)]:[2,ur(n)]:[4,c(this,Kg,"m",uE).call(this,e)];case 1:return[2,i.sent().tryTrans((function(e){var r=e[t];return void 0===r?lr(exports.ErrorCode.CHATROOM_KEY_NOT_EXIST):ur(r)}))]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=c(this,Qg,"f").get(e))?[2,ur(t.getAllEntries())]:[2,c(this,Kg,"m",uE).call(this,e)]}))}))}}),Object.defineProperty(r.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return i=hh({targetId:e,time:t,count:r,order:n}),o=this._ctx.currentUserId,[4,this._ctx.query(On.qryCHMsg,e,i)];case 1:return(a=s.sent()).isOk?(u=gh(a.data.pbData),[2,ur({hasMore:!!u.hasMsg,list:u.list.map((function(t){return _c(t,o,!1,e)}))})]):[2,a.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=gl.encode(Ca,{rtcRoomId:e.rtcRoomId}),[4,this._ctx.query(On.setRtcRoomId,e.chatRoomId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),r}(ir);Qg=new WeakMap,Kg=new WeakSet,Xg=function(){var e,t;try{for(var r=a(c(this,Qg,"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}}c(this,Qg,"f").clear()},Zg=function(){var e,t;try{for(var r=a(c(this,Qg,"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}}},zg=function(e,t){var r,n;if(t)try{for(var i=a(c(this,Qg,"f").values()),o=i.next();!o.done;o=i.next()){var s=o.value;c(this,Kg,"m",iE).call(this,s)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},$g=function(e,t){var r=t.conversationType,n=t.targetId;(t.messageType,r===exports.ConversationType.CHATROOM)&&(e.stopPropagation(),c(this,Qg,"f").get(n)&&c(this,Kg,"m",nE).call(this,[t],n))},eE=function(e,t){t.conversationType===exports.ConversationType.CHATROOM&&(e.stopPropagation(),this.emit("message",[t],t.targetId))},tE=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r){e.stopPropagation();var o=c(this,Qg,"f").get(n);o&&o.handleMessageNotify(i)}},rE=function(e,t){var r=t.type,n=t.chrmId,i=t.time;if(2===r||4===r){e.stopPropagation();var o=c(this,Qg,"f").get(n);if(o)return 4===r?(c(this,Qg,"f").delete(n),void this._ctx.emit("chatroom",{chatroomDestroyed:n})):void o.handleKVNotify(i)}},nE=function(e,t){var r=this,n=e.filter((function(e){var n,i=e.messageType;if(i===me.CHATROOM_MERGE_CHANGE){var o=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._ctx.emit("chatroom",{userChange:o}),!1}if(i===me.CHATROOM_MERGE_BAN){var s=function(e){var t=e.content;return{chatroomId:t.chatroomId,banType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return r._ctx.emit("chatroom",{chatroomNotifyBan:s}),!1}if(i===me.CHATROOM_SYNC_MSG){var a=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._ctx.emit("chatroom",{chatroomNotifyMultiLoginSync:a}),!1}if(i===me.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===exports.ChrmMemOperateType.Blocked&&(null===(n=null==u?void 0:u.userIdList)||void 0===n?void 0:n.includes(r._ctx.currentUserId))&&c(r,Kg,"m",sE).call(r,t),r._ctx.emit("chatroom",{chatroomNotifyBlock:u}),!1}return!0}));this.emit("message",n,t)},iE=function(e){return o(this,void 0,void 0,(function(){var t,r,i,o,a,u,l,d;return s(this,(function(s){switch(s.label){case 0:return t=e.roomId,r=e.extra,i=this.logger.createTraceId(),this.logger.info(B.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:t}),i),[4,c(this,Kg,"m",oE).call(this,t,!1,r)];case 1:return o=s.sent(),this.logger.summary(B.L_REJOIN_CHATROOM_R,o,i,{chatroomId:t}),a=o.code,u=o.isOk,l=o.data,u?(e.restartInterval(),d=pE(l),this._ctx.emit("chatroom",{rejoinedRoom:n(n({chatroomId:t},d),{count:e.initCount})}),[2]):(a!==exports.ErrorCode.RC_CHATROOM_USER_KICKED&&a!==exports.ErrorCode.RC_CHATROOM_NOT_EXIST||c(this,Qg,"f").delete(t),this._ctx.emit("chatroom",{rejoinedRoom:{chatroomId:t,errorCode:a}}),[2])}}))}))},oE=function(e,t,r){var n=gl.encode(Ts,{extra:r,nothing:1}),i=t?On.joinChrm:On.joinChrmR;return this._ctx.query(i,e,n,vs)},sE=function(e){var t=c(this,Qg,"f").get(e);t&&(t.stopInterval(),c(this,Qg,"f").delete(e))},aE=function(e){var t=c(this,Qg,"f").get(e);return t?ur(t):lr(exports.ErrorCode.NOT_IN_CHATROOM)},uE=function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return[4,this._ctx.query(On.pullKV,e,Th(0),void 0)];case 1:return(t=n.sent()).isOk?(r=vh(t.data.pbData).entries,[2,ur(r.reduce((function(e,t){return e[t.key]=t.value,e}),{}))]):[2,t.wipe()]}}))}))};var gE=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=Zo.localStorage,r=e.appkey,n=e.currentUserId,i=et(r,n),o=t.getItem(i)||"{}",s=JSON.parse(o);return{value:{value:{version:s.version||0,tags:s.tags||{},transLan:s.transLan||"zh",autoTrans:s.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,o=r.transLan;n[e.tagId]={tagName:e.tagName,createdTime:t},this.set("value",{version:t,tags:n,autoTrans:i,transLan:o})}}),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,o=r.transLan;delete n[e],this.set("value",{version:t,tags:n,autoTrans:i,transLan:o})}}),r}(Cd),EE=function(e){function r(t){var r=e.call(this,"UserSettings")||this;return cE.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}),dE.set(r,!1),r.storage=new gE,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),d(this,dE,!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(Nn(t.topic)===On.s_us){var r=gl.decode(ha,t.pbData).version;this.push(r),e.stopPropagation()}}}),Object.defineProperty(r.prototype,"_handleSyncData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l,d,_,f,p,h,g,E,b,T,v,R;return s(this,(function(s){switch(s.label){case 0:return t=this._ctx,r=t.currentUserId,n=t.logger,i=this._ctx.getNaviInfoFromCache(),o=n.createTraceId(),n.info(B.L_SYNC_USER_SETTINGS_T,"version: ".concat(e),o),a=gl.encode(Qs,{version:e,ipType:i.ipType||0}),[4,this._ctx.query(On.pullUS,r,a,Xs)];case 1:return u=s.sent(),n.summary(B.L_SYNC_USER_SETTINGS_R,u,o),u.isOk?(l=u.data,d=l.version,_=l.items,f=!1,p=!1,h=!1,g="",E=this.storage.get("value"),b=E.transLan,T=E.autoTrans,v=E.tags,R={version:d,transLan:b,autoTrans:T,tags:v},null==_||_.forEach((function(e){var t=e.key,r=e.value;switch(t){case"Tag":R.tags={},e.tags.forEach((function(e){R.tags[e.tagId]={tagName:e.name,createdTime:e.createdTime}})),f=!0;break;case"transLan":h=!0,R.transLan=ji.readUTF(new Uint8Array(r));break;case"autoTrans":p=!0,R.autoTrans="1"===ji.readUTF(new Uint8Array(r));break;case"VoipInfo":g=ji.readUTF(new Uint8Array(r))}})),this.storage.set("value",R),f&&this.emit("tagsChanged"),h&&this.emit("userSettingsChanged",{key:Ur.TranslationLanguage,value:R.transLan}),p&&this.emit("userSettingsChanged",{key:Ur.AutoTranslateEnable,value:R.autoTrans}),g&&this.emit("voipInfoChanged",g),c(this,cE,"m",_E).call(this,u.code),[2,ur({version:d})]):(c(this,cE,"m",_E).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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=gl.encode(fa,{version:t,tags:[{tagId:e.tagId,name:e.tagName}],ignoreVersion:!0}),[4,this._ctx.query(On.addSeTag,r,n,Ks)];case 1:return(i=s.sent()).isOk&&(o=i.data,a=o.version,u=o.updateVersion,this.storage.addTag(e,u?a:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=this.storage.version,r=this._ctx.currentUserId,n=gl.encode(pa,{version:t,tags:[{tagId:e}],ignoreVersion:!0}),[4,this._ctx.query(On.delSeTag,r,n,Ks)];case 1:return(i=s.sent()).isOk&&(o=i.data,a=o.version,u=o.updateVersion,this.storage.deleteTag(e,u?a:t)),[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,c(this,cE,"m",fE).call(this,On.transLan,e)]}))}))}}),Object.defineProperty(r.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ur(this.storage.get("value").transLan||"zh")]}))}))}}),Object.defineProperty(r.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,c(this,cE,"m",fE).call(this,On.autoTrans,e?"1":"0")]}))}))}}),Object.defineProperty(r.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ur(this.storage.get("value").autoTrans)]}))}))}}),r}(or);dE=new WeakMap,cE=new WeakSet,_E=function(e){c(this,dE,"f")&&(d(this,dE,!1,"f"),this.emit("userSettingsSynced",e))},fE=function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,_,f,p,h;return s(this,(function(s){switch(s.label){case 0:return r=this.storage.version,n=this._ctx.currentUserId,i=gl.encode(Js,{version:r,value:t,ignoreVersion:!0}),[4,this._ctx.query(e,n,i,Ks)];case 1:if((o=s.sent()).isOk){switch(a=o.data,u=a.version,l=a.updateVersion,c=this.storage.get("value"),d=c.transLan,_=c.autoTrans,f=c.tags,p=c.version,h={version:l?u:p,transLan:d,autoTrans:_,tags:f},e){case On.transLan:h.transLan=t;break;case On.autoTrans:h.autoTrans="1"===t}this.storage.set("value",h)}return[2,o.wipe()]}}))}))};var bE,TE=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}},vE=function(e){var t,r,n=e.targetId,i=e.settingProfile,o=e.extProfile,s=e.baseInfo,a=e.userInfo,u=kt(i||[]),l=kt(o||[]);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==s?void 0:s.creatorId)||"",ownerId:(null==s?void 0:s.ownerId)||"",createTime:(null==s?void 0:s.createTime)||0,membersCount:(null==s?void 0:s.memberCount)||0,remark:null!==(t=null==a?void 0:a.remarkName)&&void 0!==t?t:"",joinedTime:(null==a?void 0:a.joinTime)||0,role:null!==(r=null==a?void 0:a.role)&&void 0!==r?r:exports.GroupMemberRole.UNDEF}},RE=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:Rg}),Object.defineProperty(this,"searchGroupMembers",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(this,"searchJoinedGroups",{enumerable:!0,configurable:!0,writable:!0,value:Rg})}return Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=gl.encode(Za,{permission:e}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=gl.encode(Xa,{nothing:1}),[4,this.ctx.query(On.qProfilePermiss,this.ctx.currentUserId,e,Za)];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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=gl.encode(za,{uniqueId:e}),[4,this.ctx.query(On.searchUserProfile,this.ctx.currentUserId,t,Wa)];case 1:return(r=s.sent()).isOk?(n=r.data,i=n.userId,o=n.userProfile,a=n.userExtProfile,u=Pt(i,o,a),[2,ur(u)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return i=Zp(e,t,r,n),[4,this.ctx.query(On.channelCreate,e,i,void 0)];case 1:return(o=s.sent()).isOk||!o.data?[2,o.wipe()]:(a=gl.decode(eu,o.data.pbData),u={errorKeys:a.censorFailedFields,processCode:a.processCode||0},[2,lr(o.code,o.msg,u)])}}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=Zp(e,t,r),[4,this.ctx.query(On.upChannelInfo,e,n,void 0)];case 1:return(i=s.sent()).isOk||!i.data?[2,i.wipe()]:(o=gl.decode(eu,i.data.pbData),[2,lr(i.code,i.msg,{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n;return s(this,(function(i){switch(i.label){case 0:return t=gl.encode(tu,{type:exports.ConversationType.GROUP,list:e.map((function(e){return{targetId:e}}))}),[4,this.ctx.query(On.qChannelInfo,e[0],t,iu)];case 1:return(r=i.sent()).isOk?(n=ph(r.data).list,[2,ur(n.map(vE))]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=yh({targetId:e,users:t,settingInfo:{isQuit:!0,isDelBan:r.removeMuteStatus,isDelAttention:r.removeFollow,isDelWhite:r.removeWhiteList}}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=yh({targetId:e,settingInfo:{isQuit:!0,isDelBan:t.removeMuteStatus,isDelAttention:t.removeFollow,isDelWhite:t.removeWhiteList}}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=yh({targetId:e}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var i;return s(this,(function(o){switch(o.label){case 0:return i=yh({targetId:e,settingInfo:{isQuit:r,isDelBan:n.removeMuteStatus,isDelAttention:n.removeFollow,isDelWhite:n.removeWhiteList},users:[t]}),[4,this.ctx.query(On.channelTransfer,e,i)];case 1:return[2,o.sent().wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=gl.encode(ru,{targetId:t,type:exports.ConversationType.GROUP,users:r,operateType:e}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=gl.encode(ru,{targetId:t,type:exports.ConversationType.GROUP,users:r,operateType:e}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return t=Ih({targetId:e}),[4,this.ctx.query(On.qChannelFollow,e,t,iu)];case 1:return(r=o.sent()).isOk?(n=ph(r.data).list,i=n.map((function(e){return{userId:e.userId,time:e.opTime}})),[2,ur(i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=mh({targetId:e,operateType:t?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE,channelNickName:t}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return n=gl.encode(du,{targetId:e,type:t,info:r}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=gl.encode(_u,{targetId:e,type:t}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=gl.encode(du,{targetId:e,type:1}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=gl.encode(du,{targetId:e,type:2,info:t}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=gl.encode(pu,{targetId:e,remarkName:t,extProfile:Object.entries(r).map((function(e){var t=u(e,2);return{key:t[0],value:t[1]}}))}),[4,this.ctx.query(On.friendSetPf,this.ctx.currentUserId,n,void 0)];case 1:return(i=s.sent()).isOk||!i.data?[2,i.wipe()]:(o=gl.decode(hu,i.data.pbData),[2,lr(i.code,"",{errorKeys:o.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=gl.encode(_u,{targetId:e,type:t}),[4,this.ctx.query(On.friendCheck,this.ctx.currentUserId,r,fu)];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 o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=gl.encode(gu,{queryType:11,friendType:e,page:{size:t.count,order:t.order?0:1,pageToken:t.pageToken}}),[4,this.ctx.query(On.friendsQuery,this.ctx.currentUserId,r,iu)];case 1:return(n=s.sent()).isOk?(i=n.data.page,o=i.pageToken,a=i.hasNext,u=ph(n.data).list,l={pageToken:a&&o?o:"",data:u.map(TE)},[2,ur(l)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=gl.encode(gu,{queryType:12,page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query(On.friendsQuery,this.ctx.currentUserId,t,iu)];case 1:return(r=s.sent()).isOk?(n=r.data.page,i=n.pageToken,o=n.hasNext,a=ph(r.data).list,u={pageToken:o&&i?i:"",data:a.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,ur(u)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=gl.encode(Eu,{targetId:e}),[4,this.ctx.query(On.friendsInfoQry,this.ctx.currentUserId,t,Tu)];case 1:return[2,r.sent().trans((function(e){return e.list.map(TE)}))]}}))}))}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=gl.encode(bu,{level:e}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return e=this.ctx.currentUserId,t=gl.encode(du,{targetId:e}),[4,this.ctx.query(On.friendAuthGet,e,t,bu)];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 o(this,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return r=Ih({targetId:e,ids:t}),[4,this.ctx.query(On.qChannelSpeMem,e,r,iu)];case 1:return(n=s.sent()).isOk?(i=ph(n.data).list,o=i.map(Vt),[2,ur(o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return i=mh({targetId:e,userId:t,channelNickName:r,additional:n}),[4,this.ctx.query(On.upChannelMem,e,i,void 0)];case 1:return(o=s.sent()).isOk||!o.data?[2,o.wipe()]:(a=gl.decode(eu,o.data.pbData),[2,lr(o.code,o.msg,{errorKeys:a.censorFailedFields})])}}))}))}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o,a,u,l,c;return s(this,(function(s){switch(s.label){case 0:return n=Ih({targetId:e,roleType:t,botType:r.filterRobotType,page:{size:r.count,order:r.order?0:1,pageToken:r.pageToken}}),[4,this.ctx.query(On.qChannelMem,e,n,iu)];case 1:return(i=s.sent()).isOk?(o=i.data.page,a=o.pageToken,u=o.hasNext,l=ph(i.data).list,c={pageToken:u&&a?a:"",data:l.map(Vt)},[2,ur(c)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=gl.encode(cu,{targetId:e,type:exports.ConversationType.GROUP}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=gl.encode(cu,{targetId:e,type:exports.ConversationType.GROUP,userIds:t}),[4,this.ctx.query(On.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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=e.groupId,r=e.inviterId,n=e.optType,i=e.optResult,o=e.joinUserId,a=e.reason,u=gl.encode(lu,{targetId:t,type:exports.ConversationType.GROUP,optType:n,optResult:i,inviterId:r,joinUserId:o,detail:a}),[4,this.ctx.query(On.channelApplyResp,t,u,eu)];case 1:return[2,s.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 o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return t=Ih({page:{size:e.count,pageToken:e.pageToken,order:e.order?0:1}}),[4,this.ctx.query(On.qChannelApplyList,this.ctx.currentUserId,t,iu)];case 1:return(r=s.sent()).isOk?(n=ph(r.data),i=n.pageToken,o=n.hasNext,a=n.list,u=a.map(jt),[2,ur({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 o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return r=Ih({roleType:e,page:{size:t.count,pageToken:t.pageToken,order:t.order?1:0}}),[4,this.ctx.query(On.qChannelMemJoin,this.ctx.currentUserId,r,iu)];case 1:return(n=s.sent()).isOk?(i=n.data.page,o=i.pageToken,a=i.hasNext,u=ph(n.data).list,l=u.map(vE),[2,ur({data:l,pageToken:a&&o?o:""})]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return t=gl.encode(nu,{type:exports.ConversationType.GROUP,ids:e}),[4,this.ctx.query(On.qChannelMemSpeJoin,this.ctx.currentUserId,t,iu)];case 1:return(r=o.sent()).isOk?(n=ph(r.data).list,i=n.map(vE),[2,ur(i)]):[2,r.wipe()]}}))}))}}),e}(),IE=((bE={})[exports.ConversationType.PRIVATE]=On.qryPMsg,bE[exports.ConversationType.GROUP]=On.qryGMsg,bE[exports.ConversationType.CHATROOM]=On.qryCHMsg,bE[exports.ConversationType.CUSTOMER_SERVICE]=On.qryCMsg,bE[exports.ConversationType.SYSTEM]=On.qrySMsg,bE[exports.ConversationType.APP_PUBLIC_SERVICE]=On.qryMCMsg,bE[exports.ConversationType.PUBLIC_SERVICE]=On.qryMPMsg,bE[exports.ConversationType.ULTRA_GROUP]=On.qryUgMsg,bE),mE=function(e,t,r,n,i,o){var s=dn(t.messageType),a=s.isCounted,u=s.isPersited,l=s.isStatusMessage;return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:i,messageDirection:exports.MessageDirection.SEND,isCounted:a,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:exports.ReceivedStatus.UNREAD,receivedStatusInfo:Ct(exports.ReceivedStatus.UNREAD),pushConfig:t.pushConfig,isInterrupt:t.isInterrupt,messageId:o||0,sentStatus:exports.SentStatus.SENT,directedUserIds:t.directionalUserIdList,disableUpdateLastMessage:t.disableUpdateLastMessage,needReceipt:t.needReceipt}},yE=[L.GROUP_OPERATION,L.GROUP_PROFILE_CHANGE,L.GROUP_APPLICATION_INVITATION,L.GROUP_FOLLOW_USER_CHANGE],AE=[b.FRIEND_APPLICATION];function SE(){return function(e,t,r){var n=r.value;return r.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._isConnected?[2,n.apply(this,e)]:[2,Promise.resolve(lr(exports.ErrorCode.RC_NET_UNAVAILABLE))]}))}))},r}}var OE,CE=function(e){function r(t,r){var n=this,i=r.loggerProxy?r.loggerProxy:td();n=e.call(this,t,r,new Fc(r.appkey,"IMLib","IM",i))||this,d.add(n),Object.defineProperty(n,"_connMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_ctx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_sendMessageStore",{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,"_readReceiptManager",{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,"_reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(n,"_pullOfflineFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(n,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"reporterStatistic",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(n,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(n,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),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,"_loggerProxy",{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,i=t.messageType;if(e.conversationType,i===me.SYNC_READ_STATUS&&(t.directionalUserIdList=tr(e.conversationType,[n.currentUserId])),i===me.READ_RECEIPT_RESPONSE){if(!t.content.receiptMessageDic||0===Object.keys(t.content.receiptMessageDic).length){var o=null===(r=n._readReceiptManager)||void 0===r?void 0:r.getReceiptMessageDic(e);t.content.receiptMessageDic=o||{}}for(var s in t.directionalUserIdList=[],t.content.receiptMessageDic)t.directionalUserIdList.push(s)}return t}}),Object.defineProperty(n,"_ultraMsgMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(n,"setProxy",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"getProxy",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"testProxy",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"setUserStatusListener",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"setUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"subscribeUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"getUserStatus",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"addToBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"removeFromBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"getBlacklist",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"getBlacklistStatus",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"insertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"batchInsertMessage",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"getLocalMessageCount",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"deleteLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"deleteLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"batchClearLocalMessagesByTimestamp",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"clearLocalMessages",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"getMessage",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"setMessageContent",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"setMessageSearchField",{enumerable:!0,configurable:!0,writable:!0,value:vg}),Object.defineProperty(n,"searchConversationByContentWithAllChannel",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"searchMessagesWithParams",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"setMessageSentStatus",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"updateMessageReceiptStatus",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"setMessageReceivedStatus",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"clearLocalData",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),Object.defineProperty(n,"setCheckDuplicateMessage",{enumerable:!0,configurable:!0,writable:!0,value:Rg}),n._loggerProxy=i;var o=r.appkey,s=r.logOutputLevel,a=r.logExpireTime,u=r.navigators,l=r.areaCode,b=r.logServerUrl,T=r.miniCMPProxy,m=r.environment,y=r.useNaviV2,A=void 0!==y&&y,S=r.enableReadReceiptStorage;n._environment=m||"default",n._enableReadReceiptStorage=S,n.logger.setOutputLevel(s),jr.init({areaCode:l,navigators:u,logServerUrl:b,miniCMPProxy:T}),r.loggerProxy||Qc(o,n.logger,a),n.reporter=new Rd(o,n.logger,n._loggerProxy),n.navi=new Oc(o,n.logger,new wc(o,n.logger),n._environment,A),n.reporterStatistic=new Id(o,n.logger,n._loggerProxy),n._sendMessageStore=new Cc(o);var O=n._connMgr=new jc(o,n.navi,n.logger),C=n._ctx=new Vg(n._appkey,O,n.navi,n.logger);return n._connMgr.pipe(C),"browser"===Zo.tag&&n._initCloudController(),n._userSettings=new EE(C),n._chat=new yg(C,n._userSettings),n._chatroom=new hE(C),n._dataHosting=new RE(C),n._chatroom.on("message",n._handleChatroomMessages,n),C.on("conversationStatusChanged",n._conversationStatusChanged,n),C.on("sCmd",n._handleSCmdNotify,n),C.on("signal",n._handleSignal,n),C.on("onConnected",n.onConnected,n),C.on("onDisconnected",n.onDisconnected,n),C.on("onConnecting",n.onConnecting,n),C.on("onSuspend",n.onSuspend,n),C.on("ultraGroupEnable",n._handleUltraGroupEnable,n),C.on("messagesFromUG",n._handleMessagesFromUltraGroup,n),C.on("messagesFromSG",n._handleMessagesFromSignalGroup,n),C.on("smsgFromSignalGroup",n._handleSmsgFromSignalGroup,n),C.on("syncMsg",n._handleSyncMsg,n),C.on("sgRelationsSynced",n._handleSGRelationsSynced,n),C.on("serverEvent",c(n,d,"m",I),n),C.on("readReceiptResponseV5",c(n,d,"m",f),n),C.on("speechToTextResponse",c(n,d,"m",p),n),C.on("ugUserGroupChanged",n._handleUserGroupStatus,n),C.on("ugChannelChanged",n._handleUltraChannelChange,n),C.on("conversationStatusSynced",(function(e,t){return n._watcher.conversationStatusSynced(t)}),n),C.on("messageModified",c(n,d,"m",h),n),C.on("messageModifiedSyncCompleted",c(n,d,"m",g),n),C.on("ugMsgExpansionUpdated",c(n,d,"m",E),n),C.on("ugMsgRecalled",c(n,d,"m",v),n),C.on("conversation",c(n,d,"m",R),n),C.on("chatroom",n._handlerChatroomEvent,n),C.on("robotsSynced",c(n,d,"m",_),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}var d,_,f,p,h,g,E,v,R,I,m,y;return t(r,e),Object.defineProperty(r.prototype,"chat",{get:function(){return this._chat},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"chatroom",{get:function(){return this._chatroom},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"userSettings",{get:function(){return this._userSettings},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dataHosting",{get:function(){return this._dataHosting},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"usingCppEngine",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;e=u(jr.getCloudControllerUrl(),1),this.cloudControllerUri=e[0],this.cloudController=new kc(this._appkey,this.logger,this.reporter),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Zr.init)}}),Object.defineProperty(r.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.navi.getNaviInfoFromCache(this._connMgr.getToken());this._pullOfflineFinished=!1,this._readReceiptManager||(this._readReceiptManager=new Mc(this._appkey,this.currentUserId,this._connMgr.getDelayTime())),this._initSubscribeManager(r),this._sendMessageStore.init(this.currentUserId),this._openCallPlus&&this._syncCallPullKVMsg(),this._watcher.onConnected(),this.reporter.checkStart(r),this.reporterStatistic.checkStart(r)}}),Object.defineProperty(r.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._resetMemoryState(),this._watcher.onDisconnected(t)}}),Object.defineProperty(r.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.onSuspend(t)}}),Object.defineProperty(r.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.onConnecting()}}),Object.defineProperty(r.prototype,"_conversationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.conversation(t);var r=t.some((function(e){var t;return void 0!==(null===(t=e.updatedItems)||void 0===t?void 0:t.tags)}));r&&this._watcher.conversationTag()}}),Object.defineProperty(r.prototype,"_initSubscribeManager",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(e.subDriven||e.userProfile)&&(this._subscribeManager||(this._subscribeManager=new Lc(this._connMgr,{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._connMgr.getDelayTime(),this.logger,!!e.userProfile,e.subDriven||0)),this._subscribeManager.syncData())}}),Object.defineProperty(r.prototype,"createLogger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return new Fc(this._appkey,e,t,this._loggerProxy)}}),Object.defineProperty(r.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(r.prototype,"naviInfo",{get:function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectedTime",{get:function(){return this._connMgr.getConnectedTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connectionStatus",{get:function(){return this._connMgr.getConnectionStatus()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return this._openCallPlus=r,[2,this._connMgr.connect(e,t,r,n)]}))}))}}),Object.defineProperty(r.prototype,"_handleUltraGroupEnable",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._watcher.ultraGroupEnable()}}),Object.defineProperty(r.prototype,"_handleSGRelationsSynced",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.sgRelationsSynced(t)}}),Object.defineProperty(r.prototype,"_handleMessagesFromUltraGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=new Map,o=[];t.forEach((function(e){var t,r,s,a=e.targetId,u=e.content,l=e.messageUId,c=e.channelId,d=e.isMentioned,_=e.isCounted,f=e.senderUserId,p=e.messageType,h=e.sentTime,g=e.channelType,E=e.isPersited;if(n._ultraMsgMap[l])delete n._ultraMsgMap[l];else{var b={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:a,channelId:c||""},T=n._chat.storage.getOrCreateModel(b,!0),v=i.get(T)||{params:{channelType:g},time:h};i.set(T,v),v.time=h;var R=v.params;if(E&&(R.hidden=!1,R.latestMessage=e,R.operationTime=h),_&&f!==n.currentUserId&&p!==me.RECALL_NOTIFICATION_MESSAGE){R.unreadCount=(R.unreadCount||T.unreadCount)+1;var I=(null===(t=null==u?void 0:u.mentionedInfo)||void 0===t?void 0:t.type)===exports.MentionedType.ALL;d&&(I||(null===(s=null===(r=null==u?void 0:u.mentionedInfo)||void 0===r?void 0:r.userIdList)||void 0===s?void 0:s.includes(n.currentUserId)))&&(R.unreadMentionedCount=(R.unreadMentionedCount||T.unreadMentionedCount)+1,I||(R.unreadMentionedMeCount=(R.unreadMentionedMeCount||T.unreadMentionedMeCount)+1),R.hasMentioned=!0,R.mentionedInfo=null==u?void 0:u.mentionedInfo),T.firstUnreadMessage||R.firstUnreadMessageUId||(R.firstUnreadMessageType=p,R.firstUnreadMessageUId=l,R.firstUnreadTime=h)}o.push(e)}}));var s=[],a=[];Array.from(i.entries()).forEach((function(e){var t=u(e,2),r=t[0],n=t[1],i=n.params,o=n.time;s.push(r);var l=r.updateAttrs(i,o);l&&a.push({conversation:r.toIReceivedConversation(),updatedItems:l})})),this._chat.storage.updateConversationStorage(s),a.length>0&&this._watcher.conversation(a),this._batchMessage(o)}}),Object.defineProperty(r.prototype,"_handleChatroomMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=this._connMgr.getConnectedTime(),o=[];if(t.forEach((function(e){e.sentTime>=i&&n._writeMessagesLog(exports.ConversationType.CHATROOM,e.messageUId)&&o.push(e.messageUId)})),o.length>0){var s=Date.now();this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:s,server_deltatime:s-this._connMgr.getCrtServerTime(),msg_ids:o.join(",")}))}this._watcher.batchMessage(t)}}),Object.defineProperty(r.prototype,"_handlerChatroomEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._watcher.chatroom(t)}}),Object.defineProperty(r.prototype,"_handleMessagesFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=this._messageProcessor(t),o=i.newOutboxTime;i.messageUIds;var s=i.messages,a=i.messageExpansionList,u=i.RSMsgList,l=i.msgUIds2Statistic;l.length>0&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:l.join(",")})),this._batchMessage(s),a.forEach((function(e){n._receiveMessageExpansion(e)})),u.forEach((function(e){n._processRSMsg(e)})),this._sendMessageStore.removeByTimestamp(o),r&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this.logger.info(B.L_PULL_OFFLINE_MESSAGE_FINISHED_S),this._watcher.pullFinished(),this._chat.startPullModifyMsg())}}),Object.defineProperty(r.prototype,"_handleSignal",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=t.syncMsg,o=t.topic;if(i)this._receiveSyncMsg(t,r);else switch(Nn(o)){case On.rtc_ntf:this._receiveRtcKv(t.pbData);break;case On.s_opNtf:this._pullOperateStatusNotify(t);break;case On.s_pubCall:this._pubCallInfo(t);break;case On.s_stat:null===(n=this._subscribeManager)||void 0===n||n.updateUserStatus(t)}}}),Object.defineProperty(r.prototype,"_handleSCmdNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n,i,o=t.time;switch(t.type){case 8:null===(r=this._subscribeManager)||void 0===r||r.startsyncSubscribeUserStatus(o);break;case 9:null===(n=this._subscribeManager)||void 0===n||n.startSyncSubscribeRelationship(o);break;case 10:null===(i=this._subscribeManager)||void 0===i||i.syncOwnProfile(!0)}}}),Object.defineProperty(r.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,o=e.targetId,s=t.put,a=t.del,u=t.mid;s&&this._watcher.expansion({updatedExpansion:{messageUId:u,expansion:s,channelId:n,conversationType:i,targetId:o}}),a&&this._watcher.expansion({deletedExpansion:{messageUId:u,deletedKeys:a,channelId:n,conversationType:i,targetId:o}})}}),Object.defineProperty(r.prototype,"_clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this._chat.storage.clearConversationUnreadCount({conversationType:e,targetId:t,channelId:r},i);n&&o&&this._watcher.conversation([o])}}),Object.defineProperty(r.prototype,"_setConversationCacheByMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.isPersited,i=e.targetId,o=e.channelId,s=e.sentTime,a=e.disableUpdateLastMessage,u=e.senderUserId,l=e.messageType,c=e.isCounted,d=e.messageUId,_=e.content,f=e.isMentioned;if(te(t,W)){var p=this.naviInfo,h=this._chat.storage.getOrCreateModel({conversationType:t,targetId:i,channelId:o},!0),g={},E=u===this.currentUserId,b=l===me.RECALL,T=h.lastReadTime>s;if(c&&!Ec(p).isOk&&!b&&!E&&!T&&(0===h.unreadCount&&(g.firstUnreadMessageUId=d,g.firstUnreadTime=s,g.firstUnreadMessageType=l),g.unreadCount=h.unreadCount+1,f&&bt(_)&&_.mentionedInfo)){g.hasMentioned=!0,g.mentionedInfo=_.mentionedInfo;var v=_.mentionedInfo,R=v.type,I=v.userIdList;(R===exports.MentionedType.ALL||(I||[]).includes(this.currentUserId))&&(g.unreadMentionedCount=h.unreadMentionedCount+1)}if(b&&bt(_)&&!E){var m=_,y=m.sentTime,A=m.messageUId;!this._ctx.userStorage.recallMsgMap.has(A)&&h.unreadCount>0&&y>h.lastReadTime&&(this._ctx.userStorage.recallMsgMap.add(A),g.unreadCount=h.unreadCount-1,0===h.unreadCount&&(g.firstUnreadMessageUId="",g.firstUnreadTime=0,g.firstUnreadMessageType=""))}if(r){b&&!h.hidden||(g.operationTime=s),g.hidden=!1;var S=b?_.sentTime:s;a||h.latestMessage&&!(h.latestMessage.sentTime<=S)||(g.latestMessage=p.supportRecallRefactor&&b?gc(e,!0):e)}if(this._ctx.includeUg&&l===me.EXPANSION_NOTIFY&&h.latestMessage&&h.latestMessage.messageUId===d){var O=_,C=O.put,N=O.del;O.clear?h.latestMessage.expansion={}:C?h.latestMessage.expansion=n(n({},h.latestMessage.expansion),C):N&&h.latestMessage.expansion&&N.forEach((function(e){delete h.latestMessage.expansion[e]}))}var P=h.updateAttrs(g,e.sentTime);this._chat.storage.updateConversationStorage([h]),P&&r&&!a&&this._watcher.conversation([{conversation:h.toIReceivedConversation(),updatedItems:P}])}}}),Object.defineProperty(r.prototype,"_receiveSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;switch(Nn(e.topic)){case On.updRTime:this._receivesyncReadStatus(e);break;case On.updUserSub:null===(r=this._subscribeManager)||void 0===r||r.startSyncSubscribeRelationship(t.timestamp)}}}),Object.defineProperty(r.prototype,"_batchMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,r=[],n=[],i=[],o=e.length-1;o>=0;o-=1){var s=e[o];s.messageType===me.LOG_COMMAND&&s.senderUserId===He?n.unshift(s):s.messageType===me.CLOUD_CONTROL&&s.senderUserId===He?i.push(s):r.unshift(s)}this._watcher.batchMessage(r),n.forEach((function(e){var r=e.content,n=r.startTime,i=r.endTime,o=r.platform,s=r.logId,a=r.uri;t.reporter.report(parseInt(n,10),parseInt(i,10),o,a,s,e.messageUId)})),i.length>0&&this._ccMsgHandler(i)}}),Object.defineProperty(r.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return e.shift()?(r=this._connMgr.getToken(),[4,null===(t=this.cloudController)||void 0===t?void 0:t.request(this.cloudControllerUri,Zr.other,r)]):[3,2];case 1:n=o.sent()||0,(i=e.filter((function(e){return e.sentTime>n}))).length>0&&this._ccMsgHandler(i),o.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(r.prototype,"_pubCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=gl.decode(Pa,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(r.prototype,"_receivesyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=gl.decode(Ds,e.pbData),r=t.type,n=t.channelId,i=t.msgTime,o=t.busChannel;this._clearConversationUnreadCount(r,n,o||"",!0,i),this._watcher.syncReadStatus({conversationType:r,targetId:n,channelId:o,timestamp:i})}}),Object.defineProperty(r.prototype,"_syncCallPullKVMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r,n;return s(this,(function(i){switch(i.label){case 0:return this._isConnected?(e=gl.encode(La,{syncTime:this._latestPullKVMsgTimestamp}),[4,this._connMgr.query(On.pullKvMsg,this.currentUserId,e,Ma)]):[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(r.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===exports.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_filterMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType;return t===me.DELIVERED||t===me.DELIVERED_MSG||t===me.SYNC_READ_STATUS&&!this._processSRSMsg(e)}}),Object.defineProperty(r.prototype,"_messageProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=0,n=[],i=[],o=[],s=[],a=[];return e.forEach((function(e){var u=e.conversationType,l=e.targetId,c=e.channelId,d=e.messageDirection,_=e.messageUId,f=e.messageType,p=e.sentTime,h=e.senderUserId,g=e.content;if(n.push(_),d===exports.MessageDirection.SEND){r=Math.max(p,r);var E=t._sendMessageStore.getSendMessageMap(),b=f===me.RECALL?"Cmd:".concat(g.messageUId):_;if(E[b])return void t._sendMessageStore.removeByUID(b)}if(!t._filterMessage(e)){switch(p>=t._connMgr.getConnectedTime()&&t._writeMessagesLog(u,_)&&a.push(_),f){case me.EXPANSION_NOTIFY:return void o.push(e);case me.READ_RECEIPT:h===t.currentUserId&&t._clearConversationUnreadCount(u,l,c,!0,p);break;case me.READ_STATE:return void s.push(e);case me.READ_RECEIPT_REQUEST:t._enableReadReceiptStorage&&t._processRRReqMsg(e);break;case me.READ_RECEIPT_RESPONSE:t._enableReadReceiptStorage&&t._processRRRspMsg(e)}t._setConversationCacheByMessage(e),i.push(e)}})),{newOutboxTime:r,messageUIds:n,messages:i,messageExpansionList:o,RSMsgList:s,msgUIds2Statistic:a}}}),Object.defineProperty(r.prototype,"_processSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=e.content,o=e.senderUserId,s=e.sentTime;if(o!==this.currentUserId)return!1;var a=this.naviInfo;return this._clearConversationUnreadCount(t,r,n,!0,s),1!==a.sesDriven||(s>this.connectedTime||this._watcher.syncReadStatus({conversationType:t,targetId:r,channelId:n,timestamp:i.lastMessageSendTime}),!1)}}),Object.defineProperty(r.prototype,"_processRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,i=e.channelId,o=e.content,s={conversationType:t,targetId:r,channelId:i};this._watcher.messageReadReceipt(t===exports.ConversationType.PRIVATE?{privateReadReceipt:n(n({},s),{endMsgTime:o.endMsgTime})}:{groupReadReceipt:n(n({},s),{totalCount:o.tmn,readedCount:o.rrn,messageUId:o.msgId})})}}),Object.defineProperty(r.prototype,"_processRRReqMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.conversationType,n=e.channelId,i=e.targetId,o=e.content,s=e.sentTime,a=e.messageDirection,u=e.senderUserId;null===(t=this._readReceiptManager)||void 0===t||t.insert({conversationType:r,channelId:n,targetId:i},o.messageUId,a,s,u)}}),Object.defineProperty(r.prototype,"_processRRRspMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i=this,o=e.conversationType,s=e.channelId,u=e.targetId,l=e.content,c=e.senderUserId,d=l.receiptMessageDic,_=void 0===d?{}:d;if(c===this.currentUserId)for(var f in _){var p=_[f];try{for(var h=(t=void 0,a(p)),g=h.next();!g.done;g=h.next()){var E=g.value;null===(n=this._readReceiptManager)||void 0===n||n.remove({conversationType:o,channelId:s,targetId:u},E)}}catch(e){t={error:e}}finally{try{g&&!g.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}}else(_[this.currentUserId]||[]).forEach((function(e){var t;null===(t=i._readReceiptManager)||void 0===t||t.addReadedUser({conversationType:o,channelId:s,targetId:u},e,c)}))}}),Object.defineProperty(r.prototype,"_handleSmsgFromSignalGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=t.conversationType,n=t.senderUserId,i=t.messageUId,o=t.sentTime;this._writeMessagesLog(r,i)&&this.logger.record(ve.IM_MSG_RECEIVE,JSON.stringify({client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),msg_ids:i})),n!==this.currentUserId||t.isStatusMessage||this._sendMessageStore.setMessage(i,o),this._handleNotNotifyMsg(t)||(this._handleReadReceiptStorage(t),this._setConversationCacheByMessage(t),this._batchMessage([t]))}}),Object.defineProperty(r.prototype,"_handleReadReceiptStorage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._enableReadReceiptStorage){var t=e.messageType;t===me.READ_RECEIPT_REQUEST&&this._processRRReqMsg(e),t===me.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(e)}}}),Object.defineProperty(r.prototype,"_handleSyncMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._sendMessageStore.setMessage(t.messageUId,t.sentTime),this.logger.info(B.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),t.messageType!==me.EXPANSION_NOTIFY?((t.messageType===me.SYNC_READ_STATUS||t.messageType===me.READ_RECEIPT&&t.senderUserId===this.currentUserId)&&this._clearConversationUnreadCount(t.conversationType,t.targetId,t.channelId,!0,t.sentTime),t.messageType===me.READ_RECEIPT_REQUEST&&this._processRRReqMsg(t),t.messageType===me.READ_RECEIPT_RESPONSE&&this._processRRRspMsg(t),this._setConversationCacheByMessage(t),this._batchMessage([t])):this._receiveMessageExpansion(t)}}),Object.defineProperty(r.prototype,"_handleNotNotifyMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.messageType,r=e.senderUserId;return t===me.DELIVERED||(t===me.DELIVERED_MSG||(t===me.EXPANSION_NOTIFY?(this._receiveMessageExpansion(e),!0):t===me.SYNC_READ_STATUS&&r!==this.currentUserId||t===me.READ_STATE&&(this._processRSMsg(e),!0)))}}),Object.defineProperty(r.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,_,f,p,h,g=this;return s(this,(function(s){switch(s.label){case 0:return r=e.conversationType,n=e.targetId,i=e.channelId,o=t.timestamp,a=t.count,u=t.order,l=IE[r],c=this.currentUserId,d=hh({targetId:n,busChannel:i,time:o||(1===u?1:this._connMgr.getCrtServerTime()+6e4),count:a,order:u}),_=r===exports.ConversationType.CHATROOM?n:c,[4,this._connMgr.query(l,_,d,void 0)];case 1:return(f=s.sent()).isOk?(p=gh(f.data.pbData),h=p.list.map((function(e){var t,r=_c(e,c,!1,n),i=null===(t=g._readReceiptManager)||void 0===t?void 0:t.getReadReceiptInfo(r,r.messageUId);if(i){var o=i.users;r.readReceiptInfo={isReceiptRequestMessage:!0,readerList:o}}return r})),[2,ur({hasMore:!!p.hasMsg,list:0===u?h.reverse():h})]):[2,f.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return this._isConnected?(r=(t=this).currentUserId,n=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(B.L_VER_REPORT_T,o,i),a=gl.encode(ga,{sdkInfo:o}),u=new eo(On.reportsdk,a,r),[4,n.send(u)]):[2];case 1:return(l=s.sent().code)!==exports.ErrorCode.SUCCESS&&this.logger.warn(B.L_VER_REPORT_R,l,i),[2]}}))}))}}),Object.defineProperty(r.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){return this._chat.storage.setDrafts(e,t),[2,ur()]}))}))}}),Object.defineProperty(r.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return t=this._chat.storage.getDrafts(e),[2,ur(t)]}))}))}}),Object.defineProperty(r.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._chat.storage.deleteDrafts(e),[2,ur()]}))}))}}),Object.defineProperty(r.prototype,"_writeMessagesLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=null===(r=this.cloudController)||void 0===r?void 0:r.getMRTRConfig();if(!n)return!1;var i=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),o=0;switch(e){case exports.ConversationType.PRIVATE:o=n.private;break;case exports.ConversationType.GROUP:o=n.group;break;case exports.ConversationType.CHATROOM:o=n.chatroom;break;case exports.ConversationType.ULTRA_GROUP:o=n.ultraGroup}return!!o&&i%(1/o)==0}}),Object.defineProperty(r.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var r,o,a,u,l,c,d,_,f,p,h,g,E,b,T,v;return s(this,(function(s){switch(s.label){case 0:return r=e.conversationType,o=e.targetId,t=this._handleInnerMsgOptions(e,t),a=!1,[exports.ConversationType.PRIVATE,exports.ConversationType.GROUP].includes(r)&&(t.isStatusMessage||dn(t.messageType).isStatusMessage)&&(a=!0),u=a?function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=On.ppMsgS,t[exports.ConversationType.GROUP]=On.pgMsgS,t)[e]}(r):function(e){var t;return(t={},t[exports.ConversationType.PRIVATE]=On.ppMsgP,t[exports.ConversationType.GROUP]=On.pgMsgP,t[exports.ConversationType.CHATROOM]=On.chatMsg,t[exports.ConversationType.CUSTOMER_SERVICE]=On.pcMsgP,t[exports.ConversationType.RTC_ROOM]=On.prMsgS,t[exports.ConversationType.SYSTEM]=On.pbMsgP,t)[e]}(r)||On.ppMsgP,t.messageId||(t.messageId=Qt()),l=t.messageId,c=Rh(e,t),(d=new to(On[u],c,r===exports.ConversationType.SYSTEM?this.currentUserId:o)).setHeaderQos(Mn),a?(this._connMgr.sendOnly(d),[2,ur(mE(e,n(n({},t),{isStatusMessage:a}),"",0,this.currentUserId,l))]):(_=this._connMgr.getCrtServerTime(),f=mE(e,n(n({},t),{isStatusMessage:a}),"",_,this.currentUserId,l),null==i||i(l),p=Date.now(),[4,this._connMgr.send(d)]);case 1:return h=s.sent(),g=h.code,E=h.isOk,b=h.msg,T=h.data,E?(v=T,this._sendMessageSuccessHandle(f,v),this._writeMessagesLog(r,v.messageUId)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:v.messageUId,channel:r,start_ts:p,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:g})),[2,ur(f)]):(this._writeMessagesLog(r)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({channel:r,start_ts:p,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:g})),f.sentStatus=exports.SentStatus.FAILED,[2,lr(g,b,f)])}}))}))}}),Object.defineProperty(r.prototype,"_sendMessageSuccessHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this;this._sendMessageStore.setMessage(t.messageUId,t.timestamp),e.sentTime=t.timestamp,e.messageUId=t.messageUId,this._setConversationCacheByMessage(e);var i=e.messageType,o=e.conversationType,s=e.targetId,a=e.channelId,u=e.sentTime,l=e.content,c=e.messageDirection;if(this._enableReadReceiptStorage){if(i===me.READ_RECEIPT_REQUEST){var d=l.messageUId;null===(r=this._readReceiptManager)||void 0===r||r.insert({conversationType:o,targetId:s,channelId:a},d,c,u)}if(i===me.READ_RECEIPT_RESPONSE){var _=l.receiptMessageDic;if(!_)return;for(var f in _)_[f].forEach((function(e){var t;null===(t=n._readReceiptManager)||void 0===t||t.remove({conversationType:o,targetId:s,channelId:a},e)}))}}}}),Object.defineProperty(r.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l,c,d,_,f,p,h,g,E,b,T,v,R,I,m;return s(this,(function(s){switch(s.label){case 0:return r=e.targetId,n=e.conversationType,i=e.channelId||"",o=t.user,a=t.extra,u=t.isDelete,l=t.directionalUserIdList,c=t.disableUpdateLastMessage,d=t.messageUId,_=t.sentTime,f=t.disableNotification,p=t.pushConfig,h=t.pushContent,g=t.isAdmin,E={conversationType:n,targetId:r,messageUId:d,sentTime:_,channelId:i,isDelete:!!u,isAdmin:!!g},o&&(E.user=o),a&&(E.extra=a),b={content:E,messageType:me.RECALL,disableNotification:f,pushConfig:p,pushContent:(null==p?void 0:p.pushContent)||h,disableUpdateLastMessage:c,directionalUserIdList:tr(n,l)},T=Rh(e,b),(v=new to(On.recallMsg,T,this.currentUserId)).setHeaderQos(Mn),[4,this._connMgr.send(v)];case 1:return(R=s.sent()).isOk?(I=R.data,n!==exports.ConversationType.ULTRA_GROUP&&(I.messageUId="Cmd:".concat(d)),m=mE(e,b,I.messageUId,I.timestamp,this.currentUserId),n===exports.ConversationType.ULTRA_GROUP?(this._ultraMsgMap[I.messageUId]=I.timestamp,this._updateUltraGroupWhenRecallMsg(m)):(this._sendMessageStore.setMessage(I.messageUId,I.timestamp),this._setConversationCacheByMessage(m)),[2,ur(m)]):[2,R.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"_naviChangeHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._connMgr.getToken();this.navi.updateVoipCallInfo(r,t);var i=this.navi.getNaviInfoFromCache(r);this._watcher.onNaviDataChange(n({},i))}}),Object.defineProperty(r.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,a,u){return o(this,void 0,void 0,(function(){var o,l,c,d,_;return s(this,(function(s){switch(s.label){case 0:return o=i&&"uploads"!==i?t||"":qt(e,t),l=this.naviInfo,c=$t(l,this.logger),d="",c||(d=JSON.stringify({uploadDomain:c})),_=gl.encode(hs,{type:e,key:o,httpMethod:r||"",queryString:i||"",url:a||"",ext:d,size:u?Math.ceil(u):0,ipType:l.ipType||0}),[4,this._connMgr.query(On.qnTkn,this.currentUserId,_,Es)];case 1:return[2,s.sent().trans((function(e){return n(n({},e),{fileName:o,downloadAuthInfo:e.downloadAuthInfo?JSON.parse(e.downloadAuthInfo):null})}))]}}))}))}}),Object.defineProperty(r.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l;return s(this,(function(s){switch(s.label){case 0:return i=this.naviInfo,a="",u="",t===exports.UploadMethod.QINIU?o=On.qnUrl:t===exports.UploadMethod.AWS?o=On.s3Url:t===exports.UploadMethod.STC?o=On.stcUrl:t===exports.UploadMethod.MINIO?(o=On.minioUrl,a=$t(i,this.logger),u=JSON.stringify({url:a})):o=On.aliUrl,l=gl.encode(gs,{type:e,key:r,fileName:n,ext:u,size:-1,ipType:i.ipType||0}),[4,this._connMgr.query(o,this.currentUserId,l,bs)];case 1:return[2,s.sent().trans((function(e){return{downloadUrl:e.downloadUrl}}))]}}))}))}}),Object.defineProperty(r.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return this.reporter.stop(),this.reporterStatistic.stop(),[4,this._connMgr.disconnect(e,t)];case 1:return r.sent(),this._resetMemoryState(),[2,ur()]}}))}))}}),Object.defineProperty(r.prototype,"_resetMemoryState",{enumerable:!1,configurable:!0,writable:!0,value:function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._readReceiptManager&&delete this._readReceiptManager,this._subscribeManager&&delete this._subscribeManager}}),Object.defineProperty(r.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){}}),Object.defineProperty(r.prototype,"serverTime",{get:function(){return this._connMgr.getCrtServerTime()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"userId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"currentUserId",{get:function(){return this._connMgr.getCurrentUserId()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,lr(exports.ErrorCode.TAG_EXISTS)]:[2,this._userSettings.createTag(e)]}))}))}}),Object.defineProperty(r.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._userSettings.hasTag(e)?[2,this._userSettings.removeTag(e)]:[2,lr(exports.ErrorCode.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(r.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return this._userSettings.hasTag(e.tagId)?[2,this._userSettings.createTag(e)]:[2,lr(exports.ErrorCode.TAG_NOT_EXIST)]}))}))}}),Object.defineProperty(r.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){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,ur(n)]}))}))}}),Object.defineProperty(r.prototype,"sendUltraMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){return o(this,void 0,void 0,(function(){var r,o,a,u,l,c,d,_,f,p,h,g,E;return s(this,(function(s){switch(s.label){case 0:return r=e.targetId,t.messageId||(t.messageId=Qt()),o=t.messageId,a=Rh(e,t),(u=new to(On.ugMsg,a,r)).setHeaderQos(Mn),l=this._connMgr.getCrtServerTime(),c=mE(e,n({},t),"",l,this.currentUserId,o),i&&i(o),d=Date.now(),[4,this._connMgr.send(u)];case 1:return _=s.sent(),f=_.code,p=_.data,f!==exports.ErrorCode.SUCCESS?(this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({channel:exports.ConversationType.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:f})),c.sentStatus=exports.SentStatus.FAILED,[2,lr(f,void 0,c)]):(h=p,this._writeMessagesLog(exports.ConversationType.ULTRA_GROUP,h.messageUId)&&this.logger.record(ve.IM_MSG_SEND,JSON.stringify({msg_id:h.messageUId,channel:exports.ConversationType.ULTRA_GROUP,start_ts:d,client_ts:Date.now(),server_deltatime:Date.now()-this._connMgr.getCrtServerTime(),cod:f})),c.sentTime=h.timestamp,c.messageUId=h.messageUId,this._ultraMsgMap[h.messageUId]=h.timestamp,g=this._chat.storage.getOrCreateModel(e,!0),(E=g.updateAttrs({operationTime:h.timestamp,latestMessage:n({},c)},h.timestamp))&&this._watcher.conversation([{conversation:g.toIReceivedConversation(),updatedItems:E}]),[2,ur(c)])}}))}))}}),Object.defineProperty(r.prototype,"_pullOperateStatusNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this._isConnected){var t=function(e){var t=e,r=t.type,n=t.notifyType,i=t.info,o=t.summary,s=[],a=[],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,o=t.opType,a=t.optime;s.push({targetId:r,channelId:n,userId:i,operationType:o,operationTime:a})})),u&&Array.isArray(o)&&o.forEach((function(e){var t=e,r=t.targetId,n=t.busChannel,i=t.count,o=t.opType;a.push({targetId:r,channelId:n,count:i,operationType:o})})),{conversationType:r,info:s,summary:a,hasInfo:l,hasSummary:u}}(gl.decode(Oa,e.pbData));this._watcher.operateStatus(t)}}}),Object.defineProperty(r.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=gl.decode(Mu,new Uint8Array(e.eventData)).results;n.push.apply(n,l([],u(t.map((function(e){return{identifier:e.messageUID,from:e.inputSource,code:e.code,translateInfo:{targetLanguage:e.targetLan,translatedText:e.transResult||"",status:e.code===exports.ErrorCode.SUCCESS?Tn.SUCCESS:Tn.FAILED}}}))),!1))})),n.length&&(null===(r=(t=this._watcher).translateResponse)||void 0===r||r.call(t,n))}}),Object.defineProperty(r.prototype,"_handleEventChangeList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={Group:{map:{},types:yE},Friend:{map:{},types:AE}},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(r.prototype,"_processChangeMapGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=L.GROUP_OPERATION,r=L.GROUP_PROFILE_CHANGE,n=L.GROUP_FOLLOW_USER_CHANGE;e[t]&&this._handleGroupOperation(e[t]),e[r]&&this._handleGroupProfileChange(e[r]),e[n]&&this._handleFollowUserChange(e[n])}}),Object.defineProperty(r.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,o,s,a,u,l,c,d,_=e.subChangeType,f=e.businessId,p=e.time,h=e.eventData,g=T.FRIEND_APPLY,E=T.FRIEND_REFUSE,b=T.FRIEND_USER_INFO,v=T.FRIENDS_INPUT,R=T.FRIEND_CLEAR,I=T.FRIEND_INFO_CHANGE,m=T.FRIEND_INFO_CHANGE_SYNC;switch(_){case g:case E:var y=_===g?exports.FriendApplicationStatus.UNHANDLED:exports.FriendApplicationStatus.REFUSED;null===(n=(r=t._watcher).friendApplicationStatusChanged)||void 0===n||n.call(r,{userId:f,applicationType:h.applyType,applicationStatus:y,directionType:h.friendType,operationTime:p,extra:h.info||""});break;case b:null===(o=(i=t._watcher).friendAdd)||void 0===o||o.call(i,{userId:f,name:h.name,portraitUri:h.portraitUrl,directionType:h.friendType,operationTime:p});break;case v:null===(a=(s=t._watcher).friendDelete)||void 0===a||a.call(s,{userIds:h.targetId,directionType:h.type,operationTime:p});break;case R:null===(l=(u=t._watcher).friendCleared)||void 0===l||l.call(u,p);break;case I:break;case m:null===(d=(c=t._watcher).friendInfoChangedSync)||void 0===d||d.call(c,{userId:f,remark:h.remarkname,extProfile:h.extProfile,operationTime:p})}}))}}),Object.defineProperty(r.prototype,"_handleGroupOperation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,s=e.subChangeType,a=e.businessId,l=e.time,c=e.eventData,d=c.optUserInfo,_=c.channelInfo,f=c.userInfos,p={groupId:a,operation:s,operationTime:l};d&&(r=u(xt([d]),1),p.operatorInfo=r[0]),s===exports.GroupOperation.CREATE&&(n=u(function(e){return void 0===e&&(e=[]),e.map((function(e){var t,r,n,i,o,s,a,u,l,c=Gt(e.settingProfile)||{},d=e.extProfile||[],_=e.targetId,f=e.baseInfo,p=e.userInfo;return{groupId:_,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:Gt(d),joinPermission:~~c.joinPerm,removeMemberPermission:~~c.removePerm,invitePermission:~~c.memInvitePerm,inviteHandlePermission:~~c.invitePerm,groupInfoEditPermission:~~c.profilePerm,memberInfoEditPermission:~~c.memProfilePerm,creatorId:null!==(o=null==f?void 0:f.creatorId)&&void 0!==o?o:"",ownerId:null!==(s=null==f?void 0:f.ownerId)&&void 0!==s?s:"",createTime:(null==f?void 0:f.createTime)||0,membersCount:null!==(a=null==f?void 0:f.memberCount)&&void 0!==a?a:0,remark:null!==(u=null==p?void 0:p.remarkName)&&void 0!==u?u:"",joinedTime:(null==p?void 0:p.joinTime)||0,role:null!==(l=null==p?void 0:p.role)&&void 0!==l?l:exports.GroupMemberRole.UNDEF}}))}([_]),1),p.groupInfo=n[0]),[exports.GroupOperation.CREATE,exports.GroupOperation.DISMISS].includes(s)||(p.memberInfos=xt(f)),null===(o=(i=t._watcher).groupOperation)||void 0===o||o.call(i,p)}))}}),Object.defineProperty(r.prototype,"_handleGroupProfileChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i,o,s,a,l=e.businessId,c=e.time,d=e.eventData,_=e.subChangeType,f=e.secondaryId;switch(_){case S.GROUP_INFO_CHANGE:var p=u(xt([d.optUserInfo]),1)[0],h=u(wt([d.channelInfo]),1)[0],g=u(d.channelFullInfo?wt([d.channelFullInfo]):[void 0],1)[0];null===(n=(r=t._watcher).groupInfoChanged)||void 0===n||n.call(r,{operatorInfo:p,groupInfo:h,changedGroupInfo:h,operationTime:c,fullGroupInfo:g});break;case S.MEMBER_PROFILE_CHANGE:p=u(xt([d.optUserInfo]),1)[0];var E=xt(d.userInfos)[0];null===(o=(i=t._watcher).groupMemberInfoChanged)||void 0===o||o.call(i,{groupId:l,operatorInfo:p,memberInfo:E,operationTime:c});break;case S.GROUP_REMARK_DELETE:case S.GROUP_REMARK_SET:var b=_===S.GROUP_REMARK_SET?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(a=(s=t._watcher).groupRemarkChangedSync)||void 0===a||a.call(s,{groupId:l,operationType:b,operationTime:c,groupRemark:f})}}))}}),Object.defineProperty(r.prototype,"_handleFollowUserChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r,n,i=e.subChangeType,o=e.businessId,s=e.time,a=e.userGroupIds,u=1===i?exports.GroupOperationType.ADD:exports.GroupOperationType.REMOVE;null===(n=(r=t._watcher).groupFollowsChangedSync)||void 0===n||n.call(r,{groupId:o,operationType:u,operationTime:s,userIds:a})}))}}),Object.defineProperty(r.prototype,"_handleUltraChannelChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],i=[],o=[];t.forEach((function(e){var t=e.subChangeType,s=e.targetId;e.msgTime;var a=e.operatorId,u=e.busChannelType,l=e.time,c=e.busChannel||"",d={conversationType:exports.ConversationType.ULTRA_GROUP,targetId:s,channelId:c},_=r._chat.storage.getModel(d);switch(t){case oe.PRIVATE_TO_PUBLIC:null==_||_.updateAttrs({channelType:exports.UltraGroupChannelType.PUBLIC}),n.push({targetId:s,channelId:c,changeType:exports.UltraGroupChannelChangeType.PRIVATE_TO_PUBLIC,channelType:exports.UltraGroupChannelType.PUBLIC});break;case oe.PUBLIC_TO_PRIVATE:null==_||_.updateAttrs({channelType:exports.UltraGroupChannelType.PRIVATE}),n.push({targetId:s,channelId:c,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE,channelType:exports.UltraGroupChannelType.PRIVATE});break;case oe.PUBLIC_TO_PRIVATE_USER_NOT_IN:_&&r._chat.storage.removeConversation(_),n.push({targetId:s,channelId:c,changeType:exports.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:u});break;case oe.CHANNEL_DELETE:_&&r._chat.storage.removeConversation(_),i.push({targetId:s,channelId:c,channelType:u,deleteTime:l});break;case oe.CHANNEL_USER_KICKED:o.push({targetId:s,channelId:c,userId:a,channelType:exports.UltraGroupChannelType.PRIVATE}),a===r.currentUserId&&_&&r._chat.storage.removeConversation(_);case oe.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:}})),n.length>0&&this._watcher.ultraGroupChannelChangeType(n),i.length>0&&this._watcher.ultraGroupChannelDelete(i),o.length>0&&this._watcher.ultraGroupChannelUserKicked(o)}}),Object.defineProperty(r.prototype,"_handleUserGroupStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var e,r,n,i,o,a;return s(this,(function(s){return e=[],r=[],n=[],i=[],o=[],t.forEach((function(t){var s=t.type,a=t.targetId,u=t.busChannelType,l=t.busChannel,c=t.userGroupIds;switch(t.subChangeType){case se.REMOVE_USER_GROUP:e.push({conversation:{conversationType:s,targetId:a},userGroupIds:c});break;case se.JOIN_USER_GROUP:r.push({conversation:{conversationType:s,targetId:a},userGroupIds:c});break;case se.EXIT_USER_GROUP:n.push({conversation:{conversationType:s,targetId:a},userGroupIds:c});break;case se.CHANNEL_BIND_USER_GROUP:i.push({conversation:{conversationType:s,targetId:a,channelId:l},channelType:u,userGroupIds:c});break;case se.CHANNEL_UNBIND_USER_GROUP:o.push({conversation:{conversationType:s,targetId:a,channelId:l},channelType:u,userGroupIds:c})}})),a={},e.length>0&&(a.userGroupDisband=e),r.length>0&&(a.userAdded=r),n.length>0&&(a.userRemoved=n),i.length>0&&(a.userGroupBindChannel=i),o.length>0&&(a.userGroupUnBindChannel=o),this._watcher.userGroupStatus(a),[2]}))}))}}),Object.defineProperty(r.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,o=i.messageUId,s=i.sentTime,a=r.latestMessage;a&&a.messageUId===o&&(n.latestMessage=gc(e,!0)),s&&r.lastReadTime<s&&r.unreadCount&&(n.unreadCount=r.unreadCount-1,t!==ae.ALL&&t!==ae.ME||!r.unreadMentionedCount||(n.unreadMentionedCount=r.unreadMentionedCount-1),t===ae.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(r.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.SUBSCRIBE,r)]}))}))}}),Object.defineProperty(r.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return[4,this._subscribeManager.updateSubscribeRelation(e,t,exports.SubscribeOperationType.UNSUBSCRIBE)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;return o(this,void 0,void 0,(function(){var i;return s(this,(function(o){return i=null===(n=this._subscribeManager)||void 0===n?void 0:n.getSubscribeUserList(e,t,r),[2,ur(i)]}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return n=null===(r=this._subscribeManager)||void 0===r?void 0:r.getSubscribeUserStatus(e,t),[2,ur(n||[])]}))}))}}),Object.defineProperty(r.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=gl.encode(Wa,c(this,d,"m",m).call(this,e)),[4,this._connMgr.query(On.updUserProfile,this.currentUserId,r,void 0)];case 1:return(n=s.sent()).data?(i=gl.decode(Ja,n.data.pbData),n.isOk?(o=i.version,null===(t=this._subscribeManager)||void 0===t||t.updateOwnProfile(e,o),[2,n.wipe()]):(a=i.censorFailedFields,[2,lr(n.code,"",a&&0!==a.length?{errorKeys:a,errorKey:a[0]}:void 0)])):[2,n.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subscribeManager.getOwnProfile()}}),Object.defineProperty(r.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._subscribeManager.getUserProfiles(e)]}))}))}}),Object.defineProperty(r.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return r?[3,2]:[4,this._connMgr.send(new to(t,n,e))];case 1:return[2,i.sent().wipe()];case 2:return[4,this._connMgr.query(t,e,n,void 0)];case 3:return[2,i.sent().trans((function(e){return e.pbData}))]}}))}))}}),Object.defineProperty(r.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o;return s(this,(function(s){switch(s.label){case 0:return n=Dl(t,r),[4,this.rtcSignaling(e,On[On.rtcPing],!0,n)];case 1:return(i=s.sent()).isOk?(o=gl.decode(Wu,i.data),[2,ur(o)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"deviceId",{get:function(){return oc()},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"setPushConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;(t=e.deviceId)&&(ic=t),r=e.packageName,sc=r}}),Object.defineProperty(r.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,{code:exports.ErrorCode.NOT_SUPPORT}]}))}))}}),Object.defineProperty(r.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){o(void 0,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return Bc?(Jc&&(clearTimeout(Jc),Jc=null),[4,Bc]):[2];case 1:return(e=r.sent())&&(t=e.db,Xc.push(t)),Bc=null,[2]}}))}))}}),Object.defineProperty(r.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;if(this._connMgr.setNetwork(e,t),e.status&&this.cloudControllerUri){var n=this._connMgr.getToken();null===(r=this.cloudController)||void 0===r||r.request(this.cloudControllerUri,Zr.newWorkChange,n)}}}),Object.defineProperty(r.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n=gl.encode(Na,{key:t,dataContent:r}),[4,this._connMgr.query(On.reqCall,e,n,Na)];case 1:return(i=o.sent()).isOk?[2,i.trans((function(e){return{key:e.key,value:e.dataContent}}))]:[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(r){switch(r.label){case 0:return t=gl.encode(Iu,e),[4,this._connMgr.query(On.addUnpush,this.currentUserId,t)];case 1:return[2,r.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=gl.encode(mu,{nothing:0}),[4,this._connMgr.query(On.delUnpush,this.currentUserId,e)];case 1:return[2,t.sent().wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return e=gl.encode(yu,{nothing:0}),[4,this._connMgr.query(On.qryUnpush,this.currentUserId,e,Au)];case 1:return[2,t.sent().trans((function(e){var t=e.isUnpush,r=e.spanMinutes,n=e.startTime,i=e.level,o=e.timezone;return t?{spanMinutes:r,startTime:n,level:i,timezone:o}:{spanMinutes:0,startTime:"",level:exports.PushNotificationQuietHoursLevel.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT}}))]}}))}))}}),Object.defineProperty(r.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ur(jr.getStatsUrlList(this.naviInfo))]}))}))}}),Object.defineProperty(r.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a,u,l,c,d,_=this;return s(this,(function(s){switch(s.label){case 0:return i=0===n?e[0].identifier:this.currentUserId,o=this.userSettings.storage.get("value").transLan,a=[],u=[],e.forEach((function(e){var t=e.sourceLanguage,r=e.content,i=e.targetLanguage||o;t!==i?r?a.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:exports.ErrorCode.TRANSLATION_TEXT_INVALID,translateInfo:{targetLanguage:i,translatedText:"",status:Tn.NONE}}):u.push({identifier:e.identifier,from:n,code:exports.ErrorCode.TRANSLATION_LANGUAGE_SAME,translateInfo:{targetLanguage:i,translatedText:"",status:Tn.NONE}})})),0!==a.length?[3,1]:(l=ur(),[3,3]);case 1:return c=gl.encode(Ou,{businessType:3,businessInfo:gl.encode(Lu,{forceTrans:r,transInfos:a,model:t})}),[4,this._connMgr.query(On.upConvertMsg,i,c,Nu)];case 2:d=s.sent(),l=d.wipe(),s.label=3;case 3:return u.length>0&&setTimeout((function(){return _._watcher.translateResponse(u)}),0),[2,l]}}))}))}}),Object.defineProperty(r.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return this._subscribeManager?(t=[],r=new Set,this._subscribeManager.getSubscribeUserStatus(exports.SubscribeType.ONLINE_STATUS,e).forEach((function(e){var n=e.userId,i=e.details,o=(void 0===i?[]:i).map((function(e){return{platform:e.platform,isOnline:!!e.eventValue,updateTime:e.changeTime}})),s=o.some((function(e){return e.isOnline})),a={userId:n,isOnline:s,details:o};t.push(a),r.add(n)})),0===(n=e.filter((function(e){return!r.has(e)}))).length?[2,ur(t)]:[4,c(this,d,"m",y).call(this,exports.SubscribeType.FRIEND_ONLINE_STATUS,n)]):[2,ur([])];case 1:return(i=o.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}})),o=i.some((function(e){return e.isOnline}));t.push((r={userId:n,isOnline:o,details:i},[exports.Platform.iOS,exports.Platform.Android,exports.Platform.Web,exports.Platform.PC,exports.Platform.Mini,exports.Platform.HarmonyOS].forEach((function(e){r.details.some((function(t){return t.platform===e}))||r.details.push({platform:e,isOnline:!1,updateTime:0})})),r))})),[2,ur(t)]):[2,i.wipe()]}}))}))}}),Object.defineProperty(r.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._ctx.getAllRobots(!1)]}))}))}}),d=new WeakSet,_=function(e,t,r,n,i){this._watcher.robotsSynced(t,n)},f=function(e,t){this._watcher.readReceiptResponseV5(t)},p=function(e,t){this._watcher.speechToTextResponse(t)},h=function(e,t){this._watcher.messagesModified(t)},g=function(e){this._watcher.messageModifiedSyncCompleted()},E=function(e,t){this._watcher.ultraGroupMessageExpansionUpdated(t)},v=function(e,t){this._watcher.ultraGroupMessageRecalled(t)},R=function(e,t){this._watcher.conversation(t)},I=function(e,t,r){var n=this;t!==Mh?t!==Uh?this._handleEventChangeList(this._connMgr.codec.formatEventChangeList(r)):this._handleConvertEvent(r):r.forEach((function(e){gl.decode(Ru,new Uint8Array(e.eventData)).statusInfo.forEach((function(e){var t,r,i=jt(e);null===(r=(t=n._watcher).groupApplicationEvent)||void 0===r||r.call(t,i)}))}))},m=function(e){var t={},r=e.extraProfile;return r&&(delete e.extraProfile,t.userExtProfile=Xp(r)),t.userProfile=Xp(e),t},y=function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){switch(n.label){case 0:return r=gl.encode(Ya,{subType:e,subUsers:t.map((function(e){return{subUserId:e}}))}),[4,this._connMgr.query(On.qrySubData,this.currentUserId,r,Ha)];case 1:return[2,n.sent()]}}))}))},i([SE()],r.prototype,"setNotificationQuietHoursWithSetting",null),i([SE()],r.prototype,"removeNotificationQuietHoursSetting",null),i([SE()],r.prototype,"getNotificationQuietHoursSetting",null),r}(Vl),NE=function(){function e(e){OE.set(this,void 0),d(this,OE,e,"f")}return Object.defineProperty(e.prototype,"isSpeechToTextEnabled",{get:function(){return!!(1&(c(this,OE,"f").AIBusinessSub||0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConversationListIncludeUltraGroup",{get:function(){return wg(c(this,OE,"f"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"messageModifiableMinutes",{get:function(){return c(this,OE,"f").msgModifyMinute||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readReceiptVersion",{get:function(){return e=(e=c(this,OE,"f").grpRRVer)||0,Object.values(Ve).includes(e)?e:Ve.UNKNOWN;var e},enumerable:!1,configurable:!0}),e}();OE=new WeakMap;var PE,LE,ME,wE,UE,DE,xE,GE=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===exports.RCConnectionStatus.CONNECTED||this.ctx.userId&&e?ur(this.ctx.naviInfo):lr(exports.ErrorCode.RC_NET_UNAVAILABLE)}}),e}(),VE=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 o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,extra:n,createIfNotExist:r}),i),[4,cr.create("joinChatroom").validate("chatroomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNumber("count",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("extra",n).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){var i=Math.max(Math.min(t,50),-1)||10;return a.svr.joinChatroom(e,i,r,n)}))];case 1:return o=s.sent(),this.logger.summary(B.A_JOIN_CHATROOM_R,o,i),[2,o]}}))}))}}),Object.defineProperty(r.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_QUIT_CHATROOM_T,JSON.stringify({roomId:e}),r),[4,cr.create("quitChatroom").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isString("extra",t).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.quitChatroom(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_INFO_T,JSON.stringify({roomId:e,count:t,order:r}),n),[4,cr.create("getChatroomInfo").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,0,20).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,2).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).next((function(){return o.svr.getChatroomInfo(e,t||0,r||1)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,cr.create("setChatroomEntry").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("key",null==t?void 0:t.key,Jt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).validate("value",null==t?void 0:t.value,Kt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_VALUE).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).isBoolean("isAutoDelete",null==t?void 0:t.isAutoDelete).fail(exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE).isBoolean("isSendNotification",null==t?void 0:t.isSendNotification).fail(exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION).result().tryTrans(this.validateConnected).next((function(){return o.svr.setChatroomEntry(e,t,r)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,cr.create("setChatroomEntries").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isTypedArray("entries",null==t?void 0:t.entries,(function(e){return Jt(null==e?void 0:e.key)&&Kt(null==e?void 0:e.value)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_ENTRIES).isLimitedArray("entryOptions.entries",null==t?void 0:t.entries,10,!0).fail(exports.ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT).isBoolean("entryOptions.isForce",null==t?void 0:t.isForce).fail(exports.ErrorCode.INVALID_PARAMETER_IS_FORCE).isBoolean("entryOptions.isAutoDelete",null==t?void 0:t.isAutoDelete).fail(exports.ErrorCode.INVALID_PARAMETER_IS_AUTO_DELETE).result().tryTrans(this.validateConnected).next((function(){return i.svr.setChatroomEntries(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,entry:t,isForce:r}),n),[4,cr.create("removeChatroomEntry").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("entry.key",null==t?void 0:t.key,Jt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).isBoolean("entry.isSendNotification",null==t?void 0:t.isSendNotification).fail(exports.ErrorCode.INVALID_PARAMETER_IS_SEND_NOTIFICATION).isLimitedString("entry.notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return o.svr.removeChatroomEntry(e,t,r)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e,entryOptions:t}),r),[4,cr.create("removeChatroomEntries").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("keys",null==t?void 0:t.keys,10,Jt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYS).isLimitedString("notificationExtra",null==t?void 0:t.notificationExtra,0,2048).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_EXTRA).result().tryTrans(this.validateConnected).next((function(){return i.svr.removeChatroomEntries(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_ENTRY_T,JSON.stringify({roomId:e,key:t}),r),[4,cr.create("getChatroomEntry").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("key",t,Jt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEY).result().tryTrans(this.validateConnected).next((function(){return i.svr.getChatroomEntry(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_GET_CHATROOM_ENTRY_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_ENTRIES_T,JSON.stringify({roomId:e}),t),[4,cr.create("getAllChatroomEntries").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.getAllChatroomEntries(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_GET_CHATROOM_HISTORY_MESSAGES_T,JSON.stringify({roomId:e,count:t,order:r,timestamp:n}),i),[4,cr.create("getChatroomHistoryMessages").validate("roomId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedInteger("count",t,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",r,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isTimestamp("timestamp",n).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return a.svr.getChatroomHistoryMessages(e,n||0,t||20,r||0)}))];case 1:return o=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BIND_RTC_FOR_CHATROOM_T,JSON.stringify({option:e}),t),[4,cr.create("bindRTCRoomForChatroom").validate("chatRoomId",null==e?void 0:e.chatRoomId,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return n.svr.bindRTCRoomForChatroom(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_BIND_RTC_FOR_CHATROOM_R,r,t),[2,r]}}))}))}}),r}(GE),jE=function(e){e.groupId;var t=e.groupName,r=e.portraitUri,n=e.introduction,i=e.notice;e.extProfile;var o=e.joinPermission,s=e.removeMemberPermission,a=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:o,removePerm:s,memInvitePerm:a,invitePerm:u,profilePerm:l,memProfilePerm:c}))},kE=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)}},FE=function(e,t,r){return e.validate("groupId",null==t?void 0:t.groupId,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("groupName",null==t?void 0:t.groupName,1,64,r).fail(exports.ErrorCode.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(!bt(e))return!1;var t=Object.entries(e);return t.length<=10&&t.every((function(e){var t=u(e,2);t[0];var r=t[1];return _t(r)}))})).isNumberEnum("joinPermission",null==t?void 0:t.joinPermission,exports.GroupJoinPermission).isNumberEnum("removeMemberPermission",null==t?void 0:t.removeMemberPermission,exports.GroupOperationPermission).isNumberEnum("invitePermission",null==t?void 0:t.invitePermission,exports.GroupOperationPermission).isNumberEnum("inviteHandlePermission",null==t?void 0:t.inviteHandlePermission,exports.GroupInviteHandlePermission).isNumberEnum("groupInfoEditPermission",null==t?void 0:t.groupInfoEditPermission,exports.GroupOperationPermission).isNumberEnum("memberInfoEditPermission",null==t?void 0:t.memberInfoEditPermission,exports.GroupMemberInfoEditPermission).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_INFO)},BE=function(e,t,r,n,i){return e.isObject("option",n,i).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("count",null==n?void 0:n.count,1,t,r).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",null==n?void 0:n.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isBoolean("order",null==n?void 0:n.order).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER)},HE=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)?ur():lr(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MY_USER_PROFILE_VISIBILITY_T,e,t),[4,cr.create("updateMyUserProfileVisibility").isNumberEnum("visibility",e,exports.UserProfileVisibility,!0).fail(exports.ErrorCode.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(B.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 o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.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(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_USER_PROFILE_BY_UNIQUE_ID_T,e,t),[4,cr.create("searchUserProfileByUniqueId").isNotEmptyString("uniqueId",e,!0).fail(exports.ErrorCode.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(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_ADD_FRIEND_T,JSON.stringify({userId:e,directionType:t,extra:r}),n),[4,cr.create("addFriend").validate("userId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isNumberEnum("directionType",t,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).isLimitedString("extra",r,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.addFriend(e,t,r||"")}))];case 1:return i=s.sent(),this.svr.addFriend(e,t,r||""),this.logger.summary(B.A_ADD_FRIEND_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DELETE_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),r),[4,cr.create("deleteFriends").isLimitedTypedArray("userIds",e,100,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.deleteFriends(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_DELETE_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_FRIEND_REQUEST_T,e,t),[4,cr.create("acceptFriendRequest").validate("userId",e,At,!0).fail(exports.ErrorCode.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(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_FRIEND_REQUEST_T,JSON.stringify({userId:e,reason:t}),r),[4,cr.create("refuseFriendApplication").validate("userId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isString("reason",t).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.refuseFriendRequest(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_FRIEND_INFO_T,JSON.stringify({userId:e,remark:t,extProfile:r}),n),[4,cr.create("setFriendInfo").validate("userId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("remark",t,0,64,!0).fail(exports.ErrorCode.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=u(e,2);t[0];var r=t[1];return!_t(r)})))})).fail(exports.ErrorCode.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_CHECK_FRIENDS_T,JSON.stringify({userIds:e,directionType:t}),r),[4,cr.create("checkFriends").isLimitedTypedArray("userIds",e,20,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isNumberEnum("directionType",t,exports.DirectionType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DIRECTION_TYPE).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.checkFriends(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_CHECK_FRIENDS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIENDS_T,JSON.stringify({directionType:e,option:t}),r),[4,cr.create("getFriends").isNumberEnum("directionType",e,exports.QueryFriendsDirectionType,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIEND_APPLICATIONS_T,JSON.stringify({option:e,types:t,status:r}),n),[4,cr.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,exports.FriendApplicationType,!0).isFailed})).fail(exports.ErrorCode.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE).isTypedArray("status",r,(function(t){return!e.isNumberEnum("status",t,exports.FriendApplicationStatus,!0).isFailed})).fail(exports.ErrorCode.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],s=r&&0!==r.length?r:[0,1,2,3];return o.svr.getFriendApplications(n,i,s)}))];case 1:return i=s.sent(),this.logger.summary(B.A_GET_FRIEND_APPLICATIONS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIENDS_INFO_T,JSON.stringify({userIds:e}),t),[4,cr.create("getFriendsInfo").isLimitedTypedArray("userIds",e,100,At,!0).fail(exports.ErrorCode.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(B.A_GET_FRIENDS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_FRIENDS_INFO_T,JSON.stringify({nickname:e}),t),[4,cr.create("searchFriendsInfo").isLimitedString("nickname",e,1,64,!0).fail(exports.ErrorCode.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(B.A_SEARCH_FRIENDS_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_FRIEND_ADD_PERMISSION_T,JSON.stringify({permission:e}),t),[4,cr.create("setFriendAddPermission").isNumberEnum("permission",e,exports.FriendAddPermission,!0).fail(exports.ErrorCode.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(B.A_SET_FRIEND_ADD_PERMISSION_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_FRIEND_ADD_PERMISSION_T,JSON.stringify({}),e),[4,cr.create("getFriendAddPermission").result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return r.svr.getFriendAddPermission()}))];case 1:return t=n.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_CREATE_GROUP_T,JSON.stringify({groupInfo:e,inviteeUserIds:t}),r),[4,cr.create("createGroup").check((function(t){return FE(t,e,!0)})).isLimitedTypedArray("inviteeUserIds",t,30,At,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var r=jE(e);return i.svr.createGroup(e.groupId,r,e.extProfile||{},t||[])}))];case 1:return n=o.sent(),this.logger.summary(B.A_CREATE_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_GROUP_INFO_T,JSON.stringify({groupInfo:e}),t),[4,cr.create("updateGroupInfo").check((function(t){return FE(t,e,!1)})).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){var t=jE(e);return n.svr.updateGroupInfo(e.groupId,t,e.extProfile)}))];case 1:return r=i.sent(),this.logger.summary(B.A_UPDATE_GROUP_INFO_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUPS_INFO_T,JSON.stringify({groupIds:e}),t),[4,cr.create("getGroupsInfo").isLimitedTypedArray("groupIds",e,20,St,!0,1).fail(exports.ErrorCode.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(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_KICK_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t,config:r}),n),[4,cr.create("kickGroupMembers").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,At,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.kickGroupMembers(e,t,kE(r))}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_QUIT_GROUP_T,JSON.stringify({groupId:e,config:t}),r),[4,cr.create("quitGroup").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.quitGroup(e,kE(t))}))];case 1:return n=o.sent(),this.logger.summary(B.A_QUIT_GROUP_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_DISMISS_GROUP_T,JSON.stringify({groupId:e}),t),[4,cr.create("dismissGroup").validate("groupId",e,St,!0).fail(exports.ErrorCode.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(B.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 o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_TRANSFER_GROUP_OWNER_T,JSON.stringify({groupId:e,newOwnerId:t,quit:r,config:n}),i),[4,cr.create("transferGroupOwner").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("newOwnerId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return a.svr.transferGroupOwner(e,t,!!r,kE(n))}))];case 1:return o=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ADD_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,cr.create("addGroupManagers").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,At,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(exports.GroupOperationType.ADD,e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_GROUP_MANAGERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,cr.create("removeGroupManagers").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,10,At,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupManagers(exports.GroupOperationType.REMOVE,e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_MEMBERS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,cr.create("getGroupMembers").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,At,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.getGroupMembers(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_SET_GROUP_MEMBER_INFO_T,JSON.stringify({groupId:e,userId:t,nickname:r,extra:n}),i),[4,cr.create("setGroupMemberInfo").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("userId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("nickname",r,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NICK_NAME).isLimitedString("extra",n,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_EXTRA).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return a.svr.setGroupMemberInfo(e,t,r,n)}))];case 1:return o=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_GROUP_MEMBERS_T,JSON.stringify({groupId:e,nickName:t,option:r}),n),[4,cr.create("searchGroupMembers").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("nickName",t,1,64,!0).fail(exports.ErrorCode.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_MEMBERS_BY_ROLE_T,JSON.stringify({groupId:e,role:t,option:r}),n),[4,cr.create("getGroupMembersByRole").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isNumberEnum("role",t,exports.GroupMemberRole,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_MEMBER_ROLE).isLimitedInteger("count",r.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isString("pageToken",r.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isNumberEnum("filterRobotType",r.filterRobotType,xe).fail(exports.ErrorCode.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||xe.ALL};return o.svr.getGroupMembersByRole(e,t,n)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ADD_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,cr.create("addGroupFollows").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(exports.GroupOperationType.ADD,e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_GROUP_FOLLOWS_T,JSON.stringify({groupId:e,userIds:t}),r),[4,cr.create("removeGroupFollows").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,100,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupFollows(exports.GroupOperationType.REMOVE,e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_REMOVE_GROUP_FOLLOWS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_FOLLOWS_T,JSON.stringify({groupId:e}),t),[4,cr.create("getGroupFollows").validate("groupId",e,St,!0).fail(exports.ErrorCode.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(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SET_GROUP_REMARK_T,JSON.stringify({groupId:e,remark:t}),r),[4,cr.create("setGroupRemark").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedString("remark",t,0,64,!0).fail(exports.ErrorCode.INVALID_PARAMETER_REMARK).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.setGroupRemark(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_SET_GROUP_REMARK_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_JOIN_GROUP_T,JSON.stringify({groupId:e}),t),[4,cr.create("joinGroup").validate("groupId",e,St,!0).fail(exports.ErrorCode.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(B.A_JOIN_GROUP_R,r,t),[2,r]}}))}))}}),Object.defineProperty(r.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_INVITE_USERS_TO_GROUP_T,JSON.stringify({groupId:e,userIds:t}),r),[4,cr.create("inviteUsersToGroup").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).isLimitedTypedArray("userIds",t,30,At,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.inviteUsersToGroup(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t}),r),[4,cr.create("acceptGroupInvite").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return i.svr.memberInviteResponse({groupId:e,inviterId:t,optType:exports.GroupOperationRole.APPLICANT,optResult:exports.GroupOperationStatus.ACCEPT})}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_GROUP_INVITE_T,JSON.stringify({groupId:e,inviterId:t,reason:r}),n),[4,cr.create("refuseGroupInvite").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("inviterId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("reason",r,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,inviterId:t,optType:exports.GroupOperationRole.APPLICANT,optResult:exports.GroupOperationStatus.REFUSE,reason:r})}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_ACCEPT_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:r}),n),[4,cr.create("acceptGroupApplication").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).validate("inviterId",r,At).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return o.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r||"",optType:exports.GroupOperationRole.MANAGER,optResult:exports.GroupOperationStatus.ACCEPT})}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_REFUSE_GROUP_APPLICATION_T,JSON.stringify({groupId:e,joinUserId:t,inviterId:r,reason:n}),i),[4,cr.create("refuseGroupApplication").validate("groupId",e,St,!0).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_ID).validate("joinUserId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).validate("inviterId",r,At).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedString("reason",n,0,128).fail(exports.ErrorCode.INVALID_PARAMETER_REASON).result().tryTrans(this.validateConnected).tryTrans(this._userProfileEnabled).next((function(){return a.svr.memberInviteResponse({groupId:e,joinUserId:t,inviterId:r||"",optType:exports.GroupOperationRole.MANAGER,optResult:exports.GroupOperationStatus.REFUSE,reason:n})}))];case 1:return o=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_GROUP_APPLICATIONS_T,JSON.stringify({option:e,directions:t,status:r}),n),i=this.ctx.usingCppEngine,[4,cr.create("getGroupApplications").check((function(t){return BE(t,200,!0,e,!0)})).check((function(e){i&&e.isLimitedTypedArray("directions",t,Object.keys(exports.GroupApplicationDirection).length,(function(t){return!e.isNumberEnum("directions",t,exports.GroupApplicationDirection,!0).isFailed}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION).isLimitedTypedArray("status",r,Object.keys(exports.GroupApplicationStatus).length,(function(t){return!e.isNumberEnum("status",t,exports.GroupApplicationStatus,!0).isFailed}),!0,1).fail(exports.ErrorCode.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 a.svr.getGroupApplications(n,t||[],r||[])}))];case 1:return o=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_JOINED_GROUPS_BY_ROLES_T,JSON.stringify({role:e,option:t}),r),[4,cr.create("getJoinedGroupsByRole").isNumberEnum("role",e,exports.GroupMemberRole,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEARCH_JOINED_GROUPS_T,JSON.stringify({groupName:e,option:t}),r),[4,cr.create("searchJoinedGroups").isLimitedString("groupName",e,1,64,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.A_SEARCH_JOINED_GROUPS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_JOINED_GROUPS_T,JSON.stringify({groupIds:e}),t),[4,cr.create("getJoinedGroups").isLimitedTypedArray("groupIds",e,20,St,!0,1).fail(exports.ErrorCode.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(B.A_GET_JOINED_GROUPS_R,r,t),[2,r]}}))}))}}),r}(GE),qE=0,YE=function(e){function r(t,r,i){var o=e.call(this,i)||this;return Object.defineProperty(o,"_svr",{enumerable:!0,configurable:!0,writable:!0,value:r}),PE.set(o,void 0),LE.set(o,!1),ME.set(o,!0),wE.set(o,""),Object.defineProperty(o,"_id",{enumerable:!0,configurable:!0,writable:!0,value:++qE}),d(o,PE,n(n({},t),{tagFilter:n({},t.tagFilter)}),"f"),o}return t(r,e),Object.defineProperty(r.prototype,"hasMore",{get:function(){return c(this,ME,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isLoading",{get:function(){return c(this,LE,"f")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"load",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return c(this,LE,"f")?[2,lr(exports.ErrorCode.METHOD_BUSY)]:(d(this,LE,!0,"f"),t=this.logger.createTraceId(),this.logger.info(B.A_LOAD_CONVERSATION_LIST_T,JSON.stringify({count:e,loaderId:this._id,pageToken:c(this,wE,"f")}),t),[4,cr.create("ConversationListLoader.load").isLimitedInteger("count",e,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){return u._svr.loadConversationList(c(u,wE,"f"),e,c(u,PE,"f"))}))]);case 1:return r=s.sent(),this.logger.summary(B.A_LOAD_CONVERSATION_LIST_R,r,t,{loaderId:this._id},(function(e){return{pageToken:e.pageToken,finished:e.finished}})),d(this,LE,!1,"f"),r.isOk?(n=r.data,i=n.pageToken,o=n.finished,a=n.list,d(this,wE,i,"f"),d(this,ME,!o,"f"),[2,ur(a)]):[2,r.wipe()]}}))}))}}),r}(GE);PE=new WeakMap,LE=new WeakMap,ME=new WeakMap,wE=new WeakMap;var WE,JE,KE,QE,XE,ZE,zE,$E,eb,tb=function(e){function r(t,r){var n=e.call(this,t)||this;return UE.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SAVE_EDITED_MSG_DRAFT_T,JSON.stringify({draft:e,identifier:t}),r),[4,cr.create("saveEditedMessageDraft").check((function(e){return Ql(e,t,Z)})).isString("draft",null==e?void 0:e.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DRAFT).isNotEmptyString("messageUId",null==e?void 0:e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateLogin).next((function(){return i.svr.saveEditedMessageDraft(e,c(i,UE,"m",xE).call(i,t))}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,cr.create("getEditedMessageDraft").check((function(t){return Ql(t,e,Z)})).result().next((function(){return n.svr.getEditedMessageDraft(c(n,UE,"m",xE).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_EDITED_MSG_DRAFT_T,JSON.stringify({identifier:e}),t),[4,cr.create("clearEditedMessageDraft").check((function(t){return Ql(t,e,Z)})).result().next((function(){return n.svr.clearEditedMessageDraft(c(n,UE,"m",xE).call(n,e))}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return r=(t=e||{}).conversationTypes,i=t.order,o=t.channelId,a=t.tagFilter,[4,cr.create("createConversationListLoader").isTypedArray("conversationTypes",r,(function(e){return te(e,W)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("order",i,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).validate("channelId",o,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).check((function(e){if(a){var t=a.tagIds;e.isLimitedTypedArray("tagIds",t,20,Et,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID)}})).result().tryTrans(this.validateConnected).trans((function(){return new YE(n(n({},e),{tagFilter:n({},a)}),u.svr,u.ctx)}))];case 1:return[2,s.sent()]}}))}))}}),Object.defineProperty(r.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.conversationType,this.logger.info(B.A_SEND_UG_TYPING_T,JSON.stringify(e),t),[4,cr.create("sendUltraGroupTypingStatus").check((function(t){return Ql(t,e,X)})).validate("conversationType",r,(function(){return r===exports.ConversationType.ULTRA_GROUP}),!0).fail(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT).result().tryTrans(this.validateConnected).next((function(){var t=c(i,UE,"m",xE).call(i,e);return i.svr.sendUltraGroupTypingStatus(t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_TYPING_STATUS_T,JSON.stringify({identifier:e,typingContentType:t}),r),[4,cr.create("sendTypingStatus").check((function(t){return Ql(t,e,W)})).isString("typingContentType",t,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SYNC_READ_STATUS_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,cr.create("sendSyncReadStatusMessage").check((function(t){return Ql(t,e,W)})).isNumber("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(n){return o(i,void 0,void 0,(function(){var i;return s(this,(function(o){switch(o.label){case 0:return 1===n.sesDriven?[2,this.svr.updateConversationReadTime(e,t)]:(i={messageType:me.SYNC_READ_STATUS,content:{lastMessageSendTime:t},directionalUserIdList:tr(e.conversationType,[this.ctx.userId])},[4,this.ctx.sendMessage(e,i,r)]);case 1:return[2,o.sent().wipe()]}}))}))}))];case 1:return n=a.sent(),this.logger.summary(B.A_SYNC_READ_STATUS_R,n,r),[2,n]}}))}))}}),Object.defineProperty(r.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_UNREAD_COUNT_BY_TIME_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,cr.create("clearUnreadCountByTimestamp").check((function(t){return Ql(t,e,W)})).isTimestamp("timestamp",t).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i.svr.clearUnreadCountByTimestamp(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_REQ_T,JSON.stringify({identifier:e,messageUId:t}),r),[4,cr.create("sendReadReceiptRequest").check((function(t){return Ql(t,e,z)})).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(){var n={messageType:me.READ_RECEIPT_REQUEST,content:{messageUId:t}};return i.ctx.sendMessage(e,n,r)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageUId:t,timestamp:r}),n),[4,cr.create("sendReadReceiptMessage").check((function(t){return Ql(t,e,$)})).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("timestamp",r,1,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var i={messageType:me.READ_RECEIPT,content:{messageUId:t,lastMessageSendTime:r,type:1}};return o.ctx.sendMessage(e,i,n)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_T,JSON.stringify({identifier:e,messageList:t}),r),[4,cr.create("sendReadReceipt").check((function(t){return Ql(t,e,z)})).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).check((function(e){bt(t)&&!Object.keys(t).some((function(r){var n=t[r];return e.isLimitedTypedArray("messageList",n,Number.MAX_SAFE_INTEGER,Et,!0).isFailed}))||e.setFailed(exports.ErrorCode.MSG_LIMIT_ERROR)})).result().tryTrans(this.validateConnected).next((function(n){return o(i,void 0,void 0,(function(){var i,o;return s(this,(function(s){switch(s.label){case 0:return 0!==(i=n.grpRRVer||0)&&1!==i?[2,lr(exports.ErrorCode.READ_RECEIPT_ERROR)]:1===i?(o=[],Object.keys(t).forEach((function(e){o.push.apply(o,l([],u(t[e]),!1))})),[2,this.svr.sendReadReceiptV2(e.targetId,o,e.channelId)]):[4,this.ctx.sendMessage(e,{messageType:me.READ_RECEIPT_RESPONSE,content:{receiptMessageDic:t}},r)];case 1:return[2,s.sent().wipe()]}}))}))}))];case 1:return n=a.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_MSG_READER_T,JSON.stringify({targetId:e,messageUId:t,channelId:r}),n),[4,cr.create("getMessageReader").validate("targetId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return o(a,void 0,void 0,(function(){return s(this,(function(i){return 1!==n.grpRRVer?[2,lr(exports.ErrorCode.READ_RECEIPT_ERROR)]:[2,this.svr.getMessageReader(e,t,r||"")]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_MSG_READER_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,endMsgUid:t,startMsgUid:r}),n),[4,cr.create("sendReadReceiptMessageV4").check((function(t){return Ql(t,e,W)})).isNotEmptyString("endMsgUid",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_END_MESSAGE_UID).isNotEmptyString("startMsgUid",r).fail(exports.ErrorCode.INVALID_PARAMETER_START_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(n){return o(a,void 0,void 0,(function(){return s(this,(function(i){return 3!==n.grpRRVer?[2,lr(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.sendReadReceiptMessageV4(e,r||"",t)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_V4_R,i,n),[2,i]}}))}))}}),Object.defineProperty(r.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_READ_RECEIPT_V4_T,JSON.stringify({conversation:e,messageUId:t}),r),[4,cr.create("getMessageReadReceiptV4").check((function(t){return Ql(t,e,z)})).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){return s(this,(function(n){return 3!==r.grpRRVer?[2,lr(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.getMessageReadReceiptV4(e,t)]}))}))}))];case 1:return n=a.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_GET_READ_RECEIPT_INFO_V4_T,JSON.stringify({conversation:e,messageUIds:t}),r),[4,cr.create("batchGetMessageReadReceiptInfoV4").check((function(t){return Ql(t,e,z)})).isTypedArray("messageUIds",t,Et,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){return s(this,(function(n){return 3!==r.grpRRVer?[2,lr(exports.ErrorCode.READ_RECEIPT_V4_NOT_SUPPORT)]:[2,this.svr.batchGetMessageReadReceiptInfoV4(e,t)]}))}))}))];case 1:return n=a.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_T,JSON.stringify({options:e}),t),[4,cr.create("getConversationsIncludingRobots").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,2,(function(e){return[exports.ConversationType.PRIVATE,exports.ConversationType.SYSTEM].includes(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.A_GET_CONVERSATIONS_INCLUDING_ROBOTS_R,r,t),[2,r]}}))}))}}),r}(GE);function rb(e){return n({},e)}UE=new WeakSet,DE=function(e){var t;return!!(2&((null===(t=this.ctx.naviInfo)||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e},xE=function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP?e:n(n({},e),{channelId:c(this,UE,"m",DE).call(this,e.channelId)})};var nb=function(){function e(e){var t,r,i=this;WE.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,"_ugSynced",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_compatibleMessageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(t={},t[me.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),t[me.INTERCEPT]=this._processInterceptMessage.bind(this),t)}),Object.defineProperty(this,"_messageProccessor",{enumerable:!0,configurable:!0,writable:!0,value:(r={},r[me.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),r[me.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),r[me.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 o={onConnected:function(){return i._onConnectionStatusChange(exports.RCConnectionStatus.CONNECTED)},onConnecting:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,exports.RCConnectionStatus.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)},s=Ot();this._engine=s?new RCCppEngine(o,this._options):new CE(o,this._options),this.logger=this._engine.logger,this._options.eventLoopBlockingCheck&&zr.start(this.logger),this.sse=new jl(this,s),this.chatroom=new VE(this._engine,this._engine.chatroom),this.dataHosting=new HE(this._engine,this._engine.dataHosting),this.chat=new tb(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(B.A_INIT_REPEAT_O),this._context;this._context=new e(t),this._context.logger.info(B.L_INIT_O,JSON.stringify({appkey:t.appkey,navigators:t.navigators,typingExpireTime:t.typingExpireTime})),this._context.logger.warn(B.L_IMSDK_VER_O,JSON.stringify({commitId:"46a0c133c89d95ba2f200da50ec1ebded4869bbe",version:"5.32.1-c-test-alpha.1"}));var r=this._context._engine;return Zo.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 o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(B.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(B.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),r),this._pluginInstanseMap[e.tag])return this.logger.warn(B.L_INSTALL_PLUGIN_R,"repeat install",r),this._pluginInstanseMap[e.tag];var n="RCRTC"===e.tag?new Hl(this):new Bl(this),i=null;try{if(!e.verify(Zo))return null;i=e.setup(n,Zo,t)}catch(e){this.logger.error(B.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 NE(e)}))}}),Object.defineProperty(e.prototype,"_onConnectionStatusChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n;this._ugSynced=!1,this.logger.warn(B.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(rb(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===exports.ConversationType.ULTRA_GROUP){var r=e.content.sourceType;if(t.sourceType=r,(r===exports.MessageBlockSourceType.MSG_EXPANSION||r===exports.MessageBlockSourceType.MSG_MODIFY)&&e.content.sourceContent)try{t.sourceContent=JSON.parse(e.content.sourceContent)}catch(e){this.logger.warn(B.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,o,s,a=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(rb(e))}catch(e){return a.logger.error(B.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}})))return null===(s=(o=this._watcher).message)||void 0===s||s.call(o,rb(e),t,r),e}}),Object.defineProperty(e.prototype,"_batchMessageReceiver",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=[],o=[],s=[me.READ_RECEIPT,me.READ_RECEIPT_REQUEST,me.READ_RECEIPT_RESPONSE];e.forEach((function(e){var a=n._messageReceiver(e,t,r);a&&s.includes(a.messageType)?o.push(a):a&&i.push(a)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(B.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i)),o.length&&o.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(B.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;this._ugSynced=!0,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(B.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(B.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(B.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(B.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(B.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]=Tt(n)||bt(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,o=e.channelId,s=i.typingContentType,a=o||"",u="".concat(r,"#").concat(n,"#").concat(a);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===s?this._typingInfo[u][l].timestamp=Date.now():(l>=0&&this._typingInfo[u].splice(l,1),this._typingInfo[u].push({userId:t,messageType:s,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?lr(exports.ErrorCode.RC_USER_PROFILE_SERVICE_UNAVAILABLE):ur(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===exports.RCConnectionStatus.CONNECTED||this._engine.userId&&e?ur(this._engine.naviInfo):lr(exports.ErrorCode.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 o(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),r),[4,c(this,WE,"m",JE).call(this,e,t,r)];case 1:return n=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){return s(this,(function(r){return this.logger.info(B.A_DISCONNECT_O,JSON.stringify({closeDB:e,disablePush:t})),[2,c(this,WE,"m",KE).call(this,e,t)]}))}))}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_RECONNECT_T,JSON.stringify({reconnectKickEnable:e}),t),[4,c(this,WE,"m",JE).call(this,this.token,!!e,t)];case 1:return r=n.sent(),this.logger.summary(B.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!==exports.ConversationType.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,o){void 0===i&&(i=[]),void 0===o&&(o=!1);var s,a,u,l={isPersited:t,isCounted:r,searchProps:i,isStatusMessage:o};s=e,a=l,(u=cn.get(s))&&!u.isCustom&&console.warn("Builtin message type '".concat(s,"' cannot be registered")),a.isStatusMessage&&(a.isCounted=a.isPersited=!1),cn.set(s,n(n({},a),{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 o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.L_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),n),[4,c(this,WE,"m",XE).call(this,e,t,n,r)];case 1:return i=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SEND_MSG_T,JSON.stringify({identifier:e,messageType:t.messageType}),n),[4,c(this,WE,"m",XE).call(this,e,t,n,r)];case 1:return i=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,i,o=this;return s(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MSG_EXPANSION_T,JSON.stringify({expansion:e,attrs:t}),r),[4,cr.create("updateMessageExpansion").check((function(r){return Xl(r,t,Object.keys(e||{}))})).check((function(r){return Zl(r,e,t.canIncludeExpansion)})).result().tryTrans(this.validateConnected).next((function(){var i={put:e,mid:t.messageUId},s=n(n({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===exports.ConversationType.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(s,i,t.sentTime):c(o,WE,"m",zE).call(o,s,i,r)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,i,o=this;return s(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_MSG_EXPANSION_T,JSON.stringify({keys:e,attrs:t}),r),[4,cr.create("removeMessageExpansion").isLimitedTypedArray("keys",e,20,(function(e){return"string"==typeof e&&/^[A-Za-z0-9_=+-]+$/.test(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYS).check((function(r){return Xl(r,t,e)})).result().tryTrans(this.validateConnected).next((function(){var i={del:e,mid:t.messageUId},s=n(n({},t),{channelId:o._channelIdConvert(t.conversationType,t.channelId)});return t.conversationType===exports.ConversationType.ULTRA_GROUP?o._engine.chat.updateUGMessageExpansion(s,i,t.sentTime):c(o,WE,"m",zE).call(o,s,i,r)}))];case 1:return i=s.sent(),this.logger.summary(B.A_REMOVE_MSG_EXPANSION_R,i,r),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"removeAllMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_ALL_MSG_EXPANSION_T,JSON.stringify({attrs:e}),t),[4,cr.create("removeAllMessageExpansion").check((function(t){return Xl(t,e,[])})).check((function(t){e.conversationType!==exports.ConversationType.ULTRA_GROUP&&t.setFailed(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){var r={clear:1,mid:e.messageUId},o=n(n({},e),{channelId:i._channelIdConvert(e.conversationType,e.channelId)});return e.conversationType===exports.ConversationType.ULTRA_GROUP?i._engine.chat.updateUGMessageExpansion(o,r,e.sentTime):c(i,WE,"m",zE).call(i,o,r,t)}))];case 1:return r=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=n||this.logger.createTraceId(),this.logger.info(B.A_SEND_READ_RECEIPT_V2_T,JSON.stringify({targetId:e,messageUIds:t,channelId:r}),n),[4,cr.create("sendReadReceiptV2").validate("targetId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isLimitedTypedArray("messageUIds",t,Number.MAX_SAFE_INTEGER,Et,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).validate("channelId",r,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(n){return o(a,void 0,void 0,(function(){return s(this,(function(i){return 1!==n.grpRRVer?[2,lr(exports.ErrorCode.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 i=u.sent(),this.logger.summary(B.A_SEND_READ_RECEIPT_V2_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"_destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){switch(t.label){case 0:return zr.stop(),this._resetWatcher(),this._engine.destroy(),Zo.removeNetworkStatusListener(),[4,c(this,WE,"m",KE).call(this)];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(B.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 o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.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,a=this.logger.createTraceId(),this.logger.info(B.A_GET_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),a),[4,cr.create("getHistoryMessage").check((function(t){return Ql(t,e,Q)})).isLimitedInteger("timestamp",r,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isLimitedInteger("count",n,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isNotEmptyString("messageType",o).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:r||0,count:n||20,order:i||0,messageType:o||""},s=c(l,WE,"m",QE).call(l,e);return l._engine.getHistoryMessage(s,t,!0)}))];case 1:return u=s.sent(),this.logger.summary(B.A_GET_HISTORY_MSG_R,u,a),[2,u]}}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_CONTINUOUS_MSGS_T,JSON.stringify({conversation:e,options:t}),r),[4,cr.create("getContinuousMessages").check((function(t){return Ql(t,e,J)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateLogin).next((function(){var r=c(i,WE,"m",QE).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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_HIS_MSGS_BY_OBJ_NAMES_T,JSON.stringify({conversation:e,option:t}),r),[4,cr.create("getHistoryMessagesByObjectNames").check((function(t){return Ql(t,e,X)})).isLimitedInteger("timestamp",null==t?void 0:t.timestamp,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==t?void 0:t.count,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==t?void 0:t.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isTypedArray("messageTypes",null==t?void 0:t.messageTypes,Et).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).result().tryTrans(this.validateLogin).next((function(){var r=c(i,WE,"m",QE).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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_TOP_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e,channelId:t}),r),[4,cr.create("getTopConversationList").isTypedArray("conversationTypes",e,(function(e){return te(e,K)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).validate("channelId",t,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(r){return o(i,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=wg(r))&&!this._ugSynced?[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTopConversationList(n,e,t)]}))}))}))];case 1:return n=a.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_CONVERSATION_LIST_T,JSON.stringify({conversationTypes:e}),t),[4,cr.create("getUnreadConversationList").isTypedArray("conversationTypes",e,(function(e){return te(e,K)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateConnected).next((function(t){return o(n,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=wg(t))&&!this._ugSynced?[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getUnreadConversationList(r,e)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_UNREAD_CONVERSATION_LIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLOCKED_CONVERSATION_LIST_T,"",e),[4,cr.create("getBlockedConversationList").result().tryTrans(this.validateConnected).next((function(e){return o(r,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=wg(e))&&!this._ugSynced?[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getBlockedConversationList(t)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){switch(n.label){case 0:return[4,cr.create("getConversationListByPageIndex").isInteger("index",e,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"page index must be an integer").isInteger("limit",t,!0).fail(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_ALL_CONVERSATION_LIST_T,JSON.stringify({channelId:e}),t),[4,cr.create("getAllConversationList").validate("channelId",e,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateLogin).next((function(t){return o(n,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=wg(t))&&!this._ugSynced?[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getAllConversationList(r,e)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){switch(n.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_LIST_OLD_T,JSON.stringify(e),t),[4,Ot()&&"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(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_LIST_BY_TIME_T,JSON.stringify(e),t),[4,cr.create("getConversationListByTimestamp").isObject("params",e,!0).fail(exports.ErrorCode.CONVER_GET_ERROR,"params must be an object").isInteger("startTime",null==e?void 0:e.startTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).isInteger("count",null==e?void 0:e.count,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("order",null==e?void 0:e.order,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).validate("channelId",null==e?void 0:e.channelId,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,(function(e){return te(e,K)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans((function(){return n.checkAuthed(Ot())})).next((function(t){return o(n,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=wg(t))&&!this._ugSynced?[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getConversationListByTimestamp(e,r)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATION_T,JSON.stringify(e),t),[4,cr.create("getConversation").check((function(t){return Ql(t,e,Q)})).result().tryTrans(this.validateConnected).next((function(){var t=c(n,WE,"m",QE).call(n,e);return n._engine.chat.getConversation(t)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_CONVERSATION_T,JSON.stringify(e),r),[4,cr.create("removeConversation").check((function(t){return Ql(t,e,K)})).result().tryTrans(this.validateConnected).next((function(){var r=c(i,WE,"m",QE).call(i,e);return i._engine.chat.batchDeleteConversations({identifiers:[r],deleteRemotely:!!t,deleteMessages:!1})}))];case 1:return n=o.sent(),this.logger.summary(B.A_REMOVE_CONVERSATION_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,a,u=this;return s(this,(function(l){switch(l.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),i=this.logger.createTraceId(),this.logger.info(B.A_BATCH_DEL_CONVERS_T,JSON.stringify({identifiers:t,deleteRemotely:r,deleteMessages:n}),i),[4,cr.create("batchDeleteConversations").isLimitedArray("identifiers",t,100,!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans(this.validateConnected).next((function(){return o(u,void 0,void 0,(function(){var e,i=this;return s(this,(function(o){return 0===(e=t.filter((function(e){return Kl("",e,K).result().isOk})).map((function(e){return c(i,WE,"m",QE).call(i,e)}))).length?[2,ur()]:[2,this._engine.chat.batchDeleteConversations({identifiers:e,deleteRemotely:r,deleteMessages:n})]}))}))}))];case 1:return a=l.sent(),this.logger.summary(B.A_BATCH_DEL_CONVERS_R,a,i),[2,a.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,a=this;return s(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(B.A_GET_UG_LIST_T,JSON.stringify({targetId:t,channelType:r}),n),[4,cr.create("getUltraGroupList").validate("targetId",t,At).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isNumberEnum("channelType",r,exports.UltraGroupChannelType).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_TYPE).result().tryTrans(this.validateLogin).next((function(){return o(a,void 0,void 0,(function(){return s(this,(function(t){return this._ugSynced?[2,this._engine.chat.getUltraGroupList(e)]:[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_UG_LIST_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLOCKED_UG_LIST_T,"",e),[4,cr.create("getBlockedUGList").result().tryTrans(this.validateConnected).next((function(){return o(r,void 0,void 0,(function(){return s(this,(function(e){return this._ugSynced?[2,this._engine.chat.getBlockedUGList()]:[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_BLOCKED_UG_LIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"clearUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_UNREAD_COUNT_T,JSON.stringify(e),t),[4,cr.create("clearUnreadCount").check((function(t){return Ql(t,e,X)})).result().tryTrans((function(){return n.checkAuthed(e.conversationType!==exports.ConversationType.ULTRA_GROUP)})).next((function(){return o(n,void 0,void 0,(function(){var t;return s(this,(function(r){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._ugSynced?(t=c(this,WE,"m",QE).call(this,e),[2,this._engine.chat.clearConversationUnreadCount(t)]):[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_CLEAR_UNREAD_COUNT_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"clearAllUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_ALL_UNREAD_COUNT_T,null,e),[4,cr.create("clearAllUnreadCount").result().tryTrans(this.validateLogin).next((function(){return o(r,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.chat.clearAllSGUnreadCount()]}))}))}))];case 1:return t=n.sent(),this.logger.summary(B.A_CLEAR_ALL_UNREAD_COUNT_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_COUNT_T,JSON.stringify(e),t),[4,cr.create("getUnreadCount").check((function(t){return Ql(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){return o(n,void 0,void 0,(function(){var t;return s(this,(function(r){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._ugSynced?(t=c(this,WE,"m",QE).call(this,e),[2,this._engine.chat.getConversationUnreadCount(t)]):[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_TOTAL_UNREAD_COUNT_T,JSON.stringify({conversationTypes:e,includeMuted:t,channelId:r}),n),[4,cr.create("getTotalUnreadCount").validate("channelId",r,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",e,(function(e){return te(e,X)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin).next((function(n){return o(a,void 0,void 0,(function(){var i,o;return s(this,(function(s){return!(i=wg(n))&&e&&e.includes(exports.ConversationType.ULTRA_GROUP)?[2,lr(exports.ErrorCode.METHOD_NOT_SUPPORT)]:(o=e&&e.length>0?e:ee(i?K:W)).includes(exports.ConversationType.ULTRA_GROUP)&&!this._ugSynced?[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCount(o,!!t,r)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_TOTAL_UNREAD_COUNT_R,i,n,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_T,JSON.stringify({conversationTypes:e,levels:t,isMentioned:r}),n),[4,cr.create("getTotalUnreadCountByLevels").isLimitedTypedArray("conversationTypes",e,20,(function(e){return te(e,K)}),!0).fail(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT).isTypedArray("levels",t,mt,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return o(a,void 0,void 0,(function(){return s(this,(function(n){return e.includes(exports.ConversationType.ULTRA_GROUP)&&!this._ugSynced?[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]:[2,this._engine.chat.getTotalUnreadCountByLevels(e,t,r)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_TOTAL_UNREAD_COUNT_BY_LEVELS_R,i,n,void 0,(function(e){return{unreadCount:e}})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FIRST_UNREAD_MEG_T,JSON.stringify(e),t),[4,cr.create("getFirstUnreadMessage").check((function(t){return Ql(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(n,WE,"m",QE).call(n,e);return n._engine.chat.getFirstUnreadMessage(t)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,cr.create("getFirstUnreadMessageDigest").check((function(t){return Ql(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(n,WE,"m",QE).call(n,e);return n._engine.chat.getFirstUnreadMessageDigest(t)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_SET_CONVERSATION_NOTIFICATION_LEVEL_T,JSON.stringify({conversations:e,notificationLevel:t}),r),[4,cr.create("batchSetConversationNotificationLevel").isLimitedTypedArray("conversations",e,20,(function(e){return!Kl("batchSetConversationNotificationLevel",e,K).isFailed}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("notificationLevel",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var r=e.map((function(e){return c(i,WE,"m",QE).call(i,e)}));return i._engine.chat.batchSetConversationNotificationLevel(r,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var i,o,a,u,l,d=this;return s(this,(function(s){switch(s.label){case 0:return i=cr.create("batchSetConversationToTop"),(o=i.isLimitedTypedArray("conversations",e,20,(function(e){return Kl("batchSetConversationToTop",e,K).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).result().tryTrans((function(){return e.every((function(e){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||!e.channelId||"RCDefault"===e.channelId}))?ur():lr(exports.ErrorCode.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING)})).tryTrans(this.validateConnected)).isOk?(a=this.logger.createTraceId(),u=e.map((function(e){return c(d,WE,"m",QE).call(d,e)})),this.logger.info(B.A_BATCH_SET_CONVERSATION_TO_TOP_T,JSON.stringify({conversations:u,isTop:t,isUpdateTime:r,isCreateConversation:n}),a),[4,this._engine.chat.batchSetConversationToTop(u,t,r,n)]):[2,o.wipe()];case 1:return l=s.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_TO_TOP_R,l,a),[2,l]}}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a,u=this;return s(this,(function(s){switch(s.label){case 0:return r=cr.create("batchSetConversationTranslateStrategy"),(n=r.isLimitedTypedArray("conversations",e,20,(function(e){return Kl("",e,K).result().isOk}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST).isNumberEnum("strategy",t,vn,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_STRATEGY).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),this.logger.info(B.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_T,JSON.stringify({conversations:e,strategy:t}),i),o=e.map((function(e){return c(u,WE,"m",QE).call(u,e)})),[4,this._engine.chat.batchSetConversationTranslateStrategy(o,t)]):[2,n.wipe()];case 1:return a=s.sent(),this.logger.summary(B.A_BATCH_SET_CONVERSATION_TRANSLATE_STRATEGY_R,a,i),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){switch(n.label){case 0:return[4,Kl("saveTextMessageDraft",e,X).isString("draft",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_DRAFT).result().tryTrans(this.validateLogin).next((function(){var n=c(r,WE,"m",QE).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 o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){switch(r.label){case 0:return[4,Kl("getTextMessageDraft",e,X).result().tryTrans(this.validateLogin).next((function(){var r=c(t,WE,"m",QE).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 o(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){switch(r.label){case 0:return[4,Kl("clearTextMessageDraft",e,X).result().tryTrans(this.validateLogin).next((function(){var r=c(t,WE,"m",QE).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 o(this,void 0,void 0,(function(){var r,n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),n={conversation:e,messageUId:null==t?void 0:t.messageUId},this.logger.info(B.A_RECALL_MESSAGE_T,JSON.stringify(n),r),[4,cr.create("recallMessage").check((function(t){return Ql(t,e,Q)})).isNotEmptyString("messageUId",t.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isInteger("sentTime",t.sentTime,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isBoolean("disableNotification",t.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isObject("pushConfig",t.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE).isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,At,!1,1).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){var r=c(o,WE,"m",QE).call(o,e);return o._engine.recallMsg(r,t)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DEL_REMOTE_MSGS_T,JSON.stringify({conversation:e,messages:t}),r),[4,cr.create("deleteRemoteMessage").check((function(t){return Ql(t,e,K)})).isLimitedTypedArray("messages",t,100,(function(e){if(!e||"object"!=typeof e)return!1;var t=e.messageUId,r=e.sentTime,n=e.messageDirection;return Et(t)&&(n===exports.MessageDirection.SEND||n===exports.MessageDirection.RECEIVE)&&pt({min:0})(r)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=c(i,WE,"m",QE).call(i,e);return i._engine.chat.deleteRemoteMessage(r,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DEL_REMOTE_MSGS_T,JSON.stringify({identifier:e,timestamp:t}),r),[4,cr.create("deleteRemoteMessageByTimestamp").check((function(t){return Ql(t,e,Q)})).isInteger("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){var r=c(i,WE,"m",QE).call(i,e);return i._engine.chat.deleteRemoteMessageByTimestamp(r,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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,i,a){return o(this,void 0,void 0,(function(){var u=this;return s(this,(function(l){return[2,cr.create("getFileToken").isNumberEnum("fileType",e,exports.FileType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).validate("httpMethod",r,(function(e){return"POST"===e||"PUT"===e})).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`httpMethod` is invalid").isString("queryString",n).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`queryString` is invalid").isString("url",i).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`url` is invalid").isInteger("size",a).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"`size` is invalid").result().tryTrans(this.validateConnected).next((function(l){return o(u,void 0,void 0,(function(){var o,u;return s(this,(function(s){switch(s.label){case 0:return o=l.uploadServer||"",u=l.ossConfig||"",[4,this._engine.getFileToken(e,t,r,n,i,a)];case 1:return[2,s.sent().trans((function(e){return Object.assign(e,{qiniu:o,ossConfig:e.ossConfig||u})}))]}}))}))}))]}))}))}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i=this;return s(this,(function(o){switch(o.label){case 0:return[4,cr.create("getFileUrl").isNumberEnum("fileType",e,exports.FileType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MEDIA_TYPE).isString("fileName",t).fail(exports.ErrorCode.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME).isString("saveName",n).fail(exports.ErrorCode.INVALID_PARAMETER_SAVE_NAME).isNumberEnum("serverType",r,exports.UploadMethod,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SERVER_TYPE).result().tryTrans(this.validateConnected).next((function(){return i._engine.getFileUrl(e,r,t,n||"")}))];case 1:return[2,o.sent()]}}))}))}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ADD_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,cr.create("createTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.createTag(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_ADD_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_TAG_T,JSON.stringify({tagId:e}),t),[4,cr.create("removeTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeTag(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_REMOVE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_TAG_T,JSON.stringify({tagId:null==e?void 0:e.tagId,tagName:null==e?void 0:e.tagName}),t),[4,cr.create("updateTag").isLimitedString("tagId",null==e?void 0:e.tagId,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedString("tagName",null==e?void 0:e.tagName,1,15,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_NAME).result().tryTrans(this.validateConnected).next((function(){return n._engine.updateTag(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_UPDATE_TAG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_TAGS_T,"",e),[4,this.validateLogin().next((function(){return r._engine.getTagList()}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_TAGS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return(r=cr.create("addTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isTypedArray("conversations",t,(function(e){return Kl("",e,W).result().isOk}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS).isLimitedInteger("conversations",null==t?void 0:t.length,1,1e3,!0).fail(exports.ErrorCode.CONVER_OUT_LIMIT_ERROR).result().tryTrans(this.validateConnected)).isOk?(n=t.map((function(e){return c(a,WE,"m",QE).call(a,e)})),i=this.logger.createTraceId(),this.logger.info(B.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return(r=cr.create("removeTagForConversations").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isLimitedTypedArray("conversations",t,1e3,(function(e){return Kl("",e,W).result().isOk}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATIONS).result().tryTrans(this.validateConnected)).isOk?(n=t.map((function(e){return c(a,WE,"m",QE).call(a,e)})),i=this.logger.createTraceId(),this.logger.info(B.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i,o;return s(this,(function(s){switch(s.label){case 0:return(r=Kl("removeTagsForConversation",e,W).isTypedArray("tagIds",t,(function(e){return _t(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).result().tryTrans(this.validateConnected)).isOk?(n=this.logger.createTraceId(),i=c(this,WE,"m",QE).call(this,e),this.logger.info(B.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){return(n=cr.create("getConversationListByTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isInteger("count",r,!0).fail(exports.ErrorCode.CONVER_OUT_LIMIT_ERROR).isLimitedInteger("startTime",t,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_START_TIME).result().tryTrans((function(){return o.checkAuthed(Ot())}))).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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_COUNT_BY_TAG_T,JSON.stringify({tagId:e,containMuted:t}),r),[4,cr.create("getUnreadCountByTag").isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isBoolean("containMuted",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONTAIN_MUTED).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.getUnreadCountByTag(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return(n=Kl("setConversationStatusInTag",t,W).isLimitedString("tagId",e,1,10,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TAG_ID).isBoolean("isTop",null==r?void 0:r.isTop,!0).fail(exports.ErrorCode.INVALID_PARAMETER_IS_TOP).result().tryTrans(this.validateConnected)).isOk?(i=this.logger.createTraceId(),o=c(this,WE,"m",QE).call(this,t),this.logger.info(B.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 a=s.sent(),this.logger.summary(B.A_SET_CONVER_TO_TOP_IN_TAG_R,a,i),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i;return s(this,(function(o){switch(o.label){case 0:return(t=Kl("getTagsForConversation",e,W).result().tryTrans(this.validateLogin)).isOk?(r=this.logger.createTraceId(),n=c(this,WE,"m",QE).call(this,e),this.logger.info(B.A_GET_TAGS_OF_CONVERSATION_T,JSON.stringify(n),r),[4,this._engine.chat.getTagsForConversation(n)]):[2,t.wipe()];case 1:return i=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTIONED_COUNT_T,JSON.stringify(e),t),[4,cr.create("getUnreadMentionedCount").check((function(t){return Ql(t,e,Z)})).result().tryTrans(this.validateLogin).next((function(){return o(n,void 0,void 0,(function(){var t;return s(this,(function(r){return e.conversationType!==exports.ConversationType.ULTRA_GROUP||this._ugSynced?(t=c(this,WE,"m",QE).call(this,e),[2,this._engine.chat.getUnreadMentionedCount(t)]):[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.A_GET_UNREAD_MENTIONED_COUNT_R,r,t),[2,r.trans(bc)]}}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.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(B.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 o(this,void 0,void 0,(function(){var r,n,i,o,a,u,l=this;return s(this,(function(s){switch(s.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,a=null==e?void 0:e.channelId,this.logger.info(B.A_GET_UG_MSGS_BY_UID_T,JSON.stringify({conversationType:i,targetId:o,channelId:a,messageUIds:n}),r),[4,cr.create("getUltraGroupMessageListByMessageUId").check((function(t){return Ql(t,e,K)})).isTypedArray("messages",t,(function(e){return Et(null==e?void 0:e.messageUId)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messages",null==t?void 0:t.length,1,20,!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateConnected).next((function(){var r=c(l,WE,"m",QE).call(l,e);return l._engine.chat.getRemoteMessagesByUIds(r,t.map((function(e){return e.messageUId})))}))];case 1:return u=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,a=this;return s(this,(function(u){switch(u.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_T,JSON.stringify({targetId:e,levels:r,isGetMentioned:t}),n),[4,cr.create("getUGUnreadCountForAllChannels").validate("targetId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).check((function(e){e.isTypedArray("levels",r,(function(t){return!e.isNumberEnum("",t,exports.NotificationLevel,!0).isFailed}))})).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateLogin).next((function(){return o(a,void 0,void 0,(function(){return s(this,(function(n){return this._ugSynced?[2,this._engine.chat.getUGUnreadCountForAllChannels(e,r||[],t)]:[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return i=u.sent(),this.logger.summary(B.A_GET_UG_UNREAD_COUNT_FOR_ALL_CHANNELS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a,u=this;return s(this,(function(s){switch(s.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(B.A_GET_UG_UNREAD_MENTIONED_DIGEST_T,JSON.stringify({targetId:t,channelId:r,sentTime:n,count:i}),o),[4,cr.create("getUGUnreadMentionedDigest").validate("targetId",t,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedInteger("count",i,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isLimitedInteger("sentTime",n,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateConnected).next((function(){return e.channelId=u._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r),u._engine.chat.getUGUnreadMentionedDigest(e)}))];case 1:return a=s.sent(),this.logger.summary(B.A_GET_UG_UNREAD_MENTIONED_DIGEST_R,a,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,i=this;return s(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_FIRST_UNREAD_MSG_DIGEST_T,JSON.stringify(e),t),[4,cr.create("getUGFirstUnreadMessageDigest").validate("targetId",null==e?void 0:e.targetId,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",null==e?void 0:e.channelId,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){return o(i,void 0,void 0,(function(){var t;return s(this,(function(r){return this._ugSynced?(t=c(this,WE,"m",QE).call(this,n(n({},e),{conversationType:exports.ConversationType.ULTRA_GROUP})),[2,this._engine.chat.getUGFirstUnreadMessageDigest(t)]):[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=a.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_UNREAD_INFO_LIST_T,JSON.stringify({targetIds:e}),t),[4,cr.create("getUGUnreadInfoList").isLimitedTypedArray("targetIds",e,20,(function(e){return At(e)}),!0,1).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateLogin).next((function(){return o(n,void 0,void 0,(function(){var t;return s(this,(function(r){return this._ugSynced?(t=new Set(e),[2,this._engine.chat.getUGUnreadInfoList(Array.from(t))]):[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.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 exports.SubscribeType.ONLINE_STATUS:return 1&n?ur(e):lr(exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);case exports.SubscribeType.USER_PROFILE:return 2&n?ur(e):lr(exports.ErrorCode.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE);default:return lr(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE)}}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t,expiry:r}),n),[4,cr.create("subscribeUser").isLimitedTypedArray("userIds",e,200,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("expiry",r,60,2592e3,!0).fail(exports.ErrorCode.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_UNSUBSCRIBE_USER_STATUS_T,JSON.stringify({userIds:e,subscribeType:t}),r),[4,cr.create("unSubscribeUser").isLimitedTypedArray("userIds",e,200,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS).isNumberEnum("subscribeType",t,exports.SubscribeType,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_SUBSCRIBE_USER_STATUS_LIST_T,JSON.stringify({subscribeType:e,count:t,offset:r}),n),[4,cr.create("getSubscribeUserList").isNumberEnum("subscribeType",e,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedInteger("count",t,1,200,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE).isLimitedInteger("offset",r,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_SUB_USERS_STATUS_T,JSON.stringify({subscribeType:e,userIds:t}),r),[4,cr.create("getSubscribeUserStatus").isNumberEnum("subscribeType",e,exports.SubscribeType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SUBSCRIBE_TYPE).isLimitedTypedArray("userIds",t,200,At,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_SUB_USERS_ONLINE_STATUS_T,JSON.stringify({userIds:e}),t),[4,cr.create("getSubscribeUsersOnlineStatus").isLimitedTypedArray("userIds",e,200,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).result().tryTrans(this.validateConnected).next((function(){return n._engine.getSubscribeUsersOnlineStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_UPDATE_MY_USER_PROFILE_T,JSON.stringify({profile:e}),t),[4,cr.create("updateMyUserProfile").isObject("profile",e,!0).check((function(t){var r=e.name,n=e.portraitUri,i=e.email,o=e.birthday,s=e.gender,a=e.location,l=e.role,c=e.level,d=e.extraProfile;t.isString("name",r).isString("portraitUri",n).isString("email",i).isString("birthday",o).isNumber("gender",s).isString("location",a).isNumber("role",l).isNumber("level",c).isObject("extraProfile",d),!t.isFailed&&d&&Object.entries(d).forEach((function(e){var r=u(e,2);r[0];var n=r[1];t.isString("extraProfile",n,!0)}))})).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_USER_PROFILES_T,JSON.stringify({userIds:e}),t),[4,cr.create("getUserProfiles").isLimitedTypedArray("userIds",e,100,At,!0).fail(exports.ErrorCode.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(B.A_GET_USER_PROFILES_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_MY_USER_PROFILE_T,void 0,e),[4,cr.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(B.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 o(this,void 0,void 0,(function(){return s(this,(function(r){return[2,this._engine.chat.clearConversations(e,t)]}))}))}}),Object.defineProperty(e.prototype,"setUserStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){r.logger.error(B.L_CALLBACK_E,null==e?void 0:e.stack)}}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_ADD_TO_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,cr.create("addToBlacklist").validate("userId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.addToBlacklist(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_ADD_TO_BLACKLIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_FROM_BLACKLIST_T,JSON.stringify({userId:e}),t),[4,cr.create("removeFromBlacklist").validate("userId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.removeFromBlacklist(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_REMOVE_FROM_BLACKLIST_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_BLACKLIST_T,void 0,e),[4,cr.create("getBlacklist").result().tryTrans(this.validateConnected).next((function(){return r._engine.getBlacklist()}))];case 1:return t=n.sent(),this.logger.summary(B.A_GET_BLACKLIST_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_BLACKLIST_STATUS_T,JSON.stringify({userId:e}),t),[4,cr.create("getBlacklistStatus").validate("userId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans(this.validateConnected).next((function(){return n._engine.getBlacklistStatus(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_INSERT_MSG_T,JSON.stringify({conversation:e,params:t}),r),[4,cr.create("insertMessage").check((function(t){return Ql(t,e,X)})).validate("senderUserId",t.senderUserId,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isNotEmptyString("messageType",t.messageType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isNumberEnum("messageDirection",t.messageDirection,exports.MessageDirection,!0).fail(exports.ErrorCode.INVALID_MESSAGE_DIRECTION).check((function(e){t.canIncludeExpansion&&t.expansion&&Zl(e,t.expansion,!0)})).isTimestamp("sentTime",t.sentTime).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isNumberEnum("sentStatus",t.sentStatus,exports.SentStatus).fail(exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS).isTypedArray("directedUserIds",t.directedUserIds,At).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isString("searchContent",t.searchContent).fail(exports.ErrorCode.SEARCH_PROPS_LIMIT_ERROR).result().tryTrans((function(){return Jl(t.messageType,t.content)})).tryTrans(this.validateLogin).next((function(){var r=c(i,WE,"m",QE).call(i,e);return i._engine.insertMessage(r,t)}))];case 1:return n=o.sent(),this.logger.summary(B.A_INSERT_MSG_R,n,r),[2,n]}}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_INSERT_MSGS_T,JSON.stringify({count:null==e?void 0:e.length,checkDuplicate:t}),r),i=cr.create(""),[4,cr.create("batchInsertMessage").isLimitedTypedArray("messages",e,500,(function(e){return"object"==typeof e&&(Ql(i,e,X),i.validate("senderUserId",e.senderUserId,At,!0).isNotEmptyString("messageType",e.messageType,!0).isObject("content",e.content,!0).isNumberEnum("messageDirection",e.messageDirection,exports.MessageDirection,!0).check((function(t){e.canIncludeExpansion&&e.expansion&&Zl(t,e.expansion,!0)})).isTimestamp("sentTime",e.sentTime).isNumberEnum("sentStatus",e.sentStatus,exports.SentStatus).isString("searchContent",e.searchContent).isNumber("receivedStatus",e.receivedStatus).isObject("receivedStatusInfo",e.receivedStatusInfo).isTypedArray("directedUserIds",e.directedUserIds,At),!i.isFailed)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).result().tryTrans(this.validateLogin).next((function(){var r=e.map((function(e){return n(n({},e),{channelId:a._channelIdConvert(e.conversationType,e.channelId)})}));return a._engine.batchInsertMessage(r,t)}))];case 1:return o=s.sent(),this.logger.summary(B.A_BATCH_INSERT_MSGS_R,o,r),[2,o]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_LOCAL_MSG_COUNT_T,JSON.stringify({conversation:e}),t),[4,cr.create("getMessageCount").check((function(t){return Ql(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(n,WE,"m",QE).call(n,e);return n._engine.getLocalMessageCount(t)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_DELETE_LOCAL_MSGS_T,JSON.stringify({messageIds:e}),t),[4,cr.create("deleteLocalMessages").isTypedArray("messageIds",e,(function(e){return Number.isInteger(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ARRAY).result().tryTrans(this.validateLogin).next((function(){return n._engine.deleteLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_DEL_LOCAL_MSGS_BY_TIME_T,JSON.stringify({conversation:e,timestamp:t,cleanSpace:r}),n),[4,cr.create("deleteLocalMessagesByTimestamp").check((function(t){return Ql(t,e,X)})).isTimestamp("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){var n=c(o,WE,"m",QE).call(o,e);return o._engine.deleteLocalMessagesByTimestamp(n,t,!!r)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BATCH_CLEAR_LOCAL_MSGS_BY_TIME_T,JSON.stringify({options:e}),t),[4,cr.create("batchClearLocalMessagesByTimestamp").check((function(t){t.isLimitedTypedArray("options",e,20,(function(e){return Ql(t,e,K),!t.isFailed&&pt({min:0})(e.timestamp)})).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_BATCH_CLEAR_REMOTE_MSG_T,JSON.stringify({options:e,isDeleteLocal:t}),r),[4,cr.create("batchClearRemoteHistoryMessages").isLimitedArray("options",e,20,!0,1).check((function(t){e.forEach((function(e){Ql(t,e,K).isTimestamp("timestamp",null==e?void 0:e.timestamp)}))})).fail(exports.ErrorCode.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST,void 0,!0).check((function(t){e.some((function(e){return e.conversationType===exports.ConversationType.ULTRA_GROUP}))&&t.setFailed(exports.ErrorCode.CONVERSATION_TYPE_NOT_SUPPORT)})).result().tryTrans(this.validateConnected).next((function(){return i._engine.chat.batchClearRemoteHistoryMessages(e,!!t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_LOCAL_MSG_T,JSON.stringify({conversation:e}),t),[4,cr.create("clearLocalMessages").check((function(t){return Ql(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){return n._engine.clearLocalMessages(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_CLEAR_LOCAL_MSG_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getLocalMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_LOCAL_MESSAGE_T,JSON.stringify({messageId:e}),t),[4,cr.create("getLocalMessage").validate("messageId",e,(function(){return Et(e)||ft(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).result().next((function(){return n._engine.getMessage(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_MSG_CONTENT_T,JSON.stringify({messageId:e,messageType:r}),n),[4,cr.create("setMessageContent").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isNotEmptyString("messageType",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).isObject("content",t,!0).fail(exports.ErrorCode.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_E_SET_MSG_SENT_STATUS_T,JSON.stringify({messageId:e,sentStatus:t}),r),[4,cr.create("setMessageSentStatus").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isNumberEnum("sentStatus",t,exports.SentStatus,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SENT_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageSentStatus(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_E_SET_MSG_RECEIVED_STATUS_T,JSON.stringify({messageId:e,receivedStatus:t}),r),[4,cr.create("setMessageReceivedStatus").isInteger("messageId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isInteger("receivedStatus",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_RECEIVED_STATUS).result().tryTrans(this.validateLogin).next((function(){return i._engine.setMessageReceivedStatus(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i,o,a,u;return s(this,(function(s){switch(s.label){case 0:return(r=Kl("setMessageStatusToRead",e,W).isNumber("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin)).isOk?(n=this.logger.createTraceId(),i=e.conversationType,o=e.targetId,a=e.channelId,this.logger.info(B.A_E_SET_MESSAGE_STATUS_TO_READ_T,JSON.stringify({conversation:e,timestamp:t}),n),[4,this._engine.updateMessageReceiptStatus(i,o,t,a)]):[2,r.wipe()];case 1:return u=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"subscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){return s(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 o(this,void 0,void 0,(function(){var i,o,a;return s(this,(function(s){switch(s.label){case 0:return(i=cr.create("searchConversationByContent").isNotEmptyString("keyword",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isTypedArray("messageTypes",t,(function(e){return Et(e)})).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).validate("channelId",r,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isTypedArray("conversationTypes",n,(function(e){return te(e,K)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).result().tryTrans(this.validateLogin)).isOk?(o=this.logger.createTraceId(),this.logger.info(B.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:[me.TEXT,me.FILE],r||"",n&&0!==n.length?n:ee(K))]):[2,i.wipe()];case 1:return a=s.sent(),this.logger.summary(B.A_E_SEARCH_CONVERSATION_BY_CONTENT_R,i,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){return[2,this._engine.searchConversationByContentWithAllChannel(e,t&&0!==t.length?t:[me.TEXT,me.FILE],r&&0!==r.length?r:ee(K))]}))}))}}),Object.defineProperty(e.prototype,"searchMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,i;return o(this,void 0,void 0,(function(){var o,a;return s(this,(function(s){switch(s.label){case 0:return(o=Kl("searchMessages",e,X).isLimitedString("keyword",null==t?void 0:t.keyword,0,1e3,!0).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==t?void 0:t.limit,1,st,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==t?void 0:t.offset,0,st).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==t?void 0:t.order,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isObject("timeRange",t.timeRange).validate("timeRange",t.timeRange,(function(e){var t=e.startTime,r=e.endTime;return!t&&!r||!(t&&!ft(t)||r&&!ft(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.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(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST).isTypedArray("senderIds",null===(i=null==t?void 0:t.messageFilter)||void 0===i?void 0:i.senderIds,At).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).result().tryTrans((function(){return Ot()?ur():lr(exports.ErrorCode.NOT_SUPPORT,"Only support electron platform.")})).tryTrans(this.validateLogin)).isOk?(a=c(this,WE,"m",QE).call(this,e),[4,c(this,WE,"m",$E).call(this,n(n({},t),{conversationFilter:{conversationTypes:[a.conversationType],targetIds:[a.targetId],channelIds:"string"==typeof a.channelId?[a.channelId]:[]}}))]):[2,o.wipe()];case 1:return[2,s.sent().orSync((function(){return ur({messages:[],totalMatched:0,conditionsMatched:0})}))]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,a,u;return o(this,void 0,void 0,(function(){var o;return s(this,(function(s){return(o=cr.create("searchMessagesWithParams").isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isLimitedString("keyword",null==e?void 0:e.keyword,0,1e3).fail(exports.ErrorCode.INVALID_PARAMETER_KEYWORD).isLimitedInteger("limit",null==e?void 0:e.limit,1,st,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LIMIT).isLimitedInteger("offset",null==e?void 0:e.offset,0,st).fail(exports.ErrorCode.INVALID_PARAMETER_OFFSET).isLimitedInteger("order",null==e?void 0:e.order,0,1,!0).fail(exports.ErrorCode.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&&!ft(t)||r&&!ft(r))&&(t=null!=t?t:0,r=null!=r?r:Date.now(),t>=0&&t<=r)})).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isTypedArray("conversationTypes",null===(t=null==e?void 0:e.conversationFilter)||void 0===t?void 0:t.conversationTypes,(function(e){return te(e,X)})).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isLimitedTypedArray("targetIds",null===(r=null==e?void 0:e.conversationFilter)||void 0===r?void 0:r.targetIds,20,At,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGETID_LIST).isLimitedTypedArray("channelIds",null===(n=null==e?void 0:e.conversationFilter)||void 0===n?void 0:n.channelIds,10,yt,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isLimitedTypedArray("senderIds",null===(i=null==e?void 0:e.messageFilter)||void 0===i?void 0:i.senderIds,20,At,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isTypedArray("objectNames",null===(a=null==e?void 0:e.messageFilter)||void 0===a?void 0:a.objectNames,(function(e){return"string"==typeof e&&e.length>0&&e.length<=128})).fail(exports.ErrorCode.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,c(this,WE,"m",$E).call(this,e)]):[2,o.wipe()]}))}))}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return o(this,void 0,void 0,(function(){var i,o,a=this;return s(this,(function(s){switch(s.label){case 0:return i=this.logger.createTraceId(),this.logger.info(B.A_GET_MSGS_AROUND_TIMESTAMP_T,JSON.stringify({conversation:e,timestamp:t,beforeCount:r,afterCount:n}),i),[4,cr.create("getMessagesAroundTimestamp").check((function(t){return Ql(t,e,X)})).isLimitedInteger("timestamp",t,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("beforeCount",r,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_BEFORE).isLimitedInteger("afterCount",n,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_AFTER).result().tryTrans(this.validateLogin).next((function(){var i=c(a,WE,"m",QE).call(a,e);return a._engine.chat.getMessagesAroundTimestamp(i,t,r,n)}))];case 1:return o=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTIONED_MSGS_T,JSON.stringify(e),t),[4,cr.create("getUnreadMentionedMessages").check((function(t){return Ql(t,e,X)})).result().tryTrans(this.validateLogin).next((function(){var t=c(n,WE,"m",QE).call(n,e);return n._engine.chat.getUnreadMentionedMessages(t)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_GET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,channelId:t}),r),[4,cr.create("getUltraGroupDefaultNotificationLevel").validate("targetId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",t,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).result().tryTrans(this.validateConnected).next((function(){var r="string"==typeof t?i._channelIdConvert(exports.ConversationType.ULTRA_GROUP,t):t;return i._engine.chat.getUGDefaultNotificationLevel(e,r)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_SET_UG_DEFAULT_NTF_LEVEL_T,JSON.stringify({targetId:e,notificationLevel:t,channelId:r}),n),[4,cr.create("setUltraGroupDefaultNotificationLevel").validate("targetId",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).validate("channelId",r,yt).fail(exports.ErrorCode.INVALID_PARAMETER_CHANNEL_ID).isNumberEnum("notificationLevel",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().tryTrans(this.validateConnected).next((function(){var n="string"==typeof r?o._channelIdConvert(exports.ConversationType.ULTRA_GROUP,r):r;return o._engine.chat.setUGDefaultNotificationLevel(e,t,n)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=Kl("getConversationNotificationLevel",e,K).result()).isOk?[2,this._engine.chat.getConversationNotificationLevel(c(this,WE,"m",QE).call(this,e))]:[2,t.wipe()]}))}))}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=cr.create("setConversationTypeNotificationLevel").validate("conversationType",e,(function(){return te(e,K)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE).isNumberEnum("level",t,exports.NotificationLevel,!0).fail(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var t;return s(this,(function(r){return(t=cr.create("getConversationTypeNotificationLevel").validate("conversationType",e,(function(){return te(e,K)}),!0).fail(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var r,n,i,o,a,u=this;return s(this,(function(s){switch(s.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(B.A_GET_REMOTE_HISTORY_MSG_T,JSON.stringify({conversation:e,options:t}),o),[4,cr.create("getRemoteHistoryMessages").check((function(t){return Ql(t,e,Q)})).isLimitedInteger("timestamp",r,0,Number.MAX_SAFE_INTEGER).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",i,0,1).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).isLimitedInteger("count",n,1,100).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(){var t={timestamp:r||0,count:n||20,order:i||0,messageType:""},o=c(u,WE,"m",QE).call(u,e);return u._engine.getHistoryMessage(o,t,!1)}))];case 1:return a=s.sent(),this.logger.summary(B.A_GET_REMOTE_HISTORY_MSG_R,a,o),[2,a]}}))}))}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.logger.info(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_CONVERSATIONS_T,JSON.stringify({identifiers:e}),t),[4,cr.create("getConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,100,(function(e){return!Ql(t,e,X).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST)})).result().tryTrans(this.validateLogin).next((function(){var t=e.map((function(e){return c(n,WE,"m",QE).call(n,e)}));return n._engine.chat.getConversations(t)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var i=this;return s(this,(function(o){switch(o.label){case 0:return[4,this.validateConnected().next((function(){return i._engine.rtcSignaling(e,t,r,n)}))];case 1:return[2,o.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_PROXY_T,JSON.stringify({proxy:e}),t),[4,cr.create("setProxy").check((function(t){return zl(t,e)})).result().next((function(){return n._engine.setProxy(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_SET_PROXY_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t;return s(this,(function(r){switch(r.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_PROXY_T,JSON.stringify({}),e),[4,this._engine.getProxy()];case 1:return t=r.sent(),this.logger.summary(B.A_GET_PROXY_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_TEST_PROXY_T,JSON.stringify({proxy:e,testHost:t}),r),[4,cr.create("testProxy").check((function(t){return zl(t,e)})).isString("testHost",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TESTHOST).result().next((function(){return i._engine.testProxy(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_REALTIME_CONVERSATIONS_T,JSON.stringify({count:e,startTime:t,order:r}),n),[4,cr.create("getRealtimeConversations").isLimitedInteger("count",e,1,50,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).isTimestamp("startTime",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("order",r,0,1,!0).fail(exports.ErrorCode.INVALID_PARAMETER_ORDER).result().tryTrans(this.validateConnected).tryTrans(Ec).next((function(){return o._engine.chat.getRealtimeConversations(e,t,r)}))];case 1:return i=s.sent(),this.logger.summary(B.A_GET_REALTIME_CONVERSATIONS_R,i,n),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getRealtimeConTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.A_GET_REALTIM_CON_TOTAL_UNREAD_COUNT_T,"",e),[4,this.validateConnected().tryTrans(Ec).next((function(){return r._engine.chat.getRealtimeConTotalUnreadCount()}))];case 1:return t=n.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_CLEAR_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,this.validateConnected().tryTrans(Ec).next((function(){return n._engine.chat.clearRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_REMOVE_REALTIME_CONVERSATIONS_T,JSON.stringify(e),t),[4,cr.create("removeRealtimeConversations").check((function(t){t.isLimitedTypedArray("identifiers",e,20,(function(e){return!Ql(t,e,X).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(Ec).next((function(){return n._engine.chat.removeRealtimeConversations(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_REMOVE_REALTIME_CONVERSATIONS_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"batchGetRealtimeConUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_BATCH_GET_REALTIME_CON_UNREAD_COUNT_T,JSON.stringify(e),t),[4,cr.create("batchGetRealtimeConUnreadCount").check((function(t){t.isLimitedTypedArray("identifiers",e,10,(function(e){return!Ql(t,e,X).isFailed}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_LIST)})).result().tryTrans(this.validateConnected).tryTrans(Ec).next((function(){return n._engine.chat.batchGetRealtimeConUnreadCount(e)}))];case 1:return r=i.sent(),this.logger.summary(B.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 cr.create("setNotificationQuietHoursWithSetting").isObject("opts",e,!0).isString("timezone",e.timezone).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).validate("startTime",e.startTime,(function(e){return/^\d{2}(:\d{2}){2}$/.test(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTRING).isLimitedNumber("spanMinutes",e.spanMinutes,1,1439,!0).fail(exports.ErrorCode.INVALID_PARAMETER_SPAN_MINUTES).isNumberEnum("level",e.level,exports.PushNotificationQuietHoursLevel,!0).fail(exports.ErrorCode.INVALID_PARAMETER_NOTIFICATION_LEVEL).result().next((function(){return t._engine.setNotificationQuietHoursWithSetting(e)}))}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._engine.removeNotificationQuietHoursSetting()}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._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 o(this,void 0,void 0,(function(){var r;return s(this,(function(n){return(r=Kl("sendReadReceiptResponseV5",e,J).isTypedArray("messageUIdArray",t,(function(e){return At(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ur():lr(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var r,n;return s(this,(function(i){return(r=Kl("getMessageReadReceiptInfoV5",e,J).isTypedArray("messageUIdArray",t,(function(e){return At(e)}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",t.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ur():lr(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var t,r;return s(this,(function(n){return t=cr.create(""),(r=cr.create("getMessageReadReceiptInfoV5ByIdentifiers").isTypedArray("identifiers",e,(function(e){return Ql(t,e.identifier,J).isNotEmptyString("messageUId",e.messageUId,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().isOk}),!0).fail(exports.ErrorCode.MSG_LIMIT_ERROR).isLimitedInteger("messageUIdArray",e.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ur():lr(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=Kl("getMessageReadReceiptInfoV5",e,J).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("option",r,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,"option type error").isString("pageToken",r.pageToken).fail(exports.ErrorCode.INVALID_PARAMETER_PAGING_QUERY_OPTION).isLimitedInteger("pageCount",r.pageCount,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ur():lr(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var n;return s(this,(function(i){return(n=Kl("getMessagesReadReceiptByUsersV5",e,J).isNotEmptyString("messageUId",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isTypedArray("userList",r,(function(e){return At(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_USER_ID).isLimitedInteger("userList",r.length,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).tryTrans((function(e){return 4===e.grpRRVer?ur():lr(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_REQUEST_SPEECH_TO_TEXT_FOR_MESSAGE_T,JSON.stringify({messageUId:e,option:t}),r),[4,cr.create("requestSpeechToTextForMessage").isNotEmptyString("messageUId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).result().tryTrans(this.validateConnected).tryTrans((function(e){return!!(1&(e.AIBusinessSub||0))?ur():lr(exports.ErrorCode.SPEECH_TO_TEXT_DISABLE)})).next((function(){return i._engine.chat.requestSpeechToTextForMessage(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r=this;return s(this,(function(n){switch(n.label){case 0:return[4,cr.create("setMessageSpeechToTextVisible").isNumber("messageId",e,!0).fail(exports.ErrorCode.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 o(this,void 0,void 0,(function(){var n,i,o=this;return s(this,(function(s){switch(s.label){case 0:return n=this.logger.createTraceId(),this.logger.info(B.A_GET_UNTAGGED_CONVERSATION_LIST_BY_PAGE_T,JSON.stringify({timestamp:e,count:t,topPriority:r}),n),[4,cr.create("getUntaggedConversationListByPage").isLimitedInteger("timestamp",e,0,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isInteger("count",t,!0).fail(exports.ErrorCode.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=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var r,n,i,o,a;return s(this,(function(s){switch(s.label){case 0:return r=Ot(),[4,cr.create("translateMessagesWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof En&&e.isValid(!r)}),!0).fail(exports.ErrorCode.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(exports.ErrorCode.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,hn).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(n=s.sent()).isOk?(i=e.list,o=e.force,a=e.mode,[2,c(this,WE,"m",eb).call(this,i,0,a,o)]):[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"translateTextsWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return o(this,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return[4,cr.create("translateTextsWithParams").isTypedArray("list",null==e?void 0:e.list,(function(e){return e instanceof bn&&e.isValid(!0)}),!0).fail(exports.ErrorCode.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(exports.ErrorCode.TRANSLATION_PARAMS_LIST_INVALID).isNumberEnum("mode",null==e?void 0:e.mode,hn).fail(exports.ErrorCode.INVALID_PARAMETER_TRANSLATE_MODE).result().tryTrans(this.validateConnected)];case 1:return(r=o.sent()).isOk?(n=e.list,i=e.mode,[2,c(this,WE,"m",eb).call(this,n,1,i)]):[2,r.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_SET_TRANSLATION_LANGUAGE_T,JSON.stringify({language:e}),t),[4,cr.create("setTranslationLanguage").isLimitedString("language",e,1,Number.MAX_SAFE_INTEGER,!0).fail(exports.ErrorCode.INVALID_PARAMETER_LAUGUAGE).result().tryTrans(this.validateConnected).next((function(){return n._engine.userSettings.setTranslationLanguage(e)}))];case 1:return r=i.sent(),this.logger.summary(B.A_SET_TRANSLATION_LANGUAGE_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.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(B.A_GET_TRANSLATION_LANGUAGE_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.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(B.A_SET_AUTO_TRANSLATE_ENABLED_R,r,t),[2,r]}}))}))}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.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(B.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 o(this,void 0,void 0,(function(){var t,r,n,i,o=this;return s(this,(function(s){switch(s.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(B.A_MODIFY_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUId:r,conversation:null==e?void 0:e.conversation}),t),[4,cr.create("modifyMessageWithParams").check((function(t){return Ql(t,null==e?void 0:e.conversation,Z)})).isNotEmptyString("messageUId",r,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isObject("messageContent",n,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isLimitedInteger("messageContent",ec(JSON.stringify(n)),1,Fe,!0).fail(exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT).result().tryTrans(this.validateConnected).next((function(){return o._engine.chat.modifyMessageWithParams(e)}))];case 1:return i=s.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return t=this.logger.createTraceId(),r=null==e?void 0:e.messageUIds,this.logger.info(B.A_REFRESH_REFERENCE_MESSAGE_WITH_PARAMS_T,JSON.stringify({messageUIds:r}),t),[4,Kl("refreshReferenceMessageWithParams",null==e?void 0:e.conversationIdentifier,Z).isObject("params",e,!0).fail(exports.ErrorCode.BIZ_ERROR_INVALID_PARAMETER).isTypedArray("messageUIds",r,(function(e){return Et(e)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_UID).isLimitedInteger("messageUIds",null==r?void 0:r.length,1,20,!0).fail(exports.ErrorCode.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=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.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(B.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 o(this,void 0,void 0,(function(){var r,n,i=this;return s(this,(function(o){switch(o.label){case 0:return r=this.logger.createTraceId(),this.logger.info(B.A_DEL_LOCAL_UG_MSGS_FOR_ALL_CHANNEL_T,JSON.stringify({targetId:e,timestamp:t}),r),[4,cr.create("deleteLocalUGMessagesForAllChannel").isNotEmptyString("targetId",e,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).isTimestamp("timestamp",t,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).result().tryTrans(this.validateLogin).next((function(){return i._engine.chat.deleteLocalUGMessagesForAllChannel(e,t)}))];case 1:return n=o.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var t,r,n=this;return s(this,(function(i){switch(i.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_UNREAD_MENTION_ME_CONVERSATION_LIST_T,JSON.stringify({params:e}),t),[4,cr.create("getUnreadMentionMeConversationList").isLimitedTypedArray("conversationTypes",null==e?void 0:e.conversationTypes,Number.MAX_SAFE_INTEGER,(function(e){return te(e,K)}),!0).fail(exports.ErrorCode.INVALID_PARAMETER_CONVERSATION_TYPE_LIST).isTimestamp("timestamp",null==e?void 0:e.timestamp,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TIMESTAMP).isLimitedInteger("count",null==e?void 0:e.count,1,100,!0).fail(exports.ErrorCode.INVALID_PARAMETER_COUNT).result().tryTrans(this.validateConnected).next((function(t){return o(n,void 0,void 0,(function(){var r;return s(this,(function(n){if(r=wg(t)){if(!this._ugSynced)return[2,lr(exports.ErrorCode.METHOD_NOT_AVAILABLE)]}else if(e.conversationTypes=e.conversationTypes.filter((function(e){return e!==exports.ConversationType.ULTRA_GROUP})),0===e.conversationTypes.length)return[2,ur([])];return[2,this._engine.chat.getUnreadMentionMeConversationList(e,r)]}))}))}))];case 1:return r=i.sent(),this.logger.summary(B.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 o(this,void 0,void 0,(function(){var e,t,r=this;return s(this,(function(n){switch(n.label){case 0:return e=this.logger.createTraceId(),this.logger.info(B.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(B.A_GET_ALL_ROBOTS_R,t,e),[2,t]}}))}))}}),Object.defineProperty(e.prototype,"getRobotById",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return o(this,void 0,void 0,(function(){var t,r,n,i=this;return s(this,(function(a){switch(a.label){case 0:return t=this.logger.createTraceId(),this.logger.info(B.A_GET_ROBOT_BY_ID_T,JSON.stringify({id:e}),t),[4,cr.create("getRobotById").validate("id",e,At,!0).fail(exports.ErrorCode.INVALID_PARAMETER_TARGET_ID).result().tryTrans(this.validateConnected).next((function(){return o(i,void 0,void 0,(function(){return s(this,(function(e){return[2,this._engine.getAllRobots()]}))}))}))];case 1:return r=a.sent(),n=r.trans((function(t){return t.find((function(t){return t.robotId===e}))||null})),this.logger.summary(B.A_GET_ROBOT_BY_ID_R,r,t,{id:e,robot:n.data}),[2,n]}}))}))}}),e}();WE=new WeakSet,JE=function(e,t,r){var n,i;return o(this,void 0,void 0,(function(){var a,u,l=this;return s(this,(function(c){switch(c.label){case 0:return[4,cr.create("connect").isNotEmptyString("token",e).fail(exports.ErrorCode.RC_CONN_TOKEN_INCORRECT).result().next((function(){return o(l,void 0,void 0,(function(){var n,i;return s(this,(function(o){switch(o.label){case 0:return this._token=e,[4,Zo.getNetworkType()];case 1:return n=o.sent(),this._engine.setNetwork({status:!0,type:n},!0),i=!!this._pluginInstanseMap.RCCallPlus,[2,this._engine.connect(e,t,i,r)]}}))}))}))];case 1:return(a=c.sent()).isOk&&1!==this._engine.naviInfo.type&&(u=ut.getInfo(),null===(i=(n=this._engine).reportSDKInfo)||void 0===i||i.call(n,u)),[2,a]}}))}))},KE=function(e,t){return o(this,void 0,void 0,(function(){var r=this;return s(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(B.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},QE=function(e){return n(n({},e),{channelId:this._channelIdConvert(e.conversationType,e.channelId)})},XE=function(e,t,r,n){return o(this,void 0,void 0,(function(){var i=this;return s(this,(function(o){switch(o.label){case 0:return[4,cr.create("sendMessage").check((function(t){return Ql(t,e,X)})).isObject("content",t.content,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isString("messageType",t.messageType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_TYPE).check((function(e){var r=Jl(t.messageType,t.content);r.isOk||e.setFailed(r.code)})).isNumber("messageId",t.messageId).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_ID).isBoolean("isStatusMessage",t.isStatusMessage).fail(exports.ErrorCode.INVALID_PARAMETER_IS_STATUS_MESSAGE).isBoolean("disableNotification",t.disableNotification).fail(exports.ErrorCode.INVALID_PARAMETER_DISABLE_NOTIFICATION).isString("pushContent",t.pushContent).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONTENT).isString("pushData",t.pushData).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_DATA).isObject("pushConfig",t.pushConfig).fail(exports.ErrorCode.INVALID_PARAMETER_PUSH_CONFIG).isBoolean("isVoipPush",t.isVoipPush).fail(exports.ErrorCode.INVALID_PARAMETER_IS_VOIP_PUSH).isBoolean("canIncludeExpansion",t.canIncludeExpansion).fail(exports.ErrorCode.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION).check((function(e){t.canIncludeExpansion&&t.expansion&&Zl(e,t.expansion,!0)})).check((function(r){r.isBoolean("disableUpdateLastMessage",t.disableUpdateLastMessage).fail(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE),r.isFailed||e.conversationType===exports.ConversationType.ULTRA_GROUP&&t.disableUpdateLastMessage&&r.setFailed(exports.ErrorCode.INVALID_DISABLE_UPDATE_LAST_MESSAGE)})).check((function(r){if(!r.isLimitedTypedArray("directionalUserIdList",t.directionalUserIdList,300,At,!1,0).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isFailed&&t.directionalUserIdList&&0!==t.directionalUserIdList.length){var n=e.conversationType;[exports.ConversationType.GROUP,exports.ConversationType.ULTRA_GROUP,exports.ConversationType.APP_PUBLIC_SERVICE,exports.ConversationType.PUBLIC_SERVICE].includes(n)||r.setFailed(exports.ErrorCode.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE)}})).isBoolean("isMentioned",t.isMentioned).fail(exports.ErrorCode.INVALID_PARAMETER_IS_MENTIONED).check((function(r){var n=e.conversationType;if(!t.isMentioned||n!==exports.ConversationType.GROUP&&n!==exports.ConversationType.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,exports.MentionedType,!0).fail(exports.ErrorCode.INVALID_PARAMETER_MENTIONED_TYPE).isTypedArray("mentionedUserIdList",null==i?void 0:i.userIdList,At,(null==i?void 0:i.type)===exports.MentionedType.SINGAL).fail(exports.ErrorCode.INVALID_PARAMETER_USERIDLIST).isString("mentionedContent",null==i?void 0:i.mentionedContent).fail(exports.ErrorCode.INVALID_PARAMETER_MESSAGE_CONTENT).isFailed&&(t.content.mentionedInfo=i)}})).result().tryTrans(this.validateConnected).tryTrans((function(r){if(!t.needReceipt)return ur(r);if(r.grpRRVer!==Ve.V5)return lr(exports.ErrorCode.READ_RECEIPT_ERROR);var n=e.conversationType,i=dn(t.messageType),o=i.isPersited,s=i.isStatusMessage;return(n!==exports.ConversationType.GROUP&&n!==exports.ConversationType.PRIVATE||t.isStatusMessage||s||!o||n===exports.ConversationType.GROUP&&t.directionalUserIdList&&t.directionalUserIdList.length>0)&&(t.needReceipt=!1),ur(r)})).tryTrans((function(r){var n=e.conversationType,i=t.messageType;if(n===exports.ConversationType.SYSTEM&&i!==me.SYNC_READ_STATUS)return lr(exports.ErrorCode.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE);if(i===me.STREAM_MESSAGE)return lr(exports.ErrorCode.MESSAGE_NOT_SUPPORT_SENDING);if(i===me.READ_RECEIPT_RESPONSE&&r.grpRRVer)return lr(exports.ErrorCode.READ_RECEIPT_ERROR);var o=JSON.stringify(t.content);return ec(o)>Fe?lr(exports.ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT):ur()})).next((function(){return c(i,WE,"m",ZE).call(i,e,t,r,n)}))];case 1:return[2,o.sent()]}}))}))},ZE=function(e,t,r,n){var i=c(this,WE,"m",QE).call(this,e);return i.conversationType===exports.ConversationType.ULTRA_GROUP?this._engine.sendUltraMessage(i,t,r,n):this._engine.sendMessage(i,t,r,n)},zE=function(e,t,r){return o(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return[4,this._engine.sendMessage(e,{content:t,messageType:me.EXPANSION_NOTIFY},r)];case 1:return[2,n.sent().wipe()]}}))}))},$E=function(e){return o(this,void 0,void 0,(function(){var t,r,n,i,o,a;return s(this,(function(s){switch(s.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(B.A_SEARCH_MSGS_BY_PARAMS_T,JSON.stringify(e),o),[4,this._engine.searchMessagesWithParams(e)];case 1:return a=s.sent(),this.logger.summary(B.A_SEARCH_MSGS_BY_PARAMS_R,a,o),[2,a]}}))}))},eb=function(e,t,r,n){return o(this,void 0,void 0,(function(){return s(this,(function(i){return[2,this._engine.translateWithParams(e.map((function(e){return e.toInnerParam()})),r||hn.MECHANICAL,!!n,t)]}))}))},exports.APIContext=nb,exports.AppStorage=nc,exports.BasicEngine=Vl,exports.BasicLogger=Hr,exports.Codec=Ul,exports.EventEmitter=Ml,exports.FilterRobotType=xe,exports.GroupReadReceiptVersion=Ve,exports.LogDBProxy=Qr,exports.LogTagId=B,exports.MAX_MESSAGE_CONTENT_BYTES=Fe,exports.MAX_U32_INTEGER=st,exports.MAX_UPLOAD_FILE_SIZE=5368709120,exports.MessageAuditType={DISALLOW:0,ALLOW:1},exports.MessageType=me,exports.PBCodec=sl,exports.PluginContext=Bl,exports.RCResult=ar,exports.RTCPluginContext=Hl,exports.ReferenceMessageStatus=wr,exports.SpeechToTextStatus=Ge,exports.SuspendablePromise=sr,exports.TranslateMessageParam=En,exports.TranslateMode=hn,exports.TranslateStatus=Tn,exports.TranslateStrategy=vn,exports.TranslateTextParam=bn,exports.UPLOAD_FILE_CHUNK_SIZE=10485760,exports.UUId=lt,exports.UserSettingsChangedKey=Ur,exports.UserType={NORMAL:0,ROBOT:1},exports.Validator=cr,exports.VersionManage=ut,exports.assert=function(e,t,r,n){if(void 0===n&&(n=!1),!Wl(e,t,r,n))throw new Yl("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},exports.createLogDBProxy=Xr,exports.fail=lr,exports.fixUrlProtocol=zt,exports.forEach=wl,exports.getMessageTypeDescription=dn,exports.getUUID=function(){return lt.gen()},exports.getUUID22=function(){return lt.genWithLen(22)},exports.hasMessageTypeDescription=function(e){return cn.has(e)},exports.httpRequest=Nr,exports.isArray=ht,exports.isBoolean=function(e){return"boolean"==typeof e},exports.isFunction=Tt,exports.isHttpUrl=Rt,exports.isInteger=pt,exports.isLimitedString=gt,exports.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},exports.isNumber=ft,exports.isObject=bt,exports.isString=_t,exports.isUndefined=vt,exports.isValidConversationType=function(e){return ft(e)&&Object.prototype.hasOwnProperty.call(exports.ConversationType,e)},exports.isValidEnum=function(e){return Object.values(e.type).includes(e.value)},exports.isValidFileType=function(e){return ft(e)&&Object.prototype.hasOwnProperty.call(exports.FileType,e)},exports.isValidGroupId=St,exports.isValidTargetId=At,exports.logger=Ll,exports.map=function(e,t){return wl(e,(function(r,n){e[n]=t(r,n)})),e},exports.notEmptyArray=function(e){return ht(e)&&e.length>0},exports.notEmptyObject=It,exports.notEmptyString=Et,exports.ok=ur,exports.promiseWithResolvers=pr,exports.runtime=Zo,exports.trans2IReceivedStatusInfo=Ct,exports.trans2NotificationLevel=function(e){return e===exports.NotificationStatus.OPEN?exports.NotificationLevel.AT_MESSAGE_NOTIFICATION:exports.NotificationLevel.NOT_SET},exports.trans2NotificationStatus=we,exports.transformReceivedStatusFlag=function(e){var t=exports.ReceivedStatus.UNREAD;return(null==e?void 0:e.isRead)&&(t|=exports.ReceivedStatus.READ),(null==e?void 0:e.isListened)&&(t|=exports.ReceivedStatus.LISTENED),(null==e?void 0:e.isDownload)&&(t|=exports.ReceivedStatus.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=exports.ReceivedStatus.RETRIEVED),t},exports.usingCppEngine=Ot,exports.validate=Wl;