mezon-js 2.15.37 → 2.15.39

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
- var J=Object.defineProperty,V=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;var H=(f,e,t)=>e in f?J(f,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):f[e]=t,S=(f,e)=>{for(var t in e||(e={}))K.call(e,t)&&H(f,t,e[t]);if(N)for(var t of N(e))Y.call(e,t)&&H(f,t,e[t]);return f},w=(f,e)=>V(f,Q(e));var d=(f,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(f,e)).next())});import"whatwg-fetch";import{encode as $,decode as Z}from"js-base64";import*as R from"mezon-js-protobuf";function m(f,e,t){let n=S({method:f},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 ue(f){return $(encodeURIComponent(f).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function pe(f){return decodeURIComponent(Z(f).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function P(f){if(f==null)return{t:f};let e;if(f instanceof Uint8Array)e=new TextDecoder().decode(f);else if(typeof f=="string")e=f;else return typeof f=="object"?f:{t:f};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=f=>!f||f===null||f===void 0||f===""||f==="[]";function L(f){if(E(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,r=new Uint8Array(n);return R.MessageMentionList.decode(r)}catch(n){return P(f)}}function U(f){if(E(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,r=new Uint8Array(n);return R.MessageAttachmentList.decode(r)}catch(n){return P(f)}}function q(f){if(E(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,r=new Uint8Array(n);return R.ListChannelTimelineAttachment.decode(r)}catch(n){return P(f)}}function D(f){if(E(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,r=new Uint8Array(n);return R.MessageRefList.decode(r)}catch(n){return P(f)}}function F(f){if(E(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,r=new Uint8Array(n);return R.MessageReactionList.decode(r)}catch(n){return P(f)}}function W(f){if(E(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,r=new Uint8Array(n);return R.DirectFcmProto.decode(r)}catch(n){return P(f)}}function he(f){return R.MessageMentionList.encode(R.MessageMentionList.fromPartial(f)).finish()}function me(f){return R.MessageAttachmentList.encode(R.MessageAttachmentList.fromPartial(f)).finish()}function ge(f){return R.MessageRefList.encode(R.MessageRefList.fromPartial(f)).finish()}function _e(f){return R.MessageReactionList.encode(R.MessageReactionList.fromPartial(f)).finish()}function fe(f){return R.DirectFcmProto.encode(R.DirectFcmProto.fromPartial(f)).finish()}var X=(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))(X||{}),ee=(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))(ee||{}),te=(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))(te||{}),ne=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(ne||{}),se=(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))(se||{});function I(f){let e,t,n,r,o,a;try{e=P(f.channel_message.content)}catch(c){console.log("content is invalid",c)}try{t=F(f.channel_message.reactions)}catch(c){console.log("reactions is invalid",c)}try{n=L(f.channel_message.mentions)}catch(c){console.log("mentions is invalid",c)}try{r=U(f.channel_message.attachments)}catch(c){console.log("attachments is invalid",c)}try{o=D(f.channel_message.references)}catch(c){console.log("references is invalid",c)}try{a=f.channel_message.referenced_message}catch(c){console.log("referenced messages is invalid",c)}return{id:f.id||f.channel_message.message_id,avatar:f.channel_message.avatar,channel_id:f.channel_message.channel_id,mode:f.channel_message.mode,channel_label:f.channel_message.channel_label,clan_id:f.channel_message.clan_id,code:f.channel_message.code,message_id:f.channel_message.message_id,sender_id:f.channel_message.sender_id,update_time:f.channel_message.update_time,clan_logo:f.channel_message.clan_logo,category_name:f.channel_message.category_name,username:f.channel_message.username,clan_nick:f.channel_message.clan_nick,clan_avatar:f.channel_message.clan_avatar,display_name:f.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:f.channel_message.hide_editted,is_public:f.channel_message.is_public,create_time_seconds:f.channel_message.create_time_seconds,update_time_seconds:f.channel_message.update_time_seconds,topic_id:f.channel_message.topic_id}}import{encode as k}from"js-base64";import*as s from"mezon-js-protobuf";import{MezonNetworkAdapter as ie}from"mezon-js-protobuf";var x=(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))(x||{}),B=class B{constructor(e,t,n){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=n,this.adapter=new ie}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 x)return x[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,_)=>d(this,null,function*(){if(r&&window&&window.console&&console.log("incomming message with cid %o and message %o",p,_),p!=0){let y=this.cIds[p];if(!y){console.error("No promise executor for message: %o",_);return}delete this.cIds[p],_.error?y.reject({code:g,error:_.error}):y.resolve({code:g,message:_})}else yield o(0,0,_)})}send(e,t=B.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,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 "+k(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 "+k(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 "+k(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 "+k(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 "+k(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),_=m("POST",i,p);return e&&(_.headers.Authorization="Basic "+k(e+":"+t)),_.headers.Accept="application/x-protobuf",Promise.race([fetch(g,_).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 "+k(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 "+k(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,_)=>setTimeout(()=>_(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(_=>d(this,null,function*(){return s.ChannelMessageList.decode(_.message)})),new Promise((_,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",_=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=_,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(_=>d(this,null,function*(){return _.code!=0?{}:s.ChannelUserList.decode(_.message)})),new Promise((_,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(_=>d(this,null,function*(){return _.code!=0?{}:s.ChannelDescList.decode(_.message)})),new Promise((_,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 _="/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:_,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.code==0)return s.CheckDuplicateNameResponse.decode(i.message);throw i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,n,r={}){if(e==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteCategoryDesc",i=s.DeleteCategoryDescRequest.encode(s.DeleteCategoryDescRequest.fromPartial({category_id:e,clan_id:t,category_label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(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,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,n={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateEvent",a=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 "+k(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,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationChannelSetting",o=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(_=>d(this,null,function*(){return _.code!=0?{}:s.StreamingChannelUserList.decode(_.message)})),new Promise((_,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(_=>d(this,null,function*(){return _.code!=0?{}:s.ChannelDescListNoPool.decode(_.message)})),new Promise((_,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(_=>d(this,null,function*(){let y=yield _.arrayBuffer();return s.GenerateMeetTokenExternalResponse.decode(new Uint8Array(y))})),new Promise((_,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 "+k(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 _=yield g.arrayBuffer();return s.ListClanDiscover.decode(new Uint8Array(_))})),new Promise((g,_)=>setTimeout(()=>_(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(),_=m("POST",i,"");return _.body=g,Promise.race([this.send({urlPath:c,fetchOptions:_}).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,_,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:_,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 _="/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:_,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",_=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=_,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(_=>_),new Promise((_,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(),_=m("POST",i,"");return _.body=g,Promise.race([this.send({urlPath:c,fetchOptions:_}).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(),_=m("POST",i,"");return _.body=g,Promise.race([this.send({urlPath:c,fetchOptions:_}).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,_,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:_,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,_;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:(_=e.type)!=null?_: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 _=g.length>0?s.VotePollResponse.decode(g):{my_answer_indices:[]};return{my_answer_indices:Array.from((y=_.my_answer_indices)!=null?y:[])}})),new Promise((g,_)=>setTimeout(()=>_(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.code==0)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(_=>({index:_.index,label:_.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(_=>({answer_index:_.answer_index,user_ids:_.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(_=>d(this,null,function*(){return{}})),new Promise((_,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 _="",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:_,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,_,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:_,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,_,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:_,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,_,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:_,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,_,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:_,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,_,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:_,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))])})}};B.DefaultSendTimeoutMs=1e4;var z=B;var re="127.0.0.1",oe="7350",ae="defaultkey",ce=3e4,h={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},G=!1,T=class T{constructor(e=ae,t=re,n=oe,r=!1,o=ce,a=!0){this.serverkey=e;this.timeout=o;this.autoFallbackHttp=a;this.verbose=!1;this.host=t,this.port=n,this.useSSL=r;let c=`${r?"https://":"http://"}${t}:${n}`;this._heartbeatTimeoutMs=T.DefaultHeartbeatTimeoutMs,this._connectionState=h.DISCONNECTED,this.transport=new z(e,o,c)}isOpen(){return this._connectionState===h.CONNECTED}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){let p=I(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_event):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=G;G=!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,session_id:c.session_id||""}))}authenticateSMSOTPRequest(e,t,n){let r={username:t,account:{phoneno:e,vars:n}};return this.transport.AuthenticateSMSOTPRequest(this.serverkey,"",r,t).then(o=>Promise.resolve(o))}authenticateEmailOTPRequest(e,t,n){let r={username:t,account:{email:e,vars:n}};return this.transport.AuthenticateEmailOTPRequest(this.serverkey,"",r,t).then(o=>Promise.resolve(o))}confirmAuthenticateOTP(e){return 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,session_id:t.session_id||""}))})}authenticateEmail(e,t,n,r){let o={username:n,account:{email:e,password:t,vars:r}};return this.transport.authenticateEmail(this.serverkey,"",o,n).then(a=>({token:a.token||"",refresh_token:a.refresh_token||"",created:a.created||!1,api_url:a.api_url||"",ws_url:a.ws_url||"",id_token:a.id_token||"",is_remember:a.is_remember||!1,session_id:a.session_id||""}))}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,_,y,b,A;try{g=P(p.content)}catch(C){console.log("error parse content",C)}try{let C=F(p.reactions);_=(C==null?void 0:C.reactions)||C||P(p.reactions||"[]")}catch(C){_=P(p.reactions||"[]")}try{let C=L(p.mentions);y=(C==null?void 0:C.mentions)||C||P(p.mentions||"[]")}catch(C){y=P(p.mentions||"[]")}try{let C=U(p.attachments);b=(C==null?void 0:C.attachments)||C||P(p.attachments||"[]")}catch(C){b=P(p.attachments||"[]")}try{let C=D(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:_,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(_=>Promise.resolve(_))})}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,session_id:t.session_id||""}: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,_,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,_,y,b).then(A=>Promise.resolve(A))})}updateChannelMessage(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.updateChannelMessage(t,n,r,o,a,i,c,l,p,g,_).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,_,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,_,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,_){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,_)})}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,_,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,_,y,b,A)})}writeEphemeralMessage(e,t,n,r,o,a,i,c,l,p,g,_,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,_,y,b,A,C)})}writeChatMessage(e,t,n,r,o,a,i,c,l,p,g,_,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,_,y,b)})}writeMessageReaction(e,t,n,r,o,a,i,c,l,p,g,_,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,_,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,_,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,_,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 j=T;export{X as ApiAppRole,te as ChannelStreamMode,ee as ChannelType,j as Client,h as ConnectionState,I as CreateChannelMessageFromEvent,ne as NotificationType,se as WebrtcSignalingType,pe as b64DecodeUnicode,ue as b64EncodeUnicode,m as buildFetchOptions,U as decodeAttachments,q as decodeChannelTimelineAttachments,L as decodeMentions,W as decodeNotificationFcm,F as decodeReactions,D as decodeRefs,me as encodeAttachments,he as encodeMentions,fe as encodeNotificationFcm,_e as encodeReactions,ge as encodeRefs,P as safeJSONParse};
1
+ var J=Object.defineProperty,V=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;var H=(f,e,t)=>e in f?J(f,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):f[e]=t,S=(f,e)=>{for(var t in e||(e={}))K.call(e,t)&&H(f,t,e[t]);if(N)for(var t of N(e))Y.call(e,t)&&H(f,t,e[t]);return f},w=(f,e)=>V(f,Q(e));var d=(f,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(f,e)).next())});import"whatwg-fetch";import{encode as $,decode as Z}from"js-base64";import*as R from"mezon-js-protobuf";function m(f,e,t){let n=S({method:f},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 ue(f){return $(encodeURIComponent(f).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function pe(f){return decodeURIComponent(Z(f).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function P(f){if(f==null)return{t:f};let e;if(f instanceof Uint8Array)e=new TextDecoder().decode(f);else if(typeof f=="string")e=f;else return typeof f=="object"?f:{t:f};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=f=>!f||f===null||f===void 0||f===""||f==="[]";function L(f){if(E(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,r=new Uint8Array(n);return R.MessageMentionList.decode(r)}catch(n){return P(f)}}function U(f){if(E(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,r=new Uint8Array(n);return R.MessageAttachmentList.decode(r)}catch(n){return P(f)}}function q(f){if(E(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,r=new Uint8Array(n);return R.ListChannelTimelineAttachment.decode(r)}catch(n){return P(f)}}function D(f){if(E(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,r=new Uint8Array(n);return R.MessageRefList.decode(r)}catch(n){return P(f)}}function F(f){if(E(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,r=new Uint8Array(n);return R.MessageReactionList.decode(r)}catch(n){return P(f)}}function W(f){if(E(f))return;let e=f[0];if(e===91||e===123)return P(f);try{let n=f,r=new Uint8Array(n);return R.DirectFcmProto.decode(r)}catch(n){return P(f)}}function he(f){return R.MessageMentionList.encode(R.MessageMentionList.fromPartial(f)).finish()}function me(f){return R.MessageAttachmentList.encode(R.MessageAttachmentList.fromPartial(f)).finish()}function ge(f){return R.MessageRefList.encode(R.MessageRefList.fromPartial(f)).finish()}function _e(f){return R.MessageReactionList.encode(R.MessageReactionList.fromPartial(f)).finish()}function fe(f){return R.DirectFcmProto.encode(R.DirectFcmProto.fromPartial(f)).finish()}var X=(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))(X||{}),ee=(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))(ee||{}),te=(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))(te||{}),ne=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(ne||{}),se=(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))(se||{});function I(f){let e,t,n,r,o,a;try{e=P(f.channel_message.content)}catch(c){console.log("content is invalid",c)}try{t=F(f.channel_message.reactions)}catch(c){console.log("reactions is invalid",c)}try{n=L(f.channel_message.mentions)}catch(c){console.log("mentions is invalid",c)}try{r=U(f.channel_message.attachments)}catch(c){console.log("attachments is invalid",c)}try{o=D(f.channel_message.references)}catch(c){console.log("references is invalid",c)}try{a=f.channel_message.referenced_message}catch(c){console.log("referenced messages is invalid",c)}return{id:f.id||f.channel_message.message_id,avatar:f.channel_message.avatar,channel_id:f.channel_message.channel_id,mode:f.channel_message.mode,channel_label:f.channel_message.channel_label,clan_id:f.channel_message.clan_id,code:f.channel_message.code,message_id:f.channel_message.message_id,sender_id:f.channel_message.sender_id,update_time:f.channel_message.update_time,clan_logo:f.channel_message.clan_logo,category_name:f.channel_message.category_name,username:f.channel_message.username,clan_nick:f.channel_message.clan_nick,clan_avatar:f.channel_message.clan_avatar,display_name:f.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:f.channel_message.hide_editted,is_public:f.channel_message.is_public,create_time_seconds:f.channel_message.create_time_seconds,update_time_seconds:f.channel_message.update_time_seconds,topic_id:f.channel_message.topic_id}}import{encode as k}from"js-base64";import*as s from"mezon-js-protobuf";import{MezonNetworkAdapter as ie}from"mezon-js-protobuf";var x=(u=>(u[u.ListChannelDescs=0]="ListChannelDescs",u[u.GetAccount=1]="GetAccount",u[u.ListClanDescs=2]="ListClanDescs",u[u.ListClanUsers=3]="ListClanUsers",u[u.ListRoles=4]="ListRoles",u[u.ListEvents=5]="ListEvents",u[u.GetRoleOfUserInTheClan=6]="GetRoleOfUserInTheClan",u[u.GetListPermission=7]="GetListPermission",u[u.ListUserPermissionInChannel=8]="ListUserPermissionInChannel",u[u.GetNotificationClan=9]="GetNotificationClan",u[u.ListMutedChannel=10]="ListMutedChannel",u[u.ListStreamingChannelUsers=11]="ListStreamingChannelUsers",u[u.ListQuickMenuAccess=12]="ListQuickMenuAccess",u[u.GetNotificationChannel=13]="GetNotificationChannel",u[u.ListFriends=14]="ListFriends",u[u.EmojiRecentList=15]="EmojiRecentList",u[u.GetListEmojisByUserId=16]="GetListEmojisByUserId",u[u.ListClanBadgeCount=17]="ListClanBadgeCount",u[u.ListChannelBadgeCount=18]="ListChannelBadgeCount",u[u.ListLogedDevice=19]="ListLogedDevice",u[u.ListClanUsersStatus=20]="ListClanUsersStatus",u[u.ListChannelApps=21]="ListChannelApps",u[u.GetListFavoriteChannel=22]="GetListFavoriteChannel",u[u.ListCategoryDescs=23]="ListCategoryDescs",u[u.ListOnboarding=24]="ListOnboarding",u[u.GetListStickersByUserId=25]="GetListStickersByUserId",u[u.GetSystemMessageByClanId=26]="GetSystemMessageByClanId",u[u.GetPinMessagesList=27]="GetPinMessagesList",u[u.GetChannelCanvasList=28]="GetChannelCanvasList",u[u.ListChannelTimeline=29]="ListChannelTimeline",u[u.ListChannelMessages=30]="ListChannelMessages",u[u.ListActivity=31]="ListActivity",u[u.ListChannelByUserId=32]="ListChannelByUserId",u[u.ListUserClansByUserId=33]="ListUserClansByUserId",u[u.GetUserProfileOnClan=34]="GetUserProfileOnClan",u[u.RegistFCMDeviceToken=35]="RegistFCMDeviceToken",u[u.IsBanned=36]="IsBanned",u[u.ListThreadDescs=37]="ListThreadDescs",u[u.ListArchivedChannelDescs=38]="ListArchivedChannelDescs",u[u.ListChannelDetail=39]="ListChannelDetail",u[u.GetChannelCategoryNotiSettingsList=40]="GetChannelCategoryNotiSettingsList",u[u.ListRoleUsers=41]="ListRoleUsers",u[u.ListChannelUsers=42]="ListChannelUsers",u[u.ListChannelAttachment=43]="ListChannelAttachment",u[u.ListChannelVoiceUsers=44]="ListChannelVoiceUsers",u[u.ListUserOnline=45]="ListUserOnline",u[u.ListNotifications=46]="ListNotifications",u[u.ListChannelUsersUC=47]="ListChannelUsersUC",u[u.ListWebhookByChannelId=48]="ListWebhookByChannelId",u[u.GetPermissionByRoleIdChannelId=49]="GetPermissionByRoleIdChannelId",u[u.ListChannelSetting=50]="ListChannelSetting",u[u.ListApps=51]="ListApps",u[u.GetApp=52]="GetApp",u[u.ListForSaleItems=53]="ListForSaleItems",u[u.ListClanWebhook=54]="ListClanWebhook",u[u.GetUserStatus=55]="GetUserStatus",u[u.ListSdTopic=56]="ListSdTopic",u[u.AddFriends=57]="AddFriends",u[u.AddChannelUsers=58]="AddChannelUsers",u[u.RegistrationEmail=59]="RegistrationEmail",u[u.BlockFriends=60]="BlockFriends",u[u.UnblockFriends=61]="UnblockFriends",u[u.UploadAttachmentFile=62]="UploadAttachmentFile",u[u.UploadOauthFile=63]="UploadOauthFile",u[u.AddRolesChannelDesc=64]="AddRolesChannelDesc",u[u.CreateCategoryDesc=65]="CreateCategoryDesc",u[u.CreateChannelDesc=66]="CreateChannelDesc",u[u.CreateRole=67]="CreateRole",u[u.CreateEvent=68]="CreateEvent",u[u.DeleteRole=69]="DeleteRole",u[u.DeleteEvent=70]="DeleteEvent",u[u.DeleteRoleChannelDesc=71]="DeleteRoleChannelDesc",u[u.DeleteChannelDesc=72]="DeleteChannelDesc",u[u.CloseDMByChannelId=73]="CloseDMByChannelId",u[u.OpenDMByChannelId=74]="OpenDMByChannelId",u[u.DeleteAccount=75]="DeleteAccount",u[u.DeleteFriends=76]="DeleteFriends",u[u.DeleteCategoryDesc=77]="DeleteCategoryDesc",u[u.DeleteNotifications=78]="DeleteNotifications",u[u.DeleteClanDesc=79]="DeleteClanDesc",u[u.UpdateUser=80]="UpdateUser",u[u.UpdateUserProfileByClan=81]="UpdateUserProfileByClan",u[u.UpdateClanOrder=82]="UpdateClanOrder",u[u.RemoveChannelUsers=83]="RemoveChannelUsers",u[u.LeaveThread=84]="LeaveThread",u[u.ArchiveChannel=85]="ArchiveChannel",u[u.LinkSMS=86]="LinkSMS",u[u.ConfirmLinkMezonOTP=87]="ConfirmLinkMezonOTP",u[u.LinkEmail=88]="LinkEmail",u[u.CreateClanDesc=89]="CreateClanDesc",u[u.RemoveClanUsers=90]="RemoveClanUsers",u[u.BanClanUsers=91]="BanClanUsers",u[u.CreateLinkInviteUser=92]="CreateLinkInviteUser",u[u.InviteUser=93]="InviteUser",u[u.SetRoleChannelPermission=94]="SetRoleChannelPermission",u[u.SetNotificationChannelSetting=95]="SetNotificationChannelSetting",u[u.SetMuteChannel=96]="SetMuteChannel",u[u.SetMuteCategory=97]="SetMuteCategory",u[u.SetNotificationClanSetting=98]="SetNotificationClanSetting",u[u.SetNotificationCategorySetting=99]="SetNotificationCategorySetting",u[u.DeleteNotificationCategorySetting=100]="DeleteNotificationCategorySetting",u[u.DeleteNotificationChannel=101]="DeleteNotificationChannel",u[u.CreatePinMessage=102]="CreatePinMessage",u[u.CreateMessage2Inbox=103]="CreateMessage2Inbox",u[u.UnlinkMezon=104]="UnlinkMezon",u[u.UnlinkEmail=105]="UnlinkEmail",u[u.UpdateAccount=106]="UpdateAccount",u[u.UpdateUsername=107]="UpdateUsername",u[u.UpdateCategory=108]="UpdateCategory",u[u.UpdateCategoryOrder=109]="UpdateCategoryOrder",u[u.UpdateRoleOrder=110]="UpdateRoleOrder",u[u.UpdateClanDesc=111]="UpdateClanDesc",u[u.UpdateChannelDesc=112]="UpdateChannelDesc",u[u.UpdateChannelPrivate=113]="UpdateChannelPrivate",u[u.UpdateRole=114]="UpdateRole",u[u.UpdateEvent=115]="UpdateEvent",u[u.SearchMessage=116]="SearchMessage",u[u.CreateClanEmoji=117]="CreateClanEmoji",u[u.DeleteByIdClanEmoji=118]="DeleteByIdClanEmoji",u[u.UpdateClanEmojiById=119]="UpdateClanEmojiById",u[u.GenerateWebhook=120]="GenerateWebhook",u[u.HandleWebhook=121]="HandleWebhook",u[u.UpdateWebhookById=122]="UpdateWebhookById",u[u.DeleteWebhookById=123]="DeleteWebhookById",u[u.AddClanSticker=124]="AddClanSticker",u[u.UpdateClanStickerById=125]="UpdateClanStickerById",u[u.DeleteClanStickerById=126]="DeleteClanStickerById",u[u.ChangeChannelCategory=127]="ChangeChannelCategory",u[u.CheckDuplicateName=128]="CheckDuplicateName",u[u.AddApp=129]="AddApp",u[u.DeleteApp=130]="DeleteApp",u[u.UpdateApp=131]="UpdateApp",u[u.AddAppToClan=132]="AddAppToClan",u[u.CreateSystemMessage=133]="CreateSystemMessage",u[u.UpdateSystemMessage=134]="UpdateSystemMessage",u[u.DeleteSystemMessage=135]="DeleteSystemMessage",u[u.StreamingServerCallback=136]="StreamingServerCallback",u[u.EditChannelCanvases=137]="EditChannelCanvases",u[u.GetChannelCanvasDetail=138]="GetChannelCanvasDetail",u[u.DeleteChannelCanvas=139]="DeleteChannelCanvas",u[u.AddChannelFavorite=140]="AddChannelFavorite",u[u.RemoveChannelFavorite=141]="RemoveChannelFavorite",u[u.CreateActiviy=142]="CreateActiviy",u[u.GetPubKeys=143]="GetPubKeys",u[u.PushPubKey=144]="PushPubKey",u[u.GetChanEncryptionMethod=145]="GetChanEncryptionMethod",u[u.SetChanEncryptionMethod=146]="SetChanEncryptionMethod",u[u.GetKeyServer=147]="GetKeyServer",u[u.ListAuditLog=148]="ListAuditLog",u[u.GetOnboardingDetail=149]="GetOnboardingDetail",u[u.CreateOnboarding=150]="CreateOnboarding",u[u.UpdateOnboarding=151]="UpdateOnboarding",u[u.DeleteOnboarding=152]="DeleteOnboarding",u[u.ListOnboardingStep=153]="ListOnboardingStep",u[u.UpdateOnboardingStep=154]="UpdateOnboardingStep",u[u.GenerateClanWebhook=155]="GenerateClanWebhook",u[u.UpdateClanWebhookById=156]="UpdateClanWebhookById",u[u.DeleteClanWebhookById=157]="DeleteClanWebhookById",u[u.HandleClanWebhook=158]="HandleClanWebhook",u[u.UpdateUserStatus=159]="UpdateUserStatus",u[u.UpdateUserCustomStatus=160]="UpdateUserCustomStatus",u[u.GetTopicDetail=161]="GetTopicDetail",u[u.CreateSdTopic=162]="CreateSdTopic",u[u.DeleteSdTopic=163]="DeleteSdTopic",u[u.CreateExternalMezonMeet=164]="CreateExternalMezonMeet",u[u.GenerateMeetToken=165]="GenerateMeetToken",u[u.RemoveParticipantMezonMeet=166]="RemoveParticipantMezonMeet",u[u.MuteParticipantMezonMeet=167]="MuteParticipantMezonMeet",u[u.CreateRoomChannelApps=168]="CreateRoomChannelApps",u[u.GetMezonOauthClient=169]="GetMezonOauthClient",u[u.DeleteMezonOauthClient=170]="DeleteMezonOauthClient",u[u.UpdateMezonOauthClient=171]="UpdateMezonOauthClient",u[u.SearchThread=172]="SearchThread",u[u.GenerateHashChannelApps=173]="GenerateHashChannelApps",u[u.DeleteUserEvent=174]="DeleteUserEvent",u[u.AddUserEvent=175]="AddUserEvent",u[u.DeleteQuickMenuAccess=176]="DeleteQuickMenuAccess",u[u.AddQuickMenuAccess=177]="AddQuickMenuAccess",u[u.UpdateQuickMenuAccess=178]="UpdateQuickMenuAccess",u[u.TransferOwnership=179]="TransferOwnership",u[u.SendChannelMessage=180]="SendChannelMessage",u[u.UpdateChannelMessage=181]="UpdateChannelMessage",u[u.DeleteChannelMessage=182]="DeleteChannelMessage",u[u.ReportMessageAbuse=183]="ReportMessageAbuse",u[u.MessageButtonClick=184]="MessageButtonClick",u[u.DropdownBoxSelected=185]="DropdownBoxSelected",u[u.ActiveArchivedThread=186]="ActiveArchivedThread",u[u.UpdateChannelTimeline=187]="UpdateChannelTimeline",u[u.AddAgentToChannel=188]="AddAgentToChannel",u[u.DisconnectAgent=189]="DisconnectAgent",u[u.CreateChannelTimeline=190]="CreateChannelTimeline",u[u.DetailChannelTimeline=191]="DetailChannelTimeline",u[u.CreatePoll=192]="CreatePoll",u[u.VotePoll=193]="VotePoll",u[u.ClosePoll=194]="ClosePoll",u[u.GetPoll=195]="GetPoll",u[u.ReactChannelMessage=196]="ReactChannelMessage",u[u.MultipartUploadAttachmentFileStart=197]="MultipartUploadAttachmentFileStart",u[u.MultipartUploadAttachmentFileFinish=198]="MultipartUploadAttachmentFileFinish",u))(x||{}),B=class B{constructor(e,t,n){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=n,this.adapter=new ie}setOnOpen(e){this.adapter.onOpen=e}setOnError(e){this.adapter.onError=e}close(){this.adapter.close()}generatecid(){let e=this.nextCid;return this.nextCid>=65535?this.nextCid=1:++this.nextCid,e}setTransportAdapter(e){this.adapter=e}setFallbackSession(e){}getApiFromPath(e){if(e in x)return x[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,_)=>d(this,null,function*(){if(r&&window&&window.console&&console.log("incomming message with cid %o and message %o",p,_),p!=0){let y=this.cIds[p];if(!y){console.error("No promise executor for message: %o",_);return}delete this.cIds[p],_.error?y.reject({code:g,error:_.error}):y.resolve({code:g,message:_})}else yield o(0,0,_)})}send(e,t=B.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,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 "+k(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 "+k(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 "+k(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 "+k(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 "+k(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),_=m("POST",i,p);return e&&(_.headers.Authorization="Basic "+k(e+":"+t)),_.headers.Accept="application/x-protobuf",Promise.race([fetch(g,_).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 "+k(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 "+k(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,_)=>setTimeout(()=>_(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(_=>d(this,null,function*(){return s.ChannelMessageList.decode(_.message)})),new Promise((_,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",_=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=_,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(_=>d(this,null,function*(){return _.code!=0?{}:s.ChannelUserList.decode(_.message)})),new Promise((_,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(_=>d(this,null,function*(){return _.code!=0?{}:s.ChannelDescList.decode(_.message)})),new Promise((_,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 _="/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:_,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.code==0)return s.CheckDuplicateNameResponse.decode(i.message);throw i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,n,r={}){if(e==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteCategoryDesc",i=s.DeleteCategoryDescRequest.encode(s.DeleteCategoryDescRequest.fromPartial({category_id:e,clan_id:t,category_label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:o,fetchOptions:c}).then(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,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,n={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateEvent",a=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 "+k(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,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationChannelSetting",o=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(_=>d(this,null,function*(){return _.code!=0?{}:s.StreamingChannelUserList.decode(_.message)})),new Promise((_,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(_=>d(this,null,function*(){return _.code!=0?{}:s.ChannelDescListNoPool.decode(_.message)})),new Promise((_,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(_=>d(this,null,function*(){let y=yield _.arrayBuffer();return s.GenerateMeetTokenExternalResponse.decode(new Uint8Array(y))})),new Promise((_,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 "+k(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 _=yield g.arrayBuffer();return s.ListClanDiscover.decode(new Uint8Array(_))})),new Promise((g,_)=>setTimeout(()=>_(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(),_=m("POST",i,"");return _.body=g,Promise.race([this.send({urlPath:c,fetchOptions:_}).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,_,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:_,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 _="/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:_,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",_=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=_,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(_=>_),new Promise((_,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(),_=m("POST",i,"");return _.body=g,Promise.race([this.send({urlPath:c,fetchOptions:_}).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(),_=m("POST",i,"");return _.body=g,Promise.race([this.send({urlPath:c,fetchOptions:_}).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,_,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:_,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,_;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:(_=e.type)!=null?_: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 _=g.length>0?s.VotePollResponse.decode(g):{my_answer_indices:[]};return{my_answer_indices:Array.from((y=_.my_answer_indices)!=null?y:[])}})),new Promise((g,_)=>setTimeout(()=>_(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.code==0)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(_=>({index:_.index,label:_.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(_=>({answer_index:_.answer_index,user_ids:_.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(_=>d(this,null,function*(){return{}})),new Promise((_,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 _="",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:_,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,_,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:_,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,_,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:_,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,_,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:_,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,_,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:_,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,_,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:_,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))])})}};B.DefaultSendTimeoutMs=1e4;var z=B;var re="127.0.0.1",oe="7350",ae="defaultkey",ce=3e4,h={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},G=!1,T=class T{constructor(e=ae,t=re,n=oe,r=!1,o=ce,a=!0){this.serverkey=e;this.timeout=o;this.autoFallbackHttp=a;this.verbose=!1;this.host=t,this.port=n,this.useSSL=r;let c=`${r?"https://":"http://"}${t}:${n}`;this._heartbeatTimeoutMs=T.DefaultHeartbeatTimeoutMs,this._connectionState=h.DISCONNECTED,this.transport=new z(e,o,c)}isOpen(){return this._connectionState===h.CONNECTED}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){let p=I(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_event):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=G;G=!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,session_id:c.session_id||""}))}authenticateSMSOTPRequest(e,t,n){let r={username:t,account:{phoneno:e,vars:n}};return this.transport.AuthenticateSMSOTPRequest(this.serverkey,"",r,t).then(o=>Promise.resolve(o))}authenticateEmailOTPRequest(e,t,n){let r={username:t,account:{email:e,vars:n}};return this.transport.AuthenticateEmailOTPRequest(this.serverkey,"",r,t).then(o=>Promise.resolve(o))}confirmAuthenticateOTP(e){return 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,session_id:t.session_id||""}))})}authenticateEmail(e,t,n,r){let o={username:n,account:{email:e,password:t,vars:r}};return this.transport.authenticateEmail(this.serverkey,"",o,n).then(a=>({token:a.token||"",refresh_token:a.refresh_token||"",created:a.created||!1,api_url:a.api_url||"",ws_url:a.ws_url||"",id_token:a.id_token||"",is_remember:a.is_remember||!1,session_id:a.session_id||""}))}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,_,y,b,A;try{g=P(p.content)}catch(C){console.log("error parse content",C)}try{let C=F(p.reactions);_=(C==null?void 0:C.reactions)||C||P(p.reactions||"[]")}catch(C){_=P(p.reactions||"[]")}try{let C=L(p.mentions);y=(C==null?void 0:C.mentions)||C||P(p.mentions||"[]")}catch(C){y=P(p.mentions||"[]")}try{let C=U(p.attachments);b=(C==null?void 0:C.attachments)||C||P(p.attachments||"[]")}catch(C){b=P(p.attachments||"[]")}try{let C=D(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:_,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(_=>Promise.resolve(_))})}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,session_id:t.session_id||""}: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,_,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,_,y,b).then(A=>Promise.resolve(A))})}updateChannelMessage(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.updateChannelMessage(t,n,r,o,a,i,c,l,p,g,_).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,_,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,_,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,_){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,_)})}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,_,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,_,y,b,A)})}writeEphemeralMessage(e,t,n,r,o,a,i,c,l,p,g,_,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,_,y,b,A,C)})}writeChatMessage(e,t,n,r,o,a,i,c,l,p,g,_,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,_,y,b)})}writeMessageReaction(e,t,n,r,o,a,i,c,l,p,g,_,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,_,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,_,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,_,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 j=T;export{X as ApiAppRole,te as ChannelStreamMode,ee as ChannelType,j as Client,h as ConnectionState,I as CreateChannelMessageFromEvent,ne as NotificationType,se as WebrtcSignalingType,pe as b64DecodeUnicode,ue as b64EncodeUnicode,m as buildFetchOptions,U as decodeAttachments,q as decodeChannelTimelineAttachments,L as decodeMentions,W as decodeNotificationFcm,F as decodeReactions,D as decodeRefs,me as encodeAttachments,he as encodeMentions,fe as encodeNotificationFcm,_e as encodeReactions,ge as encodeRefs,P as safeJSONParse};