mezon-js 2.16.20 → 2.16.22
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/dist/mezon-js.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var me=Object.create;var z=Object.defineProperty,ge=Object.defineProperties,_e=Object.getOwnPropertyDescriptor,fe=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertyNames,ne=Object.getOwnPropertySymbols,be=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable;var ie=(y,e,t)=>e in y?z(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t,S=(y,e)=>{for(var t in e||(e={}))se.call(e,t)&&ie(y,t,e[t]);if(ne)for(var t of ne(e))Ce.call(e,t)&&ie(y,t,e[t]);return y},M=(y,e)=>ge(y,fe(e));var Ae=(y,e)=>{for(var t in e)z(y,t,{get:e[t],enumerable:!0})},re=(y,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ye(e))!se.call(y,r)&&r!==t&&z(y,r,{get:()=>e[r],enumerable:!(n=_e(e,r))||n.enumerable});return y};var oe=(y,e,t)=>(t=y!=null?me(be(y)):{},re(e||!y||!y.__esModule?z(t,"default",{value:y,enumerable:!0}):t,y)),Pe=y=>re(z({},"__esModule",{value:!0}),y);var l=(y,e,t)=>new Promise((n,r)=>{var o=c=>{try{i(t.next(c))}catch(d){r(d)}},a=c=>{try{i(t.throw(c))}catch(d){r(d)}},i=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,a);i((t=t.apply(y,e)).next())});var Fe={};Ae(Fe,{ApiAppRole:()=>ce,ChannelStreamMode:()=>de,ChannelType:()=>le,Client:()=>ee,ConnectionState:()=>p,CreateChannelMessageFromEvent:()=>$,E_CONNECT_ERROR:()=>X,EveryoneChannelExcludeType:()=>ae.EveryoneChannelExcludeType,NotificationType:()=>ue,WebrtcSignalingType:()=>he,b64DecodeUnicode:()=>Re,b64EncodeUnicode:()=>we,buildFetchOptions:()=>m,decodeAttachments:()=>x,decodeChannelTimelineAttachments:()=>T,decodeGenerateMeetTokenResponse:()=>Y,decodeMentions:()=>B,decodeNotificationFcm:()=>G,decodeReactions:()=>N,decodeRefs:()=>W,encodeAttachments:()=>Me,encodeMentions:()=>ve,encodeNotificationFcm:()=>Ee,encodeReactions:()=>qe,encodeRefs:()=>ke,normalizeClanHashtags:()=>I,safeJSONParse:()=>P});module.exports=Pe(Fe);var no=require("whatwg-fetch");var ae=require("mezon-js-protobuf");var H=require("js-base64"),R=oe(require("mezon-js-protobuf"));function Y(y){let e=y[0];if(y.length===0||e===10||e===18)try{return R.GenerateMeetTokenResponse.decode(y)}catch(n){}return{token:new TextDecoder("utf-8").decode(y)}}function m(y,e,t){let n=S({method:y},e);return n.headers=S({},e.headers),Object.keys(n.headers).includes("Accept")||(n.headers.Accept="application/proto"),Object.keys(n.headers).includes("Content-Type")||(n.headers["Content-Type"]="application/proto"),Object.keys(n.headers).forEach(r=>{n.headers[r]||delete n.headers[r]}),t&&(n.body=t),n}function we(y){return(0,H.encode)(encodeURIComponent(y).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function Re(y){return decodeURIComponent((0,H.decode)(y).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var Se=512;function I(y){let e=y.trim();if(!e)return"";let n=e.split(",").map(r=>r.trim()).filter(r=>r.length>0).join(",");if([...n].length>Se)throw new Error("clan hashtags too long");return n}function P(y){if(y==null)return{t:y};let e;if(y instanceof Uint8Array)e=new TextDecoder().decode(y);else if(typeof y=="string")e=y;else return typeof y=="object"?y:{t:y};if(!e||e===""||e==="[]")return{t:e};try{return JSON.parse(e)}catch(t){try{let n=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(n)}catch(n){return console.error("JSON Parse failed completely:",{original:e,error:n}),{t:e}}}}var O=y=>!y||y===null||y===void 0||y===""||y==="[]";function B(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.MessageMentionList.decode(r)}catch(n){return P(y)}}function x(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.MessageAttachmentList.decode(r)}catch(n){return P(y)}}function T(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.ListChannelTimelineAttachment.decode(r)}catch(n){return P(y)}}function W(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.MessageRefList.decode(r)}catch(n){return P(y)}}function N(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.MessageReactionList.decode(r)}catch(n){return P(y)}}function G(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return R.DirectFcmProto.decode(r)}catch(n){return P(y)}}function ve(y){return R.MessageMentionList.encode(R.MessageMentionList.fromPartial(y)).finish()}function Me(y){return R.MessageAttachmentList.encode(R.MessageAttachmentList.fromPartial(y)).finish()}function ke(y){return R.MessageRefList.encode(R.MessageRefList.fromPartial(y)).finish()}function qe(y){return R.MessageReactionList.encode(R.MessageReactionList.fromPartial(y)).finish()}function Ee(y){return R.DirectFcmProto.encode(R.DirectFcmProto.fromPartial(y)).finish()}var ce=(o=>(o[o.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",o[o.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",o[o.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",o[o.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",o[o.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",o))(ce||{});var le=(d=>(d[d.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",d[d.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",d[d.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",d[d.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",d[d.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",d[d.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",d[d.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",d[d.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",d[d.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",d))(le||{}),de=(o=>(o[o.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",o[o.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",o[o.STREAM_MODE_DM=4]="STREAM_MODE_DM",o[o.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",o[o.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",o))(de||{}),ue=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(ue||{}),he=(d=>(d[d.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",d[d.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",d[d.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",d[d.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",d[d.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",d[d.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",d[d.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",d[d.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",d[d.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",d))(he||{});function $(y){let e,t,n,r,o,a;try{e=P(y.channel_message.content)}catch(c){console.log("content is invalid",c)}try{t=N(y.channel_message.reactions)}catch(c){console.log("reactions is invalid",c)}try{n=B(y.channel_message.mentions)}catch(c){console.log("mentions is invalid",c)}try{r=x(y.channel_message.attachments)}catch(c){console.log("attachments is invalid",c)}try{o=W(y.channel_message.references)}catch(c){console.log("references is invalid",c)}try{a=y.channel_message.referenced_message}catch(c){console.log("referenced messages is invalid",c)}return{id:y.id||y.channel_message.message_id,avatar:y.channel_message.avatar,channel_id:y.channel_message.channel_id,mode:y.channel_message.mode,channel_label:y.channel_message.channel_label,clan_id:y.channel_message.clan_id,code:y.channel_message.code,message_id:y.channel_message.message_id,sender_id:y.channel_message.sender_id,update_time:y.channel_message.update_time,clan_logo:y.channel_message.clan_logo,category_name:y.channel_message.category_name,username:y.channel_message.username,clan_nick:y.channel_message.clan_nick,clan_avatar:y.channel_message.clan_avatar,display_name:y.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:n==null?void 0:n.mentions,attachments:r==null?void 0:r.attachments,referenced_message:a,references:o==null?void 0:o.refs,hide_editted:y.channel_message.hide_editted,is_public:y.channel_message.is_public,create_time_seconds:y.channel_message.create_time_seconds,update_time_seconds:y.channel_message.update_time_seconds,topic_id:y.channel_message.topic_id}}var X=(t=>(t.TIME_OUT="TIME_OUT",t.SOCKET_CLOSED_BEFORE_ESTABLISH="SOCKET_CLOSED_BEFORE_ESTABLISH",t))(X||{});var k=require("js-base64"),s=oe(require("mezon-js-protobuf")),pe=require("mezon-js-protobuf");var Te="CHECK_HEALTHY",j=class{constructor(){this.maxAllowedFailures=3;this.minAllowedFastRate=.95;this.maxAllowedLatencyMs=1e3;this.metricsWindowMs=6e4;this.minRequests=20;this.windowStartTime=0;this.totalRequests=0;this.failed=0;this.slowCount=0;this.requests=new Map}start(e){this.requests.set(e,performance.now())}end(e,t=!1){let n=this.requests.get(e);if(n===void 0)return;let r=performance.now();this.windowStartTime!==0&&n-this.windowStartTime>=this.metricsWindowMs&&(this.reset(),this.windowStartTime=n);let o=r-n;if(this.totalRequests++,t?this.failed++:o>this.maxAllowedLatencyMs&&this.slowCount++,this.totalRequests>=this.minRequests){let a=(this.totalRequests-this.slowCount)/this.totalRequests;a<this.minAllowedFastRate&&(typeof window!="undefined"&&window.dispatchEvent(new CustomEvent(Te,{detail:{requestId:e,fastRate:a,totalRequests:this.totalRequests,slowCount:this.slowCount}})),this.reset(),this.windowStartTime=performance.now())}this.requests.delete(e)}get shouldSwitch(){if(this.totalRequests<this.minRequests)return!1;let e=(this.totalRequests-this.slowCount)/this.totalRequests;return this.failed>=this.maxAllowedFailures||e<this.minAllowedFastRate}get stats(){let e=this.totalRequests>0?this.slowCount/this.totalRequests:0,t=this.totalRequests>0?(this.totalRequests-this.slowCount)/this.totalRequests:0;return{totalRequests:this.totalRequests,failedCount:this.failed,slowCount:this.slowCount,slowRate:e,fastRate:t,isUnhealthy:this.shouldSwitch}}reset(){this.windowStartTime=0,this.totalRequests=0,this.failed=0,this.slowCount=0,this.requests.clear()}};var Z=(u=>(u[u.ListChannelDescs=0]="ListChannelDescs",u[u.GetAccount=1]="GetAccount",u[u.ListClanDescs=2]="ListClanDescs",u[u.ListClanUsers=3]="ListClanUsers",u[u.ListRoles=4]="ListRoles",u[u.ListEvents=5]="ListEvents",u[u.GetRoleOfUserInTheClan=6]="GetRoleOfUserInTheClan",u[u.GetListPermission=7]="GetListPermission",u[u.ListUserPermissionInChannel=8]="ListUserPermissionInChannel",u[u.GetNotificationClan=9]="GetNotificationClan",u[u.ListMutedChannel=10]="ListMutedChannel",u[u.ListStreamingChannelUsers=11]="ListStreamingChannelUsers",u[u.ListQuickMenuAccess=12]="ListQuickMenuAccess",u[u.GetNotificationChannel=13]="GetNotificationChannel",u[u.ListFriends=14]="ListFriends",u[u.EmojiRecentList=15]="EmojiRecentList",u[u.GetListEmojisByUserId=16]="GetListEmojisByUserId",u[u.ListClanBadgeCount=17]="ListClanBadgeCount",u[u.ListChannelBadgeCount=18]="ListChannelBadgeCount",u[u.ListLogedDevice=19]="ListLogedDevice",u[u.ListClanUsersStatus=20]="ListClanUsersStatus",u[u.ListChannelApps=21]="ListChannelApps",u[u.GetListFavoriteChannel=22]="GetListFavoriteChannel",u[u.ListCategoryDescs=23]="ListCategoryDescs",u[u.ListOnboarding=24]="ListOnboarding",u[u.GetListStickersByUserId=25]="GetListStickersByUserId",u[u.GetSystemMessageByClanId=26]="GetSystemMessageByClanId",u[u.GetPinMessagesList=27]="GetPinMessagesList",u[u.GetChannelCanvasList=28]="GetChannelCanvasList",u[u.ListChannelTimeline=29]="ListChannelTimeline",u[u.ListChannelMessages=30]="ListChannelMessages",u[u.ListActivity=31]="ListActivity",u[u.ListChannelByUserId=32]="ListChannelByUserId",u[u.ListUserClansByUserId=33]="ListUserClansByUserId",u[u.GetUserProfileOnClan=34]="GetUserProfileOnClan",u[u.RegistFCMDeviceToken=35]="RegistFCMDeviceToken",u[u.IsBanned=36]="IsBanned",u[u.ListThreadDescs=37]="ListThreadDescs",u[u.ListArchivedChannelDescs=38]="ListArchivedChannelDescs",u[u.ListChannelDetail=39]="ListChannelDetail",u[u.GetChannelCategoryNotiSettingsList=40]="GetChannelCategoryNotiSettingsList",u[u.ListRoleUsers=41]="ListRoleUsers",u[u.ListChannelUsers=42]="ListChannelUsers",u[u.ListChannelAttachment=43]="ListChannelAttachment",u[u.ListChannelVoiceUsers=44]="ListChannelVoiceUsers",u[u.ListUserOnline=45]="ListUserOnline",u[u.ListNotifications=46]="ListNotifications",u[u.ListChannelUsersUC=47]="ListChannelUsersUC",u[u.ListWebhookByChannelId=48]="ListWebhookByChannelId",u[u.GetPermissionByRoleIdChannelId=49]="GetPermissionByRoleIdChannelId",u[u.ListChannelSetting=50]="ListChannelSetting",u[u.ListApps=51]="ListApps",u[u.GetApp=52]="GetApp",u[u.ListForSaleItems=53]="ListForSaleItems",u[u.ListClanWebhook=54]="ListClanWebhook",u[u.GetUserStatus=55]="GetUserStatus",u[u.ListSdTopic=56]="ListSdTopic",u[u.AddFriends=57]="AddFriends",u[u.AddChannelUsers=58]="AddChannelUsers",u[u.RegistrationEmail=59]="RegistrationEmail",u[u.BlockFriends=60]="BlockFriends",u[u.UnblockFriends=61]="UnblockFriends",u[u.UploadAttachmentFile=62]="UploadAttachmentFile",u[u.UploadOauthFile=63]="UploadOauthFile",u[u.AddRolesChannelDesc=64]="AddRolesChannelDesc",u[u.CreateCategoryDesc=65]="CreateCategoryDesc",u[u.CreateChannelDesc=66]="CreateChannelDesc",u[u.CreateRole=67]="CreateRole",u[u.CreateEvent=68]="CreateEvent",u[u.DeleteRole=69]="DeleteRole",u[u.DeleteEvent=70]="DeleteEvent",u[u.DeleteRoleChannelDesc=71]="DeleteRoleChannelDesc",u[u.DeleteChannelDesc=72]="DeleteChannelDesc",u[u.CloseDMByChannelId=73]="CloseDMByChannelId",u[u.OpenDMByChannelId=74]="OpenDMByChannelId",u[u.DeleteAccount=75]="DeleteAccount",u[u.DeleteFriends=76]="DeleteFriends",u[u.DeleteCategoryDesc=77]="DeleteCategoryDesc",u[u.DeleteNotifications=78]="DeleteNotifications",u[u.DeleteClanDesc=79]="DeleteClanDesc",u[u.UpdateUser=80]="UpdateUser",u[u.UpdateUserProfileByClan=81]="UpdateUserProfileByClan",u[u.UpdateClanOrder=82]="UpdateClanOrder",u[u.RemoveChannelUsers=83]="RemoveChannelUsers",u[u.LeaveThread=84]="LeaveThread",u[u.ArchiveChannel=85]="ArchiveChannel",u[u.LinkSMS=86]="LinkSMS",u[u.ConfirmLinkMezonOTP=87]="ConfirmLinkMezonOTP",u[u.LinkEmail=88]="LinkEmail",u[u.CreateClanDesc=89]="CreateClanDesc",u[u.RemoveClanUsers=90]="RemoveClanUsers",u[u.BanClanUsers=91]="BanClanUsers",u[u.CreateLinkInviteUser=92]="CreateLinkInviteUser",u[u.InviteUser=93]="InviteUser",u[u.SetRoleChannelPermission=94]="SetRoleChannelPermission",u[u.SetNotificationChannelSetting=95]="SetNotificationChannelSetting",u[u.SetMuteChannel=96]="SetMuteChannel",u[u.SetMuteCategory=97]="SetMuteCategory",u[u.SetNotificationClanSetting=98]="SetNotificationClanSetting",u[u.SetNotificationCategorySetting=99]="SetNotificationCategorySetting",u[u.DeleteNotificationCategorySetting=100]="DeleteNotificationCategorySetting",u[u.DeleteNotificationChannel=101]="DeleteNotificationChannel",u[u.CreatePinMessage=102]="CreatePinMessage",u[u.CreateMessage2Inbox=103]="CreateMessage2Inbox",u[u.UnlinkMezon=104]="UnlinkMezon",u[u.UnlinkEmail=105]="UnlinkEmail",u[u.UpdateAccount=106]="UpdateAccount",u[u.UpdateUsername=107]="UpdateUsername",u[u.UpdateCategory=108]="UpdateCategory",u[u.UpdateCategoryOrder=109]="UpdateCategoryOrder",u[u.UpdateRoleOrder=110]="UpdateRoleOrder",u[u.UpdateClanDesc=111]="UpdateClanDesc",u[u.UpdateChannelDesc=112]="UpdateChannelDesc",u[u.UpdateChannelPrivate=113]="UpdateChannelPrivate",u[u.UpdateRole=114]="UpdateRole",u[u.UpdateEvent=115]="UpdateEvent",u[u.SearchMessage=116]="SearchMessage",u[u.CreateClanEmoji=117]="CreateClanEmoji",u[u.DeleteByIdClanEmoji=118]="DeleteByIdClanEmoji",u[u.UpdateClanEmojiById=119]="UpdateClanEmojiById",u[u.GenerateWebhook=120]="GenerateWebhook",u[u.HandleWebhook=121]="HandleWebhook",u[u.UpdateWebhookById=122]="UpdateWebhookById",u[u.DeleteWebhookById=123]="DeleteWebhookById",u[u.AddClanSticker=124]="AddClanSticker",u[u.UpdateClanStickerById=125]="UpdateClanStickerById",u[u.DeleteClanStickerById=126]="DeleteClanStickerById",u[u.ChangeChannelCategory=127]="ChangeChannelCategory",u[u.CheckDuplicateName=128]="CheckDuplicateName",u[u.AddApp=129]="AddApp",u[u.DeleteApp=130]="DeleteApp",u[u.UpdateApp=131]="UpdateApp",u[u.AddAppToClan=132]="AddAppToClan",u[u.CreateSystemMessage=133]="CreateSystemMessage",u[u.UpdateSystemMessage=134]="UpdateSystemMessage",u[u.DeleteSystemMessage=135]="DeleteSystemMessage",u[u.StreamingServerCallback=136]="StreamingServerCallback",u[u.EditChannelCanvases=137]="EditChannelCanvases",u[u.GetChannelCanvasDetail=138]="GetChannelCanvasDetail",u[u.DeleteChannelCanvas=139]="DeleteChannelCanvas",u[u.AddChannelFavorite=140]="AddChannelFavorite",u[u.RemoveChannelFavorite=141]="RemoveChannelFavorite",u[u.CreateActiviy=142]="CreateActiviy",u[u.GetPubKeys=143]="GetPubKeys",u[u.PushPubKey=144]="PushPubKey",u[u.GetChanEncryptionMethod=145]="GetChanEncryptionMethod",u[u.SetChanEncryptionMethod=146]="SetChanEncryptionMethod",u[u.GetKeyServer=147]="GetKeyServer",u[u.ListAuditLog=148]="ListAuditLog",u[u.GetOnboardingDetail=149]="GetOnboardingDetail",u[u.CreateOnboarding=150]="CreateOnboarding",u[u.UpdateOnboarding=151]="UpdateOnboarding",u[u.DeleteOnboarding=152]="DeleteOnboarding",u[u.ListOnboardingStep=153]="ListOnboardingStep",u[u.UpdateOnboardingStep=154]="UpdateOnboardingStep",u[u.GenerateClanWebhook=155]="GenerateClanWebhook",u[u.UpdateClanWebhookById=156]="UpdateClanWebhookById",u[u.DeleteClanWebhookById=157]="DeleteClanWebhookById",u[u.HandleClanWebhook=158]="HandleClanWebhook",u[u.UpdateUserStatus=159]="UpdateUserStatus",u[u.UpdateUserCustomStatus=160]="UpdateUserCustomStatus",u[u.GetTopicDetail=161]="GetTopicDetail",u[u.CreateSdTopic=162]="CreateSdTopic",u[u.DeleteSdTopic=163]="DeleteSdTopic",u[u.CreateExternalMezonMeet=164]="CreateExternalMezonMeet",u[u.GenerateMeetToken=165]="GenerateMeetToken",u[u.RemoveParticipantMezonMeet=166]="RemoveParticipantMezonMeet",u[u.MuteParticipantMezonMeet=167]="MuteParticipantMezonMeet",u[u.CreateRoomChannelApps=168]="CreateRoomChannelApps",u[u.GetMezonOauthClient=169]="GetMezonOauthClient",u[u.DeleteMezonOauthClient=170]="DeleteMezonOauthClient",u[u.UpdateMezonOauthClient=171]="UpdateMezonOauthClient",u[u.SearchThread=172]="SearchThread",u[u.GenerateHashChannelApps=173]="GenerateHashChannelApps",u[u.DeleteUserEvent=174]="DeleteUserEvent",u[u.AddUserEvent=175]="AddUserEvent",u[u.DeleteQuickMenuAccess=176]="DeleteQuickMenuAccess",u[u.AddQuickMenuAccess=177]="AddQuickMenuAccess",u[u.UpdateQuickMenuAccess=178]="UpdateQuickMenuAccess",u[u.TransferOwnership=179]="TransferOwnership",u[u.SendChannelMessage=180]="SendChannelMessage",u[u.UpdateChannelMessage=181]="UpdateChannelMessage",u[u.DeleteChannelMessage=182]="DeleteChannelMessage",u[u.ReportMessageAbuse=183]="ReportMessageAbuse",u[u.MessageButtonClick=184]="MessageButtonClick",u[u.DropdownBoxSelected=185]="DropdownBoxSelected",u[u.ActiveArchivedThread=186]="ActiveArchivedThread",u[u.UpdateChannelTimeline=187]="UpdateChannelTimeline",u[u.AddAgentToChannel=188]="AddAgentToChannel",u[u.DisconnectAgent=189]="DisconnectAgent",u[u.CreateChannelTimeline=190]="CreateChannelTimeline",u[u.DetailChannelTimeline=191]="DetailChannelTimeline",u[u.CreatePoll=192]="CreatePoll",u[u.VotePoll=193]="VotePoll",u[u.ClosePoll=194]="ClosePoll",u[u.GetPoll=195]="GetPoll",u[u.ReactChannelMessage=196]="ReactChannelMessage",u[u.MultipartUploadAttachmentFileStart=197]="MultipartUploadAttachmentFileStart",u[u.MultipartUploadAttachmentFileFinish=198]="MultipartUploadAttachmentFileFinish",u[u.SessionRefresh=199]="SessionRefresh",u[u.SessionLogout=200]="SessionLogout",u[u.Healthcheck=201]="Healthcheck",u[u.UnbanClanUsers=202]="UnbanClanUsers",u[u.ListBannedUsers=203]="ListBannedUsers",u[u.GetNotificationCategory=204]="GetNotificationCategory",u[u.ListRolePermissions=205]="ListRolePermissions",u[u.IsFollower=206]="IsFollower",u[u.DeletePinMessage=207]="DeletePinMessage",u[u.MarkAsRead=208]="MarkAsRead",u[u.UploadBatchAttachmentFile=209]="UploadBatchAttachmentFile",u[u.SearchCtrlK=210]="SearchCtrlK",u[u.SearchMentionUsers=211]="SearchMentionUsers",u[u.GenerateCDNSignature=212]="GenerateCDNSignature",u[u.GetStreamPlayback=213]="GetStreamPlayback",u[u.LinkCDNFile=214]="LinkCDNFile",u[u.SfuBreakoutRoom=215]="SfuBreakoutRoom",u[u.SfuBreakoutMerge=216]="SfuBreakoutMerge",u[u.SetOverrideEveryoneChannel=217]="SetOverrideEveryoneChannel",u[u.GetOverrideEveryoneChannel=218]="GetOverrideEveryoneChannel",u[u.GetDMSetting=219]="GetDMSetting",u[u.UpdateDMSetting=220]="UpdateDMSetting",u))(Z||{}),V=class V{constructor(e,t,n){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=n,this.adapter=new pe.MezonNetworkAdapter,this.metricLatency=new j}close(){this.adapter.close()}generatecid(){let e=this.nextCid;return this.nextCid>=65535?this.nextCid=1:++this.nextCid,e}setTransportAdapter(e){this.adapter=e}setFallbackSession(e){}getApiFromPath(e){if(e in Z)return Z[e]}connect(e,t,n,r,o,a){let[i,c]=t.split(":");this.adapter.connect(i,c,n,e,a),this.adapter.onOpen=o.onOpen,this.adapter.onError=o.onError,this.adapter.onClose=o.onClose,this.adapter.onMessage=(d,h,_)=>l(this,null,function*(){if(r&&typeof console!="undefined"&&console.log("incomming message with cid %o and message %o",d,_),d!=0){let f=this.cIds[d];if(!f){r&&typeof console!="undefined"&&console.error("No promise executor for message: %o",_);return}delete this.cIds[d],_.error?(f.reject({code:h,error:_.error}),this.metricLatency.end(d,!0)):(f.resolve({code:h,message:_}),this.metricLatency.end(d))}else yield o.onMessage(0,0,_)})}send(e,t=V.DefaultSendTimeoutMs){let{urlPath:n,fetchOptions:r}=e,o=r;if(n!=null&&n.includes("/mezon.api.Mezon/")){let a=n.substring(17);o={api_request_event:{api_index:this.getApiFromPath(a),api_name:a,body:r.body}}}return new Promise((a,i)=>l(this,null,function*(){var c,d;if(!this.adapter.isOpen())i("Socket connection has not been established yet.");else{o.channel_message_send?o.channel_message_send.content=JSON.stringify(o.channel_message_send.content):o.channel_message_update?o.channel_message_update.content=JSON.stringify(o.channel_message_update.content):o.ephemeral_message_send?o.ephemeral_message_send.message.content=JSON.stringify((c=o.ephemeral_message_send.message)==null?void 0:c.content):o.quick_menu_event&&(o.quick_menu_event.message.content=JSON.stringify((d=o.quick_menu_event.message)==null?void 0:d.content));let h=this.generatecid();this.metricLatency.start(h),this.cIds[h]={resolve:a,reject:i},t!==1/0&&t>0&&setTimeout(()=>{this.metricLatency.end(h,!0),i("The socket timed out while waiting for a response.")},t),o.cid=h,this.adapter.send(o)}}))}deleteAccount(e={}){let t="/mezon.api.Mezon/DeleteAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return o})),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}getAccount(e={}){let t="/mezon.api.Mezon/GetAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return s.Account.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateAccount(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateAccount",o=s.UpdateAccountRequest.encode(s.UpdateAccountRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/checklogin",a=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.Session.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/v2/account/authenticate/confirmlogin",r=new Map,o="";o=JSON.stringify(e||{});let a=this.buildFullUrl(this.basePath,n,r),i=m("POST",t,o);return i.headers.Accept="application/x-protobuf",i.headers["Content-Type"]="application/json",Promise.race([fetch(a,i).then(c=>c),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/createqrlogin",a=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.LoginIDResponse.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/smsotp",a=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/emailotp",a=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/email",a=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.Session.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,n,r,o,a,i={}){if(n==null)throw new Error("'account' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/mezon",d=new Map;d.set("create",r),d.set("username",o),d.set("is_remember",a);let h="";h=JSON.stringify(n||{});let _=this.buildFullUrl(this.basePath,c,d),f=m("POST",i,h);return e&&(f.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),f.headers.Accept="application/x-protobuf",Promise.race([fetch(_,f).then(b=>l(this,null,function*(){if(!b.ok)throw b;let g=yield b.arrayBuffer();return s.Session.decode(new Uint8Array(g))})),new Promise((b,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}linkEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkEmail",o=s.AccountEmail.encode(s.AccountEmail.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.LinkAccountConfirmRequest.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}linkSMS(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkSMS",o=s.AccountMezon.encode(s.AccountMezon.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.LinkAccountConfirmRequest.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}confirmLinkMezonOTP(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ConfirmLinkMezonOTP",o=s.LinkAccountConfirmRequest.encode(s.LinkAccountConfirmRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,a.headers.Accept="application/x-protobuf",Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Session.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/confirmotp",a=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.Session.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}registrationEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RegistrationEmail",o=s.RegistrationEmailRequest.encode(s.RegistrationEmailRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Session.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/SessionRefresh",i=s.SessionRefreshRequest.encode(s.SessionRefreshRequest.fromPartial(n)).finish(),c=m("POST",r,"");return c.body=i,e&&(c.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.Session.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unlinkEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UnlinkEmail",o=s.AccountEmail.encode(s.AccountEmail.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}unlinkMezon(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UnlinkMezon",o=s.AccountMezon.encode(s.AccountMezon.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listActivity(e={}){let t="/mezon.api.Mezon/ListActivity",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.ListUserActivity.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}createActiviy(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateActiviy",o=s.CreateActivityRequest.encode(s.CreateActivityRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UserActivity.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}addApp(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddApp",o=s.AddAppRequest.encode(s.AddAppRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.App.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,n,r={}){let o="/mezon.api.Mezon/ListApps",i=s.ListAppsRequest.encode(s.ListAppsRequest.fromPartial({filter:e,tombstones:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.AppList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,n={}){if(e==null)throw new Error("'appId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/AddAppToClan",a=s.AppClan.encode(s.AppClan.fromPartial({app_id:e,clan_id:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteApp(e,t={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteApp",o=s.App.encode(s.App.fromPartial({id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getApp(e,t={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetApp",o=s.App.encode(s.App.fromPartial({id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.App.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateApp(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateApp",a=s.UpdateAppRequest.encode(s.UpdateAppRequest.fromPartial(M(S({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.App.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,n,r,o={}){let a="/mezon.api.Mezon/ListAuditLog",c=s.ListAuditLogRequest.encode(s.ListAuditLogRequest.fromPartial({clan_id:n,user_id:t,action_log:e,date_log:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.ListAuditLog.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateCategoryOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateCategoryOrder",o=s.UpdateCategoryOrderRequest.encode(s.UpdateCategoryOrderRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,n,r,o,a={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListCategoryDescs",d=s.CategoryDesc.encode(s.CategoryDesc.fromPartial({clan_id:e,creator_id:t,category_name:n,category_id:r,category_order:o})).finish(),h=m("POST",a,"");return h.body=d,Promise.race([this.send({urlPath:i,fetchOptions:h}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.CategoryDescList.decode(_.message)})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t={}){let n="/mezon.api.Mezon/ListChannelApps",o=s.ListChannelAppsRequest.encode(s.ListChannelAppsRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListChannelAppsResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,n,r,o={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetChannelCanvasList",c=s.ChannelCanvasListRequest.encode(s.ChannelCanvasListRequest.fromPartial({channel_id:e,clan_id:t,limit:n,page:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.ChannelCanvasListResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}addChannelFavorite(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddChannelFavorite",o=s.AddFavoriteChannelRequest.encode(s.AddFavoriteChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.AddFavoriteChannelResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveChannelFavorite",a=s.RemoveFavoriteChannelRequest.encode(s.RemoveFavoriteChannelRequest.fromPartial({channel_id:e,clan_id:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getListFavoriteChannel(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetListFavoriteChannel",o=s.ListFavoriteChannelRequest.encode(s.ListFavoriteChannelRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListFavoriteChannelResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,n,r,o,a,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListChannelMessages",h=s.ListChannelMessagesRequest.encode(s.ListChannelMessagesRequest.fromPartial({clan_id:e,channel_id:t,message_id:n,direction:r,limit:o,topic_id:a})).finish(),_=m("POST",i,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.ChannelMessageList.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/AddChannelUsers",a=s.AddChannelUsersRequest.encode(s.AddChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,r,o,a,i,c,d={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let h="/mezon.api.Mezon/ListChannelAttachment",f=s.ListChannelAttachmentRequest.encode(s.ListChannelAttachmentRequest.fromPartial({channel_id:e,clan_id:t,file_type:n,limit:r,state:o,before:a,after:i,around:c})).finish(),b=m("POST",d,"");return b.body=f,Promise.race([this.send({urlPath:h,fetchOptions:b}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return s.ChannelAttachmentList.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetChanEncryptionMethod",a=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial({channel_id:e,method:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.ChanEncryptionMethod.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/SetChanEncryptionMethod",a=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial(M(S({},t),{channel_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/LeaveThread",a=s.LeaveThreadRequest.encode(s.LeaveThreadRequest.fromPartial({channel_id:t,clan_id:e})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}archiveChannel(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ArchiveChannel",a=s.ArchiveChannelRequest.encode(s.ArchiveChannelRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listArchivedChannelDescs(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListArchivedChannelDescs",o=s.ListArchivedChannelDescsRequest.encode(s.ListArchivedChannelDescsRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListArchivedChannelDescsResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChannelUsers(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveChannelUsers",a=s.RemoveChannelUsersRequest.encode(s.RemoveChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,n,r,o,a,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListChannelUsers",h=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:o,cursor:a})).finish(),_=m("POST",i,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.ChannelUserList.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,r,o,a,i={}){let c="/mezon.api.Mezon/ListChannelDescs",h=s.ListChannelDescsRequest.encode(s.ListChannelDescsRequest.fromPartial({limit:e,state:t,page:n,clan_id:r,channel_type:o,is_mobile:a})).finish(),_=m("POST",i,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.ChannelDescList.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateChannelDesc",o=s.CreateChannelDescRequest.encode(s.CreateChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelDescription.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,n={}){let r="/mezon.api.Mezon/ListChannelUsersUC",a=s.AllUsersAddChannelRequest.encode(s.AllUsersAddChannelRequest.fromPartial({channel_id:e,limit:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.AllUsersAddChannelResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteChannelDesc",a=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateChannelDesc",a=s.UpdateChannelDescRequest.encode(s.UpdateChannelDescRequest.fromPartial(M(S({},t),{channel_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,r,o,a,i,c,d,h,_={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let f="/mezon.api.Mezon/ListChannelSetting",g=s.ChannelSettingListRequest.encode(s.ChannelSettingListRequest.fromPartial({clan_id:e,parent_id:t,category_id:n,active:o,private_channel:r,status:a,type:i,limit:c,page:d,channel_label:h})).finish(),A=m("POST",_,"");return A.body=g,Promise.race([this.send({urlPath:f,fetchOptions:A}).then(C=>l(this,null,function*(){if(C.code!=0)throw C;return s.ChannelSettingListResponse.decode(C.message)})),new Promise((C,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,n={}){let r="/mezon.api.Mezon/ListChannelVoiceUsers",a=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,limit:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.VoiceChannelUserList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,n,r={}){let o="/mezon.api.Mezon/ListClanDescs",i=s.ListClanDescRequest.encode(s.ListClanDescRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ClanDescList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listClanBadgeCount(){let e="/mezon.api.Mezon/ListClanBadgeCount",t={};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){if(n.code!=0)throw n;return s.ListClanBadgeCountResponse.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelBadgeCount(e,t,n,r={}){let o="/mezon.api.Mezon/ListChannelBadgeCount",i=s.ListChannelBadgeCountRequest.encode(s.ListChannelBadgeCountRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ListChannelBadgeCountResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listUserOnline(e,t,n,r={}){let o="/mezon.api.Mezon/ListUserOnline",i=s.ListUserOnlineRequest.encode(s.ListUserOnlineRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ListUserOnlineResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createClanDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateClanDesc",o=s.CreateClanDescRequest.encode(s.CreateClanDescRequest.fromPartial({clan_name:e.clan_name,logo:e.logo,banner:e.banner})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanDesc.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanDesc(e,t={}){if(e==null)throw new Error("'clanDescId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteClanDesc",o=s.DeleteClanDescRequest.encode(s.DeleteClanDescRequest.fromPartial({clan_desc_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateClanDesc(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanDesc",a=s.UpdateClanDescRequest.encode(s.UpdateClanDescRequest.fromPartial(S({clan_id:e},t))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveClanUsers",a=s.RemoveClanUsersRequest.encode(s.RemoveClanUsersRequest.fromPartial({clan_id:e,user_ids:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,n={}){let r="/mezon.api.Mezon/ListBannedUsers",a=s.BannedUserListRequest.encode(s.BannedUserListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.BannedUserList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,n,r,o={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UnbanClanUsers",c=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return{}})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,n,r,o={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/BanClanUsers",c=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return{}})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}listClanUsers(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanUsers",o=s.ListClanUsersRequest.encode(s.ListClanUsersRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanUserList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listClanUsersStatus(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanUsersStatus",o=s.ListClanUsersStatusRequest.encode(s.ListClanUsersStatusRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanUserStatusList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createCategoryDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateCategoryDesc",o=s.CreateCategoryDescRequest.encode(s.CreateCategoryDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.CategoryDesc.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}checkDuplicateName(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CheckDuplicateName",o=s.CheckDuplicateNameRequest.encode(s.CheckDuplicateNameRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code==0)return s.CheckDuplicateNameResponse.decode(i.message);throw i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,n,r={}){if(e==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteCategoryDesc",i=s.DeleteCategoryDescRequest.encode(s.DeleteCategoryDescRequest.fromPartial({category_id:e,clan_id:t,category_label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,n,r,o={}){let a="/mezon.api.Mezon/RegistFCMDeviceToken",c=s.RegistFcmDeviceTokenRequest.encode(s.RegistFcmDeviceTokenRequest.fromPartial({token:e,device_id:t,platform:n,voip_token:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.RegistFcmDeviceTokenResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}closeDirectMess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CloseDMByChannelId",o=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}openDirectMess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/OpenDMByChannelId",o=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createClanEmoji(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateClanEmoji",o=s.ClanEmojiCreateRequest.encode(s.ClanEmojiCreateRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteByIdClanEmoji",i=s.ClanEmojiDeleteRequest.encode(s.ClanEmojiDeleteRequest.fromPartial({id:e,clan_id:t,emoji_label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanEmojiById",a=s.ClanEmojiUpdateRequest.encode(s.ClanEmojiUpdateRequest.fromPartial({id:t.id,shortname:t.shortname,clan_id:t.clan_id})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e={}){let t="/mezon.api.Mezon/EmojiRecentList",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return s.EmojiRecentList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e={}){let t="/mezon.api.Mezon/GetListEmojisByUserId",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return s.EmojiListedResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}searchMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchMessage",o=s.SearchMessageRequest.encode(s.SearchMessageRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SearchMessageResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}searchCtrlK(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchCtrlK",o=s.SearchCtrlKRequest.encode(s.SearchCtrlKRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SearchCtrlKResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}searchMentionUsers(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchMentionUsers",o=s.SearchMentionUsersRequest.encode(s.SearchMentionUsersRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SearchMentionUsersResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateCDNSignature(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateCDNSignature",o=s.GenerateCDNSignatureRequest.encode(s.GenerateCDNSignatureRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GenerateCDNSignatureResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getStreamPlayback(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetStreamPlayback",o=s.GetStreamPlaybackRequest.encode(s.GetStreamPlaybackRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GetStreamPlaybackResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}setOverrideEveryoneChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetOverrideEveryoneChannel",o=s.SetOverrideEveryoneChannelRequest.encode(s.SetOverrideEveryoneChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getOverrideEveryoneChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetOverrideEveryoneChannel",o=s.GetOverrideEveryoneChannelRequest.encode(s.GetOverrideEveryoneChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GetOverrideEveryoneChannelResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getDMSetting(e={}){let t="/mezon.api.Mezon/GetDMSetting",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.DMSetting.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateDMSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateDMSetting",o=s.UpdateDMSettingRequest.encode(s.UpdateDMSettingRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.DMSetting.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}event(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateEvent",o=s.Event.encode(s.Event.fromPartial({external:e.external,name:e.name,properties:e.properties})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listEvents(e,t={}){let n="/mezon.api.Mezon/ListEvents",o=s.ListEventsRequest.encode(s.ListEventsRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.EventList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createEvent(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateEvent",o=s.CreateEventRequest.encode(s.CreateEventRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.EventManagement.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateEventUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateEventUser",o=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,n,r,o,a={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteEvent",d=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial({event_id:e,clan_id:t,creator_id:n,event_label:r,channel_id:o})).finish(),h=m("POST",a,"");return h.body=d,Promise.race([this.send({urlPath:i,fetchOptions:h}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return{}})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,n={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateEvent",a=s.UpdateEventRequest.encode(s.UpdateEventRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,n={}){let r="/mezon.api.Mezon/DeleteFriends",a=s.DeleteFriendsRequest.encode(s.DeleteFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listFriends(e,t,n,r={}){let o="/mezon.api.Mezon/ListFriends",i=s.ListFriendsRequest.encode(s.ListFriendsRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.FriendList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,n={}){let r="/mezon.api.Mezon/AddFriends",a=s.AddFriendsRequest.encode(s.AddFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.AddFriendsResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,n={}){let r="/mezon.api.Mezon/BlockFriends",a=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,n={}){let r="/mezon.api.Mezon/UnblockFriends",a=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t={}){let n="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",o=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationChannelCategorySettingList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getUserProfileOnClan(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetUserProfileOnClan",o=s.ClanProfileRequest.encode(s.ClanProfileRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanProfile.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t={}){let n="/mezon.api.Mezon/GetNotificationCategory",o=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationUserChannel.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t={}){let n="/mezon.api.Mezon/GetNotificationChannel",o=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationUserChannel.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t={}){let n="/mezon.api.Mezon/GetNotificationClan",o=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationSetting.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t={}){let n="/mezon.api.Mezon/GetNotificationReactMessage",o=s.NotifiReactMessage.encode(s.NotifiReactMessage.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotifiReactMessage.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getKeyServer(e={}){let t="/mezon.api.Mezon/GetKeyServer",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.GetKeyServerResp.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}createLinkInviteUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateLinkInviteUser",o=s.LinkInviteUserRequest.encode(s.LinkInviteUserRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.LinkInviteUser.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}inviteUser(e,t={}){if(e==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/InviteUser",o=s.InviteUserRequest.encode(s.InviteUserRequest.fromPartial({invite_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.InviteUserRes.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,n,r={}){if(n==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let o="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(n))),a=new Map,i="",c=this.buildFullUrl(this.basePath,o,a),d=m("GET",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.InviteUserRes.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e={}){let t="/mezon.api.Mezon/ListChannelByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.ChannelDescList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}markAsRead(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MarkAsRead",o=s.MarkAsReadRequest.encode(s.MarkAsReadRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listMezonOauthClient(e={}){let t="/mezon.api.Mezon/ListMezonOauthClient",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.MezonOauthClientList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}setMuteCategory(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetMuteCategory",o=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}setMuteChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetMuteChannel",o=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,n={}){let r="/mezon.api.Mezon/DeleteNotifications",a=s.DeleteNotificationsRequest.encode(s.DeleteNotificationsRequest.fromPartial({ids:e||[],category:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,r,o,a={}){let i="/mezon.api.Mezon/ListNotifications",d=s.ListNotificationsRequest.encode(s.ListNotificationsRequest.fromPartial({limit:e,clan_id:t,notification_id:n,category:r,direction:o})).finish(),h=m("POST",a,"");return h.body=d,Promise.race([this.send({urlPath:i,fetchOptions:h}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.NotificationList.decode(_.message)})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationChannelSetting",o=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationClanSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationClanSetting",o=s.SetDefaultNotificationRequest.encode(s.SetDefaultNotificationRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationCategorySetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationCategorySetting",o=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationCategorySetting",o=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationChannel",o=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t={}){let n="/mezon.api.Mezon/DeleteNotiReactMessage",o=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationReactMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationReactMessage",o=s.NotificationChannel.encode(s.NotificationChannel.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setRoleChannelPermission(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetRoleChannelPermission",o=s.UpdateRoleChannelRequest.encode(s.UpdateRoleChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getListPermission(e={}){let t="/mezon.api.Mezon/GetListPermission",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.PermissionList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,n,r={}){let o="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",i=s.PermissionRoleChannelListEventRequest.encode(s.PermissionRoleChannelListEventRequest.fromPartial({role_id:e,channel_id:t,user_id:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.PermissionRoleChannelListEventResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,n,r,o={}){let a="/mezon.api.Mezon/DeletePinMessage",c=s.DeletePinMessage.encode(s.DeletePinMessage.fromPartial({id:e,message_id:t,channel_id:n,clan_id:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return h})),new Promise((h,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,n,r={}){let o="/mezon.api.Mezon/GetPinMessagesList",i=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial({message_id:e,channel_id:t,clan_id:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.PinMessagesList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createMessage2Inbox(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateMessage2Inbox",o=s.Message2InboxRequest.encode(s.Message2InboxRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelMessageHeader.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createPinMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePinMessage",o=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelMessageHeader.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t={}){let n="/mezon.api.Mezon/GetPubKeys",o=s.GetPubKeysRequest.encode(s.GetPubKeysRequest.fromPartial({user_ids:e||[]})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GetPubKeysResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}pushPubKey(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/PushPubKey",o=s.PushPubKeyRequest.encode(s.PushPubKeyRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}addRolesChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddRolesChannelDesc",o=s.AddRoleChannelDescRequest.encode(s.AddRoleChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}changeChannelCategory(e,t,n={}){if(e==null)throw new Error("'newCategoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ChangeChannelCategory",a=s.ChangeChannelCategoryRequest.encode(s.ChangeChannelCategoryRequest.fromPartial(M(S({},t),{new_category_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRoleChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteRoleChannelDesc",o=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listRoles(e,t,n,r,o={}){let a="/mezon.api.Mezon/ListRoles",c=s.RoleListEventRequest.encode(s.RoleListEventRequest.fromPartial({clan_id:e,limit:t,state:n,cursor:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.RoleListEventResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}createRole(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateRole",o=s.CreateRoleRequest.encode(s.CreateRoleRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Role.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateRoleDelete(e,t,n={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteRole",a=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(M(S({},t),{role_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,n,r,o={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteRole",c=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial({role_id:e,channel_id:t,clan_id:n,role_label:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return h})),new Promise((h,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}updateRole(e,t,n={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateRole",a=s.UpdateRoleRequest.encode(s.UpdateRoleRequest.fromPartial(M(S({},t),{role_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listRolePermissions(e,t={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListRolePermissions",o=s.ListPermissionsRequest.encode(s.ListPermissionsRequest.fromPartial({role_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.PermissionList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,n,r={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListRoleUsers",i=s.ListRoleUsersRequest.encode(s.ListRoleUsersRequest.fromPartial({role_id:e,limit:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.RoleUserList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetRoleOfUserInTheClan",a=s.ListPermissionOfUsersRequest.encode(s.ListPermissionOfUsersRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.RoleList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,n,r={}){let o="/mezon.api.Mezon/SearchThread",i=s.SearchThreadRequest.encode(s.SearchThreadRequest.fromPartial({clan_id:e,channel_id:t,label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ChannelDescList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}sessionLogout(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SessionLogout",o=s.SessionLogoutRequest.encode(s.SessionLogoutRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}addClanSticker(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddClanSticker",o=s.ClanStickerAddRequest.encode(s.ClanStickerAddRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteClanStickerById",i=s.ClanStickerDeleteRequest.encode(s.ClanStickerDeleteRequest.fromPartial({id:e,clan_id:t,sticker_label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanStickerById",a=s.ClanStickerUpdateByIdRequest.encode(s.ClanStickerUpdateByIdRequest.fromPartial(M(S({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e={}){let t="/mezon.api.Mezon/GetListStickersByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.StickerListedResponse.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}registerStreamingChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RegisterStreamingChannel",o=s.RegisterStreamingChannelRequest.encode(s.RegisterStreamingChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.RegisterStreamingChannelResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,n,r,o,a,i={}){let c="/mezon.api.Mezon/ListStreamingChannelUsers",h=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:o,cursor:a})).finish(),_=m("POST",i,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.StreamingChannelUserList.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e={}){let t="/mezon.api.Mezon/GetSystemMessagesList",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.SystemMessagesList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}createSystemMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateSystemMessage",o=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,n,r={}){let o="/mezon.api.Mezon/ListSdTopic",i=s.ListSdTopicRequest.encode(s.ListSdTopicRequest.fromPartial({clan_id:e,limit:t,page:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.SdTopicList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createSdTopic(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateSdTopic",o=s.SdTopicRequest.encode(s.SdTopicRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SdTopic.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteSdTopic(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteSdTopic",o=s.DeleteSdTopicRequest.encode(s.DeleteSdTopicRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteSystemMessage(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteSystemMessage",o=s.DeleteSystemMessage.encode(s.DeleteSystemMessage.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessageByClanId(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetSystemMessageByClanId",o=s.GetSystemMessage.encode(s.GetSystemMessage.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SystemMessage.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateSystemMessage(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateSystemMessage",a=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(M(S({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,n,r,o,a,i={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListThreadDescs",h=s.ListThreadRequest.encode(s.ListThreadRequest.fromPartial({channel_id:e,limit:t,state:n,clan_id:r,thread_id:o,page:a})).finish(),_=m("POST",i,"");return _.body=h,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.ChannelDescListNoPool.decode(f.message)})),new Promise((f,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateCategory",a=s.UpdateCategoryDescRequest.encode(s.UpdateCategoryDescRequest.fromPartial(M(S({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateChannelPrivate(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateChannelPrivate",o=s.ChangeChannelPrivateRequest.encode(s.ChangeChannelPrivateRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateUserProfileByClan(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateUserProfileByClan",a=s.UpdateClanProfileRequest.encode(s.UpdateClanProfileRequest.fromPartial(M(S({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}uploadOauthFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadOauthFile",o=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UploadAttachment.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadAttachmentFile",o=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UploadAttachment.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}uploadBatchAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadBatchAttachmentFile",o=s.UploadBatchAttachmentRequest.encode(s.UploadBatchAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UploadAttachmentBatch.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",o=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.MultipartUploadAttachment.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFileFinsih(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MultipartUploadAttachmentFileFinish",o=s.MultipartUploadAttachmentFinishRequest.encode(s.MultipartUploadAttachmentFinishRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}linkCDNFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkCDNFile",o=s.LinkCDNFileRequest.encode(s.LinkCDNFileRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sfuBreakoutRoom(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SfuBreakoutRoom",o=s.SfuBreakoutRoomRequest.encode(s.SfuBreakoutRoomRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SfuBreakoutRoomResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sfuBreakoutMerge(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SfuBreakoutMerge",o=s.SfuBreakoutMergeRequest.encode(s.SfuBreakoutMergeRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUser",o=s.UpdateUsersRequest.encode(s.UpdateUsersRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listUserClansByUserId(e={}){let t="/mezon.api.Mezon/ListUserClansByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.AllUserClans.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,n={}){let r="/mezon.api.Mezon/ListUserPermissionInChannel",a=s.UserPermissionInChannelListRequest.encode(s.UserPermissionInChannelListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.UserPermissionInChannelListResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e={}){let t="/mezon.api.Mezon/GetUserStatus",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.UserStatus.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateUserStatus(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUserStatus",o=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateUserCustomStatus(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUserCustomStatus",o=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}generateWebhook(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateWebhook",o=s.WebhookCreateRequest.encode(s.WebhookCreateRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.WebhookGenerateResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateWebhookById",a=s.WebhookUpdateRequestById.encode(s.WebhookUpdateRequestById.fromPartial(M(S({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ListWebhookByChannelId",a=s.WebhookListRequest.encode(s.WebhookListRequest.fromPartial({channel_id:e,clan_id:t||""})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.WebhookListResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteWebhookById",a=s.WebhookDeleteRequestById.encode(s.WebhookDeleteRequestById.fromPartial(M(S({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,n){let r=e+t+"?";for(let[o,a]of n)a instanceof Array?r+=a.reduce((i,c)=>i+encodeURIComponent(o)+"="+encodeURIComponent(c)+"&",""):a!=null&&(r+=encodeURIComponent(o)+"="+encodeURIComponent(a)+"&");return r}editChannelCanvases(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/EditChannelCanvases",o=s.EditChannelCanvasRequest.encode(s.EditChannelCanvasRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.EditChannelCanvasResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/GetChannelCanvasDetail",i=s.ChannelCanvasDetailRequest.encode(s.ChannelCanvasDetailRequest.fromPartial({id:e,clan_id:t||"",channel_id:n||""})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ChannelCanvasDetailResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,n,r={}){if(e==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteChannelCanvas",i=s.DeleteChannelCanvasRequest.encode(s.DeleteChannelCanvasRequest.fromPartial({canvas_id:e,clan_id:t||"",channel_id:n||""})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,n,r,o={}){let a="/mezon.api.Mezon/ListOnboarding",c=s.ListOnboardingRequest.encode(s.ListOnboardingRequest.fromPartial({clan_id:e,guide_type:t,limit:n,page:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.ListOnboardingResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}createOnboarding(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateOnboarding",o=s.CreateOnboardingRequest.encode(s.CreateOnboardingRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListOnboardingResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteOnboarding(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteOnboarding",a=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:e,clan_id:t})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetOnboardingDetail",a=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:e,clan_id:t||""})).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.OnboardingItem.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateOnboarding",a=s.UpdateOnboardingRequest.encode(s.UpdateOnboardingRequest.fromPartial(M(S({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}generateClanWebhook(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateClanWebhook",o=s.GenerateClanWebhookRequest.encode(s.GenerateClanWebhookRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GenerateClanWebhookResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listClanWebhook(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanWebhook",o=s.ListClanWebhookRequest.encode(s.ListClanWebhookRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListClanWebhookResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteClanWebhookById",o={id:e,clan_id:t},i=s.ClanWebhookRequest.encode(s.ClanWebhookRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanWebhookById",o=M(S({},t),{id:e}),i=s.UpdateClanWebhookRequest.encode(s.UpdateClanWebhookRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t={}){let n="/mezon.api.Mezon/GetTopicDetail",r={topic_id:e},a=s.SdTopicDetailRequest.encode(s.SdTopicDetailRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=a,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.SdTopic.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,n,r={}){let o="/mezon.api.Mezon/ListOnboardingStep",a={clan_id:e,limit:t,page:n},c=s.ListOnboardingStepRequest.encode(s.ListOnboardingStepRequest.fromPartial(a)).finish(),d=m("POST",r,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.ListOnboardingStepResponse.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateOnboardingStep",o=M(S({},t),{clan_id:e}),i=s.UpdateOnboardingStepRequest.encode(s.UpdateOnboardingStepRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}createRoomChannelApps(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateRoomChannelApps",o=s.CreateRoomChannelApps.encode(s.CreateRoomChannelApps.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.CreateRoomChannelApps.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateMeetToken(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateMeetToken",o=s.GenerateMeetTokenRequest.encode(s.GenerateMeetTokenRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return console.log(i.message),Y(new Uint8Array(i.message))})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,n={}){let r="/mezon.api.Mezon/GetMezonOauthClient",o={client_id:e,client_name:t},i=s.GetMezonOauthClientRequest.encode(s.GetMezonOauthClientRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.MezonOauthClient.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateMezonOauthClient(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateMezonOauthClient",o=s.MezonOauthClient.encode(s.MezonOauthClient.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.MezonOauthClient.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t={}){let n="/mezon.api.Mezon/GenerateHashChannelApps",r={app_id:e},a=s.GenerateHashChannelAppsRequest.encode(s.GenerateHashChannelAppsRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=a,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.GenerateHashChannelAppsResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}addUserEvent(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddUserEvent",o=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,n={}){let r="/mezon.api.Mezon/DeleteUserEvent",o={clan_id:e,event_id:t},i=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateRoleOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateRoleOrder",o=s.UpdateRoleOrderRequest.encode(s.UpdateRoleOrderRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}createExternalMezonMeet(e={}){let t="/mezon.api.Mezon/CreateExternalMezonMeet",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.GenerateMezonMeetResponse.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,n,r,o={}){if(e==null)throw new Error("'token' is a required parameter but is null or undefined.");let a="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(e))),i=new Map;i.set("username",t),i.set("metadata",n),i.set("is_guest",r);let c="",d=this.buildFullUrl(this.basePath,a,i),h=m("POST",o,c);return h.headers.Accept="application/x-protobuf",h.headers["Content-Type"]="application/json",Promise.race([fetch(d,h).then(_=>l(this,null,function*(){if(!_.ok)throw _;let f=yield _.arrayBuffer();return s.GenerateMeetTokenExternalResponse.decode(new Uint8Array(f))})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}muteParticipantMezonMeet(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MuteParticipantMezonMeet",o=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}removeParticipantMezonMeet(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RemoveParticipantMezonMeet",o=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listChannelDetail(e,t={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListChannelDetail",r={channel_id:e},a=s.ListChannelDetailRequest.encode(s.ListChannelDetailRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=a,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.ChannelDescription.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListChannelTimeline",o=s.ListChannelTimelineRequest.encode(s.ListChannelTimelineRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListChannelTimelineResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateChannelTimeline",o=s.CreateChannelTimelineRequest.encode(s.CreateChannelTimelineRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.CreateChannelTimelineResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateChannelTimeline",o=s.UpdateChannelTimelineRequest.encode(s.UpdateChannelTimelineRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UpdateChannelTimelineResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}detailChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DetailChannelTimeline",o=s.ChannelTimelineDetailRequest.encode(s.ChannelTimelineDetailRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelTimelineDetailResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateClanOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateClanOrder",o=s.UpdateClanOrderRequest.encode(s.UpdateClanOrderRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/clan/discover",a=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let _=yield h.arrayBuffer();return s.ListClanDiscover.decode(new Uint8Array(_))})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,n,r,o,a,i={}){let c="/mezon.api.Mezon/DeleteQuickMenuAccess",d={id:e,clan_id:t,bot_id:n,menu_name:r,background:o,action_msg:a},_=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(d)).finish(),f=m("POST",i,"");return f.body=_,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,n,r={}){let o="/mezon.api.Mezon/ListQuickMenuAccess",a={bot_id:e,channel_id:t,menu_type:n},c=s.ListQuickMenuAccessRequest.encode(s.ListQuickMenuAccessRequest.fromPartial(a)).finish(),d=m("POST",r,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.QuickMenuAccessList.decode(h.message)})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}addQuickMenuAccess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddQuickMenuAccess",o=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateQuickMenuAccess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateQuickMenuAccess",o=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t={}){let n="/mezon.api.Mezon/ListForSaleItems",r={page:e},a=s.ListForSaleItemsRequest.encode(s.ListForSaleItemsRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=a,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.ForSaleItemList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}isFollower(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/IsFollower",o=s.IsFollowerRequest.encode(s.IsFollowerRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.IsFollowerResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}transferOwnership(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/TransferOwnership",o=s.TransferOwnershipRequest.encode(s.TransferOwnershipRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateUsername(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUsername",o=s.UpdateUsernameRequest.encode(s.UpdateUsernameRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Session.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}isBanned(e,t={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/IsBanned",r={channel_id:e},a=s.IsBannedRequest.encode(s.IsBannedRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=a,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.IsBannedResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,n={}){let r="/mezon.api.Mezon/ReportMessageAbuse",o={message_id:e,abuse_type:t},i=s.ReportMessageAbuseReqest.encode(s.ReportMessageAbuseReqest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,r,o,a,i,c,d,h,_,f,b){let g="/mezon.api.Mezon/SendChannelMessage",C=s.ChannelMessageSend.encode(s.ChannelMessageSend.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,content:o,mentions:a,attachments:i,references:c,anonymous_message:d,mention_everyone:h,avatar:_,code:f,topic_id:b})).finish(),w=m("POST",{},"");return w.body=C,Promise.race([this.send({urlPath:g,fetchOptions:w}).then(v=>l(this,null,function*(){if(v.code!=0)throw v;return s.ChannelMessageAck.decode(v.message)})),new Promise((v,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}sendChannelMessageApi(e,t,n,r,o,a,i,c,d,h,_,f,b,g,A={}){var te;let C="/mezon.api.Mezon/SendChannelMessage",w=new Map,v=typeof a=="string"?a:JSON.stringify(a!=null?a:{}),J=s.ChannelMessageSend.encode(s.ChannelMessageSend.fromPartial({clan_id:t,channel_id:n,mode:r,is_public:o,content:v,mentions:i,attachments:c,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:b,topic_id:g})).finish(),D=this.buildFullUrl((te=e.api_url)!=null?te:"",C,w),L=m("POST",A,"");return L.body=J,e.token&&(L.headers.Authorization="Bearer "+e.token),Promise.race([fetch(D,L).then(F=>l(this,null,function*(){if(!F.ok)throw F;if(F.status===204)return{};let Q=yield F.arrayBuffer();return s.ChannelMessageAck.decode(new Uint8Array(Q))})),new Promise((F,Q)=>setTimeout(()=>Q(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,r,o,a,i,c,d,h,_,f){let b="/mezon.api.Mezon/UpdateChannelMessage",A=s.ChannelMessageUpdate.encode(s.ChannelMessageUpdate.fromPartial({clan_id:e,channel_id:t,message_id:o,mode:n,is_public:r,content:a,mentions:i,attachments:c,create_time_seconds:d,hide_editted:h,topic_id:_,is_update_msg_topic:f})).finish(),C=m("POST",{},"");return C.body=A,Promise.race([this.send({urlPath:b,fetchOptions:C}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return s.ChannelMessageUpdate.decode(w.message)})),new Promise((w,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,n,r,o,a,i,c,d){let h="/mezon.api.Mezon/DeleteChannelMessage",f=s.ChannelMessageRemove.encode(s.ChannelMessageRemove.fromPartial({clan_id:e,channel_id:t,message_id:o,mode:n,is_public:r,has_attachment:a,mentions:c,references:d,topic_id:i})).finish(),b=m("POST",{},"");return b.body=f,Promise.race([this.send({urlPath:h,fetchOptions:b}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return s.ChannelMessageRemove.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,n,r,o,a={}){let i="/mezon.api.Mezon/UpdateMezonVoiceState",c={clan_id:e,channel_id:t,display_name:n,room_name:r,state:o},h=s.HandleParticipantMeetStateEvent.encode(s.HandleParticipantMeetStateEvent.fromPartial(c)).finish(),_=m("POST",a,"");return _.body=h,Promise.race([this.send({urlPath:i,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return f})),new Promise((f,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,r,o,a,i={}){let c="/mezon.api.Mezon/MessageButtonClick",d={message_id:e,channel_id:t,button_id:n,sender_id:r,user_id:o,extra_data:a},_=s.MessageButtonClicked.encode(s.MessageButtonClicked.fromPartial(d)).finish(),f=m("POST",i,"");return f.body=_,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,r,o,a,i={}){let c="/mezon.api.Mezon/DropdownBoxSelected",d={message_id:e,channel_id:t,selectbox_id:n,sender_id:r,user_id:o,values:a},_=s.DropdownBoxSelected.encode(s.DropdownBoxSelected.fromPartial(d)).finish(),f=m("POST",i,"");return f.body=_,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,n={}){let r="/mezon.api.Mezon/ActiveArchivedThread",o={clan_id:e,channel_id:t},i=s.ActiveArchivedThread.encode(s.ActiveArchivedThread.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,n={}){let r="/mezon.api.Mezon/AddAgentToChannel",o={room_name:e,channel_id:t},i=s.UpdateAIAgentRequest.encode(s.UpdateAIAgentRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,n={}){let r="/mezon.api.Mezon/DisconnectAgent",o={room_name:e,channel_id:t},i=s.UpdateAIAgentRequest.encode(s.UpdateAIAgentRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listMutedChannel(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListMutedChannel",o=s.ListMutedChannelRequest.encode(s.ListMutedChannelRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.MutedChannelList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,n,r,o,a,i,c,d,h,_,f,b){let g="/mezon.api.Mezon/ReactChannelMessage",C=s.MessageReaction.encode(s.MessageReaction.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,message_id:o,emoji_id:a,emoji:i,count:c,message_sender_id:d,action:h,emoji_recent_id:f,sender_name:b,topic_id:_})).finish(),w=m("POST",{},"");return w.body=C,Promise.race([this.send({urlPath:g,fetchOptions:w}).then(v=>l(this,null,function*(){if(v.code!=0)throw v;return s.ChannelMessageSend.decode(v.message)})),new Promise((v,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t={}){var i,c,d,h,_,f;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePoll",o=s.CreatePollRequest.encode(s.CreatePollRequest.fromPartial({channel_id:(i=e.channel_id)!=null?i:"0",clan_id:(c=e.clan_id)!=null?c:"0",question:(d=e.question)!=null?d:"",answers:(h=e.answers)!=null?h:[],expire_hours:(_=e.expire_hours)!=null?_:0,type:(f=e.type)!=null?f:0})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;let g=s.CreatePollResponse.decode(b.message);return{poll_id:g.poll_id,message_id:g.message_id,question:g.question,answers:g.answers.map(A=>({index:A.index,label:A.label})),answer_counts:g.answer_counts,exp:g.exp,is_closed:g.is_closed,creator_id:g.creator_id,type:g.type,total_votes:g.total_votes}})),new Promise((b,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t={}){var i,c,d,h;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/VotePoll",o=s.VotePollRequest.encode(s.VotePollRequest.fromPartial({poll_id:(i=e.poll_id)!=null?i:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0",answer_indices:(h=e.answer_indices)!=null?h:[]})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(_=>l(this,null,function*(){var b;let f=_.code==0?s.VotePollResponse.decode(_.message):{my_answer_indices:[]};return{my_answer_indices:Array.from((b=f.my_answer_indices)!=null?b:[])}})),new Promise((_,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t={}){var i,c,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ClosePoll",o=s.ClosePollRequest.encode(s.ClosePollRequest.fromPartial({poll_id:(i=e.poll_id)!=null?i:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(h=>{if(h.code==0)return{};throw h}),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t={}){var i,c,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetPoll",o=s.GetPollRequest.encode(s.GetPollRequest.fromPartial({poll_id:(i=e.poll_id)!=null?i:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;let _=s.GetPollResponse.decode(h.message);return{poll_id:_.poll_id,message_id:_.message_id,question:_.question,answers:_.answers.map(f=>({index:f.index,label:f.label})),answer_counts:_.answer_counts,exp:_.exp,is_closed:_.is_closed,creator_id:_.creator_id,type:_.type,total_votes:_.total_votes,voter_details:_.voter_details.map(f=>({answer_index:f.answer_index,user_ids:f.user_ids}))}})),new Promise((h,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}followUsers(e){return l(this,null,function*(){let t="",n={status_follow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}joinClanChat(e){return l(this,null,function*(){let t="",n={clan_join:{clan_id:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}follower(){return l(this,null,function*(){let e="",t={follow_event:{}};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){if(n.code!=0)throw n;return{}})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}joinChat(e,t,n,r){return l(this,null,function*(){let o="",a={channel_join:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}leaveChat(e,t,n,r){let o="",a={channel_leave:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,r,o,a,i,c,d){return l(this,null,function*(){let h="",_={channel_message_remove:{clan_id:e,channel_id:t,mode:n,message_id:o,is_public:r,has_attachment:a,topic_id:i,mentions:c,references:d}};return Promise.race([this.send({urlPath:h,fetchOptions:_}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return{}})),new Promise((f,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])})}unfollowUsers(e){let t="",n={status_unfollow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateChatMessage(e,t,n,r,o,a,i,c,d,h,_,f){return l(this,null,function*(){let b="",g={channel_message_update:{clan_id:e,channel_id:t,message_id:o,content:a,mentions:i,attachments:c,create_time_seconds:d,mode:n,is_public:r,hide_editted:h,topic_id:_,is_update_msg_topic:f}};return Promise.race([this.send({urlPath:b,fetchOptions:g}).then(A=>l(this,null,function*(){if(A.code!=0)throw A;return{}})),new Promise((A,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])})}updateStatus(e){let t="",n={status_update:{status:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}writeQuickMenuEvent(e,t,n,r,o,a,i,c,d,h,_,f,b,g,A,C){return l(this,null,function*(){let w="",v={clan_id:t,channel_id:n,mode:r,is_public:o,content:a,mentions:i,attachments:c,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:b,topic_id:g};A!=null&&String(A).length>0&&(v.id=A);let E={menu_name:e,message:v};C!=null&&String(C).length>0&&String(C)!=="0"&&(E.message_sender_id=C);let J={quick_menu_event:E};return Promise.race([this.send({urlPath:w,fetchOptions:J}).then(D=>l(this,null,function*(){if(D.code!=0)throw D;return{}})),new Promise((D,L)=>setTimeout(()=>L(new Error("Request timed out.")),this.timeoutMs))])})}writeEphemeralMessage(e,t,n,r,o,a,i,c,d,h,_,f,b,g,A){return l(this,null,function*(){let C="",w={ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:n,mode:r,is_public:o,content:a,mentions:i,attachments:c,references:d,anonymous_message:h,mention_everyone:_,avatar:f,code:b,topic_id:g,id:A}}};return Promise.race([this.send({urlPath:C,fetchOptions:w}).then(v=>l(this,null,function*(){if(v.code!=0)throw v;return{}})),new Promise((v,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])})}writeChatMessage(e,t,n,r,o,a,i,c,d,h,_,f,b){return l(this,null,function*(){let g="",A={channel_message_send:{clan_id:e,channel_id:t,mode:n,is_public:r,content:o,mentions:a,attachments:i,references:c,anonymous_message:d,mention_everyone:h,avatar:_,code:f,topic_id:b}};return Promise.race([this.send({urlPath:g,fetchOptions:A}).then(C=>l(this,null,function*(){var w;if(C.code!=0)throw C;return(w=C==null?void 0:C.message)==null?void 0:w.channel_message_ack})),new Promise((C,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageReaction(e,t,n,r,o,a,i,c,d,h,_,f,b,g){return l(this,null,function*(){let A="",C={message_reaction_event:{id:e,clan_id:t,channel_id:n,mode:r,is_public:o,message_id:a,emoji_id:i,emoji:c,count:d,message_sender_id:h,action:_,topic_id:f,emoji_recent_id:b,sender_name:g}};return Promise.race([this.send({urlPath:A,fetchOptions:C}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return{}})),new Promise((w,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageTyping(e,t,n,r,o,a){return l(this,null,function*(){let i="",c={message_typing_event:{clan_id:e,channel_id:t,mode:n,is_public:r,sender_display_name:o,topic_id:a}};return Promise.race([this.send({urlPath:i,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastSeenMessage(e,t,n,r,o,a){return l(this,null,function*(){let i="",c={last_seen_message_event:{clan_id:e,channel_id:t,mode:n,message_id:r,timestamp_seconds:o,badge_count:a}};return Promise.race([this.send({urlPath:i,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastPinMessage(e,t,n,r,o,a,i,c,d,h,_,f,b){return l(this,null,function*(){let g="",A={last_pin_message_event:{clan_id:e,channel_id:t,mode:n,is_public:r,message_id:o,timestamp_seconds:a,operation:i,message_sender_avatar:c,message_sender_id:d,message_sender_username:h,message_content:_,message_attachment:f,message_created_time:b}};return Promise.race([this.send({urlPath:g,fetchOptions:A}).then(C=>l(this,null,function*(){if(C.code!=0)throw C;return{}})),new Promise((C,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeCustomStatus(e,t,n,r){return l(this,null,function*(){let o="",a={custom_status_event:{clan_id:e,status:t,time_reset:n,no_clear:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceReaction(e,t){return l(this,null,function*(){let n="",r={voice_reaction_send:{emojis:e,channel_id:t}};return Promise.race([this.send({urlPath:n,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceInteractiveEvent(e,t,n,r,o,a){return l(this,null,function*(){let i="",c={voice_interactive_event:{clan_id:e,voice_channel_id:t,sender_id:n,receiver_id:r,event_type:o,params:a}};return Promise.race([this.send({urlPath:i,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}forwardWebrtcSignaling(e,t,n,r,o){return l(this,null,function*(){let a="",i={webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:n,channel_id:r,caller_id:o}};return Promise.race([this.send({urlPath:a,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,r){return l(this,null,function*(){let o="",a={incoming_call_push:{receiver_id:e,json_data:t,channel_id:n,caller_id:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeChannelAppEvent(e,t,n){return l(this,null,function*(){let r="",o={channel_app_event:{clan_id:e,channel_id:t,action:n}};return Promise.race([this.send({urlPath:r,fetchOptions:o}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])})}writeStreamingWatch(e,t){return l(this,null,function*(){let n="",r={streaming_watch:{channel_id:e,watching:t}};return Promise.race([this.send({urlPath:n,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}listLogedDevice(){return l(this,null,function*(){let e="/mezon.api.Mezon/ListLogedDevice",t={};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){return n.code!=0?{}:s.LogedDeviceList.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}};V.DefaultSendTimeoutMs=1e4;var K=V;var Oe="127.0.0.1",Ue="7350",De="defaultkey",Le=3e4,p={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};function U(y){return typeof Event=="function"?new Event(y):{type:y,target:null,currentTarget:null,bubbles:!1,cancelable:!1,defaultPrevented:!1,timeStamp:Date.now(),preventDefault:()=>{},stopPropagation:()=>{},stopImmediatePropagation:()=>{}}}var q=class q{constructor(e=De,t=Oe,n=Ue,r=!1,o=Le,a=!0){this.serverkey=e;this.timeout=o;this.autoFallbackHttp=a;this.verbose=!1;this._hasConnectedOnce=!1;this._connectAttemptSeq=0;this._heartbeatSuspended=!1;this._serverDisconnectStreak=0;this.host=t,this.port=n,this.useSSL=r;let c=`${r?"https://":"http://"}${t}:${n}`;this._heartbeatIntervalMs=q.DefaultHeartbeatIntervalMs,this._heartbeatTimeoutMs=q.DefaultHeartbeatTimeoutMs,this._connectionState=p.DISCONNECTED,this.serverDisconnectStreakLogoutThreshold=q.DefaultServerDisconnectStreakLogoutThreshold,this.transport=new K(e,o,c)}failConnect(e){let t=this._connectReject;this._connectReject=void 0,t&&t(e)}isOpen(){return this._connectionState===p.CONNECTED}connect(e,t,n=!1,r=!1,o=q.DefaultConnectTimeoutMs){var h,_;this.verbose=r;let a=((h=this._lastConnectArgs)==null?void 0:h.session_id)===e&&((_=this._lastConnectArgs)==null?void 0:_.url)===t;if(this._connectionState===p.CONNECTED&&this.transport.adapter.isOpen()&&a)return Promise.resolve();if(this._connectionState===p.CONNECTING&&this._connectPromise&&a)return this._connectPromise;(this._connectionState===p.CONNECTED||this._connectionState===p.CONNECTING)&&(this.failConnect(new Error("Connect superseded by new connect().")),this.transport.close(),this.markDisconnected("connect_superseded",U("close"),!1,!1)),this.clearConnectTimeout(),this._connectionState=p.CONNECTING,this._connectAttemptSeq+=1,this._lastConnectArgs={session_id:e,url:t,createStatus:n,verbose:r,connectTimeoutMs:o};let i,c,d=new Promise((f,b)=>{i=f,c=b});this._connectPromise=d,this._connectReject=c,this._connectTimeoutTimer=setTimeout(()=>{this._connectionState===p.CONNECTING&&(this.markDisconnected("connect_timeout",U("timeout"),!0,!1),this.transport.close(),this.failConnect(new Error("TIME_OUT")))},o);try{this.transport.connect(e,t,n,r,{onMessage:(f,b,g)=>l(this,null,function*(){if(!g.cid)if(g.notifications)g.notifications.notifications.forEach(A=>{A.content=A.content?G(A.content):void 0,this.onnotification(A)});else if(g.voice_started_event)this.onvoicestarted(g.voice_started_event);else if(g.voice_ended_event)this.onvoiceended(g.voice_ended_event);else if(g.voice_joined_event)this.onvoicejoined(g.voice_joined_event);else if(g.voice_leaved_event)this.onvoiceleaved(g.voice_leaved_event);else if(g.channel_created_event)this.onchannelcreated(g.channel_created_event);else if(g.category_event)this.oncategoryevent(g.category_event);else if(g.role_event)this.onroleevent(g.role_event);else if(g.event_emoji)this.oneventemoji(g.event_emoji);else if(g.noti_user_channel)this.oneventnotiuserchannel(g.noti_user_channel);else if(g.webhook_event)this.oneventwebhook(g.webhook_event);else if(g.channel_deleted_event)this.onchanneldeleted(g.channel_deleted_event);else if(g.clan_deleted_event)this.onclandeleted(g.clan_deleted_event);else if(g.sticker_create_event)this.onstickercreated(g.sticker_create_event);else if(g.sticker_update_event)this.onstickerupdated(g.sticker_update_event);else if(g.sticker_delete_event)this.onstickerdeleted(g.sticker_delete_event);else if(g.channel_updated_event)this.onchannelupdated(g.channel_updated_event);else if(g.channel_archive_event)this.onchannelarchive(g.channel_archive_event);else if(g.delete_account_event)this.ondeleteaccount(g.delete_account_event);else if(g.clan_profile_updated_event)this.onclanprofileupdated(g.clan_profile_updated_event);else if(g.clan_updated_event)this.onclanupdated(g.clan_updated_event);else if(g.last_seen_message_event)this.onlastseenupdated(g.last_seen_message_event);else if(g.status_presence_event)this.onstatuspresence(g.status_presence_event);else if(g.channel_message){let A=$(g);this.onchannelmessage(A)}else g.message_typing_event?this.onmessagetyping(g.message_typing_event):g.message_reaction_event?this.onmessagereaction(g.message_reaction_event):g.channel_presence_event?this.onchannelpresence(g.channel_presence_event):g.last_pin_message_event?this.onpinmessage(g.last_pin_message_event):g.custom_status_event?this.oncustomstatus(g.custom_status_event):g.canvas_event?this.oncanvasevent(g.canvas_event):g.user_channel_added_event?this.onuserchanneladded(g.user_channel_added_event):g.add_clan_user_event?this.onuserclanadded(g.add_clan_user_event):g.user_profile_updated_event?this.onuserprofileupdate(g.user_profile_updated_event):g.user_channel_removed_event?this.onuserchannelremoved(g.user_channel_removed_event):g.block_friend?this.onblockfriend(g.block_friend):g.un_block_friend?this.onunblockfriend(g.un_block_friend):g.add_friend?this.onaddfriend(g.add_friend):g.remove_friend?this.onremovefriend(g.remove_friend):g.user_clan_removed_event?this.onuserclanremoved(g.user_clan_removed_event):g.clan_event_created?this.oneventcreated(g.clan_event_created):g.give_coffee_event?this.oncoffeegiven(g.give_coffee_event):g.role_assign_event?this.onroleassign(g.role_assign_event):g.streaming_started_event?this.onstreamingchannelstarted(g.streaming_started_event):g.streaming_ended_event?this.onstreamingchannelended(g.streaming_ended_event):g.streaming_joined_event?this.onstreamingchanneljoined(g.streaming_joined_event):g.streaming_leaved_event?this.onstreamingchannelleaved(g.streaming_leaved_event):g.streaming_viewer_count_event?this.onstreamingviewercount(g.streaming_viewer_count_event):g.permission_set_event?this.onpermissionset(g.permission_set_event):g.permission_changed_event?this.onpermissionchanged(g.permission_changed_event):g.unmute_event?this.onunmuteevent(g.unmute_event):g.token_sent_event?this.ontokensent(g.token_sent_event):g.message_button_clicked?this.onmessagebuttonclicked(g.message_button_clicked):g.dropdown_box_selected?this.onmessagedropdownboxselected(g.dropdown_box_selected):g.mark_as_read?this.onmarkasread(g.mark_as_read):g.voice_reaction_send?this.onvoicereactionmessage(g.voice_reaction_send):g.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(g.webrtc_signaling_fwd):g.list_activity?this.onactivityupdated(g.list_activity):g.sd_topic_event?this.onsdtopicevent(g.sd_topic_event):g.channel_app_event?this.onchannelappevent(g.channel_app_event):g.user_status_event?this.onuserstatusevent(g.user_status_event):g.join_channel_app_data?this.onjoinchannelappevent(g.join_channel_app_data):g.unpin_message_event?this.onunpinmessageevent(g.unpin_message_event):g.quick_menu_event?this.onquickmenuevent(g.quick_menu_event):g.meet_participant_event?this.onmeetparticipantevent(g.meet_participant_event):g.transfer_ownership_event?this.ontransferownership(g.transfer_ownership_event):g.ban_user_event?this.onbanneduser(g.ban_user_event):g.list_channel_users_banned_event?this.onlistchannelusersbanned(g.list_channel_users_banned_event):g.allow_anonymous_event?this.onallowanonymousevent(g.allow_anonymous_event):g.aiagent_enabled_event?this.onaiagentenabled(g.aiagent_enabled_event):g.refresh_session_event?this.onrefreshsession(g.refresh_session_event):g.topic_in_message_event?this.ontopicinmessage(g.topic_in_message_event):g.screen_share_event?this.onscreenshare(g.screen_share_event):g.voice_interactive_event?this.onvoiceinteractiveevent(g.voice_interactive_event):g.sfu_breakout_room_event?this.onsfubreakoutroomevent(g.sfu_breakout_room_event):g.pong?this.verbose&&window&&window.console&&console.log("Pong message received: %o",g):this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",g)}),onClose:f=>{let b=this._connectionState===p.CONNECTING;this.markDisconnected("transport_on_close",f,!0,!0),b&&this.failConnect(new Error("SOCKET_CLOSED_BEFORE_ESTABLISH"))},onOpen:f=>{this.verbose&&typeof console!="undefined"&&console.log(f);let b=this._hasConnectedOnce;this._hasConnectedOnce=!0,this.clearConnectTimeout(),this._serverDisconnectStreak=0,this._connectionState=p.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,i(),this._connectReject=void 0,b?this.onreconnect(f):this.onconnect(f)},onError:f=>{this.onerror(f),this._connectAttemptSeq+=1,this.failConnect(f instanceof Error?f:new Error("Socket error during connect.")),this.transport.close(),this.markDisconnected("transport_on_error",f,!0,!1)}})}catch(f){let b=U("error");this.onerror(b),this.markDisconnected("connect_sync_throw",b,!0,!1),this.failConnect(f instanceof Error?f:new Error(String(f)))}return d}setAutoReconnect(e){}disconnect(e=!0){this._lastConnectArgs=void 0,this.failConnect(new Error("Client disconnected.")),this.markDisconnected("client_disconnect",U("close"),e,!1),this.transport.close()}pingPong(){return l(this,null,function*(){if(!this.isOpen())return;let e=this._connectAttemptSeq;try{let t="",n={ping:{}};yield this.transport.send({urlPath:t,fetchOptions:n},this._heartbeatTimeoutMs)}catch(t){if(e!==this._connectAttemptSeq||this._connectionState!==p.CONNECTED)return;this.verbose&&typeof console!="undefined"&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this._connectAttemptSeq+=1,this.transport.adapter.isOpen()&&this.transport.close(),this.markDisconnected("heartbeat_unreachable",U("close"),!0,!1);return}e===this._connectAttemptSeq&&this.startHeartbeatLoop()})}startHeartbeatLoop(){this._heartbeatSuspended||(this.stopHeartbeatLoop(),this._heartbeatTimer=setTimeout(()=>this.pingPong(),this._heartbeatIntervalMs))}stopHeartbeatLoop(){this._heartbeatTimer!==void 0&&(clearTimeout(this._heartbeatTimer),this._heartbeatTimer=void 0)}clearConnectTimeout(){this._connectTimeoutTimer!==void 0&&(clearTimeout(this._connectTimeoutTimer),this._connectTimeoutTimer=void 0)}markDisconnected(e,t=U("close"),n=!0,r=!1){this.verbose&&typeof console!="undefined"&&console.log(e);let o=this._connectionState===p.DISCONNECTED;if(this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this._connectPromise=void 0,o||n&&this.ondisconnect(t),r&&!o&&this.serverDisconnectStreakLogoutThreshold>0&&(this._serverDisconnectStreak+=1,this._serverDisconnectStreak>=this.serverDisconnectStreakLogoutThreshold)){let a=this._serverDisconnectStreak;this._serverDisconnectStreak=0,this.onserverdisconnectstreaklogout(t,a)}}onconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onreconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ondisconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onserverdisconnectstreaklogout(e,t){this.verbose&&typeof console!="undefined"&&console.log("Server disconnect streak reached: %o",t,e)}onerror(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagetyping(e){this.verbose&&window&&window.console&&console.log(e)}onmessagereaction(e){this.verbose&&window&&window.console&&console.log(e)}onchannelmessage(e){this.verbose&&window&&window.console&&console.log(e)}onchannelpresence(e){this.verbose&&window&&window.console&&console.log(e)}onuserchanneladded(e){this.verbose&&window&&window.console&&console.log(e)}onuserclanadded(e){this.verbose&&window&&window.console&&console.log(e)}onuserprofileupdate(e){this.verbose&&window&&window.console&&console.log(e)}onuserchannelremoved(e){this.verbose&&window&&window.console&&console.log(e)}onaddfriend(e){this.verbose&&window&&window.console&&console.log(e)}onremovefriend(e){this.verbose&&window&&window.console&&console.log(e)}onblockfriend(e){this.verbose&&window&&window.console&&console.log(e)}onunblockfriend(e){this.verbose&&window&&window.console&&console.log(e)}onuserclanremoved(e){this.verbose&&window&&window.console&&console.log(e)}onnotification(e){this.verbose&&window&&window.console&&console.log(e)}onstatuspresence(e){this.verbose&&window&&window.console&&console.log(e)}onpinmessage(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceended(e){this.verbose&&window&&window.console&&console.log(e)}onvoicestarted(e){this.verbose&&window&&window.console&&console.log(e)}onvoicejoined(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceleaved(e){this.verbose&&window&&window.console&&console.log(e)}onchannelcreated(e){this.verbose&&window&&window.console&&console.log(e)}oncategoryevent(e){this.verbose&&window&&window.console&&console.log(e)}onroleevent(e){this.verbose&&window&&window.console&&console.log(e)}oneventemoji(e){this.verbose&&window&&window.console&&console.log(e)}oneventnotiuserchannel(e){this.verbose&&window&&window.console&&console.log(e)}oneventwebhook(e){this.verbose&&window&&window.console&&console.log(e)}onchanneldeleted(e){this.verbose&&window&&window.console&&console.log(e)}onclandeleted(e){this.verbose&&window&&window.console&&console.log(e)}onstickercreated(e){this.verbose&&window&&window.console&&console.log(e)}onstickerdeleted(e){this.verbose&&window&&window.console&&console.log(e)}onstickerupdated(e){this.verbose&&window&&window.console&&console.log(e)}onchannelupdated(e){this.verbose&&window&&window.console&&console.log(e)}onchannelarchive(e){this.verbose&&window&&window.console&&console.log(e)}ondeleteaccount(e){this.verbose&&window&&window.console&&console.log(e)}onclanprofileupdated(e){this.verbose&&window&&window.console&&console.log(e)}onclanupdated(e){this.verbose&&window&&window.console&&console.log(e)}onlastseenupdated(e){this.verbose&&window&&window.console&&console.log(e)}onheartbeattimeout(){this.verbose&&window&&window.console&&console.log("Heartbeat timeout.")}oncustomstatus(e){this.verbose&&window&&window.console&&console.log(e)}oncanvasevent(e){this.verbose&&window&&window.console&&console.log(e)}oneventcreated(e){this.verbose&&window&&window.console&&console.log(e)}oncoffeegiven(e){this.verbose&&window&&window.console&&console.log(e)}onroleassign(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelstarted(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelended(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchanneljoined(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelleaved(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingviewercount(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionset(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionchanged(e){this.verbose&&window&&window.console&&console.log(e)}onunmuteevent(e){this.verbose&&window&&window.console&&console.log(e)}ontokensent(e){this.verbose&&window&&window.console&&console.log(e)}onmessagebuttonclicked(e){this.verbose&&window&&window.console&&console.log(e)}onmessagedropdownboxselected(e){this.verbose&&window&&window.console&&console.log(e)}onmarkasread(e){this.verbose&&window&&window.console&&console.log(e)}onvoicereactionmessage(e){this.verbose&&window&&window.console&&console.log(e)}onwebrtcsignalingfwd(e){this.verbose&&window&&window.console&&console.log(e)}onactivityupdated(e){this.verbose&&window&&window.console&&console.log(e)}onsdtopicevent(e){this.verbose&&window&&window.console&&console.log(e)}onsfubreakoutroomevent(e){this.verbose&&window&&window.console&&console.log(e)}onchannelappevent(e){this.verbose&&window&&window.console&&console.log(e)}onuserstatusevent(e){this.verbose&&window&&window.console&&console.log(e)}onjoinchannelappevent(e){this.verbose&&window&&window.console&&console.log(e)}onunpinmessageevent(e){this.verbose&&window&&window.console&&console.log(e)}onquickmenuevent(e){this.verbose&&window&&window.console&&console.log(e)}ontransferownership(e){this.verbose&&window&&window.console&&console.log(e)}onbanneduser(e){this.verbose&&window&&window.console&&console.log(e)}onlistchannelusersbanned(e){this.verbose&&window&&window.console&&console.log(e)}onmeetparticipantevent(e){this.verbose&&window&&window.console&&console.log(e)}onallowanonymousevent(e){this.verbose&&window&&window.console&&console.log(e)}onaiagentenabled(e){this.verbose&&window&&window.console&&console.log(e)}onrefreshsession(e){this.verbose&&window&&window.console&&console.log(`Token refresh occurred. Token: ${e.token}`)}ontopicinmessage(e){this.verbose&&window&&window.console&&console.log(e)}onscreenshare(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceinteractiveevent(e){this.verbose&&window&&window.console&&console.log(e)}authenticateMezon(e,t,n,r,o={},a={}){let i={token:e,vars:o};return this.transport.authenticateMezon(this.serverkey,"",i,t,n,r,a).then(c=>({token:c.token||"",refresh_token:c.refresh_token||"",created:c.created||!1,api_url:c.api_url||"",ws_url:c.ws_url||"",id_token:c.id_token||"",is_remember:c.is_remember||!1,session_id:c.session_id||""}))}authenticateSMSOTPRequest(e,t,n){let r={username:t,account:{phoneno:e,vars:n}};return this.transport.AuthenticateSMSOTPRequest(this.serverkey,"",r,t).then(o=>Promise.resolve(o))}authenticateEmailOTPRequest(e,t,n){let r={username:t,account:{email:e,vars:n}};return this.transport.AuthenticateEmailOTPRequest(this.serverkey,"",r,t).then(o=>Promise.resolve(o))}confirmAuthenticateOTP(e){return l(this,null,function*(){return this.transport.confirmAuthenticateOTP(this.serverkey,"",e).then(t=>({token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}))})}authenticateEmail(e,t,n,r){let o={username:n,account:{email:e,password:t,vars:r}};return this.transport.authenticateEmail(this.serverkey,"",o,n).then(a=>({token:a.token||"",refresh_token:a.refresh_token||"",created:a.created||!1,api_url:a.api_url||"",ws_url:a.ws_url||"",id_token:a.id_token||"",is_remember:a.is_remember||!1,session_id:a.session_id||""}))}addChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelUsers(t,n).then(r=>r!==void 0)})}addFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addFriends(t,n)})}blockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.blockFriends(t,n).then(r=>Promise.resolve(r!=null))})}unblockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unblockFriends(t,n).then(r=>Promise.resolve(r!=null))})}uploadOauthFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadOauthFile(t)})}uploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadAttachmentFile(t)})}uploadBatchAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadBatchAttachmentFile(t)})}multipartUploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFile(t)})}multipartUploadAttachmentFileFinish(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFileFinsih(t)})}linkCDNFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkCDNFile(t)})}sfuBreakoutRoom(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sfuBreakoutRoom(t)})}sfuBreakoutMerge(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sfuBreakoutMerge(t)})}createChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelDesc(t).then(n=>Promise.resolve(n))})}createClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanDesc(t).then(n=>Promise.resolve(n))})}checkDuplicateName(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.checkDuplicateName(t)})}createCategoryDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createCategoryDesc(t).then(n=>Promise.resolve(n))})}createRole(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRole(t).then(n=>Promise.resolve(n))})}createEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createEvent(t).then(n=>Promise.resolve(n))})}addRolesChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addRolesChannelDesc(t).then(n=>n!==void 0)})}deleteRoleChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRoleChannelDesc(t).then(n=>n!==void 0)})}deleteApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteApp(t).then(n=>n!==void 0)})}deleteFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteFriends(t,n).then(r=>r!==void 0)})}deleteChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelDesc(t,n).then(r=>r!==void 0)})}deleteClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanDesc(t).then(n=>n!==void 0)})}deleteCategoryDesc(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteCategoryDesc(t,n,r).then(o=>o!==void 0)})}deleteNotifications(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotifications(t,n).then(r=>Promise.resolve(r!=null))})}deleteRole(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRole(t,"0",n,r).then(()=>!0)})}deleteEvent(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(t,n,r,o,a).then(i=>i!==void 0)})}updateEventUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEventUser(t).then(n=>n!==void 0)})}emitEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.event(t).then(n=>Promise.resolve(n!=null))})}getAccount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getAccount(e.token)})}removeClanUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeClanUsers(t,n).then(r=>Promise.resolve(r!=null))})}listBannedUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listBannedUsers(t,n).then(r=>Promise.resolve(r))})}unbanClanUsers(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unbanClanUsers(t,n,r).then(o=>Promise.resolve(o!=null))})}banClanUsers(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.banClanUsers(t,n,r,o).then(a=>Promise.resolve(a!=null))})}removeChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelUsers(t,n).then(r=>Promise.resolve(r!=null))})}listChannelMessages(e,t,n,r,o,a,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelMessages(t,n,r,o,a,i).then(c=>{let d={messages:[],last_seen_message:c.last_seen_message,last_sent_message:c.last_sent_message};return c.messages==null||c.messages.forEach(h=>{let _,f,b,g,A;try{_=P(h.content)}catch(C){console.log("error parse content",C)}try{let C=N(h.reactions);f=(C==null?void 0:C.reactions)||C||P(h.reactions||"[]")}catch(C){f=P(h.reactions||"[]")}try{let C=B(h.mentions);b=(C==null?void 0:C.mentions)||C||P(h.mentions||"[]")}catch(C){b=P(h.mentions||"[]")}try{let C=x(h.attachments);g=(C==null?void 0:C.attachments)||C||P(h.attachments||"[]")}catch(C){g=P(h.attachments||"[]")}try{let C=W(h.references);A=(C==null?void 0:C.refs)||C||P(h.references||"[]")}catch(C){A=P(h.references||"[]")}d.messages.push({channel_id:h.channel_id,code:h.code?Number(h.code):0,id:h.message_id||"",sender_id:h.sender_id,username:h.username,display_name:h.display_name,avatar:h.avatar,content:_,channel_label:h.channel_label,clan_logo:h.clan_logo,category_name:h.category_name,clan_nick:h.clan_nick,clan_avatar:h.clan_avatar,attachments:g,mentions:b,reactions:f,references:A,clan_id:h.clan_id,create_time_seconds:h.create_time_seconds,update_time_seconds:h.update_time_seconds,hide_editted:h.hide_editted})}),Promise.resolve(d)})})}listChannelVoiceUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelVoiceUsers(t,n).then(r=>{let o={voice_channel_users:[]};return r.voice_channel_users==null||r.voice_channel_users.forEach(a=>{o.voice_channel_users.push({id:a.id,channel_id:a.channel_id,user_ids:a.user_ids,room_name:a.room_name,share_screen_ids:a.share_screen_ids})}),Promise.resolve(o)})})}listChannelUsers(e,t,n,r,o,a,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(t,n,r,a,o,i).then(c=>{let d={channel_users:[],cursor:c.cursor,channel_id:c.channel_id};return c.channel_users==null||c.channel_users.forEach(h=>{d.channel_users.push({user_id:h.user_id,role_id:h.role_id,thread_id:h.thread_id,clan_avatar:h.clan_avatar,clan_nick:h.clan_nick,id:h.id,clan_id:h.clan_id,added_by:h.added_by,is_banned:h.is_banned})}),Promise.resolve(d)})})}listChannelAttachments(e,t,n,r,o,a,i,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(n,t,r,a,o,i,c).then(d=>{let h={attachments:[]};return d.attachments==null||d.attachments.forEach(_=>{h.attachments.push({filename:_.filename,filesize:_.filesize,filetype:_.filetype,id:_.id,uploader:_.uploader,url:_.url,message_id:_.message_id,create_time_seconds:_.create_time_seconds,width:_.width,height:_.height})}),Promise.resolve(h)})})}listClanUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsers(t).then(n=>{let r={clan_users:[],cursor:n.cursor,clan_id:n.clan_id};return n.clan_users==null||n.clan_users.forEach(o=>{var a;r.clan_users.push({user:{avatar_url:o.user.avatar_url,create_time_seconds:o.user.create_time_seconds,display_name:o.user.display_name,edge_count:o.user.edge_count?Number(o.user.edge_count):0,id:o.user.id,lang_tag:o.user.lang_tag,location:o.user.location,online:o.user.online,is_mobile:(a=o.user)==null?void 0:a.is_mobile,timezone:o.user.timezone,update_time:o.user.update_time,username:o.user.username,user_status:o.user.user_status,status:o.user.status,about_me:o.user.about_me,mezon_id:o.user.mezon_id,list_nick_names:o.user.list_nick_names,phone_number:o.user.phone_number,join_time_seconds:o.user.join_time_seconds},role_id:o.role_id,clan_nick:o.clan_nick,clan_avatar:o.clan_avatar})}),Promise.resolve(r)})})}listClanUsersStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsersStatus(t).then(n=>{let r={clan_user_statuses:[]};return n.clan_user_statuses==null||n.clan_user_statuses.forEach(o=>{r.clan_user_statuses.push({user_id:o.user_id,user_status:o.user_status})}),Promise.resolve(r)})})}listChannelDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDetail(t).then(n=>Promise.resolve(n))})}listChannelDescs(e,t,n,r,o,a,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDescs(t,n,r,o,a,i).then(c=>{let d={channeldesc:[],next_cursor:c.next_cursor,prev_cursor:c.prev_cursor,cacheable_cursor:c.cacheable_cursor};return c.channeldesc==null||(d.channeldesc=c.channeldesc),Promise.resolve(d)})})}listClanDescs(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanDescs(t,n,r).then(o=>{let a={clandesc:[]};return o.clandesc==null||(a.clandesc=o.clandesc),Promise.resolve(a)})})}listClanBadgeCount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanBadgeCount().then(t=>{var n;return{list_badge:(n=t.list_badge)!=null?n:[]}})})}listChannelBadgeCount(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelBadgeCount(t,n,r).then(o=>{var a;return{channeldesc:(a=o.channeldesc)!=null?a:[],total_count:o.total_count}})})}listUserOnline(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserOnline(t,n,r).then(o=>{var a;return{users:(a=o.users)!=null?a:[],total_count:o.total_count}})})}listCategoryDescs(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listCategoryDescs(t,n,r).then(o=>{let a={categorydesc:[]};return o.categorydesc==null||(a.categorydesc=o.categorydesc),Promise.resolve(a)})})}listEvents(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listEvents(t).then(n=>Promise.resolve(n))})}getListPermission(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListPermission(e.token).then(t=>Promise.resolve(t))})}listRolePermissions(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRolePermissions(t).then(n=>Promise.resolve(n))})}listRoleUsers(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoleUsers(t,n,r).then(o=>Promise.resolve(o))})}registFCMDeviceToken(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registFCMDeviceToken(t,n,r,o).then(a=>Promise.resolve(a))})}getUserProfileOnClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserProfileOnClan(t).then(n=>Promise.resolve(n))})}closeDirectMess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closeDirectMess(t).then(n=>n!==void 0)})}openDirectMess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.openDirectMess(t).then(n=>n!==void 0)})}confirmLinkMezonOTP(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLinkMezonOTP(t)})}linkSMS(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkSMS(t).then(n=>Promise.resolve(n))})}linkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkEmail(t).then(n=>Promise.resolve(n))})}listFriends(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listFriends(n,t,r).then(o=>{let a={friends:[],cursor:o.cursor};return o.friends==null||o.friends.forEach(i=>{var c;a.friends.push({user:{avatar_url:i.user.avatar_url,create_time_seconds:i.user.create_time_seconds,display_name:i.user.display_name,edge_count:i.user.edge_count?Number(i.user.edge_count):0,id:i.user.id,lang_tag:i.user.lang_tag,location:i.user.location,online:i.user.online,timezone:i.user.timezone,update_time:i.user.update_time,username:i.user.username,is_mobile:(c=i.user)==null?void 0:c.is_mobile,user_status:i.user.user_status,status:i.user.status,mezon_id:i.user.mezon_id,list_nick_names:i.user.list_nick_names,phone_number:i.user.phone_number,about_me:i.user.about_me},state:i.state,source_id:i.source_id})}),Promise.resolve(a)})})}listNotifications(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listNotifications(n,t,r,o,a).then(i=>{let c={cacheable_cursor:i.cacheable_cursor,notifications:[]};return i.notifications==null||i.notifications.forEach(d=>{c.notifications.push({id:d.id,subject:d.subject,content:d.content?G(d.content):void 0,code:d.code?Number(d.code):0,sender_id:d.sender_id,create_time_seconds:d.create_time_seconds,persistent:d.persistent,category:d.category})}),Promise.resolve(c)})})}sessionLogout(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sessionLogout({refresh_token:n,token:t,device_id:r,platform:o}).then(a=>a!==void 0)})}unlinkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkEmail(t).then(n=>n!==void 0)})}unlinkMezon(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkMezon(t).then(n=>n!==void 0)})}updateUsername(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUsername(t).then(n=>Promise.resolve(n))})}updateAccount(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateAccount(t).then(n=>n!==void 0)})}updateChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelDesc(t,n).then(r=>r!==void 0)})}updateClanDesc(e,t,n){return l(this,null,function*(){this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e));let r=S({},n);return r.hashtags!==void 0&&(r.hashtags=I(r.hashtags)),this.transport.updateClanDesc(t,r).then(o=>o!==void 0)})}updateCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategory(t,n).then(r=>r!==void 0)})}updateUserProfileByClan(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserProfileByClan(t,n).then(r=>r!==void 0)})}updateRole(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRole(t,n).then(()=>!0)})}updateEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEvent(t,n).then(r=>r!==void 0)})}updateApp(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateApp(t,n).then(r=>Promise.resolve(r))})}createLinkInviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createLinkInviteUser(t).then(n=>Promise.resolve(n))})}getLinkInvite(e){return l(this,null,function*(){return this.transport.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getRoleOfUserInTheClan(t).then(n=>Promise.resolve(n))})}inviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.inviteUser(t).then(n=>Promise.resolve(n))})}setNotificationClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationClanSetting(t).then(n=>n!==void 0)})}setNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationChannelSetting(t).then(n=>n!==void 0)})}setMuteCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteCategory(t).then(n=>n!==void 0)})}setMuteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteChannel(t).then(n=>n!==void 0)})}updateChannelPrivate(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelPrivate(t).then(n=>n!==void 0)})}setNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationChannel(t).then(n=>n!==void 0)})}setNotificationReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationReactMessage({channel_id:t}).then(n=>n!==void 0)})}deleteNotiReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotiReactMessage(t).then(n=>n!==void 0)})}searchMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMessage(t).then(n=>Promise.resolve(n))})}searchCtrlK(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchCtrlK(t).then(n=>Promise.resolve(n))})}searchMentionUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMentionUsers(t).then(n=>Promise.resolve(n))})}generateCDNSignature(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateCDNSignature(t).then(n=>Promise.resolve(n))})}getStreamPlayback(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getStreamPlayback(t).then(n=>Promise.resolve(n))})}setOverrideEveryoneChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setOverrideEveryoneChannel(t).then(n=>Promise.resolve(n))})}getOverrideEveryoneChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOverrideEveryoneChannel(t).then(n=>Promise.resolve(n))})}getDMSetting(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getDMSetting().then(t=>Promise.resolve(t))})}updateDMSetting(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateDMSetting(t).then(n=>Promise.resolve(n))})}createMessage2Inbox(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createMessage2Inbox(t).then(n=>Promise.resolve(n))})}createPinMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPinMessage(t).then(n=>Promise.resolve(n))})}pinMessagesList(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPinMessagesList(t,n,r).then(o=>{let a={pin_messages_list:[]};return o.pin_messages_list==null||o.pin_messages_list.forEach(i=>{a.pin_messages_list.push({id:i.id,avatar:i.avatar,channel_id:i.channel_id,content:i.content,create_time_seconds:i.create_time_seconds,message_id:i.message_id,sender_id:i.sender_id,username:i.username,attachment:i.attachment})}),Promise.resolve(a)})})}deletePinMessage(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deletePinMessage(t,n,r,o).then(a=>a!==void 0)})}createClanEmoji(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanEmoji(t).then(n=>n!==void 0)})}updateClanEmojiById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanEmojiById(t,n).then(r=>r!==void 0)})}deleteByIdClanEmoji(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanEmojiById(t,n,r).then(o=>o!==void 0)})}generateWebhookLink(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateWebhook(t).then(n=>Promise.resolve(n))})}listWebhookByChannelId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listWebhookByChannelId(t,n).then(r=>Promise.resolve(r))})}updateWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateWebhookById(t,n).then(r=>r!==void 0)})}deleteWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteWebhookById(t,n).then(r=>r!==void 0)})}addClanSticker(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addClanSticker(t).then(n=>n!==void 0)})}deleteClanStickerById(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanStickerById(t,n,r).then(o=>o!==void 0)})}updateClanStickerById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanStickerById(t,n).then(r=>r!==void 0)})}changeChannelCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.changeChannelCategory(t,n).then(r=>r!==void 0)})}setRoleChannelPermission(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setRoleChannelPermission(t).then(n=>n!==void 0)})}addApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addApp(t).then(n=>Promise.resolve(n))})}getApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getApp(t).then(n=>Promise.resolve(n))})}listApps(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listApps(e.token).then(t=>Promise.resolve(t))})}addAppToClan(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAppToClan(t,n).then(r=>r!==void 0)})}getSystemMessagesList(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessagesList(e.token).then(t=>Promise.resolve(t))})}getSystemMessageByClanId(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessageByClanId(t).then(n=>Promise.resolve(n))})}createSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSystemMessage(t).then(n=>Promise.resolve(n))})}updateSystemMessage(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateSystemMessage(t,n).then(r=>Promise.resolve(r))})}deleteSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSystemMessage(t).then(n=>Promise.resolve(n))})}updateCategoryOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategoryOrder(t).then(n=>Promise.resolve(n))})}listStreamingChannelUsers(e,t,n,r,o,a,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(t,n,r,a,o,i).then(c=>{let d={streaming_channel_users:[]};return c.streaming_channel_users==null||c.streaming_channel_users.forEach(h=>{d.streaming_channel_users.push({id:h.id,channel_id:h.channel_id,user_id:h.user_id,participant:h.participant,is_publisher:h.is_publisher})}),Promise.resolve(d)})})}registerStreamingChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registerStreamingChannel(t).then(n=>n!==void 0)})}listChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelApps(t).then(n=>{let r={channel_apps:[]};return n.channel_apps==null||n.channel_apps.forEach(o=>{r.channel_apps.push({id:o.id,channel_id:o.channel_id,app_id:o.app_id,clan_id:o.clan_id,app_url:o.app_url,app_name:o.app_name,app_logo:o.app_logo})}),Promise.resolve(r)})})}getChannelCategoryNotiSettingsList(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCategoryNotiSettingsList(t).then(n=>Promise.resolve(n))})}getNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationCategory(t).then(n=>Promise.resolve(n))})}getNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationChannel(t).then(n=>Promise.resolve(n))})}getNotificationClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationClan(t).then(n=>Promise.resolve(n))})}getNotificationReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationReactMessage(t).then(n=>Promise.resolve(n))})}listChannelByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelByUserId(e.token).then(t=>Promise.resolve(t))})}listChannelUsersUC(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsersUC(t,n).then(r=>Promise.resolve(r))})}getListEmojisByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListEmojisByUserId(e.token).then(t=>Promise.resolve(t))})}emojiRecentList(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.emojiRecentList(e.token).then(t=>Promise.resolve(t))})}getListStickersByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListStickersByUserId(e.token).then(t=>Promise.resolve(t))})}listUserClansByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserClansByUserId(e.token).then(t=>Promise.resolve(t))})}listRoles(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoles(t,n,r,o).then(a=>{let i={clan_id:t,roles:a.roles};return Promise.resolve(i)})})}listUserPermissionInChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserPermissionInChannel(t,n).then(r=>{let o={clan_id:t,channel_id:n,permissions:r.permissions};return Promise.resolve(o)})})}getPermissionByRoleIdChannelId(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPermissionByRoleIdChannelId(t,n,r).then(o=>{let a={role_id:t,channel_id:n,permission_role_channel:o.permission_role_channel,user_id:r};return Promise.resolve(a)})})}markAsRead(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.markAsRead(t).then(n=>Promise.resolve(n))})}listThreadDescs(e,t,n,r,o,a,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listThreadDescs(t,n,r,o,a,i).then(c=>{let d={channeldesc:[]};return c.channeldesc==null||(d.channeldesc=c.channeldesc),Promise.resolve(d)})})}listChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelTimeline(t).then(n=>{var r;return(r=n.events)==null||r.forEach(o=>{o.attachments=[];let a;try{let i=T(o.preview_imgs);a=(i==null?void 0:i.attachments)||i||P(o.preview_imgs||"[]")}catch(i){a=P(o.preview_imgs||"[]")}Array.isArray(a)?o.preview_imgs=a:o.preview_imgs=[]}),Promise.resolve(n)})})}createChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let i=T(r.attachments),c=T(r.preview_imgs);o=(i==null?void 0:i.attachments)||i||P(r.attachments||"[]"),a=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(i){o=P(r.attachments||"[]"),a=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(a)?r.preview_imgs=a:r.preview_imgs=[]}return Promise.resolve(n)})})}updateChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let i=T(r.attachments),c=T(r.preview_imgs);o=(i==null?void 0:i.attachments)||i||P(r.attachments||"[]"),a=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(i){o=P(r.attachments||"[]"),a=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(a)?r.preview_imgs=a:r.preview_imgs=[]}return Promise.resolve(n)})})}detailChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.detailChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let i=T(r.attachments),c=T(r.preview_imgs);o=(i==null?void 0:i.attachments)||i||P(r.attachments||"[]"),a=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(i){o=P(r.attachments||"[]"),a=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(a)?r.preview_imgs=a:r.preview_imgs=[]}return Promise.resolve(n)})})}leaveThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveThread(t,n).then(r=>Promise.resolve(r))})}archiveChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.archiveChannel(t,n).then(r=>Promise.resolve(r))})}listArchivedChannelDescs(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listArchivedChannelDescs(t).then(n=>Promise.resolve(n))})}getChannelSettingInClan(e,t,n,r,o,a,i,c,d,h,_){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelSetting(t,n,r,o,a,i,c,d,h,_).then(f=>Promise.resolve(f))})}getChannelCanvasList(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasList(t,n,r,o).then(a=>{let i={channel_canvases:[]};return a.channel_canvases==null||(i.clan_id=a.clan_id,i.channel_id=a.channel_id,i.channel_canvases=a.channel_canvases,i.count=a.count),Promise.resolve(i)})})}getChannelCanvasDetail(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasDetail(t,n,r).then(o=>Promise.resolve(o))})}editChannelCanvases(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.editChannelCanvases(t).then(n=>Promise.resolve(n))})}deleteChannelCanvas(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelCanvas(t,n,r).then(o=>o!==void 0)})}addFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelFavorite({channel_id:t,clan_id:n}).then(r=>r)})}removeFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelFavorite(t,n).then(r=>r)})}getListFavoriteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListFavoriteChannel(t).then(n=>n)})}listActivity(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listActivity(e.token).then(t=>t)})}createActiviy(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createActiviy(t).then(n=>n)})}createQRLogin(e){return l(this,null,function*(){let t=yield this.transport.createQRLogin(this.serverkey,"",e);return{login_id:t.login_id,create_time_second:t.create_time_second}})}checkLoginRequest(e){return l(this,null,function*(){let t=yield this.transport.checkLoginRequest(this.serverkey,"",e);return t!=null&&t.token?{token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}:null})}confirmLogin(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLogin(t).then(n=>n)})}getChanEncryptionMethod(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChanEncryptionMethod(t).then(n=>n)})}setChanEncryptionMethod(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setChanEncryptionMethod(t,{method:n}).then(r=>r)})}getPubKeys(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPubKeys(t).then(n=>n)})}pushPubKey(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.pushPubKey({PK:t}).then(n=>n)})}getKeyServer(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getKeyServer(e.token).then(t=>t)})}listAuditLog(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listAuditLog(t,n,r,o).then(a=>a)})}listOnboarding(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboarding(t,n,r,o).then(a=>a)})}getOnboardingDetail(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOnboardingDetail(t,n).then(r=>Promise.resolve(r))})}createOnboarding(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createOnboarding(t).then(n=>n)})}updateOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboarding(t,n).then(r=>r!==void 0)})}deleteOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteOnboarding(t,n).then(r=>r!==void 0)})}generateClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateClanWebhook(t).then(n=>Promise.resolve(n))})}listClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanWebhook(t).then(n=>Promise.resolve(n))})}deleteClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanWebhookById(t,n).then(r=>r!==void 0)})}updateClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanWebhookById(t,n).then(r=>r!==void 0)})}listOnboardingStep(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboardingStep(t,n,r).then(o=>Promise.resolve(o))})}updateOnboardingStepByClanId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboardingStepByClanId(t,n).then(r=>r!==void 0)})}updateUserStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserStatus(t).then(n=>n!==void 0)})}updateUserCustomStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserCustomStatus(t).then(n=>n!==void 0)})}getUserStatus(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserStatus(e.token).then(t=>Promise.resolve(t))})}listSdTopic(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listSdTopic(t,n,r).then(o=>Promise.resolve(o))})}createSdTopic(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSdTopic(t).then(n=>n)})}deleteSdTopic(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSdTopic(t)})}getTopicDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getTopicDetail(t).then(n=>Promise.resolve(n))})}createRoomChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRoomChannelApps(t).then(n=>Promise.resolve(n))})}generateMeetToken(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateMeetToken(t).then(n=>Promise.resolve(n))})}listMezonOauthClient(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMezonOauthClient(e.token).then(t=>Promise.resolve(t))})}getMezonOauthClient(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getMezonOauthClient(t,n).then(r=>Promise.resolve(r))})}updateMezonOauthClient(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonOauthClient(t).then(n=>Promise.resolve(n))})}searchThread(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchThread(t,n,r).then(o=>Promise.resolve(o))})}generateHashChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateHashChannelApps(t).then(n=>Promise.resolve(n))})}registrationPassword(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registrationEmail({email:t,password:n,old_password:r}).then(o=>Promise.resolve(o))})}addUserEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addUserEvent(t).then(n=>n!==void 0)})}deleteUserEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteUserEvent(t,n).then(r=>r!==void 0)})}updateRoleOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRoleOrder(t).then(n=>Promise.resolve(n))})}deleteAccount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteAccount(e.token).then(t=>Promise.resolve(t))})}createExternalMezonMeet(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createExternalMezonMeet(e.token).then(t=>Promise.resolve(t))})}generateMeetTokenExternal(e,t,n,r){return l(this,null,function*(){return this.transport.generateMeetTokenExternal(e,t,n,r).then(o=>Promise.resolve(o))})}removeMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}muteMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.muteParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}updateClanOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanOrder(t).then(n=>n!==void 0)})}listClanDiscover(e){return l(this,null,function*(){let t=S({},e);return t.hashtags!==void 0&&(t.hashtags=I(t.hashtags)),this.transport.clanDiscover(this.serverkey,"",t).then(n=>Promise.resolve(n))})}listQuickMenuAccess(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listQuickMenuAccess(t,n,r).then(o=>Promise.resolve(o))})}deleteQuickMenuAccess(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteQuickMenuAccess(t,n).then(r=>r!==void 0)})}addQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addQuickMenuAccess(t).then(n=>n!==void 0)})}updateQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateQuickMenuAccess(t).then(n=>n!==void 0)})}listForSaleItems(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listForSaleItems(t).then(n=>Promise.resolve(n))})}isFollower(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isFollower(t).then(n=>Promise.resolve(n))})}transferOwnership(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.transferOwnership(t).then(n=>n!==void 0)})}isBanned(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isBanned(t).then(n=>Promise.resolve(n))})}reportMessageAbuse(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.reportMessageAbuse(t,n).then(r=>r!==void 0)})}updateMezonVoiceState(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonVoiceState(t,n,r,o,a).then(i=>i!==void 0)})}sendChannelMessage(e,t,n,r,o,a,i,c,d,h,_,f,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendChannelMessage(t,n,r,o,a,i,c,d,h,_,f,b,g).then(A=>Promise.resolve(A))})}sendChannelMessageApi(e,t,n,r,o,a,i,c,d,h,_,f,b,g){return l(this,null,function*(){return this.transport.sendChannelMessageApi(e,t,n,r,o,a,i,c,d,h,_,f,b,g).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,n,r,o,a,i,c,d,h,_,f,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(t,n,r,o,a,i,c,d,h,_,f,b).then(g=>Promise.resolve(g))})}deleteChannelMessage(e,t,n,r,o,a,i,c,d,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelMessage(t,n,r,o,a,i,c,d,h).then(_=>Promise.resolve(_))})}messageButtonClick(e,t,n,r,o,a,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.messageButtonClick(t,n,r,o,a,i).then(c=>Promise.resolve(c))})}dropdownBoxSelected(e,t,n,r,o,a,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.dropdownBoxSelected(t,n,r,o,a,i).then(c=>Promise.resolve(c))})}activeArchivedThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.activeArchivedThread(t,n).then(r=>Promise.resolve(r))})}addAgentToChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAgentToChannel(t,n).then(r=>Promise.resolve(r))})}disconnectAgent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.disconnectAgent(t,n).then(r=>Promise.resolve(r))})}listMutedChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMutedChannel(t).then(n=>Promise.resolve(n))})}channelMessageReact(e,t,n,r,o,a,i,c,d,h,_,f,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.channelMessageReact(t,n,r,o,a,i,c,d,h,_,f,b,g).then(A=>Promise.resolve(A))})}createPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPoll(t)})}votePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.votePoll(t)})}closePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closePoll(t)})}getPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPoll(t)})}followUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.followUsers(t)})}joinClanChat(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinClanChat(t)})}follower(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.follower()})}joinChat(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinChat(t,n,r,o)})}leaveChat(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveChat(t,n,r,o)})}removeChatMessage(e,t,n,r,o,a,i,c,d,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChatMessage(t,n,r,o,a,i,c,d,h)})}unfollowUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unfollowUsers(t)})}updateChatMessage(e,t,n,r,o,a,i,c,d,h,_,f,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,r,o,a,i,c,d,h,_,f,b)})}updateStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateStatus(t)})}writeQuickMenuEvent(e,t,n,r,o,a,i,c,d,h,_,f,b,g,A,C,w){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeQuickMenuEvent(t,n,r,o,a,i,c,d,h,_,f,b,g,A,C,w)})}writeEphemeralMessage(e,t,n,r,o,a,i,c,d,h,_,f,b,g,A,C){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeEphemeralMessage(t,n,r,o,a,i,c,d,h,_,f,b,g,A,C)})}writeChatMessage(e,t,n,r,o,a,i,c,d,h,_,f,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChatMessage(t,n,r,o,a,i,c,d,h,_,f,b,g)})}writeMessageReaction(e,t,n,r,o,a,i,c,d,h,_,f,b,g,A){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageReaction(t,n,r,o,a,i,c,d,h,_,f,b,g,A)})}writeMessageTyping(e,t,n,r,o,a,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageTyping(t,n,r,o,a,i)})}writeLastSeenMessage(e,t,n,r,o,a,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastSeenMessage(t,n,r,o,a,i)})}writeLastPinMessage(e,t,n,r,o,a,i,c,d,h,_,f,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastPinMessage(t,n,r,o,a,i,c,d,h,_,f,b,g)})}writeCustomStatus(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeCustomStatus(t,n,r,o)})}writeVoiceReaction(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceReaction(t,n)})}writeVoiceInteractiveEvent(e,t,n,r,o,a,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceInteractiveEvent(t,n,r,o,a,i)})}forwardWebrtcSignaling(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,r,o,a)})}makeCallPush(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.makeCallPush(t,n,r,o)})}writeChannelAppEvent(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChannelAppEvent(t,n,r)})}writeStreamingWatch(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeStreamingWatch(t,n)})}listLogedDevice(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listLogedDevice()})}refreshSession(e){return l(this,null,function*(){return this.transport.sessionRefresh(this.serverkey,"",e).then(t=>({token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}))})}};q.DefaultHeartbeatIntervalMs=1e4,q.DefaultHeartbeatTimeoutMs=1e4,q.DefaultConnectTimeoutMs=3e4,q.DefaultServerDisconnectStreakLogoutThreshold=3;var ee=q;
|
|
1
|
+
"use strict";var me=Object.create;var z=Object.defineProperty,ge=Object.defineProperties,fe=Object.getOwnPropertyDescriptor,_e=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertyNames,ne=Object.getOwnPropertySymbols,be=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable;var se=(y,e,t)=>e in y?z(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t,v=(y,e)=>{for(var t in e||(e={}))ie.call(e,t)&&se(y,t,e[t]);if(ne)for(var t of ne(e))Ce.call(e,t)&&se(y,t,e[t]);return y},M=(y,e)=>ge(y,_e(e));var Ae=(y,e)=>{for(var t in e)z(y,t,{get:e[t],enumerable:!0})},re=(y,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ye(e))!ie.call(y,r)&&r!==t&&z(y,r,{get:()=>e[r],enumerable:!(n=fe(e,r))||n.enumerable});return y};var oe=(y,e,t)=>(t=y!=null?me(be(y)):{},re(e||!y||!y.__esModule?z(t,"default",{value:y,enumerable:!0}):t,y)),Pe=y=>re(z({},"__esModule",{value:!0}),y);var l=(y,e,t)=>new Promise((n,r)=>{var o=c=>{try{s(t.next(c))}catch(d){r(d)}},a=c=>{try{s(t.throw(c))}catch(d){r(d)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,a);s((t=t.apply(y,e)).next())});var Fe={};Ae(Fe,{ApiAppRole:()=>ce,ChannelStreamMode:()=>de,ChannelType:()=>le,Client:()=>ee,ConnectionState:()=>p,CreateChannelMessageFromEvent:()=>$,E_CONNECT_ERROR:()=>X,EveryoneChannelExcludeType:()=>ae.EveryoneChannelExcludeType,NotificationType:()=>ue,WebrtcSignalingType:()=>he,b64DecodeUnicode:()=>Se,b64EncodeUnicode:()=>Re,buildFetchOptions:()=>m,decodeAttachments:()=>x,decodeChannelTimelineAttachments:()=>T,decodeGenerateMeetTokenResponse:()=>Y,decodeMentions:()=>B,decodeNotificationFcm:()=>G,decodeReactions:()=>N,decodeRefs:()=>W,encodeAttachments:()=>Me,encodeMentions:()=>we,encodeNotificationFcm:()=>Ee,encodeReactions:()=>qe,encodeRefs:()=>ke,normalizeClanHashtags:()=>I,safeJSONParse:()=>P});module.exports=Pe(Fe);var no=require("whatwg-fetch");var ae=require("mezon-js-protobuf");var H=require("js-base64"),S=oe(require("mezon-js-protobuf"));function Y(y){let e=y[0];if(y.length===0||e===10||e===18)try{return S.GenerateMeetTokenResponse.decode(y)}catch(n){}return{token:new TextDecoder("utf-8").decode(y)}}function m(y,e,t){let n=v({method:y},e);return n.headers=v({},e.headers),Object.keys(n.headers).includes("Accept")||(n.headers.Accept="application/proto"),Object.keys(n.headers).includes("Content-Type")||(n.headers["Content-Type"]="application/proto"),Object.keys(n.headers).forEach(r=>{n.headers[r]||delete n.headers[r]}),t&&(n.body=t),n}function Re(y){return(0,H.encode)(encodeURIComponent(y).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function Se(y){return decodeURIComponent((0,H.decode)(y).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ve=512;function I(y){let e=y.trim();if(!e)return"";let n=e.split(",").map(r=>r.trim()).filter(r=>r.length>0).join(",");if([...n].length>ve)throw new Error("clan hashtags too long");return n}function P(y){if(y==null)return{t:y};let e;if(y instanceof Uint8Array)e=new TextDecoder().decode(y);else if(typeof y=="string")e=y;else return typeof y=="object"?y:{t:y};if(!e||e===""||e==="[]")return{t:e};try{return JSON.parse(e)}catch(t){try{let n=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(n)}catch(n){return console.error("JSON Parse failed completely:",{original:e,error:n}),{t:e}}}}var O=y=>!y||y===null||y===void 0||y===""||y==="[]";function B(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.MessageMentionList.decode(r)}catch(n){return P(y)}}function x(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.MessageAttachmentList.decode(r)}catch(n){return P(y)}}function T(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.ListChannelTimelineAttachment.decode(r)}catch(n){return P(y)}}function W(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.MessageRefList.decode(r)}catch(n){return P(y)}}function N(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.MessageReactionList.decode(r)}catch(n){return P(y)}}function G(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.DirectFcmProto.decode(r)}catch(n){return P(y)}}function we(y){return S.MessageMentionList.encode(S.MessageMentionList.fromPartial(y)).finish()}function Me(y){return S.MessageAttachmentList.encode(S.MessageAttachmentList.fromPartial(y)).finish()}function ke(y){return S.MessageRefList.encode(S.MessageRefList.fromPartial(y)).finish()}function qe(y){return S.MessageReactionList.encode(S.MessageReactionList.fromPartial(y)).finish()}function Ee(y){return S.DirectFcmProto.encode(S.DirectFcmProto.fromPartial(y)).finish()}var ce=(o=>(o[o.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",o[o.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",o[o.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",o[o.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",o[o.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",o))(ce||{});var le=(d=>(d[d.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",d[d.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",d[d.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",d[d.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",d[d.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",d[d.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",d[d.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",d[d.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",d[d.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",d))(le||{}),de=(o=>(o[o.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",o[o.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",o[o.STREAM_MODE_DM=4]="STREAM_MODE_DM",o[o.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",o[o.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",o))(de||{}),ue=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(ue||{}),he=(d=>(d[d.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",d[d.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",d[d.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",d[d.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",d[d.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",d[d.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",d[d.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",d[d.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",d[d.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",d))(he||{});function $(y){let e,t,n,r,o,a;try{e=P(y.channel_message.content)}catch(c){console.log("content is invalid",c)}try{t=N(y.channel_message.reactions)}catch(c){console.log("reactions is invalid",c)}try{n=B(y.channel_message.mentions)}catch(c){console.log("mentions is invalid",c)}try{r=x(y.channel_message.attachments)}catch(c){console.log("attachments is invalid",c)}try{o=W(y.channel_message.references)}catch(c){console.log("references is invalid",c)}try{a=y.channel_message.referenced_message}catch(c){console.log("referenced messages is invalid",c)}return{id:y.id||y.channel_message.message_id,avatar:y.channel_message.avatar,channel_id:y.channel_message.channel_id,mode:y.channel_message.mode,channel_label:y.channel_message.channel_label,clan_id:y.channel_message.clan_id,code:y.channel_message.code,message_id:y.channel_message.message_id,sender_id:y.channel_message.sender_id,update_time:y.channel_message.update_time,clan_logo:y.channel_message.clan_logo,category_name:y.channel_message.category_name,username:y.channel_message.username,clan_nick:y.channel_message.clan_nick,clan_avatar:y.channel_message.clan_avatar,display_name:y.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:n==null?void 0:n.mentions,attachments:r==null?void 0:r.attachments,referenced_message:a,references:o==null?void 0:o.refs,hide_editted:y.channel_message.hide_editted,is_public:y.channel_message.is_public,create_time_seconds:y.channel_message.create_time_seconds,update_time_seconds:y.channel_message.update_time_seconds,topic_id:y.channel_message.topic_id}}var X=(t=>(t.TIME_OUT="TIME_OUT",t.SOCKET_CLOSED_BEFORE_ESTABLISH="SOCKET_CLOSED_BEFORE_ESTABLISH",t))(X||{});var k=require("js-base64"),i=oe(require("mezon-js-protobuf")),pe=require("mezon-js-protobuf");var Te="CHECK_HEALTHY",j=class{constructor(){this.maxAllowedFailures=3;this.minAllowedFastRate=.95;this.maxAllowedLatencyMs=1e3;this.metricsWindowMs=6e4;this.minRequests=20;this.windowStartTime=0;this.totalRequests=0;this.failed=0;this.slowCount=0;this.requests=new Map}start(e){this.requests.set(e,performance.now())}end(e,t=!1){let n=this.requests.get(e);if(n===void 0)return;let r=performance.now();this.windowStartTime!==0&&n-this.windowStartTime>=this.metricsWindowMs&&(this.reset(),this.windowStartTime=n);let o=r-n;if(this.totalRequests++,t?this.failed++:o>this.maxAllowedLatencyMs&&this.slowCount++,this.totalRequests>=this.minRequests){let a=(this.totalRequests-this.slowCount)/this.totalRequests;a<this.minAllowedFastRate&&(typeof window!="undefined"&&window.dispatchEvent(new CustomEvent(Te,{detail:{requestId:e,fastRate:a,totalRequests:this.totalRequests,slowCount:this.slowCount}})),this.reset(),this.windowStartTime=performance.now())}this.requests.delete(e)}get shouldSwitch(){if(this.totalRequests<this.minRequests)return!1;let e=(this.totalRequests-this.slowCount)/this.totalRequests;return this.failed>=this.maxAllowedFailures||e<this.minAllowedFastRate}get stats(){let e=this.totalRequests>0?this.slowCount/this.totalRequests:0,t=this.totalRequests>0?(this.totalRequests-this.slowCount)/this.totalRequests:0;return{totalRequests:this.totalRequests,failedCount:this.failed,slowCount:this.slowCount,slowRate:e,fastRate:t,isUnhealthy:this.shouldSwitch}}reset(){this.windowStartTime=0,this.totalRequests=0,this.failed=0,this.slowCount=0,this.requests.clear()}};var Z=(u=>(u[u.ListChannelDescs=0]="ListChannelDescs",u[u.GetAccount=1]="GetAccount",u[u.ListClanDescs=2]="ListClanDescs",u[u.ListClanUsers=3]="ListClanUsers",u[u.ListRoles=4]="ListRoles",u[u.ListEvents=5]="ListEvents",u[u.GetRoleOfUserInTheClan=6]="GetRoleOfUserInTheClan",u[u.GetListPermission=7]="GetListPermission",u[u.ListUserPermissionInChannel=8]="ListUserPermissionInChannel",u[u.GetNotificationClan=9]="GetNotificationClan",u[u.ListMutedChannel=10]="ListMutedChannel",u[u.ListStreamingChannelUsers=11]="ListStreamingChannelUsers",u[u.ListQuickMenuAccess=12]="ListQuickMenuAccess",u[u.GetNotificationChannel=13]="GetNotificationChannel",u[u.ListFriends=14]="ListFriends",u[u.EmojiRecentList=15]="EmojiRecentList",u[u.GetListEmojisByUserId=16]="GetListEmojisByUserId",u[u.ListClanBadgeCount=17]="ListClanBadgeCount",u[u.ListChannelBadgeCount=18]="ListChannelBadgeCount",u[u.ListLogedDevice=19]="ListLogedDevice",u[u.ListClanUsersStatus=20]="ListClanUsersStatus",u[u.ListChannelApps=21]="ListChannelApps",u[u.GetListFavoriteChannel=22]="GetListFavoriteChannel",u[u.ListCategoryDescs=23]="ListCategoryDescs",u[u.ListOnboarding=24]="ListOnboarding",u[u.GetListStickersByUserId=25]="GetListStickersByUserId",u[u.GetSystemMessageByClanId=26]="GetSystemMessageByClanId",u[u.GetPinMessagesList=27]="GetPinMessagesList",u[u.GetChannelCanvasList=28]="GetChannelCanvasList",u[u.ListChannelTimeline=29]="ListChannelTimeline",u[u.ListChannelMessages=30]="ListChannelMessages",u[u.ListActivity=31]="ListActivity",u[u.ListChannelByUserId=32]="ListChannelByUserId",u[u.ListUserClansByUserId=33]="ListUserClansByUserId",u[u.GetUserProfileOnClan=34]="GetUserProfileOnClan",u[u.RegistFCMDeviceToken=35]="RegistFCMDeviceToken",u[u.IsBanned=36]="IsBanned",u[u.ListThreadDescs=37]="ListThreadDescs",u[u.ListArchivedChannelDescs=38]="ListArchivedChannelDescs",u[u.ListChannelDetail=39]="ListChannelDetail",u[u.GetChannelCategoryNotiSettingsList=40]="GetChannelCategoryNotiSettingsList",u[u.ListRoleUsers=41]="ListRoleUsers",u[u.ListChannelUsers=42]="ListChannelUsers",u[u.ListChannelAttachment=43]="ListChannelAttachment",u[u.ListChannelVoiceUsers=44]="ListChannelVoiceUsers",u[u.ListUserOnline=45]="ListUserOnline",u[u.ListNotifications=46]="ListNotifications",u[u.ListChannelUsersUC=47]="ListChannelUsersUC",u[u.ListWebhookByChannelId=48]="ListWebhookByChannelId",u[u.GetPermissionByRoleIdChannelId=49]="GetPermissionByRoleIdChannelId",u[u.ListChannelSetting=50]="ListChannelSetting",u[u.ListApps=51]="ListApps",u[u.GetApp=52]="GetApp",u[u.ListForSaleItems=53]="ListForSaleItems",u[u.ListClanWebhook=54]="ListClanWebhook",u[u.GetUserStatus=55]="GetUserStatus",u[u.ListSdTopic=56]="ListSdTopic",u[u.AddFriends=57]="AddFriends",u[u.AddChannelUsers=58]="AddChannelUsers",u[u.RegistrationEmail=59]="RegistrationEmail",u[u.BlockFriends=60]="BlockFriends",u[u.UnblockFriends=61]="UnblockFriends",u[u.UploadAttachmentFile=62]="UploadAttachmentFile",u[u.UploadOauthFile=63]="UploadOauthFile",u[u.AddRolesChannelDesc=64]="AddRolesChannelDesc",u[u.CreateCategoryDesc=65]="CreateCategoryDesc",u[u.CreateChannelDesc=66]="CreateChannelDesc",u[u.CreateRole=67]="CreateRole",u[u.CreateEvent=68]="CreateEvent",u[u.DeleteRole=69]="DeleteRole",u[u.DeleteEvent=70]="DeleteEvent",u[u.DeleteRoleChannelDesc=71]="DeleteRoleChannelDesc",u[u.DeleteChannelDesc=72]="DeleteChannelDesc",u[u.CloseDMByChannelId=73]="CloseDMByChannelId",u[u.OpenDMByChannelId=74]="OpenDMByChannelId",u[u.DeleteAccount=75]="DeleteAccount",u[u.DeleteFriends=76]="DeleteFriends",u[u.DeleteCategoryDesc=77]="DeleteCategoryDesc",u[u.DeleteNotifications=78]="DeleteNotifications",u[u.DeleteClanDesc=79]="DeleteClanDesc",u[u.UpdateUser=80]="UpdateUser",u[u.UpdateUserProfileByClan=81]="UpdateUserProfileByClan",u[u.UpdateClanOrder=82]="UpdateClanOrder",u[u.RemoveChannelUsers=83]="RemoveChannelUsers",u[u.LeaveThread=84]="LeaveThread",u[u.ArchiveChannel=85]="ArchiveChannel",u[u.LinkSMS=86]="LinkSMS",u[u.ConfirmLinkMezonOTP=87]="ConfirmLinkMezonOTP",u[u.LinkEmail=88]="LinkEmail",u[u.CreateClanDesc=89]="CreateClanDesc",u[u.RemoveClanUsers=90]="RemoveClanUsers",u[u.BanClanUsers=91]="BanClanUsers",u[u.CreateLinkInviteUser=92]="CreateLinkInviteUser",u[u.InviteUser=93]="InviteUser",u[u.SetRoleChannelPermission=94]="SetRoleChannelPermission",u[u.SetNotificationChannelSetting=95]="SetNotificationChannelSetting",u[u.SetMuteChannel=96]="SetMuteChannel",u[u.SetMuteCategory=97]="SetMuteCategory",u[u.SetNotificationClanSetting=98]="SetNotificationClanSetting",u[u.SetNotificationCategorySetting=99]="SetNotificationCategorySetting",u[u.DeleteNotificationCategorySetting=100]="DeleteNotificationCategorySetting",u[u.DeleteNotificationChannel=101]="DeleteNotificationChannel",u[u.CreatePinMessage=102]="CreatePinMessage",u[u.CreateMessage2Inbox=103]="CreateMessage2Inbox",u[u.UnlinkMezon=104]="UnlinkMezon",u[u.UnlinkEmail=105]="UnlinkEmail",u[u.UpdateAccount=106]="UpdateAccount",u[u.UpdateUsername=107]="UpdateUsername",u[u.UpdateCategory=108]="UpdateCategory",u[u.UpdateCategoryOrder=109]="UpdateCategoryOrder",u[u.UpdateRoleOrder=110]="UpdateRoleOrder",u[u.UpdateClanDesc=111]="UpdateClanDesc",u[u.UpdateChannelDesc=112]="UpdateChannelDesc",u[u.UpdateChannelPrivate=113]="UpdateChannelPrivate",u[u.UpdateRole=114]="UpdateRole",u[u.UpdateEvent=115]="UpdateEvent",u[u.SearchMessage=116]="SearchMessage",u[u.CreateClanEmoji=117]="CreateClanEmoji",u[u.DeleteByIdClanEmoji=118]="DeleteByIdClanEmoji",u[u.UpdateClanEmojiById=119]="UpdateClanEmojiById",u[u.GenerateWebhook=120]="GenerateWebhook",u[u.HandleWebhook=121]="HandleWebhook",u[u.UpdateWebhookById=122]="UpdateWebhookById",u[u.DeleteWebhookById=123]="DeleteWebhookById",u[u.AddClanSticker=124]="AddClanSticker",u[u.UpdateClanStickerById=125]="UpdateClanStickerById",u[u.DeleteClanStickerById=126]="DeleteClanStickerById",u[u.ChangeChannelCategory=127]="ChangeChannelCategory",u[u.CheckDuplicateName=128]="CheckDuplicateName",u[u.AddApp=129]="AddApp",u[u.DeleteApp=130]="DeleteApp",u[u.UpdateApp=131]="UpdateApp",u[u.AddAppToClan=132]="AddAppToClan",u[u.CreateSystemMessage=133]="CreateSystemMessage",u[u.UpdateSystemMessage=134]="UpdateSystemMessage",u[u.DeleteSystemMessage=135]="DeleteSystemMessage",u[u.StreamingServerCallback=136]="StreamingServerCallback",u[u.EditChannelCanvases=137]="EditChannelCanvases",u[u.GetChannelCanvasDetail=138]="GetChannelCanvasDetail",u[u.DeleteChannelCanvas=139]="DeleteChannelCanvas",u[u.AddChannelFavorite=140]="AddChannelFavorite",u[u.RemoveChannelFavorite=141]="RemoveChannelFavorite",u[u.CreateActiviy=142]="CreateActiviy",u[u.GetPubKeys=143]="GetPubKeys",u[u.PushPubKey=144]="PushPubKey",u[u.GetChanEncryptionMethod=145]="GetChanEncryptionMethod",u[u.SetChanEncryptionMethod=146]="SetChanEncryptionMethod",u[u.GetKeyServer=147]="GetKeyServer",u[u.ListAuditLog=148]="ListAuditLog",u[u.GetOnboardingDetail=149]="GetOnboardingDetail",u[u.CreateOnboarding=150]="CreateOnboarding",u[u.UpdateOnboarding=151]="UpdateOnboarding",u[u.DeleteOnboarding=152]="DeleteOnboarding",u[u.ListOnboardingStep=153]="ListOnboardingStep",u[u.UpdateOnboardingStep=154]="UpdateOnboardingStep",u[u.GenerateClanWebhook=155]="GenerateClanWebhook",u[u.UpdateClanWebhookById=156]="UpdateClanWebhookById",u[u.DeleteClanWebhookById=157]="DeleteClanWebhookById",u[u.HandleClanWebhook=158]="HandleClanWebhook",u[u.UpdateUserStatus=159]="UpdateUserStatus",u[u.UpdateUserCustomStatus=160]="UpdateUserCustomStatus",u[u.GetTopicDetail=161]="GetTopicDetail",u[u.CreateSdTopic=162]="CreateSdTopic",u[u.DeleteSdTopic=163]="DeleteSdTopic",u[u.CreateExternalMezonMeet=164]="CreateExternalMezonMeet",u[u.GenerateMeetToken=165]="GenerateMeetToken",u[u.RemoveParticipantMezonMeet=166]="RemoveParticipantMezonMeet",u[u.MuteParticipantMezonMeet=167]="MuteParticipantMezonMeet",u[u.CreateRoomChannelApps=168]="CreateRoomChannelApps",u[u.GetMezonOauthClient=169]="GetMezonOauthClient",u[u.DeleteMezonOauthClient=170]="DeleteMezonOauthClient",u[u.UpdateMezonOauthClient=171]="UpdateMezonOauthClient",u[u.SearchThread=172]="SearchThread",u[u.GenerateHashChannelApps=173]="GenerateHashChannelApps",u[u.DeleteUserEvent=174]="DeleteUserEvent",u[u.AddUserEvent=175]="AddUserEvent",u[u.DeleteQuickMenuAccess=176]="DeleteQuickMenuAccess",u[u.AddQuickMenuAccess=177]="AddQuickMenuAccess",u[u.UpdateQuickMenuAccess=178]="UpdateQuickMenuAccess",u[u.TransferOwnership=179]="TransferOwnership",u[u.SendChannelMessage=180]="SendChannelMessage",u[u.UpdateChannelMessage=181]="UpdateChannelMessage",u[u.DeleteChannelMessage=182]="DeleteChannelMessage",u[u.ReportMessageAbuse=183]="ReportMessageAbuse",u[u.MessageButtonClick=184]="MessageButtonClick",u[u.DropdownBoxSelected=185]="DropdownBoxSelected",u[u.ActiveArchivedThread=186]="ActiveArchivedThread",u[u.UpdateChannelTimeline=187]="UpdateChannelTimeline",u[u.AddAgentToChannel=188]="AddAgentToChannel",u[u.DisconnectAgent=189]="DisconnectAgent",u[u.CreateChannelTimeline=190]="CreateChannelTimeline",u[u.DetailChannelTimeline=191]="DetailChannelTimeline",u[u.CreatePoll=192]="CreatePoll",u[u.VotePoll=193]="VotePoll",u[u.ClosePoll=194]="ClosePoll",u[u.GetPoll=195]="GetPoll",u[u.ReactChannelMessage=196]="ReactChannelMessage",u[u.MultipartUploadAttachmentFileStart=197]="MultipartUploadAttachmentFileStart",u[u.MultipartUploadAttachmentFileFinish=198]="MultipartUploadAttachmentFileFinish",u[u.SessionRefresh=199]="SessionRefresh",u[u.SessionLogout=200]="SessionLogout",u[u.Healthcheck=201]="Healthcheck",u[u.UnbanClanUsers=202]="UnbanClanUsers",u[u.ListBannedUsers=203]="ListBannedUsers",u[u.GetNotificationCategory=204]="GetNotificationCategory",u[u.ListRolePermissions=205]="ListRolePermissions",u[u.IsFollower=206]="IsFollower",u[u.DeletePinMessage=207]="DeletePinMessage",u[u.MarkAsRead=208]="MarkAsRead",u[u.UploadBatchAttachmentFile=209]="UploadBatchAttachmentFile",u[u.SearchCtrlK=210]="SearchCtrlK",u[u.SearchMentionUsers=211]="SearchMentionUsers",u[u.GenerateCDNSignature=212]="GenerateCDNSignature",u[u.GetStreamPlayback=213]="GetStreamPlayback",u[u.LinkCDNFile=214]="LinkCDNFile",u[u.SfuBreakoutRoom=215]="SfuBreakoutRoom",u[u.SfuBreakoutMerge=216]="SfuBreakoutMerge",u[u.SetOverrideEveryoneChannel=217]="SetOverrideEveryoneChannel",u[u.GetOverrideEveryoneChannel=218]="GetOverrideEveryoneChannel",u[u.GetDMSetting=219]="GetDMSetting",u[u.UpdateDMSetting=220]="UpdateDMSetting",u))(Z||{}),V=class V{constructor(e,t,n){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=n,this.adapter=new pe.MezonNetworkAdapter,this.metricLatency=new j}close(){this.adapter.close()}generatecid(){let e=this.nextCid;return this.nextCid>=65535?this.nextCid=1:++this.nextCid,e}setTransportAdapter(e){this.adapter=e}setFallbackSession(e){}getApiFromPath(e){if(e in Z)return Z[e]}connect(e,t,n,r,o,a){let[s,c]=t.split(":");this.adapter.connect(s,c,n,e,a),this.adapter.onOpen=o.onOpen,this.adapter.onError=o.onError,this.adapter.onClose=o.onClose,this.adapter.onMessage=(d,h,f)=>l(this,null,function*(){if(r&&typeof console!="undefined"&&console.log("incomming message with cid %o and message %o",d,f),d!=0){let _=this.cIds[d];if(!_){r&&typeof console!="undefined"&&console.error("No promise executor for message: %o",f);return}delete this.cIds[d],f.error?(_.reject({code:h,error:f.error}),this.metricLatency.end(d,!0)):(_.resolve({code:h,message:f}),this.metricLatency.end(d))}else yield o.onMessage(0,0,f)})}send(e,t=V.DefaultSendTimeoutMs){let{urlPath:n,fetchOptions:r}=e,o=r;if(n!=null&&n.includes("/mezon.api.Mezon/")){let a=n.substring(17);o={api_request_event:{api_index:this.getApiFromPath(a),api_name:a,body:r.body}}}return new Promise((a,s)=>l(this,null,function*(){var c,d;if(!this.adapter.isOpen())s("Socket connection has not been established yet.");else{o.channel_message_send?o.channel_message_send.content=JSON.stringify(o.channel_message_send.content):o.channel_message_update?o.channel_message_update.content=JSON.stringify(o.channel_message_update.content):o.ephemeral_message_send?o.ephemeral_message_send.message.content=JSON.stringify((c=o.ephemeral_message_send.message)==null?void 0:c.content):o.quick_menu_event&&(o.quick_menu_event.message.content=JSON.stringify((d=o.quick_menu_event.message)==null?void 0:d.content));let h=this.generatecid();this.metricLatency.start(h),this.cIds[h]={resolve:a,reject:s},t!==1/0&&t>0&&setTimeout(()=>{this.metricLatency.end(h,!0),s("The socket timed out while waiting for a response.")},t),o.cid=h,this.adapter.send(o)}}))}deleteAccount(e={}){let t="/mezon.api.Mezon/DeleteAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return o})),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}getAccount(e={}){let t="/mezon.api.Mezon/GetAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return i.Account.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateAccount(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateAccount",o=i.UpdateAccountRequest.encode(i.UpdateAccountRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/checklogin",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return i.Session.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/v2/account/authenticate/confirmlogin",r=new Map,o="";o=JSON.stringify(e||{});let a=this.buildFullUrl(this.basePath,n,r),s=m("POST",t,o);return s.headers.Accept="application/x-protobuf",s.headers["Content-Type"]="application/json",Promise.race([fetch(a,s).then(c=>c),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/createqrlogin",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return i.LoginIDResponse.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/smsotp",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return i.LinkAccountConfirmRequest.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/emailotp",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return i.LinkAccountConfirmRequest.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/email",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return i.Session.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,n,r,o,a,s={}){if(n==null)throw new Error("'account' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/mezon",d=new Map;d.set("create",r),d.set("username",o),d.set("is_remember",a);let h="";h=JSON.stringify(n||{});let f=this.buildFullUrl(this.basePath,c,d),_=m("POST",s,h);return e&&(_.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),_.headers.Accept="application/x-protobuf",Promise.race([fetch(f,_).then(b=>l(this,null,function*(){if(!b.ok)throw b;let g=yield b.arrayBuffer();return i.Session.decode(new Uint8Array(g))})),new Promise((b,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}linkEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkEmail",o=i.AccountEmail.encode(i.AccountEmail.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.LinkAccountConfirmRequest.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}linkSMS(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkSMS",o=i.AccountMezon.encode(i.AccountMezon.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.LinkAccountConfirmRequest.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}confirmLinkMezonOTP(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ConfirmLinkMezonOTP",o=i.LinkAccountConfirmRequest.encode(i.LinkAccountConfirmRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,a.headers.Accept="application/x-protobuf",Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Session.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/confirmotp",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return i.Session.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}registrationEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RegistrationEmail",o=i.RegistrationEmailRequest.encode(i.RegistrationEmailRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Session.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/SessionRefresh",s=i.SessionRefreshRequest.encode(i.SessionRefreshRequest.fromPartial(n)).finish(),c=m("POST",r,"");return c.body=s,e&&(c.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.Session.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unlinkEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UnlinkEmail",o=i.AccountEmail.encode(i.AccountEmail.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}unlinkMezon(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UnlinkMezon",o=i.AccountMezon.encode(i.AccountMezon.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listActivity(e={}){let t="/mezon.api.Mezon/ListActivity",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.ListUserActivity.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}createActiviy(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateActiviy",o=i.CreateActivityRequest.encode(i.CreateActivityRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UserActivity.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}addApp(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddApp",o=i.AddAppRequest.encode(i.AddAppRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.App.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,n,r={}){let o="/mezon.api.Mezon/ListApps",s=i.ListAppsRequest.encode(i.ListAppsRequest.fromPartial({filter:e,tombstones:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.AppList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,n={}){if(e==null)throw new Error("'appId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/AddAppToClan",a=i.AppClan.encode(i.AppClan.fromPartial({app_id:e,clan_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteApp(e,t={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteApp",o=i.App.encode(i.App.fromPartial({id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getApp(e,t={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetApp",o=i.App.encode(i.App.fromPartial({id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.App.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateApp(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateApp",a=i.UpdateAppRequest.encode(i.UpdateAppRequest.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.App.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,n,r,o={}){let a="/mezon.api.Mezon/ListAuditLog",c=i.ListAuditLogRequest.encode(i.ListAuditLogRequest.fromPartial({clan_id:n,user_id:t,action_log:e,date_log:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.ListAuditLog.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateCategoryOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateCategoryOrder",o=i.UpdateCategoryOrderRequest.encode(i.UpdateCategoryOrderRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,n,r,o,a={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListCategoryDescs",d=i.CategoryDesc.encode(i.CategoryDesc.fromPartial({clan_id:e,creator_id:t,category_name:n,category_id:r,category_order:o})).finish(),h=m("POST",a,"");return h.body=d,Promise.race([this.send({urlPath:s,fetchOptions:h}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.CategoryDescList.decode(f.message)})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t={}){let n="/mezon.api.Mezon/ListChannelApps",o=i.ListChannelAppsRequest.encode(i.ListChannelAppsRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListChannelAppsResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,n,r,o={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetChannelCanvasList",c=i.ChannelCanvasListRequest.encode(i.ChannelCanvasListRequest.fromPartial({channel_id:e,clan_id:t,limit:n,page:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.ChannelCanvasListResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addChannelFavorite(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddChannelFavorite",o=i.AddFavoriteChannelRequest.encode(i.AddFavoriteChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.AddFavoriteChannelResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveChannelFavorite",a=i.RemoveFavoriteChannelRequest.encode(i.RemoveFavoriteChannelRequest.fromPartial({channel_id:e,clan_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getListFavoriteChannel(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetListFavoriteChannel",o=i.ListFavoriteChannelRequest.encode(i.ListFavoriteChannelRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListFavoriteChannelResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,n,r,o,a,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListChannelMessages",h=i.ListChannelMessagesRequest.encode(i.ListChannelMessagesRequest.fromPartial({clan_id:e,channel_id:t,message_id:n,direction:r,limit:o,topic_id:a})).finish(),f=m("POST",s,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return i.ChannelMessageList.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/AddChannelUsers",a=i.AddChannelUsersRequest.encode(i.AddChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,r,o,a,s,c,d={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let h="/mezon.api.Mezon/ListChannelAttachment",_=i.ListChannelAttachmentRequest.encode(i.ListChannelAttachmentRequest.fromPartial({channel_id:e,clan_id:t,file_type:n,limit:r,state:o,before:a,after:s,around:c})).finish(),b=m("POST",d,"");return b.body=_,Promise.race([this.send({urlPath:h,fetchOptions:b}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return i.ChannelAttachmentList.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetChanEncryptionMethod",a=i.ChanEncryptionMethod.encode(i.ChanEncryptionMethod.fromPartial({channel_id:e,method:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.ChanEncryptionMethod.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/SetChanEncryptionMethod",a=i.ChanEncryptionMethod.encode(i.ChanEncryptionMethod.fromPartial(M(v({},t),{channel_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/LeaveThread",a=i.LeaveThreadRequest.encode(i.LeaveThreadRequest.fromPartial({channel_id:t,clan_id:e})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}archiveChannel(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ArchiveChannel",a=i.ArchiveChannelRequest.encode(i.ArchiveChannelRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listArchivedChannelDescs(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListArchivedChannelDescs",o=i.ListArchivedChannelDescsRequest.encode(i.ListArchivedChannelDescsRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListArchivedChannelDescsResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChannelUsers(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveChannelUsers",a=i.RemoveChannelUsersRequest.encode(i.RemoveChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,n,r,o,a,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListChannelUsers",h=i.ListChannelUsersRequest.encode(i.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:o,cursor:a})).finish(),f=m("POST",s,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return i.ChannelUserList.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/ListChannelDescs",h=i.ListChannelDescsRequest.encode(i.ListChannelDescsRequest.fromPartial({limit:e,state:t,page:n,clan_id:r,channel_type:o,is_mobile:a})).finish(),f=m("POST",s,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return i.ChannelDescList.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateChannelDesc",o=i.CreateChannelDescRequest.encode(i.CreateChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelDescription.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,n={}){let r="/mezon.api.Mezon/ListChannelUsersUC",a=i.AllUsersAddChannelRequest.encode(i.AllUsersAddChannelRequest.fromPartial({channel_id:e,limit:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.AllUsersAddChannelResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteChannelDesc",a=i.DeleteChannelDescRequest.encode(i.DeleteChannelDescRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateChannelDesc",a=i.UpdateChannelDescRequest.encode(i.UpdateChannelDescRequest.fromPartial(M(v({},t),{channel_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,r,o,a,s,c,d,h,f={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let _="/mezon.api.Mezon/ListChannelSetting",g=i.ChannelSettingListRequest.encode(i.ChannelSettingListRequest.fromPartial({clan_id:e,parent_id:t,category_id:n,active:o,private_channel:r,status:a,type:s,limit:c,page:d,channel_label:h})).finish(),A=m("POST",f,"");return A.body=g,Promise.race([this.send({urlPath:_,fetchOptions:A}).then(C=>l(this,null,function*(){if(C.code!=0)throw C;return i.ChannelSettingListResponse.decode(C.message)})),new Promise((C,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,n={}){let r="/mezon.api.Mezon/ListChannelVoiceUsers",a=i.ListChannelUsersRequest.encode(i.ListChannelUsersRequest.fromPartial({clan_id:e,limit:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.VoiceChannelUserList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,n,r={}){let o="/mezon.api.Mezon/ListClanDescs",s=i.ListClanDescRequest.encode(i.ListClanDescRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ClanDescList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listClanBadgeCount(){let e="/mezon.api.Mezon/ListClanBadgeCount",t={};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){if(n.code!=0)throw n;return i.ListClanBadgeCountResponse.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelBadgeCount(e,t,n,r={}){let o="/mezon.api.Mezon/ListChannelBadgeCount",s=i.ListChannelBadgeCountRequest.encode(i.ListChannelBadgeCountRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ListChannelBadgeCountResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listUserOnline(e,t,n,r={}){let o="/mezon.api.Mezon/ListUserOnline",s=i.ListUserOnlineRequest.encode(i.ListUserOnlineRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ListUserOnlineResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createClanDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateClanDesc",o=i.CreateClanDescRequest.encode(i.CreateClanDescRequest.fromPartial({clan_name:e.clan_name,logo:e.logo,banner:e.banner})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanDesc.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanDesc(e,t={}){if(e==null)throw new Error("'clanDescId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteClanDesc",o=i.DeleteClanDescRequest.encode(i.DeleteClanDescRequest.fromPartial({clan_desc_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateClanDesc(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanDesc",a=i.UpdateClanDescRequest.encode(i.UpdateClanDescRequest.fromPartial(v({clan_id:e},t))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveClanUsers",a=i.RemoveClanUsersRequest.encode(i.RemoveClanUsersRequest.fromPartial({clan_id:e,user_ids:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,n={}){let r="/mezon.api.Mezon/ListBannedUsers",a=i.BannedUserListRequest.encode(i.BannedUserListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.BannedUserList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,n,r,o={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UnbanClanUsers",c=i.BanClanUsersRequest.encode(i.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return{}})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,n,r,o={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/BanClanUsers",c=i.BanClanUsersRequest.encode(i.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return{}})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listClanUsers(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanUsers",o=i.ListClanUsersRequest.encode(i.ListClanUsersRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanUserList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listClanUsersStatus(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanUsersStatus",o=i.ListClanUsersStatusRequest.encode(i.ListClanUsersStatusRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanUserStatusList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createCategoryDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateCategoryDesc",o=i.CreateCategoryDescRequest.encode(i.CreateCategoryDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.CategoryDesc.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}checkDuplicateName(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CheckDuplicateName",o=i.CheckDuplicateNameRequest.encode(i.CheckDuplicateNameRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code==0)return i.CheckDuplicateNameResponse.decode(s.message);throw s})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,n,r={}){if(e==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteCategoryDesc",s=i.DeleteCategoryDescRequest.encode(i.DeleteCategoryDescRequest.fromPartial({category_id:e,clan_id:t,category_label:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,n,r,o={}){let a="/mezon.api.Mezon/RegistFCMDeviceToken",c=i.RegistFcmDeviceTokenRequest.encode(i.RegistFcmDeviceTokenRequest.fromPartial({token:e,device_id:t,platform:n,voip_token:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.RegistFcmDeviceTokenResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}closeDirectMess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CloseDMByChannelId",o=i.DeleteChannelDescRequest.encode(i.DeleteChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}openDirectMess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/OpenDMByChannelId",o=i.DeleteChannelDescRequest.encode(i.DeleteChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createClanEmoji(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateClanEmoji",o=i.ClanEmojiCreateRequest.encode(i.ClanEmojiCreateRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteByIdClanEmoji",s=i.ClanEmojiDeleteRequest.encode(i.ClanEmojiDeleteRequest.fromPartial({id:e,clan_id:t,emoji_label:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanEmojiById",a=i.ClanEmojiUpdateRequest.encode(i.ClanEmojiUpdateRequest.fromPartial({id:t.id,shortname:t.shortname,clan_id:t.clan_id})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e={}){let t="/mezon.api.Mezon/EmojiRecentList",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return i.EmojiRecentList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e={}){let t="/mezon.api.Mezon/GetListEmojisByUserId",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return i.EmojiListedResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}searchMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchMessage",o=i.SearchMessageRequest.encode(i.SearchMessageRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SearchMessageResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}searchCtrlK(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchCtrlK",o=i.SearchCtrlKRequest.encode(i.SearchCtrlKRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SearchCtrlKResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}searchMentionUsers(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchMentionUsers",o=i.SearchMentionUsersRequest.encode(i.SearchMentionUsersRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SearchMentionUsersResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateCDNSignature(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateCDNSignature",o=i.GenerateCDNSignatureRequest.encode(i.GenerateCDNSignatureRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.GenerateCDNSignatureResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getStreamPlayback(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetStreamPlayback",o=i.GetStreamPlaybackRequest.encode(i.GetStreamPlaybackRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.GetStreamPlaybackResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}setOverrideEveryoneChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetOverrideEveryoneChannel",o=i.SetOverrideEveryoneChannelRequest.encode(i.SetOverrideEveryoneChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getOverrideEveryoneChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetOverrideEveryoneChannel",o=i.GetOverrideEveryoneChannelRequest.encode(i.GetOverrideEveryoneChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.GetOverrideEveryoneChannelResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getDMSetting(e={}){let t="/mezon.api.Mezon/GetDMSetting",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.DMSetting.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateDMSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateDMSetting",o=i.UpdateDMSettingRequest.encode(i.UpdateDMSettingRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.DMSetting.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}event(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateEvent",o=i.Event.encode(i.Event.fromPartial({external:e.external,name:e.name,properties:e.properties})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listEvents(e,t={}){let n="/mezon.api.Mezon/ListEvents",o=i.ListEventsRequest.encode(i.ListEventsRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.EventList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createEvent(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateEvent",o=i.CreateEventRequest.encode(i.CreateEventRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.EventManagement.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateEventUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateEventUser",o=i.DeleteEventRequest.encode(i.DeleteEventRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,n,r,o,a={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/DeleteEvent",d=i.DeleteEventRequest.encode(i.DeleteEventRequest.fromPartial({event_id:e,clan_id:t,creator_id:n,event_label:r,channel_id:o})).finish(),h=m("POST",a,"");return h.body=d,Promise.race([this.send({urlPath:s,fetchOptions:h}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return{}})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,n={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateEvent",a=i.UpdateEventRequest.encode(i.UpdateEventRequest.fromPartial(t)).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,n={}){let r="/mezon.api.Mezon/DeleteFriends",a=i.DeleteFriendsRequest.encode(i.DeleteFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listFriends(e,t,n,r={}){let o="/mezon.api.Mezon/ListFriends",s=i.ListFriendsRequest.encode(i.ListFriendsRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.FriendList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,n={}){let r="/mezon.api.Mezon/AddFriends",a=i.AddFriendsRequest.encode(i.AddFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.AddFriendsResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,n={}){let r="/mezon.api.Mezon/BlockFriends",a=i.BlockFriendsRequest.encode(i.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,n={}){let r="/mezon.api.Mezon/UnblockFriends",a=i.BlockFriendsRequest.encode(i.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t={}){let n="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",o=i.NotificationClan.encode(i.NotificationClan.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationChannelCategorySettingList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getUserProfileOnClan(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetUserProfileOnClan",o=i.ClanProfileRequest.encode(i.ClanProfileRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ClanProfile.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t={}){let n="/mezon.api.Mezon/GetNotificationCategory",o=i.DefaultNotificationCategory.encode(i.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationUserChannel.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t={}){let n="/mezon.api.Mezon/GetNotificationChannel",o=i.NotificationChannel.encode(i.NotificationChannel.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationUserChannel.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t={}){let n="/mezon.api.Mezon/GetNotificationClan",o=i.NotificationClan.encode(i.NotificationClan.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotificationSetting.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t={}){let n="/mezon.api.Mezon/GetNotificationReactMessage",o=i.NotifiReactMessage.encode(i.NotifiReactMessage.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.NotifiReactMessage.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getKeyServer(e={}){let t="/mezon.api.Mezon/GetKeyServer",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.GetKeyServerResp.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}createLinkInviteUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateLinkInviteUser",o=i.LinkInviteUserRequest.encode(i.LinkInviteUserRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.LinkInviteUser.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}inviteUser(e,t={}){if(e==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/InviteUser",o=i.InviteUserRequest.encode(i.InviteUserRequest.fromPartial({invite_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.InviteUserRes.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,n,r={}){if(n==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let o="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(n))),a=new Map,s="",c=this.buildFullUrl(this.basePath,o,a),d=m("GET",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return i.InviteUserRes.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e={}){let t="/mezon.api.Mezon/ListChannelByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.ChannelDescList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}markAsRead(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MarkAsRead",o=i.MarkAsReadRequest.encode(i.MarkAsReadRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listMezonOauthClient(e={}){let t="/mezon.api.Mezon/ListMezonOauthClient",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.MezonOauthClientList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}setMuteCategory(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetMuteCategory",o=i.SetMuteRequest.encode(i.SetMuteRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}setMuteChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetMuteChannel",o=i.SetMuteRequest.encode(i.SetMuteRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,n={}){let r="/mezon.api.Mezon/DeleteNotifications",a=i.DeleteNotificationsRequest.encode(i.DeleteNotificationsRequest.fromPartial({ids:e||[],category:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,r,o,a={}){let s="/mezon.api.Mezon/ListNotifications",d=i.ListNotificationsRequest.encode(i.ListNotificationsRequest.fromPartial({limit:e,clan_id:t,notification_id:n,category:r,direction:o})).finish(),h=m("POST",a,"");return h.body=d,Promise.race([this.send({urlPath:s,fetchOptions:h}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return i.NotificationList.decode(f.message)})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationChannelSetting",o=i.SetNotificationRequest.encode(i.SetNotificationRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationClanSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationClanSetting",o=i.SetDefaultNotificationRequest.encode(i.SetDefaultNotificationRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationCategorySetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationCategorySetting",o=i.SetNotificationRequest.encode(i.SetNotificationRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationCategorySetting",o=i.DefaultNotificationCategory.encode(i.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationChannel",o=i.NotificationChannel.encode(i.NotificationChannel.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t={}){let n="/mezon.api.Mezon/DeleteNotiReactMessage",o=i.NotificationChannel.encode(i.NotificationChannel.fromPartial({channel_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationReactMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationReactMessage",o=i.NotificationChannel.encode(i.NotificationChannel.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setRoleChannelPermission(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetRoleChannelPermission",o=i.UpdateRoleChannelRequest.encode(i.UpdateRoleChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getListPermission(e={}){let t="/mezon.api.Mezon/GetListPermission",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.PermissionList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,n,r={}){let o="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",s=i.PermissionRoleChannelListEventRequest.encode(i.PermissionRoleChannelListEventRequest.fromPartial({role_id:e,channel_id:t,user_id:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.PermissionRoleChannelListEventResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,n,r,o={}){let a="/mezon.api.Mezon/DeletePinMessage",c=i.DeletePinMessage.encode(i.DeletePinMessage.fromPartial({id:e,message_id:t,channel_id:n,clan_id:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return h})),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,n,r={}){let o="/mezon.api.Mezon/GetPinMessagesList",s=i.PinMessageRequest.encode(i.PinMessageRequest.fromPartial({message_id:e,channel_id:t,clan_id:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.PinMessagesList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createMessage2Inbox(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateMessage2Inbox",o=i.Message2InboxRequest.encode(i.Message2InboxRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelMessageHeader.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createPinMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePinMessage",o=i.PinMessageRequest.encode(i.PinMessageRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelMessageHeader.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t={}){let n="/mezon.api.Mezon/GetPubKeys",o=i.GetPubKeysRequest.encode(i.GetPubKeysRequest.fromPartial({user_ids:e||[]})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.GetPubKeysResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}pushPubKey(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/PushPubKey",o=i.PushPubKeyRequest.encode(i.PushPubKeyRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}addRolesChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddRolesChannelDesc",o=i.AddRoleChannelDescRequest.encode(i.AddRoleChannelDescRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}changeChannelCategory(e,t,n={}){if(e==null)throw new Error("'newCategoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ChangeChannelCategory",a=i.ChangeChannelCategoryRequest.encode(i.ChangeChannelCategoryRequest.fromPartial(M(v({},t),{new_category_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRoleChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteRoleChannelDesc",o=i.DeleteRoleRequest.encode(i.DeleteRoleRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listRoles(e,t,n,r,o={}){let a="/mezon.api.Mezon/ListRoles",c=i.RoleListEventRequest.encode(i.RoleListEventRequest.fromPartial({clan_id:e,limit:t,state:n,cursor:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.RoleListEventResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}createRole(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateRole",o=i.CreateRoleRequest.encode(i.CreateRoleRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Role.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateRoleDelete(e,t,n={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteRole",a=i.DeleteRoleRequest.encode(i.DeleteRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,n,r,o={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteRole",c=i.DeleteRoleRequest.encode(i.DeleteRoleRequest.fromPartial({role_id:e,channel_id:t,clan_id:n,role_label:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return h})),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}updateRole(e,t,n={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateRole",a=i.UpdateRoleRequest.encode(i.UpdateRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listRolePermissions(e,t={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListRolePermissions",o=i.ListPermissionsRequest.encode(i.ListPermissionsRequest.fromPartial({role_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.PermissionList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,n,r={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListRoleUsers",s=i.ListRoleUsersRequest.encode(i.ListRoleUsersRequest.fromPartial({role_id:e,limit:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.RoleUserList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetRoleOfUserInTheClan",a=i.ListPermissionOfUsersRequest.encode(i.ListPermissionOfUsersRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.RoleList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,n,r={}){let o="/mezon.api.Mezon/SearchThread",s=i.SearchThreadRequest.encode(i.SearchThreadRequest.fromPartial({clan_id:e,channel_id:t,label:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ChannelDescList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}sessionLogout(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SessionLogout",o=i.SessionLogoutRequest.encode(i.SessionLogoutRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}addClanSticker(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddClanSticker",o=i.ClanStickerAddRequest.encode(i.ClanStickerAddRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteClanStickerById",s=i.ClanStickerDeleteRequest.encode(i.ClanStickerDeleteRequest.fromPartial({id:e,clan_id:t,sticker_label:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanStickerById",a=i.ClanStickerUpdateByIdRequest.encode(i.ClanStickerUpdateByIdRequest.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e={}){let t="/mezon.api.Mezon/GetListStickersByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.StickerListedResponse.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}registerStreamingChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RegisterStreamingChannel",o=i.RegisterStreamingChannelRequest.encode(i.RegisterStreamingChannelRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.RegisterStreamingChannelResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/ListStreamingChannelUsers",h=i.ListChannelUsersRequest.encode(i.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:o,cursor:a})).finish(),f=m("POST",s,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return i.StreamingChannelUserList.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e={}){let t="/mezon.api.Mezon/GetSystemMessagesList",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.SystemMessagesList.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}createSystemMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateSystemMessage",o=i.SystemMessageRequest.encode(i.SystemMessageRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,n,r={}){let o="/mezon.api.Mezon/ListSdTopic",s=i.ListSdTopicRequest.encode(i.ListSdTopicRequest.fromPartial({clan_id:e,limit:t,page:n})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.SdTopicList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createSdTopic(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateSdTopic",o=i.SdTopicRequest.encode(i.SdTopicRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SdTopic.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteSdTopic(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteSdTopic",o=i.DeleteSdTopicRequest.encode(i.DeleteSdTopicRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteSystemMessage(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteSystemMessage",o=i.DeleteSystemMessage.encode(i.DeleteSystemMessage.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessageByClanId(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetSystemMessageByClanId",o=i.GetSystemMessage.encode(i.GetSystemMessage.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SystemMessage.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateSystemMessage(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateSystemMessage",a=i.SystemMessageRequest.encode(i.SystemMessageRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,n,r,o,a,s={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListThreadDescs",h=i.ListThreadRequest.encode(i.ListThreadRequest.fromPartial({channel_id:e,limit:t,state:n,clan_id:r,thread_id:o,page:a})).finish(),f=m("POST",s,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return i.ChannelDescListNoPool.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateCategory",a=i.UpdateCategoryDescRequest.encode(i.UpdateCategoryDescRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateChannelPrivate(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateChannelPrivate",o=i.ChangeChannelPrivateRequest.encode(i.ChangeChannelPrivateRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateUserProfileByClan(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateUserProfileByClan",a=i.UpdateClanProfileRequest.encode(i.UpdateClanProfileRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}uploadOauthFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadOauthFile",o=i.UploadAttachmentRequest.encode(i.UploadAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UploadAttachment.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadAttachmentFile",o=i.UploadAttachmentRequest.encode(i.UploadAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UploadAttachment.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}uploadBatchAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadBatchAttachmentFile",o=i.UploadBatchAttachmentRequest.encode(i.UploadBatchAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UploadAttachmentBatch.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",o=i.UploadAttachmentRequest.encode(i.UploadAttachmentRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.MultipartUploadAttachment.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFileFinsih(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MultipartUploadAttachmentFileFinish",o=i.MultipartUploadAttachmentFinishRequest.encode(i.MultipartUploadAttachmentFinishRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}linkCDNFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkCDNFile",o=i.LinkCDNFileRequest.encode(i.LinkCDNFileRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sfuBreakoutRoom(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SfuBreakoutRoom",o=i.SfuBreakoutRoomRequest.encode(i.SfuBreakoutRoomRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.SfuBreakoutRoomResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sfuBreakoutMerge(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SfuBreakoutMerge",o=i.SfuBreakoutMergeRequest.encode(i.SfuBreakoutMergeRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUser",o=i.UpdateUsersRequest.encode(i.UpdateUsersRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listUserClansByUserId(e={}){let t="/mezon.api.Mezon/ListUserClansByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.AllUserClans.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,n={}){let r="/mezon.api.Mezon/ListUserPermissionInChannel",a=i.UserPermissionInChannelListRequest.encode(i.UserPermissionInChannelListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.UserPermissionInChannelListResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e={}){let t="/mezon.api.Mezon/GetUserStatus",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.UserStatus.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateUserStatus(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUserStatus",o=i.UserStatusUpdate.encode(i.UserStatusUpdate.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateUserCustomStatus(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUserCustomStatus",o=i.UserStatusUpdate.encode(i.UserStatusUpdate.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}generateWebhook(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateWebhook",o=i.WebhookCreateRequest.encode(i.WebhookCreateRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.WebhookGenerateResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateWebhookById",a=i.WebhookUpdateRequestById.encode(i.WebhookUpdateRequestById.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ListWebhookByChannelId",a=i.WebhookListRequest.encode(i.WebhookListRequest.fromPartial({channel_id:e,clan_id:t||""})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.WebhookListResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteWebhookById",a=i.WebhookDeleteRequestById.encode(i.WebhookDeleteRequestById.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,n){let r=e+t+"?";for(let[o,a]of n)a instanceof Array?r+=a.reduce((s,c)=>s+encodeURIComponent(o)+"="+encodeURIComponent(c)+"&",""):a!=null&&(r+=encodeURIComponent(o)+"="+encodeURIComponent(a)+"&");return r}editChannelCanvases(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/EditChannelCanvases",o=i.EditChannelCanvasRequest.encode(i.EditChannelCanvasRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.EditChannelCanvasResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/GetChannelCanvasDetail",s=i.ChannelCanvasDetailRequest.encode(i.ChannelCanvasDetailRequest.fromPartial({id:e,clan_id:t||"",channel_id:n||""})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.ChannelCanvasDetailResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,n,r={}){if(e==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteChannelCanvas",s=i.DeleteChannelCanvasRequest.encode(i.DeleteChannelCanvasRequest.fromPartial({canvas_id:e,clan_id:t||"",channel_id:n||""})).finish(),c=m("POST",r,"");return c.body=s,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,n,r,o={}){let a="/mezon.api.Mezon/ListOnboarding",c=i.ListOnboardingRequest.encode(i.ListOnboardingRequest.fromPartial({clan_id:e,guide_type:t,limit:n,page:r})).finish(),d=m("POST",o,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.ListOnboardingResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}createOnboarding(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateOnboarding",o=i.CreateOnboardingRequest.encode(i.CreateOnboardingRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListOnboardingResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteOnboarding(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteOnboarding",a=i.OnboardingRequest.encode(i.OnboardingRequest.fromPartial({id:e,clan_id:t})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetOnboardingDetail",a=i.OnboardingRequest.encode(i.OnboardingRequest.fromPartial({id:e,clan_id:t||""})).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.OnboardingItem.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateOnboarding",a=i.UpdateOnboardingRequest.encode(i.UpdateOnboardingRequest.fromPartial(M(v({},t),{id:e}))).finish(),s=m("POST",n,"");return s.body=a,Promise.race([this.send({urlPath:r,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}generateClanWebhook(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateClanWebhook",o=i.GenerateClanWebhookRequest.encode(i.GenerateClanWebhookRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.GenerateClanWebhookResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listClanWebhook(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanWebhook",o=i.ListClanWebhookRequest.encode(i.ListClanWebhookRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListClanWebhookResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteClanWebhookById",o={id:e,clan_id:t},s=i.ClanWebhookRequest.encode(i.ClanWebhookRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanWebhookById",o=M(v({},t),{id:e}),s=i.UpdateClanWebhookRequest.encode(i.UpdateClanWebhookRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t={}){let n="/mezon.api.Mezon/GetTopicDetail",r={topic_id:e},a=i.SdTopicDetailRequest.encode(i.SdTopicDetailRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.SdTopic.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,n,r={}){let o="/mezon.api.Mezon/ListOnboardingStep",a={clan_id:e,limit:t,page:n},c=i.ListOnboardingStepRequest.encode(i.ListOnboardingStepRequest.fromPartial(a)).finish(),d=m("POST",r,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.ListOnboardingStepResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateOnboardingStep",o=M(v({},t),{clan_id:e}),s=i.UpdateOnboardingStepRequest.encode(i.UpdateOnboardingStepRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}createRoomChannelApps(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateRoomChannelApps",o=i.CreateRoomChannelApps.encode(i.CreateRoomChannelApps.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.CreateRoomChannelApps.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateMeetToken(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateMeetToken",o=i.GenerateMeetTokenRequest.encode(i.GenerateMeetTokenRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return console.log(s.message),Y(new Uint8Array(s.message))})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,n={}){let r="/mezon.api.Mezon/GetMezonOauthClient",o={client_id:e,client_name:t},s=i.GetMezonOauthClientRequest.encode(i.GetMezonOauthClientRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return i.MezonOauthClient.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateMezonOauthClient(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateMezonOauthClient",o=i.MezonOauthClient.encode(i.MezonOauthClient.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.MezonOauthClient.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t={}){let n="/mezon.api.Mezon/GenerateHashChannelApps",r={app_id:e},a=i.GenerateHashChannelAppsRequest.encode(i.GenerateHashChannelAppsRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.GenerateHashChannelAppsResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}addUserEvent(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddUserEvent",o=i.UserEventRequest.encode(i.UserEventRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,n={}){let r="/mezon.api.Mezon/DeleteUserEvent",o={clan_id:e,event_id:t},s=i.UserEventRequest.encode(i.UserEventRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateRoleOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateRoleOrder",o=i.UpdateRoleOrderRequest.encode(i.UpdateRoleOrderRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}createExternalMezonMeet(e={}){let t="/mezon.api.Mezon/CreateExternalMezonMeet",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return i.GenerateMezonMeetResponse.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,n,r,o={}){if(e==null)throw new Error("'token' is a required parameter but is null or undefined.");let a="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(e))),s=new Map;s.set("username",t),s.set("metadata",n),s.set("is_guest",r);let c="",d=this.buildFullUrl(this.basePath,a,s),h=m("POST",o,c);return h.headers.Accept="application/x-protobuf",h.headers["Content-Type"]="application/json",Promise.race([fetch(d,h).then(f=>l(this,null,function*(){if(!f.ok)throw f;let _=yield f.arrayBuffer();return i.GenerateMeetTokenExternalResponse.decode(new Uint8Array(_))})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}muteParticipantMezonMeet(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MuteParticipantMezonMeet",o=i.MeetParticipantRequest.encode(i.MeetParticipantRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}removeParticipantMezonMeet(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RemoveParticipantMezonMeet",o=i.MeetParticipantRequest.encode(i.MeetParticipantRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listChannelDetail(e,t={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListChannelDetail",r={channel_id:e},a=i.ListChannelDetailRequest.encode(i.ListChannelDetailRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.ChannelDescription.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListChannelTimeline",o=i.ListChannelTimelineRequest.encode(i.ListChannelTimelineRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ListChannelTimelineResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateChannelTimeline",o=i.CreateChannelTimelineRequest.encode(i.CreateChannelTimelineRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.CreateChannelTimelineResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateChannelTimeline",o=i.UpdateChannelTimelineRequest.encode(i.UpdateChannelTimelineRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.UpdateChannelTimelineResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}detailChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DetailChannelTimeline",o=i.ChannelTimelineDetailRequest.encode(i.ChannelTimelineDetailRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.ChannelTimelineDetailResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateClanOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateClanOrder",o=i.UpdateClanOrderRequest.encode(i.UpdateClanOrderRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/clan/discover",a=new Map,s="";s=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,o,a),d=m("POST",r,s);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return i.ListClanDiscover.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/DeleteQuickMenuAccess",d={id:e,clan_id:t,bot_id:n,menu_name:r,background:o,action_msg:a},f=i.QuickMenuAccess.encode(i.QuickMenuAccess.fromPartial(d)).finish(),_=m("POST",s,"");return _.body=f,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,n,r={}){let o="/mezon.api.Mezon/ListQuickMenuAccess",a={bot_id:e,channel_id:t,menu_type:n},c=i.ListQuickMenuAccessRequest.encode(i.ListQuickMenuAccessRequest.fromPartial(a)).finish(),d=m("POST",r,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return i.QuickMenuAccessList.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addQuickMenuAccess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddQuickMenuAccess",o=i.QuickMenuAccess.encode(i.QuickMenuAccess.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateQuickMenuAccess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateQuickMenuAccess",o=i.QuickMenuAccess.encode(i.QuickMenuAccess.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t={}){let n="/mezon.api.Mezon/ListForSaleItems",r={page:e},a=i.ListForSaleItemsRequest.encode(i.ListForSaleItemsRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.ForSaleItemList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}isFollower(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/IsFollower",o=i.IsFollowerRequest.encode(i.IsFollowerRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.IsFollowerResponse.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}transferOwnership(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/TransferOwnership",o=i.TransferOwnershipRequest.encode(i.TransferOwnershipRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return s})),new Promise((s,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateUsername(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUsername",o=i.UpdateUsernameRequest.encode(i.UpdateUsernameRequest.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.Session.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}isBanned(e,t={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/IsBanned",r={channel_id:e},a=i.IsBannedRequest.encode(i.IsBannedRequest.fromPartial(r)).finish(),s=m("POST",t,"");return s.body=a,Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return i.IsBannedResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,n={}){let r="/mezon.api.Mezon/ReportMessageAbuse",o={message_id:e,abuse_type:t},s=i.ReportMessageAbuseReqest.encode(i.ReportMessageAbuseReqest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,r,o,a,s,c,d,h,f,_,b){let g="/mezon.api.Mezon/SendChannelMessage",C=i.ChannelMessageSend.encode(i.ChannelMessageSend.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,content:o,mentions:a,attachments:s,references:c,anonymous_message:d,mention_everyone:h,avatar:f,code:_,topic_id:b})).finish(),R=m("POST",{},"");return R.body=C,Promise.race([this.send({urlPath:g,fetchOptions:R}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return i.ChannelMessageAck.decode(w.message)})),new Promise((w,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}sendChannelMessageApi(e,t,n,r,o,a,s,c,d,h,f,_,b,g,A={}){var te;let C="/mezon.api.Mezon/SendChannelMessage",R=new Map,w=typeof a=="string"?a:JSON.stringify(a!=null?a:{}),J=i.ChannelMessageSend.encode(i.ChannelMessageSend.fromPartial({clan_id:t,channel_id:n,mode:r,is_public:o,content:w,mentions:s,attachments:c,references:d,anonymous_message:h,mention_everyone:f,avatar:_,code:b,topic_id:g})).finish(),D=this.buildFullUrl((te=e.api_url)!=null?te:"",C,R),L=m("POST",A,"");return L.body=J,e.token&&(L.headers.Authorization="Bearer "+e.token),Promise.race([fetch(D,L).then(F=>l(this,null,function*(){if(!F.ok)throw F;if(F.status===204)return{};let Q=yield F.arrayBuffer();return i.ChannelMessageAck.decode(new Uint8Array(Q))})),new Promise((F,Q)=>setTimeout(()=>Q(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,r,o,a,s,c,d,h,f,_){let b="/mezon.api.Mezon/UpdateChannelMessage",A=i.ChannelMessageUpdate.encode(i.ChannelMessageUpdate.fromPartial({clan_id:e,channel_id:t,message_id:o,mode:n,is_public:r,content:a,mentions:s,attachments:c,create_time_seconds:d,hide_editted:h,topic_id:f,is_update_msg_topic:_})).finish(),C=m("POST",{},"");return C.body=A,Promise.race([this.send({urlPath:b,fetchOptions:C}).then(R=>l(this,null,function*(){if(R.code!=0)throw R;return i.ChannelMessageUpdate.decode(R.message)})),new Promise((R,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,n,r,o,a,s,c,d){let h="/mezon.api.Mezon/DeleteChannelMessage",_=i.ChannelMessageRemove.encode(i.ChannelMessageRemove.fromPartial({clan_id:e,channel_id:t,message_id:o,mode:n,is_public:r,has_attachment:a,mentions:c,references:d,topic_id:s})).finish(),b=m("POST",{},"");return b.body=_,Promise.race([this.send({urlPath:h,fetchOptions:b}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return i.ChannelMessageRemove.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,n,r,o,a={}){let s="/mezon.api.Mezon/UpdateMezonVoiceState",c={clan_id:e,channel_id:t,display_name:n,room_name:r,state:o},h=i.HandleParticipantMeetStateEvent.encode(i.HandleParticipantMeetStateEvent.fromPartial(c)).finish(),f=m("POST",a,"");return f.body=h,Promise.race([this.send({urlPath:s,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return _})),new Promise((_,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/MessageButtonClick",d={message_id:e,channel_id:t,button_id:n,sender_id:r,user_id:o,extra_data:a},f=i.MessageButtonClicked.encode(i.MessageButtonClicked.fromPartial(d)).finish(),_=m("POST",s,"");return _.body=f,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,r,o,a,s={}){let c="/mezon.api.Mezon/DropdownBoxSelected",d={message_id:e,channel_id:t,selectbox_id:n,sender_id:r,user_id:o,values:a},f=i.DropdownBoxSelected.encode(i.DropdownBoxSelected.fromPartial(d)).finish(),_=m("POST",s,"");return _.body=f,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,n={}){let r="/mezon.api.Mezon/ActiveArchivedThread",o={clan_id:e,channel_id:t},s=i.ActiveArchivedThread.encode(i.ActiveArchivedThread.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,n={}){let r="/mezon.api.Mezon/AddAgentToChannel",o={room_name:e,channel_id:t},s=i.UpdateAIAgentRequest.encode(i.UpdateAIAgentRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,n={}){let r="/mezon.api.Mezon/DisconnectAgent",o={room_name:e,channel_id:t},s=i.UpdateAIAgentRequest.encode(i.UpdateAIAgentRequest.fromPartial(o)).finish(),c=m("POST",n,"");return c.body=s,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listMutedChannel(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListMutedChannel",o=i.ListMutedChannelRequest.encode(i.ListMutedChannelRequest.fromPartial({clan_id:e})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return i.MutedChannelList.decode(s.message)})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,n,r,o,a,s,c,d,h,f,_,b){let g="/mezon.api.Mezon/ReactChannelMessage",C=i.MessageReaction.encode(i.MessageReaction.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,message_id:o,emoji_id:a,emoji:s,count:c,message_sender_id:d,action:h,emoji_recent_id:_,sender_name:b,topic_id:f})).finish(),R=m("POST",{},"");return R.body=C,Promise.race([this.send({urlPath:g,fetchOptions:R}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return i.ChannelMessageSend.decode(w.message)})),new Promise((w,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t={}){var s,c,d,h,f,_;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePoll",o=i.CreatePollRequest.encode(i.CreatePollRequest.fromPartial({channel_id:(s=e.channel_id)!=null?s:"0",clan_id:(c=e.clan_id)!=null?c:"0",question:(d=e.question)!=null?d:"",answers:(h=e.answers)!=null?h:[],expire_hours:(f=e.expire_hours)!=null?f:0,type:(_=e.type)!=null?_:0})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;let g=i.CreatePollResponse.decode(b.message);return{poll_id:g.poll_id,message_id:g.message_id,question:g.question,answers:g.answers.map(A=>({index:A.index,label:A.label})),answer_counts:g.answer_counts,exp:g.exp,is_closed:g.is_closed,creator_id:g.creator_id,type:g.type,total_votes:g.total_votes}})),new Promise((b,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t={}){var s,c,d,h;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/VotePoll",o=i.VotePollRequest.encode(i.VotePollRequest.fromPartial({poll_id:(s=e.poll_id)!=null?s:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0",answer_indices:(h=e.answer_indices)!=null?h:[]})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(f=>l(this,null,function*(){var b;let _=f.code==0?i.VotePollResponse.decode(f.message):{my_answer_indices:[]};return{my_answer_indices:Array.from((b=_.my_answer_indices)!=null?b:[])}})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t={}){var s,c,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ClosePoll",o=i.ClosePollRequest.encode(i.ClosePollRequest.fromPartial({poll_id:(s=e.poll_id)!=null?s:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(h=>{if(h.code==0)return{};throw h}),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t={}){var s,c,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetPoll",o=i.GetPollRequest.encode(i.GetPollRequest.fromPartial({poll_id:(s=e.poll_id)!=null?s:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;let f=i.GetPollResponse.decode(h.message);return{poll_id:f.poll_id,message_id:f.message_id,question:f.question,answers:f.answers.map(_=>({index:_.index,label:_.label})),answer_counts:f.answer_counts,exp:f.exp,is_closed:f.is_closed,creator_id:f.creator_id,type:f.type,total_votes:f.total_votes,voter_details:f.voter_details.map(_=>({answer_index:_.answer_index,user_ids:_.user_ids}))}})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}followUsers(e){return l(this,null,function*(){let t="",n={status_follow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}joinClanChat(e){return l(this,null,function*(){let t="",n={clan_join:{clan_id:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}follower(){return l(this,null,function*(){let e="",t={follow_event:{}};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){if(n.code!=0)throw n;return{}})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}joinChat(e,t,n,r){return l(this,null,function*(){let o="",a={channel_join:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}leaveChat(e,t,n,r){let o="",a={channel_leave:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,r,o,a,s,c,d){return l(this,null,function*(){let h="",f={channel_message_remove:{clan_id:e,channel_id:t,mode:n,message_id:o,is_public:r,has_attachment:a,topic_id:s,mentions:c,references:d}};return Promise.race([this.send({urlPath:h,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return{}})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])})}unfollowUsers(e){let t="",n={status_unfollow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateChatMessage(e,t,n,r,o,a,s,c,d,h,f,_){return l(this,null,function*(){let b="",g={channel_message_update:{clan_id:e,channel_id:t,message_id:o,content:a,mentions:s,attachments:c,create_time_seconds:d,mode:n,is_public:r,hide_editted:h,topic_id:f,is_update_msg_topic:_}};return Promise.race([this.send({urlPath:b,fetchOptions:g}).then(A=>l(this,null,function*(){if(A.code!=0)throw A;return{}})),new Promise((A,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])})}updateStatus(e){let t="",n={status_update:{status:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}writeQuickMenuEvent(e,t,n,r,o,a,s,c,d,h,f,_,b,g,A,C){return l(this,null,function*(){let R="",w={clan_id:t,channel_id:n,mode:r,is_public:o,content:a,mentions:s,attachments:c,references:d,anonymous_message:h,mention_everyone:f,avatar:_,code:b,topic_id:g};A!=null&&String(A).length>0&&(w.id=A);let E={menu_name:e,message:w};C!=null&&String(C).length>0&&String(C)!=="0"&&(E.message_sender_id=C);let J={quick_menu_event:E};return Promise.race([this.send({urlPath:R,fetchOptions:J}).then(D=>l(this,null,function*(){if(D.code!=0)throw D;return{}})),new Promise((D,L)=>setTimeout(()=>L(new Error("Request timed out.")),this.timeoutMs))])})}writeEphemeralMessage(e,t,n,r,o,a,s,c,d,h,f,_,b,g,A){return l(this,null,function*(){let C="",R={ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:n,mode:r,is_public:o,content:a,mentions:s,attachments:c,references:d,anonymous_message:h,mention_everyone:f,avatar:_,code:b,topic_id:g,id:A}}};return Promise.race([this.send({urlPath:C,fetchOptions:R}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return{}})),new Promise((w,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])})}writeChatMessage(e,t,n,r,o,a,s,c,d,h,f,_,b){return l(this,null,function*(){let g="",A={channel_message_send:{clan_id:e,channel_id:t,mode:n,is_public:r,content:o,mentions:a,attachments:s,references:c,anonymous_message:d,mention_everyone:h,avatar:f,code:_,topic_id:b}};return Promise.race([this.send({urlPath:g,fetchOptions:A}).then(C=>l(this,null,function*(){var R;if(C.code!=0)throw C;return(R=C==null?void 0:C.message)==null?void 0:R.channel_message_ack})),new Promise((C,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageReaction(e,t,n,r,o,a,s,c,d,h,f,_,b,g){return l(this,null,function*(){let A="",C={message_reaction_event:{id:e,clan_id:t,channel_id:n,mode:r,is_public:o,message_id:a,emoji_id:s,emoji:c,count:d,message_sender_id:h,action:f,topic_id:_,emoji_recent_id:b,sender_name:g}};return Promise.race([this.send({urlPath:A,fetchOptions:C}).then(R=>l(this,null,function*(){if(R.code!=0)throw R;return{}})),new Promise((R,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageTyping(e,t,n,r,o,a){return l(this,null,function*(){let s="",c={message_typing_event:{clan_id:e,channel_id:t,mode:n,is_public:r,sender_display_name:o,topic_id:a}};return Promise.race([this.send({urlPath:s,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastSeenMessage(e,t,n,r,o,a){return l(this,null,function*(){let s="",c={last_seen_message_event:{clan_id:e,channel_id:t,mode:n,message_id:r,timestamp_seconds:o,badge_count:a}};return Promise.race([this.send({urlPath:s,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastPinMessage(e,t,n,r,o,a,s,c,d,h,f,_,b){return l(this,null,function*(){let g="",A={last_pin_message_event:{clan_id:e,channel_id:t,mode:n,is_public:r,message_id:o,timestamp_seconds:a,operation:s,message_sender_avatar:c,message_sender_id:d,message_sender_username:h,message_content:f,message_attachment:_,message_created_time:b}};return Promise.race([this.send({urlPath:g,fetchOptions:A}).then(C=>l(this,null,function*(){if(C.code!=0)throw C;return{}})),new Promise((C,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])})}writeCustomStatus(e,t,n,r){return l(this,null,function*(){let o="",a={custom_status_event:{clan_id:e,status:t,time_reset:n,no_clear:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceReaction(e,t){return l(this,null,function*(){let n="",r={voice_reaction_send:{emojis:e,channel_id:t}};return Promise.race([this.send({urlPath:n,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceInteractiveEvent(e,t,n,r,o,a){return l(this,null,function*(){let s="",c={voice_interactive_event:{clan_id:e,voice_channel_id:t,sender_id:n,receiver_id:r,event_type:o,params:a}};return Promise.race([this.send({urlPath:s,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}forwardWebrtcSignaling(e,t,n,r,o){return l(this,null,function*(){let a="",s={webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:n,channel_id:r,caller_id:o}};return Promise.race([this.send({urlPath:a,fetchOptions:s}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,r){return l(this,null,function*(){let o="",a={incoming_call_push:{receiver_id:e,json_data:t,channel_id:n,caller_id:r}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(s=>l(this,null,function*(){if(s.code!=0)throw s;return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeChannelAppEvent(e,t,n){return l(this,null,function*(){let r="",o={channel_app_event:{clan_id:e,channel_id:t,action:n}};return Promise.race([this.send({urlPath:r,fetchOptions:o}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,s)=>setTimeout(()=>s(new Error("Request timed out.")),this.timeoutMs))])})}writeStreamingWatch(e,t){return l(this,null,function*(){let n="",r={streaming_watch:{channel_id:e,watching:t}};return Promise.race([this.send({urlPath:n,fetchOptions:r}).then(o=>l(this,null,function*(){if(o.code!=0)throw o})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}listLogedDevice(){return l(this,null,function*(){let e="/mezon.api.Mezon/ListLogedDevice",t={};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){return n.code!=0?{}:i.LogedDeviceList.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}};V.DefaultSendTimeoutMs=1e4;var K=V;var Oe="127.0.0.1",Ue="7350",De="defaultkey",Le=3e4,p={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};function U(y){return typeof Event=="function"?new Event(y):{type:y,target:null,currentTarget:null,bubbles:!1,cancelable:!1,defaultPrevented:!1,timeStamp:Date.now(),preventDefault:()=>{},stopPropagation:()=>{},stopImmediatePropagation:()=>{}}}var q=class q{constructor(e=De,t=Oe,n=Ue,r=!1,o=Le,a=!0){this.serverkey=e;this.timeout=o;this.autoFallbackHttp=a;this.verbose=!1;this._hasConnectedOnce=!1;this._connectAttemptSeq=0;this._heartbeatSuspended=!1;this._serverDisconnectStreak=0;this.host=t,this.port=n,this.useSSL=r;let c=`${r?"https://":"http://"}${t}:${n}`;this._heartbeatIntervalMs=q.DefaultHeartbeatIntervalMs,this._heartbeatTimeoutMs=q.DefaultHeartbeatTimeoutMs,this._connectionState=p.DISCONNECTED,this.serverDisconnectStreakLogoutThreshold=q.DefaultServerDisconnectStreakLogoutThreshold,this.transport=new K(e,o,c)}failConnect(e){let t=this._connectReject;this._connectReject=void 0,t&&t(e)}isOpen(){return this._connectionState===p.CONNECTED}connect(e,t,n=!1,r=!1,o=q.DefaultConnectTimeoutMs){var h,f;this.verbose=r;let a=((h=this._lastConnectArgs)==null?void 0:h.session_id)===e&&((f=this._lastConnectArgs)==null?void 0:f.url)===t;if(this._connectionState===p.CONNECTED&&this.transport.adapter.isOpen()&&a)return Promise.resolve();if(this._connectionState===p.CONNECTING&&this._connectPromise&&a)return this._connectPromise;(this._connectionState===p.CONNECTED||this._connectionState===p.CONNECTING)&&(this.failConnect(new Error("Connect superseded by new connect().")),this.transport.close(),this.markDisconnected("connect_superseded",U("close"),!1,!1)),this.clearConnectTimeout(),this._connectionState=p.CONNECTING,this._connectAttemptSeq+=1,this._lastConnectArgs={session_id:e,url:t,createStatus:n,verbose:r,connectTimeoutMs:o};let s,c,d=new Promise((_,b)=>{s=_,c=b});this._connectPromise=d,this._connectReject=c,this._connectTimeoutTimer=setTimeout(()=>{this._connectionState===p.CONNECTING&&(this.markDisconnected("connect_timeout",U("timeout"),!0,!1),this.transport.close(),this.failConnect(new Error("TIME_OUT")))},o);try{this.transport.connect(e,t,n,r,{onMessage:(_,b,g)=>l(this,null,function*(){if(!g.cid)if(g.notifications)g.notifications.notifications.forEach(A=>{A.content=A.content?G(A.content):void 0,this.onnotification(A)});else if(g.voice_started_event)this.onvoicestarted(g.voice_started_event);else if(g.voice_ended_event)this.onvoiceended(g.voice_ended_event);else if(g.voice_joined_event)this.onvoicejoined(g.voice_joined_event);else if(g.voice_leaved_event)this.onvoiceleaved(g.voice_leaved_event);else if(g.channel_created_event)this.onchannelcreated(g.channel_created_event);else if(g.category_event)this.oncategoryevent(g.category_event);else if(g.role_event)this.onroleevent(g.role_event);else if(g.event_emoji)this.oneventemoji(g.event_emoji);else if(g.noti_user_channel)this.oneventnotiuserchannel(g.noti_user_channel);else if(g.webhook_event)this.oneventwebhook(g.webhook_event);else if(g.channel_deleted_event)this.onchanneldeleted(g.channel_deleted_event);else if(g.clan_deleted_event)this.onclandeleted(g.clan_deleted_event);else if(g.sticker_create_event)this.onstickercreated(g.sticker_create_event);else if(g.sticker_update_event)this.onstickerupdated(g.sticker_update_event);else if(g.sticker_delete_event)this.onstickerdeleted(g.sticker_delete_event);else if(g.channel_updated_event)this.onchannelupdated(g.channel_updated_event);else if(g.channel_archive_event)this.onchannelarchive(g.channel_archive_event);else if(g.delete_account_event)this.ondeleteaccount(g.delete_account_event);else if(g.clan_profile_updated_event)this.onclanprofileupdated(g.clan_profile_updated_event);else if(g.clan_updated_event)this.onclanupdated(g.clan_updated_event);else if(g.last_seen_message_event)this.onlastseenupdated(g.last_seen_message_event);else if(g.status_presence_event)this.onstatuspresence(g.status_presence_event);else if(g.channel_message){let A=$(g);this.onchannelmessage(A)}else g.message_typing_event?this.onmessagetyping(g.message_typing_event):g.message_reaction_event?this.onmessagereaction(g.message_reaction_event):g.channel_presence_event?this.onchannelpresence(g.channel_presence_event):g.last_pin_message_event?this.onpinmessage(g.last_pin_message_event):g.custom_status_event?this.oncustomstatus(g.custom_status_event):g.canvas_event?this.oncanvasevent(g.canvas_event):g.user_channel_added_event?this.onuserchanneladded(g.user_channel_added_event):g.add_clan_user_event?this.onuserclanadded(g.add_clan_user_event):g.user_profile_updated_event?this.onuserprofileupdate(g.user_profile_updated_event):g.user_channel_removed_event?this.onuserchannelremoved(g.user_channel_removed_event):g.block_friend?this.onblockfriend(g.block_friend):g.un_block_friend?this.onunblockfriend(g.un_block_friend):g.add_friend?this.onaddfriend(g.add_friend):g.remove_friend?this.onremovefriend(g.remove_friend):g.user_clan_removed_event?this.onuserclanremoved(g.user_clan_removed_event):g.clan_event_created?this.oneventcreated(g.clan_event_created):g.give_coffee_event?this.oncoffeegiven(g.give_coffee_event):g.role_assign_event?this.onroleassign(g.role_assign_event):g.streaming_started_event?this.onstreamingchannelstarted(g.streaming_started_event):g.streaming_ended_event?this.onstreamingchannelended(g.streaming_ended_event):g.streaming_joined_event?this.onstreamingchanneljoined(g.streaming_joined_event):g.streaming_leaved_event?this.onstreamingchannelleaved(g.streaming_leaved_event):g.streaming_viewer_count_event?this.onstreamingviewercount(g.streaming_viewer_count_event):g.permission_set_event?this.onpermissionset(g.permission_set_event):g.permission_changed_event?this.onpermissionchanged(g.permission_changed_event):g.unmute_event?this.onunmuteevent(g.unmute_event):g.token_sent_event?this.ontokensent(g.token_sent_event):g.message_button_clicked?this.onmessagebuttonclicked(g.message_button_clicked):g.dropdown_box_selected?this.onmessagedropdownboxselected(g.dropdown_box_selected):g.mark_as_read?this.onmarkasread(g.mark_as_read):g.voice_reaction_send?this.onvoicereactionmessage(g.voice_reaction_send):g.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(g.webrtc_signaling_fwd):g.list_activity?this.onactivityupdated(g.list_activity):g.sd_topic_event?this.onsdtopicevent(g.sd_topic_event):g.channel_app_event?this.onchannelappevent(g.channel_app_event):g.user_status_event?this.onuserstatusevent(g.user_status_event):g.join_channel_app_data?this.onjoinchannelappevent(g.join_channel_app_data):g.unpin_message_event?this.onunpinmessageevent(g.unpin_message_event):g.quick_menu_event?this.onquickmenuevent(g.quick_menu_event):g.meet_participant_event?this.onmeetparticipantevent(g.meet_participant_event):g.transfer_ownership_event?this.ontransferownership(g.transfer_ownership_event):g.ban_user_event?this.onbanneduser(g.ban_user_event):g.list_channel_users_banned_event?this.onlistchannelusersbanned(g.list_channel_users_banned_event):g.allow_anonymous_event?this.onallowanonymousevent(g.allow_anonymous_event):g.aiagent_enabled_event?this.onaiagentenabled(g.aiagent_enabled_event):g.refresh_session_event?this.onrefreshsession(g.refresh_session_event):g.topic_in_message_event?this.ontopicinmessage(g.topic_in_message_event):g.screen_share_event?this.onscreenshare(g.screen_share_event):g.voice_interactive_event?this.onvoiceinteractiveevent(g.voice_interactive_event):g.sfu_breakout_room_event?this.onsfubreakoutroomevent(g.sfu_breakout_room_event):g.pong?this.verbose&&typeof console!="undefined"&&console.log("Pong message received: %o",g):this.verbose&&typeof console!="undefined"&&console.log("Unrecognized message received: %o",g)}),onClose:_=>{let b=this._connectionState===p.CONNECTING;this.markDisconnected("transport_on_close",_,!0,!0),b&&this.failConnect(new Error("SOCKET_CLOSED_BEFORE_ESTABLISH"))},onOpen:_=>{this.verbose&&typeof console!="undefined"&&console.log(_);let b=this._hasConnectedOnce;this._hasConnectedOnce=!0,this.clearConnectTimeout(),this._serverDisconnectStreak=0,this._connectionState=p.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,s(),this._connectReject=void 0,b?this.onreconnect(_):this.onconnect(_)},onError:_=>{this.onerror(_),this._connectAttemptSeq+=1,this.failConnect(_ instanceof Error?_:new Error("Socket error during connect.")),this.transport.close(),this.markDisconnected("transport_on_error",_,!0,!1)}})}catch(_){let b=U("error");this.onerror(b),this.markDisconnected("connect_sync_throw",b,!0,!1),this.failConnect(_ instanceof Error?_:new Error(String(_)))}return d}setAutoReconnect(e){}disconnect(e=!0){this._lastConnectArgs=void 0,this.failConnect(new Error("Client disconnected.")),this.markDisconnected("client_disconnect",U("close"),e,!1),this.transport.close()}pingPong(){return l(this,null,function*(){if(!this.isOpen())return;let e=this._connectAttemptSeq;try{let t="",n={ping:{}};yield this.transport.send({urlPath:t,fetchOptions:n},this._heartbeatTimeoutMs)}catch(t){if(e!==this._connectAttemptSeq||this._connectionState!==p.CONNECTED)return;this.verbose&&typeof console!="undefined"&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this._connectAttemptSeq+=1,this.transport.adapter.isOpen()&&this.transport.close(),this.markDisconnected("heartbeat_unreachable",U("close"),!0,!1);return}e===this._connectAttemptSeq&&this.startHeartbeatLoop()})}startHeartbeatLoop(){this._heartbeatSuspended||(this.stopHeartbeatLoop(),this._heartbeatTimer=setTimeout(()=>this.pingPong(),this._heartbeatIntervalMs))}stopHeartbeatLoop(){this._heartbeatTimer!==void 0&&(clearTimeout(this._heartbeatTimer),this._heartbeatTimer=void 0)}clearConnectTimeout(){this._connectTimeoutTimer!==void 0&&(clearTimeout(this._connectTimeoutTimer),this._connectTimeoutTimer=void 0)}markDisconnected(e,t=U("close"),n=!0,r=!1){this.verbose&&typeof console!="undefined"&&console.log(e);let o=this._connectionState===p.DISCONNECTED;if(this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this._connectPromise=void 0,o||n&&this.ondisconnect(t),r&&!o&&this.serverDisconnectStreakLogoutThreshold>0&&(this._serverDisconnectStreak+=1,this._serverDisconnectStreak>=this.serverDisconnectStreakLogoutThreshold)){let a=this._serverDisconnectStreak;this._serverDisconnectStreak=0,this.onserverdisconnectstreaklogout(t,a)}}onconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onreconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ondisconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onserverdisconnectstreaklogout(e,t){this.verbose&&typeof console!="undefined"&&console.log("Server disconnect streak reached: %o",t,e)}onerror(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagetyping(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagereaction(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelmessage(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelpresence(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserchanneladded(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserclanadded(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserprofileupdate(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserchannelremoved(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onaddfriend(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onremovefriend(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onblockfriend(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onunblockfriend(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserclanremoved(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onnotification(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstatuspresence(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onpinmessage(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoiceended(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoicestarted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoicejoined(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoiceleaved(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelcreated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oncategoryevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onroleevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oneventemoji(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oneventnotiuserchannel(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oneventwebhook(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchanneldeleted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onclandeleted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstickercreated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstickerdeleted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstickerupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelarchive(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ondeleteaccount(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onclanprofileupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onclanupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onlastseenupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onheartbeattimeout(){this.verbose&&typeof console!="undefined"&&console.log("Heartbeat timeout.")}oncustomstatus(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oncanvasevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oneventcreated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oncoffeegiven(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onroleassign(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingchannelstarted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingchannelended(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingchanneljoined(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingchannelleaved(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingviewercount(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionset(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onpermissionchanged(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onunmuteevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ontokensent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagebuttonclicked(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagedropdownboxselected(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmarkasread(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoicereactionmessage(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onwebrtcsignalingfwd(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onactivityupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onsdtopicevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onsfubreakoutroomevent(e){this.verbose&&window&&window.console&&console.log(e)}onchannelappevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserstatusevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onjoinchannelappevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onunpinmessageevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onquickmenuevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ontransferownership(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onbanneduser(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onlistchannelusersbanned(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmeetparticipantevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onallowanonymousevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onaiagentenabled(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onrefreshsession(e){this.verbose&&typeof console!="undefined"&&console.log(`Token refresh occurred. Token: ${e.token}`)}ontopicinmessage(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onscreenshare(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoiceinteractiveevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}authenticateMezon(e,t,n,r,o={},a={}){let s={token:e,vars:o};return this.transport.authenticateMezon(this.serverkey,"",s,t,n,r,a).then(c=>({token:c.token||"",refresh_token:c.refresh_token||"",created:c.created||!1,api_url:c.api_url||"",ws_url:c.ws_url||"",id_token:c.id_token||"",is_remember:c.is_remember||!1,session_id:c.session_id||""}))}authenticateSMSOTPRequest(e,t,n){let r={username:t,account:{phoneno:e,vars:n}};return this.transport.AuthenticateSMSOTPRequest(this.serverkey,"",r,t).then(o=>Promise.resolve(o))}authenticateEmailOTPRequest(e,t,n){let r={username:t,account:{email:e,vars:n}};return this.transport.AuthenticateEmailOTPRequest(this.serverkey,"",r,t).then(o=>Promise.resolve(o))}confirmAuthenticateOTP(e){return l(this,null,function*(){return this.transport.confirmAuthenticateOTP(this.serverkey,"",e).then(t=>({token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}))})}authenticateEmail(e,t,n,r){let o={username:n,account:{email:e,password:t,vars:r}};return this.transport.authenticateEmail(this.serverkey,"",o,n).then(a=>({token:a.token||"",refresh_token:a.refresh_token||"",created:a.created||!1,api_url:a.api_url||"",ws_url:a.ws_url||"",id_token:a.id_token||"",is_remember:a.is_remember||!1,session_id:a.session_id||""}))}addChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelUsers(t,n).then(r=>r!==void 0)})}addFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addFriends(t,n)})}blockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.blockFriends(t,n).then(r=>Promise.resolve(r!=null))})}unblockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unblockFriends(t,n).then(r=>Promise.resolve(r!=null))})}uploadOauthFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadOauthFile(t)})}uploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadAttachmentFile(t)})}uploadBatchAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadBatchAttachmentFile(t)})}multipartUploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFile(t)})}multipartUploadAttachmentFileFinish(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFileFinsih(t)})}linkCDNFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkCDNFile(t)})}sfuBreakoutRoom(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sfuBreakoutRoom(t)})}sfuBreakoutMerge(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sfuBreakoutMerge(t)})}createChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelDesc(t).then(n=>Promise.resolve(n))})}createClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanDesc(t).then(n=>Promise.resolve(n))})}checkDuplicateName(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.checkDuplicateName(t)})}createCategoryDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createCategoryDesc(t).then(n=>Promise.resolve(n))})}createRole(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRole(t).then(n=>Promise.resolve(n))})}createEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createEvent(t).then(n=>Promise.resolve(n))})}addRolesChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addRolesChannelDesc(t).then(n=>n!==void 0)})}deleteRoleChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRoleChannelDesc(t).then(n=>n!==void 0)})}deleteApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteApp(t).then(n=>n!==void 0)})}deleteFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteFriends(t,n).then(r=>r!==void 0)})}deleteChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelDesc(t,n).then(r=>r!==void 0)})}deleteClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanDesc(t).then(n=>n!==void 0)})}deleteCategoryDesc(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteCategoryDesc(t,n,r).then(o=>o!==void 0)})}deleteNotifications(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotifications(t,n).then(r=>Promise.resolve(r!=null))})}deleteRole(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRole(t,"0",n,r).then(()=>!0)})}deleteEvent(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(t,n,r,o,a).then(s=>s!==void 0)})}updateEventUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEventUser(t).then(n=>n!==void 0)})}emitEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.event(t).then(n=>Promise.resolve(n!=null))})}getAccount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getAccount(e.token)})}removeClanUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeClanUsers(t,n).then(r=>Promise.resolve(r!=null))})}listBannedUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listBannedUsers(t,n).then(r=>Promise.resolve(r))})}unbanClanUsers(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unbanClanUsers(t,n,r).then(o=>Promise.resolve(o!=null))})}banClanUsers(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.banClanUsers(t,n,r,o).then(a=>Promise.resolve(a!=null))})}removeChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelUsers(t,n).then(r=>Promise.resolve(r!=null))})}listChannelMessages(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelMessages(t,n,r,o,a,s).then(c=>{let d={messages:[],last_seen_message:c.last_seen_message,last_sent_message:c.last_sent_message};return c.messages==null||c.messages.forEach(h=>{let f,_,b,g,A;try{f=P(h.content)}catch(C){console.log("error parse content",C)}try{let C=N(h.reactions);_=(C==null?void 0:C.reactions)||C||P(h.reactions||"[]")}catch(C){_=P(h.reactions||"[]")}try{let C=B(h.mentions);b=(C==null?void 0:C.mentions)||C||P(h.mentions||"[]")}catch(C){b=P(h.mentions||"[]")}try{let C=x(h.attachments);g=(C==null?void 0:C.attachments)||C||P(h.attachments||"[]")}catch(C){g=P(h.attachments||"[]")}try{let C=W(h.references);A=(C==null?void 0:C.refs)||C||P(h.references||"[]")}catch(C){A=P(h.references||"[]")}d.messages.push({channel_id:h.channel_id,code:h.code?Number(h.code):0,id:h.message_id||"",sender_id:h.sender_id,username:h.username,display_name:h.display_name,avatar:h.avatar,content:f,channel_label:h.channel_label,clan_logo:h.clan_logo,category_name:h.category_name,clan_nick:h.clan_nick,clan_avatar:h.clan_avatar,attachments:g,mentions:b,reactions:_,references:A,clan_id:h.clan_id,create_time_seconds:h.create_time_seconds,update_time_seconds:h.update_time_seconds,hide_editted:h.hide_editted})}),Promise.resolve(d)})})}listChannelVoiceUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelVoiceUsers(t,n).then(r=>{let o={voice_channel_users:[]};return r.voice_channel_users==null||r.voice_channel_users.forEach(a=>{o.voice_channel_users.push({id:a.id,channel_id:a.channel_id,user_ids:a.user_ids,room_name:a.room_name,share_screen_ids:a.share_screen_ids})}),Promise.resolve(o)})})}listChannelUsers(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(t,n,r,a,o,s).then(c=>{let d={channel_users:[],cursor:c.cursor,channel_id:c.channel_id};return c.channel_users==null||c.channel_users.forEach(h=>{d.channel_users.push({user_id:h.user_id,role_id:h.role_id,thread_id:h.thread_id,clan_avatar:h.clan_avatar,clan_nick:h.clan_nick,id:h.id,clan_id:h.clan_id,added_by:h.added_by,is_banned:h.is_banned})}),Promise.resolve(d)})})}listChannelAttachments(e,t,n,r,o,a,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(n,t,r,a,o,s,c).then(d=>{let h={attachments:[]};return d.attachments==null||d.attachments.forEach(f=>{h.attachments.push({filename:f.filename,filesize:f.filesize,filetype:f.filetype,id:f.id,uploader:f.uploader,url:f.url,message_id:f.message_id,create_time_seconds:f.create_time_seconds,width:f.width,height:f.height})}),Promise.resolve(h)})})}listClanUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsers(t).then(n=>{let r={clan_users:[],cursor:n.cursor,clan_id:n.clan_id};return n.clan_users==null||n.clan_users.forEach(o=>{var a;r.clan_users.push({user:{avatar_url:o.user.avatar_url,create_time_seconds:o.user.create_time_seconds,display_name:o.user.display_name,edge_count:o.user.edge_count?Number(o.user.edge_count):0,id:o.user.id,lang_tag:o.user.lang_tag,location:o.user.location,online:o.user.online,is_mobile:(a=o.user)==null?void 0:a.is_mobile,timezone:o.user.timezone,update_time:o.user.update_time,username:o.user.username,user_status:o.user.user_status,status:o.user.status,about_me:o.user.about_me,mezon_id:o.user.mezon_id,list_nick_names:o.user.list_nick_names,phone_number:o.user.phone_number,join_time_seconds:o.user.join_time_seconds},role_id:o.role_id,clan_nick:o.clan_nick,clan_avatar:o.clan_avatar})}),Promise.resolve(r)})})}listClanUsersStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsersStatus(t).then(n=>{let r={clan_user_statuses:[]};return n.clan_user_statuses==null||n.clan_user_statuses.forEach(o=>{r.clan_user_statuses.push({user_id:o.user_id,user_status:o.user_status})}),Promise.resolve(r)})})}listChannelDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDetail(t).then(n=>Promise.resolve(n))})}listChannelDescs(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDescs(t,n,r,o,a,s).then(c=>{let d={channeldesc:[],next_cursor:c.next_cursor,prev_cursor:c.prev_cursor,cacheable_cursor:c.cacheable_cursor};return c.channeldesc==null||(d.channeldesc=c.channeldesc),Promise.resolve(d)})})}listClanDescs(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanDescs(t,n,r).then(o=>{let a={clandesc:[]};return o.clandesc==null||(a.clandesc=o.clandesc),Promise.resolve(a)})})}listClanBadgeCount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanBadgeCount().then(t=>{var n;return{list_badge:(n=t.list_badge)!=null?n:[]}})})}listChannelBadgeCount(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelBadgeCount(t,n,r).then(o=>{var a;return{channeldesc:(a=o.channeldesc)!=null?a:[],total_count:o.total_count}})})}listUserOnline(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserOnline(t,n,r).then(o=>{var a;return{users:(a=o.users)!=null?a:[],total_count:o.total_count}})})}listCategoryDescs(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listCategoryDescs(t,n,r).then(o=>{let a={categorydesc:[]};return o.categorydesc==null||(a.categorydesc=o.categorydesc),Promise.resolve(a)})})}listEvents(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listEvents(t).then(n=>Promise.resolve(n))})}getListPermission(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListPermission(e.token).then(t=>Promise.resolve(t))})}listRolePermissions(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRolePermissions(t).then(n=>Promise.resolve(n))})}listRoleUsers(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoleUsers(t,n,r).then(o=>Promise.resolve(o))})}registFCMDeviceToken(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registFCMDeviceToken(t,n,r,o).then(a=>Promise.resolve(a))})}getUserProfileOnClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserProfileOnClan(t).then(n=>Promise.resolve(n))})}closeDirectMess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closeDirectMess(t).then(n=>n!==void 0)})}openDirectMess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.openDirectMess(t).then(n=>n!==void 0)})}confirmLinkMezonOTP(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLinkMezonOTP(t)})}linkSMS(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkSMS(t).then(n=>Promise.resolve(n))})}linkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkEmail(t).then(n=>Promise.resolve(n))})}listFriends(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listFriends(n,t,r).then(o=>{let a={friends:[],cursor:o.cursor};return o.friends==null||o.friends.forEach(s=>{var c;a.friends.push({user:{avatar_url:s.user.avatar_url,create_time_seconds:s.user.create_time_seconds,display_name:s.user.display_name,edge_count:s.user.edge_count?Number(s.user.edge_count):0,id:s.user.id,lang_tag:s.user.lang_tag,location:s.user.location,online:s.user.online,timezone:s.user.timezone,update_time:s.user.update_time,username:s.user.username,is_mobile:(c=s.user)==null?void 0:c.is_mobile,user_status:s.user.user_status,status:s.user.status,mezon_id:s.user.mezon_id,list_nick_names:s.user.list_nick_names,phone_number:s.user.phone_number,about_me:s.user.about_me},state:s.state,source_id:s.source_id})}),Promise.resolve(a)})})}listNotifications(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listNotifications(n,t,r,o,a).then(s=>{let c={cacheable_cursor:s.cacheable_cursor,notifications:[]};return s.notifications==null||s.notifications.forEach(d=>{c.notifications.push({id:d.id,subject:d.subject,content:d.content?G(d.content):void 0,code:d.code?Number(d.code):0,sender_id:d.sender_id,create_time_seconds:d.create_time_seconds,persistent:d.persistent,category:d.category})}),Promise.resolve(c)})})}sessionLogout(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sessionLogout({refresh_token:n,token:t,device_id:r,platform:o}).then(a=>a!==void 0)})}unlinkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkEmail(t).then(n=>n!==void 0)})}unlinkMezon(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkMezon(t).then(n=>n!==void 0)})}updateUsername(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUsername(t).then(n=>Promise.resolve(n))})}updateAccount(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateAccount(t).then(n=>n!==void 0)})}updateChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelDesc(t,n).then(r=>r!==void 0)})}updateClanDesc(e,t,n){return l(this,null,function*(){this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e));let r=v({},n);return r.hashtags!==void 0&&(r.hashtags=I(r.hashtags)),this.transport.updateClanDesc(t,r).then(o=>o!==void 0)})}updateCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategory(t,n).then(r=>r!==void 0)})}updateUserProfileByClan(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserProfileByClan(t,n).then(r=>r!==void 0)})}updateRole(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRole(t,n).then(()=>!0)})}updateEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEvent(t,n).then(r=>r!==void 0)})}updateApp(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateApp(t,n).then(r=>Promise.resolve(r))})}createLinkInviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createLinkInviteUser(t).then(n=>Promise.resolve(n))})}getLinkInvite(e){return l(this,null,function*(){return this.transport.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getRoleOfUserInTheClan(t).then(n=>Promise.resolve(n))})}inviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.inviteUser(t).then(n=>Promise.resolve(n))})}setNotificationClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationClanSetting(t).then(n=>n!==void 0)})}setNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationChannelSetting(t).then(n=>n!==void 0)})}setMuteCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteCategory(t).then(n=>n!==void 0)})}setMuteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteChannel(t).then(n=>n!==void 0)})}updateChannelPrivate(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelPrivate(t).then(n=>n!==void 0)})}setNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationChannel(t).then(n=>n!==void 0)})}setNotificationReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationReactMessage({channel_id:t}).then(n=>n!==void 0)})}deleteNotiReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotiReactMessage(t).then(n=>n!==void 0)})}searchMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMessage(t).then(n=>Promise.resolve(n))})}searchCtrlK(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchCtrlK(t).then(n=>Promise.resolve(n))})}searchMentionUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMentionUsers(t).then(n=>Promise.resolve(n))})}generateCDNSignature(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateCDNSignature(t).then(n=>Promise.resolve(n))})}getStreamPlayback(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getStreamPlayback(t).then(n=>Promise.resolve(n))})}setOverrideEveryoneChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setOverrideEveryoneChannel(t).then(n=>Promise.resolve(n))})}getOverrideEveryoneChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOverrideEveryoneChannel(t).then(n=>Promise.resolve(n))})}getDMSetting(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getDMSetting().then(t=>Promise.resolve(t))})}updateDMSetting(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateDMSetting(t).then(n=>Promise.resolve(n))})}createMessage2Inbox(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createMessage2Inbox(t).then(n=>Promise.resolve(n))})}createPinMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPinMessage(t).then(n=>Promise.resolve(n))})}pinMessagesList(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPinMessagesList(t,n,r).then(o=>{let a={pin_messages_list:[]};return o.pin_messages_list==null||o.pin_messages_list.forEach(s=>{a.pin_messages_list.push({id:s.id,avatar:s.avatar,channel_id:s.channel_id,content:s.content,create_time_seconds:s.create_time_seconds,message_id:s.message_id,sender_id:s.sender_id,username:s.username,attachment:s.attachment})}),Promise.resolve(a)})})}deletePinMessage(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deletePinMessage(t,n,r,o).then(a=>a!==void 0)})}createClanEmoji(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanEmoji(t).then(n=>n!==void 0)})}updateClanEmojiById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanEmojiById(t,n).then(r=>r!==void 0)})}deleteByIdClanEmoji(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanEmojiById(t,n,r).then(o=>o!==void 0)})}generateWebhookLink(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateWebhook(t).then(n=>Promise.resolve(n))})}listWebhookByChannelId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listWebhookByChannelId(t,n).then(r=>Promise.resolve(r))})}updateWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateWebhookById(t,n).then(r=>r!==void 0)})}deleteWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteWebhookById(t,n).then(r=>r!==void 0)})}addClanSticker(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addClanSticker(t).then(n=>n!==void 0)})}deleteClanStickerById(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanStickerById(t,n,r).then(o=>o!==void 0)})}updateClanStickerById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanStickerById(t,n).then(r=>r!==void 0)})}changeChannelCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.changeChannelCategory(t,n).then(r=>r!==void 0)})}setRoleChannelPermission(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setRoleChannelPermission(t).then(n=>n!==void 0)})}addApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addApp(t).then(n=>Promise.resolve(n))})}getApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getApp(t).then(n=>Promise.resolve(n))})}listApps(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listApps(e.token).then(t=>Promise.resolve(t))})}addAppToClan(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAppToClan(t,n).then(r=>r!==void 0)})}getSystemMessagesList(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessagesList(e.token).then(t=>Promise.resolve(t))})}getSystemMessageByClanId(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessageByClanId(t).then(n=>Promise.resolve(n))})}createSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSystemMessage(t).then(n=>Promise.resolve(n))})}updateSystemMessage(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateSystemMessage(t,n).then(r=>Promise.resolve(r))})}deleteSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSystemMessage(t).then(n=>Promise.resolve(n))})}updateCategoryOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategoryOrder(t).then(n=>Promise.resolve(n))})}listStreamingChannelUsers(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(t,n,r,a,o,s).then(c=>{let d={streaming_channel_users:[]};return c.streaming_channel_users==null||c.streaming_channel_users.forEach(h=>{d.streaming_channel_users.push({id:h.id,channel_id:h.channel_id,user_id:h.user_id,participant:h.participant,is_publisher:h.is_publisher})}),Promise.resolve(d)})})}registerStreamingChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registerStreamingChannel(t).then(n=>n!==void 0)})}listChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelApps(t).then(n=>{let r={channel_apps:[]};return n.channel_apps==null||n.channel_apps.forEach(o=>{r.channel_apps.push({id:o.id,channel_id:o.channel_id,app_id:o.app_id,clan_id:o.clan_id,app_url:o.app_url,app_name:o.app_name,app_logo:o.app_logo})}),Promise.resolve(r)})})}getChannelCategoryNotiSettingsList(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCategoryNotiSettingsList(t).then(n=>Promise.resolve(n))})}getNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationCategory(t).then(n=>Promise.resolve(n))})}getNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationChannel(t).then(n=>Promise.resolve(n))})}getNotificationClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationClan(t).then(n=>Promise.resolve(n))})}getNotificationReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationReactMessage(t).then(n=>Promise.resolve(n))})}listChannelByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelByUserId(e.token).then(t=>Promise.resolve(t))})}listChannelUsersUC(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsersUC(t,n).then(r=>Promise.resolve(r))})}getListEmojisByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListEmojisByUserId(e.token).then(t=>Promise.resolve(t))})}emojiRecentList(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.emojiRecentList(e.token).then(t=>Promise.resolve(t))})}getListStickersByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListStickersByUserId(e.token).then(t=>Promise.resolve(t))})}listUserClansByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserClansByUserId(e.token).then(t=>Promise.resolve(t))})}listRoles(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoles(t,n,r,o).then(a=>{let s={clan_id:t,roles:a.roles};return Promise.resolve(s)})})}listUserPermissionInChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserPermissionInChannel(t,n).then(r=>{let o={clan_id:t,channel_id:n,permissions:r.permissions};return Promise.resolve(o)})})}getPermissionByRoleIdChannelId(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPermissionByRoleIdChannelId(t,n,r).then(o=>{let a={role_id:t,channel_id:n,permission_role_channel:o.permission_role_channel,user_id:r};return Promise.resolve(a)})})}markAsRead(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.markAsRead(t).then(n=>Promise.resolve(n))})}listThreadDescs(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listThreadDescs(t,n,r,o,a,s).then(c=>{let d={channeldesc:[]};return c.channeldesc==null||(d.channeldesc=c.channeldesc),Promise.resolve(d)})})}listChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelTimeline(t).then(n=>{var r;return(r=n.events)==null||r.forEach(o=>{o.attachments=[];let a;try{let s=T(o.preview_imgs);a=(s==null?void 0:s.attachments)||s||P(o.preview_imgs||"[]")}catch(s){a=P(o.preview_imgs||"[]")}Array.isArray(a)?o.preview_imgs=a:o.preview_imgs=[]}),Promise.resolve(n)})})}createChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let s=T(r.attachments),c=T(r.preview_imgs);o=(s==null?void 0:s.attachments)||s||P(r.attachments||"[]"),a=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(s){o=P(r.attachments||"[]"),a=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(a)?r.preview_imgs=a:r.preview_imgs=[]}return Promise.resolve(n)})})}updateChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let s=T(r.attachments),c=T(r.preview_imgs);o=(s==null?void 0:s.attachments)||s||P(r.attachments||"[]"),a=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(s){o=P(r.attachments||"[]"),a=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(a)?r.preview_imgs=a:r.preview_imgs=[]}return Promise.resolve(n)})})}detailChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.detailChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let s=T(r.attachments),c=T(r.preview_imgs);o=(s==null?void 0:s.attachments)||s||P(r.attachments||"[]"),a=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(s){o=P(r.attachments||"[]"),a=P(r.preview_imgs||"[]")}Array.isArray(o)?r.attachments=o:r.attachments=[],Array.isArray(a)?r.preview_imgs=a:r.preview_imgs=[]}return Promise.resolve(n)})})}leaveThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveThread(t,n).then(r=>Promise.resolve(r))})}archiveChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.archiveChannel(t,n).then(r=>Promise.resolve(r))})}listArchivedChannelDescs(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listArchivedChannelDescs(t).then(n=>Promise.resolve(n))})}getChannelSettingInClan(e,t,n,r,o,a,s,c,d,h,f){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelSetting(t,n,r,o,a,s,c,d,h,f).then(_=>Promise.resolve(_))})}getChannelCanvasList(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasList(t,n,r,o).then(a=>{let s={channel_canvases:[]};return a.channel_canvases==null||(s.clan_id=a.clan_id,s.channel_id=a.channel_id,s.channel_canvases=a.channel_canvases,s.count=a.count),Promise.resolve(s)})})}getChannelCanvasDetail(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasDetail(t,n,r).then(o=>Promise.resolve(o))})}editChannelCanvases(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.editChannelCanvases(t).then(n=>Promise.resolve(n))})}deleteChannelCanvas(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelCanvas(t,n,r).then(o=>o!==void 0)})}addFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelFavorite({channel_id:t,clan_id:n}).then(r=>r)})}removeFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelFavorite(t,n).then(r=>r)})}getListFavoriteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListFavoriteChannel(t).then(n=>n)})}listActivity(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listActivity(e.token).then(t=>t)})}createActiviy(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createActiviy(t).then(n=>n)})}createQRLogin(e){return l(this,null,function*(){let t=yield this.transport.createQRLogin(this.serverkey,"",e);return{login_id:t.login_id,create_time_second:t.create_time_second}})}checkLoginRequest(e){return l(this,null,function*(){let t=yield this.transport.checkLoginRequest(this.serverkey,"",e);return t!=null&&t.token?{token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}:null})}confirmLogin(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLogin(t).then(n=>n)})}getChanEncryptionMethod(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChanEncryptionMethod(t).then(n=>n)})}setChanEncryptionMethod(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setChanEncryptionMethod(t,{method:n}).then(r=>r)})}getPubKeys(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPubKeys(t).then(n=>n)})}pushPubKey(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.pushPubKey({PK:t}).then(n=>n)})}getKeyServer(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getKeyServer(e.token).then(t=>t)})}listAuditLog(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listAuditLog(t,n,r,o).then(a=>a)})}listOnboarding(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboarding(t,n,r,o).then(a=>a)})}getOnboardingDetail(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOnboardingDetail(t,n).then(r=>Promise.resolve(r))})}createOnboarding(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createOnboarding(t).then(n=>n)})}updateOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboarding(t,n).then(r=>r!==void 0)})}deleteOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteOnboarding(t,n).then(r=>r!==void 0)})}generateClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateClanWebhook(t).then(n=>Promise.resolve(n))})}listClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanWebhook(t).then(n=>Promise.resolve(n))})}deleteClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanWebhookById(t,n).then(r=>r!==void 0)})}updateClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanWebhookById(t,n).then(r=>r!==void 0)})}listOnboardingStep(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboardingStep(t,n,r).then(o=>Promise.resolve(o))})}updateOnboardingStepByClanId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboardingStepByClanId(t,n).then(r=>r!==void 0)})}updateUserStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserStatus(t).then(n=>n!==void 0)})}updateUserCustomStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserCustomStatus(t).then(n=>n!==void 0)})}getUserStatus(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserStatus(e.token).then(t=>Promise.resolve(t))})}listSdTopic(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listSdTopic(t,n,r).then(o=>Promise.resolve(o))})}createSdTopic(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSdTopic(t).then(n=>n)})}deleteSdTopic(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSdTopic(t)})}getTopicDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getTopicDetail(t).then(n=>Promise.resolve(n))})}createRoomChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRoomChannelApps(t).then(n=>Promise.resolve(n))})}generateMeetToken(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateMeetToken(t).then(n=>Promise.resolve(n))})}listMezonOauthClient(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMezonOauthClient(e.token).then(t=>Promise.resolve(t))})}getMezonOauthClient(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getMezonOauthClient(t,n).then(r=>Promise.resolve(r))})}updateMezonOauthClient(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonOauthClient(t).then(n=>Promise.resolve(n))})}searchThread(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchThread(t,n,r).then(o=>Promise.resolve(o))})}generateHashChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateHashChannelApps(t).then(n=>Promise.resolve(n))})}registrationPassword(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registrationEmail({email:t,password:n,old_password:r}).then(o=>Promise.resolve(o))})}addUserEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addUserEvent(t).then(n=>n!==void 0)})}deleteUserEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteUserEvent(t,n).then(r=>r!==void 0)})}updateRoleOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRoleOrder(t).then(n=>Promise.resolve(n))})}deleteAccount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteAccount(e.token).then(t=>Promise.resolve(t))})}createExternalMezonMeet(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createExternalMezonMeet(e.token).then(t=>Promise.resolve(t))})}generateMeetTokenExternal(e,t,n,r){return l(this,null,function*(){return this.transport.generateMeetTokenExternal(e,t,n,r).then(o=>Promise.resolve(o))})}removeMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}muteMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.muteParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}updateClanOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanOrder(t).then(n=>n!==void 0)})}listClanDiscover(e){return l(this,null,function*(){let t=v({},e);return t.hashtags!==void 0&&(t.hashtags=I(t.hashtags)),this.transport.clanDiscover(this.serverkey,"",t).then(n=>Promise.resolve(n))})}listQuickMenuAccess(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listQuickMenuAccess(t,n,r).then(o=>Promise.resolve(o))})}deleteQuickMenuAccess(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteQuickMenuAccess(t,n).then(r=>r!==void 0)})}addQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addQuickMenuAccess(t).then(n=>n!==void 0)})}updateQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateQuickMenuAccess(t).then(n=>n!==void 0)})}listForSaleItems(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listForSaleItems(t).then(n=>Promise.resolve(n))})}isFollower(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isFollower(t).then(n=>Promise.resolve(n))})}transferOwnership(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.transferOwnership(t).then(n=>n!==void 0)})}isBanned(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isBanned(t).then(n=>Promise.resolve(n))})}reportMessageAbuse(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.reportMessageAbuse(t,n).then(r=>r!==void 0)})}updateMezonVoiceState(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonVoiceState(t,n,r,o,a).then(s=>s!==void 0)})}sendChannelMessage(e,t,n,r,o,a,s,c,d,h,f,_,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendChannelMessage(t,n,r,o,a,s,c,d,h,f,_,b,g).then(A=>Promise.resolve(A))})}sendChannelMessageApi(e,t,n,r,o,a,s,c,d,h,f,_,b,g){return l(this,null,function*(){return this.transport.sendChannelMessageApi(e,t,n,r,o,a,s,c,d,h,f,_,b,g).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,n,r,o,a,s,c,d,h,f,_,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(t,n,r,o,a,s,c,d,h,f,_,b).then(g=>Promise.resolve(g))})}deleteChannelMessage(e,t,n,r,o,a,s,c,d,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelMessage(t,n,r,o,a,s,c,d,h).then(f=>Promise.resolve(f))})}messageButtonClick(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.messageButtonClick(t,n,r,o,a,s).then(c=>Promise.resolve(c))})}dropdownBoxSelected(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.dropdownBoxSelected(t,n,r,o,a,s).then(c=>Promise.resolve(c))})}activeArchivedThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.activeArchivedThread(t,n).then(r=>Promise.resolve(r))})}addAgentToChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAgentToChannel(t,n).then(r=>Promise.resolve(r))})}disconnectAgent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.disconnectAgent(t,n).then(r=>Promise.resolve(r))})}listMutedChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMutedChannel(t).then(n=>Promise.resolve(n))})}channelMessageReact(e,t,n,r,o,a,s,c,d,h,f,_,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.channelMessageReact(t,n,r,o,a,s,c,d,h,f,_,b,g).then(A=>Promise.resolve(A))})}createPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPoll(t)})}votePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.votePoll(t)})}closePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closePoll(t)})}getPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPoll(t)})}followUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.followUsers(t)})}joinClanChat(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinClanChat(t)})}follower(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.follower()})}joinChat(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinChat(t,n,r,o)})}leaveChat(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveChat(t,n,r,o)})}removeChatMessage(e,t,n,r,o,a,s,c,d,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChatMessage(t,n,r,o,a,s,c,d,h)})}unfollowUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unfollowUsers(t)})}updateChatMessage(e,t,n,r,o,a,s,c,d,h,f,_,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,r,o,a,s,c,d,h,f,_,b)})}updateStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateStatus(t)})}writeQuickMenuEvent(e,t,n,r,o,a,s,c,d,h,f,_,b,g,A,C,R){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeQuickMenuEvent(t,n,r,o,a,s,c,d,h,f,_,b,g,A,C,R)})}writeEphemeralMessage(e,t,n,r,o,a,s,c,d,h,f,_,b,g,A,C){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeEphemeralMessage(t,n,r,o,a,s,c,d,h,f,_,b,g,A,C)})}writeChatMessage(e,t,n,r,o,a,s,c,d,h,f,_,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChatMessage(t,n,r,o,a,s,c,d,h,f,_,b,g)})}writeMessageReaction(e,t,n,r,o,a,s,c,d,h,f,_,b,g,A){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageReaction(t,n,r,o,a,s,c,d,h,f,_,b,g,A)})}writeMessageTyping(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageTyping(t,n,r,o,a,s)})}writeLastSeenMessage(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastSeenMessage(t,n,r,o,a,s)})}writeLastPinMessage(e,t,n,r,o,a,s,c,d,h,f,_,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastPinMessage(t,n,r,o,a,s,c,d,h,f,_,b,g)})}writeCustomStatus(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeCustomStatus(t,n,r,o)})}writeVoiceReaction(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceReaction(t,n)})}writeVoiceInteractiveEvent(e,t,n,r,o,a,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceInteractiveEvent(t,n,r,o,a,s)})}forwardWebrtcSignaling(e,t,n,r,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,r,o,a)})}makeCallPush(e,t,n,r,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.makeCallPush(t,n,r,o)})}writeChannelAppEvent(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChannelAppEvent(t,n,r)})}writeStreamingWatch(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeStreamingWatch(t,n)})}listLogedDevice(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listLogedDevice()})}refreshSession(e){return l(this,null,function*(){return this.transport.sessionRefresh(this.serverkey,"",e).then(t=>({token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}))})}};q.DefaultHeartbeatIntervalMs=1e4,q.DefaultHeartbeatTimeoutMs=1e4,q.DefaultConnectTimeoutMs=3e4,q.DefaultServerDisconnectStreakLogoutThreshold=3;var ee=q;
|