mezon-js 2.15.29 → 2.15.31

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.
@@ -1 +1 @@
1
- "use strict";var se=Object.create;var L=Object.defineProperty,ie=Object.defineProperties,re=Object.getOwnPropertyDescriptor,oe=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols,ce=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var J=(_,e,t)=>e in _?L(_,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):_[e]=t,S=(_,e)=>{for(var t in e||(e={}))V.call(e,t)&&J(_,t,e[t]);if(j)for(var t of j(e))le.call(e,t)&&J(_,t,e[t]);return _},w=(_,e)=>ie(_,oe(e));var de=(_,e)=>{for(var t in e)L(_,t,{get:e[t],enumerable:!0})},Q=(_,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ae(e))!V.call(_,o)&&o!==t&&L(_,o,{get:()=>e[o],enumerable:!(n=re(e,o))||n.enumerable});return _};var K=(_,e,t)=>(t=_!=null?se(ce(_)):{},Q(e||!_||!_.__esModule?L(t,"default",{value:_,enumerable:!0}):t,_)),ue=_=>Q(L({},"__esModule",{value:!0}),_);var l=(_,e,t)=>new Promise((n,o)=>{var a=i=>{try{r(t.next(i))}catch(d){o(d)}},c=i=>{try{r(t.throw(i))}catch(d){o(d)}},r=i=>i.done?n(i.value):Promise.resolve(i.value).then(a,c);r((t=t.apply(_,e)).next())});var Re={};de(Re,{ApiAppRole:()=>Y,ChannelStreamMode:()=>Z,ChannelType:()=>$,Client:()=>G,ConnectionState:()=>h,CreateChannelMessageFromEvent:()=>H,NotificationType:()=>X,WebrtcSignalingType:()=>ee,b64DecodeUnicode:()=>he,b64EncodeUnicode:()=>pe,buildFetchOptions:()=>m,decodeAttachments:()=>D,decodeChannelTimelineAttachments:()=>q,decodeMentions:()=>U,decodeNotificationFcm:()=>W,decodeReactions:()=>z,decodeRefs:()=>F,encodeAttachments:()=>ge,encodeMentions:()=>me,encodeNotificationFcm:()=>ye,encodeReactions:()=>fe,encodeRefs:()=>_e,safeJSONParse:()=>P});module.exports=ue(Re);var mr=require("whatwg-fetch");var B=require("js-base64"),R=K(require("mezon-js-protobuf"));function m(_,e,t){let n=S({method:_},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(o=>{n.headers[o]||delete n.headers[o]}),t&&(n.body=t),n}function pe(_){return(0,B.encode)(encodeURIComponent(_).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function he(_){return decodeURIComponent((0,B.decode)(_).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function P(_){if(_==null)return{t:_};let e;if(_ instanceof Uint8Array)e=new TextDecoder().decode(_);else if(typeof _=="string")e=_;else return typeof _=="object"?_:{t:_};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 E=_=>!_||_===null||_===void 0||_===""||_==="[]";function U(_){if(E(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,o=new Uint8Array(n);return R.MessageMentionList.decode(o)}catch(n){return P(_)}}function D(_){if(E(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,o=new Uint8Array(n);return R.MessageAttachmentList.decode(o)}catch(n){return P(_)}}function q(_){if(E(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,o=new Uint8Array(n);return R.ListChannelTimelineAttachment.decode(o)}catch(n){return P(_)}}function F(_){if(E(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,o=new Uint8Array(n);return R.MessageRefList.decode(o)}catch(n){return P(_)}}function z(_){if(E(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,o=new Uint8Array(n);return R.MessageReactionList.decode(o)}catch(n){return P(_)}}function W(_){if(E(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,o=new Uint8Array(n);return R.DirectFcmProto.decode(o)}catch(n){return P(_)}}function me(_){return R.MessageMentionList.encode(R.MessageMentionList.fromPartial(_)).finish()}function ge(_){return R.MessageAttachmentList.encode(R.MessageAttachmentList.fromPartial(_)).finish()}function _e(_){return R.MessageRefList.encode(R.MessageRefList.fromPartial(_)).finish()}function fe(_){return R.MessageReactionList.encode(R.MessageReactionList.fromPartial(_)).finish()}function ye(_){return R.DirectFcmProto.encode(R.DirectFcmProto.fromPartial(_)).finish()}var Y=(a=>(a[a.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",a[a.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",a[a.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",a[a.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",a[a.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",a))(Y||{}),$=(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))($||{}),Z=(a=>(a[a.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",a[a.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",a[a.STREAM_MODE_DM=4]="STREAM_MODE_DM",a[a.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",a[a.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",a))(Z||{}),X=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(X||{}),ee=(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))(ee||{});function H(_){let e,t,n,o,a,c;try{e=P(_.channel_message.content)}catch(i){console.log("content is invalid",i)}try{t=z(_.channel_message.reactions)}catch(i){console.log("reactions is invalid",i)}try{n=U(_.channel_message.mentions)}catch(i){console.log("mentions is invalid",i)}try{o=D(_.channel_message.attachments)}catch(i){console.log("attachments is invalid",i)}try{a=F(_.channel_message.references)}catch(i){console.log("references is invalid",i)}try{c=_.channel_message.referenced_message}catch(i){console.log("referenced messages is invalid",i)}return{id:_.id||_.channel_message.message_id,avatar:_.channel_message.avatar,channel_id:_.channel_message.channel_id,mode:_.channel_message.mode,channel_label:_.channel_message.channel_label,clan_id:_.channel_message.clan_id,code:_.channel_message.code,message_id:_.channel_message.message_id,sender_id:_.channel_message.sender_id,update_time:_.channel_message.update_time,clan_logo:_.channel_message.clan_logo,category_name:_.channel_message.category_name,username:_.channel_message.username,clan_nick:_.channel_message.clan_nick,clan_avatar:_.channel_message.clan_avatar,display_name:_.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:n==null?void 0:n.mentions,attachments:o==null?void 0:o.attachments,referenced_message:c,references:a==null?void 0:a.refs,hide_editted:_.channel_message.hide_editted,is_public:_.channel_message.is_public,create_time_seconds:_.channel_message.create_time_seconds,update_time_seconds:_.channel_message.update_time_seconds,topic_id:_.channel_message.topic_id}}var k=require("js-base64"),s=K(require("mezon-js-protobuf")),te=require("mezon-js-protobuf");var I=(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.ListChannelBadgeCount=17]="ListChannelBadgeCount",u[u.ListClanUsersStatus=18]="ListClanUsersStatus",u[u.ListChannelApps=19]="ListChannelApps",u[u.GetListFavoriteChannel=20]="GetListFavoriteChannel",u[u.ListCategoryDescs=21]="ListCategoryDescs",u[u.ListOnboarding=22]="ListOnboarding",u[u.GetListStickersByUserId=23]="GetListStickersByUserId",u[u.GetSystemMessageByClanId=24]="GetSystemMessageByClanId",u[u.GetPinMessagesList=25]="GetPinMessagesList",u[u.GetChannelCanvasList=26]="GetChannelCanvasList",u[u.ListChannelTimeline=27]="ListChannelTimeline",u[u.ListChannelMessages=28]="ListChannelMessages",u[u.ListActivity=29]="ListActivity",u[u.ListChannelByUserId=30]="ListChannelByUserId",u[u.ListUserClansByUserId=31]="ListUserClansByUserId",u[u.GetUserProfileOnClan=32]="GetUserProfileOnClan",u[u.RegistFCMDeviceToken=33]="RegistFCMDeviceToken",u[u.IsBanned=34]="IsBanned",u[u.ListThreadDescs=35]="ListThreadDescs",u[u.ListArchivedChannelDescs=36]="ListArchivedChannelDescs",u[u.ListChannelDetail=37]="ListChannelDetail",u[u.GetChannelCategoryNotiSettingsList=38]="GetChannelCategoryNotiSettingsList",u[u.ListRoleUsers=39]="ListRoleUsers",u[u.ListChannelUsers=40]="ListChannelUsers",u[u.ListChannelAttachment=41]="ListChannelAttachment",u[u.ListChannelVoiceUsers=42]="ListChannelVoiceUsers",u[u.ListUserOnline=43]="ListUserOnline",u[u.ListNotifications=44]="ListNotifications",u[u.ListChannelUsersUC=45]="ListChannelUsersUC",u[u.ListWebhookByChannelId=46]="ListWebhookByChannelId",u[u.GetPermissionByRoleIdChannelId=47]="GetPermissionByRoleIdChannelId",u[u.ListChannelSetting=48]="ListChannelSetting",u[u.ListApps=49]="ListApps",u[u.GetApp=50]="GetApp",u[u.ListForSaleItems=51]="ListForSaleItems",u[u.ListClanWebhook=52]="ListClanWebhook",u[u.GetUserStatus=53]="GetUserStatus",u[u.ListSdTopic=54]="ListSdTopic",u[u.AddFriends=55]="AddFriends",u[u.AddChannelUsers=56]="AddChannelUsers",u[u.RegistrationEmail=57]="RegistrationEmail",u[u.BlockFriends=58]="BlockFriends",u[u.UnblockFriends=59]="UnblockFriends",u[u.UploadAttachmentFile=60]="UploadAttachmentFile",u[u.UploadOauthFile=61]="UploadOauthFile",u[u.AddRolesChannelDesc=62]="AddRolesChannelDesc",u[u.CreateCategoryDesc=63]="CreateCategoryDesc",u[u.CreateChannelDesc=64]="CreateChannelDesc",u[u.CreateRole=65]="CreateRole",u[u.CreateEvent=66]="CreateEvent",u[u.DeleteRole=67]="DeleteRole",u[u.DeleteEvent=68]="DeleteEvent",u[u.DeleteRoleChannelDesc=69]="DeleteRoleChannelDesc",u[u.DeleteChannelDesc=70]="DeleteChannelDesc",u[u.CloseDMByChannelId=71]="CloseDMByChannelId",u[u.OpenDMByChannelId=72]="OpenDMByChannelId",u[u.DeleteAccount=73]="DeleteAccount",u[u.DeleteFriends=74]="DeleteFriends",u[u.DeleteCategoryDesc=75]="DeleteCategoryDesc",u[u.DeleteNotifications=76]="DeleteNotifications",u[u.DeleteClanDesc=77]="DeleteClanDesc",u[u.UpdateUser=78]="UpdateUser",u[u.UpdateUserProfileByClan=79]="UpdateUserProfileByClan",u[u.UpdateClanOrder=80]="UpdateClanOrder",u[u.RemoveChannelUsers=81]="RemoveChannelUsers",u[u.LeaveThread=82]="LeaveThread",u[u.ArchiveChannel=83]="ArchiveChannel",u[u.LinkSMS=84]="LinkSMS",u[u.ConfirmLinkMezonOTP=85]="ConfirmLinkMezonOTP",u[u.LinkEmail=86]="LinkEmail",u[u.CreateClanDesc=87]="CreateClanDesc",u[u.RemoveClanUsers=88]="RemoveClanUsers",u[u.BanClanUsers=89]="BanClanUsers",u[u.CreateLinkInviteUser=90]="CreateLinkInviteUser",u[u.InviteUser=91]="InviteUser",u[u.SetRoleChannelPermission=92]="SetRoleChannelPermission",u[u.SetNotificationChannelSetting=93]="SetNotificationChannelSetting",u[u.SetMuteChannel=94]="SetMuteChannel",u[u.SetMuteCategory=95]="SetMuteCategory",u[u.SetNotificationClanSetting=96]="SetNotificationClanSetting",u[u.SetNotificationCategorySetting=97]="SetNotificationCategorySetting",u[u.DeleteNotificationCategorySetting=98]="DeleteNotificationCategorySetting",u[u.DeleteNotificationChannel=99]="DeleteNotificationChannel",u[u.CreatePinMessage=100]="CreatePinMessage",u[u.CreateMessage2Inbox=101]="CreateMessage2Inbox",u[u.UnlinkMezon=102]="UnlinkMezon",u[u.UnlinkEmail=103]="UnlinkEmail",u[u.UpdateAccount=104]="UpdateAccount",u[u.UpdateUsername=105]="UpdateUsername",u[u.UpdateCategory=106]="UpdateCategory",u[u.UpdateCategoryOrder=107]="UpdateCategoryOrder",u[u.UpdateRoleOrder=108]="UpdateRoleOrder",u[u.UpdateClanDesc=109]="UpdateClanDesc",u[u.UpdateChannelDesc=110]="UpdateChannelDesc",u[u.UpdateChannelPrivate=111]="UpdateChannelPrivate",u[u.UpdateRole=112]="UpdateRole",u[u.UpdateEvent=113]="UpdateEvent",u[u.SearchMessage=114]="SearchMessage",u[u.CreateClanEmoji=115]="CreateClanEmoji",u[u.DeleteByIdClanEmoji=116]="DeleteByIdClanEmoji",u[u.UpdateClanEmojiById=117]="UpdateClanEmojiById",u[u.GenerateWebhook=118]="GenerateWebhook",u[u.HandleWebhook=119]="HandleWebhook",u[u.UpdateWebhookById=120]="UpdateWebhookById",u[u.DeleteWebhookById=121]="DeleteWebhookById",u[u.AddClanSticker=122]="AddClanSticker",u[u.UpdateClanStickerById=123]="UpdateClanStickerById",u[u.DeleteClanStickerById=124]="DeleteClanStickerById",u[u.ChangeChannelCategory=125]="ChangeChannelCategory",u[u.CheckDuplicateName=126]="CheckDuplicateName",u[u.AddApp=127]="AddApp",u[u.DeleteApp=128]="DeleteApp",u[u.UpdateApp=129]="UpdateApp",u[u.AddAppToClan=130]="AddAppToClan",u[u.CreateSystemMessage=131]="CreateSystemMessage",u[u.UpdateSystemMessage=132]="UpdateSystemMessage",u[u.DeleteSystemMessage=133]="DeleteSystemMessage",u[u.StreamingServerCallback=134]="StreamingServerCallback",u[u.EditChannelCanvases=135]="EditChannelCanvases",u[u.GetChannelCanvasDetail=136]="GetChannelCanvasDetail",u[u.DeleteChannelCanvas=137]="DeleteChannelCanvas",u[u.AddChannelFavorite=138]="AddChannelFavorite",u[u.RemoveChannelFavorite=139]="RemoveChannelFavorite",u[u.CreateActiviy=140]="CreateActiviy",u[u.GetPubKeys=141]="GetPubKeys",u[u.PushPubKey=142]="PushPubKey",u[u.GetChanEncryptionMethod=143]="GetChanEncryptionMethod",u[u.SetChanEncryptionMethod=144]="SetChanEncryptionMethod",u[u.GetKeyServer=145]="GetKeyServer",u[u.ListAuditLog=146]="ListAuditLog",u[u.GetOnboardingDetail=147]="GetOnboardingDetail",u[u.CreateOnboarding=148]="CreateOnboarding",u[u.UpdateOnboarding=149]="UpdateOnboarding",u[u.DeleteOnboarding=150]="DeleteOnboarding",u[u.ListOnboardingStep=151]="ListOnboardingStep",u[u.UpdateOnboardingStep=152]="UpdateOnboardingStep",u[u.GenerateClanWebhook=153]="GenerateClanWebhook",u[u.UpdateClanWebhookById=154]="UpdateClanWebhookById",u[u.DeleteClanWebhookById=155]="DeleteClanWebhookById",u[u.HandleClanWebhook=156]="HandleClanWebhook",u[u.UpdateUserStatus=157]="UpdateUserStatus",u[u.UpdateUserCustomStatus=158]="UpdateUserCustomStatus",u[u.GetTopicDetail=159]="GetTopicDetail",u[u.CreateSdTopic=160]="CreateSdTopic",u[u.DeleteSdTopic=161]="DeleteSdTopic",u[u.CreateExternalMezonMeet=162]="CreateExternalMezonMeet",u[u.GenerateMeetToken=163]="GenerateMeetToken",u[u.RemoveParticipantMezonMeet=164]="RemoveParticipantMezonMeet",u[u.MuteParticipantMezonMeet=165]="MuteParticipantMezonMeet",u[u.CreateRoomChannelApps=166]="CreateRoomChannelApps",u[u.GetMezonOauthClient=167]="GetMezonOauthClient",u[u.DeleteMezonOauthClient=168]="DeleteMezonOauthClient",u[u.UpdateMezonOauthClient=169]="UpdateMezonOauthClient",u[u.SearchThread=170]="SearchThread",u[u.GenerateHashChannelApps=171]="GenerateHashChannelApps",u[u.DeleteUserEvent=172]="DeleteUserEvent",u[u.AddUserEvent=173]="AddUserEvent",u[u.DeleteQuickMenuAccess=174]="DeleteQuickMenuAccess",u[u.AddQuickMenuAccess=175]="AddQuickMenuAccess",u[u.UpdateQuickMenuAccess=176]="UpdateQuickMenuAccess",u[u.TransferOwnership=177]="TransferOwnership",u[u.SendChannelMessage=178]="SendChannelMessage",u[u.UpdateChannelMessage=179]="UpdateChannelMessage",u[u.DeleteChannelMessage=180]="DeleteChannelMessage",u[u.ReportMessageAbuse=181]="ReportMessageAbuse",u[u.MessageButtonClick=182]="MessageButtonClick",u[u.DropdownBoxSelected=183]="DropdownBoxSelected",u[u.ActiveArchivedThread=184]="ActiveArchivedThread",u[u.UpdateChannelTimeline=185]="UpdateChannelTimeline",u[u.AddAgentToChannel=186]="AddAgentToChannel",u[u.DisconnectAgent=187]="DisconnectAgent",u[u.CreateChannelTimeline=188]="CreateChannelTimeline",u[u.DetailChannelTimeline=189]="DetailChannelTimeline",u[u.CreatePoll=190]="CreatePoll",u[u.VotePoll=191]="VotePoll",u[u.ClosePoll=192]="ClosePoll",u[u.GetPoll=193]="GetPoll",u[u.ReactChannelMessage=194]="ReactChannelMessage",u[u.MultipartUploadAttachmentFileStart=195]="MultipartUploadAttachmentFileStart",u[u.MultipartUploadAttachmentFileFinish=196]="MultipartUploadAttachmentFileFinish",u))(I||{}),N=class N{constructor(e,t,n,o){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=o,n?this.adapter=n:this.adapter=new te.WebSocketAdapter}setOnOpen(e){this.adapter.onOpen=e}setOnError(e){this.adapter.onError=e}close(){this.adapter.close()}generatecid(){let e=this.nextCid;return++this.nextCid,e}setTransportAdapter(e){this.adapter=e}setFallbackSession(e){}getApiFromPath(e){if(e in I)return I[e]}connect(e,t,n=!1,o=!1,a,c,r){let[i,d]=t.split(":");this.adapter.connect(i,d,n,e,r),this.adapter.onClose=c,this.adapter.onMessage=(p,g,f)=>l(this,null,function*(){if(o&&window&&window.console&&console.log("incomming message with cid %o and message %o",p,f),p!=0){let y=this.cIds[p];if(!y){console.error("No promise executor for message: %o",f);return}delete this.cIds[p],f.error?y.reject(f.error):y.resolve({code:g,message:f})}else yield a(0,0,f)})}send(e,t=N.DefaultSendTimeoutMs){let{urlPath:n,fetchOptions:o}=e,a=o;if(n!=null&&n.includes("/mezon.api.Mezon/")){let c=n.substring(17);a={api_request_event:{api_index:this.getApiFromPath(c),api_name:c,body:o.body}}}return new Promise((c,r)=>{var i,d;if(!this.adapter.isOpen())r("Socket connection has not been established yet.");else{a.channel_message_send?a.channel_message_send.content=JSON.stringify(a.channel_message_send.content):a.channel_message_update?a.channel_message_update.content=JSON.stringify(a.channel_message_update.content):a.ephemeral_message_send?a.ephemeral_message_send.message.content=JSON.stringify((i=a.ephemeral_message_send.message)==null?void 0:i.content):a.quick_menu_event&&(a.quick_menu_event.message.content=JSON.stringify((d=a.quick_menu_event.message)==null?void 0:d.content));let p=this.generatecid();this.cIds[p]={resolve:c,reject:r},t!==1/0&&t>0&&setTimeout(()=>{r("The socket timed out while waiting for a response.")},t),a.cid=p.toString(),this.adapter.send(a)}})}setBasePath(e){this.basePath=e}deleteAccount(e={}){let t="/mezon.api.Mezon/DeleteAccount",o=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:o}).then(a=>a),new Promise((a,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getAccount(e={}){let t="/mezon.api.Mezon/GetAccount",o=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:s.Account.decode(a.message)})),new Promise((a,c)=>setTimeout(()=>c(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",a=s.UpdateAccountRequest.encode(s.UpdateAccountRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,n,o={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/checklogin",c=new Map,r="";r=JSON.stringify(n||{});let i=this.buildFullUrl(this.basePath,a,c),d=m("POST",o,r);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(i,d).then(p=>l(this,null,function*(){let g=yield p.arrayBuffer();return s.Session.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/confirmlogin",a=new Map,c="";c=JSON.stringify(t||{});let r=this.buildFullUrl(e,o,a),i=m("POST",n,c);return i.headers.Accept="application/x-protobuf",i.headers["Content-Type"]="application/json",Promise.race([fetch(r,i).then(d=>d),new Promise((d,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,n,o={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/createqrlogin",c=new Map,r="";r=JSON.stringify(n||{});let i=this.buildFullUrl(this.basePath,a,c),d=m("POST",o,r);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(i,d).then(p=>l(this,null,function*(){let g=yield p.arrayBuffer();return s.LoginIDResponse.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,n,o={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/smsotp",c=new Map,r="";r=JSON.stringify(n||{});let i=this.buildFullUrl(this.basePath,a,c),d=m("POST",o,r);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(i,d).then(p=>l(this,null,function*(){let g=yield p.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,n,o={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/emailotp",c=new Map,r="";r=JSON.stringify(n||{});let i=this.buildFullUrl(this.basePath,a,c),d=m("POST",o,r);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(i,d).then(p=>l(this,null,function*(){let g=yield p.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,n,o={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/email",c=new Map,r="";r=JSON.stringify(n||{});let i=this.buildFullUrl(this.basePath,a,c),d=m("POST",o,r);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(i,d).then(p=>l(this,null,function*(){let g=yield p.arrayBuffer();return s.Session.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,n,o,a,c,r={}){if(n==null)throw new Error("'account' is a required parameter but is null or undefined.");let i="/v2/account/authenticate/mezon",d=new Map;d.set("create",o),d.set("username",a),d.set("is_remember",c);let p="";p=JSON.stringify(n||{});let g=this.buildFullUrl(this.basePath,i,d),f=m("POST",r,p);return e&&(f.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),f.headers.Accept="application/x-protobuf",Promise.race([fetch(g,f).then(y=>l(this,null,function*(){let b=yield y.arrayBuffer();return s.Session.decode(new Uint8Array(b))})),new Promise((y,b)=>setTimeout(()=>b(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",a=s.AccountEmail.encode(s.AccountEmail.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.LinkAccountConfirmRequest.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.AccountMezon.encode(s.AccountMezon.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.LinkAccountConfirmRequest.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.LinkAccountConfirmRequest.encode(s.LinkAccountConfirmRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,c.headers.Accept="application/x-protobuf",Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.Session.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,n,o={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/confirmotp",c=new Map,r="";r=JSON.stringify(n||{});let i=this.buildFullUrl(this.basePath,a,c),d=m("POST",o,r);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(i,d).then(p=>l(this,null,function*(){let g=yield p.arrayBuffer();return s.Session.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(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",a=s.RegistrationEmailRequest.encode(s.RegistrationEmailRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.Session.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,n,o={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SessionRefresh",r=s.SessionRefreshRequest.encode(s.SessionRefreshRequest.fromPartial(n)).finish(),i=m("POST",o,"");return i.body=r,e&&(i.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return d.code!=0?{}:s.Session.decode(d.message)})),new Promise((d,p)=>setTimeout(()=>p(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",a=s.AccountEmail.encode(s.AccountEmail.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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(o=>l(this,null,function*(){return o.code!=0?{}:s.ListUserActivity.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(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",a=s.CreateActivityRequest.encode(s.CreateActivityRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.UserActivity.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.AddAppRequest.encode(s.AddAppRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.App.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,n,o={}){let a="/mezon.api.Mezon/ListApps",r=s.ListAppsRequest.encode(s.ListAppsRequest.fromPartial({filter:e,tombstones:t,cursor:n})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return d.code!=0?{}:s.AppList.decode(d.message)})),new Promise((d,p)=>setTimeout(()=>p(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 o="/mezon.api.Mezon/AddAppToClan",c=s.AppClan.encode(s.AppClan.fromPartial({app_id:e,clan_id:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i})),new Promise((i,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",a=s.App.encode(s.App.fromPartial({id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r})),new Promise((r,i)=>setTimeout(i,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",a=s.App.encode(s.App.fromPartial({id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.App.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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 o="/mezon.api.Mezon/UpdateApp",c=s.UpdateAppRequest.encode(s.UpdateAppRequest.fromPartial(w(S({},t),{id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.App.decode(i.message)})),new Promise((i,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,n,o,a={}){let c="/mezon.api.Mezon/ListAuditLog",i=s.ListAuditLogRequest.encode(s.ListAuditLogRequest.fromPartial({clan_id:n,user_id:t,action_log:e,date_log:o})).finish(),d=m("POST",a,"");return d.body=i,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(p=>l(this,null,function*(){return s.ListAuditLog.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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",a=s.UpdateCategoryOrderRequest.encode(s.UpdateCategoryOrderRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r})),new Promise((r,i)=>setTimeout(i,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,n,o,a,c={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ListCategoryDescs",d=s.CategoryDesc.encode(s.CategoryDesc.fromPartial({clan_id:e,creator_id:t,category_name:n,category_id:o,category_order:a})).finish(),p=m("POST",c,"");return p.body=d,Promise.race([this.send({urlPath:r,fetchOptions:p}).then(g=>l(this,null,function*(){return g.code!=0?{}:s.CategoryDescList.decode(g.message)})),new Promise((g,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t={}){let n="/mezon.api.Mezon/ListChannelApps",a=s.ListChannelAppsRequest.encode(s.ListChannelAppsRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.ListChannelAppsResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,n,o,a={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetChannelCanvasList",i=s.ChannelCanvasListRequest.encode(s.ChannelCanvasListRequest.fromPartial({channel_id:e,clan_id:t,limit:n,page:o})).finish(),d=m("POST",a,"");return d.body=i,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(p=>l(this,null,function*(){return p.code!=0?{}:s.ChannelCanvasListResponse.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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",a=s.AddFavoriteChannelRequest.encode(s.AddFavoriteChannelRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return s.AddFavoriteChannelResponse.decode(r)})),new Promise((r,i)=>setTimeout(i,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 o="/mezon.api.Mezon/RemoveChannelFavorite",c=s.RemoveFavoriteChannelRequest.encode(s.RemoveFavoriteChannelRequest.fromPartial({channel_id:e,clan_id:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i})),new Promise((i,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",a=s.ListFavoriteChannelRequest.encode(s.ListFavoriteChannelRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.ListFavoriteChannelResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,n,o,a,c,r={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListChannelMessages",p=s.ListChannelMessagesRequest.encode(s.ListChannelMessagesRequest.fromPartial({clan_id:e,channel_id:t,message_id:n,direction:o,limit:a,topic_id:c})).finish(),g=m("POST",r,"");return g.body=p,Promise.race([this.send({urlPath:i,fetchOptions:g}).then(f=>l(this,null,function*(){return s.ChannelMessageList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(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 o="/mezon.api.Mezon/AddChannelUsers",c=s.AddChannelUsersRequest.encode(s.AddChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i})),new Promise((i,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,o,a,c,r,i,d={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let p="/mezon.api.Mezon/ListChannelAttachment",f=s.ListChannelAttachmentRequest.encode(s.ListChannelAttachmentRequest.fromPartial({channel_id:e,clan_id:t,file_type:n,limit:o,state:a,before:c,after:r,around:i})).finish(),y=m("POST",d,"");return y.body=f,Promise.race([this.send({urlPath:p,fetchOptions:y}).then(b=>l(this,null,function*(){return b.code!=0?{}:s.ChannelAttachmentList.decode(b.message)})),new Promise((b,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 o="/mezon.api.Mezon/GetChanEncryptionMethod",c=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial({channel_id:e,method:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.ChanEncryptionMethod.decode(i.message)})),new Promise((i,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 o="/mezon.api.Mezon/SetChanEncryptionMethod",c=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial(w(S({},t),{channel_id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i})),new Promise((i,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 o="/mezon.api.Mezon/LeaveThread",c=s.LeaveThreadRequest.encode(s.LeaveThreadRequest.fromPartial({channel_id:t,clan_id:e})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i})),new Promise((i,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 o="/mezon.api.Mezon/ArchiveChannel",c=s.ArchiveChannelRequest.encode(s.ArchiveChannelRequest.fromPartial({clan_id:e,channel_id:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i})),new Promise((i,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",a=s.ListArchivedChannelDescsRequest.encode(s.ListArchivedChannelDescsRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.ListArchivedChannelDescsResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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 o="/mezon.api.Mezon/RemoveChannelUsers",c=s.RemoveChannelUsersRequest.encode(s.RemoveChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i})),new Promise((i,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,n,o,a,c,r={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListChannelUsers",p=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:o,state:a,cursor:c})).finish(),g=m("POST",r,"");return g.body=p,Promise.race([this.send({urlPath:i,fetchOptions:g}).then(f=>l(this,null,function*(){return f.code!=0?{}:s.ChannelUserList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,o,a,c,r={}){let i="/mezon.api.Mezon/ListChannelDescs",p=s.ListChannelDescsRequest.encode(s.ListChannelDescsRequest.fromPartial({limit:e,state:t,page:n,clan_id:o,channel_type:a,is_mobile:c})).finish(),g=m("POST",r,"");return g.body=p,Promise.race([this.send({urlPath:i,fetchOptions:g}).then(f=>l(this,null,function*(){return f.code!=0?{}:s.ChannelDescList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(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",a=s.CreateChannelDescRequest.encode(s.CreateChannelDescRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.ChannelDescription.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,n={}){let o="/mezon.api.Mezon/ListChannelUsersUC",c=s.AllUsersAddChannelRequest.encode(s.AllUsersAddChannelRequest.fromPartial({channel_id:e,limit:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.AllUsersAddChannelResponse.decode(i.message)})),new Promise((i,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 o="/mezon.api.Mezon/DeleteChannelDesc",c=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial({clan_id:e,channel_id:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,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 o="/mezon.api.Mezon/UpdateChannelDesc",c=s.UpdateChannelDescRequest.encode(s.UpdateChannelDescRequest.fromPartial(w(S({},t),{channel_id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,o,a,c,r,i,d,p,g={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let f="/mezon.api.Mezon/ListChannelSetting",b=s.ChannelSettingListRequest.encode(s.ChannelSettingListRequest.fromPartial({clan_id:e,parent_id:t,category_id:n,active:a,private_channel:o,status:c,type:r,limit:i,page:d,channel_label:p})).finish(),A=m("POST",g,"");return A.body=b,Promise.race([this.send({urlPath:f,fetchOptions:A}).then(C=>l(this,null,function*(){return C.code!=0?{}:s.ChannelSettingListResponse.decode(C.message)})),new Promise((C,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,n={}){let o="/mezon.api.Mezon/ListChannelVoiceUsers",c=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,limit:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.VoiceChannelUserList.decode(i.message)})),new Promise((i,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,n,o={}){let a="/mezon.api.Mezon/ListClanDescs",r=s.ListClanDescRequest.encode(s.ListClanDescRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return d.code!=0?{}:s.ClanDescList.decode(d.message)})),new Promise((d,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}listChannelBadgeCount(e,t,n,o={}){let a="/mezon.api.Mezon/ListChannelBadgeCount",r=s.ListChannelBadgeCountRequest.encode(s.ListChannelBadgeCountRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return d.code!=0?{}:s.ListChannelBadgeCountResponse.decode(d.message)})),new Promise((d,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}listUserOnline(e,t,n,o={}){let a="/mezon.api.Mezon/ListUserOnline",r=s.ListUserOnlineRequest.encode(s.ListUserOnlineRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return d.code!=0?{}:s.ListUserOnlineResponse.decode(d.message)})),new Promise((d,p)=>setTimeout(()=>p(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",a=s.CreateClanDescRequest.encode(s.CreateClanDescRequest.fromPartial({clan_name:e.clan_name,logo:e.logo,banner:e.banner})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.ClanDesc.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.DeleteClanDescRequest.encode(s.DeleteClanDescRequest.fromPartial({clan_desc_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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 o="/mezon.api.Mezon/UpdateClanDesc",c=s.UpdateClanDescRequest.encode(s.UpdateClanDescRequest.fromPartial(S({clan_id:e},t))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,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 o="/mezon.api.Mezon/RemoveClanUsers",c=s.RemoveClanUsersRequest.encode(s.RemoveClanUsersRequest.fromPartial({clan_id:e,user_ids:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return{}})),new Promise((i,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,n={}){let o="/mezon.api.Mezon/ListBannedUsers",c=s.BannedUserListRequest.encode(s.BannedUserListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.BannedUserList.decode(i.message)})),new Promise((i,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,n,o,a={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UnbanClanUsers",i=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:o})).finish(),d=m("POST",a,"");return d.body=i,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(p=>l(this,null,function*(){return{}})),new Promise((p,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,n,o,a={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/BanClanUsers",i=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:o})).finish(),d=m("POST",a,"");return d.body=i,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(p=>l(this,null,function*(){return{}})),new Promise((p,g)=>setTimeout(()=>g(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",a=s.ListClanUsersRequest.encode(s.ListClanUsersRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.ClanUserList.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.ListClanUsersStatusRequest.encode(s.ListClanUsersStatusRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.ClanUserStatusList.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.CreateCategoryDescRequest.encode(s.CreateCategoryDescRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.CategoryDesc.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.CheckDuplicateNameRequest.encode(s.CheckDuplicateNameRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){if(r.status>=200&&r.status<300)return s.CheckDuplicateNameResponse.decode(r);throw r})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,n,o={}){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 a="/mezon.api.Mezon/DeleteCategoryDesc",r=s.DeleteCategoryDescRequest.encode(s.DeleteCategoryDescRequest.fromPartial({category_id:e,clan_id:t,category_label:n})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return{}})),new Promise((d,p)=>setTimeout(p,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,n,o,a={}){let c="/mezon.api.Mezon/RegistFCMDeviceToken",i=s.RegistFcmDeviceTokenRequest.encode(s.RegistFcmDeviceTokenRequest.fromPartial({token:e,device_id:t,platform:n,voip_token:o})).finish(),d=m("POST",a,"");return d.body=i,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(p=>l(this,null,function*(){return p.code!=0?{}:s.RegistFcmDeviceTokenResponse.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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",a=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.ClanEmojiCreateRequest.encode(s.ClanEmojiCreateRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,n,o={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteByIdClanEmoji",r=s.ClanEmojiDeleteRequest.encode(s.ClanEmojiDeleteRequest.fromPartial({id:e,clan_id:t,emoji_label:n})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return{}})),new Promise((d,p)=>setTimeout(()=>p(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 o="/mezon.api.Mezon/UpdateClanEmojiById",c=s.ClanEmojiUpdateRequest.encode(s.ClanEmojiUpdateRequest.fromPartial({id:t.id,shortname:t.shortname,clan_id:t.clan_id})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return{}})),new Promise((i,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e={}){let t="/mezon.api.Mezon/EmojiRecentList",o=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:s.EmojiRecentList.decode(a.message)})),new Promise((a,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e={}){let t="/mezon.api.Mezon/GetListEmojisByUserId",o=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:s.EmojiListedResponse.decode(a.message)})),new Promise((a,c)=>setTimeout(()=>c(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",a=s.SearchMessageRequest.encode(s.SearchMessageRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.SearchMessageResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.Event.encode(s.Event.fromPartial({external:e.external,name:e.name,properties:e.properties})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,this.timeoutMs,"Request timed out."))])}listEvents(e,t={}){let n="/mezon.api.Mezon/ListEvents",a=s.ListEventsRequest.encode(s.ListEventsRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.EventList.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.CreateEventRequest.encode(s.CreateEventRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.EventManagement.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,n,o,a,c={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteEvent",d=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial({event_id:e,clan_id:t,creator_id:n,event_label:o,channel_id:a})).finish(),p=m("POST",c,"");return p.body=d,Promise.race([this.send({urlPath:r,fetchOptions:p}).then(g=>l(this,null,function*(){return{}})),new Promise((g,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 o="/mezon.api.Mezon/UpdateEvent",c=s.UpdateEventRequest.encode(s.UpdateEventRequest.fromPartial(t)).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return{}})),new Promise((i,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,n={}){let o="/mezon.api.Mezon/DeleteFriends",c=s.DeleteFriendsRequest.encode(s.DeleteFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listFriends(e,t,n,o={}){let a="/mezon.api.Mezon/ListFriends",r=s.ListFriendsRequest.encode(s.ListFriendsRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return d.code!=0?{}:s.FriendList.decode(d.message)})),new Promise((d,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,n={}){let o="/mezon.api.Mezon/AddFriends",c=s.AddFriendsRequest.encode(s.AddFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.AddFriendsResponse.decode(i.message)})),new Promise((i,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,n={}){let o="/mezon.api.Mezon/BlockFriends",c=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,n={}){let o="/mezon.api.Mezon/UnblockFriends",c=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t={}){let n="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",a=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.NotificationChannelCategorySettingList.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.ClanProfileRequest.encode(s.ClanProfileRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.ClanProfile.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t={}){let n="/mezon.api.Mezon/GetNotificationCategory",a=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.NotificationUserChannel.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t={}){let n="/mezon.api.Mezon/GetNotificationChannel",a=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.NotificationUserChannel.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t={}){let n="/mezon.api.Mezon/GetNotificationClan",a=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.NotificationSetting.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t={}){let n="/mezon.api.Mezon/GetNotificationReactMessage",a=s.NotifiReactMessage.encode(s.NotifiReactMessage.fromPartial({channel_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.NotifiReactMessage.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}giveMeACoffee(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GiveMeACoffee",a=s.GiveCoffeeEvent.encode(s.GiveCoffeeEvent.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(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(o=>l(this,null,function*(){return o.code!=0?{}:s.GetKeyServerResp.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(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",a=s.LinkInviteUserRequest.encode(s.LinkInviteUserRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.LinkInviteUser.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.InviteUserRequest.encode(s.InviteUserRequest.fromPartial({invite_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.InviteUserRes.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,n,o={}){if(n==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let a="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(n))),c=new Map,r="",i=this.buildFullUrl(this.basePath,a,c),d=m("GET",o,r);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(i,d).then(p=>l(this,null,function*(){let g=yield p.arrayBuffer();return s.InviteUserRes.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(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(o=>l(this,null,function*(){return o.code!=0?{}:s.ChannelDescList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(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",a=s.MarkAsReadRequest.encode(s.MarkAsReadRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(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(o=>l(this,null,function*(){return o.code!=0?{}:s.MezonOauthClientList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(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",a=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,n={}){let o="/mezon.api.Mezon/DeleteNotifications",c=s.DeleteNotificationsRequest.encode(s.DeleteNotificationsRequest.fromPartial({ids:e||[],category:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,o,a,c={}){let r="/mezon.api.Mezon/ListNotifications",d=s.ListNotificationsRequest.encode(s.ListNotificationsRequest.fromPartial({limit:e,clan_id:t,notification_id:n,category:o,direction:a})).finish(),p=m("POST",c,"");return p.body=d,Promise.race([this.send({urlPath:r,fetchOptions:p}).then(g=>l(this,null,function*(){return s.NotificationList.decode(g.message)})),new Promise((g,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",a=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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",a=s.SetDefaultNotificationRequest.encode(s.SetDefaultNotificationRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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",a=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationCategorySetting",a=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationChannel",a=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t={}){let n="/mezon.api.Mezon/DeleteNotiReactMessage",a=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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",a=s.NotificationChannel.encode(s.NotificationChannel.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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",a=s.UpdateRoleChannelRequest.encode(s.UpdateRoleChannelRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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(o=>l(this,null,function*(){return o.code!=0?{}:s.PermissionList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,n,o={}){let a="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",r=s.PermissionRoleChannelListEventRequest.encode(s.PermissionRoleChannelListEventRequest.fromPartial({role_id:e,channel_id:t,user_id:n})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return d.code!=0?{}:s.PermissionRoleChannelListEventResponse.decode(d.message)})),new Promise((d,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,n,o,a={}){let c="/mezon.api.Mezon/DeletePinMessage",i=s.DeletePinMessage.encode(s.DeletePinMessage.fromPartial({id:e,message_id:t,channel_id:n,clan_id:o})).finish(),d=m("POST",a,"");return d.body=i,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(p=>p),new Promise((p,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,n,o={}){let a="/mezon.api.Mezon/GetPinMessagesList",r=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial({message_id:e,channel_id:t,clan_id:n})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return s.PinMessagesList.decode(d.message)})),new Promise((d,p)=>setTimeout(()=>p(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",a=s.Message2InboxRequest.encode(s.Message2InboxRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.ChannelMessageHeader.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.ChannelMessageHeader.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t={}){let n="/mezon.api.Mezon/GetPubKeys",a=s.GetPubKeysRequest.encode(s.GetPubKeysRequest.fromPartial({user_ids:e||[]})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.GetPubKeysResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.PushPubKeyRequest.encode(s.PushPubKeyRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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",a=s.AddRoleChannelDescRequest.encode(s.AddRoleChannelDescRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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 o="/mezon.api.Mezon/ChangeChannelCategory",c=s.ChangeChannelCategoryRequest.encode(s.ChangeChannelCategoryRequest.fromPartial(w(S({},t),{new_category_id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,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",a=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,this.timeoutMs,"Request timed out."))])}listRoles(e,t,n,o,a={}){let c="/mezon.api.Mezon/ListRoles",i=s.RoleListEventRequest.encode(s.RoleListEventRequest.fromPartial({clan_id:e,limit:t,state:n,cursor:o})).finish(),d=m("POST",a,"");return d.body=i,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(p=>l(this,null,function*(){return p.code!=0?{}:s.RoleListEventResponse.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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",a=s.CreateRoleRequest.encode(s.CreateRoleRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.Role.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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 o="/mezon.api.Mezon/DeleteRole",c=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(w(S({},t),{role_id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,n,o,a={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteRole",i=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial({role_id:e,channel_id:t,clan_id:n,role_label:o})).finish(),d=m("POST",a,"");return d.body=i,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(p=>p),new Promise((p,g)=>setTimeout(g,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 o="/mezon.api.Mezon/UpdateRole",c=s.UpdateRoleRequest.encode(s.UpdateRoleRequest.fromPartial(w(S({},t),{role_id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,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",a=s.ListPermissionsRequest.encode(s.ListPermissionsRequest.fromPartial({role_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.PermissionList.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,n,o={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListRoleUsers",r=s.ListRoleUsersRequest.encode(s.ListRoleUsersRequest.fromPartial({role_id:e,limit:t,cursor:n})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return d.code!=0?{}:s.RoleUserList.decode(d.message)})),new Promise((d,p)=>setTimeout(()=>p(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 o="/mezon.api.Mezon/GetRoleOfUserInTheClan",c=s.ListPermissionOfUsersRequest.encode(s.ListPermissionOfUsersRequest.fromPartial({clan_id:e,channel_id:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.RoleList.decode(i.message)})),new Promise((i,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,n,o={}){let a="/mezon.api.Mezon/SearchThread",r=s.SearchThreadRequest.encode(s.SearchThreadRequest.fromPartial({clan_id:e,channel_id:t,label:n})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return d.code!=0?{}:s.ChannelDescList.decode(d.message)})),new Promise((d,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}sendToken(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SendToken",a=s.TokenSentEvent.encode(s.TokenSentEvent.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.SessionLogoutRequest.encode(s.SessionLogoutRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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",a=s.ClanStickerAddRequest.encode(s.ClanStickerAddRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,n,o={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteClanStickerById",r=s.ClanStickerDeleteRequest.encode(s.ClanStickerDeleteRequest.fromPartial({id:e,clan_id:t,sticker_label:n})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return{}})),new Promise((d,p)=>setTimeout(()=>p(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 o="/mezon.api.Mezon/UpdateClanStickerById",c=s.ClanStickerUpdateByIdRequest.encode(s.ClanStickerUpdateByIdRequest.fromPartial(w(S({},t),{id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return{}})),new Promise((i,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(o=>l(this,null,function*(){return o.code!=0?{}:s.StickerListedResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(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",a=s.RegisterStreamingChannelRequest.encode(s.RegisterStreamingChannelRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.RegisterStreamingChannelResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,n,o,a,c,r={}){let i="/mezon.api.Mezon/ListStreamingChannelUsers",p=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:o,state:a,cursor:c})).finish(),g=m("POST",r,"");return g.body=p,Promise.race([this.send({urlPath:i,fetchOptions:g}).then(f=>l(this,null,function*(){return f.code!=0?{}:s.StreamingChannelUserList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(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(o=>l(this,null,function*(){return o.code!=0?{}:s.SystemMessagesList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(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",a=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,n={}){let o="/mezon.api.Mezon/ListSdTopic",c=s.ListSdTopicRequest.encode(s.ListSdTopicRequest.fromPartial({clan_id:e,limit:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.SdTopicList.decode(i.message)})),new Promise((i,d)=>setTimeout(()=>d(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",a=s.SdTopicRequest.encode(s.SdTopicRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.SdTopic.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.DeleteSystemMessage.encode(s.DeleteSystemMessage.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.GetSystemMessage.encode(s.GetSystemMessage.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.SystemMessage.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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 o="/mezon.api.Mezon/UpdateSystemMessage",c=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(w(S({},t),{clan_id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return{}})),new Promise((i,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,n,o,a,c,r={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListThreadDescs",p=s.ListThreadRequest.encode(s.ListThreadRequest.fromPartial({channel_id:e,limit:t,state:n,clan_id:o,thread_id:a,page:c})).finish(),g=m("POST",r,"");return g.body=p,Promise.race([this.send({urlPath:i,fetchOptions:g}).then(f=>l(this,null,function*(){return f.code!=0?{}:s.ChannelDescListNoPool.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(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 o="/mezon.api.Mezon/UpdateCategory",c=s.UpdateCategoryDescRequest.encode(s.UpdateCategoryDescRequest.fromPartial(w(S({},t),{clan_id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return{}})),new Promise((i,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",a=s.ChangeChannelPrivateRequest.encode(s.ChangeChannelPrivateRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(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 o="/mezon.api.Mezon/UpdateUserProfileByClan",c=s.UpdateClanProfileRequest.encode(s.UpdateClanProfileRequest.fromPartial(w(S({},t),{clan_id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return{}})),new Promise((i,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",a=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.UploadAttachment.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.UploadAttachment.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.MultipartUploadAttachment.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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/MultipartUploadAttachmentFileStart",a=s.MultipartUploadAttachmentFinishRequest.encode(s.MultipartUploadAttachmentFinishRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.UpdateUsersRequest.encode(s.UpdateUsersRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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(o=>l(this,null,function*(){return o.code!=0?{}:s.AllUserClans.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,n={}){let o="/mezon.api.Mezon/ListUserPermissionInChannel",c=s.UserPermissionInChannelListRequest.encode(s.UserPermissionInChannelListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.UserPermissionInChannelListResponse.decode(i.message)})),new Promise((i,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(o=>l(this,null,function*(){return o.code!=0?{}:s.UserStatus.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(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",a=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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",a=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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",a=s.WebhookCreateRequest.encode(s.WebhookCreateRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return s.WebhookGenerateResponse.decode(r)})),new Promise((r,i)=>setTimeout(()=>i(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 o="/mezon.api.Mezon/UpdateWebhookById",c=s.WebhookUpdateRequestById.encode(s.WebhookUpdateRequestById.fromPartial(w(S({},t),{id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,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 o="/mezon.api.Mezon/ListWebhookByChannelId",c=s.WebhookListRequest.encode(s.WebhookListRequest.fromPartial({channel_id:e,clan_id:t||""})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.WebhookListResponse.decode(i.message)})),new Promise((i,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 o="/mezon.api.Mezon/DeleteWebhookById",c=s.WebhookDeleteRequestById.encode(s.WebhookDeleteRequestById.fromPartial(w(S({},t),{id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,n){let o=e+t+"?";for(let[a,c]of n)c instanceof Array?o+=c.reduce((r,i)=>r+encodeURIComponent(a)+"="+encodeURIComponent(i)+"&",""):c!=null&&(o+=encodeURIComponent(a)+"="+encodeURIComponent(c)+"&");return o}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",a=s.EditChannelCanvasRequest.encode(s.EditChannelCanvasRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.EditChannelCanvasResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,n,o={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetChannelCanvasDetail",r=s.ChannelCanvasDetailRequest.encode(s.ChannelCanvasDetailRequest.fromPartial({id:e,clan_id:t||"",channel_id:n||""})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>l(this,null,function*(){return d.code!=0?{}:s.ChannelCanvasDetailResponse.decode(d.message)})),new Promise((d,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,n,o={}){if(e==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteChannelCanvas",r=s.DeleteChannelCanvasRequest.encode(s.DeleteChannelCanvasRequest.fromPartial({canvas_id:e,clan_id:t||"",channel_id:n||""})).finish(),i=m("POST",o,"");return i.body=r,Promise.race([this.send({urlPath:a,fetchOptions:i}).then(d=>d),new Promise((d,p)=>setTimeout(p,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,n,o,a={}){let c="/mezon.api.Mezon/ListOnboarding",i=s.ListOnboardingRequest.encode(s.ListOnboardingRequest.fromPartial({clan_id:e,guide_type:t,limit:n,page:o})).finish(),d=m("POST",a,"");return d.body=i,Promise.race([this.send({urlPath:c,fetchOptions:d}).then(p=>l(this,null,function*(){return p.code!=0?{}:s.ListOnboardingResponse.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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",a=s.CreateOnboardingRequest.encode(s.CreateOnboardingRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.ListOnboardingResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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 o="/mezon.api.Mezon/DeleteOnboarding",c=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:e,clan_id:t})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,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 o="/mezon.api.Mezon/GetOnboardingDetail",c=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:e,clan_id:t||""})).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.OnboardingItem.decode(i.message)})),new Promise((i,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 o="/mezon.api.Mezon/UpdateOnboarding",c=s.UpdateOnboardingRequest.encode(s.UpdateOnboardingRequest.fromPartial(w(S({},t),{id:e}))).finish(),r=m("POST",n,"");return r.body=c,Promise.race([this.send({urlPath:o,fetchOptions:r}).then(i=>i),new Promise((i,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",a=s.GenerateClanWebhookRequest.encode(s.GenerateClanWebhookRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.GenerateClanWebhookResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.ListClanWebhookRequest.encode(s.ListClanWebhookRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.ListClanWebhookResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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 o="/mezon.api.Mezon/DeleteClanWebhookById",a={id:e,clan_id:t},r=s.ClanWebhookRequest.encode(s.ClanWebhookRequest.fromPartial(a)).finish(),i=m("POST",n,"");return i.body=r,Promise.race([this.send({urlPath:o,fetchOptions:i}).then(d=>d),new Promise((d,p)=>setTimeout(p,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 o="/mezon.api.Mezon/UpdateClanWebhookById",a=w(S({},t),{id:e}),r=s.UpdateClanWebhookRequest.encode(s.UpdateClanWebhookRequest.fromPartial(a)).finish(),i=m("POST",n,"");return i.body=r,Promise.race([this.send({urlPath:o,fetchOptions:i}).then(d=>d),new Promise((d,p)=>setTimeout(p,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t={}){let n="/mezon.api.Mezon/GetTopicDetail",o={topic_id:e},c=s.SdTopicDetailRequest.encode(s.SdTopicDetailRequest.fromPartial(o)).finish(),r=m("POST",t,"");return r.body=c,Promise.race([this.send({urlPath:n,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.SdTopic.decode(i.message)})),new Promise((i,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,n,o={}){let a="/mezon.api.Mezon/ListOnboardingStep",c={clan_id:e,limit:t,page:n},i=s.ListOnboardingStepRequest.encode(s.ListOnboardingStepRequest.fromPartial(c)).finish(),d=m("POST",o,"");return d.body=i,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(p=>l(this,null,function*(){return p.code!=0?{}:s.ListOnboardingStepResponse.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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 o="/mezon.api.Mezon/UpdateOnboardingStep",a=w(S({},t),{clan_id:e}),r=s.UpdateOnboardingStepRequest.encode(s.UpdateOnboardingStepRequest.fromPartial(a)).finish(),i=m("POST",n,"");return i.body=r,Promise.race([this.send({urlPath:o,fetchOptions:i}).then(d=>d),new Promise((d,p)=>setTimeout(p,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",a=s.CreateRoomChannelApps.encode(s.CreateRoomChannelApps.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return s.CreateRoomChannelApps.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.GenerateMeetTokenRequest.encode(s.GenerateMeetTokenRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.GenerateMeetTokenResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,n={}){let o="/mezon.api.Mezon/GetMezonOauthClient",a={client_id:e,client_name:t},r=s.GetMezonOauthClientRequest.encode(s.GetMezonOauthClientRequest.fromPartial(a)).finish(),i=m("POST",n,"");return i.body=r,Promise.race([this.send({urlPath:o,fetchOptions:i}).then(d=>l(this,null,function*(){return d.code!=0?{}:s.MezonOauthClient.decode(d.message)})),new Promise((d,p)=>setTimeout(()=>p(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",a=s.MezonOauthClient.encode(s.MezonOauthClient.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.MezonOauthClient.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t={}){let n="/mezon.api.Mezon/GenerateHashChannelApps",o={app_id:e},c=s.GenerateHashChannelAppsRequest.encode(s.GenerateHashChannelAppsRequest.fromPartial(o)).finish(),r=m("POST",t,"");return r.body=c,Promise.race([this.send({urlPath:n,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.GenerateHashChannelAppsResponse.decode(i.message)})),new Promise((i,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",a=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,n={}){let o="/mezon.api.Mezon/DeleteUserEvent",a={clan_id:e,event_id:t},r=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(a)).finish(),i=m("POST",n,"");return i.body=r,Promise.race([this.send({urlPath:o,fetchOptions:i}).then(d=>d),new Promise((d,p)=>setTimeout(p,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",a=s.UpdateRoleOrderRequest.encode(s.UpdateRoleOrderRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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(o=>l(this,null,function*(){return o.code!=0?{}:s.GenerateMezonMeetResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,n,o,a,c={}){if(t==null)throw new Error("'token' is a required parameter but is null or undefined.");let r="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(t))),i=new Map;i.set("username",n),i.set("metadata",o),i.set("is_guest",a);let d="",p=this.buildFullUrl(e,r,i),g=m("POST",c,d);return g.headers.Accept="application/x-protobuf",g.headers["Content-Type"]="application/json",Promise.race([fetch(p,g).then(f=>l(this,null,function*(){let y=yield f.arrayBuffer();return s.GenerateMeetTokenExternalResponse.decode(new Uint8Array(y))})),new Promise((f,y)=>setTimeout(()=>y(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",a=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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",a=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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",o={channel_id:e},c=s.ListChannelDetailRequest.encode(s.ListChannelDetailRequest.fromPartial(o)).finish(),r=m("POST",t,"");return r.body=c,Promise.race([this.send({urlPath:n,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.ChannelDescription.decode(i.message)})),new Promise((i,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",a=s.ListChannelTimelineRequest.encode(s.ListChannelTimelineRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return s.ListChannelTimelineResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.CreateChannelTimelineRequest.encode(s.CreateChannelTimelineRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return s.CreateChannelTimelineResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.UpdateChannelTimelineRequest.encode(s.UpdateChannelTimelineRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return s.UpdateChannelTimelineResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.ChannelTimelineDetailRequest.encode(s.ChannelTimelineDetailRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return s.ChannelTimelineDetailResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.UpdateClanOrderRequest.encode(s.UpdateClanOrderRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,n,o,a={}){if(o==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/clan/discover",r=new Map,i="";i=JSON.stringify(o||{});let d=this.buildFullUrl(n,c,r),p=m("POST",a,i);return e&&(p.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),p.headers.Accept="application/x-protobuf",p.headers["Content-Type"]="application/json",Promise.race([fetch(d,p).then(g=>l(this,null,function*(){let f=yield g.arrayBuffer();return s.ListClanDiscover.decode(new Uint8Array(f))})),new Promise((g,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,n,o,a,c,r={}){let i="/mezon.api.Mezon/DeleteQuickMenuAccess",d={id:e,clan_id:t,bot_id:n,menu_name:o,background:a,action_msg:c},g=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(d)).finish(),f=m("POST",r,"");return f.body=g,Promise.race([this.send({urlPath:i,fetchOptions:f}).then(y=>y),new Promise((y,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,n,o={}){let a="/mezon.api.Mezon/ListQuickMenuAccess",c={bot_id:e,channel_id:t,menu_type:n},i=s.ListQuickMenuAccessRequest.encode(s.ListQuickMenuAccessRequest.fromPartial(c)).finish(),d=m("POST",o,"");return d.body=i,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(p=>l(this,null,function*(){return p.code!=0?{}:s.QuickMenuAccessList.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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",a=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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",a=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t={}){let n="/mezon.api.Mezon/ListForSaleItems",o={page:e},c=s.ListForSaleItemsRequest.encode(s.ListForSaleItemsRequest.fromPartial(o)).finish(),r=m("POST",t,"");return r.body=c,Promise.race([this.send({urlPath:n,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.ForSaleItemList.decode(i.message)})),new Promise((i,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",a=s.IsFollowerRequest.encode(s.IsFollowerRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.IsFollowerResponse.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",a=s.TransferOwnershipRequest.encode(s.TransferOwnershipRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>r),new Promise((r,i)=>setTimeout(i,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",a=s.UpdateUsernameRequest.encode(s.UpdateUsernameRequest.fromPartial(e)).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return r.code!=0?{}:s.Session.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(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",o={channel_id:e},c=s.IsBannedRequest.encode(s.IsBannedRequest.fromPartial(o)).finish(),r=m("POST",t,"");return r.body=c,Promise.race([this.send({urlPath:n,fetchOptions:r}).then(i=>l(this,null,function*(){return i.code!=0?{}:s.IsBannedResponse.decode(i.message)})),new Promise((i,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,n={}){let o="/mezon.api.Mezon/ReportMessageAbuse",a={message_id:e,abuse_type:t},r=s.ReportMessageAbuseReqest.encode(s.ReportMessageAbuseReqest.fromPartial(a)).finish(),i=m("POST",n,"");return i.body=r,Promise.race([this.send({urlPath:o,fetchOptions:i}).then(d=>d),new Promise((d,p)=>setTimeout(p,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,o,a,c,r,i,d,p,g,f,y){let b="/mezon.api.Mezon/SendChannelMessage",C=s.ChannelMessageSend.encode(s.ChannelMessageSend.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:o,content:a,mentions:c,attachments:r,references:i,anonymous_message:d,mention_everyone:p,avatar:g,code:f,topic_id:y})).finish(),v=m("POST",{},"");return v.body=C,Promise.race([this.send({urlPath:b,fetchOptions:v}).then(M=>l(this,null,function*(){return s.ChannelMessageAck.decode(M.message)})),new Promise((M,O)=>setTimeout(()=>O(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,o,a,c,r,i,d,p,g){let f="/mezon.api.Mezon/UpdateChannelMessage",b=s.ChannelMessageUpdate.encode(s.ChannelMessageUpdate.fromPartial({clan_id:e,channel_id:t,message_id:a,mode:n,is_public:o,content:c,mentions:r,attachments:i,hide_editted:d,topic_id:p,is_update_msg_topic:g})).finish(),A=m("POST",{},"");return A.body=b,Promise.race([this.send({urlPath:f,fetchOptions:A}).then(C=>l(this,null,function*(){return C.code!=0?{}:s.ChannelMessageUpdate.decode(C.message)})),new Promise((C,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,n,o,a,c,r,i,d){let p="/mezon.api.Mezon/DeleteChannelMessage",f=s.ChannelMessageRemove.encode(s.ChannelMessageRemove.fromPartial({clan_id:e,channel_id:t,message_id:a,mode:n,is_public:o,has_attachment:c,mentions:i,references:d,topic_id:r})).finish(),y=m("POST",{},"");return y.body=f,Promise.race([this.send({urlPath:p,fetchOptions:y}).then(b=>l(this,null,function*(){return b.code!=0?{}:s.ChannelMessageRemove.decode(b.message)})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,n,o,a,c={}){let r="/mezon.api.Mezon/UpdateMezonVoiceState",i={clan_id:e,channel_id:t,display_name:n,room_name:o,state:a},p=s.HandleParticipantMeetStateEvent.encode(s.HandleParticipantMeetStateEvent.fromPartial(i)).finish(),g=m("POST",c,"");return g.body=p,Promise.race([this.send({urlPath:r,fetchOptions:g}).then(f=>f),new Promise((f,y)=>setTimeout(y,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,o,a,c,r={}){let i="/mezon.api.Mezon/MessageButtonClick",d={message_id:e,channel_id:t,button_id:n,sender_id:o,user_id:a,extra_data:c},g=s.MessageButtonClicked.encode(s.MessageButtonClicked.fromPartial(d)).finish(),f=m("POST",r,"");return f.body=g,Promise.race([this.send({urlPath:i,fetchOptions:f}).then(y=>y),new Promise((y,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,o,a,c,r={}){let i="/mezon.api.Mezon/DropdownBoxSelected",d={message_id:e,channel_id:t,selectbox_id:n,sender_id:o,user_id:a,values:c},g=s.DropdownBoxSelected.encode(s.DropdownBoxSelected.fromPartial(d)).finish(),f=m("POST",r,"");return f.body=g,Promise.race([this.send({urlPath:i,fetchOptions:f}).then(y=>y),new Promise((y,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,n={}){let o="/mezon.api.Mezon/ActiveArchivedThread",a={clan_id:e,channel_id:t},r=s.ActiveArchivedThread.encode(s.ActiveArchivedThread.fromPartial(a)).finish(),i=m("POST",n,"");return i.body=r,Promise.race([this.send({urlPath:o,fetchOptions:i}).then(d=>d),new Promise((d,p)=>setTimeout(p,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,n={}){let o="/mezon.api.Mezon/AddAgentToChannel",a={room_name:e,channel_id:t},r=s.UpdateAIAgentRequest.encode(s.UpdateAIAgentRequest.fromPartial(a)).finish(),i=m("POST",n,"");return i.body=r,Promise.race([this.send({urlPath:o,fetchOptions:i}).then(d=>d),new Promise((d,p)=>setTimeout(p,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,n={}){let o="/mezon.api.Mezon/DisconnectAgent",a={room_name:e,channel_id:t},r=s.UpdateAIAgentRequest.encode(s.UpdateAIAgentRequest.fromPartial(a)).finish(),i=m("POST",n,"");return i.body=r,Promise.race([this.send({urlPath:o,fetchOptions:i}).then(d=>d),new Promise((d,p)=>setTimeout(p,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",a=s.ListMutedChannelRequest.encode(s.ListMutedChannelRequest.fromPartial({clan_id:e})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(r=>l(this,null,function*(){return s.MutedChannelList.decode(r.message)})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,n,o,a,c,r,i,d,p,g,f,y){let b="/mezon.api.Mezon/ReactChannelMessage",C=s.MessageReaction.encode(s.MessageReaction.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:o,message_id:a,emoji_id:c,emoji:r,count:i,message_sender_id:d,action:p,emoji_recent_id:f,sender_name:y,topic_id:g})).finish(),v=m("POST",{},"");return v.body=C,Promise.race([this.send({urlPath:b,fetchOptions:v}).then(M=>l(this,null,function*(){return s.ChannelMessageSend.decode(M.message)})),new Promise((M,O)=>setTimeout(()=>O(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t={}){var r,i,d,p,g,f;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePoll",a=s.CreatePollRequest.encode(s.CreatePollRequest.fromPartial({channel_id:(r=e.channel_id)!=null?r:"0",clan_id:(i=e.clan_id)!=null?i:"0",question:(d=e.question)!=null?d:"",answers:(p=e.answers)!=null?p:[],expire_hours:(g=e.expire_hours)!=null?g:0,type:(f=e.type)!=null?f:0})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(y=>l(this,null,function*(){let b=s.CreatePollResponse.decode(y);return{poll_id:b.poll_id,message_id:b.message_id,question:b.question,answers:b.answers.map(A=>({index:A.index,label:A.label})),answer_counts:b.answer_counts,exp:b.exp,is_closed:b.is_closed,creator_id:b.creator_id,type:b.type,total_votes:b.total_votes}})),new Promise((y,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t={}){var r,i,d,p;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/VotePoll",a=s.VotePollRequest.encode(s.VotePollRequest.fromPartial({poll_id:(r=e.poll_id)!=null?r:"0",message_id:(i=e.message_id)!=null?i:"0",channel_id:(d=e.channel_id)!=null?d:"0",answer_indices:(p=e.answer_indices)!=null?p:[]})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(g=>l(this,null,function*(){var y;let f=g.length>0?s.VotePollResponse.decode(g):{my_answer_indices:[]};return{my_answer_indices:Array.from((y=f.my_answer_indices)!=null?y:[])}})),new Promise((g,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t={}){var r,i,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ClosePoll",a=s.ClosePollRequest.encode(s.ClosePollRequest.fromPartial({poll_id:(r=e.poll_id)!=null?r:"0",message_id:(i=e.message_id)!=null?i:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(p=>{if(p.status==204||p.status>=200&&p.status<300)return{};throw p}),new Promise((p,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t={}){var r,i,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetPoll",a=s.GetPollRequest.encode(s.GetPollRequest.fromPartial({poll_id:(r=e.poll_id)!=null?r:"0",message_id:(i=e.message_id)!=null?i:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),c=m("POST",t,"");return c.body=a,Promise.race([this.send({urlPath:n,fetchOptions:c}).then(p=>l(this,null,function*(){let g=s.GetPollResponse.decode(p);return{poll_id:g.poll_id,message_id:g.message_id,question:g.question,answers:g.answers.map(f=>({index:f.index,label:f.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,voter_details:g.voter_details.map(f=>({answer_index:f.answer_index,user_ids:f.user_ids}))}})),new Promise((p,g)=>setTimeout(()=>g(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(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(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(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(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*(){return{}})),new Promise((n,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}joinChat(e,t,n,o){return l(this,null,function*(){let a="",c={channel_join:{clan_id:e,channel_id:t,channel_type:n,is_public:o}};return Promise.race([this.send({urlPath:a,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])})}leaveChat(e,t,n,o){let a="",c={channel_leave:{clan_id:e,channel_id:t,channel_type:n,is_public:o}};return Promise.race([this.send({urlPath:a,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,o,a,c,r,i,d){return l(this,null,function*(){let p="",g={channel_message_remove:{clan_id:e,channel_id:t,mode:n,message_id:a,is_public:o,has_attachment:c,topic_id:r,mentions:i,references:d}};return Promise.race([this.send({urlPath:p,fetchOptions:g}).then(f=>l(this,null,function*(){return{}})),new Promise((f,y)=>setTimeout(()=>y(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(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateChatMessage(e,t,n,o,a,c,r,i,d,p,g){return l(this,null,function*(){let f="",y={channel_message_update:{clan_id:e,channel_id:t,message_id:a,content:c,mentions:r,attachments:i,mode:n,is_public:o,hide_editted:d,topic_id:p,is_update_msg_topic:g}};return Promise.race([this.send({urlPath:f,fetchOptions:y}).then(b=>l(this,null,function*(){return{}})),new Promise((b,A)=>setTimeout(()=>A(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(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}writeQuickMenuEvent(e,t,n,o,a,c,r,i,d,p,g,f,y,b){return l(this,null,function*(){let A="",C={quick_menu_event:{menu_name:e,message:{clan_id:t,channel_id:n,mode:o,is_public:a,content:c,mentions:r,attachments:i,references:d,anonymous_message:p,mention_everyone:g,avatar:f,code:y,topic_id:b}}};return Promise.race([this.send({urlPath:A,fetchOptions:C}).then(v=>l(this,null,function*(){return{}})),new Promise((v,M)=>setTimeout(()=>M(new Error("Request timed out.")),this.timeoutMs))])})}writeEphemeralMessage(e,t,n,o,a,c,r,i,d,p,g,f,y,b,A){return l(this,null,function*(){let C="",v={ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:n,mode:o,is_public:a,content:c,mentions:r,attachments:i,references:d,anonymous_message:p,mention_everyone:g,avatar:f,code:y,topic_id:b,id:A}}};return Promise.race([this.send({urlPath:C,fetchOptions:v}).then(M=>l(this,null,function*(){return{}})),new Promise((M,O)=>setTimeout(()=>O(new Error("Request timed out.")),this.timeoutMs))])})}writeChatMessage(e,t,n,o,a,c,r,i,d,p,g,f,y){return l(this,null,function*(){let b="",A={channel_message_send:{clan_id:e,channel_id:t,mode:n,is_public:o,content:a,mentions:c,attachments:r,references:i,anonymous_message:d,mention_everyone:p,avatar:g,code:f,topic_id:y}};return Promise.race([this.send({urlPath:b,fetchOptions:A}).then(C=>l(this,null,function*(){return{}})),new Promise((C,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageReaction(e,t,n,o,a,c,r,i,d,p,g,f,y,b){return l(this,null,function*(){let A="",C={message_reaction_event:{id:e,clan_id:t,channel_id:n,mode:o,is_public:a,message_id:c,emoji_id:r,emoji:i,count:d,message_sender_id:p,action:g,topic_id:f,emoji_recent_id:y,sender_name:b}};return Promise.race([this.send({urlPath:A,fetchOptions:C}).then(v=>l(this,null,function*(){return{}})),new Promise((v,M)=>setTimeout(()=>M(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageTyping(e,t,n,o,a,c){return l(this,null,function*(){let r="",i={message_typing_event:{clan_id:e,channel_id:t,mode:n,is_public:o,sender_display_name:a,topic_id:c}};return Promise.race([this.send({urlPath:r,fetchOptions:i}).then(d=>l(this,null,function*(){return{}})),new Promise((d,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])})}writeLastSeenMessage(e,t,n,o,a,c){return l(this,null,function*(){let r="",i={last_seen_message_event:{clan_id:e,channel_id:t,mode:n,message_id:o,timestamp_seconds:a,badge_count:c}};return Promise.race([this.send({urlPath:r,fetchOptions:i}).then(d=>l(this,null,function*(){return{}})),new Promise((d,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])})}writeLastPinMessage(e,t,n,o,a,c,r,i,d,p,g,f,y){return l(this,null,function*(){let b="",A={last_pin_message_event:{clan_id:e,channel_id:t,mode:n,is_public:o,message_id:a,timestamp_seconds:c,operation:r,message_sender_avatar:i,message_sender_id:d,message_sender_username:p,message_content:g,message_attachment:f,message_created_time:y}};return Promise.race([this.send({urlPath:b,fetchOptions:A}).then(C=>l(this,null,function*(){return{}})),new Promise((C,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])})}writeCustomStatus(e,t,n,o){return l(this,null,function*(){let a="",c={custom_status_event:{clan_id:e,status:t,time_reset:n,no_clear:o}};return Promise.race([this.send({urlPath:a,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceReaction(e,t){return l(this,null,function*(){let n="",o={voice_reaction_send:{emojis:e,channel_id:t}};return Promise.race([this.send({urlPath:n,fetchOptions:o}).then(a=>l(this,null,function*(){return{}})),new Promise((a,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}forwardWebrtcSignaling(e,t,n,o,a){return l(this,null,function*(){let c="",r={webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:n,channel_id:o,caller_id:a}};return Promise.race([this.send({urlPath:c,fetchOptions:r}).then(i=>l(this,null,function*(){return{}})),new Promise((i,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,o){return l(this,null,function*(){let a="",c={incoming_call_push:{receiver_id:e,json_data:t,channel_id:n,caller_id:o}};return Promise.race([this.send({urlPath:a,fetchOptions:c}).then(r=>l(this,null,function*(){return{}})),new Promise((r,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])})}writeChannelAppEvent(e,t,n){return l(this,null,function*(){let o="",a={channel_app_event:{clan_id:e,channel_id:t,action:n}};return Promise.race([this.send({urlPath:o,fetchOptions:a}).then(c=>l(this,null,function*(){return{}})),new Promise((c,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}listDataSocket(e){return l(this,null,function*(){let t="",n={list_data_socket:e};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(o=>l(this,null,function*(){return o})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}};N.DefaultSendTimeoutMs=1e4;var x=N;var be="127.0.0.1",Ce="7350",Ae="defaultkey",Pe=3e4,h={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},ne=!1,T=class T{constructor(e=Ae,t=be,n=Ce,o=!1,a=null,c=Pe,r=!0){this.serverkey=e;this.timeout=c;this.autoFallbackHttp=r;this.verbose=!1;this.host=t,this.port=n,this.useSSL=o;let d=`${o?"https://":"http://"}${t}:${n}`;this._heartbeatTimeoutMs=T.DefaultHeartbeatTimeoutMs,this._connectionState=h.DISCONNECTED,this.transport=new x(e,c,a,d)}isOpen(){return this._connectionState===h.CONNECTED}setTransportAdapter(e){this.transport.setTransportAdapter(e)}connect(e,t,n=!1,o=!1,a=T.DefaultConnectTimeoutMs){if(this.verbose=o,this._connectionState===h.CONNECTED)return Promise.resolve();if(this._connectionState===h.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=h.CONNECTING,this.transport.connect(e,t,n,o,(r,i)=>l(this,null,function*(){if(!i.cid)if(i.notifications)i.notifications.notifications.forEach(d=>{d.content=d.content?W(d.content):void 0,this.onnotification(d)});else if(i.voice_started_event)this.onvoicestarted(i.voice_started_event);else if(i.voice_ended_event)this.onvoiceended(i.voice_ended_event);else if(i.voice_joined_event)this.onvoicejoined(i.voice_joined_event);else if(i.voice_leaved_event)this.onvoiceleaved(i.voice_leaved_event);else if(i.channel_created_event)this.onchannelcreated(i.channel_created_event);else if(i.category_event)this.oncategoryevent(i.category_event);else if(i.role_event)this.onroleevent(i.role_event);else if(i.event_emoji)this.oneventemoji(i.event_emoji);else if(i.noti_user_channel)this.oneventnotiuserchannel(i.noti_user_channel);else if(i.webhook_event)this.oneventwebhook(i.webhook_event);else if(i.channel_deleted_event)this.onchanneldeleted(i.channel_deleted_event);else if(i.clan_deleted_event)this.onclandeleted(i.clan_deleted_event);else if(i.sticker_create_event)this.onstickercreated(i.sticker_create_event);else if(i.sticker_update_event)this.onstickerupdated(i.sticker_update_event);else if(i.sticker_delete_event)this.onstickerdeleted(i.sticker_delete_event);else if(i.channel_updated_event)this.onchannelupdated(i.channel_updated_event);else if(i.delete_account_event)this.ondeleteaccount(i.delete_account_event);else if(i.clan_profile_updated_event)this.onclanprofileupdated(i.clan_profile_updated_event);else if(i.clan_updated_event)this.onclanupdated(i.clan_updated_event);else if(i.last_seen_message_event)this.onlastseenupdated(i.last_seen_message_event);else if(i.status_presence_event)this.onstatuspresence(i.status_presence_event);else if(i.channel_message){let d=H(i);this.onchannelmessage(d)}else i.message_typing_event?this.onmessagetyping(i.message_typing_event):i.message_reaction_event?this.onmessagereaction(i.message_reaction_event):i.channel_presence_event?this.onchannelpresence(i.channel_presence_event):i.last_pin_message_event?this.onpinmessage(i.last_pin_message_event):i.custom_status_event?this.oncustomstatus(i.custom_status_event):i.canvas_event?this.oncanvasevent(i.canvas_event):i.user_channel_added_event?this.onuserchanneladded(i.user_channel_added_event):i.add_clan_user_event?this.onuserclanadded(i.add_clan_user_event):i.user_profile_updated_event?this.onuserprofileupdate(i.user_profile_updated_event):i.user_channel_removed_event?this.onuserchannelremoved(i.user_channel_removed_event):i.block_friend?this.onblockfriend(i.block_friend):i.un_block_friend?this.onunblockfriend(i.un_block_friend):i.add_friend?this.onaddfriend(i.add_friend):i.remove_friend?this.onremovefriend(i.remove_friend):i.user_clan_removed_event?this.onuserclanremoved(i.user_clan_removed_event):i.clan_event_created?this.oneventcreated(i.clan_event_created):i.give_coffee_event?this.oncoffeegiven(i.give_coffee_event):i.role_assign_event?this.onroleassign(i.role_assign_event):i.streaming_started_event?this.onstreamingchannelstarted(i.streaming_started_event):i.streaming_ended_event?this.onstreamingchannelended(i.streaming_ended_event):i.streaming_joined_event?this.onstreamingchanneljoined(i.streaming_joined_event):i.streaming_leaved_event?this.onstreamingchannelleaved(i.streaming_leaved_event):i.permission_set_event?this.onpermissionset(i.permission_set_event):i.permission_changed_event?this.onpermissionchanged(i.permission_changed_event):i.unmute_event?this.onunmuteevent(i.unmute_event):i.token_sent_event?this.ontokensent(i.token_sent_event):i.message_button_clicked?this.onmessagebuttonclicked(i.message_button_clicked):i.dropdown_box_selected?this.onmessagedropdownboxselected(i.dropdown_box_selected):i.mark_as_read?this.onmarkasread(i.mark_as_read):i.voice_reaction_send?this.onvoicereactionmessage(i.voice_reaction_send):i.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(i.webrtc_signaling_fwd):i.list_activity?this.onactivityupdated(i.list_activity):i.sd_topic_event?this.onsdtopicevent(i.sd_topic_event):i.channel_app_event?this.onchannelappevent(i.channel_app_event):i.user_status_event?this.onuserstatusevent(i.user_status_event):i.join_channel_app_data?this.onjoinchannelappevent(i.join_channel_app_data):i.unpin_message_event?this.onunpinmessageevent(i.unpin_message_event):i.quick_menu_event?this.onquickmenuevent(i.quick_menu_event):i.meet_participant_event?this.onmeetparticipantevent(i.meet_participant_event):i.transfer_ownership_event?this.ontransferownership(i.transfer_ownership_event):i.ban_user_event?this.onbanneduser(i.ban_user_event):i.list_channel_users_banned_event?this.onlistchannelusersbanned(i.list_channel_users_banned_event):i.allow_anonymous_event?this.onallowanonymousevent(i.allow_anonymous_event):i.aiagent_enabled_event?this.onaiagentenabled(i.aiagent_enabled_event):i.refresh_session_event?this.onrefreshsession(i.refresh_session):i.pong?this.verbose&&window&&window.console&&console.log("Pong message received: %o",i):this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",i)}),r=>l(this,null,function*(){this._connectionState=h.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(r)}));let c=new Promise((r,i)=>{this.transport.setOnOpen(d=>{this.verbose&&window&&window.console&&console.log(d);let p=ne;ne=!0,this.clearConnectTimeout(),this._connectionState=h.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,r(),p&&this.onreconnect(d)}),this.transport.setOnError(d=>{this._connectionState=h.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(d),this._connectPromise=void 0,this.transport.close(),i(d)}),this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=h.DISCONNECTED,this.stopHeartbeatLoop(),this.transport.close(),this._connectPromise=void 0,i("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},a)});return this._connectPromise=c,this._connectPromise}pingPong(){return l(this,null,function*(){if(!this.isOpen()){this._connectionState=h.DISCONNECTED,this.stopHeartbeatLoop();return}try{let e="",t={ping:{}};yield this.transport.send({urlPath:e,fetchOptions:t},this._heartbeatTimeoutMs)}catch(e){this._connectionState=h.DISCONNECTED,this.stopHeartbeatLoop(),this.isOpen()&&(window&&window.console&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this.transport.close());return}this.startHeartbeatLoop()})}startHeartbeatLoop(){this.stopHeartbeatLoop(),this._heartbeatTimer=setTimeout(()=>this.pingPong(),this._heartbeatTimeoutMs)}stopHeartbeatLoop(){this._heartbeatTimer!==void 0&&(clearTimeout(this._heartbeatTimer),this._heartbeatTimer=void 0)}clearConnectTimeout(){this._connectTimeoutTimer!==void 0&&(clearTimeout(this._connectTimeoutTimer),this._connectTimeoutTimer=void 0)}onreconnect(e){this.verbose&&window&&window.console&&console.log(e)}ondisconnect(e){this.verbose&&window&&window.console&&console.log(e)}onerror(e){this._connectionState=h.DISCONNECTED,this.stopHeartbeatLoop(),this.verbose&&window&&window.console&&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)}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)}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)}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){console.log(`Token refresh occurred. Token: ${e.token}`)}authenticateMezon(e,t,n,o,a={},c={}){let r={token:e,vars:a};return this.transport.authenticateMezon(this.serverkey,"",r,t,n,o,c).then(i=>({token:i.token||"",refresh_token:i.refresh_token||"",created:i.created||!1,api_url:i.api_url||"",ws_url:i.ws_url||"",id_token:i.id_token||"",is_remember:i.is_remember||!1}))}authenticateSMSOTPRequest(e,t,n){let o={username:t,account:{phoneno:e,vars:n}};return this.transport.AuthenticateSMSOTPRequest(this.serverkey,"",o,t).then(a=>Promise.resolve(a))}authenticateEmailOTPRequest(e,t,n){let o={username:t,account:{email:e,vars:n}};return this.transport.AuthenticateEmailOTPRequest(this.serverkey,"",o,t).then(a=>Promise.resolve(a))}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}))})}authenticateEmail(e,t,n,o){let a={username:n,account:{email:e,password:t,vars:o}};return this.transport.authenticateEmail(this.serverkey,"",a,n).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}))}setBasePath(e,t,n){this.host=e,this.port=t,this.useSSL=n;let a=`${n?"https://":"http://"}${e}:${t}`;return this.transport.setBasePath(a)}addChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelUsers(t,n).then(o=>o!==void 0)})}addFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.blockFriends(t,n).then(o=>Promise.resolve(o!=null))})}unblockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unblockFriends(t,n).then(o=>Promise.resolve(o!=null))})}uploadOauthFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadOauthFile(t)})}uploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadAttachmentFile(t)})}multipartUploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFile(t)})}multipartUploadAttachmentFileFinish(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFileFinsih(t)})}createChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.checkDuplicateName(t)})}createCategoryDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.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!==h.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!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteFriends(t,n).then(o=>o!==void 0)})}deleteChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelDesc(t,n).then(o=>o!==void 0)})}deleteClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanDesc(t).then(n=>n!==void 0)})}deleteCategoryDesc(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteCategoryDesc(t,n,o).then(a=>a!==void 0)})}deleteNotifications(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotifications(t,n).then(o=>Promise.resolve(o!=null))})}deleteRole(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRole(t,"0",n,o).then(a=>a!==void 0)})}deleteEvent(e,t,n,o,a,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(t,n,o,a,c).then(r=>r!==void 0)})}updateEventUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeClanUsers(t,n).then(o=>Promise.resolve(o!=null))})}listBannedUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listBannedUsers(t,n).then(o=>Promise.resolve(o))})}unbanClanUsers(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unbanClanUsers(t,n,o).then(a=>Promise.resolve(a!=null))})}banClanUsers(e,t,n,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.banClanUsers(t,n,o,a).then(c=>Promise.resolve(c!=null))})}removeChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelUsers(t,n).then(o=>Promise.resolve(o!=null))})}listChannelMessages(e,t,n,o,a,c,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelMessages(t,n,o,a,c,r).then(i=>{let d={messages:[],last_seen_message:i.last_seen_message,last_sent_message:i.last_sent_message};return i.messages==null||i.messages.forEach(p=>{let g,f,y,b,A;try{g=P(p.content)}catch(C){console.log("error parse content",C)}try{let C=z(p.reactions);f=(C==null?void 0:C.reactions)||C||P(p.reactions||"[]")}catch(C){f=P(p.reactions||"[]")}try{let C=U(p.mentions);y=(C==null?void 0:C.mentions)||C||P(p.mentions||"[]")}catch(C){y=P(p.mentions||"[]")}try{let C=D(p.attachments);b=(C==null?void 0:C.attachments)||C||P(p.attachments||"[]")}catch(C){b=P(p.attachments||"[]")}try{let C=F(p.references);A=(C==null?void 0:C.refs)||C||P(p.references||"[]")}catch(C){A=P(p.references||"[]")}d.messages.push({channel_id:p.channel_id,code:p.code?Number(p.code):0,id:p.message_id||"",sender_id:p.sender_id,username:p.username,display_name:p.display_name,avatar:p.avatar,content:g,channel_label:p.channel_label,clan_logo:p.clan_logo,category_name:p.category_name,clan_nick:p.clan_nick,clan_avatar:p.clan_avatar,attachments:b,mentions:y,reactions:f,references:A,clan_id:p.clan_id,create_time_seconds:p.create_time_seconds,update_time_seconds:p.update_time_seconds,hide_editted:p.hide_editted})}),Promise.resolve(d)})})}listChannelVoiceUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelVoiceUsers(t,n).then(o=>{let a={voice_channel_users:[]};return o.voice_channel_users==null||o.voice_channel_users.forEach(c=>{a.voice_channel_users.push({id:c.id,channel_id:c.channel_id,user_ids:c.user_ids,participant:c.participant})}),Promise.resolve(a)})})}listChannelUsers(e,t,n,o,a,c,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(t,n,o,c,a,r).then(i=>{let d={channel_users:[],cursor:i.cursor,channel_id:i.channel_id};return i.channel_users==null||i.channel_users.forEach(p=>{d.channel_users.push({user_id:p.user_id,role_id:p.role_id,thread_id:p.thread_id,clan_avatar:p.clan_avatar,clan_nick:p.clan_nick,id:p.id,clan_id:p.clan_id,added_by:p.added_by,is_banned:p.is_banned})}),Promise.resolve(d)})})}listChannelAttachments(e,t,n,o,a,c,r,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(n,t,o,c,a,r,i).then(d=>{let p={attachments:[]};return d.attachments==null||d.attachments.forEach(g=>{p.attachments.push({filename:g.filename,filesize:g.filesize,filetype:g.filetype,id:g.id,uploader:g.uploader,url:g.url,message_id:g.message_id,create_time_seconds:g.create_time_seconds,width:g.width,height:g.height})}),Promise.resolve(p)})})}listClanUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsers(t).then(n=>{let o={clan_users:[],cursor:n.cursor,clan_id:n.clan_id};return n.clan_users==null||n.clan_users.forEach(a=>{var c;o.clan_users.push({user:{avatar_url:a.user.avatar_url,create_time_seconds:a.user.create_time_seconds,display_name:a.user.display_name,edge_count:a.user.edge_count?Number(a.user.edge_count):0,id:a.user.id,lang_tag:a.user.lang_tag,location:a.user.location,online:a.user.online,is_mobile:(c=a.user)==null?void 0:c.is_mobile,timezone:a.user.timezone,update_time:a.user.update_time,username:a.user.username,user_status:a.user.user_status,status:a.user.status,about_me:a.user.about_me,mezon_id:a.user.mezon_id,list_nick_names:a.user.list_nick_names,phone_number:a.user.phone_number,join_time_seconds:a.user.join_time_seconds},role_id:a.role_id,clan_nick:a.clan_nick,clan_avatar:a.clan_avatar})}),Promise.resolve(o)})})}listClanUsersStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsersStatus(t).then(n=>{let o={clan_user_statuses:[]};return n.clan_user_statuses==null||n.clan_user_statuses.forEach(a=>{o.clan_user_statuses.push({user_id:a.user_id,user_status:a.user_status})}),Promise.resolve(o)})})}listChannelDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDetail(t).then(n=>Promise.resolve(n))})}listChannelDescs(e,t,n,o,a,c,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDescs(t,n,o,a,c,r).then(i=>{let d={channeldesc:[],next_cursor:i.next_cursor,prev_cursor:i.prev_cursor,cacheable_cursor:i.cacheable_cursor};return i.channeldesc==null||(d.channeldesc=i.channeldesc),Promise.resolve(d)})})}listClanDescs(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanDescs(t,n,o).then(a=>{let c={clandesc:[]};return a.clandesc==null||(c.clandesc=a.clandesc),Promise.resolve(c)})})}listChannelBadgeCount(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelBadgeCount(t,n,o).then(a=>{var c;return{channeldesc:(c=a.channeldesc)!=null?c:[],total_count:a.total_count}})})}listUserOnline(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserOnline(t,n,o).then(a=>{var c;return{users:(c=a.users)!=null?c:[],total_count:a.total_count}})})}listCategoryDescs(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listCategoryDescs(t,n,o).then(a=>{let c={categorydesc:[]};return a.categorydesc==null||(c.categorydesc=a.categorydesc),Promise.resolve(c)})})}listEvents(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRolePermissions(t).then(n=>Promise.resolve(n))})}listRoleUsers(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoleUsers(t,n,o).then(a=>Promise.resolve(a))})}registFCMDeviceToken(e,t,n,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registFCMDeviceToken(t,n,o,a).then(c=>Promise.resolve(c))})}getUserProfileOnClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLinkMezonOTP(t)})}linkSMS(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkEmail(t).then(n=>Promise.resolve(n))})}listFriends(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listFriends(n,t,o).then(a=>{let c={friends:[],cursor:a.cursor};return a.friends==null||a.friends.forEach(r=>{var i;c.friends.push({user:{avatar_url:r.user.avatar_url,create_time_seconds:r.user.create_time_seconds,display_name:r.user.display_name,edge_count:r.user.edge_count?Number(r.user.edge_count):0,id:r.user.id,lang_tag:r.user.lang_tag,location:r.user.location,online:r.user.online,timezone:r.user.timezone,update_time:r.user.update_time,username:r.user.username,is_mobile:(i=r.user)==null?void 0:i.is_mobile,user_status:r.user.user_status,status:r.user.status,mezon_id:r.user.mezon_id,list_nick_names:r.user.list_nick_names,phone_number:r.user.phone_number,about_me:r.user.about_me},state:r.state,source_id:r.source_id})}),Promise.resolve(c)})})}listNotifications(e,t,n,o,a,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listNotifications(n,t,o,a,c).then(r=>{let i={cacheable_cursor:r.cacheable_cursor,notifications:[]};return r.notifications==null||r.notifications.forEach(d=>{i.notifications.push({id:d.id,subject:d.subject,content:d.content?W(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(i)})})}sessionLogout(e,t,n,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sessionLogout({refresh_token:n,token:t,device_id:o,platform:a}).then(c=>c!==void 0)})}unlinkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkEmail(t).then(n=>n!==void 0)})}updateUsername(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelDesc(t,n).then(o=>o!==void 0)})}updateClanDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanDesc(t,n).then(o=>o!==void 0)})}updateCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategory(t,n).then(o=>o!==void 0)})}updateUserProfileByClan(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserProfileByClan(t,n).then(o=>o!==void 0)})}updateRole(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRole(t,n).then(o=>o!==void 0)})}updateEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEvent(t,n).then(o=>o!==void 0)})}updateApp(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateApp(t,n).then(o=>Promise.resolve(o))})}createLinkInviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.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!==h.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!==h.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!==h.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!==h.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!==h.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!==h.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!==h.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!==h.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!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMessage(t).then(n=>Promise.resolve(n))})}createMessage2Inbox(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPinMessage(t).then(n=>Promise.resolve(n))})}pinMessagesList(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPinMessagesList(t,n,o).then(a=>{let c={pin_messages_list:[]};return a.pin_messages_list==null||a.pin_messages_list.forEach(r=>{c.pin_messages_list.push({id:r.id,avatar:r.avatar,channel_id:r.channel_id,content:r.content,create_time_seconds:r.create_time_seconds,message_id:r.message_id,sender_id:r.sender_id,username:r.username,attachment:r.attachment})}),Promise.resolve(c)})})}deletePinMessage(e,t,n,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deletePinMessage(t,n,o,a).then(c=>c!==void 0)})}createClanEmoji(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanEmojiById(t,n).then(o=>o!==void 0)})}deleteByIdClanEmoji(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanEmojiById(t,n,o).then(a=>a!==void 0)})}generateWebhookLink(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listWebhookByChannelId(t,n).then(o=>Promise.resolve(o))})}updateWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateWebhookById(t,n).then(o=>o!==void 0)})}deleteWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteWebhookById(t,n).then(o=>o!==void 0)})}addClanSticker(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addClanSticker(t).then(n=>n!==void 0)})}deleteClanStickerById(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanStickerById(t,n,o).then(a=>a!==void 0)})}updateClanStickerById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanStickerById(t,n).then(o=>o!==void 0)})}changeChannelCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.changeChannelCategory(t,n).then(o=>o!==void 0)})}setRoleChannelPermission(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAppToClan(t,n).then(o=>o!==void 0)})}getSystemMessagesList(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateSystemMessage(t,n).then(o=>Promise.resolve(o))})}deleteSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategoryOrder(t).then(n=>Promise.resolve(n))})}givecoffee(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.giveMeACoffee(t).then(n=>n!==void 0)})}sendToken(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendToken(t).then(n=>n!==void 0)})}listStreamingChannelUsers(e,t,n,o,a,c,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(t,n,o,c,a,r).then(i=>{let d={streaming_channel_users:[]};return i.streaming_channel_users==null||i.streaming_channel_users.forEach(p=>{d.streaming_channel_users.push({id:p.id,channel_id:p.channel_id,user_id:p.user_id,participant:p.participant})}),Promise.resolve(d)})})}registerStreamingChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelApps(t).then(n=>{let o={channel_apps:[]};return n.channel_apps==null||n.channel_apps.forEach(a=>{o.channel_apps.push({id:a.id,channel_id:a.channel_id,app_id:a.app_id,clan_id:a.clan_id,app_url:a.app_url,app_name:a.app_name,app_logo:a.app_logo})}),Promise.resolve(o)})})}getChannelCategoryNotiSettingsList(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.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!==h.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!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsersUC(t,n).then(o=>Promise.resolve(o))})}getListEmojisByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserClansByUserId(e.token).then(t=>Promise.resolve(t))})}listRoles(e,t,n,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoles(t,n,o,a).then(c=>{let r={clan_id:t,roles:c.roles};return Promise.resolve(r)})})}listUserPermissionInChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserPermissionInChannel(t,n).then(o=>{let a={clan_id:t,channel_id:n,permissions:o.permissions};return Promise.resolve(a)})})}getPermissionByRoleIdChannelId(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPermissionByRoleIdChannelId(t,n,o).then(a=>{let c={role_id:t,channel_id:n,permission_role_channel:a.permission_role_channel,user_id:o};return Promise.resolve(c)})})}markAsRead(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.markAsRead(t).then(n=>Promise.resolve(n))})}listThreadDescs(e,t,n,o,a,c,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listThreadDescs(t,n,o,a,c,r).then(i=>{let d={channeldesc:[]};return i.channeldesc==null||(d.channeldesc=i.channeldesc),Promise.resolve(d)})})}listChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelTimeline(t).then(n=>{var o;return(o=n.events)==null||o.forEach(a=>{a.attachments=[];let c;try{let r=q(a.preview_imgs);c=(r==null?void 0:r.attachments)||r||P(a.preview_imgs||"[]")}catch(r){c=P(a.preview_imgs||"[]")}Array.isArray(c)?a.preview_imgs=c:a.preview_imgs=[]}),Promise.resolve(n)})})}createChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelTimeline(t).then(n=>{let o=n.event;if(o){let a,c;try{let r=q(o.attachments),i=q(o.preview_imgs);a=(r==null?void 0:r.attachments)||r||P(o.attachments||"[]"),c=(i==null?void 0:i.attachments)||i||P(o.preview_imgs||"[]")}catch(r){a=P(o.attachments||"[]"),c=P(o.preview_imgs||"[]")}Array.isArray(a)?o.attachments=a:o.attachments=[],Array.isArray(c)?o.preview_imgs=c:o.preview_imgs=[]}return Promise.resolve(n)})})}updateChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelTimeline(t).then(n=>{let o=n.event;if(o){let a,c;try{let r=q(o.attachments),i=q(o.preview_imgs);a=(r==null?void 0:r.attachments)||r||P(o.attachments||"[]"),c=(i==null?void 0:i.attachments)||i||P(o.preview_imgs||"[]")}catch(r){a=P(o.attachments||"[]"),c=P(o.preview_imgs||"[]")}Array.isArray(a)?o.attachments=a:o.attachments=[],Array.isArray(c)?o.preview_imgs=c:o.preview_imgs=[]}return Promise.resolve(n)})})}detailChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.detailChannelTimeline(t).then(n=>{let o=n.event;if(o){let a,c;try{let r=q(o.attachments),i=q(o.preview_imgs);a=(r==null?void 0:r.attachments)||r||P(o.attachments||"[]"),c=(i==null?void 0:i.attachments)||i||P(o.preview_imgs||"[]")}catch(r){a=P(o.attachments||"[]"),c=P(o.preview_imgs||"[]")}Array.isArray(a)?o.attachments=a:o.attachments=[],Array.isArray(c)?o.preview_imgs=c:o.preview_imgs=[]}return Promise.resolve(n)})})}leaveThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveThread(t,n).then(o=>Promise.resolve(o))})}archiveChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.archiveChannel(t,n).then(o=>Promise.resolve(o))})}listArchivedChannelDescs(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listArchivedChannelDescs(t).then(n=>Promise.resolve(n))})}getChannelSettingInClan(e,t,n,o,a,c,r,i,d,p,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelSetting(t,n,o,a,c,r,i,d,p,g).then(f=>Promise.resolve(f))})}getChannelCanvasList(e,t,n,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasList(t,n,o,a).then(c=>{let r={channel_canvases:[]};return c.channel_canvases==null||(r.clan_id=c.clan_id,r.channel_id=c.channel_id,r.channel_canvases=c.channel_canvases,r.count=c.count),Promise.resolve(r)})})}getChannelCanvasDetail(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasDetail(t,n,o).then(a=>Promise.resolve(a))})}editChannelCanvases(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.editChannelCanvases(t).then(n=>Promise.resolve(n))})}deleteChannelCanvas(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelCanvas(t,n,o).then(a=>a!==void 0)})}addFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelFavorite({channel_id:t,clan_id:n}).then(o=>o)})}removeFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelFavorite(t,n).then(o=>o)})}getListFavoriteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.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}:null})}confirmLogin(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLogin(t,n).then(o=>o)})}getChanEncryptionMethod(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setChanEncryptionMethod(t,{method:n}).then(o=>o)})}getPubKeys(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getKeyServer(e.token).then(t=>t)})}listAuditLog(e,t,n,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listAuditLog(t,n,o,a).then(c=>c)})}listOnboarding(e,t,n,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboarding(t,n,o,a).then(c=>c)})}getOnboardingDetail(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOnboardingDetail(t,n).then(o=>Promise.resolve(o))})}createOnboarding(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboarding(t,n).then(o=>o!==void 0)})}deleteOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteOnboarding(t,n).then(o=>o!==void 0)})}generateClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanWebhookById(t,n).then(o=>o!==void 0)})}updateClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanWebhookById(t,n).then(o=>o!==void 0)})}listOnboardingStep(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboardingStep(t,n,o).then(a=>Promise.resolve(a))})}updateOnboardingStepByClanId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboardingStepByClanId(t,n).then(o=>o!==void 0)})}updateUserStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserStatus(e.token).then(t=>Promise.resolve(t))})}listSdTopic(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listSdTopic(t,n).then(o=>Promise.resolve(o))})}createSdTopic(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSdTopic(t).then(n=>n)})}getTopicDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getMezonOauthClient(t,n).then(o=>Promise.resolve(o))})}updateMezonOauthClient(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonOauthClient(t).then(n=>Promise.resolve(n))})}searchThread(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchThread(t,n,o).then(a=>Promise.resolve(a))})}generateHashChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateHashChannelApps(t).then(n=>Promise.resolve(n))})}registrationPassword(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registrationEmail({email:t,password:n,old_password:o}).then(a=>Promise.resolve(a))})}addUserEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteUserEvent(t,n).then(o=>o!==void 0)})}updateRoleOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createExternalMezonMeet(e.token).then(t=>Promise.resolve(t))})}generateMeetTokenExternal(e,t,n,o,a){return l(this,null,function*(){return this.transport.generateMeetTokenExternal(e,t,n,o,a).then(c=>Promise.resolve(c))})}removeMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanOrder(t).then(n=>n!==void 0)})}listClanDiscover(e,t){return l(this,null,function*(){return this.transport.clanDiscover(this.serverkey,"",e,t).then(n=>Promise.resolve(n))})}listQuickMenuAccess(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listQuickMenuAccess(t,n,o).then(a=>Promise.resolve(a))})}deleteQuickMenuAccess(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteQuickMenuAccess(t,n).then(o=>o!==void 0)})}addQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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!==h.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!==h.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!==h.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!==h.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!==h.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!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.reportMessageAbuse(t,n).then(o=>o!==void 0)})}updateMezonVoiceState(e,t,n,o,a,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonVoiceState(t,n,o,a,c).then(r=>r!==void 0)})}sendChannelMessage(e,t,n,o,a,c,r,i,d,p,g,f,y,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendChannelMessage(t,n,o,a,c,r,i,d,p,g,f,y,b).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,n,o,a,c,r,i,d,p,g,f){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(t,n,o,a,c,r,i,d,p,g,f).then(y=>Promise.resolve(y))})}deleteChannelMessage(e,t,n,o,a,c,r,i,d,p){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelMessage(t,n,o,a,c,r,i,d,p).then(g=>Promise.resolve(g))})}messageButtonClick(e,t,n,o,a,c,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.messageButtonClick(t,n,o,a,c,r).then(i=>Promise.resolve(i))})}dropdownBoxSelected(e,t,n,o,a,c,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.dropdownBoxSelected(t,n,o,a,c,r).then(i=>Promise.resolve(i))})}activeArchivedThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.activeArchivedThread(t,n).then(o=>Promise.resolve(o))})}addAgentToChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAgentToChannel(t,n).then(o=>Promise.resolve(o))})}disconnectAgent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.disconnectAgent(t,n).then(o=>Promise.resolve(o))})}listMutedChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMutedChannel(t).then(n=>Promise.resolve(n))})}channelMessageReact(e,t,n,o,a,c,r,i,d,p,g,f,y,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.channelMessageReact(t,n,o,a,c,r,i,d,p,g,f,y,b).then(A=>Promise.resolve(A))})}createPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPoll(t)})}votePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.votePoll(t)})}closePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closePoll(t)})}getPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPoll(t)})}followUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.followUsers(t)})}joinClanChat(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinClanChat(t)})}follower(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.follower()})}joinChat(e,t,n,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinChat(t,n,o,a)})}leaveChat(e,t,n,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveChat(t,n,o,a)})}removeChatMessage(e,t,n,o,a,c,r,i,d,p){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChatMessage(t,n,o,a,c,r,i,d,p)})}unfollowUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unfollowUsers(t)})}updateChatMessage(e,t,n,o,a,c,r,i,d,p,g,f){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,o,a,c,r,i,d,p,g,f)})}updateStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateStatus(t)})}writeQuickMenuEvent(e,t,n,o,a,c,r,i,d,p,g,f,y,b,A){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeQuickMenuEvent(t,n,o,a,c,r,i,d,p,g,f,y,b,A)})}writeEphemeralMessage(e,t,n,o,a,c,r,i,d,p,g,f,y,b,A,C){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeEphemeralMessage(t,n,o,a,c,r,i,d,p,g,f,y,b,A,C)})}writeChatMessage(e,t,n,o,a,c,r,i,d,p,g,f,y,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChatMessage(t,n,o,a,c,r,i,d,p,g,f,y,b)})}writeMessageReaction(e,t,n,o,a,c,r,i,d,p,g,f,y,b,A){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageReaction(t,n,o,a,c,r,i,d,p,g,f,y,b,A)})}writeMessageTyping(e,t,n,o,a,c,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageTyping(t,n,o,a,c,r)})}writeLastSeenMessage(e,t,n,o,a,c,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastSeenMessage(t,n,o,a,c,r)})}writeLastPinMessage(e,t,n,o,a,c,r,i,d,p,g,f,y,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastPinMessage(t,n,o,a,c,r,i,d,p,g,f,y,b)})}writeCustomStatus(e,t,n,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeCustomStatus(t,n,o,a)})}writeVoiceReaction(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceReaction(t,n)})}forwardWebrtcSignaling(e,t,n,o,a,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,o,a,c)})}makeCallPush(e,t,n,o,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.makeCallPush(t,n,o,a)})}writeChannelAppEvent(e,t,n,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChannelAppEvent(t,n,o)})}listDataSocket(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listDataSocket(t)})}};T.DefaultHeartbeatTimeoutMs=1e4,T.DefaultConnectTimeoutMs=3e4;var G=T;
1
+ "use strict";var se=Object.create;var L=Object.defineProperty,ie=Object.defineProperties,re=Object.getOwnPropertyDescriptor,oe=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertyNames,j=Object.getOwnPropertySymbols,ce=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var J=(_,e,t)=>e in _?L(_,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):_[e]=t,S=(_,e)=>{for(var t in e||(e={}))V.call(e,t)&&J(_,t,e[t]);if(j)for(var t of j(e))le.call(e,t)&&J(_,t,e[t]);return _},w=(_,e)=>ie(_,oe(e));var de=(_,e)=>{for(var t in e)L(_,t,{get:e[t],enumerable:!0})},Q=(_,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ae(e))!V.call(_,r)&&r!==t&&L(_,r,{get:()=>e[r],enumerable:!(n=re(e,r))||n.enumerable});return _};var K=(_,e,t)=>(t=_!=null?se(ce(_)):{},Q(e||!_||!_.__esModule?L(t,"default",{value:_,enumerable:!0}):t,_)),ue=_=>Q(L({},"__esModule",{value:!0}),_);var d=(_,e,t)=>new Promise((n,r)=>{var o=c=>{try{i(t.next(c))}catch(l){r(l)}},a=c=>{try{i(t.throw(c))}catch(l){r(l)}},i=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,a);i((t=t.apply(_,e)).next())});var Re={};de(Re,{ApiAppRole:()=>Y,ChannelStreamMode:()=>Z,ChannelType:()=>$,Client:()=>G,ConnectionState:()=>h,CreateChannelMessageFromEvent:()=>H,NotificationType:()=>X,WebrtcSignalingType:()=>ee,b64DecodeUnicode:()=>he,b64EncodeUnicode:()=>pe,buildFetchOptions:()=>m,decodeAttachments:()=>D,decodeChannelTimelineAttachments:()=>q,decodeMentions:()=>U,decodeNotificationFcm:()=>W,decodeReactions:()=>z,decodeRefs:()=>F,encodeAttachments:()=>ge,encodeMentions:()=>me,encodeNotificationFcm:()=>ye,encodeReactions:()=>fe,encodeRefs:()=>_e,safeJSONParse:()=>P});module.exports=ue(Re);var mr=require("whatwg-fetch");var B=require("js-base64"),R=K(require("mezon-js-protobuf"));function m(_,e,t){let n=S({method:_},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 pe(_){return(0,B.encode)(encodeURIComponent(_).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function he(_){return decodeURIComponent((0,B.decode)(_).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function P(_){if(_==null)return{t:_};let e;if(_ instanceof Uint8Array)e=new TextDecoder().decode(_);else if(typeof _=="string")e=_;else return typeof _=="object"?_:{t:_};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 E=_=>!_||_===null||_===void 0||_===""||_==="[]";function U(_){if(E(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,r=new Uint8Array(n);return R.MessageMentionList.decode(r)}catch(n){return P(_)}}function D(_){if(E(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,r=new Uint8Array(n);return R.MessageAttachmentList.decode(r)}catch(n){return P(_)}}function q(_){if(E(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,r=new Uint8Array(n);return R.ListChannelTimelineAttachment.decode(r)}catch(n){return P(_)}}function F(_){if(E(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,r=new Uint8Array(n);return R.MessageRefList.decode(r)}catch(n){return P(_)}}function z(_){if(E(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,r=new Uint8Array(n);return R.MessageReactionList.decode(r)}catch(n){return P(_)}}function W(_){if(E(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,r=new Uint8Array(n);return R.DirectFcmProto.decode(r)}catch(n){return P(_)}}function me(_){return R.MessageMentionList.encode(R.MessageMentionList.fromPartial(_)).finish()}function ge(_){return R.MessageAttachmentList.encode(R.MessageAttachmentList.fromPartial(_)).finish()}function _e(_){return R.MessageRefList.encode(R.MessageRefList.fromPartial(_)).finish()}function fe(_){return R.MessageReactionList.encode(R.MessageReactionList.fromPartial(_)).finish()}function ye(_){return R.DirectFcmProto.encode(R.DirectFcmProto.fromPartial(_)).finish()}var Y=(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))(Y||{}),$=(l=>(l[l.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",l[l.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",l[l.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",l[l.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",l[l.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",l[l.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",l[l.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",l[l.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",l[l.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",l))($||{}),Z=(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))(Z||{}),X=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(X||{}),ee=(l=>(l[l.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",l[l.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",l[l.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",l[l.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",l[l.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",l[l.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",l[l.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",l[l.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",l[l.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",l))(ee||{});function H(_){let e,t,n,r,o,a;try{e=P(_.channel_message.content)}catch(c){console.log("content is invalid",c)}try{t=z(_.channel_message.reactions)}catch(c){console.log("reactions is invalid",c)}try{n=U(_.channel_message.mentions)}catch(c){console.log("mentions is invalid",c)}try{r=D(_.channel_message.attachments)}catch(c){console.log("attachments is invalid",c)}try{o=F(_.channel_message.references)}catch(c){console.log("references is invalid",c)}try{a=_.channel_message.referenced_message}catch(c){console.log("referenced messages is invalid",c)}return{id:_.id||_.channel_message.message_id,avatar:_.channel_message.avatar,channel_id:_.channel_message.channel_id,mode:_.channel_message.mode,channel_label:_.channel_message.channel_label,clan_id:_.channel_message.clan_id,code:_.channel_message.code,message_id:_.channel_message.message_id,sender_id:_.channel_message.sender_id,update_time:_.channel_message.update_time,clan_logo:_.channel_message.clan_logo,category_name:_.channel_message.category_name,username:_.channel_message.username,clan_nick:_.channel_message.clan_nick,clan_avatar:_.channel_message.clan_avatar,display_name:_.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:_.channel_message.hide_editted,is_public:_.channel_message.is_public,create_time_seconds:_.channel_message.create_time_seconds,update_time_seconds:_.channel_message.update_time_seconds,topic_id:_.channel_message.topic_id}}var k=require("js-base64"),s=K(require("mezon-js-protobuf")),te=require("mezon-js-protobuf");var I=(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.ListChannelBadgeCount=17]="ListChannelBadgeCount",u[u.ListClanUsersStatus=18]="ListClanUsersStatus",u[u.ListChannelApps=19]="ListChannelApps",u[u.GetListFavoriteChannel=20]="GetListFavoriteChannel",u[u.ListCategoryDescs=21]="ListCategoryDescs",u[u.ListOnboarding=22]="ListOnboarding",u[u.GetListStickersByUserId=23]="GetListStickersByUserId",u[u.GetSystemMessageByClanId=24]="GetSystemMessageByClanId",u[u.GetPinMessagesList=25]="GetPinMessagesList",u[u.GetChannelCanvasList=26]="GetChannelCanvasList",u[u.ListChannelTimeline=27]="ListChannelTimeline",u[u.ListChannelMessages=28]="ListChannelMessages",u[u.ListActivity=29]="ListActivity",u[u.ListChannelByUserId=30]="ListChannelByUserId",u[u.ListUserClansByUserId=31]="ListUserClansByUserId",u[u.GetUserProfileOnClan=32]="GetUserProfileOnClan",u[u.RegistFCMDeviceToken=33]="RegistFCMDeviceToken",u[u.IsBanned=34]="IsBanned",u[u.ListThreadDescs=35]="ListThreadDescs",u[u.ListArchivedChannelDescs=36]="ListArchivedChannelDescs",u[u.ListChannelDetail=37]="ListChannelDetail",u[u.GetChannelCategoryNotiSettingsList=38]="GetChannelCategoryNotiSettingsList",u[u.ListRoleUsers=39]="ListRoleUsers",u[u.ListChannelUsers=40]="ListChannelUsers",u[u.ListChannelAttachment=41]="ListChannelAttachment",u[u.ListChannelVoiceUsers=42]="ListChannelVoiceUsers",u[u.ListUserOnline=43]="ListUserOnline",u[u.ListNotifications=44]="ListNotifications",u[u.ListChannelUsersUC=45]="ListChannelUsersUC",u[u.ListWebhookByChannelId=46]="ListWebhookByChannelId",u[u.GetPermissionByRoleIdChannelId=47]="GetPermissionByRoleIdChannelId",u[u.ListChannelSetting=48]="ListChannelSetting",u[u.ListApps=49]="ListApps",u[u.GetApp=50]="GetApp",u[u.ListForSaleItems=51]="ListForSaleItems",u[u.ListClanWebhook=52]="ListClanWebhook",u[u.GetUserStatus=53]="GetUserStatus",u[u.ListSdTopic=54]="ListSdTopic",u[u.AddFriends=55]="AddFriends",u[u.AddChannelUsers=56]="AddChannelUsers",u[u.RegistrationEmail=57]="RegistrationEmail",u[u.BlockFriends=58]="BlockFriends",u[u.UnblockFriends=59]="UnblockFriends",u[u.UploadAttachmentFile=60]="UploadAttachmentFile",u[u.UploadOauthFile=61]="UploadOauthFile",u[u.AddRolesChannelDesc=62]="AddRolesChannelDesc",u[u.CreateCategoryDesc=63]="CreateCategoryDesc",u[u.CreateChannelDesc=64]="CreateChannelDesc",u[u.CreateRole=65]="CreateRole",u[u.CreateEvent=66]="CreateEvent",u[u.DeleteRole=67]="DeleteRole",u[u.DeleteEvent=68]="DeleteEvent",u[u.DeleteRoleChannelDesc=69]="DeleteRoleChannelDesc",u[u.DeleteChannelDesc=70]="DeleteChannelDesc",u[u.CloseDMByChannelId=71]="CloseDMByChannelId",u[u.OpenDMByChannelId=72]="OpenDMByChannelId",u[u.DeleteAccount=73]="DeleteAccount",u[u.DeleteFriends=74]="DeleteFriends",u[u.DeleteCategoryDesc=75]="DeleteCategoryDesc",u[u.DeleteNotifications=76]="DeleteNotifications",u[u.DeleteClanDesc=77]="DeleteClanDesc",u[u.UpdateUser=78]="UpdateUser",u[u.UpdateUserProfileByClan=79]="UpdateUserProfileByClan",u[u.UpdateClanOrder=80]="UpdateClanOrder",u[u.RemoveChannelUsers=81]="RemoveChannelUsers",u[u.LeaveThread=82]="LeaveThread",u[u.ArchiveChannel=83]="ArchiveChannel",u[u.LinkSMS=84]="LinkSMS",u[u.ConfirmLinkMezonOTP=85]="ConfirmLinkMezonOTP",u[u.LinkEmail=86]="LinkEmail",u[u.CreateClanDesc=87]="CreateClanDesc",u[u.RemoveClanUsers=88]="RemoveClanUsers",u[u.BanClanUsers=89]="BanClanUsers",u[u.CreateLinkInviteUser=90]="CreateLinkInviteUser",u[u.InviteUser=91]="InviteUser",u[u.SetRoleChannelPermission=92]="SetRoleChannelPermission",u[u.SetNotificationChannelSetting=93]="SetNotificationChannelSetting",u[u.SetMuteChannel=94]="SetMuteChannel",u[u.SetMuteCategory=95]="SetMuteCategory",u[u.SetNotificationClanSetting=96]="SetNotificationClanSetting",u[u.SetNotificationCategorySetting=97]="SetNotificationCategorySetting",u[u.DeleteNotificationCategorySetting=98]="DeleteNotificationCategorySetting",u[u.DeleteNotificationChannel=99]="DeleteNotificationChannel",u[u.CreatePinMessage=100]="CreatePinMessage",u[u.CreateMessage2Inbox=101]="CreateMessage2Inbox",u[u.UnlinkMezon=102]="UnlinkMezon",u[u.UnlinkEmail=103]="UnlinkEmail",u[u.UpdateAccount=104]="UpdateAccount",u[u.UpdateUsername=105]="UpdateUsername",u[u.UpdateCategory=106]="UpdateCategory",u[u.UpdateCategoryOrder=107]="UpdateCategoryOrder",u[u.UpdateRoleOrder=108]="UpdateRoleOrder",u[u.UpdateClanDesc=109]="UpdateClanDesc",u[u.UpdateChannelDesc=110]="UpdateChannelDesc",u[u.UpdateChannelPrivate=111]="UpdateChannelPrivate",u[u.UpdateRole=112]="UpdateRole",u[u.UpdateEvent=113]="UpdateEvent",u[u.SearchMessage=114]="SearchMessage",u[u.CreateClanEmoji=115]="CreateClanEmoji",u[u.DeleteByIdClanEmoji=116]="DeleteByIdClanEmoji",u[u.UpdateClanEmojiById=117]="UpdateClanEmojiById",u[u.GenerateWebhook=118]="GenerateWebhook",u[u.HandleWebhook=119]="HandleWebhook",u[u.UpdateWebhookById=120]="UpdateWebhookById",u[u.DeleteWebhookById=121]="DeleteWebhookById",u[u.AddClanSticker=122]="AddClanSticker",u[u.UpdateClanStickerById=123]="UpdateClanStickerById",u[u.DeleteClanStickerById=124]="DeleteClanStickerById",u[u.ChangeChannelCategory=125]="ChangeChannelCategory",u[u.CheckDuplicateName=126]="CheckDuplicateName",u[u.AddApp=127]="AddApp",u[u.DeleteApp=128]="DeleteApp",u[u.UpdateApp=129]="UpdateApp",u[u.AddAppToClan=130]="AddAppToClan",u[u.CreateSystemMessage=131]="CreateSystemMessage",u[u.UpdateSystemMessage=132]="UpdateSystemMessage",u[u.DeleteSystemMessage=133]="DeleteSystemMessage",u[u.StreamingServerCallback=134]="StreamingServerCallback",u[u.EditChannelCanvases=135]="EditChannelCanvases",u[u.GetChannelCanvasDetail=136]="GetChannelCanvasDetail",u[u.DeleteChannelCanvas=137]="DeleteChannelCanvas",u[u.AddChannelFavorite=138]="AddChannelFavorite",u[u.RemoveChannelFavorite=139]="RemoveChannelFavorite",u[u.CreateActiviy=140]="CreateActiviy",u[u.GetPubKeys=141]="GetPubKeys",u[u.PushPubKey=142]="PushPubKey",u[u.GetChanEncryptionMethod=143]="GetChanEncryptionMethod",u[u.SetChanEncryptionMethod=144]="SetChanEncryptionMethod",u[u.GetKeyServer=145]="GetKeyServer",u[u.ListAuditLog=146]="ListAuditLog",u[u.GetOnboardingDetail=147]="GetOnboardingDetail",u[u.CreateOnboarding=148]="CreateOnboarding",u[u.UpdateOnboarding=149]="UpdateOnboarding",u[u.DeleteOnboarding=150]="DeleteOnboarding",u[u.ListOnboardingStep=151]="ListOnboardingStep",u[u.UpdateOnboardingStep=152]="UpdateOnboardingStep",u[u.GenerateClanWebhook=153]="GenerateClanWebhook",u[u.UpdateClanWebhookById=154]="UpdateClanWebhookById",u[u.DeleteClanWebhookById=155]="DeleteClanWebhookById",u[u.HandleClanWebhook=156]="HandleClanWebhook",u[u.UpdateUserStatus=157]="UpdateUserStatus",u[u.UpdateUserCustomStatus=158]="UpdateUserCustomStatus",u[u.GetTopicDetail=159]="GetTopicDetail",u[u.CreateSdTopic=160]="CreateSdTopic",u[u.DeleteSdTopic=161]="DeleteSdTopic",u[u.CreateExternalMezonMeet=162]="CreateExternalMezonMeet",u[u.GenerateMeetToken=163]="GenerateMeetToken",u[u.RemoveParticipantMezonMeet=164]="RemoveParticipantMezonMeet",u[u.MuteParticipantMezonMeet=165]="MuteParticipantMezonMeet",u[u.CreateRoomChannelApps=166]="CreateRoomChannelApps",u[u.GetMezonOauthClient=167]="GetMezonOauthClient",u[u.DeleteMezonOauthClient=168]="DeleteMezonOauthClient",u[u.UpdateMezonOauthClient=169]="UpdateMezonOauthClient",u[u.SearchThread=170]="SearchThread",u[u.GenerateHashChannelApps=171]="GenerateHashChannelApps",u[u.DeleteUserEvent=172]="DeleteUserEvent",u[u.AddUserEvent=173]="AddUserEvent",u[u.DeleteQuickMenuAccess=174]="DeleteQuickMenuAccess",u[u.AddQuickMenuAccess=175]="AddQuickMenuAccess",u[u.UpdateQuickMenuAccess=176]="UpdateQuickMenuAccess",u[u.TransferOwnership=177]="TransferOwnership",u[u.SendChannelMessage=178]="SendChannelMessage",u[u.UpdateChannelMessage=179]="UpdateChannelMessage",u[u.DeleteChannelMessage=180]="DeleteChannelMessage",u[u.ReportMessageAbuse=181]="ReportMessageAbuse",u[u.MessageButtonClick=182]="MessageButtonClick",u[u.DropdownBoxSelected=183]="DropdownBoxSelected",u[u.ActiveArchivedThread=184]="ActiveArchivedThread",u[u.UpdateChannelTimeline=185]="UpdateChannelTimeline",u[u.AddAgentToChannel=186]="AddAgentToChannel",u[u.DisconnectAgent=187]="DisconnectAgent",u[u.CreateChannelTimeline=188]="CreateChannelTimeline",u[u.DetailChannelTimeline=189]="DetailChannelTimeline",u[u.CreatePoll=190]="CreatePoll",u[u.VotePoll=191]="VotePoll",u[u.ClosePoll=192]="ClosePoll",u[u.GetPoll=193]="GetPoll",u[u.ReactChannelMessage=194]="ReactChannelMessage",u[u.MultipartUploadAttachmentFileStart=195]="MultipartUploadAttachmentFileStart",u[u.MultipartUploadAttachmentFileFinish=196]="MultipartUploadAttachmentFileFinish",u))(I||{}),N=class N{constructor(e,t,n,r){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=r,n?this.adapter=n:this.adapter=new te.WebSocketAdapter}setOnOpen(e){this.adapter.onOpen=e}setOnError(e){this.adapter.onError=e}close(){this.adapter.close()}generatecid(){let e=this.nextCid;return++this.nextCid,e}setTransportAdapter(e){this.adapter=e}setFallbackSession(e){}getApiFromPath(e){if(e in I)return I[e]}connect(e,t,n=!1,r=!1,o,a,i){let[c,l]=t.split(":");this.adapter.connect(c,l,n,e,i),this.adapter.onClose=a,this.adapter.onMessage=(p,g,f)=>d(this,null,function*(){if(r&&window&&window.console&&console.log("incomming message with cid %o and message %o",p,f),p!=0){let y=this.cIds[p];if(!y){console.error("No promise executor for message: %o",f);return}delete this.cIds[p],f.error?y.reject(f.error):y.resolve({code:g,message:f})}else yield o(0,0,f)})}send(e,t=N.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)=>{var c,l;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((l=o.quick_menu_event.message)==null?void 0:l.content));let p=this.generatecid();this.cIds[p]={resolve:a,reject:i},t!==1/0&&t>0&&setTimeout(()=>{i("The socket timed out while waiting for a response.")},t),o.cid=p.toString(),this.adapter.send(o)}})}setBasePath(e){this.basePath=e}deleteAccount(e={}){let t="/mezon.api.Mezon/DeleteAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(o=>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=>d(this,null,function*(){return o.code!=0?{}: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=>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),l=m("POST",r,i);return e&&(l.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),l.headers.Accept="application/x-protobuf",l.headers["Content-Type"]="application/json",Promise.race([fetch(c,l).then(p=>d(this,null,function*(){let g=yield p.arrayBuffer();return s.Session.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/v2/account/authenticate/confirmlogin",o=new Map,a="";a=JSON.stringify(t||{});let i=this.buildFullUrl(e,r,o),c=m("POST",n,a);return c.headers.Accept="application/x-protobuf",c.headers["Content-Type"]="application/json",Promise.race([fetch(i,c).then(l=>l),new Promise((l,p)=>setTimeout(()=>p(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),l=m("POST",r,i);return e&&(l.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),l.headers.Accept="application/x-protobuf",l.headers["Content-Type"]="application/json",Promise.race([fetch(c,l).then(p=>d(this,null,function*(){let g=yield p.arrayBuffer();return s.LoginIDResponse.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(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),l=m("POST",r,i);return e&&(l.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),l.headers.Accept="application/x-protobuf",l.headers["Content-Type"]="application/json",Promise.race([fetch(c,l).then(p=>d(this,null,function*(){let g=yield p.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(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),l=m("POST",r,i);return e&&(l.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),l.headers.Accept="application/x-protobuf",l.headers["Content-Type"]="application/json",Promise.race([fetch(c,l).then(p=>d(this,null,function*(){let g=yield p.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(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),l=m("POST",r,i);return e&&(l.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),l.headers.Accept="application/x-protobuf",l.headers["Content-Type"]="application/json",Promise.race([fetch(c,l).then(p=>d(this,null,function*(){let g=yield p.arrayBuffer();return s.Session.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(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",l=new Map;l.set("create",r),l.set("username",o),l.set("is_remember",a);let p="";p=JSON.stringify(n||{});let g=this.buildFullUrl(this.basePath,c,l),f=m("POST",i,p);return e&&(f.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),f.headers.Accept="application/x-protobuf",Promise.race([fetch(g,f).then(y=>d(this,null,function*(){let b=yield y.arrayBuffer();return s.Session.decode(new Uint8Array(b))})),new Promise((y,b)=>setTimeout(()=>b(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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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),l=m("POST",r,i);return e&&(l.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),l.headers.Accept="application/x-protobuf",l.headers["Content-Type"]="application/json",Promise.race([fetch(c,l).then(p=>d(this,null,function*(){let g=yield p.arrayBuffer();return s.Session.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(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=>d(this,null,function*(){return i.code!=0?{}: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(l=>d(this,null,function*(){return l.code!=0?{}:s.Session.decode(l.message)})),new Promise((l,p)=>setTimeout(()=>p(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=>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=>d(this,null,function*(){return r.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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(l=>d(this,null,function*(){return l.code!=0?{}:s.AppList.decode(l.message)})),new Promise((l,p)=>setTimeout(()=>p(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=>d(this,null,function*(){return c})),new Promise((c,l)=>setTimeout(l,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=>d(this,null,function*(){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=>d(this,null,function*(){return i.code!=0?{}: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(w(S({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>d(this,null,function*(){return c.code!=0?{}:s.App.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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(),l=m("POST",o,"");return l.body=c,Promise.race([this.send({urlPath:a,fetchOptions:l}).then(p=>d(this,null,function*(){return s.ListAuditLog.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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=>d(this,null,function*(){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",l=s.CategoryDesc.encode(s.CategoryDesc.fromPartial({clan_id:e,creator_id:t,category_name:n,category_id:r,category_order:o})).finish(),p=m("POST",a,"");return p.body=l,Promise.race([this.send({urlPath:i,fetchOptions:p}).then(g=>d(this,null,function*(){return g.code!=0?{}:s.CategoryDescList.decode(g.message)})),new Promise((g,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=>d(this,null,function*(){return i.code!=0?{}: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(),l=m("POST",o,"");return l.body=c,Promise.race([this.send({urlPath:a,fetchOptions:l}).then(p=>d(this,null,function*(){return p.code!=0?{}:s.ChannelCanvasListResponse.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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=>d(this,null,function*(){return s.AddFavoriteChannelResponse.decode(i)})),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=>d(this,null,function*(){return c})),new Promise((c,l)=>setTimeout(l,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=>d(this,null,function*(){return i.code!=0?{}: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",p=s.ListChannelMessagesRequest.encode(s.ListChannelMessagesRequest.fromPartial({clan_id:e,channel_id:t,message_id:n,direction:r,limit:o,topic_id:a})).finish(),g=m("POST",i,"");return g.body=p,Promise.race([this.send({urlPath:c,fetchOptions:g}).then(f=>d(this,null,function*(){return s.ChannelMessageList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(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=>d(this,null,function*(){return c})),new Promise((c,l)=>setTimeout(l,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,r,o,a,i,c,l={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let p="/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(),y=m("POST",l,"");return y.body=f,Promise.race([this.send({urlPath:p,fetchOptions:y}).then(b=>d(this,null,function*(){return b.code!=0?{}:s.ChannelAttachmentList.decode(b.message)})),new Promise((b,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=>d(this,null,function*(){return c.code!=0?{}:s.ChanEncryptionMethod.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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(w(S({},t),{channel_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>d(this,null,function*(){return c})),new Promise((c,l)=>setTimeout(l,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=>d(this,null,function*(){return c})),new Promise((c,l)=>setTimeout(l,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=>d(this,null,function*(){return c})),new Promise((c,l)=>setTimeout(l,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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return c})),new Promise((c,l)=>setTimeout(l,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",p=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:o,cursor:a})).finish(),g=m("POST",i,"");return g.body=p,Promise.race([this.send({urlPath:c,fetchOptions:g}).then(f=>d(this,null,function*(){return f.code!=0?{}:s.ChannelUserList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,r,o,a,i={}){let c="/mezon.api.Mezon/ListChannelDescs",p=s.ListChannelDescsRequest.encode(s.ListChannelDescsRequest.fromPartial({limit:e,state:t,page:n,clan_id:r,channel_type:o,is_mobile:a})).finish(),g=m("POST",i,"");return g.body=p,Promise.race([this.send({urlPath:c,fetchOptions:g}).then(f=>d(this,null,function*(){return f.code!=0?{}:s.ChannelDescList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return c.code!=0?{}:s.AllUsersAddChannelResponse.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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=>c),new Promise((c,l)=>setTimeout(l,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(w(S({},t),{channel_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>c),new Promise((c,l)=>setTimeout(l,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,r,o,a,i,c,l,p,g={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let f="/mezon.api.Mezon/ListChannelSetting",b=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:l,channel_label:p})).finish(),A=m("POST",g,"");return A.body=b,Promise.race([this.send({urlPath:f,fetchOptions:A}).then(C=>d(this,null,function*(){return C.code!=0?{}:s.ChannelSettingListResponse.decode(C.message)})),new Promise((C,v)=>setTimeout(()=>v(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=>d(this,null,function*(){return c.code!=0?{}:s.VoiceChannelUserList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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(l=>d(this,null,function*(){return l.code!=0?{}:s.ClanDescList.decode(l.message)})),new Promise((l,p)=>setTimeout(()=>p(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(l=>d(this,null,function*(){return l.code!=0?{}:s.ListChannelBadgeCountResponse.decode(l.message)})),new Promise((l,p)=>setTimeout(()=>p(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(l=>d(this,null,function*(){return l.code!=0?{}:s.ListUserOnlineResponse.decode(l.message)})),new Promise((l,p)=>setTimeout(()=>p(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=>d(this,null,function*(){return i.code!=0?{}: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=>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=>c),new Promise((c,l)=>setTimeout(l,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=>d(this,null,function*(){return{}})),new Promise((c,l)=>setTimeout(()=>l(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=>d(this,null,function*(){return c.code!=0?{}:s.BannedUserList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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(),l=m("POST",o,"");return l.body=c,Promise.race([this.send({urlPath:a,fetchOptions:l}).then(p=>d(this,null,function*(){return{}})),new Promise((p,g)=>setTimeout(()=>g(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(),l=m("POST",o,"");return l.body=c,Promise.race([this.send({urlPath:a,fetchOptions:l}).then(p=>d(this,null,function*(){return{}})),new Promise((p,g)=>setTimeout(()=>g(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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){if(i.status>=200&&i.status<300)return s.CheckDuplicateNameResponse.decode(i);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(l=>d(this,null,function*(){return{}})),new Promise((l,p)=>setTimeout(p,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(),l=m("POST",o,"");return l.body=c,Promise.race([this.send({urlPath:a,fetchOptions:l}).then(p=>d(this,null,function*(){return p.code!=0?{}:s.RegistFcmDeviceTokenResponse.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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=>d(this,null,function*(){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=>d(this,null,function*(){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=>d(this,null,function*(){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(l=>d(this,null,function*(){return{}})),new Promise((l,p)=>setTimeout(()=>p(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=>d(this,null,function*(){return{}})),new Promise((c,l)=>setTimeout(()=>l(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=>d(this,null,function*(){return o.code!=0?{}: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=>d(this,null,function*(){return o.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}:s.SearchMessageResponse.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=>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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){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",l=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial({event_id:e,clan_id:t,creator_id:n,event_label:r,channel_id:o})).finish(),p=m("POST",a,"");return p.body=l,Promise.race([this.send({urlPath:i,fetchOptions:p}).then(g=>d(this,null,function*(){return{}})),new Promise((g,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=>d(this,null,function*(){return{}})),new Promise((c,l)=>setTimeout(()=>l(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=>c),new Promise((c,l)=>setTimeout(l,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(l=>d(this,null,function*(){return l.code!=0?{}:s.FriendList.decode(l.message)})),new Promise((l,p)=>setTimeout(()=>p(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=>d(this,null,function*(){return c.code!=0?{}:s.AddFriendsResponse.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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=>c),new Promise((c,l)=>setTimeout(l,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=>c),new Promise((c,l)=>setTimeout(l,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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}:s.NotifiReactMessage.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}giveMeACoffee(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GiveMeACoffee",o=s.GiveCoffeeEvent.encode(s.GiveCoffeeEvent.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>d(this,null,function*(){return{}})),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=>d(this,null,function*(){return r.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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),l=m("GET",r,i);return e&&(l.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),l.headers.Accept="application/x-protobuf",l.headers["Content-Type"]="application/json",Promise.race([fetch(c,l).then(p=>d(this,null,function*(){let g=yield p.arrayBuffer();return s.InviteUserRes.decode(new Uint8Array(g))})),new Promise((p,g)=>setTimeout(()=>g(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=>d(this,null,function*(){return r.code!=0?{}: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=>d(this,null,function*(){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=>d(this,null,function*(){return r.code!=0?{}: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=>d(this,null,function*(){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=>d(this,null,function*(){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=>c),new Promise((c,l)=>setTimeout(l,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,r,o,a={}){let i="/mezon.api.Mezon/ListNotifications",l=s.ListNotificationsRequest.encode(s.ListNotificationsRequest.fromPartial({limit:e,clan_id:t,notification_id:n,category:r,direction:o})).finish(),p=m("POST",a,"");return p.body=l,Promise.race([this.send({urlPath:i,fetchOptions:p}).then(g=>d(this,null,function*(){return s.NotificationList.decode(g.message)})),new Promise((g,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=>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=>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=>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=>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=>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=>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=>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=>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=>d(this,null,function*(){return r.code!=0?{}: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(l=>d(this,null,function*(){return l.code!=0?{}:s.PermissionRoleChannelListEventResponse.decode(l.message)})),new Promise((l,p)=>setTimeout(()=>p(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(),l=m("POST",o,"");return l.body=c,Promise.race([this.send({urlPath:a,fetchOptions:l}).then(p=>p),new Promise((p,g)=>setTimeout(g,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(l=>d(this,null,function*(){return s.PinMessagesList.decode(l.message)})),new Promise((l,p)=>setTimeout(()=>p(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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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=>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=>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(w(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=>c),new Promise((c,l)=>setTimeout(l,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=>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(),l=m("POST",o,"");return l.body=c,Promise.race([this.send({urlPath:a,fetchOptions:l}).then(p=>d(this,null,function*(){return p.code!=0?{}:s.RoleListEventResponse.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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=>d(this,null,function*(){return i.code!=0?{}: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(w(S({},t),{role_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>c),new Promise((c,l)=>setTimeout(l,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(),l=m("POST",o,"");return l.body=c,Promise.race([this.send({urlPath:a,fetchOptions:l}).then(p=>p),new Promise((p,g)=>setTimeout(g,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(w(S({},t),{role_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>c),new Promise((c,l)=>setTimeout(l,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=>d(this,null,function*(){return i.code!=0?{}: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(l=>d(this,null,function*(){return l.code!=0?{}:s.RoleUserList.decode(l.message)})),new Promise((l,p)=>setTimeout(()=>p(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=>d(this,null,function*(){return c.code!=0?{}:s.RoleList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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(l=>d(this,null,function*(){return l.code!=0?{}:s.ChannelDescList.decode(l.message)})),new Promise((l,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}sendToken(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SendToken",o=s.TokenSentEvent.encode(s.TokenSentEvent.fromPartial(e)).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(i=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(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=>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=>d(this,null,function*(){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(l=>d(this,null,function*(){return{}})),new Promise((l,p)=>setTimeout(()=>p(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(w(S({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>d(this,null,function*(){return{}})),new Promise((c,l)=>setTimeout(()=>l(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=>d(this,null,function*(){return r.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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",p=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:o,cursor:a})).finish(),g=m("POST",i,"");return g.body=p,Promise.race([this.send({urlPath:c,fetchOptions:g}).then(f=>d(this,null,function*(){return f.code!=0?{}:s.StreamingChannelUserList.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(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=>d(this,null,function*(){return r.code!=0?{}: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=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,n={}){let r="/mezon.api.Mezon/ListSdTopic",a=s.ListSdTopicRequest.encode(s.ListSdTopicRequest.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=>d(this,null,function*(){return c.code!=0?{}:s.SdTopicList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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=>d(this,null,function*(){return i.code!=0?{}:s.SdTopic.decode(i.message)})),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=>d(this,null,function*(){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=>d(this,null,function*(){return i.code!=0?{}: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(w(S({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>d(this,null,function*(){return{}})),new Promise((c,l)=>setTimeout(()=>l(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",p=s.ListThreadRequest.encode(s.ListThreadRequest.fromPartial({channel_id:e,limit:t,state:n,clan_id:r,thread_id:o,page:a})).finish(),g=m("POST",i,"");return g.body=p,Promise.race([this.send({urlPath:c,fetchOptions:g}).then(f=>d(this,null,function*(){return f.code!=0?{}:s.ChannelDescListNoPool.decode(f.message)})),new Promise((f,y)=>setTimeout(()=>y(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(w(S({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>d(this,null,function*(){return{}})),new Promise((c,l)=>setTimeout(()=>l(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=>d(this,null,function*(){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(w(S({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>d(this,null,function*(){return{}})),new Promise((c,l)=>setTimeout(()=>l(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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}:s.UploadAttachment.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=>d(this,null,function*(){return i.code!=0?{}: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/MultipartUploadAttachmentFileStart",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=>d(this,null,function*(){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=>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=>d(this,null,function*(){return r.code!=0?{}: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=>d(this,null,function*(){return c.code!=0?{}:s.UserPermissionInChannelListResponse.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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=>d(this,null,function*(){return r.code!=0?{}: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=>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=>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=>d(this,null,function*(){return s.WebhookGenerateResponse.decode(i)})),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(w(S({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>c),new Promise((c,l)=>setTimeout(l,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=>d(this,null,function*(){return c.code!=0?{}:s.WebhookListResponse.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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(w(S({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>c),new Promise((c,l)=>setTimeout(l,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=>d(this,null,function*(){return i.code!=0?{}: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(l=>d(this,null,function*(){return l.code!=0?{}:s.ChannelCanvasDetailResponse.decode(l.message)})),new Promise((l,p)=>setTimeout(()=>p(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(l=>l),new Promise((l,p)=>setTimeout(p,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(),l=m("POST",o,"");return l.body=c,Promise.race([this.send({urlPath:a,fetchOptions:l}).then(p=>d(this,null,function*(){return p.code!=0?{}:s.ListOnboardingResponse.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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=>d(this,null,function*(){return i.code!=0?{}: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=>c),new Promise((c,l)=>setTimeout(l,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=>d(this,null,function*(){return c.code!=0?{}:s.OnboardingItem.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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(w(S({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=a,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>c),new Promise((c,l)=>setTimeout(l,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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return i.code!=0?{}: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(l=>l),new Promise((l,p)=>setTimeout(p,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=w(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(l=>l),new Promise((l,p)=>setTimeout(p,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=>d(this,null,function*(){return c.code!=0?{}:s.SdTopic.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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(),l=m("POST",r,"");return l.body=c,Promise.race([this.send({urlPath:o,fetchOptions:l}).then(p=>d(this,null,function*(){return p.code!=0?{}:s.ListOnboardingStepResponse.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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=w(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(l=>l),new Promise((l,p)=>setTimeout(p,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=>d(this,null,function*(){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=>d(this,null,function*(){return i.code!=0?{}:s.GenerateMeetTokenResponse.decode(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(l=>d(this,null,function*(){return l.code!=0?{}:s.MezonOauthClient.decode(l.message)})),new Promise((l,p)=>setTimeout(()=>p(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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return c.code!=0?{}:s.GenerateHashChannelAppsResponse.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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=>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(l=>l),new Promise((l,p)=>setTimeout(p,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=>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=>d(this,null,function*(){return r.code!=0?{}:s.GenerateMezonMeetResponse.decode(r.message)})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,n,r,o,a={}){if(t==null)throw new Error("'token' is a required parameter but is null or undefined.");let i="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(t))),c=new Map;c.set("username",n),c.set("metadata",r),c.set("is_guest",o);let l="",p=this.buildFullUrl(e,i,c),g=m("POST",a,l);return g.headers.Accept="application/x-protobuf",g.headers["Content-Type"]="application/json",Promise.race([fetch(p,g).then(f=>d(this,null,function*(){let y=yield f.arrayBuffer();return s.GenerateMeetTokenExternalResponse.decode(new Uint8Array(y))})),new Promise((f,y)=>setTimeout(()=>y(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=>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=>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=>d(this,null,function*(){return c.code!=0?{}:s.ChannelDescription.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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=>d(this,null,function*(){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=>d(this,null,function*(){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=>d(this,null,function*(){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=>d(this,null,function*(){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=>i),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,n,r,o={}){if(r==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/clan/discover",i=new Map,c="";c=JSON.stringify(r||{});let l=this.buildFullUrl(n,a,i),p=m("POST",o,c);return e&&(p.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),p.headers.Accept="application/x-protobuf",p.headers["Content-Type"]="application/json",Promise.race([fetch(l,p).then(g=>d(this,null,function*(){let f=yield g.arrayBuffer();return s.ListClanDiscover.decode(new Uint8Array(f))})),new Promise((g,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,n,r,o,a,i={}){let c="/mezon.api.Mezon/DeleteQuickMenuAccess",l={id:e,clan_id:t,bot_id:n,menu_name:r,background:o,action_msg:a},g=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(l)).finish(),f=m("POST",i,"");return f.body=g,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(y=>y),new Promise((y,b)=>setTimeout(b,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(),l=m("POST",r,"");return l.body=c,Promise.race([this.send({urlPath:o,fetchOptions:l}).then(p=>d(this,null,function*(){return p.code!=0?{}:s.QuickMenuAccessList.decode(p.message)})),new Promise((p,g)=>setTimeout(()=>g(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=>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=>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=>d(this,null,function*(){return c.code!=0?{}:s.ForSaleItemList.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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=>d(this,null,function*(){return i.code!=0?{}: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=>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=>d(this,null,function*(){return i.code!=0?{}: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=>d(this,null,function*(){return c.code!=0?{}:s.IsBannedResponse.decode(c.message)})),new Promise((c,l)=>setTimeout(()=>l(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(l=>l),new Promise((l,p)=>setTimeout(p,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,r,o,a,i,c,l,p,g,f,y){let b="/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:l,mention_everyone:p,avatar:g,code:f,topic_id:y})).finish(),v=m("POST",{},"");return v.body=C,Promise.race([this.send({urlPath:b,fetchOptions:v}).then(M=>d(this,null,function*(){return s.ChannelMessageAck.decode(M.message)})),new Promise((M,O)=>setTimeout(()=>O(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,r,o,a,i,c,l,p,g){let f="/mezon.api.Mezon/UpdateChannelMessage",b=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,hide_editted:l,topic_id:p,is_update_msg_topic:g})).finish(),A=m("POST",{},"");return A.body=b,Promise.race([this.send({urlPath:f,fetchOptions:A}).then(C=>d(this,null,function*(){return C.code!=0?{}:s.ChannelMessageUpdate.decode(C.message)})),new Promise((C,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,n,r,o,a,i,c,l){let p="/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:l,topic_id:i})).finish(),y=m("POST",{},"");return y.body=f,Promise.race([this.send({urlPath:p,fetchOptions:y}).then(b=>d(this,null,function*(){return b.code!=0?{}:s.ChannelMessageRemove.decode(b.message)})),new Promise((b,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},p=s.HandleParticipantMeetStateEvent.encode(s.HandleParticipantMeetStateEvent.fromPartial(c)).finish(),g=m("POST",a,"");return g.body=p,Promise.race([this.send({urlPath:i,fetchOptions:g}).then(f=>f),new Promise((f,y)=>setTimeout(y,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,r,o,a,i={}){let c="/mezon.api.Mezon/MessageButtonClick",l={message_id:e,channel_id:t,button_id:n,sender_id:r,user_id:o,extra_data:a},g=s.MessageButtonClicked.encode(s.MessageButtonClicked.fromPartial(l)).finish(),f=m("POST",i,"");return f.body=g,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(y=>y),new Promise((y,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,r,o,a,i={}){let c="/mezon.api.Mezon/DropdownBoxSelected",l={message_id:e,channel_id:t,selectbox_id:n,sender_id:r,user_id:o,values:a},g=s.DropdownBoxSelected.encode(s.DropdownBoxSelected.fromPartial(l)).finish(),f=m("POST",i,"");return f.body=g,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(y=>y),new Promise((y,b)=>setTimeout(b,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(l=>l),new Promise((l,p)=>setTimeout(p,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(l=>l),new Promise((l,p)=>setTimeout(p,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(l=>l),new Promise((l,p)=>setTimeout(p,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=>d(this,null,function*(){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,l,p,g,f,y){let b="/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:l,action:p,emoji_recent_id:f,sender_name:y,topic_id:g})).finish(),v=m("POST",{},"");return v.body=C,Promise.race([this.send({urlPath:b,fetchOptions:v}).then(M=>d(this,null,function*(){return s.ChannelMessageSend.decode(M.message)})),new Promise((M,O)=>setTimeout(()=>O(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t={}){var i,c,l,p,g,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:(l=e.question)!=null?l:"",answers:(p=e.answers)!=null?p:[],expire_hours:(g=e.expire_hours)!=null?g: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(y=>d(this,null,function*(){let b=s.CreatePollResponse.decode(y);return{poll_id:b.poll_id,message_id:b.message_id,question:b.question,answers:b.answers.map(A=>({index:A.index,label:A.label})),answer_counts:b.answer_counts,exp:b.exp,is_closed:b.is_closed,creator_id:b.creator_id,type:b.type,total_votes:b.total_votes}})),new Promise((y,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t={}){var i,c,l,p;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:(l=e.channel_id)!=null?l:"0",answer_indices:(p=e.answer_indices)!=null?p:[]})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(g=>d(this,null,function*(){var y;let f=g.length>0?s.VotePollResponse.decode(g):{my_answer_indices:[]};return{my_answer_indices:Array.from((y=f.my_answer_indices)!=null?y:[])}})),new Promise((g,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t={}){var i,c,l;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:(l=e.channel_id)!=null?l:"0"})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(p=>{if(p.status==204||p.status>=200&&p.status<300)return{};throw p}),new Promise((p,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t={}){var i,c,l;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:(l=e.channel_id)!=null?l:"0"})).finish(),a=m("POST",t,"");return a.body=o,Promise.race([this.send({urlPath:n,fetchOptions:a}).then(p=>d(this,null,function*(){let g=s.GetPollResponse.decode(p);return{poll_id:g.poll_id,message_id:g.message_id,question:g.question,answers:g.answers.map(f=>({index:f.index,label:f.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,voter_details:g.voter_details.map(f=>({answer_index:f.answer_index,user_ids:f.user_ids}))}})),new Promise((p,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}followUsers(e){return d(this,null,function*(){let t="",n={status_follow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>d(this,null,function*(){return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}joinClanChat(e){return d(this,null,function*(){let t="",n={clan_join:{clan_id:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>d(this,null,function*(){return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}follower(){return d(this,null,function*(){let e="",t={follow_event:{}};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>d(this,null,function*(){return{}})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}joinChat(e,t,n,r){return d(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=>d(this,null,function*(){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=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,r,o,a,i,c,l){return d(this,null,function*(){let p="",g={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:l}};return Promise.race([this.send({urlPath:p,fetchOptions:g}).then(f=>d(this,null,function*(){return{}})),new Promise((f,y)=>setTimeout(()=>y(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=>d(this,null,function*(){return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateChatMessage(e,t,n,r,o,a,i,c,l,p,g){return d(this,null,function*(){let f="",y={channel_message_update:{clan_id:e,channel_id:t,message_id:o,content:a,mentions:i,attachments:c,mode:n,is_public:r,hide_editted:l,topic_id:p,is_update_msg_topic:g}};return Promise.race([this.send({urlPath:f,fetchOptions:y}).then(b=>d(this,null,function*(){return{}})),new Promise((b,A)=>setTimeout(()=>A(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=>d(this,null,function*(){return{}})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}writeQuickMenuEvent(e,t,n,r,o,a,i,c,l,p,g,f,y,b){return d(this,null,function*(){let A="",C={quick_menu_event:{menu_name:e,message:{clan_id:t,channel_id:n,mode:r,is_public:o,content:a,mentions:i,attachments:c,references:l,anonymous_message:p,mention_everyone:g,avatar:f,code:y,topic_id:b}}};return Promise.race([this.send({urlPath:A,fetchOptions:C}).then(v=>d(this,null,function*(){return{}})),new Promise((v,M)=>setTimeout(()=>M(new Error("Request timed out.")),this.timeoutMs))])})}writeEphemeralMessage(e,t,n,r,o,a,i,c,l,p,g,f,y,b,A){return d(this,null,function*(){let C="",v={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:l,anonymous_message:p,mention_everyone:g,avatar:f,code:y,topic_id:b,id:A}}};return Promise.race([this.send({urlPath:C,fetchOptions:v}).then(M=>d(this,null,function*(){return{}})),new Promise((M,O)=>setTimeout(()=>O(new Error("Request timed out.")),this.timeoutMs))])})}writeChatMessage(e,t,n,r,o,a,i,c,l,p,g,f,y){return d(this,null,function*(){let b="",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:l,mention_everyone:p,avatar:g,code:f,topic_id:y}};return Promise.race([this.send({urlPath:b,fetchOptions:A}).then(C=>d(this,null,function*(){return{}})),new Promise((C,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageReaction(e,t,n,r,o,a,i,c,l,p,g,f,y,b){return d(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:l,message_sender_id:p,action:g,topic_id:f,emoji_recent_id:y,sender_name:b}};return Promise.race([this.send({urlPath:A,fetchOptions:C}).then(v=>d(this,null,function*(){return{}})),new Promise((v,M)=>setTimeout(()=>M(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageTyping(e,t,n,r,o,a){return d(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(l=>d(this,null,function*(){return{}})),new Promise((l,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])})}writeLastSeenMessage(e,t,n,r,o,a){return d(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(l=>d(this,null,function*(){return{}})),new Promise((l,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])})}writeLastPinMessage(e,t,n,r,o,a,i,c,l,p,g,f,y){return d(this,null,function*(){let b="",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:l,message_sender_username:p,message_content:g,message_attachment:f,message_created_time:y}};return Promise.race([this.send({urlPath:b,fetchOptions:A}).then(C=>d(this,null,function*(){return{}})),new Promise((C,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])})}writeCustomStatus(e,t,n,r){return d(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=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceReaction(e,t){return d(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=>d(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}forwardWebrtcSignaling(e,t,n,r,o){return d(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=>d(this,null,function*(){return{}})),new Promise((c,l)=>setTimeout(()=>l(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,r){return d(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=>d(this,null,function*(){return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeChannelAppEvent(e,t,n){return d(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=>d(this,null,function*(){return{}})),new Promise((a,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])})}listDataSocket(e){return d(this,null,function*(){let t="",n={list_data_socket:e};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>d(this,null,function*(){return r})),new Promise((r,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}};N.DefaultSendTimeoutMs=1e4;var x=N;var be="127.0.0.1",Ce="7350",Ae="defaultkey",Pe=3e4,h={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},ne=!1,T=class T{constructor(e=Ae,t=be,n=Ce,r=!1,o=null,a=Pe,i=!0){this.serverkey=e;this.timeout=a;this.autoFallbackHttp=i;this.verbose=!1;this.host=t,this.port=n,this.useSSL=r;let l=`${r?"https://":"http://"}${t}:${n}`;this._heartbeatTimeoutMs=T.DefaultHeartbeatTimeoutMs,this._connectionState=h.DISCONNECTED,this.transport=new x(e,a,o,l)}isOpen(){return this._connectionState===h.CONNECTED}setTransportAdapter(e){this.transport.setTransportAdapter(e)}connect(e,t,n=!1,r=!1,o=T.DefaultConnectTimeoutMs){if(this.verbose=r,this._connectionState===h.CONNECTED)return Promise.resolve();if(this._connectionState===h.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=h.CONNECTING,this.transport.connect(e,t,n,r,(i,c,l)=>d(this,null,function*(){if(!l.cid)if(l.notifications)l.notifications.notifications.forEach(p=>{p.content=p.content?W(p.content):void 0,this.onnotification(p)});else if(l.voice_started_event)this.onvoicestarted(l.voice_started_event);else if(l.voice_ended_event)this.onvoiceended(l.voice_ended_event);else if(l.voice_joined_event)this.onvoicejoined(l.voice_joined_event);else if(l.voice_leaved_event)this.onvoiceleaved(l.voice_leaved_event);else if(l.channel_created_event)this.onchannelcreated(l.channel_created_event);else if(l.category_event)this.oncategoryevent(l.category_event);else if(l.role_event)this.onroleevent(l.role_event);else if(l.event_emoji)this.oneventemoji(l.event_emoji);else if(l.noti_user_channel)this.oneventnotiuserchannel(l.noti_user_channel);else if(l.webhook_event)this.oneventwebhook(l.webhook_event);else if(l.channel_deleted_event)this.onchanneldeleted(l.channel_deleted_event);else if(l.clan_deleted_event)this.onclandeleted(l.clan_deleted_event);else if(l.sticker_create_event)this.onstickercreated(l.sticker_create_event);else if(l.sticker_update_event)this.onstickerupdated(l.sticker_update_event);else if(l.sticker_delete_event)this.onstickerdeleted(l.sticker_delete_event);else if(l.channel_updated_event)this.onchannelupdated(l.channel_updated_event);else if(l.delete_account_event)this.ondeleteaccount(l.delete_account_event);else if(l.clan_profile_updated_event)this.onclanprofileupdated(l.clan_profile_updated_event);else if(l.clan_updated_event)this.onclanupdated(l.clan_updated_event);else if(l.last_seen_message_event)this.onlastseenupdated(l.last_seen_message_event);else if(l.status_presence_event)this.onstatuspresence(l.status_presence_event);else if(l.channel_message){console.log("onchannelmessage",l.channel_message);let p=H(l);this.onchannelmessage(p)}else l.message_typing_event?this.onmessagetyping(l.message_typing_event):l.message_reaction_event?this.onmessagereaction(l.message_reaction_event):l.channel_presence_event?this.onchannelpresence(l.channel_presence_event):l.last_pin_message_event?this.onpinmessage(l.last_pin_message_event):l.custom_status_event?this.oncustomstatus(l.custom_status_event):l.canvas_event?this.oncanvasevent(l.canvas_event):l.user_channel_added_event?this.onuserchanneladded(l.user_channel_added_event):l.add_clan_user_event?this.onuserclanadded(l.add_clan_user_event):l.user_profile_updated_event?this.onuserprofileupdate(l.user_profile_updated_event):l.user_channel_removed_event?this.onuserchannelremoved(l.user_channel_removed_event):l.block_friend?this.onblockfriend(l.block_friend):l.un_block_friend?this.onunblockfriend(l.un_block_friend):l.add_friend?this.onaddfriend(l.add_friend):l.remove_friend?this.onremovefriend(l.remove_friend):l.user_clan_removed_event?this.onuserclanremoved(l.user_clan_removed_event):l.clan_event_created?this.oneventcreated(l.clan_event_created):l.give_coffee_event?this.oncoffeegiven(l.give_coffee_event):l.role_assign_event?this.onroleassign(l.role_assign_event):l.streaming_started_event?this.onstreamingchannelstarted(l.streaming_started_event):l.streaming_ended_event?this.onstreamingchannelended(l.streaming_ended_event):l.streaming_joined_event?this.onstreamingchanneljoined(l.streaming_joined_event):l.streaming_leaved_event?this.onstreamingchannelleaved(l.streaming_leaved_event):l.permission_set_event?this.onpermissionset(l.permission_set_event):l.permission_changed_event?this.onpermissionchanged(l.permission_changed_event):l.unmute_event?this.onunmuteevent(l.unmute_event):l.token_sent_event?this.ontokensent(l.token_sent_event):l.message_button_clicked?this.onmessagebuttonclicked(l.message_button_clicked):l.dropdown_box_selected?this.onmessagedropdownboxselected(l.dropdown_box_selected):l.mark_as_read?this.onmarkasread(l.mark_as_read):l.voice_reaction_send?this.onvoicereactionmessage(l.voice_reaction_send):l.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(l.webrtc_signaling_fwd):l.list_activity?this.onactivityupdated(l.list_activity):l.sd_topic_event?this.onsdtopicevent(l.sd_topic_event):l.channel_app_event?this.onchannelappevent(l.channel_app_event):l.user_status_event?this.onuserstatusevent(l.user_status_event):l.join_channel_app_data?this.onjoinchannelappevent(l.join_channel_app_data):l.unpin_message_event?this.onunpinmessageevent(l.unpin_message_event):l.quick_menu_event?this.onquickmenuevent(l.quick_menu_event):l.meet_participant_event?this.onmeetparticipantevent(l.meet_participant_event):l.transfer_ownership_event?this.ontransferownership(l.transfer_ownership_event):l.ban_user_event?this.onbanneduser(l.ban_user_event):l.list_channel_users_banned_event?this.onlistchannelusersbanned(l.list_channel_users_banned_event):l.allow_anonymous_event?this.onallowanonymousevent(l.allow_anonymous_event):l.aiagent_enabled_event?this.onaiagentenabled(l.aiagent_enabled_event):l.refresh_session_event?this.onrefreshsession(l.refresh_session):l.pong?this.verbose&&window&&window.console&&console.log("Pong message received: %o",l):this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",l)}),i=>d(this,null,function*(){this._connectionState=h.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(i)}));let a=new Promise((i,c)=>{this.transport.setOnOpen(l=>{this.verbose&&window&&window.console&&console.log(l);let p=ne;ne=!0,this.clearConnectTimeout(),this._connectionState=h.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,i(),p&&this.onreconnect(l)}),this.transport.setOnError(l=>{this._connectionState=h.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(l),this._connectPromise=void 0,this.transport.close(),c(l)}),this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=h.DISCONNECTED,this.stopHeartbeatLoop(),this.transport.close(),this._connectPromise=void 0,c("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},o)});return this._connectPromise=a,this._connectPromise}pingPong(){return d(this,null,function*(){if(!this.isOpen()){this._connectionState=h.DISCONNECTED,this.stopHeartbeatLoop();return}try{let e="",t={ping:{}};yield this.transport.send({urlPath:e,fetchOptions:t},this._heartbeatTimeoutMs)}catch(e){this._connectionState=h.DISCONNECTED,this.stopHeartbeatLoop(),this.isOpen()&&(window&&window.console&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this.transport.close());return}this.startHeartbeatLoop()})}startHeartbeatLoop(){this.stopHeartbeatLoop(),this._heartbeatTimer=setTimeout(()=>this.pingPong(),this._heartbeatTimeoutMs)}stopHeartbeatLoop(){this._heartbeatTimer!==void 0&&(clearTimeout(this._heartbeatTimer),this._heartbeatTimer=void 0)}clearConnectTimeout(){this._connectTimeoutTimer!==void 0&&(clearTimeout(this._connectTimeoutTimer),this._connectTimeoutTimer=void 0)}onreconnect(e){this.verbose&&window&&window.console&&console.log(e)}ondisconnect(e){this.verbose&&window&&window.console&&console.log(e)}onerror(e){this._connectionState=h.DISCONNECTED,this.stopHeartbeatLoop(),this.verbose&&window&&window.console&&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)}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)}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)}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){console.log(`Token refresh occurred. Token: ${e.token}`)}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}))}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 d(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}))})}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}))}setBasePath(e,t,n){this.host=e,this.port=t,this.useSSL=n;let o=`${n?"https://":"http://"}${e}:${t}`;return this.transport.setBasePath(o)}addChannelUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelUsers(t,n).then(r=>r!==void 0)})}addFriends(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addFriends(t,n)})}blockFriends(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.blockFriends(t,n).then(r=>Promise.resolve(r!=null))})}unblockFriends(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unblockFriends(t,n).then(r=>Promise.resolve(r!=null))})}uploadOauthFile(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadOauthFile(t)})}uploadAttachmentFile(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadAttachmentFile(t)})}multipartUploadAttachmentFile(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFile(t)})}multipartUploadAttachmentFileFinish(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFileFinsih(t)})}createChannelDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelDesc(t).then(n=>Promise.resolve(n))})}createClanDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanDesc(t).then(n=>Promise.resolve(n))})}checkDuplicateName(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.checkDuplicateName(t)})}createCategoryDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createCategoryDesc(t).then(n=>Promise.resolve(n))})}createRole(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRole(t).then(n=>Promise.resolve(n))})}createEvent(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createEvent(t).then(n=>Promise.resolve(n))})}addRolesChannelDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addRolesChannelDesc(t).then(n=>n!==void 0)})}deleteRoleChannelDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRoleChannelDesc(t).then(n=>n!==void 0)})}deleteApp(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteApp(t).then(n=>n!==void 0)})}deleteFriends(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteFriends(t,n).then(r=>r!==void 0)})}deleteChannelDesc(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelDesc(t,n).then(r=>r!==void 0)})}deleteClanDesc(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanDesc(t).then(n=>n!==void 0)})}deleteCategoryDesc(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteCategoryDesc(t,n,r).then(o=>o!==void 0)})}deleteNotifications(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotifications(t,n).then(r=>Promise.resolve(r!=null))})}deleteRole(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRole(t,"0",n,r).then(o=>o!==void 0)})}deleteEvent(e,t,n,r,o,a){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(t,n,r,o,a).then(i=>i!==void 0)})}updateEventUser(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEventUser(t).then(n=>n!==void 0)})}emitEvent(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.event(t).then(n=>Promise.resolve(n!=null))})}getAccount(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getAccount(e.token)})}removeClanUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeClanUsers(t,n).then(r=>Promise.resolve(r!=null))})}listBannedUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listBannedUsers(t,n).then(r=>Promise.resolve(r))})}unbanClanUsers(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.banClanUsers(t,n,r,o).then(a=>Promise.resolve(a!=null))})}removeChannelUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelMessages(t,n,r,o,a,i).then(c=>{let l={messages:[],last_seen_message:c.last_seen_message,last_sent_message:c.last_sent_message};return c.messages==null||c.messages.forEach(p=>{let g,f,y,b,A;try{g=P(p.content)}catch(C){console.log("error parse content",C)}try{let C=z(p.reactions);f=(C==null?void 0:C.reactions)||C||P(p.reactions||"[]")}catch(C){f=P(p.reactions||"[]")}try{let C=U(p.mentions);y=(C==null?void 0:C.mentions)||C||P(p.mentions||"[]")}catch(C){y=P(p.mentions||"[]")}try{let C=D(p.attachments);b=(C==null?void 0:C.attachments)||C||P(p.attachments||"[]")}catch(C){b=P(p.attachments||"[]")}try{let C=F(p.references);A=(C==null?void 0:C.refs)||C||P(p.references||"[]")}catch(C){A=P(p.references||"[]")}l.messages.push({channel_id:p.channel_id,code:p.code?Number(p.code):0,id:p.message_id||"",sender_id:p.sender_id,username:p.username,display_name:p.display_name,avatar:p.avatar,content:g,channel_label:p.channel_label,clan_logo:p.clan_logo,category_name:p.category_name,clan_nick:p.clan_nick,clan_avatar:p.clan_avatar,attachments:b,mentions:y,reactions:f,references:A,clan_id:p.clan_id,create_time_seconds:p.create_time_seconds,update_time_seconds:p.update_time_seconds,hide_editted:p.hide_editted})}),Promise.resolve(l)})})}listChannelVoiceUsers(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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,participant:a.participant})}),Promise.resolve(o)})})}listChannelUsers(e,t,n,r,o,a,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(t,n,r,a,o,i).then(c=>{let l={channel_users:[],cursor:c.cursor,channel_id:c.channel_id};return c.channel_users==null||c.channel_users.forEach(p=>{l.channel_users.push({user_id:p.user_id,role_id:p.role_id,thread_id:p.thread_id,clan_avatar:p.clan_avatar,clan_nick:p.clan_nick,id:p.id,clan_id:p.clan_id,added_by:p.added_by,is_banned:p.is_banned})}),Promise.resolve(l)})})}listChannelAttachments(e,t,n,r,o,a,i,c){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(n,t,r,a,o,i,c).then(l=>{let p={attachments:[]};return l.attachments==null||l.attachments.forEach(g=>{p.attachments.push({filename:g.filename,filesize:g.filesize,filetype:g.filetype,id:g.id,uploader:g.uploader,url:g.url,message_id:g.message_id,create_time_seconds:g.create_time_seconds,width:g.width,height:g.height})}),Promise.resolve(p)})})}listClanUsers(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDetail(t).then(n=>Promise.resolve(n))})}listChannelDescs(e,t,n,r,o,a,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDescs(t,n,r,o,a,i).then(c=>{let l={channeldesc:[],next_cursor:c.next_cursor,prev_cursor:c.prev_cursor,cacheable_cursor:c.cacheable_cursor};return c.channeldesc==null||(l.channeldesc=c.channeldesc),Promise.resolve(l)})})}listClanDescs(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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)})})}listChannelBadgeCount(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listEvents(t).then(n=>Promise.resolve(n))})}getListPermission(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListPermission(e.token).then(t=>Promise.resolve(t))})}listRolePermissions(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRolePermissions(t).then(n=>Promise.resolve(n))})}listRoleUsers(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoleUsers(t,n,r).then(o=>Promise.resolve(o))})}registFCMDeviceToken(e,t,n,r,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registFCMDeviceToken(t,n,r,o).then(a=>Promise.resolve(a))})}getUserProfileOnClan(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserProfileOnClan(t).then(n=>Promise.resolve(n))})}closeDirectMess(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closeDirectMess(t).then(n=>n!==void 0)})}openDirectMess(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.openDirectMess(t).then(n=>n!==void 0)})}confirmLinkMezonOTP(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLinkMezonOTP(t)})}linkSMS(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkSMS(t).then(n=>Promise.resolve(n))})}linkEmail(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkEmail(t).then(n=>Promise.resolve(n))})}listFriends(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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(l=>{c.notifications.push({id:l.id,subject:l.subject,content:l.content?W(l.content):void 0,code:l.code?Number(l.code):0,sender_id:l.sender_id,create_time_seconds:l.create_time_seconds,persistent:l.persistent,category:l.category})}),Promise.resolve(c)})})}sessionLogout(e,t,n,r,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkEmail(t).then(n=>n!==void 0)})}updateUsername(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUsername(t).then(n=>Promise.resolve(n))})}updateAccount(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateAccount(t).then(n=>n!==void 0)})}updateChannelDesc(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelDesc(t,n).then(r=>r!==void 0)})}updateClanDesc(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanDesc(t,n).then(r=>r!==void 0)})}updateCategory(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategory(t,n).then(r=>r!==void 0)})}updateUserProfileByClan(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserProfileByClan(t,n).then(r=>r!==void 0)})}updateRole(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRole(t,n).then(r=>r!==void 0)})}updateEvent(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEvent(t,n).then(r=>r!==void 0)})}updateApp(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateApp(t,n).then(r=>Promise.resolve(r))})}createLinkInviteUser(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createLinkInviteUser(t).then(n=>Promise.resolve(n))})}getLinkInvite(e){return d(this,null,function*(){return this.transport.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getRoleOfUserInTheClan(t).then(n=>Promise.resolve(n))})}inviteUser(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.inviteUser(t).then(n=>Promise.resolve(n))})}setNotificationClan(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationClanSetting(t).then(n=>n!==void 0)})}setNotificationChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationChannelSetting(t).then(n=>n!==void 0)})}setMuteCategory(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteCategory(t).then(n=>n!==void 0)})}setMuteChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteChannel(t).then(n=>n!==void 0)})}updateChannelPrivate(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelPrivate(t).then(n=>n!==void 0)})}setNotificationCategory(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationCategory(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationChannel(t).then(n=>n!==void 0)})}setNotificationReactMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationReactMessage({channel_id:t}).then(n=>n!==void 0)})}deleteNotiReactMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotiReactMessage(t).then(n=>n!==void 0)})}searchMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMessage(t).then(n=>Promise.resolve(n))})}createMessage2Inbox(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createMessage2Inbox(t).then(n=>Promise.resolve(n))})}createPinMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPinMessage(t).then(n=>Promise.resolve(n))})}pinMessagesList(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deletePinMessage(t,n,r,o).then(a=>a!==void 0)})}createClanEmoji(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanEmoji(t).then(n=>n!==void 0)})}updateClanEmojiById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanEmojiById(t,n).then(r=>r!==void 0)})}deleteByIdClanEmoji(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanEmojiById(t,n,r).then(o=>o!==void 0)})}generateWebhookLink(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateWebhook(t).then(n=>Promise.resolve(n))})}listWebhookByChannelId(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listWebhookByChannelId(t,n).then(r=>Promise.resolve(r))})}updateWebhookById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateWebhookById(t,n).then(r=>r!==void 0)})}deleteWebhookById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteWebhookById(t,n).then(r=>r!==void 0)})}addClanSticker(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addClanSticker(t).then(n=>n!==void 0)})}deleteClanStickerById(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanStickerById(t,n,r).then(o=>o!==void 0)})}updateClanStickerById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanStickerById(t,n).then(r=>r!==void 0)})}changeChannelCategory(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.changeChannelCategory(t,n).then(r=>r!==void 0)})}setRoleChannelPermission(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setRoleChannelPermission(t).then(n=>n!==void 0)})}addApp(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addApp(t).then(n=>Promise.resolve(n))})}getApp(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getApp(t).then(n=>Promise.resolve(n))})}listApps(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listApps(e.token).then(t=>Promise.resolve(t))})}addAppToClan(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAppToClan(t,n).then(r=>r!==void 0)})}getSystemMessagesList(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessagesList(e.token).then(t=>Promise.resolve(t))})}getSystemMessageByClanId(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessageByClanId(t).then(n=>Promise.resolve(n))})}createSystemMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSystemMessage(t).then(n=>Promise.resolve(n))})}updateSystemMessage(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateSystemMessage(t,n).then(r=>Promise.resolve(r))})}deleteSystemMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSystemMessage(t).then(n=>Promise.resolve(n))})}updateCategoryOrder(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategoryOrder(t).then(n=>Promise.resolve(n))})}givecoffee(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.giveMeACoffee(t).then(n=>n!==void 0)})}sendToken(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendToken(t).then(n=>n!==void 0)})}listStreamingChannelUsers(e,t,n,r,o,a,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(t,n,r,a,o,i).then(c=>{let l={streaming_channel_users:[]};return c.streaming_channel_users==null||c.streaming_channel_users.forEach(p=>{l.streaming_channel_users.push({id:p.id,channel_id:p.channel_id,user_id:p.user_id,participant:p.participant})}),Promise.resolve(l)})})}registerStreamingChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registerStreamingChannel(t).then(n=>n!==void 0)})}listChannelApps(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCategoryNotiSettingsList(t).then(n=>Promise.resolve(n))})}getNotificationCategory(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationCategory(t).then(n=>Promise.resolve(n))})}getNotificationChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationChannel(t).then(n=>Promise.resolve(n))})}getNotificationClan(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationClan(t).then(n=>Promise.resolve(n))})}getNotificationReactMessage(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationReactMessage(t).then(n=>Promise.resolve(n))})}listChannelByUserId(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelByUserId(e.token).then(t=>Promise.resolve(t))})}listChannelUsersUC(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsersUC(t,n).then(r=>Promise.resolve(r))})}getListEmojisByUserId(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListEmojisByUserId(e.token).then(t=>Promise.resolve(t))})}emojiRecentList(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.emojiRecentList(e.token).then(t=>Promise.resolve(t))})}getListStickersByUserId(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListStickersByUserId(e.token).then(t=>Promise.resolve(t))})}listUserClansByUserId(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserClansByUserId(e.token).then(t=>Promise.resolve(t))})}listRoles(e,t,n,r,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.markAsRead(t).then(n=>Promise.resolve(n))})}listThreadDescs(e,t,n,r,o,a,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listThreadDescs(t,n,r,o,a,i).then(c=>{let l={channeldesc:[]};return c.channeldesc==null||(l.channeldesc=c.channeldesc),Promise.resolve(l)})})}listChannelTimeline(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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=q(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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let i=q(r.attachments),c=q(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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let i=q(r.attachments),c=q(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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.detailChannelTimeline(t).then(n=>{let r=n.event;if(r){let o,a;try{let i=q(r.attachments),c=q(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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveThread(t,n).then(r=>Promise.resolve(r))})}archiveChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.archiveChannel(t,n).then(r=>Promise.resolve(r))})}listArchivedChannelDescs(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listArchivedChannelDescs(t).then(n=>Promise.resolve(n))})}getChannelSettingInClan(e,t,n,r,o,a,i,c,l,p,g){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelSetting(t,n,r,o,a,i,c,l,p,g).then(f=>Promise.resolve(f))})}getChannelCanvasList(e,t,n,r,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasDetail(t,n,r).then(o=>Promise.resolve(o))})}editChannelCanvases(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.editChannelCanvases(t).then(n=>Promise.resolve(n))})}deleteChannelCanvas(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelCanvas(t,n,r).then(o=>o!==void 0)})}addFavoriteChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelFavorite({channel_id:t,clan_id:n}).then(r=>r)})}removeFavoriteChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelFavorite(t,n).then(r=>r)})}getListFavoriteChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListFavoriteChannel(t).then(n=>n)})}listActivity(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listActivity(e.token).then(t=>t)})}createActiviy(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createActiviy(t).then(n=>n)})}createQRLogin(e){return d(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 d(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}:null})}confirmLogin(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLogin(t,n).then(r=>r)})}getChanEncryptionMethod(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChanEncryptionMethod(t).then(n=>n)})}setChanEncryptionMethod(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setChanEncryptionMethod(t,{method:n}).then(r=>r)})}getPubKeys(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPubKeys(t).then(n=>n)})}pushPubKey(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.pushPubKey({PK:t}).then(n=>n)})}getKeyServer(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getKeyServer(e.token).then(t=>t)})}listAuditLog(e,t,n,r,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listAuditLog(t,n,r,o).then(a=>a)})}listOnboarding(e,t,n,r,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboarding(t,n,r,o).then(a=>a)})}getOnboardingDetail(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOnboardingDetail(t,n).then(r=>Promise.resolve(r))})}createOnboarding(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createOnboarding(t).then(n=>n)})}updateOnboarding(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboarding(t,n).then(r=>r!==void 0)})}deleteOnboarding(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteOnboarding(t,n).then(r=>r!==void 0)})}generateClanWebhook(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateClanWebhook(t).then(n=>Promise.resolve(n))})}listClanWebhook(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanWebhook(t).then(n=>Promise.resolve(n))})}deleteClanWebhookById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanWebhookById(t,n).then(r=>r!==void 0)})}updateClanWebhookById(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanWebhookById(t,n).then(r=>r!==void 0)})}listOnboardingStep(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboardingStep(t,n,r).then(o=>Promise.resolve(o))})}updateOnboardingStepByClanId(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboardingStepByClanId(t,n).then(r=>r!==void 0)})}updateUserStatus(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserStatus(t).then(n=>n!==void 0)})}updateUserCustomStatus(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserCustomStatus(t).then(n=>n!==void 0)})}getUserStatus(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserStatus(e.token).then(t=>Promise.resolve(t))})}listSdTopic(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listSdTopic(t,n).then(r=>Promise.resolve(r))})}createSdTopic(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSdTopic(t).then(n=>n)})}getTopicDetail(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getTopicDetail(t).then(n=>Promise.resolve(n))})}createRoomChannelApps(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRoomChannelApps(t).then(n=>Promise.resolve(n))})}generateMeetToken(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateMeetToken(t).then(n=>Promise.resolve(n))})}listMezonOauthClient(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMezonOauthClient(e.token).then(t=>Promise.resolve(t))})}getMezonOauthClient(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getMezonOauthClient(t,n).then(r=>Promise.resolve(r))})}updateMezonOauthClient(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonOauthClient(t).then(n=>Promise.resolve(n))})}searchThread(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchThread(t,n,r).then(o=>Promise.resolve(o))})}generateHashChannelApps(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateHashChannelApps(t).then(n=>Promise.resolve(n))})}registrationPassword(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addUserEvent(t).then(n=>n!==void 0)})}deleteUserEvent(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteUserEvent(t,n).then(r=>r!==void 0)})}updateRoleOrder(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRoleOrder(t).then(n=>Promise.resolve(n))})}deleteAccount(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteAccount(e.token).then(t=>Promise.resolve(t))})}createExternalMezonMeet(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createExternalMezonMeet(e.token).then(t=>Promise.resolve(t))})}generateMeetTokenExternal(e,t,n,r,o){return d(this,null,function*(){return this.transport.generateMeetTokenExternal(e,t,n,r,o).then(a=>Promise.resolve(a))})}removeMezonMeetParticipant(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}muteMezonMeetParticipant(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.muteParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}updateClanOrder(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanOrder(t).then(n=>n!==void 0)})}listClanDiscover(e,t){return d(this,null,function*(){return this.transport.clanDiscover(this.serverkey,"",e,t).then(n=>Promise.resolve(n))})}listQuickMenuAccess(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listQuickMenuAccess(t,n,r).then(o=>Promise.resolve(o))})}deleteQuickMenuAccess(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteQuickMenuAccess(t,n).then(r=>r!==void 0)})}addQuickMenuAccess(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addQuickMenuAccess(t).then(n=>n!==void 0)})}updateQuickMenuAccess(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateQuickMenuAccess(t).then(n=>n!==void 0)})}listForSaleItems(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listForSaleItems(t).then(n=>Promise.resolve(n))})}isFollower(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isFollower(t).then(n=>Promise.resolve(n))})}transferOwnership(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.transferOwnership(t).then(n=>n!==void 0)})}isBanned(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isBanned(t).then(n=>Promise.resolve(n))})}reportMessageAbuse(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.reportMessageAbuse(t,n).then(r=>r!==void 0)})}updateMezonVoiceState(e,t,n,r,o,a){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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,l,p,g,f,y,b){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendChannelMessage(t,n,r,o,a,i,c,l,p,g,f,y,b).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,n,r,o,a,i,c,l,p,g,f){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(t,n,r,o,a,i,c,l,p,g,f).then(y=>Promise.resolve(y))})}deleteChannelMessage(e,t,n,r,o,a,i,c,l,p){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelMessage(t,n,r,o,a,i,c,l,p).then(g=>Promise.resolve(g))})}messageButtonClick(e,t,n,r,o,a,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.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 d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.activeArchivedThread(t,n).then(r=>Promise.resolve(r))})}addAgentToChannel(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAgentToChannel(t,n).then(r=>Promise.resolve(r))})}disconnectAgent(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.disconnectAgent(t,n).then(r=>Promise.resolve(r))})}listMutedChannel(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMutedChannel(t).then(n=>Promise.resolve(n))})}channelMessageReact(e,t,n,r,o,a,i,c,l,p,g,f,y,b){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.channelMessageReact(t,n,r,o,a,i,c,l,p,g,f,y,b).then(A=>Promise.resolve(A))})}createPoll(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPoll(t)})}votePoll(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.votePoll(t)})}closePoll(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closePoll(t)})}getPoll(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPoll(t)})}followUsers(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.followUsers(t)})}joinClanChat(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinClanChat(t)})}follower(e){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.follower()})}joinChat(e,t,n,r,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinChat(t,n,r,o)})}leaveChat(e,t,n,r,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveChat(t,n,r,o)})}removeChatMessage(e,t,n,r,o,a,i,c,l,p){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChatMessage(t,n,r,o,a,i,c,l,p)})}unfollowUsers(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unfollowUsers(t)})}updateChatMessage(e,t,n,r,o,a,i,c,l,p,g,f){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,r,o,a,i,c,l,p,g,f)})}updateStatus(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateStatus(t)})}writeQuickMenuEvent(e,t,n,r,o,a,i,c,l,p,g,f,y,b,A){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeQuickMenuEvent(t,n,r,o,a,i,c,l,p,g,f,y,b,A)})}writeEphemeralMessage(e,t,n,r,o,a,i,c,l,p,g,f,y,b,A,C){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeEphemeralMessage(t,n,r,o,a,i,c,l,p,g,f,y,b,A,C)})}writeChatMessage(e,t,n,r,o,a,i,c,l,p,g,f,y,b){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChatMessage(t,n,r,o,a,i,c,l,p,g,f,y,b)})}writeMessageReaction(e,t,n,r,o,a,i,c,l,p,g,f,y,b,A){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageReaction(t,n,r,o,a,i,c,l,p,g,f,y,b,A)})}writeMessageTyping(e,t,n,r,o,a,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageTyping(t,n,r,o,a,i)})}writeLastSeenMessage(e,t,n,r,o,a,i){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastSeenMessage(t,n,r,o,a,i)})}writeLastPinMessage(e,t,n,r,o,a,i,c,l,p,g,f,y,b){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastPinMessage(t,n,r,o,a,i,c,l,p,g,f,y,b)})}writeCustomStatus(e,t,n,r,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeCustomStatus(t,n,r,o)})}writeVoiceReaction(e,t,n){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceReaction(t,n)})}forwardWebrtcSignaling(e,t,n,r,o,a){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,r,o,a)})}makeCallPush(e,t,n,r,o){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.makeCallPush(t,n,r,o)})}writeChannelAppEvent(e,t,n,r){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChannelAppEvent(t,n,r)})}listDataSocket(e,t){return d(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==h.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listDataSocket(t)})}};T.DefaultHeartbeatTimeoutMs=1e4,T.DefaultConnectTimeoutMs=3e4;var G=T;