mezon-js 2.14.67 → 2.14.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var oe=Object.create;var O=Object.defineProperty,ae=Object.defineProperties,ue=Object.getOwnPropertyDescriptor,le=Object.getOwnPropertyDescriptors,ce=Object.getOwnPropertyNames,V=Object.getOwnPropertySymbols,de=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable;var Y=(_,e,t)=>e in _?O(_,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):_[e]=t,R=(_,e)=>{for(var t in e||(e={}))$.call(e,t)&&Y(_,t,e[t]);if(V)for(var t of V(e))he.call(e,t)&&Y(_,t,e[t]);return _},M=(_,e)=>ae(_,le(e));var fe=(_,e)=>{for(var t in e)O(_,t,{get:e[t],enumerable:!0})},Z=(_,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ce(e))!$.call(_,a)&&a!==t&&O(_,a,{get:()=>e[a],enumerable:!(i=ue(e,a))||i.enumerable});return _};var H=(_,e,t)=>(t=_!=null?oe(de(_)):{},Z(e||!_||!_.__esModule?O(t,"default",{value:_,enumerable:!0}):t,_)),pe=_=>Z(O({},"__esModule",{value:!0}),_);var h=(_,e,t)=>new Promise((i,a)=>{var l=u=>{try{c(t.next(u))}catch(o){a(o)}},d=u=>{try{c(t.throw(u))}catch(o){a(o)}},c=u=>u.done?i(u.value):Promise.resolve(u.value).then(l,d);c((t=t.apply(_,e)).next())});var qe={};fe(qe,{ChannelStreamMode:()=>ie,ChannelType:()=>ne,Client:()=>K,ConnectionState:()=>U,DefaultSocket:()=>B,NotificationType:()=>re,Session:()=>L,WebrtcSignalingType:()=>se,b64DecodeUnicode:()=>ge,b64EncodeUnicode:()=>me,buildFetchOptions:()=>p,decodeAttachments:()=>T,decodeMentions:()=>x,decodeNotificationFcm:()=>N,decodeReactions:()=>F,decodeRefs:()=>W,encodeAttachments:()=>ye,encodeMentions:()=>_e,encodeNotificationFcm:()=>Pe,encodeReactions:()=>be,encodeRefs:()=>Ae,getFetcher:()=>m,resetFetchStrategy:()=>Re,safeJSONParse:()=>w,setFetchStrategy:()=>we});module.exports=pe(qe);var Qi=require("whatwg-fetch");var I=require("js-base64"),C=H(require("mezon-js-protobuf"));function p(_,e,t){let i=R({method:_},e);return i.headers=R({},e.headers),Object.keys(i.headers).includes("Accept")||(i.headers.Accept="application/proto"),Object.keys(i.headers).includes("Content-Type")||(i.headers["Content-Type"]="application/proto"),Object.keys(i.headers).forEach(a=>{i.headers[a]||delete i.headers[a]}),t&&(i.body=t),i}function me(_){return(0,I.encode)(encodeURIComponent(_).replace(/%([0-9A-F]{2})/g,function(t,i){return String.fromCharCode(+("0x"+i))}))}function ge(_){return decodeURIComponent((0,I.decode)(_).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function w(_){if(_==null)return{t:_};let e;if(_ instanceof Uint8Array)e=new TextDecoder().decode(_);else if(typeof _=="string")e=_;else return typeof _=="object"?_:{t:_};if(!e||e===""||e==="[]")return{t:e};try{return JSON.parse(e)}catch(t){try{let i=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(i)}catch(i){return console.error("JSON Parse failed completely:",{original:e,error:i}),{t:e}}}}var D=_=>!_||_===null||_===void 0||_===""||_==="[]";function x(_){if(D(_))return;let e=_[0];if(e===91||e===123)return w(_);try{let i=_,a=new Uint8Array(i);return C.MessageMentionList.decode(a)}catch(i){return w(_)}}function T(_){if(D(_))return;let e=_[0];if(e===91||e===123)return w(_);try{let i=_,a=new Uint8Array(i);return C.MessageAttachmentList.decode(a)}catch(i){return w(_)}}function W(_){if(D(_))return;let e=_[0];if(e===91||e===123)return w(_);try{let i=_,a=new Uint8Array(i);return C.MessageRefList.decode(a)}catch(i){return w(_)}}function F(_){if(D(_))return;let e=_[0];if(e===91||e===123)return w(_);try{let i=_,a=new Uint8Array(i);return C.MessageReactionList.decode(a)}catch(i){return w(_)}}function N(_){if(D(_))return;let e=_[0];if(e===91||e===123)return w(_);try{let i=_,a=new Uint8Array(i);return C.DirectFcmProto.decode(a)}catch(i){return w(_)}}function _e(_){return C.MessageMentionList.encode(C.MessageMentionList.fromPartial(_)).finish()}function ye(_){return C.MessageAttachmentList.encode(C.MessageAttachmentList.fromPartial(_)).finish()}function Ae(_){return C.MessageRefList.encode(C.MessageRefList.fromPartial(_)).finish()}function be(_){return C.MessageReactionList.encode(C.MessageReactionList.fromPartial(_)).finish()}function Pe(_){return C.DirectFcmProto.encode(C.DirectFcmProto.fromPartial(_)).finish()}var E=require("js-base64"),s=H(require("mezon-js-protobuf"));var J=fetch,we=_=>{J=_},Re=()=>{J=fetch},m=()=>J;var j=class{constructor(e,t,i){this.serverKey=e;this.timeoutMs=t;this.basePath=i}setBasePath(e){this.basePath=e}deleteAccount(e,t={}){let i="/mezon.api.Mezon/DeleteAccount",a=new Map,l="",d=this.buildFullUrl(this.basePath,i,a),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([m()(d,c).then(u=>{if(u.status==204)return u;if(u.status>=200&&u.status<300)return u;throw u}),new Promise((u,o)=>setTimeout(o,this.timeoutMs,"Request timed out."))])}getAccount(e,t={}){let i="/mezon.api.Mezon/GetAccount",a=new Map,l="",d=this.buildFullUrl(this.basePath,i,a),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([m()(d,c).then(u=>h(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return s.Account.decode(new Uint8Array(o))}else throw u})),new Promise((u,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateAccount(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateAccount",l=new Map,c=s.UpdateAccountRequest.encode(s.UpdateAccountRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/checklogin",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/confirmlogin",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(t,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Bearer "+e),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/createqrlogin",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LoginIDResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/smsotp",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/emailotp",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/email",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,i,a,l,d,c={}){if(i==null)throw new Error("'account' is a required parameter but is null or undefined.");let u="/v2/account/authenticate/mezon",o=new Map;o.set("create",a),o.set("username",l),o.set("is_remember",d);let n="";n=JSON.stringify(i||{});let r=this.buildFullUrl(this.basePath,u,o),f=p("POST",c,n);return e&&(f.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),f.headers.Accept="application/x-protobuf",Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.Session.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}linkEmail(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/LinkEmail",l=new Map,c=s.UpdateAccountRequest.encode(s.UpdateAccountRequest.fromPartial({email:t.email})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}linkSMS(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/LinkSMS",l=new Map,c=s.AccountMezon.encode(s.AccountMezon.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}confirmLinkMezonOTP(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ConfirmLinkMezonOTP",l=new Map,c=s.LinkAccountConfirmRequest.encode(s.LinkAccountConfirmRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),o.headers.Accept="application/x-protobuf",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/confirmotp",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}registrationEmail(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/registry",l=new Map,d="";d=JSON.stringify(t||{});let c=this.buildFullUrl(this.basePath,a,l),u=p("POST",i,d);return e&&(u.headers.Authorization="Bearer "+e),u.headers.Accept="application/x-protobuf",Promise.race([m()(c,u).then(o=>h(this,null,function*(){if(o.status==204)return{};if(o.status>=200&&o.status<300){let n=yield o.arrayBuffer();return s.Session.decode(new Uint8Array(n))}else throw o})),new Promise((o,n)=>setTimeout(()=>n(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/SessionRefresh",d=new Map,u=s.SessionRefreshRequest.encode(s.SessionRefreshRequest.fromPartial(i)).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.Session.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}unlinkEmail(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UnlinkEmail",l=new Map,c=s.AccountEmail.encode(s.AccountEmail.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listActivity(e,t={}){let i="/mezon.api.Mezon/ListActivity",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.ListUserActivity.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}createActiviy(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateActiviy",l=new Map,c=s.CreateActivityRequest.encode(s.CreateActivityRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.UserActivity.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}addApp(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddApp",l=new Map,c=s.AddAppRequest.encode(s.AddAppRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.App.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListApps",c=new Map,o=s.ListAppsRequest.encode(s.ListAppsRequest.fromPartial({filter:t,tombstones:i,cursor:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.AppList.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,i,a={}){if(t==null)throw new Error("'appId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/AddAppToClan",d=new Map,u=s.AppClan.encode(s.AppClan.fromPartial({app_id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}deleteApp(e,t,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteApp",l=new Map,c=s.App.encode(s.App.fromPartial({id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return n;throw n})),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}getApp(e,t,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetApp",l=new Map,c=s.App.encode(s.App.fromPartial({id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.App.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateApp(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateApp",d=new Map,u=s.UpdateAppRequest.encode(s.UpdateAppRequest.fromPartial(M(R({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.App.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/ListAuditLog",u=new Map,n=s.ListAuditLogRequest.encode(s.ListAuditLogRequest.fromPartial({clan_id:a,user_id:i,action_log:t,date_log:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.ListAuditLog.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}updateCategoryOrder(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateCategoryOrder",l=new Map,c=s.UpdateCategoryOrderRequest.encode(s.UpdateCategoryOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return n;throw n})),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,i,a,l,d,c={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let u="/mezon.api.Mezon/ListCategoryDescs",o=new Map,r=s.CategoryDesc.encode(s.CategoryDesc.fromPartial({clan_id:t,creator_id:i,category_name:a,category_id:l,category_order:d})).finish(),f=this.buildFullUrl(this.basePath,u,o),g=p("POST",c,"");return g.body=r,e&&(g.headers.Authorization="Bearer "+e),Promise.race([m()(f,g).then(y=>h(this,null,function*(){if(y.status==204)return{};if(y.status>=200&&y.status<300){let b=yield y.arrayBuffer();return s.CategoryDescList.decode(new Uint8Array(b))}else throw y})),new Promise((y,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t,i={}){let a="/mezon.api.Mezon/ListChannelApps",l=new Map,c=s.ListChannelAppsRequest.encode(s.ListChannelAppsRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListChannelAppsResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,i,a,l,d={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetChannelCanvasList",u=new Map,n=s.ChannelCanvasListRequest.encode(s.ChannelCanvasListRequest.fromPartial({channel_id:t,clan_id:i,limit:a,page:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.ChannelCanvasListResponse.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}addChannelFavorite(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddChannelFavorite",l=new Map,c=s.AddFavoriteChannelRequest.encode(s.AddFavoriteChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.AddFavoriteChannelResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/RemoveChannelFavorite",d=new Map,u=s.RemoveFavoriteChannelRequest.encode(s.RemoveFavoriteChannelRequest.fromPartial({channel_id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}getListFavoriteChannel(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetListFavoriteChannel",l=new Map,c=s.ListFavoriteChannelRequest.encode(s.ListFavoriteChannelRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListFavoriteChannelResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,i,a,l,d,c,u={}){if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListChannelMessages",n=new Map,f=s.ListChannelMessagesRequest.encode(s.ListChannelMessagesRequest.fromPartial({clan_id:t,channel_id:i,message_id:a,direction:l,limit:d,topic_id:c})).finish(),g=this.buildFullUrl(this.basePath,o,n),y=p("POST",u,"");return y.body=f,e&&(y.headers.Authorization="Bearer "+e),Promise.race([m()(g,y).then(b=>h(this,null,function*(){if(b.status==204)return{};if(b.status>=200&&b.status<300){let A=yield b.arrayBuffer();return s.ChannelMessageList.decode(new Uint8Array(A))}else throw b})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/AddChannelUsers",d=new Map,u=s.AddChannelUsersRequest.encode(s.AddChannelUsersRequest.fromPartial({channel_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,i,a,l,d,c,u,o,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ListChannelAttachment",f=new Map,y=s.ListChannelAttachmentRequest.encode(s.ListChannelAttachmentRequest.fromPartial({channel_id:t,clan_id:i,file_type:a,limit:l,state:d,before:c,after:u,around:o})).finish(),b=this.buildFullUrl(this.basePath,r,f),A=p("POST",n,"");return A.body=y,e&&(A.headers.Authorization="Bearer "+e),Promise.race([m()(b,A).then(P=>h(this,null,function*(){if(P.status==204)return{};if(P.status>=200&&P.status<300){let v=yield P.arrayBuffer();return s.ChannelAttachmentList.decode(new Uint8Array(v))}else throw P})),new Promise((P,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/GetChanEncryptionMethod",d=new Map,u=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial({channel_id:t,method:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.ChanEncryptionMethod.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/SetChanEncryptionMethod",d=new Map,u=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial(M(R({},i),{channel_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,i,a={}){if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/LeaveThread",d=new Map,u=s.LeaveThreadRequest.encode(s.LeaveThreadRequest.fromPartial({channel_id:i,clan_id:t})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}removeChannelUsers(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/RemoveChannelUsers",d=new Map,u=s.RemoveChannelUsersRequest.encode(s.RemoveChannelUsersRequest.fromPartial({channel_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,i,a,l,d,c,u={}){if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListChannelUsers",n=new Map,f=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:i,channel_type:a,limit:l,state:d,cursor:c})).finish(),g=this.buildFullUrl(this.basePath,o,n),y=p("POST",u,"");return y.body=f,e&&(y.headers.Authorization="Bearer "+e),Promise.race([m()(g,y).then(b=>h(this,null,function*(){if(b.status==204)return{};if(b.status>=200&&b.status<300){let A=yield b.arrayBuffer();return s.ChannelUserList.decode(new Uint8Array(A))}else throw b})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/ListChannelDescs",n=new Map,f=s.ListChannelDescsRequest.encode(s.ListChannelDescsRequest.fromPartial({limit:t,state:i,cursor:a,clan_id:l,channel_type:d,is_mobile:c})).finish(),g=this.buildFullUrl(this.basePath,o,n),y=p("POST",u,"");return y.body=f,e&&(y.headers.Authorization="Bearer "+e),Promise.race([m()(g,y).then(b=>h(this,null,function*(){if(b.status==204)return{};if(b.status>=200&&b.status<300){let A=yield b.arrayBuffer();return s.ChannelDescList.decode(new Uint8Array(A))}else throw b})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateChannelDesc",l=new Map,c=s.CreateChannelDescRequest.encode(s.CreateChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ChannelDescription.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,i,a={}){let l="/mezon.api.Mezon/ListChannelUsersUC",d=new Map,u=s.AllUsersAddChannelRequest.encode(s.AllUsersAddChannelRequest.fromPartial({channel_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.AllUsersAddChannelResponse.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,i,a={}){if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteChannelDesc",d=new Map,u=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateChannelDesc",d=new Map,u=s.UpdateChannelDescRequest.encode(s.UpdateChannelDescRequest.fromPartial(M(R({},i),{channel_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,i,a,l,d,c,u,o,n,r,f={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let g="/mezon.api.Mezon/ListChannelSetting",y=new Map,A=s.ChannelSettingListRequest.encode(s.ChannelSettingListRequest.fromPartial({clan_id:t,parent_id:i,category_id:a,active:d,private_channel:l,status:c,type:u,limit:o,page:n,channel_label:r})).finish(),P=this.buildFullUrl(this.basePath,g,y),v=p("POST",f,"");return v.body=A,e&&(v.headers.Authorization="Bearer "+e),Promise.race([m()(P,v).then(S=>h(this,null,function*(){if(S.status==204)return{};if(S.status>=200&&S.status<300){let q=yield S.arrayBuffer();return s.ChannelSettingListResponse.decode(new Uint8Array(q))}else throw S})),new Promise((S,q)=>setTimeout(()=>q(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,i,a={}){let l="/mezon.api.Mezon/ListChannelVoiceUsers",d=new Map,u=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.VoiceChannelUserList.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listClanUnreadMsgIndicator(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListClanUnreadMsgIndicator",l=new Map,c=s.ListClanUnreadMsgIndicatorRequest.encode(s.ListClanUnreadMsgIndicatorRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListClanUnreadMsgIndicatorResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListClanDescs",c=new Map,o=s.ListClanDescRequest.encode(s.ListClanDescRequest.fromPartial({limit:t,state:i,cursor:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.ClanDescList.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}createClanDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateClanDesc",l=new Map,c=s.CreateClanDescRequest.encode(s.CreateClanDescRequest.fromPartial({clan_name:t.clan_name,logo:t.logo,banner:t.banner})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ClanDesc.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteClanDesc(e,t,i={}){if(t==null)throw new Error("'clanDescId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteClanDesc",l=new Map,c=s.DeleteClanDescRequest.encode(s.DeleteClanDescRequest.fromPartial({clan_desc_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}updateClanDesc(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateClanDesc",d=new Map,u=s.UpdateClanDescRequest.encode(s.UpdateClanDescRequest.fromPartial(R({clan_id:t},i))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/RemoveClanUsers",d=new Map,u=s.RemoveClanUsersRequest.encode(s.RemoveClanUsersRequest.fromPartial({clan_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return(yield r.arrayBuffer()).byteLength>0?{}:{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,i,a={}){let l="/mezon.api.Mezon/ListBannedUsers",d=new Map,u=s.BannedUserListRequest.encode(s.BannedUserListRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.BannedUserList.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,i,a,l,d={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UnbanClanUsers",u=new Map,n=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:i,user_ids:a,ban_time:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300)return(yield g.arrayBuffer()).byteLength>0?{}:{};throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,i,a,l,d={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/BanClanUsers",u=new Map,n=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:i,user_ids:a,ban_time:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300)return(yield g.arrayBuffer()).byteLength>0?{}:{};throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}listClanUsers(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListClanUsers",l=new Map,c=s.ListClanUsersRequest.encode(s.ListClanUsersRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ClanUserList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createCategoryDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateCategoryDesc",l=new Map,c=s.CreateCategoryDescRequest.encode(s.CreateCategoryDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.CategoryDesc.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,i,a,l={}){if(t==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteCategoryDesc",c=new Map,o=s.DeleteCategoryDescRequest.encode(s.DeleteCategoryDescRequest.fromPartial({category_id:t,clan_id:i,category_label:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300)return(yield f.arrayBuffer()).byteLength>0?{}:{};throw f})),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/RegistFCMDeviceToken",u=new Map,n=s.RegistFcmDeviceTokenRequest.encode(s.RegistFcmDeviceTokenRequest.fromPartial({token:t,device_id:i,platform:a,voip_token:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.RegistFcmDeviceTokenResponse.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}closeDirectMess(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CloseDMByChannelId",l=new Map,c=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return(yield n.arrayBuffer()).byteLength>0?{}:{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}openDirectMess(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/OpenDMByChannelId",l=new Map,c=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return(yield n.arrayBuffer()).byteLength>0?{}:{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createClanEmoji(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateClanEmoji",l=new Map,c=s.ClanEmojiCreateRequest.encode(s.ClanEmojiCreateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return(yield n.arrayBuffer()).byteLength>0?{}:{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,i,a,l={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteByIdClanEmoji",c=new Map,o=s.ClanEmojiDeleteRequest.encode(s.ClanEmojiDeleteRequest.fromPartial({id:t,clan_id:i,emoji_label:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300)return(yield f.arrayBuffer()).byteLength>0?{}:{};throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateClanEmojiById",d=new Map,u=s.ClanEmojiUpdateRequest.encode(s.ClanEmojiUpdateRequest.fromPartial({id:i.id,shortname:i.shortname,clan_id:i.clan_id})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return(yield r.arrayBuffer()).byteLength>0?{}:{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e,t={}){let i="/mezon.api.Mezon/EmojiRecentList",a=new Map,l="",d=this.buildFullUrl(this.basePath,i,a),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([m()(d,c).then(u=>h(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return s.EmojiRecentList.decode(new Uint8Array(o))}else throw u})),new Promise((u,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e,t={}){let i="/mezon.api.Mezon/GetListEmojisByUserId",a=new Map,l="",d=this.buildFullUrl(this.basePath,i,a),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([m()(d,c).then(u=>h(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return s.EmojiListedResponse.decode(new Uint8Array(o))}else throw u})),new Promise((u,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}searchMessage(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SearchMessage",l=new Map,c=s.SearchMessageRequest.encode(s.SearchMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.SearchMessageResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}event(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateEvent",l=new Map,c=s.Event.encode(s.Event.fromPartial({external:t.external,name:t.name,properties:t.properties})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listEvents(e,t,i={}){let a="/mezon.api.Mezon/ListEvents",l=new Map,c=s.ListEventsRequest.encode(s.ListEventsRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.EventList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createEvent(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateEvent",l=new Map,c=s.CreateEventRequest.encode(s.CreateEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.EventManagement.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateEventUser(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateEventUser",l=new Map,c=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,i,a,l,d,c={}){if(t==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let u="/mezon.api.Mezon/DeleteEvent",o=new Map,r=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial({event_id:t,clan_id:i,creator_id:a,event_label:l,channel_id:d})).finish(),f=this.buildFullUrl(this.basePath,u,o),g=p("POST",c,"");return g.body=r,e&&(g.headers.Authorization="Bearer "+e),Promise.race([m()(f,g).then(y=>h(this,null,function*(){if(y.status==204)return{};if(y.status>=200&&y.status<300)return{};throw y})),new Promise((y,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,i,a={}){if(t==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateEvent",d=new Map,u=s.UpdateEventRequest.encode(s.UpdateEventRequest.fromPartial(i)).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,i,a={}){let l="/mezon.api.Mezon/DeleteFriends",d=new Map,u=s.DeleteFriendsRequest.encode(s.DeleteFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listFriends(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListFriends",c=new Map,o=s.ListFriendsRequest.encode(s.ListFriendsRequest.fromPartial({limit:t,state:i,cursor:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.FriendList.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,i,a={}){let l="/mezon.api.Mezon/AddFriends",d=new Map,u=s.AddFriendsRequest.encode(s.AddFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.AddFriendsResponse.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,i,a={}){let l="/mezon.api.Mezon/BlockFriends",d=new Map,u=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,i,a={}){let l="/mezon.api.Mezon/UnblockFriends",d=new Map,u=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t,i={}){let a="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",l=new Map,c=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotificationChannelCategorySettingList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getUserProfileOnClan(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetUserProfileOnClan",l=new Map,c=s.ClanProfileRequest.encode(s.ClanProfileRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ClanProfile.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t,i={}){let a="/mezon.api.Mezon/GetNotificationCategory",l=new Map,c=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotificationUserChannel.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t,i={}){let a="/mezon.api.Mezon/GetNotificationChannel",l=new Map,c=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotificationUserChannel.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t,i={}){let a="/mezon.api.Mezon/GetNotificationClan",l=new Map,c=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotificationSetting.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t,i={}){let a="/mezon.api.Mezon/GetNotificationReactMessage",l=new Map,c=s.NotifiReactMessage.encode(s.NotifiReactMessage.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotifiReactMessage.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}giveMeACoffee(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GiveMeACoffee",l=new Map,c=s.GiveCoffeeEvent.encode(s.GiveCoffeeEvent.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getKeyServer(e,t={}){let i="/mezon.api.Mezon/GetKeyServer",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.GetKeyServerResp.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}createLinkInviteUser(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateLinkInviteUser",l=new Map,c=s.LinkInviteUserRequest.encode(s.LinkInviteUserRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkInviteUser.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}inviteUser(e,t,i={}){if(t==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/InviteUser",l=new Map,c=s.InviteUserRequest.encode(s.InviteUserRequest.fromPartial({invite_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.InviteUserRes.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,i,a={}){if(i==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let l="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(i))),d=new Map,c="",u=this.buildFullUrl(this.basePath,l,d),o=p("GET",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/json",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return n.json();throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e,t={}){let i="/mezon.api.Mezon/ListChannelByUserId",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.ChannelDescList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}markAsRead(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/MarkAsRead",l=new Map,c=s.MarkAsReadRequest.encode(s.MarkAsReadRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listMezonOauthClient(e,t={}){let i="/mezon.api.Mezon/ListMezonOauthClient",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.MezonOauthClientList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}setMuteCategory(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetMuteCategory",l=new Map,c=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}setMuteChannel(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetMuteChannel",l=new Map,c=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,i,a={}){let l="/mezon.api.Mezon/DeleteNotifications",d=new Map,u=s.DeleteNotificationsRequest.encode(s.DeleteNotificationsRequest.fromPartial({ids:t||[],category:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,i,a,l,d,c={}){let u="/mezon.api.Mezon/ListNotifications",o=new Map,r=s.ListNotificationsRequest.encode(s.ListNotificationsRequest.fromPartial({limit:t,clan_id:i,notification_id:a,category:l,direction:d})).finish(),f=this.buildFullUrl(this.basePath,u,o),g=p("POST",c,"");return g.body=r,e&&(g.headers.Authorization="Bearer "+e),Promise.race([m()(f,g).then(y=>h(this,null,function*(){if(y.status==204)return{};if(y.status>=200&&y.status<300){let b=yield y.arrayBuffer();return s.NotificationList.decode(new Uint8Array(b))}else throw y})),new Promise((y,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetNotificationChannelSetting",l=new Map,c=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}setNotificationClanSetting(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetNotificationClanSetting",l=new Map,c=s.SetDefaultNotificationRequest.encode(s.SetDefaultNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}setNotificationCategorySetting(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetNotificationCategorySetting",l=new Map,c=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t,i={}){let a="/mezon.api.Mezon/DeleteNotificationCategorySetting",l=new Map,c=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t,i={}){let a="/mezon.api.Mezon/DeleteNotificationChannel",l=new Map,c=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t,i={}){let a="/mezon.api.Mezon/DeleteNotiReactMessage",l=new Map,c=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}setNotificationReactMessage(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetNotificationReactMessage",l=new Map,c=s.NotificationChannel.encode(s.NotificationChannel.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}setRoleChannelPermission(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetRoleChannelPermission",l=new Map,c=s.UpdateRoleChannelRequest.encode(s.UpdateRoleChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}getListPermission(e,t={}){let i="/mezon.api.Mezon/GetListPermission",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.PermissionList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,i,a,l={}){let d="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",c=new Map,o=s.PermissionRoleChannelListEventRequest.encode(s.PermissionRoleChannelListEventRequest.fromPartial({role_id:t,channel_id:i,user_id:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.PermissionRoleChannelListEventResponse.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/DeletePinMessage",u=new Map,n=s.DeletePinMessage.encode(s.DeletePinMessage.fromPartial({id:t,message_id:i,channel_id:a,clan_id:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>{if(g.status==204)return g;if(g.status>=200&&g.status<300)return g;throw g}),new Promise((g,y)=>setTimeout(y,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,i,a,l={}){let d="/mezon.api.Mezon/GetPinMessagesList",c=new Map,o=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial({message_id:t,channel_id:i,clan_id:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.PinMessagesList.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}createMessage2Inbox(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateMessage2Inbox",l=new Map,c=s.Message2InboxRequest.encode(s.Message2InboxRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ChannelMessageHeader.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createPinMessage(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreatePinMessage",l=new Map,c=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ChannelMessageHeader.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t,i={}){let a="/mezon.api.Mezon/GetPubKeys",l=new Map,c=s.GetPubKeysRequest.encode(s.GetPubKeysRequest.fromPartial({user_ids:t||[]})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.GetPubKeysResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}pushPubKey(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/PushPubKey",l=new Map,c=s.PushPubKeyRequest.encode(s.PushPubKeyRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}addRolesChannelDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddRolesChannelDesc",l=new Map,c=s.AddRoleChannelDescRequest.encode(s.AddRoleChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}changeChannelCategory(e,t,i,a={}){if(t==null)throw new Error("'newCategoryId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/ChangeChannelCategory",d=new Map,u=s.ChangeChannelCategoryRequest.encode(s.ChangeChannelCategoryRequest.fromPartial(M(R({},i),{new_category_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}deleteRoleChannelDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteRoleChannelDesc",l=new Map,c=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listRoles(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/ListRoles",u=new Map,n=s.RoleListEventRequest.encode(s.RoleListEventRequest.fromPartial({clan_id:t,limit:i,state:a,cursor:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.RoleListEventResponse.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}createRole(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateRole",l=new Map,c=s.CreateRoleRequest.encode(s.CreateRoleRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Role.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateRoleDelete(e,t,i,a={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteRole",d=new Map,u=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(M(R({},i),{role_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,i,a,l,d={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteRole",u=new Map,n=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial({role_id:t,channel_id:i,clan_id:a,role_label:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>{if(g.status==204)return g;if(g.status>=200&&g.status<300)return g;throw g}),new Promise((g,y)=>setTimeout(y,this.timeoutMs,"Request timed out."))])}updateRole(e,t,i,a={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateRole",d=new Map,u=s.UpdateRoleRequest.encode(s.UpdateRoleRequest.fromPartial(M(R({},i),{role_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listRolePermissions(e,t,i={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListRolePermissions",l=new Map,c=s.ListPermissionsRequest.encode(s.ListPermissionsRequest.fromPartial({role_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.PermissionList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,i,a,l={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/ListRoleUsers",c=new Map,o=s.ListRoleUsersRequest.encode(s.ListRoleUsersRequest.fromPartial({role_id:t,limit:i,cursor:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.RoleUserList.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/GetRoleOfUserInTheClan",d=new Map,u=s.ListPermissionOfUsersRequest.encode(s.ListPermissionOfUsersRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.RoleList.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,i,a,l={}){let d="/mezon.api.Mezon/SearchThread",c=new Map,o=s.SearchThreadRequest.encode(s.SearchThreadRequest.fromPartial({clan_id:t,channel_id:i,label:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.ChannelDescList.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}sendToken(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SendToken",l=new Map,c=s.TokenSentEvent.encode(s.TokenSentEvent.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}sessionLogout(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SessionLogout",l=new Map,c=s.SessionLogoutRequest.encode(s.SessionLogoutRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}addClanSticker(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddClanSticker",l=new Map,c=s.ClanStickerAddRequest.encode(s.ClanStickerAddRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,i,a,l={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteClanStickerById",c=new Map,o=s.ClanStickerDeleteRequest.encode(s.ClanStickerDeleteRequest.fromPartial({id:t,clan_id:i,sticker_label:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300)return{};throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateClanStickerById",d=new Map,u=s.ClanStickerUpdateByIdRequest.encode(s.ClanStickerUpdateByIdRequest.fromPartial(M(R({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e,t={}){let i="/mezon.api.Mezon/GetListStickersByUserId",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.StickerListedResponse.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}registerStreamingChannel(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/RegisterStreamingChannel",l=new Map,c=s.RegisterStreamingChannelRequest.encode(s.RegisterStreamingChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.RegisterStreamingChannelResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/ListStreamingChannelUsers",n=new Map,f=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:i,channel_type:a,limit:l,state:d,cursor:c})).finish(),g=this.buildFullUrl(this.basePath,o,n),y=p("POST",u,"");return y.body=f,e&&(y.headers.Authorization="Bearer "+e),Promise.race([m()(g,y).then(b=>h(this,null,function*(){if(b.status==204)return{};if(b.status>=200&&b.status<300){let A=yield b.arrayBuffer();return s.StreamingChannelUserList.decode(new Uint8Array(A))}else throw b})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e,t={}){let i="/mezon.api.Mezon/GetSystemMessagesList",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.SystemMessagesList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}createSystemMessage(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateSystemMessage",l=new Map,c=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,i,a={}){let l="/mezon.api.Mezon/ListSdTopic",d=new Map,u=s.ListSdTopicRequest.encode(s.ListSdTopicRequest.fromPartial({clan_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.SdTopicList.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}createSdTopic(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateSdTopic",l=new Map,c=s.SdTopicRequest.encode(s.SdTopicRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.SdTopic.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteSystemMessage(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteSystemMessage",l=new Map,c=s.DeleteSystemMessage.encode(s.DeleteSystemMessage.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessageByClanId(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetSystemMessageByClanId",l=new Map,c=s.GetSystemMessage.encode(s.GetSystemMessage.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.SystemMessage.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateSystemMessage(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateSystemMessage",d=new Map,u=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(M(R({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,i,a,l,d,c,u={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListThreadDescs",n=new Map,f=s.ListThreadRequest.encode(s.ListThreadRequest.fromPartial({channel_id:t,limit:i,state:a,clan_id:l,thread_id:d,page:c})).finish(),g=this.buildFullUrl(this.basePath,o,n),y=p("POST",u,"");return y.body=f,e&&(y.headers.Authorization="Bearer "+e),Promise.race([m()(g,y).then(b=>h(this,null,function*(){if(b.status==204)return{};if(b.status>=200&&b.status<300){let A=yield b.arrayBuffer();return s.ChannelDescListNoPool.decode(new Uint8Array(A))}else throw b})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateCategory",d=new Map,u=s.UpdateCategoryDescRequest.encode(s.UpdateCategoryDescRequest.fromPartial(M(R({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateChannelPrivate(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateChannelPrivate",l=new Map,c=s.ChangeChannelPrivateRequest.encode(s.ChangeChannelPrivateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateUserProfileByClan(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateUserProfileByClan",d=new Map,u=s.UpdateClanProfileRequest.encode(s.UpdateClanProfileRequest.fromPartial(M(R({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}uploadOauthFile(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UploadOauthFile",l=new Map,c=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.UploadAttachment.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UploadAttachmentFile",l=new Map,c=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.UploadAttachment.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateUser(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateUser",l=new Map,c=s.UpdateUsersRequest.encode(s.UpdateUsersRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listUserClansByUserId(e,t={}){let i="/mezon.api.Mezon/ListUserClansByUserId",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.AllUserClans.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,i,a={}){let l="/mezon.api.Mezon/ListUserPermissionInChannel",d=new Map,u=s.UserPermissionInChannelListRequest.encode(s.UserPermissionInChannelListRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.UserPermissionInChannelListResponse.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e,t={}){let i="/mezon.api.Mezon/GetUserStatus",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.UserStatus.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}updateUserStatus(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateUserStatus",l=new Map,c=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}generateWebhook(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GenerateWebhook",l=new Map,c=s.WebhookCreateRequest.encode(s.WebhookCreateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.WebhookGenerateResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateWebhookById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateWebhookById",d=new Map,u=s.WebhookUpdateRequestById.encode(s.WebhookUpdateRequestById.fromPartial(M(R({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/ListWebhookByChannelId",d=new Map,u=s.WebhookListRequest.encode(s.WebhookListRequest.fromPartial({channel_id:t,clan_id:i||""})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.WebhookListResponse.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteWebhookById",d=new Map,u=s.WebhookDeleteRequestById.encode(s.WebhookDeleteRequestById.fromPartial(M(R({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,i){let a=e+t+"?";for(let[l,d]of i)d instanceof Array?a+=d.reduce((c,u)=>c+encodeURIComponent(l)+"="+encodeURIComponent(u)+"&",""):d!=null&&(a+=encodeURIComponent(l)+"="+encodeURIComponent(d)+"&");return a}editChannelCanvases(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/EditChannelCanvases",l=new Map,c=s.EditChannelCanvasRequest.encode(s.EditChannelCanvasRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.EditChannelCanvasResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,i,a,l={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/GetChannelCanvasDetail",c=new Map,o=s.ChannelCanvasDetailRequest.encode(s.ChannelCanvasDetailRequest.fromPartial({id:t,clan_id:i||"",channel_id:a||""})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.ChannelCanvasDetailResponse.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,i,a,l={}){if(t==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteChannelCanvas",c=new Map,o=s.DeleteChannelCanvasRequest.encode(s.DeleteChannelCanvasRequest.fromPartial({canvas_id:t,clan_id:i||"",channel_id:a||""})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/ListOnboarding",u=new Map,n=s.ListOnboardingRequest.encode(s.ListOnboardingRequest.fromPartial({clan_id:t,guide_type:i,limit:a,page:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.ListOnboardingResponse.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}createOnboarding(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateOnboarding",l=new Map,c=s.CreateOnboardingRequest.encode(s.CreateOnboardingRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListOnboardingResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteOnboarding(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteOnboarding",d=new Map,u=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/GetOnboardingDetail",d=new Map,u=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:t,clan_id:i||""})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.OnboardingItem.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateOnboarding",d=new Map,u=s.UpdateOnboardingRequest.encode(s.UpdateOnboardingRequest.fromPartial(M(R({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}generateClanWebhook(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GenerateClanWebhook",l=new Map,c=s.GenerateClanWebhookRequest.encode(s.GenerateClanWebhookRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.GenerateClanWebhookResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listClanWebhook(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListClanWebhook",l=new Map,c=s.ListClanWebhookRequest.encode(s.ListClanWebhookRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListClanWebhookResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteClanWebhookById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteClanWebhookById",d=new Map,c={id:t,clan_id:i},o=s.ClanWebhookRequest.encode(s.ClanWebhookRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateClanWebhookById",d=new Map,c=M(R({},i),{id:t}),o=s.UpdateClanWebhookRequest.encode(s.UpdateClanWebhookRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t,i={}){let a="/mezon.api.Mezon/GetTopicDetail",l=new Map,d={topic_id:t},u=s.SdTopicDetailRequest.encode(s.SdTopicDetailRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.SdTopic.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListOnboardingStep",c=new Map,u={clan_id:t,limit:i,page:a},n=s.ListOnboardingStepRequest.encode(s.ListOnboardingStepRequest.fromPartial(u)).finish(),r=this.buildFullUrl(this.basePath,d,c),f=p("POST",l,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.ListOnboardingStepResponse.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateOnboardingStep",d=new Map,c=M(R({},i),{clan_id:t}),o=s.UpdateOnboardingStepRequest.encode(s.UpdateOnboardingStepRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}createRoomChannelApps(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateRoomChannelApps",l=new Map,c=s.CreateRoomChannelApps.encode(s.CreateRoomChannelApps.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.CreateRoomChannelApps.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}generateMeetToken(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GenerateMeetToken",l=new Map,c=s.GenerateMeetTokenRequest.encode(s.GenerateMeetTokenRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.GenerateMeetTokenResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,i,a={}){let l="/mezon.api.Mezon/GetMezonOauthClient",d=new Map,c={client_id:t,client_name:i},o=s.GetMezonOauthClientRequest.encode(s.GetMezonOauthClientRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.MezonOauthClient.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}updateMezonOauthClient(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateMezonOauthClient",l=new Map,c=s.MezonOauthClient.encode(s.MezonOauthClient.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.MezonOauthClient.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t,i={}){let a="/mezon.api.Mezon/GenerateHashChannelApps",l=new Map,d={app_id:t},u=s.GenerateHashChannelAppsRequest.encode(s.GenerateHashChannelAppsRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.GenerateHashChannelAppsResponse.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addUserEvent(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddUserEvent",l=new Map,c=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,i,a={}){let l="/mezon.api.Mezon/DeleteUserEvent",d=new Map,c={clan_id:t,event_id:i},o=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}updateRoleOrder(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateRoleOrder",l=new Map,c=s.UpdateRoleOrderRequest.encode(s.UpdateRoleOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}createExternalMezonMeet(e,t={}){let i="/mezon.api.Mezon/CreateExternalMezonMeet",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.GenerateMezonMeetResponse.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,i,a,l,d={}){if(i==null)throw new Error("'token' is a required parameter but is null or undefined.");let c="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(i))),u=new Map;u.set("display_name",a),u.set("is_guest",l);let o="",n=this.buildFullUrl(t,c,u),r=p("POST",d,o);return e&&(r.headers.Authorization="Bearer "+e),r.headers.Accept="application/x-protobuf",r.headers["Content-Type"]="application/json",Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.GenerateMeetTokenExternalResponse.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}muteParticipantMezonMeet(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/MuteParticipantMezonMeet",l=new Map,c=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}removeParticipantMezonMeet(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/RemoveParticipantMezonMeet",l=new Map,c=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listChannelDetail(e,t,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListChannelDetail",l=new Map,d={channel_id:t},u=s.ListChannelDetailRequest.encode(s.ListChannelDetailRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.ChannelDescription.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateClanOrder(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateClanOrder",l=new Map,c=s.UpdateClanOrderRequest.encode(s.UpdateClanOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,i,a,l={}){if(a==null)throw new Error("'body' is a required parameter but is null or undefined.");let d="/v2/clan/discover",c=new Map,u="";u=JSON.stringify(a||{});let o=this.buildFullUrl(i,d,c),n=p("POST",l,u);return e&&(n.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),n.headers.Accept="application/x-protobuf",n.headers["Content-Type"]="application/json",Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.ListClanDiscover.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/DeleteQuickMenuAccess",n=new Map,r={id:t,clan_id:i,bot_id:a,menu_name:l,background:d,action_msg:c},g=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(r)).finish(),y=this.buildFullUrl(this.basePath,o,n),b=p("POST",u,"");return b.body=g,e&&(b.headers.Authorization="Bearer "+e),Promise.race([m()(y,b).then(A=>{if(A.status==204)return A;if(A.status>=200&&A.status<300)return A;throw A}),new Promise((A,P)=>setTimeout(P,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListQuickMenuAccess",c=new Map,u={bot_id:t,channel_id:i,menu_type:a},n=s.ListQuickMenuAccessRequest.encode(s.ListQuickMenuAccessRequest.fromPartial(u)).finish(),r=this.buildFullUrl(this.basePath,d,c),f=p("POST",l,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.QuickMenuAccessList.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}addQuickMenuAccess(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddQuickMenuAccess",l=new Map,c=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}updateQuickMenuAccess(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateQuickMenuAccess",l=new Map,c=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t,i={}){let a="/mezon.api.Mezon/ListForSaleItems",l=new Map,d={page:t},u=s.ListForSaleItemsRequest.encode(s.ListForSaleItemsRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.ForSaleItemList.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}isFollower(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/IsFollower",l=new Map,c=s.IsFollowerRequest.encode(s.IsFollowerRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.IsFollowerResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}transferOwnership(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/TransferOwnership",l=new Map,c=s.TransferOwnershipRequest.encode(s.TransferOwnershipRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}updateUsername(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateUsername",l=new Map,c=s.UpdateUsernameRequest.encode(s.UpdateUsernameRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}isBanned(e,t,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/IsBanned",l=new Map,d={channel_id:t},u=s.IsBannedRequest.encode(s.IsBannedRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.IsBannedResponse.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,i,a={}){let l="/mezon.api.Mezon/ReportMessageAbuse",d=new Map,c={message_id:t,abuse_type:i},o=s.ReportMessageAbuseReqest.encode(s.ReportMessageAbuseReqest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}listLogedDevice(e,t={}){let i="/mezon.api.Mezon/ListLogedDevice",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.LogedDeviceList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}sendChannelMessage(e,t,i,a,l,d,c,u,o,n,r,f,g,y){let b="/mezon.api.Mezon/SendChannelMessage",A=new Map,v=s.ChannelMessageSend.encode(s.ChannelMessageSend.fromPartial({clan_id:t,channel_id:i,mode:a,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:f,code:g,topic_id:y})).finish(),S=this.buildFullUrl(this.basePath,b,A),q=p("POST",{},"");return q.body=v,e&&(q.headers.Authorization="Bearer "+e),Promise.race([m()(S,q).then(z=>h(this,null,function*(){if(z.status==204)return{};if(z.status>=200&&z.status<300){let G=yield z.arrayBuffer();return s.ChannelMessageSend.decode(new Uint8Array(G))}else throw z})),new Promise((z,G)=>setTimeout(()=>G(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,i,a,l,d,c,u,o,n,r,f){let g="/mezon.api.Mezon/UpdateChannelMessage",y=new Map,A=s.ChannelMessageUpdate.encode(s.ChannelMessageUpdate.fromPartial({clan_id:t,channel_id:i,message_id:d,mode:a,is_public:l,content:c,mentions:u,attachments:o,hide_editted:n,topic_id:r,is_update_msg_topic:f})).finish(),P=this.buildFullUrl(this.basePath,g,y),v=p("POST",{},"");return v.body=A,e&&(v.headers.Authorization="Bearer "+e),Promise.race([m()(P,v).then(S=>h(this,null,function*(){if(S.status==204)return{};if(S.status>=200&&S.status<300){let q=yield S.arrayBuffer();return s.ChannelMessageUpdate.decode(new Uint8Array(q))}else throw S})),new Promise((S,q)=>setTimeout(()=>q(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,i,a,l,d,c,u,o,n){let r="/mezon.api.Mezon/DeleteChannelMessage",f=new Map,y=s.ChannelMessageRemove.encode(s.ChannelMessageRemove.fromPartial({clan_id:t,channel_id:i,message_id:d,mode:a,is_public:l,has_attachment:c,mentions:o,references:n,topic_id:u})).finish(),b=this.buildFullUrl(this.basePath,r,f),A=p("POST",{},"");return A.body=y,e&&(A.headers.Authorization="Bearer "+e),Promise.race([m()(b,A).then(P=>h(this,null,function*(){if(P.status==204)return{};if(P.status>=200&&P.status<300){let v=yield P.arrayBuffer();return s.ChannelMessageRemove.decode(new Uint8Array(v))}else throw P})),new Promise((P,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,i,a,l,d,c={}){let u="/mezon.api.Mezon/UpdateMezonVoiceState",o=new Map,n={clan_id:t,channel_id:i,display_name:a,room_name:l,state:d},f=s.HandleParticipantMeetStateEvent.encode(s.HandleParticipantMeetStateEvent.fromPartial(n)).finish(),g=this.buildFullUrl(this.basePath,u,o),y=p("POST",c,"");return y.body=f,e&&(y.headers.Authorization="Bearer "+e),Promise.race([m()(g,y).then(b=>{if(b.status==204)return b;if(b.status>=200&&b.status<300)return b;throw b}),new Promise((b,A)=>setTimeout(A,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/MessageButtonClick",n=new Map,r={message_id:t,channel_id:i,button_id:a,sender_id:l,user_id:d,extra_data:c},g=s.MessageButtonClicked.encode(s.MessageButtonClicked.fromPartial(r)).finish(),y=this.buildFullUrl(this.basePath,o,n),b=p("POST",u,"");return b.body=g,e&&(b.headers.Authorization="Bearer "+e),Promise.race([m()(y,b).then(A=>{if(A.status==204)return A;if(A.status>=200&&A.status<300)return A;throw A}),new Promise((A,P)=>setTimeout(P,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/DropdownBoxSelected",n=new Map,r={message_id:t,channel_id:i,selectbox_id:a,sender_id:l,user_id:d,values:c},g=s.DropdownBoxSelected.encode(s.DropdownBoxSelected.fromPartial(r)).finish(),y=this.buildFullUrl(this.basePath,o,n),b=p("POST",u,"");return b.body=g,e&&(b.headers.Authorization="Bearer "+e),Promise.race([m()(y,b).then(A=>{if(A.status==204)return A;if(A.status>=200&&A.status<300)return A;throw A}),new Promise((A,P)=>setTimeout(P,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,i,a={}){let l="/mezon.api.Mezon/ActiveArchivedThread",d=new Map,c={clan_id:t,channel_id:i},o=s.ActiveArchivedThread.encode(s.ActiveArchivedThread.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}};var Q=H(require("js-base64")),L=class _{constructor(e,t,i,a,l,d,c){this.created=i;this.api_url=a;this.ws_url=l;this.id_token=d;this.token=e,this.refresh_token=t,this.id_token=d,this.api_url=a,this.ws_url=l,this.created_at=Math.floor(new Date().getTime()/1e3),this.is_remember=c,this.update(e,t,c)}isexpired(e){return this.expires_at-e<=0}isrefreshexpired(e){return this.refresh_expires_at-e<=0}update(e,t,i){let a=e.split(".");if(a.length!=3)throw"jwt is not valid.";let l=JSON.parse(Q.atob(a[1])),d=Math.floor(parseInt(l.exp));if(t){let c=t.split(".");if(c.length!=3)throw"refresh jwt is not valid.";let u=JSON.parse(Q.atob(c[1])),o=Math.floor(parseInt(u.exp));this.refresh_expires_at=o,this.refresh_token=t,this.is_remember=i}this.token=e,this.expires_at=d,this.username=l.usn,this.user_id=l.uid,this.vars=l.vrs}static restore(e,t,i,a,l){return new _(e,t,!1,i,a,"",l)}};var ee=require("mezon-js-protobuf");function Ce(_){let e,t,i,a,l,d;try{e=w(_.channel_message.content)}catch(u){console.log("content is invalid",u)}try{t=F(_.channel_message.reactions)}catch(u){console.log("reactions is invalid",u)}try{i=x(_.channel_message.mentions)}catch(u){console.log("mentions is invalid",u)}try{a=T(_.channel_message.attachments)}catch(u){console.log("attachments is invalid",u)}try{l=W(_.channel_message.references)}catch(u){console.log("references is invalid",u)}try{d=_.channel_message.referenced_message}catch(u){console.log("referenced messages is invalid",u)}return{id:_.id||_.channel_message.message_id,avatar:_.channel_message.avatar,channel_id:_.channel_message.channel_id,mode:_.channel_message.mode,channel_label:_.channel_message.channel_label,clan_id:_.channel_message.clan_id,code:_.channel_message.code,message_id:_.channel_message.message_id,sender_id:_.channel_message.sender_id,update_time:_.channel_message.update_time,clan_logo:_.channel_message.clan_logo,category_name:_.channel_message.category_name,username:_.channel_message.username,clan_nick:_.channel_message.clan_nick,clan_avatar:_.channel_message.clan_avatar,display_name:_.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:i==null?void 0:i.mentions,attachments:a==null?void 0:a.attachments,referenced_message:d,references:l==null?void 0:l.refs,hide_editted:_.channel_message.hide_editted,is_public:_.channel_message.is_public,create_time_seconds:_.channel_message.create_time_seconds,update_time_seconds:_.channel_message.update_time_seconds,topic_id:_.channel_message.topic_id}}var X=!1,U={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},k=class k{constructor(e,t,i=!1,a=!1,l=new ee.WebSocketAdapterPb,d=k.DefaultSendTimeoutMs){this.host=e;this.port=t;this.useSSL=i;this.verbose=a;this.adapter=l;this.sendTimeoutMs=d;this.cIds={},this.nextCid=1,this._heartbeatTimeoutMs=k.DefaultHeartbeatTimeoutMs,this._connectionState=U.DISCONNECTED}generatecid(){let e=this.nextCid.toString();return++this.nextCid,e}isOpen(){return this._connectionState===U.CONNECTED}connect(e,t=!1,i="",a=k.DefaultConnectTimeoutMs,l){if(this._connectionState===U.CONNECTED)return Promise.resolve(e);if(this._connectionState===U.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=U.CONNECTING;let d=this.useSSL?"wss://":"ws://";this.adapter.connect(d,this.host,this.port,t,e.token,i,l),this.adapter.onClose=u=>{this._connectionState=U.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(u)},this.adapter.onMessage=u=>h(this,null,function*(){if(this.verbose&&window&&window.console&&console.log("Response: %o",JSON.stringify(u)),u.cid){let o=this.cIds[u.cid];if(!o){this.verbose&&window&&window.console&&console.error("No promise executor for message: %o",u);return}delete this.cIds[u.cid],u.error?o.reject(u.error):o.resolve(u)}else if(u.notifications)u.notifications.notifications.forEach(o=>{o.content=o.content?N(o.content):void 0,this.onnotification(o)});else if(u.voice_started_event)this.onvoicestarted(u.voice_started_event);else if(u.voice_ended_event)this.onvoiceended(u.voice_ended_event);else if(u.voice_joined_event)this.onvoicejoined(u.voice_joined_event);else if(u.voice_leaved_event)this.onvoiceleaved(u.voice_leaved_event);else if(u.channel_created_event)this.onchannelcreated(u.channel_created_event);else if(u.category_event)this.oncategoryevent(u.category_event);else if(u.role_event)this.onroleevent(u.role_event);else if(u.event_emoji)this.oneventemoji(u.event_emoji);else if(u.noti_user_channel)this.oneventnotiuserchannel(u.noti_user_channel);else if(u.webhook_event)this.oneventwebhook(u.webhook_event);else if(u.channel_deleted_event)this.onchanneldeleted(u.channel_deleted_event);else if(u.clan_deleted_event)this.onclandeleted(u.clan_deleted_event);else if(u.sticker_create_event)this.onstickercreated(u.sticker_create_event);else if(u.sticker_update_event)this.onstickerupdated(u.sticker_update_event);else if(u.sticker_delete_event)this.onstickerdeleted(u.sticker_delete_event);else if(u.channel_updated_event)this.onchannelupdated(u.channel_updated_event);else if(u.delete_account_event)this.ondeleteaccount(u.delete_account_event);else if(u.clan_profile_updated_event)this.onclanprofileupdated(u.clan_profile_updated_event);else if(u.clan_updated_event)this.onclanupdated(u.clan_updated_event);else if(u.last_seen_message_event)this.onlastseenupdated(u.last_seen_message_event);else if(u.status_presence_event)this.onstatuspresence(u.status_presence_event);else if(u.stream_presence_event)this.onstreampresence(u.stream_presence_event);else if(u.stream_data)this.onstreamdata(u.stream_data);else if(u.channel_message){let o=Ce(u);this.onchannelmessage(o)}else u.message_typing_event?this.onmessagetyping(u.message_typing_event):u.message_reaction_event?this.onmessagereaction(u.message_reaction_event):u.channel_presence_event?this.onchannelpresence(u.channel_presence_event):u.last_pin_message_event?this.onpinmessage(u.last_pin_message_event):u.custom_status_event?this.oncustomstatus(u.custom_status_event):u.canvas_event?this.oncanvasevent(u.canvas_event):u.user_channel_added_event?this.onuserchanneladded(u.user_channel_added_event):u.add_clan_user_event?this.onuserclanadded(u.add_clan_user_event):u.user_profile_updated_event?this.onuserprofileupdate(u.user_profile_updated_event):u.user_channel_removed_event?this.onuserchannelremoved(u.user_channel_removed_event):u.block_friend?this.onblockfriend(u.block_friend):u.un_block_friend?this.onunblockfriend(u.un_block_friend):u.add_friend?this.onaddfriend(u.add_friend):u.remove_friend?this.onremovefriend(u.remove_friend):u.user_clan_removed_event?this.onuserclanremoved(u.user_clan_removed_event):u.clan_event_created?this.oneventcreated(u.clan_event_created):u.give_coffee_event?this.oncoffeegiven(u.give_coffee_event):u.role_assign_event?this.onroleassign(u.role_assign_event):u.streaming_started_event?this.onstreamingchannelstarted(u.streaming_started_event):u.streaming_ended_event?this.onstreamingchannelended(u.streaming_ended_event):u.streaming_joined_event?this.onstreamingchanneljoined(u.streaming_joined_event):u.streaming_leaved_event?this.onstreamingchannelleaved(u.streaming_leaved_event):u.permission_set_event?this.onpermissionset(u.permission_set_event):u.permission_changed_event?this.onpermissionchanged(u.permission_changed_event):u.unmute_event?this.onunmuteevent(u.unmute_event):u.token_sent_event?this.ontokensent(u.token_sent_event):u.message_button_clicked?this.onmessagebuttonclicked(u.message_button_clicked):u.dropdown_box_selected?this.onmessagedropdownboxselected(u.dropdown_box_selected):u.mark_as_read?this.onmarkasread(u.mark_as_read):u.voice_reaction_send?this.onvoicereactionmessage(u.voice_reaction_send):u.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(u.webrtc_signaling_fwd):u.list_activity?this.onactivityupdated(u.list_activity):u.sd_topic_event?this.onsdtopicevent(u.sd_topic_event):u.channel_app_event?this.onchannelappevent(u.channel_app_event):u.user_status_event?this.onuserstatusevent(u.user_status_event):u.join_channel_app_data?this.onjoinchannelappevent(u.join_channel_app_data):u.unpin_message_event?this.onunpinmessageevent(u.unpin_message_event):u.quick_menu_event?this.onquickmenuevent(u.quick_menu_event):u.meet_participant_event?this.onmeetparticipantevent(u.meet_participant_event):u.transfer_ownership_event?this.ontransferownership(u.transfer_ownership_event):u.ban_user_event?this.onbanneduser(u.ban_user_event):u.allow_anonymous_event?this.onallowanonymousevent(u.allow_anonymous_event):this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",u)});let c=new Promise((u,o)=>{this.adapter.onOpen=n=>{this.verbose&&window&&window.console&&console.log(n);let r=X;X=!0,this.clearConnectTimeout(),this._connectionState=U.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,u(e),r&&this.onreconnect(n)},this.adapter.onError=n=>{this._connectionState=U.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(n),this._connectPromise=void 0,this.adapter.close(),o(n)},this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=U.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.close(),this._connectPromise=void 0,o("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},a)});return this._connectPromise=c,this._connectPromise}disconnect(e=!0){this._connectionState=U.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.isOpen()&&this.adapter.close(),e&&this.ondisconnect({})}setHeartbeatTimeoutMs(e){this._heartbeatTimeoutMs=e}getHeartbeatTimeoutMs(){return this._heartbeatTimeoutMs}onreconnect(e){this.verbose&&window&&window.console&&console.log(e)}ondisconnect(e){this.verbose&&window&&window.console&&console.log(e)}onerror(e){this._connectionState=U.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)}onstreampresence(e){this.verbose&&window&&window.console&&console.log(e)}onstreamdata(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)}onmeetparticipantevent(e){this.verbose&&window&&window.console&&console.log(e)}onallowanonymousevent(e){this.verbose&&window&&window.console&&console.log(e)}send(e,t=k.DefaultSendTimeoutMs){let i=e;return new Promise((a,l)=>{var d,c;if(!this.adapter.isOpen())l("Socket connection has not been established yet.");else{i.channel_message_send?i.channel_message_send.content=JSON.stringify(i.channel_message_send.content):i.channel_message_update?i.channel_message_update.content=JSON.stringify(i.channel_message_update.content):i.ephemeral_message_send?i.ephemeral_message_send.message.content=JSON.stringify((d=i.ephemeral_message_send.message)==null?void 0:d.content):i.quick_menu_event&&(i.quick_menu_event.message.content=JSON.stringify((c=i.quick_menu_event.message)==null?void 0:c.content));let u=this.generatecid();this.cIds[u]={resolve:a,reject:l},t!==1/0&&t>0&&setTimeout(()=>{l("The socket timed out while waiting for a response.")},t),i.cid=u,this.adapter.send(i)}})}followUsers(e){return h(this,null,function*(){return(yield this.send({status_follow:{user_ids:e}})).status})}joinClanChat(e){return h(this,null,function*(){return(yield this.send({clan_join:{clan_id:e}})).clan_join})}follower(){return h(this,null,function*(){return(yield this.send({follow_event:{}})).follow_event})}joinChat(e,t,i,a){return h(this,null,function*(){return(yield this.send({channel_join:{clan_id:e,channel_id:t,channel_type:i,is_public:a}})).channel})}leaveChat(e,t,i,a){return this.send({channel_leave:{clan_id:e,channel_id:t,channel_type:i,is_public:a}})}removeChatMessage(e,t,i,a,l,d,c,u,o){return h(this,null,function*(){return(yield this.send({channel_message_remove:{clan_id:e,channel_id:t,mode:i,message_id:l,is_public:a,has_attachment:d,topic_id:c,mentions:u,references:o}})).channel_message_ack})}rpc(e,t,i){return h(this,null,function*(){return(yield this.send({rpc:{id:e,payload:t,http_key:i}})).rpc})}unfollowUsers(e){return this.send({status_unfollow:{user_ids:e}})}updateChatMessage(e,t,i,a,l,d,c,u,o,n,r){return h(this,null,function*(){return(yield this.send({channel_message_update:{clan_id:e,channel_id:t,message_id:l,content:d,mentions:c,attachments:u,mode:i,is_public:a,hide_editted:o,topic_id:n,is_update_msg_topic:r}})).channel_message_ack})}updateStatus(e){return this.send({status_update:{status:e}})}writeQuickMenuEvent(e,t,i,a,l,d,c,u,o,n,r,f,g,y){return h(this,null,function*(){return(yield this.send({quick_menu_event:{menu_name:e,message:{clan_id:t,channel_id:i,mode:a,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:f,code:g,topic_id:y}}})).ephemeral_message_send})}writeEphemeralMessage(e,t,i,a,l,d,c,u,o,n,r,f,g,y,b){return h(this,null,function*(){return(yield this.send({ephemeral_message_send:{receiver_id:e,message:{clan_id:t,channel_id:i,mode:a,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:f,code:g,topic_id:y,id:b}}})).ephemeral_message_send})}writeChatMessage(e,t,i,a,l,d,c,u,o,n,r,f,g){return h(this,null,function*(){return(yield this.send({channel_message_send:{clan_id:e,channel_id:t,mode:i,is_public:a,content:l,mentions:d,attachments:c,references:u,anonymous_message:o,mention_everyone:n,avatar:r,code:f,topic_id:g}},1/0)).channel_message_ack})}writeMessageReaction(e,t,i,a,l,d,c,u,o,n,r,f,g,y){return h(this,null,function*(){return(yield this.send({message_reaction_event:{id:e,clan_id:t,channel_id:i,mode:a,is_public:l,message_id:d,emoji_id:c,emoji:u,count:o,message_sender_id:n,action:r,topic_id:f,emoji_recent_id:g,sender_name:y}})).message_reaction_event})}writeMessageTyping(e,t,i,a,l,d){return h(this,null,function*(){return(yield this.send({message_typing_event:{clan_id:e,channel_id:t,mode:i,is_public:a,sender_display_name:l,topic_id:d}})).message_typing_event})}writeLastSeenMessage(e,t,i,a,l,d){return h(this,null,function*(){return(yield this.send({last_seen_message_event:{clan_id:e,channel_id:t,mode:i,message_id:a,timestamp_seconds:l,badge_count:d}})).last_seen_message_event})}writeLastPinMessage(e,t,i,a,l,d,c,u,o,n,r,f,g){return h(this,null,function*(){return(yield this.send({last_pin_message_event:{clan_id:e,channel_id:t,mode:i,is_public:a,message_id:l,timestamp_seconds:d,operation:c,message_sender_avatar:u,message_sender_id:o,message_sender_username:n,message_content:r,message_attachment:f,message_created_time:g}})).last_pin_message_event})}writeCustomStatus(e,t,i,a){return h(this,null,function*(){return(yield this.send({custom_status_event:{clan_id:e,status:t,time_reset:i,no_clear:a}})).custom_status_event})}checkDuplicateName(e,t,i,a){return h(this,null,function*(){return(yield this.send({check_name_existed_event:{name:e,condition_id:t,type:i,clan_id:a}})).check_name_existed_event})}writeVoiceReaction(e,t){return h(this,null,function*(){return(yield this.send({voice_reaction_send:{emojis:e,channel_id:t}})).voice_reaction_send})}forwardWebrtcSignaling(e,t,i,a,l){return h(this,null,function*(){return(yield this.send({webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:i,channel_id:a,caller_id:l}})).webrtc_signaling_fwd})}makeCallPush(e,t,i,a){return h(this,null,function*(){return(yield this.send({incoming_call_push:{receiver_id:e,json_data:t,channel_id:i,caller_id:a}})).incoming_call_push})}writeChannelAppEvent(e,t,i){return h(this,null,function*(){return(yield this.send({channel_app_event:{clan_id:e,channel_id:t,action:i}})).channel_app_event})}listDataSocket(e){return h(this,null,function*(){return(yield this.send({list_data_socket:e})).list_data_socket})}pingPong(){return h(this,null,function*(){if(!this.isOpen()){this._connectionState=U.DISCONNECTED,this.stopHeartbeatLoop();return}try{yield this.send({ping:{}},this._heartbeatTimeoutMs)}catch(e){this._connectionState=U.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.isOpen()&&(window&&window.console&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this.adapter.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)}};k.DefaultHeartbeatTimeoutMs=1e4,k.DefaultSendTimeoutMs=1e4,k.DefaultConnectTimeoutMs=3e4;var B=k;var te=require("mezon-js-protobuf");var ve="127.0.0.1",Me="7350",Se="defaultkey",Ue=3e4,ne=(o=>(o[o.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",o[o.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",o[o.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",o[o.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",o[o.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",o[o.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",o[o.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",o[o.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",o[o.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",o))(ne||{}),ie=(l=>(l[l.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",l[l.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",l[l.STREAM_MODE_DM=4]="STREAM_MODE_DM",l[l.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",l[l.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",l))(ie||{}),re=(i=>(i[i.ALL_MESSAGE=1]="ALL_MESSAGE",i[i.MENTION_MESSAGE=2]="MENTION_MESSAGE",i[i.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",i))(re||{}),se=(o=>(o[o.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",o[o.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",o[o.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",o[o.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",o[o.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",o[o.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",o[o.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",o[o.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",o[o.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",o))(se||{}),K=class{constructor(e=Se,t=ve,i=Me,a=!1,l=Ue,d=!0){this.serverkey=e;this.timeout=l;this.autoRefreshSession=d;this.refreshTokenPromise=null;this.host=t,this.port=i,this.useSSL=a;let u=`${a?"https://":"http://"}${t}:${i}`;this.apiClient=new j(e,l,u)}onRefreshSession(e){console.log(`Token refresh occurred. Token: ${e.token}`)}isexpired(e){return e.isexpired(Date.now()/1e3)}authenticateMezon(e,t,i,a,l={},d={}){let c={token:e,vars:l};return this.apiClient.authenticateMezon(this.serverkey,"",c,t,i,a,d).then(u=>new L(u.token||"",u.refresh_token||"",u.created||!1,u.api_url||"",u.ws_url||"",u.id_token||"",u.is_remember||!1))}authenticateSMSOTPRequest(e,t,i){let a={username:t,account:{phoneno:e,vars:i}};return this.apiClient.AuthenticateSMSOTPRequest(this.serverkey,"",a,t).then(l=>Promise.resolve(l))}authenticateEmailOTPRequest(e,t,i){let a={username:t,account:{email:e,vars:i}};return this.apiClient.AuthenticateEmailOTPRequest(this.serverkey,"",a,t).then(l=>Promise.resolve(l))}confirmAuthenticateOTP(e){return h(this,null,function*(){return this.apiClient.confirmAuthenticateOTP(this.serverkey,"",e).then(t=>new L(t.token||"",t.refresh_token||"",t.created||!1,t.api_url||"",t.ws_url||"",t.id_token||"",t.is_remember||!1))})}authenticateEmail(e,t,i,a){let l={username:i,account:{email:e,password:t,vars:a}};return this.apiClient.authenticateEmail(this.serverkey,"",l,i).then(d=>new L(d.token||"",d.refresh_token||"",d.created||!1,d.api_url||"",d.ws_url||"",d.id_token||"",d.is_remember||!1))}setBasePath(e,t,i){this.host=e,this.port=t,this.useSSL=i;let l=`${i?"https://":"http://"}${e}:${t}`;return this.apiClient.setBasePath(l)}addChannelUsers(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addChannelUsers(e.token,t,i).then(a=>a!==void 0)})}addFriends(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addFriends(e.token,t,i)})}blockFriends(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.blockFriends(e.token,t,i).then(a=>Promise.resolve(a!=null))})}unblockFriends(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.unblockFriends(e.token,t,i).then(a=>Promise.resolve(a!=null))})}uploadOauthFile(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.uploadOauthFile(e.token,t)})}uploadAttachmentFile(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.uploadAttachmentFile(e.token,t)})}createChannelDesc(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createChannelDesc(e.token,t).then(i=>Promise.resolve(i))})}createClanDesc(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createClanDesc(e.token,t).then(i=>Promise.resolve(i))})}createCategoryDesc(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createCategoryDesc(e.token,t).then(i=>Promise.resolve(i))})}createRole(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createRole(e.token,t).then(i=>Promise.resolve(i))})}createEvent(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createEvent(e.token,t).then(i=>Promise.resolve(i))})}addRolesChannelDesc(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addRolesChannelDesc(e.token,t).then(i=>i!==void 0)})}deleteRoleChannelDesc(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteRoleChannelDesc(e.token,t).then(i=>i!==void 0)})}deleteApp(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteApp(e.token,t).then(i=>i!==void 0)})}createSocket(e=!1,t,i,a=!1,l=new te.WebSocketAdapterPb,d=B.DefaultSendTimeoutMs){return new B(t,i,e,a,l,d)}deleteFriends(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteFriends(e.token,t,i).then(a=>a!==void 0)})}deleteChannelDesc(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteChannelDesc(e.token,t,i).then(a=>a!==void 0)})}deleteClanDesc(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteClanDesc(e.token,t).then(i=>i!==void 0)})}deleteCategoryDesc(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteCategoryDesc(e.token,t,i,a).then(l=>l!==void 0)})}deleteNotifications(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteNotifications(e.token,t,i).then(a=>Promise.resolve(a!=null))})}deleteRole(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteRole(e.token,t,"0",i,a).then(l=>l!==void 0)})}deleteEvent(e,t,i,a,l,d){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteEvent(e.token,t,i,a,l,d).then(c=>c!==void 0)})}updateEventUser(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateEventUser(e.token,t).then(i=>i!==void 0)})}emitEvent(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.event(e.token,t).then(i=>Promise.resolve(i!=null))})}getAccount(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getAccount(e.token)})}removeClanUsers(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.removeClanUsers(e.token,t,i).then(a=>Promise.resolve(a!=null))})}listBannedUsers(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listBannedUsers(e.token,t,i).then(a=>Promise.resolve(a))})}unbanClanUsers(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.unbanClanUsers(e.token,t,i,a).then(l=>Promise.resolve(l!=null))})}banClanUsers(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.banClanUsers(e.token,t,i,a,l).then(d=>Promise.resolve(d!=null))})}removeChannelUsers(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.removeChannelUsers(e.token,t,i).then(a=>Promise.resolve(a!=null))})}listChannelMessages(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelMessages(e.token,t,i,a,l,d,c).then(u=>{let o={messages:[],last_seen_message:u.last_seen_message,last_sent_message:u.last_sent_message};return u.messages==null||u.messages.forEach(n=>{let r,f,g,y,b;try{r=w(n.content)}catch(A){console.log("error parse content",A)}try{let A=F(n.reactions);f=(A==null?void 0:A.reactions)||A||w(n.reactions||"[]")}catch(A){f=w(n.reactions||"[]")}try{let A=x(n.mentions);g=(A==null?void 0:A.mentions)||A||w(n.mentions||"[]")}catch(A){g=w(n.mentions||"[]")}try{let A=T(n.attachments);y=(A==null?void 0:A.attachments)||A||w(n.attachments||"[]")}catch(A){y=w(n.attachments||"[]")}try{let A=W(n.references);b=(A==null?void 0:A.refs)||A||w(n.references||"[]")}catch(A){b=w(n.references||"[]")}o.messages.push({channel_id:n.channel_id,code:n.code?Number(n.code):0,id:n.message_id||"",sender_id:n.sender_id,username:n.username,display_name:n.display_name,avatar:n.avatar,content:r,channel_label:n.channel_label,clan_logo:n.clan_logo,category_name:n.category_name,clan_nick:n.clan_nick,clan_avatar:n.clan_avatar,attachments:y,mentions:g,reactions:f,references:b,clan_id:n.clan_id,create_time_seconds:n.create_time_seconds,update_time_seconds:n.update_time_seconds,hide_editted:n.hide_editted})}),Promise.resolve(o)})})}listChannelVoiceUsers(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelVoiceUsers(e.token,t,i).then(a=>{let l={voice_channel_users:[]};return a.voice_channel_users==null||a.voice_channel_users.forEach(d=>{l.voice_channel_users.push({id:d.id,channel_id:d.channel_id,user_ids:d.user_ids,participant:d.participant})}),Promise.resolve(l)})})}listChannelUsers(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelUsers(e.token,t,i,a,d,l,c).then(u=>{let o={channel_users:[],cursor:u.cursor,channel_id:u.channel_id};return u.channel_users==null||u.channel_users.forEach(n=>{o.channel_users.push({user_id:n.user_id,role_id:n.role_id,thread_id:n.thread_id,clan_avatar:n.clan_avatar,clan_nick:n.clan_nick,id:n.id,clan_id:n.clan_id,added_by:n.added_by,is_banned:n.is_banned})}),Promise.resolve(o)})})}listChannelAttachments(e,t,i,a,l,d,c,u){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelAttachment(e.token,i,t,a,d,l,c,u).then(o=>{let n={attachments:[]};return o.attachments==null||o.attachments.forEach(r=>{n.attachments.push({filename:r.filename,filesize:r.filesize,filetype:r.filetype,id:r.id,uploader:r.uploader,url:r.url,message_id:r.message_id,create_time_seconds:r.create_time_seconds,width:r.width,height:r.height})}),Promise.resolve(n)})})}listClanUsers(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listClanUsers(e.token,t).then(i=>{let a={clan_users:[],cursor:i.cursor,clan_id:i.clan_id};return i.clan_users==null||i.clan_users.forEach(l=>{var d;a.clan_users.push({user:{avatar_url:l.user.avatar_url,create_time_seconds:l.user.create_time_seconds,display_name:l.user.display_name,edge_count:l.user.edge_count?Number(l.user.edge_count):0,id:l.user.id,lang_tag:l.user.lang_tag,location:l.user.location,online:l.user.online,is_mobile:(d=l.user)==null?void 0:d.is_mobile,timezone:l.user.timezone,update_time:l.user.update_time,username:l.user.username,user_status:l.user.user_status,status:l.user.status,about_me:l.user.about_me,mezon_id:l.user.mezon_id,list_nick_names:l.user.list_nick_names,phone_number:l.user.phone_number},role_id:l.role_id,clan_nick:l.clan_nick,clan_avatar:l.clan_avatar})}),Promise.resolve(a)})})}listChannelDetail(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelDetail(e.token,t).then(i=>Promise.resolve(i))})}listChannelDescs(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelDescs(e.token,t,i,a,l,d,c).then(u=>{let o={channeldesc:[],next_cursor:u.next_cursor,prev_cursor:u.prev_cursor,cacheable_cursor:u.cacheable_cursor};return u.channeldesc==null||(o.channeldesc=u.channeldesc),Promise.resolve(o)})})}listClanUnreadMsgIndicator(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listClanUnreadMsgIndicator(e.token,t).then(i=>Promise.resolve(i))})}listClanDescs(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listClanDescs(e.token,t,i,a).then(l=>{let d={clandesc:[]};return l.clandesc==null||(d.clandesc=l.clandesc),Promise.resolve(d)})})}listCategoryDescs(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listCategoryDescs(e.token,t,i,a).then(l=>{let d={categorydesc:[]};return l.categorydesc==null||(d.categorydesc=l.categorydesc),Promise.resolve(d)})})}listEvents(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listEvents(e.token,t).then(i=>Promise.resolve(i))})}getListPermission(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getListPermission(e.token).then(t=>Promise.resolve(t))})}listRolePermissions(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listRolePermissions(e.token,t).then(i=>Promise.resolve(i))})}listRoleUsers(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listRoleUsers(e.token,t,i,a).then(l=>Promise.resolve(l))})}registFCMDeviceToken(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.registFCMDeviceToken(e.token,t,i,a,l).then(d=>Promise.resolve(d))})}getUserProfileOnClan(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getUserProfileOnClan(e.token,t).then(i=>Promise.resolve(i))})}closeDirectMess(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.closeDirectMess(e.token,t).then(i=>i!==void 0)})}openDirectMess(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.openDirectMess(e.token,t).then(i=>i!==void 0)})}confirmLinkMezonOTP(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.confirmLinkMezonOTP(e.token,t)})}linkSMS(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.linkSMS(e.token,t).then(i=>Promise.resolve(i))})}linkEmail(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.linkEmail(e.token,t).then(i=>Promise.resolve(i))})}listFriends(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listFriends(e.token,i,t,a).then(l=>{let d={friends:[],cursor:l.cursor};return l.friends==null||l.friends.forEach(c=>{var u;d.friends.push({user:{avatar_url:c.user.avatar_url,create_time_seconds:c.user.create_time_seconds,display_name:c.user.display_name,edge_count:c.user.edge_count?Number(c.user.edge_count):0,id:c.user.id,lang_tag:c.user.lang_tag,location:c.user.location,online:c.user.online,timezone:c.user.timezone,update_time:c.user.update_time,username:c.user.username,is_mobile:(u=c.user)==null?void 0:u.is_mobile,user_status:c.user.user_status,status:c.user.status,mezon_id:c.user.mezon_id,list_nick_names:c.user.list_nick_names,phone_number:c.user.phone_number,about_me:c.user.about_me},state:c.state,source_id:c.source_id})}),Promise.resolve(d)})})}listNotifications(e,t,i,a,l,d){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listNotifications(e.token,i,t,a,l,d).then(c=>{let u={cacheable_cursor:c.cacheable_cursor,notifications:[]};return c.notifications==null||c.notifications.forEach(o=>{u.notifications.push({id:o.id,subject:o.subject,content:o.content?N(o.content):void 0,code:o.code?Number(o.code):0,sender_id:o.sender_id,create_time_seconds:o.create_time_seconds,persistent:o.persistent,category:o.category})}),Promise.resolve(u)})})}sessionLogout(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.sessionLogout(e.token,{refresh_token:i,token:t,device_id:a,platform:l}).then(d=>d!==void 0)})}sessionRefresh(i){return h(this,arguments,function*(e,t={}){return e?(e.created&&e.expires_at-e.created_at<70&&console.warn("Session lifetime too short, please set '--session.token_expiry_sec' option. See the documentation for more info: https://mezon.vn/docs/mezon/getting-started/configuration/#session"),e.created&&e.refresh_expires_at-e.created_at<3700&&console.warn("Session refresh lifetime too short, please set '--session.refresh_token_expiry_sec' option. See the documentation for more info: https://mezon.vn/docs/mezon/getting-started/configuration/#session"),this.refreshTokenPromise?this.refreshTokenPromise:(this.refreshTokenPromise=h(this,null,function*(){try{let a=yield this.apiClient.sessionRefresh(this.serverkey,"",{token:e.refresh_token,vars:t,is_remember:e.is_remember});return e.update(a.token,a.refresh_token,a.is_remember||!1),this.onRefreshSession(a),e}catch(a){throw console.error("Session refresh failed:",a),a}finally{this.refreshTokenPromise=null}}),this.refreshTokenPromise)):(console.error("Cannot refresh a null session."),e)})}unlinkEmail(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.unlinkEmail(e.token,t).then(i=>i!==void 0)})}updateUsername(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateUsername(e.token,t).then(i=>Promise.resolve(i))})}updateAccount(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateAccount(e.token,t).then(i=>i!==void 0)})}updateChannelDesc(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateChannelDesc(e.token,t,i).then(a=>a!==void 0)})}updateClanDesc(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanDesc(e.token,t,i).then(a=>a!==void 0)})}updateCategory(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateCategory(e.token,t,i).then(a=>a!==void 0)})}updateUserProfileByClan(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateUserProfileByClan(e.token,t,i).then(a=>a!==void 0)})}updateRole(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateRole(e.token,t,i).then(a=>a!==void 0)})}updateEvent(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateEvent(e.token,t,i).then(a=>a!==void 0)})}updateApp(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateApp(e.token,t,i).then(a=>Promise.resolve(a))})}createLinkInviteUser(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createLinkInviteUser(e.token,t).then(i=>Promise.resolve(i))})}getLinkInvite(e){return h(this,null,function*(){return this.apiClient.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getRoleOfUserInTheClan(e.token,t).then(i=>Promise.resolve(i))})}inviteUser(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.inviteUser(e.token,t).then(i=>Promise.resolve(i))})}setNotificationClan(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setNotificationClanSetting(e.token,t).then(i=>i!==void 0)})}setNotificationChannel(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setNotificationChannelSetting(e.token,t).then(i=>i!==void 0)})}setMuteCategory(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setMuteCategory(e.token,t).then(i=>i!==void 0)})}setMuteChannel(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setMuteChannel(e.token,t).then(i=>i!==void 0)})}updateChannelPrivate(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateChannelPrivate(e.token,t).then(i=>i!==void 0)})}setNotificationCategory(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setNotificationCategorySetting(e.token,t).then(i=>i!==void 0)})}deleteNotificationCategory(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteNotificationCategorySetting(e.token,t).then(i=>i!==void 0)})}deleteNotificationChannel(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteNotificationChannel(e.token,t).then(i=>i!==void 0)})}setNotificationReactMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setNotificationReactMessage(e.token,{channel_id:t}).then(i=>i!==void 0)})}deleteNotiReactMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteNotiReactMessage(e.token,t).then(i=>i!==void 0)})}searchMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.searchMessage(e.token,t).then(i=>Promise.resolve(i))})}createMessage2Inbox(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createMessage2Inbox(e.token,t).then(i=>Promise.resolve(i))})}createPinMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createPinMessage(e.token,t).then(i=>Promise.resolve(i))})}pinMessagesList(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getPinMessagesList(e.token,t,i,a).then(l=>{let d={pin_messages_list:[]};return l.pin_messages_list==null||l.pin_messages_list.forEach(c=>{d.pin_messages_list.push({id:c.id,avatar:c.avatar,channel_id:c.channel_id,content:c.content,create_time_seconds:c.create_time_seconds,message_id:c.message_id,sender_id:c.sender_id,username:c.username,attachment:c.attachment})}),Promise.resolve(d)})})}deletePinMessage(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deletePinMessage(e.token,t,i,a,l).then(d=>d!==void 0)})}createClanEmoji(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createClanEmoji(e.token,t).then(i=>i!==void 0)})}updateClanEmojiById(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanEmojiById(e.token,t,i).then(a=>a!==void 0)})}deleteByIdClanEmoji(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteClanEmojiById(e.token,t,i,a).then(l=>l!==void 0)})}generateWebhookLink(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.generateWebhook(e.token,t).then(i=>Promise.resolve(i))})}listWebhookByChannelId(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listWebhookByChannelId(e.token,t,i).then(a=>Promise.resolve(a))})}updateWebhookById(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateWebhookById(e.token,t,i).then(a=>a!==void 0)})}deleteWebhookById(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteWebhookById(e.token,t,i).then(a=>a!==void 0)})}addClanSticker(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addClanSticker(e.token,t).then(i=>i!==void 0)})}deleteClanStickerById(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteClanStickerById(e.token,t,i,a).then(l=>l!==void 0)})}updateClanStickerById(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanStickerById(e.token,t,i).then(a=>a!==void 0)})}changeChannelCategory(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.changeChannelCategory(e.token,t,i).then(a=>a!==void 0)})}setRoleChannelPermission(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setRoleChannelPermission(e.token,t).then(i=>i!==void 0)})}addApp(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addApp(e.token,t).then(i=>Promise.resolve(i))})}getApp(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getApp(e.token,t).then(i=>Promise.resolve(i))})}listApps(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listApps(e.token).then(t=>Promise.resolve(t))})}addAppToClan(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addAppToClan(e.token,t,i).then(a=>a!==void 0)})}getSystemMessagesList(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getSystemMessagesList(e.token).then(t=>Promise.resolve(t))})}getSystemMessageByClanId(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getSystemMessageByClanId(e.token,t).then(i=>Promise.resolve(i))})}createSystemMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createSystemMessage(e.token,t).then(i=>Promise.resolve(i))})}updateSystemMessage(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateSystemMessage(e.token,t,i).then(a=>Promise.resolve(a))})}deleteSystemMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteSystemMessage(e.token,t).then(i=>Promise.resolve(i))})}updateCategoryOrder(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateCategoryOrder(e.token,t).then(i=>Promise.resolve(i))})}givecoffee(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.giveMeACoffee(e.token,t).then(i=>i!==void 0)})}sendToken(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.sendToken(e.token,t).then(i=>i!==void 0)})}listStreamingChannelUsers(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listStreamingChannelUsers(e.token,t,i,a,d,l,c).then(u=>{let o={streaming_channel_users:[]};return u.streaming_channel_users==null||u.streaming_channel_users.forEach(n=>{o.streaming_channel_users.push({id:n.id,channel_id:n.channel_id,user_id:n.user_id,participant:n.participant})}),Promise.resolve(o)})})}registerStreamingChannel(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.registerStreamingChannel(e.token,t).then(i=>i!==void 0)})}listChannelApps(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelApps(e.token,t).then(i=>{let a={channel_apps:[]};return i.channel_apps==null||i.channel_apps.forEach(l=>{a.channel_apps.push({id:l.id,channel_id:l.channel_id,app_id:l.app_id,clan_id:l.clan_id,app_url:l.app_url,app_name:l.app_name,app_logo:l.app_logo})}),Promise.resolve(a)})})}getChannelCategoryNotiSettingsList(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getChannelCategoryNotiSettingsList(e.token,t).then(i=>Promise.resolve(i))})}getNotificationCategory(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getNotificationCategory(e.token,t).then(i=>Promise.resolve(i))})}getNotificationChannel(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getNotificationChannel(e.token,t).then(i=>Promise.resolve(i))})}getNotificationClan(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getNotificationClan(e.token,t).then(i=>Promise.resolve(i))})}getNotificationReactMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getNotificationReactMessage(e.token,t).then(i=>Promise.resolve(i))})}listChannelByUserId(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelByUserId(e.token).then(t=>Promise.resolve(t))})}listChannelUsersUC(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelUsersUC(e.token,t,i).then(a=>Promise.resolve(a))})}getListEmojisByUserId(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getListEmojisByUserId(e.token).then(t=>Promise.resolve(t))})}emojiRecentList(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.emojiRecentList(e.token).then(t=>Promise.resolve(t))})}getListStickersByUserId(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getListStickersByUserId(e.token).then(t=>Promise.resolve(t))})}listUserClansByUserId(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listUserClansByUserId(e.token).then(t=>Promise.resolve(t))})}listRoles(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listRoles(e.token,t,i,a,l).then(d=>{let c={clan_id:t,roles:d.roles};return Promise.resolve(c)})})}listUserPermissionInChannel(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listUserPermissionInChannel(e.token,t,i).then(a=>{let l={clan_id:t,channel_id:i,permissions:a.permissions};return Promise.resolve(l)})})}getPermissionByRoleIdChannelId(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getPermissionByRoleIdChannelId(e.token,t,i,a).then(l=>{let d={role_id:t,channel_id:i,permission_role_channel:l.permission_role_channel,user_id:a};return Promise.resolve(d)})})}markAsRead(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.markAsRead(e.token,t).then(i=>Promise.resolve(i))})}listThreadDescs(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listThreadDescs(e.token,t,i,a,l,d,c).then(u=>{let o={channeldesc:[]};return u.channeldesc==null||(o.channeldesc=u.channeldesc),Promise.resolve(o)})})}leaveThread(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.leaveThread(e.token,t,i).then(a=>Promise.resolve(a))})}getChannelSettingInClan(e,t,i,a,l,d,c,u,o,n,r){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelSetting(e.token,t,i,a,l,d,c,u,o,n,r).then(f=>Promise.resolve(f))})}getChannelCanvasList(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getChannelCanvasList(e.token,t,i,a,l).then(d=>{let c={channel_canvases:[]};return d.channel_canvases==null||(c.clan_id=d.clan_id,c.channel_id=d.channel_id,c.channel_canvases=d.channel_canvases,c.count=d.count),Promise.resolve(c)})})}getChannelCanvasDetail(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getChannelCanvasDetail(e.token,t,i,a).then(l=>Promise.resolve(l))})}editChannelCanvases(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.editChannelCanvases(e.token,t).then(i=>Promise.resolve(i))})}deleteChannelCanvas(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteChannelCanvas(e.token,t,i,a).then(l=>l!==void 0)})}addFavoriteChannel(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addChannelFavorite(e.token,{channel_id:t,clan_id:i}).then(a=>a)})}removeFavoriteChannel(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.removeChannelFavorite(e.token,t,i).then(a=>a)})}getListFavoriteChannel(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getListFavoriteChannel(e.token,t).then(i=>i)})}listActivity(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listActivity(e.token).then(t=>t)})}createActiviy(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createActiviy(e.token,t).then(i=>i)})}createQRLogin(e){return h(this,null,function*(){let t=yield this.apiClient.createQRLogin(this.serverkey,"",e);return{login_id:t.login_id,create_time_second:t.create_time_second}})}checkLoginRequest(e){return h(this,null,function*(){let t=yield this.apiClient.checkLoginRequest(this.serverkey,"",e);return t!=null&&t.token?new L(t.token||"",t.refresh_token||"",t.created||!1,t.api_url||"",t.ws_url||"",t.id_token||"",t.is_remember||!1):null})}confirmLogin(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.confirmLogin(e.token,t,i).then(a=>a)})}getChanEncryptionMethod(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getChanEncryptionMethod(e.token,t).then(i=>i)})}setChanEncryptionMethod(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setChanEncryptionMethod(e.token,t,{method:i}).then(a=>a)})}getPubKeys(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getPubKeys(e.token,t).then(i=>i)})}pushPubKey(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.pushPubKey(e.token,{PK:t}).then(i=>i)})}getKeyServer(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getKeyServer(e.token).then(t=>t)})}listAuditLog(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listAuditLog(e.token,t,i,a,l).then(d=>d)})}listOnboarding(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listOnboarding(e.token,t,i,a,l).then(d=>d)})}getOnboardingDetail(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getOnboardingDetail(e.token,t,i).then(a=>Promise.resolve(a))})}createOnboarding(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createOnboarding(e.token,t).then(i=>i)})}updateOnboarding(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateOnboarding(e.token,t,i).then(a=>a!==void 0)})}deleteOnboarding(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteOnboarding(e.token,t,i).then(a=>a!==void 0)})}generateClanWebhook(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.generateClanWebhook(e.token,t).then(i=>Promise.resolve(i))})}listClanWebhook(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listClanWebhook(e.token,t).then(i=>Promise.resolve(i))})}deleteClanWebhookById(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteClanWebhookById(e.token,t,i).then(a=>a!==void 0)})}updateClanWebhookById(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanWebhookById(e.token,t,i).then(a=>a!==void 0)})}listOnboardingStep(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listOnboardingStep(e.token,t,i,a).then(l=>Promise.resolve(l))})}updateOnboardingStepByClanId(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateOnboardingStepByClanId(e.token,t,i).then(a=>a!==void 0)})}updateUserStatus(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateUserStatus(e.token,t).then(i=>i!==void 0)})}getUserStatus(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getUserStatus(e.token).then(t=>Promise.resolve(t))})}listSdTopic(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listSdTopic(e.token,t,i).then(a=>Promise.resolve(a))})}createSdTopic(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createSdTopic(e.token,t).then(i=>i)})}getTopicDetail(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getTopicDetail(e.token,t).then(i=>Promise.resolve(i))})}createRoomChannelApps(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createRoomChannelApps(e.token,t).then(i=>Promise.resolve(i))})}generateMeetToken(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.generateMeetToken(e.token,t).then(i=>Promise.resolve(i))})}listMezonOauthClient(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listMezonOauthClient(e.token).then(t=>Promise.resolve(t))})}getMezonOauthClient(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getMezonOauthClient(e.token,t,i).then(a=>Promise.resolve(a))})}updateMezonOauthClient(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateMezonOauthClient(e.token,t).then(i=>Promise.resolve(i))})}searchThread(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.searchThread(e.token,t,i,a).then(l=>Promise.resolve(l))})}generateHashChannelApps(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.generateHashChannelApps(e.token,t).then(i=>Promise.resolve(i))})}registrationPassword(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.registrationEmail(e.token,{email:t,password:i,old_password:a}).then(l=>Promise.resolve(l))})}addUserEvent(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addUserEvent(e.token,t).then(i=>i!==void 0)})}deleteUserEvent(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteUserEvent(e.token,t,i).then(a=>a!==void 0)})}updateRoleOrder(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateRoleOrder(e.token,t).then(i=>Promise.resolve(i))})}deleteAccount(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteAccount(e.token).then(t=>Promise.resolve(t))})}createExternalMezonMeet(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createExternalMezonMeet(e.token).then(t=>Promise.resolve(t))})}generateMeetTokenExternal(e,t,i,a){return h(this,null,function*(){return this.apiClient.generateMeetTokenExternal("",e,t,i,a).then(l=>Promise.resolve(l))})}removeMezonMeetParticipant(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.removeParticipantMezonMeet(e.token,t).then(i=>Promise.resolve(i))})}muteMezonMeetParticipant(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.muteParticipantMezonMeet(e.token,t).then(i=>Promise.resolve(i))})}updateClanOrder(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanOrder(e.token,t).then(i=>i!==void 0)})}listClanDiscover(e,t){return h(this,null,function*(){return this.apiClient.clanDiscover(this.serverkey,"",e,t).then(i=>Promise.resolve(i))})}listQuickMenuAccess(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listQuickMenuAccess(e.token,t,i,a).then(l=>Promise.resolve(l))})}deleteQuickMenuAccess(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteQuickMenuAccess(e.token,t,i).then(a=>a!==void 0)})}addQuickMenuAccess(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addQuickMenuAccess(e.token,t).then(i=>i!==void 0)})}updateQuickMenuAccess(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateQuickMenuAccess(e.token,t).then(i=>i!==void 0)})}listForSaleItems(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listForSaleItems(e.token,t).then(i=>Promise.resolve(i))})}isFollower(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.isFollower(e.token,t).then(i=>Promise.resolve(i))})}transferOwnership(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.transferOwnership(e.token,t).then(i=>i!==void 0)})}isBanned(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.isBanned(e.token,t).then(i=>Promise.resolve(i))})}reportMessageAbuse(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.reportMessageAbuse(e.token,t,i).then(a=>a!==void 0)})}listLogedDevice(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listLogedDevice(e.token).then(t=>Promise.resolve(t))})}updateMezonVoiceState(e,t,i,a,l,d){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateMezonVoiceState(e.token,t,i,a,l,d).then(c=>c!==void 0)})}sendChannelMessage(e,t,i,a,l,d,c,u,o,n,r,f,g,y){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.sendChannelMessage(e.token,t,i,a,l,d,c,u,o,n,r,f,g,y).then(b=>Promise.resolve(b))})}updateChannelMessage(e,t,i,a,l,d,c,u,o,n,r,f){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateChannelMessage(e.token,t,i,a,l,d,c,u,o,n,r,f).then(g=>Promise.resolve(g))})}deleteChannelMessage(e,t,i,a,l,d,c,u,o,n){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteChannelMessage(e.token,t,i,a,l,d,c,u,o,n).then(r=>Promise.resolve(r))})}messageButtonClick(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.messageButtonClick(e.token,t,i,a,l,d,c).then(u=>Promise.resolve(u))})}dropdownBoxSelected(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.dropdownBoxSelected(e.token,t,i,a,l,d,c).then(u=>Promise.resolve(u))})}activeArchivedThread(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.activeArchivedThread(e.token,t,i).then(a=>Promise.resolve(a))})}};
|
|
1
|
+
"use strict";var oe=Object.create;var O=Object.defineProperty,ae=Object.defineProperties,ue=Object.getOwnPropertyDescriptor,le=Object.getOwnPropertyDescriptors,ce=Object.getOwnPropertyNames,V=Object.getOwnPropertySymbols,de=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable;var Y=(_,e,t)=>e in _?O(_,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):_[e]=t,R=(_,e)=>{for(var t in e||(e={}))$.call(e,t)&&Y(_,t,e[t]);if(V)for(var t of V(e))he.call(e,t)&&Y(_,t,e[t]);return _},M=(_,e)=>ae(_,le(e));var fe=(_,e)=>{for(var t in e)O(_,t,{get:e[t],enumerable:!0})},Z=(_,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ce(e))!$.call(_,a)&&a!==t&&O(_,a,{get:()=>e[a],enumerable:!(i=ue(e,a))||i.enumerable});return _};var H=(_,e,t)=>(t=_!=null?oe(de(_)):{},Z(e||!_||!_.__esModule?O(t,"default",{value:_,enumerable:!0}):t,_)),pe=_=>Z(O({},"__esModule",{value:!0}),_);var h=(_,e,t)=>new Promise((i,a)=>{var l=u=>{try{c(t.next(u))}catch(o){a(o)}},d=u=>{try{c(t.throw(u))}catch(o){a(o)}},c=u=>u.done?i(u.value):Promise.resolve(u.value).then(l,d);c((t=t.apply(_,e)).next())});var qe={};fe(qe,{ChannelStreamMode:()=>ie,ChannelType:()=>ne,Client:()=>K,ConnectionState:()=>U,DefaultSocket:()=>B,NotificationType:()=>re,Session:()=>L,WebrtcSignalingType:()=>se,b64DecodeUnicode:()=>ge,b64EncodeUnicode:()=>me,buildFetchOptions:()=>p,decodeAttachments:()=>T,decodeMentions:()=>x,decodeNotificationFcm:()=>N,decodeReactions:()=>F,decodeRefs:()=>W,encodeAttachments:()=>ye,encodeMentions:()=>_e,encodeNotificationFcm:()=>Pe,encodeReactions:()=>be,encodeRefs:()=>Ae,getFetcher:()=>m,resetFetchStrategy:()=>Re,safeJSONParse:()=>w,setFetchStrategy:()=>we});module.exports=pe(qe);var Qi=require("whatwg-fetch");var I=require("js-base64"),C=H(require("mezon-js-protobuf"));function p(_,e,t){let i=R({method:_},e);return i.headers=R({},e.headers),Object.keys(i.headers).includes("Accept")||(i.headers.Accept="application/proto"),Object.keys(i.headers).includes("Content-Type")||(i.headers["Content-Type"]="application/proto"),Object.keys(i.headers).forEach(a=>{i.headers[a]||delete i.headers[a]}),t&&(i.body=t),i}function me(_){return(0,I.encode)(encodeURIComponent(_).replace(/%([0-9A-F]{2})/g,function(t,i){return String.fromCharCode(+("0x"+i))}))}function ge(_){return decodeURIComponent((0,I.decode)(_).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function w(_){if(_==null)return{t:_};let e;if(_ instanceof Uint8Array)e=new TextDecoder().decode(_);else if(typeof _=="string")e=_;else return typeof _=="object"?_:{t:_};if(!e||e===""||e==="[]")return{t:e};try{return JSON.parse(e)}catch(t){try{let i=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(i)}catch(i){return console.error("JSON Parse failed completely:",{original:e,error:i}),{t:e}}}}var D=_=>!_||_===null||_===void 0||_===""||_==="[]";function x(_){if(D(_))return;let e=_[0];if(e===91||e===123)return w(_);try{let i=_,a=new Uint8Array(i);return C.MessageMentionList.decode(a)}catch(i){return w(_)}}function T(_){if(D(_))return;let e=_[0];if(e===91||e===123)return w(_);try{let i=_,a=new Uint8Array(i);return C.MessageAttachmentList.decode(a)}catch(i){return w(_)}}function W(_){if(D(_))return;let e=_[0];if(e===91||e===123)return w(_);try{let i=_,a=new Uint8Array(i);return C.MessageRefList.decode(a)}catch(i){return w(_)}}function F(_){if(D(_))return;let e=_[0];if(e===91||e===123)return w(_);try{let i=_,a=new Uint8Array(i);return C.MessageReactionList.decode(a)}catch(i){return w(_)}}function N(_){if(D(_))return;let e=_[0];if(e===91||e===123)return w(_);try{let i=_,a=new Uint8Array(i);return C.DirectFcmProto.decode(a)}catch(i){return w(_)}}function _e(_){return C.MessageMentionList.encode(C.MessageMentionList.fromPartial(_)).finish()}function ye(_){return C.MessageAttachmentList.encode(C.MessageAttachmentList.fromPartial(_)).finish()}function Ae(_){return C.MessageRefList.encode(C.MessageRefList.fromPartial(_)).finish()}function be(_){return C.MessageReactionList.encode(C.MessageReactionList.fromPartial(_)).finish()}function Pe(_){return C.DirectFcmProto.encode(C.DirectFcmProto.fromPartial(_)).finish()}var E=require("js-base64"),s=H(require("mezon-js-protobuf"));var J=fetch,we=_=>{J=_},Re=()=>{J=fetch},m=()=>J;var j=class{constructor(e,t,i){this.serverKey=e;this.timeoutMs=t;this.basePath=i}setBasePath(e){this.basePath=e}deleteAccount(e,t={}){let i="/mezon.api.Mezon/DeleteAccount",a=new Map,l="",d=this.buildFullUrl(this.basePath,i,a),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([m()(d,c).then(u=>{if(u.status==204)return u;if(u.status>=200&&u.status<300)return u;throw u}),new Promise((u,o)=>setTimeout(o,this.timeoutMs,"Request timed out."))])}getAccount(e,t={}){let i="/mezon.api.Mezon/GetAccount",a=new Map,l="",d=this.buildFullUrl(this.basePath,i,a),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([m()(d,c).then(u=>h(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return s.Account.decode(new Uint8Array(o))}else throw u})),new Promise((u,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateAccount(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateAccount",l=new Map,c=s.UpdateAccountRequest.encode(s.UpdateAccountRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/checklogin",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/confirmlogin",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(t,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Bearer "+e),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/createqrlogin",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LoginIDResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/smsotp",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/emailotp",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/email",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,i,a,l,d,c={}){if(i==null)throw new Error("'account' is a required parameter but is null or undefined.");let u="/v2/account/authenticate/mezon",o=new Map;o.set("create",a),o.set("username",l),o.set("is_remember",d);let n="";n=JSON.stringify(i||{});let r=this.buildFullUrl(this.basePath,u,o),f=p("POST",c,n);return e&&(f.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),f.headers.Accept="application/x-protobuf",Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.Session.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}linkEmail(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/LinkEmail",l=new Map,c=s.UpdateAccountRequest.encode(s.UpdateAccountRequest.fromPartial({email:t.email})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}linkSMS(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/LinkSMS",l=new Map,c=s.AccountMezon.encode(s.AccountMezon.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}confirmLinkMezonOTP(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ConfirmLinkMezonOTP",l=new Map,c=s.LinkAccountConfirmRequest.encode(s.LinkAccountConfirmRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),o.headers.Accept="application/x-protobuf",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/confirmotp",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}registrationEmail(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/RegistrationEmail",l=new Map,c=s.RegistrationEmailRequest.encode(s.RegistrationEmailRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/SessionRefresh",d=new Map,u=s.SessionRefreshRequest.encode(s.SessionRefreshRequest.fromPartial(i)).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.Session.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}unlinkEmail(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UnlinkEmail",l=new Map,c=s.AccountEmail.encode(s.AccountEmail.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listActivity(e,t={}){let i="/mezon.api.Mezon/ListActivity",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.ListUserActivity.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}createActiviy(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateActiviy",l=new Map,c=s.CreateActivityRequest.encode(s.CreateActivityRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.UserActivity.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}addApp(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddApp",l=new Map,c=s.AddAppRequest.encode(s.AddAppRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.App.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListApps",c=new Map,o=s.ListAppsRequest.encode(s.ListAppsRequest.fromPartial({filter:t,tombstones:i,cursor:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.AppList.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,i,a={}){if(t==null)throw new Error("'appId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/AddAppToClan",d=new Map,u=s.AppClan.encode(s.AppClan.fromPartial({app_id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}deleteApp(e,t,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteApp",l=new Map,c=s.App.encode(s.App.fromPartial({id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return n;throw n})),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}getApp(e,t,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetApp",l=new Map,c=s.App.encode(s.App.fromPartial({id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.App.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateApp(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateApp",d=new Map,u=s.UpdateAppRequest.encode(s.UpdateAppRequest.fromPartial(M(R({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.App.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/ListAuditLog",u=new Map,n=s.ListAuditLogRequest.encode(s.ListAuditLogRequest.fromPartial({clan_id:a,user_id:i,action_log:t,date_log:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.ListAuditLog.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}updateCategoryOrder(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateCategoryOrder",l=new Map,c=s.UpdateCategoryOrderRequest.encode(s.UpdateCategoryOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return n;throw n})),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,i,a,l,d,c={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let u="/mezon.api.Mezon/ListCategoryDescs",o=new Map,r=s.CategoryDesc.encode(s.CategoryDesc.fromPartial({clan_id:t,creator_id:i,category_name:a,category_id:l,category_order:d})).finish(),f=this.buildFullUrl(this.basePath,u,o),g=p("POST",c,"");return g.body=r,e&&(g.headers.Authorization="Bearer "+e),Promise.race([m()(f,g).then(y=>h(this,null,function*(){if(y.status==204)return{};if(y.status>=200&&y.status<300){let b=yield y.arrayBuffer();return s.CategoryDescList.decode(new Uint8Array(b))}else throw y})),new Promise((y,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t,i={}){let a="/mezon.api.Mezon/ListChannelApps",l=new Map,c=s.ListChannelAppsRequest.encode(s.ListChannelAppsRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListChannelAppsResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,i,a,l,d={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetChannelCanvasList",u=new Map,n=s.ChannelCanvasListRequest.encode(s.ChannelCanvasListRequest.fromPartial({channel_id:t,clan_id:i,limit:a,page:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.ChannelCanvasListResponse.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}addChannelFavorite(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddChannelFavorite",l=new Map,c=s.AddFavoriteChannelRequest.encode(s.AddFavoriteChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.AddFavoriteChannelResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/RemoveChannelFavorite",d=new Map,u=s.RemoveFavoriteChannelRequest.encode(s.RemoveFavoriteChannelRequest.fromPartial({channel_id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}getListFavoriteChannel(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetListFavoriteChannel",l=new Map,c=s.ListFavoriteChannelRequest.encode(s.ListFavoriteChannelRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListFavoriteChannelResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,i,a,l,d,c,u={}){if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListChannelMessages",n=new Map,f=s.ListChannelMessagesRequest.encode(s.ListChannelMessagesRequest.fromPartial({clan_id:t,channel_id:i,message_id:a,direction:l,limit:d,topic_id:c})).finish(),g=this.buildFullUrl(this.basePath,o,n),y=p("POST",u,"");return y.body=f,e&&(y.headers.Authorization="Bearer "+e),Promise.race([m()(g,y).then(b=>h(this,null,function*(){if(b.status==204)return{};if(b.status>=200&&b.status<300){let A=yield b.arrayBuffer();return s.ChannelMessageList.decode(new Uint8Array(A))}else throw b})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/AddChannelUsers",d=new Map,u=s.AddChannelUsersRequest.encode(s.AddChannelUsersRequest.fromPartial({channel_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,i,a,l,d,c,u,o,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ListChannelAttachment",f=new Map,y=s.ListChannelAttachmentRequest.encode(s.ListChannelAttachmentRequest.fromPartial({channel_id:t,clan_id:i,file_type:a,limit:l,state:d,before:c,after:u,around:o})).finish(),b=this.buildFullUrl(this.basePath,r,f),A=p("POST",n,"");return A.body=y,e&&(A.headers.Authorization="Bearer "+e),Promise.race([m()(b,A).then(P=>h(this,null,function*(){if(P.status==204)return{};if(P.status>=200&&P.status<300){let v=yield P.arrayBuffer();return s.ChannelAttachmentList.decode(new Uint8Array(v))}else throw P})),new Promise((P,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/GetChanEncryptionMethod",d=new Map,u=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial({channel_id:t,method:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.ChanEncryptionMethod.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/SetChanEncryptionMethod",d=new Map,u=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial(M(R({},i),{channel_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,i,a={}){if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/LeaveThread",d=new Map,u=s.LeaveThreadRequest.encode(s.LeaveThreadRequest.fromPartial({channel_id:i,clan_id:t})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}removeChannelUsers(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/RemoveChannelUsers",d=new Map,u=s.RemoveChannelUsersRequest.encode(s.RemoveChannelUsersRequest.fromPartial({channel_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,i,a,l,d,c,u={}){if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListChannelUsers",n=new Map,f=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:i,channel_type:a,limit:l,state:d,cursor:c})).finish(),g=this.buildFullUrl(this.basePath,o,n),y=p("POST",u,"");return y.body=f,e&&(y.headers.Authorization="Bearer "+e),Promise.race([m()(g,y).then(b=>h(this,null,function*(){if(b.status==204)return{};if(b.status>=200&&b.status<300){let A=yield b.arrayBuffer();return s.ChannelUserList.decode(new Uint8Array(A))}else throw b})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/ListChannelDescs",n=new Map,f=s.ListChannelDescsRequest.encode(s.ListChannelDescsRequest.fromPartial({limit:t,state:i,cursor:a,clan_id:l,channel_type:d,is_mobile:c})).finish(),g=this.buildFullUrl(this.basePath,o,n),y=p("POST",u,"");return y.body=f,e&&(y.headers.Authorization="Bearer "+e),Promise.race([m()(g,y).then(b=>h(this,null,function*(){if(b.status==204)return{};if(b.status>=200&&b.status<300){let A=yield b.arrayBuffer();return s.ChannelDescList.decode(new Uint8Array(A))}else throw b})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateChannelDesc",l=new Map,c=s.CreateChannelDescRequest.encode(s.CreateChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ChannelDescription.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,i,a={}){let l="/mezon.api.Mezon/ListChannelUsersUC",d=new Map,u=s.AllUsersAddChannelRequest.encode(s.AllUsersAddChannelRequest.fromPartial({channel_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.AllUsersAddChannelResponse.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,i,a={}){if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteChannelDesc",d=new Map,u=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateChannelDesc",d=new Map,u=s.UpdateChannelDescRequest.encode(s.UpdateChannelDescRequest.fromPartial(M(R({},i),{channel_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,i,a,l,d,c,u,o,n,r,f={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let g="/mezon.api.Mezon/ListChannelSetting",y=new Map,A=s.ChannelSettingListRequest.encode(s.ChannelSettingListRequest.fromPartial({clan_id:t,parent_id:i,category_id:a,active:d,private_channel:l,status:c,type:u,limit:o,page:n,channel_label:r})).finish(),P=this.buildFullUrl(this.basePath,g,y),v=p("POST",f,"");return v.body=A,e&&(v.headers.Authorization="Bearer "+e),Promise.race([m()(P,v).then(S=>h(this,null,function*(){if(S.status==204)return{};if(S.status>=200&&S.status<300){let q=yield S.arrayBuffer();return s.ChannelSettingListResponse.decode(new Uint8Array(q))}else throw S})),new Promise((S,q)=>setTimeout(()=>q(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,i,a={}){let l="/mezon.api.Mezon/ListChannelVoiceUsers",d=new Map,u=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.VoiceChannelUserList.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listClanUnreadMsgIndicator(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListClanUnreadMsgIndicator",l=new Map,c=s.ListClanUnreadMsgIndicatorRequest.encode(s.ListClanUnreadMsgIndicatorRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListClanUnreadMsgIndicatorResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListClanDescs",c=new Map,o=s.ListClanDescRequest.encode(s.ListClanDescRequest.fromPartial({limit:t,state:i,cursor:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.ClanDescList.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}createClanDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateClanDesc",l=new Map,c=s.CreateClanDescRequest.encode(s.CreateClanDescRequest.fromPartial({clan_name:t.clan_name,logo:t.logo,banner:t.banner})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ClanDesc.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteClanDesc(e,t,i={}){if(t==null)throw new Error("'clanDescId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteClanDesc",l=new Map,c=s.DeleteClanDescRequest.encode(s.DeleteClanDescRequest.fromPartial({clan_desc_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}updateClanDesc(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateClanDesc",d=new Map,u=s.UpdateClanDescRequest.encode(s.UpdateClanDescRequest.fromPartial(R({clan_id:t},i))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/RemoveClanUsers",d=new Map,u=s.RemoveClanUsersRequest.encode(s.RemoveClanUsersRequest.fromPartial({clan_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return(yield r.arrayBuffer()).byteLength>0?{}:{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,i,a={}){let l="/mezon.api.Mezon/ListBannedUsers",d=new Map,u=s.BannedUserListRequest.encode(s.BannedUserListRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.BannedUserList.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,i,a,l,d={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UnbanClanUsers",u=new Map,n=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:i,user_ids:a,ban_time:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300)return(yield g.arrayBuffer()).byteLength>0?{}:{};throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,i,a,l,d={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/BanClanUsers",u=new Map,n=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:i,user_ids:a,ban_time:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300)return(yield g.arrayBuffer()).byteLength>0?{}:{};throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}listClanUsers(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListClanUsers",l=new Map,c=s.ListClanUsersRequest.encode(s.ListClanUsersRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ClanUserList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createCategoryDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateCategoryDesc",l=new Map,c=s.CreateCategoryDescRequest.encode(s.CreateCategoryDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.CategoryDesc.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,i,a,l={}){if(t==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteCategoryDesc",c=new Map,o=s.DeleteCategoryDescRequest.encode(s.DeleteCategoryDescRequest.fromPartial({category_id:t,clan_id:i,category_label:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300)return(yield f.arrayBuffer()).byteLength>0?{}:{};throw f})),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/RegistFCMDeviceToken",u=new Map,n=s.RegistFcmDeviceTokenRequest.encode(s.RegistFcmDeviceTokenRequest.fromPartial({token:t,device_id:i,platform:a,voip_token:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.RegistFcmDeviceTokenResponse.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}closeDirectMess(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CloseDMByChannelId",l=new Map,c=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return(yield n.arrayBuffer()).byteLength>0?{}:{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}openDirectMess(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/OpenDMByChannelId",l=new Map,c=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return(yield n.arrayBuffer()).byteLength>0?{}:{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createClanEmoji(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateClanEmoji",l=new Map,c=s.ClanEmojiCreateRequest.encode(s.ClanEmojiCreateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return(yield n.arrayBuffer()).byteLength>0?{}:{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,i,a,l={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteByIdClanEmoji",c=new Map,o=s.ClanEmojiDeleteRequest.encode(s.ClanEmojiDeleteRequest.fromPartial({id:t,clan_id:i,emoji_label:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300)return(yield f.arrayBuffer()).byteLength>0?{}:{};throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateClanEmojiById",d=new Map,u=s.ClanEmojiUpdateRequest.encode(s.ClanEmojiUpdateRequest.fromPartial({id:i.id,shortname:i.shortname,clan_id:i.clan_id})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return(yield r.arrayBuffer()).byteLength>0?{}:{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e,t={}){let i="/mezon.api.Mezon/EmojiRecentList",a=new Map,l="",d=this.buildFullUrl(this.basePath,i,a),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([m()(d,c).then(u=>h(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return s.EmojiRecentList.decode(new Uint8Array(o))}else throw u})),new Promise((u,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e,t={}){let i="/mezon.api.Mezon/GetListEmojisByUserId",a=new Map,l="",d=this.buildFullUrl(this.basePath,i,a),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([m()(d,c).then(u=>h(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return s.EmojiListedResponse.decode(new Uint8Array(o))}else throw u})),new Promise((u,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}searchMessage(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SearchMessage",l=new Map,c=s.SearchMessageRequest.encode(s.SearchMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.SearchMessageResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}event(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateEvent",l=new Map,c=s.Event.encode(s.Event.fromPartial({external:t.external,name:t.name,properties:t.properties})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listEvents(e,t,i={}){let a="/mezon.api.Mezon/ListEvents",l=new Map,c=s.ListEventsRequest.encode(s.ListEventsRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.EventList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createEvent(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateEvent",l=new Map,c=s.CreateEventRequest.encode(s.CreateEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.EventManagement.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateEventUser(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateEventUser",l=new Map,c=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,i,a,l,d,c={}){if(t==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let u="/mezon.api.Mezon/DeleteEvent",o=new Map,r=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial({event_id:t,clan_id:i,creator_id:a,event_label:l,channel_id:d})).finish(),f=this.buildFullUrl(this.basePath,u,o),g=p("POST",c,"");return g.body=r,e&&(g.headers.Authorization="Bearer "+e),Promise.race([m()(f,g).then(y=>h(this,null,function*(){if(y.status==204)return{};if(y.status>=200&&y.status<300)return{};throw y})),new Promise((y,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,i,a={}){if(t==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateEvent",d=new Map,u=s.UpdateEventRequest.encode(s.UpdateEventRequest.fromPartial(i)).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,i,a={}){let l="/mezon.api.Mezon/DeleteFriends",d=new Map,u=s.DeleteFriendsRequest.encode(s.DeleteFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listFriends(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListFriends",c=new Map,o=s.ListFriendsRequest.encode(s.ListFriendsRequest.fromPartial({limit:t,state:i,cursor:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.FriendList.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,i,a={}){let l="/mezon.api.Mezon/AddFriends",d=new Map,u=s.AddFriendsRequest.encode(s.AddFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.AddFriendsResponse.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,i,a={}){let l="/mezon.api.Mezon/BlockFriends",d=new Map,u=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,i,a={}){let l="/mezon.api.Mezon/UnblockFriends",d=new Map,u=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t,i={}){let a="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",l=new Map,c=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotificationChannelCategorySettingList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getUserProfileOnClan(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetUserProfileOnClan",l=new Map,c=s.ClanProfileRequest.encode(s.ClanProfileRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ClanProfile.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t,i={}){let a="/mezon.api.Mezon/GetNotificationCategory",l=new Map,c=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotificationUserChannel.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t,i={}){let a="/mezon.api.Mezon/GetNotificationChannel",l=new Map,c=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotificationUserChannel.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t,i={}){let a="/mezon.api.Mezon/GetNotificationClan",l=new Map,c=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotificationSetting.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t,i={}){let a="/mezon.api.Mezon/GetNotificationReactMessage",l=new Map,c=s.NotifiReactMessage.encode(s.NotifiReactMessage.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotifiReactMessage.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}giveMeACoffee(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GiveMeACoffee",l=new Map,c=s.GiveCoffeeEvent.encode(s.GiveCoffeeEvent.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getKeyServer(e,t={}){let i="/mezon.api.Mezon/GetKeyServer",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.GetKeyServerResp.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}createLinkInviteUser(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateLinkInviteUser",l=new Map,c=s.LinkInviteUserRequest.encode(s.LinkInviteUserRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkInviteUser.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}inviteUser(e,t,i={}){if(t==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/InviteUser",l=new Map,c=s.InviteUserRequest.encode(s.InviteUserRequest.fromPartial({invite_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.InviteUserRes.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,i,a={}){if(i==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let l="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(i))),d=new Map,c="",u=this.buildFullUrl(this.basePath,l,d),o=p("GET",a,c);return e&&(o.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),o.headers.Accept="application/json",o.headers["Content-Type"]="application/json",Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return n.json();throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e,t={}){let i="/mezon.api.Mezon/ListChannelByUserId",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.ChannelDescList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}markAsRead(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/MarkAsRead",l=new Map,c=s.MarkAsReadRequest.encode(s.MarkAsReadRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listMezonOauthClient(e,t={}){let i="/mezon.api.Mezon/ListMezonOauthClient",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.MezonOauthClientList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}setMuteCategory(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetMuteCategory",l=new Map,c=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}setMuteChannel(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetMuteChannel",l=new Map,c=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,i,a={}){let l="/mezon.api.Mezon/DeleteNotifications",d=new Map,u=s.DeleteNotificationsRequest.encode(s.DeleteNotificationsRequest.fromPartial({ids:t||[],category:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,i,a,l,d,c={}){let u="/mezon.api.Mezon/ListNotifications",o=new Map,r=s.ListNotificationsRequest.encode(s.ListNotificationsRequest.fromPartial({limit:t,clan_id:i,notification_id:a,category:l,direction:d})).finish(),f=this.buildFullUrl(this.basePath,u,o),g=p("POST",c,"");return g.body=r,e&&(g.headers.Authorization="Bearer "+e),Promise.race([m()(f,g).then(y=>h(this,null,function*(){if(y.status==204)return{};if(y.status>=200&&y.status<300){let b=yield y.arrayBuffer();return s.NotificationList.decode(new Uint8Array(b))}else throw y})),new Promise((y,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetNotificationChannelSetting",l=new Map,c=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}setNotificationClanSetting(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetNotificationClanSetting",l=new Map,c=s.SetDefaultNotificationRequest.encode(s.SetDefaultNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}setNotificationCategorySetting(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetNotificationCategorySetting",l=new Map,c=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t,i={}){let a="/mezon.api.Mezon/DeleteNotificationCategorySetting",l=new Map,c=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t,i={}){let a="/mezon.api.Mezon/DeleteNotificationChannel",l=new Map,c=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t,i={}){let a="/mezon.api.Mezon/DeleteNotiReactMessage",l=new Map,c=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}setNotificationReactMessage(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetNotificationReactMessage",l=new Map,c=s.NotificationChannel.encode(s.NotificationChannel.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}setRoleChannelPermission(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetRoleChannelPermission",l=new Map,c=s.UpdateRoleChannelRequest.encode(s.UpdateRoleChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}getListPermission(e,t={}){let i="/mezon.api.Mezon/GetListPermission",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.PermissionList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,i,a,l={}){let d="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",c=new Map,o=s.PermissionRoleChannelListEventRequest.encode(s.PermissionRoleChannelListEventRequest.fromPartial({role_id:t,channel_id:i,user_id:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.PermissionRoleChannelListEventResponse.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/DeletePinMessage",u=new Map,n=s.DeletePinMessage.encode(s.DeletePinMessage.fromPartial({id:t,message_id:i,channel_id:a,clan_id:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>{if(g.status==204)return g;if(g.status>=200&&g.status<300)return g;throw g}),new Promise((g,y)=>setTimeout(y,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,i,a,l={}){let d="/mezon.api.Mezon/GetPinMessagesList",c=new Map,o=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial({message_id:t,channel_id:i,clan_id:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.PinMessagesList.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}createMessage2Inbox(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateMessage2Inbox",l=new Map,c=s.Message2InboxRequest.encode(s.Message2InboxRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ChannelMessageHeader.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createPinMessage(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreatePinMessage",l=new Map,c=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ChannelMessageHeader.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t,i={}){let a="/mezon.api.Mezon/GetPubKeys",l=new Map,c=s.GetPubKeysRequest.encode(s.GetPubKeysRequest.fromPartial({user_ids:t||[]})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.GetPubKeysResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}pushPubKey(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/PushPubKey",l=new Map,c=s.PushPubKeyRequest.encode(s.PushPubKeyRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}addRolesChannelDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddRolesChannelDesc",l=new Map,c=s.AddRoleChannelDescRequest.encode(s.AddRoleChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}changeChannelCategory(e,t,i,a={}){if(t==null)throw new Error("'newCategoryId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/ChangeChannelCategory",d=new Map,u=s.ChangeChannelCategoryRequest.encode(s.ChangeChannelCategoryRequest.fromPartial(M(R({},i),{new_category_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}deleteRoleChannelDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteRoleChannelDesc",l=new Map,c=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listRoles(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/ListRoles",u=new Map,n=s.RoleListEventRequest.encode(s.RoleListEventRequest.fromPartial({clan_id:t,limit:i,state:a,cursor:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.RoleListEventResponse.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}createRole(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateRole",l=new Map,c=s.CreateRoleRequest.encode(s.CreateRoleRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Role.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateRoleDelete(e,t,i,a={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteRole",d=new Map,u=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(M(R({},i),{role_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,i,a,l,d={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteRole",u=new Map,n=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial({role_id:t,channel_id:i,clan_id:a,role_label:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>{if(g.status==204)return g;if(g.status>=200&&g.status<300)return g;throw g}),new Promise((g,y)=>setTimeout(y,this.timeoutMs,"Request timed out."))])}updateRole(e,t,i,a={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateRole",d=new Map,u=s.UpdateRoleRequest.encode(s.UpdateRoleRequest.fromPartial(M(R({},i),{role_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listRolePermissions(e,t,i={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListRolePermissions",l=new Map,c=s.ListPermissionsRequest.encode(s.ListPermissionsRequest.fromPartial({role_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.PermissionList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,i,a,l={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/ListRoleUsers",c=new Map,o=s.ListRoleUsersRequest.encode(s.ListRoleUsersRequest.fromPartial({role_id:t,limit:i,cursor:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.RoleUserList.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/GetRoleOfUserInTheClan",d=new Map,u=s.ListPermissionOfUsersRequest.encode(s.ListPermissionOfUsersRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.RoleList.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,i,a,l={}){let d="/mezon.api.Mezon/SearchThread",c=new Map,o=s.SearchThreadRequest.encode(s.SearchThreadRequest.fromPartial({clan_id:t,channel_id:i,label:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.ChannelDescList.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}sendToken(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SendToken",l=new Map,c=s.TokenSentEvent.encode(s.TokenSentEvent.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}sessionLogout(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SessionLogout",l=new Map,c=s.SessionLogoutRequest.encode(s.SessionLogoutRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}addClanSticker(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddClanSticker",l=new Map,c=s.ClanStickerAddRequest.encode(s.ClanStickerAddRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,i,a,l={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteClanStickerById",c=new Map,o=s.ClanStickerDeleteRequest.encode(s.ClanStickerDeleteRequest.fromPartial({id:t,clan_id:i,sticker_label:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300)return{};throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateClanStickerById",d=new Map,u=s.ClanStickerUpdateByIdRequest.encode(s.ClanStickerUpdateByIdRequest.fromPartial(M(R({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e,t={}){let i="/mezon.api.Mezon/GetListStickersByUserId",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.StickerListedResponse.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}registerStreamingChannel(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/RegisterStreamingChannel",l=new Map,c=s.RegisterStreamingChannelRequest.encode(s.RegisterStreamingChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.RegisterStreamingChannelResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/ListStreamingChannelUsers",n=new Map,f=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:i,channel_type:a,limit:l,state:d,cursor:c})).finish(),g=this.buildFullUrl(this.basePath,o,n),y=p("POST",u,"");return y.body=f,e&&(y.headers.Authorization="Bearer "+e),Promise.race([m()(g,y).then(b=>h(this,null,function*(){if(b.status==204)return{};if(b.status>=200&&b.status<300){let A=yield b.arrayBuffer();return s.StreamingChannelUserList.decode(new Uint8Array(A))}else throw b})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e,t={}){let i="/mezon.api.Mezon/GetSystemMessagesList",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.SystemMessagesList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}createSystemMessage(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateSystemMessage",l=new Map,c=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,i,a={}){let l="/mezon.api.Mezon/ListSdTopic",d=new Map,u=s.ListSdTopicRequest.encode(s.ListSdTopicRequest.fromPartial({clan_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.SdTopicList.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}createSdTopic(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateSdTopic",l=new Map,c=s.SdTopicRequest.encode(s.SdTopicRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.SdTopic.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteSystemMessage(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteSystemMessage",l=new Map,c=s.DeleteSystemMessage.encode(s.DeleteSystemMessage.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessageByClanId(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetSystemMessageByClanId",l=new Map,c=s.GetSystemMessage.encode(s.GetSystemMessage.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.SystemMessage.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateSystemMessage(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateSystemMessage",d=new Map,u=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(M(R({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,i,a,l,d,c,u={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListThreadDescs",n=new Map,f=s.ListThreadRequest.encode(s.ListThreadRequest.fromPartial({channel_id:t,limit:i,state:a,clan_id:l,thread_id:d,page:c})).finish(),g=this.buildFullUrl(this.basePath,o,n),y=p("POST",u,"");return y.body=f,e&&(y.headers.Authorization="Bearer "+e),Promise.race([m()(g,y).then(b=>h(this,null,function*(){if(b.status==204)return{};if(b.status>=200&&b.status<300){let A=yield b.arrayBuffer();return s.ChannelDescListNoPool.decode(new Uint8Array(A))}else throw b})),new Promise((b,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateCategory",d=new Map,u=s.UpdateCategoryDescRequest.encode(s.UpdateCategoryDescRequest.fromPartial(M(R({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateChannelPrivate(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateChannelPrivate",l=new Map,c=s.ChangeChannelPrivateRequest.encode(s.ChangeChannelPrivateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateUserProfileByClan(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateUserProfileByClan",d=new Map,u=s.UpdateClanProfileRequest.encode(s.UpdateClanProfileRequest.fromPartial(M(R({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}uploadOauthFile(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UploadOauthFile",l=new Map,c=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.UploadAttachment.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UploadAttachmentFile",l=new Map,c=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.UploadAttachment.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateUser(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateUser",l=new Map,c=s.UpdateUsersRequest.encode(s.UpdateUsersRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listUserClansByUserId(e,t={}){let i="/mezon.api.Mezon/ListUserClansByUserId",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.AllUserClans.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,i,a={}){let l="/mezon.api.Mezon/ListUserPermissionInChannel",d=new Map,u=s.UserPermissionInChannelListRequest.encode(s.UserPermissionInChannelListRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.UserPermissionInChannelListResponse.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e,t={}){let i="/mezon.api.Mezon/GetUserStatus",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.UserStatus.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}updateUserStatus(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateUserStatus",l=new Map,c=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}generateWebhook(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GenerateWebhook",l=new Map,c=s.WebhookCreateRequest.encode(s.WebhookCreateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.WebhookGenerateResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateWebhookById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateWebhookById",d=new Map,u=s.WebhookUpdateRequestById.encode(s.WebhookUpdateRequestById.fromPartial(M(R({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/ListWebhookByChannelId",d=new Map,u=s.WebhookListRequest.encode(s.WebhookListRequest.fromPartial({channel_id:t,clan_id:i||""})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.WebhookListResponse.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteWebhookById",d=new Map,u=s.WebhookDeleteRequestById.encode(s.WebhookDeleteRequestById.fromPartial(M(R({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,i){let a=e+t+"?";for(let[l,d]of i)d instanceof Array?a+=d.reduce((c,u)=>c+encodeURIComponent(l)+"="+encodeURIComponent(u)+"&",""):d!=null&&(a+=encodeURIComponent(l)+"="+encodeURIComponent(d)+"&");return a}editChannelCanvases(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/EditChannelCanvases",l=new Map,c=s.EditChannelCanvasRequest.encode(s.EditChannelCanvasRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.EditChannelCanvasResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,i,a,l={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/GetChannelCanvasDetail",c=new Map,o=s.ChannelCanvasDetailRequest.encode(s.ChannelCanvasDetailRequest.fromPartial({id:t,clan_id:i||"",channel_id:a||""})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.ChannelCanvasDetailResponse.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,i,a,l={}){if(t==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteChannelCanvas",c=new Map,o=s.DeleteChannelCanvasRequest.encode(s.DeleteChannelCanvasRequest.fromPartial({canvas_id:t,clan_id:i||"",channel_id:a||""})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/ListOnboarding",u=new Map,n=s.ListOnboardingRequest.encode(s.ListOnboardingRequest.fromPartial({clan_id:t,guide_type:i,limit:a,page:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),f=p("POST",d,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.ListOnboardingResponse.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}createOnboarding(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateOnboarding",l=new Map,c=s.CreateOnboardingRequest.encode(s.CreateOnboardingRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListOnboardingResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteOnboarding(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteOnboarding",d=new Map,u=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/GetOnboardingDetail",d=new Map,u=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:t,clan_id:i||""})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.OnboardingItem.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateOnboarding",d=new Map,u=s.UpdateOnboardingRequest.encode(s.UpdateOnboardingRequest.fromPartial(M(R({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}generateClanWebhook(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GenerateClanWebhook",l=new Map,c=s.GenerateClanWebhookRequest.encode(s.GenerateClanWebhookRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.GenerateClanWebhookResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listClanWebhook(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListClanWebhook",l=new Map,c=s.ListClanWebhookRequest.encode(s.ListClanWebhookRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListClanWebhookResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteClanWebhookById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteClanWebhookById",d=new Map,c={id:t,clan_id:i},o=s.ClanWebhookRequest.encode(s.ClanWebhookRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateClanWebhookById",d=new Map,c=M(R({},i),{id:t}),o=s.UpdateClanWebhookRequest.encode(s.UpdateClanWebhookRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t,i={}){let a="/mezon.api.Mezon/GetTopicDetail",l=new Map,d={topic_id:t},u=s.SdTopicDetailRequest.encode(s.SdTopicDetailRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.SdTopic.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListOnboardingStep",c=new Map,u={clan_id:t,limit:i,page:a},n=s.ListOnboardingStepRequest.encode(s.ListOnboardingStepRequest.fromPartial(u)).finish(),r=this.buildFullUrl(this.basePath,d,c),f=p("POST",l,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.ListOnboardingStepResponse.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateOnboardingStep",d=new Map,c=M(R({},i),{clan_id:t}),o=s.UpdateOnboardingStepRequest.encode(s.UpdateOnboardingStepRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}createRoomChannelApps(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateRoomChannelApps",l=new Map,c=s.CreateRoomChannelApps.encode(s.CreateRoomChannelApps.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.CreateRoomChannelApps.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}generateMeetToken(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GenerateMeetToken",l=new Map,c=s.GenerateMeetTokenRequest.encode(s.GenerateMeetTokenRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.GenerateMeetTokenResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,i,a={}){let l="/mezon.api.Mezon/GetMezonOauthClient",d=new Map,c={client_id:t,client_name:i},o=s.GetMezonOauthClientRequest.encode(s.GetMezonOauthClientRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.MezonOauthClient.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}updateMezonOauthClient(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateMezonOauthClient",l=new Map,c=s.MezonOauthClient.encode(s.MezonOauthClient.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.MezonOauthClient.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t,i={}){let a="/mezon.api.Mezon/GenerateHashChannelApps",l=new Map,d={app_id:t},u=s.GenerateHashChannelAppsRequest.encode(s.GenerateHashChannelAppsRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.GenerateHashChannelAppsResponse.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addUserEvent(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddUserEvent",l=new Map,c=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,i,a={}){let l="/mezon.api.Mezon/DeleteUserEvent",d=new Map,c={clan_id:t,event_id:i},o=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}updateRoleOrder(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateRoleOrder",l=new Map,c=s.UpdateRoleOrderRequest.encode(s.UpdateRoleOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}createExternalMezonMeet(e,t={}){let i="/mezon.api.Mezon/CreateExternalMezonMeet",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.GenerateMezonMeetResponse.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,i,a,l,d={}){if(i==null)throw new Error("'token' is a required parameter but is null or undefined.");let c="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(i))),u=new Map;u.set("display_name",a),u.set("is_guest",l);let o="",n=this.buildFullUrl(t,c,u),r=p("POST",d,o);return e&&(r.headers.Authorization="Bearer "+e),r.headers.Accept="application/x-protobuf",r.headers["Content-Type"]="application/json",Promise.race([m()(n,r).then(f=>h(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let g=yield f.arrayBuffer();return s.GenerateMeetTokenExternalResponse.decode(new Uint8Array(g))}else throw f})),new Promise((f,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}muteParticipantMezonMeet(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/MuteParticipantMezonMeet",l=new Map,c=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}removeParticipantMezonMeet(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/RemoveParticipantMezonMeet",l=new Map,c=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listChannelDetail(e,t,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListChannelDetail",l=new Map,d={channel_id:t},u=s.ListChannelDetailRequest.encode(s.ListChannelDetailRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.ChannelDescription.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateClanOrder(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateClanOrder",l=new Map,c=s.UpdateClanOrderRequest.encode(s.UpdateClanOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,i,a,l={}){if(a==null)throw new Error("'body' is a required parameter but is null or undefined.");let d="/v2/clan/discover",c=new Map,u="";u=JSON.stringify(a||{});let o=this.buildFullUrl(i,d,c),n=p("POST",l,u);return e&&(n.headers.Authorization="Basic "+(0,E.encode)(e+":"+t)),n.headers.Accept="application/x-protobuf",n.headers["Content-Type"]="application/json",Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.ListClanDiscover.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/DeleteQuickMenuAccess",n=new Map,r={id:t,clan_id:i,bot_id:a,menu_name:l,background:d,action_msg:c},g=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(r)).finish(),y=this.buildFullUrl(this.basePath,o,n),b=p("POST",u,"");return b.body=g,e&&(b.headers.Authorization="Bearer "+e),Promise.race([m()(y,b).then(A=>{if(A.status==204)return A;if(A.status>=200&&A.status<300)return A;throw A}),new Promise((A,P)=>setTimeout(P,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListQuickMenuAccess",c=new Map,u={bot_id:t,channel_id:i,menu_type:a},n=s.ListQuickMenuAccessRequest.encode(s.ListQuickMenuAccessRequest.fromPartial(u)).finish(),r=this.buildFullUrl(this.basePath,d,c),f=p("POST",l,"");return f.body=n,e&&(f.headers.Authorization="Bearer "+e),Promise.race([m()(r,f).then(g=>h(this,null,function*(){if(g.status==204)return{};if(g.status>=200&&g.status<300){let y=yield g.arrayBuffer();return s.QuickMenuAccessList.decode(new Uint8Array(y))}else throw g})),new Promise((g,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}addQuickMenuAccess(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddQuickMenuAccess",l=new Map,c=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}updateQuickMenuAccess(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateQuickMenuAccess",l=new Map,c=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t,i={}){let a="/mezon.api.Mezon/ListForSaleItems",l=new Map,d={page:t},u=s.ListForSaleItemsRequest.encode(s.ListForSaleItemsRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.ForSaleItemList.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}isFollower(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/IsFollower",l=new Map,c=s.IsFollowerRequest.encode(s.IsFollowerRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.IsFollowerResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}transferOwnership(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/TransferOwnership",l=new Map,c=s.TransferOwnershipRequest.encode(s.TransferOwnershipRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}updateUsername(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateUsername",l=new Map,c=s.UpdateUsernameRequest.encode(s.UpdateUsernameRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([m()(u,o).then(n=>h(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}isBanned(e,t,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/IsBanned",l=new Map,d={channel_id:t},u=s.IsBannedRequest.encode(s.IsBannedRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([m()(o,n).then(r=>h(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let f=yield r.arrayBuffer();return s.IsBannedResponse.decode(new Uint8Array(f))}else throw r})),new Promise((r,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,i,a={}){let l="/mezon.api.Mezon/ReportMessageAbuse",d=new Map,c={message_id:t,abuse_type:i},o=s.ReportMessageAbuseReqest.encode(s.ReportMessageAbuseReqest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}listLogedDevice(e,t={}){let i="/mezon.api.Mezon/ListLogedDevice",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([m()(l,d).then(c=>h(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.LogedDeviceList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}sendChannelMessage(e,t,i,a,l,d,c,u,o,n,r,f,g,y){let b="/mezon.api.Mezon/SendChannelMessage",A=new Map,v=s.ChannelMessageSend.encode(s.ChannelMessageSend.fromPartial({clan_id:t,channel_id:i,mode:a,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:f,code:g,topic_id:y})).finish(),S=this.buildFullUrl(this.basePath,b,A),q=p("POST",{},"");return q.body=v,e&&(q.headers.Authorization="Bearer "+e),Promise.race([m()(S,q).then(z=>h(this,null,function*(){if(z.status==204)return{};if(z.status>=200&&z.status<300){let G=yield z.arrayBuffer();return s.ChannelMessageSend.decode(new Uint8Array(G))}else throw z})),new Promise((z,G)=>setTimeout(()=>G(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,i,a,l,d,c,u,o,n,r,f){let g="/mezon.api.Mezon/UpdateChannelMessage",y=new Map,A=s.ChannelMessageUpdate.encode(s.ChannelMessageUpdate.fromPartial({clan_id:t,channel_id:i,message_id:d,mode:a,is_public:l,content:c,mentions:u,attachments:o,hide_editted:n,topic_id:r,is_update_msg_topic:f})).finish(),P=this.buildFullUrl(this.basePath,g,y),v=p("POST",{},"");return v.body=A,e&&(v.headers.Authorization="Bearer "+e),Promise.race([m()(P,v).then(S=>h(this,null,function*(){if(S.status==204)return{};if(S.status>=200&&S.status<300){let q=yield S.arrayBuffer();return s.ChannelMessageUpdate.decode(new Uint8Array(q))}else throw S})),new Promise((S,q)=>setTimeout(()=>q(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,i,a,l,d,c,u,o,n){let r="/mezon.api.Mezon/DeleteChannelMessage",f=new Map,y=s.ChannelMessageRemove.encode(s.ChannelMessageRemove.fromPartial({clan_id:t,channel_id:i,message_id:d,mode:a,is_public:l,has_attachment:c,mentions:o,references:n,topic_id:u})).finish(),b=this.buildFullUrl(this.basePath,r,f),A=p("POST",{},"");return A.body=y,e&&(A.headers.Authorization="Bearer "+e),Promise.race([m()(b,A).then(P=>h(this,null,function*(){if(P.status==204)return{};if(P.status>=200&&P.status<300){let v=yield P.arrayBuffer();return s.ChannelMessageRemove.decode(new Uint8Array(v))}else throw P})),new Promise((P,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,i,a,l,d,c={}){let u="/mezon.api.Mezon/UpdateMezonVoiceState",o=new Map,n={clan_id:t,channel_id:i,display_name:a,room_name:l,state:d},f=s.HandleParticipantMeetStateEvent.encode(s.HandleParticipantMeetStateEvent.fromPartial(n)).finish(),g=this.buildFullUrl(this.basePath,u,o),y=p("POST",c,"");return y.body=f,e&&(y.headers.Authorization="Bearer "+e),Promise.race([m()(g,y).then(b=>{if(b.status==204)return b;if(b.status>=200&&b.status<300)return b;throw b}),new Promise((b,A)=>setTimeout(A,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/MessageButtonClick",n=new Map,r={message_id:t,channel_id:i,button_id:a,sender_id:l,user_id:d,extra_data:c},g=s.MessageButtonClicked.encode(s.MessageButtonClicked.fromPartial(r)).finish(),y=this.buildFullUrl(this.basePath,o,n),b=p("POST",u,"");return b.body=g,e&&(b.headers.Authorization="Bearer "+e),Promise.race([m()(y,b).then(A=>{if(A.status==204)return A;if(A.status>=200&&A.status<300)return A;throw A}),new Promise((A,P)=>setTimeout(P,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/DropdownBoxSelected",n=new Map,r={message_id:t,channel_id:i,selectbox_id:a,sender_id:l,user_id:d,values:c},g=s.DropdownBoxSelected.encode(s.DropdownBoxSelected.fromPartial(r)).finish(),y=this.buildFullUrl(this.basePath,o,n),b=p("POST",u,"");return b.body=g,e&&(b.headers.Authorization="Bearer "+e),Promise.race([m()(y,b).then(A=>{if(A.status==204)return A;if(A.status>=200&&A.status<300)return A;throw A}),new Promise((A,P)=>setTimeout(P,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,i,a={}){let l="/mezon.api.Mezon/ActiveArchivedThread",d=new Map,c={clan_id:t,channel_id:i},o=s.ActiveArchivedThread.encode(s.ActiveArchivedThread.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([m()(n,r).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}};var Q=H(require("js-base64")),L=class _{constructor(e,t,i,a,l,d,c){this.created=i;this.api_url=a;this.ws_url=l;this.id_token=d;this.token=e,this.refresh_token=t,this.id_token=d,this.api_url=a,this.ws_url=l,this.created_at=Math.floor(new Date().getTime()/1e3),this.is_remember=c,this.update(e,t,c)}isexpired(e){return this.expires_at-e<=0}isrefreshexpired(e){return this.refresh_expires_at-e<=0}update(e,t,i){let a=e.split(".");if(a.length!=3)throw"jwt is not valid.";let l=JSON.parse(Q.atob(a[1])),d=Math.floor(parseInt(l.exp));if(t){let c=t.split(".");if(c.length!=3)throw"refresh jwt is not valid.";let u=JSON.parse(Q.atob(c[1])),o=Math.floor(parseInt(u.exp));this.refresh_expires_at=o,this.refresh_token=t,this.is_remember=i}this.token=e,this.expires_at=d,this.username=l.usn,this.user_id=l.uid,this.vars=l.vrs}static restore(e,t,i,a,l){return new _(e,t,!1,i,a,"",l)}};var ee=require("mezon-js-protobuf");function Ce(_){let e,t,i,a,l,d;try{e=w(_.channel_message.content)}catch(u){console.log("content is invalid",u)}try{t=F(_.channel_message.reactions)}catch(u){console.log("reactions is invalid",u)}try{i=x(_.channel_message.mentions)}catch(u){console.log("mentions is invalid",u)}try{a=T(_.channel_message.attachments)}catch(u){console.log("attachments is invalid",u)}try{l=W(_.channel_message.references)}catch(u){console.log("references is invalid",u)}try{d=_.channel_message.referenced_message}catch(u){console.log("referenced messages is invalid",u)}return{id:_.id||_.channel_message.message_id,avatar:_.channel_message.avatar,channel_id:_.channel_message.channel_id,mode:_.channel_message.mode,channel_label:_.channel_message.channel_label,clan_id:_.channel_message.clan_id,code:_.channel_message.code,message_id:_.channel_message.message_id,sender_id:_.channel_message.sender_id,update_time:_.channel_message.update_time,clan_logo:_.channel_message.clan_logo,category_name:_.channel_message.category_name,username:_.channel_message.username,clan_nick:_.channel_message.clan_nick,clan_avatar:_.channel_message.clan_avatar,display_name:_.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:i==null?void 0:i.mentions,attachments:a==null?void 0:a.attachments,referenced_message:d,references:l==null?void 0:l.refs,hide_editted:_.channel_message.hide_editted,is_public:_.channel_message.is_public,create_time_seconds:_.channel_message.create_time_seconds,update_time_seconds:_.channel_message.update_time_seconds,topic_id:_.channel_message.topic_id}}var X=!1,U={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},k=class k{constructor(e,t,i=!1,a=!1,l=new ee.WebSocketAdapterPb,d=k.DefaultSendTimeoutMs){this.host=e;this.port=t;this.useSSL=i;this.verbose=a;this.adapter=l;this.sendTimeoutMs=d;this.cIds={},this.nextCid=1,this._heartbeatTimeoutMs=k.DefaultHeartbeatTimeoutMs,this._connectionState=U.DISCONNECTED}generatecid(){let e=this.nextCid.toString();return++this.nextCid,e}isOpen(){return this._connectionState===U.CONNECTED}connect(e,t=!1,i="",a=k.DefaultConnectTimeoutMs,l){if(this._connectionState===U.CONNECTED)return Promise.resolve(e);if(this._connectionState===U.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=U.CONNECTING;let d=this.useSSL?"wss://":"ws://";this.adapter.connect(d,this.host,this.port,t,e.token,i,l),this.adapter.onClose=u=>{this._connectionState=U.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(u)},this.adapter.onMessage=u=>h(this,null,function*(){if(this.verbose&&window&&window.console&&console.log("Response: %o",JSON.stringify(u)),u.cid){let o=this.cIds[u.cid];if(!o){this.verbose&&window&&window.console&&console.error("No promise executor for message: %o",u);return}delete this.cIds[u.cid],u.error?o.reject(u.error):o.resolve(u)}else if(u.notifications)u.notifications.notifications.forEach(o=>{o.content=o.content?N(o.content):void 0,this.onnotification(o)});else if(u.voice_started_event)this.onvoicestarted(u.voice_started_event);else if(u.voice_ended_event)this.onvoiceended(u.voice_ended_event);else if(u.voice_joined_event)this.onvoicejoined(u.voice_joined_event);else if(u.voice_leaved_event)this.onvoiceleaved(u.voice_leaved_event);else if(u.channel_created_event)this.onchannelcreated(u.channel_created_event);else if(u.category_event)this.oncategoryevent(u.category_event);else if(u.role_event)this.onroleevent(u.role_event);else if(u.event_emoji)this.oneventemoji(u.event_emoji);else if(u.noti_user_channel)this.oneventnotiuserchannel(u.noti_user_channel);else if(u.webhook_event)this.oneventwebhook(u.webhook_event);else if(u.channel_deleted_event)this.onchanneldeleted(u.channel_deleted_event);else if(u.clan_deleted_event)this.onclandeleted(u.clan_deleted_event);else if(u.sticker_create_event)this.onstickercreated(u.sticker_create_event);else if(u.sticker_update_event)this.onstickerupdated(u.sticker_update_event);else if(u.sticker_delete_event)this.onstickerdeleted(u.sticker_delete_event);else if(u.channel_updated_event)this.onchannelupdated(u.channel_updated_event);else if(u.delete_account_event)this.ondeleteaccount(u.delete_account_event);else if(u.clan_profile_updated_event)this.onclanprofileupdated(u.clan_profile_updated_event);else if(u.clan_updated_event)this.onclanupdated(u.clan_updated_event);else if(u.last_seen_message_event)this.onlastseenupdated(u.last_seen_message_event);else if(u.status_presence_event)this.onstatuspresence(u.status_presence_event);else if(u.stream_presence_event)this.onstreampresence(u.stream_presence_event);else if(u.stream_data)this.onstreamdata(u.stream_data);else if(u.channel_message){let o=Ce(u);this.onchannelmessage(o)}else u.message_typing_event?this.onmessagetyping(u.message_typing_event):u.message_reaction_event?this.onmessagereaction(u.message_reaction_event):u.channel_presence_event?this.onchannelpresence(u.channel_presence_event):u.last_pin_message_event?this.onpinmessage(u.last_pin_message_event):u.custom_status_event?this.oncustomstatus(u.custom_status_event):u.canvas_event?this.oncanvasevent(u.canvas_event):u.user_channel_added_event?this.onuserchanneladded(u.user_channel_added_event):u.add_clan_user_event?this.onuserclanadded(u.add_clan_user_event):u.user_profile_updated_event?this.onuserprofileupdate(u.user_profile_updated_event):u.user_channel_removed_event?this.onuserchannelremoved(u.user_channel_removed_event):u.block_friend?this.onblockfriend(u.block_friend):u.un_block_friend?this.onunblockfriend(u.un_block_friend):u.add_friend?this.onaddfriend(u.add_friend):u.remove_friend?this.onremovefriend(u.remove_friend):u.user_clan_removed_event?this.onuserclanremoved(u.user_clan_removed_event):u.clan_event_created?this.oneventcreated(u.clan_event_created):u.give_coffee_event?this.oncoffeegiven(u.give_coffee_event):u.role_assign_event?this.onroleassign(u.role_assign_event):u.streaming_started_event?this.onstreamingchannelstarted(u.streaming_started_event):u.streaming_ended_event?this.onstreamingchannelended(u.streaming_ended_event):u.streaming_joined_event?this.onstreamingchanneljoined(u.streaming_joined_event):u.streaming_leaved_event?this.onstreamingchannelleaved(u.streaming_leaved_event):u.permission_set_event?this.onpermissionset(u.permission_set_event):u.permission_changed_event?this.onpermissionchanged(u.permission_changed_event):u.unmute_event?this.onunmuteevent(u.unmute_event):u.token_sent_event?this.ontokensent(u.token_sent_event):u.message_button_clicked?this.onmessagebuttonclicked(u.message_button_clicked):u.dropdown_box_selected?this.onmessagedropdownboxselected(u.dropdown_box_selected):u.mark_as_read?this.onmarkasread(u.mark_as_read):u.voice_reaction_send?this.onvoicereactionmessage(u.voice_reaction_send):u.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(u.webrtc_signaling_fwd):u.list_activity?this.onactivityupdated(u.list_activity):u.sd_topic_event?this.onsdtopicevent(u.sd_topic_event):u.channel_app_event?this.onchannelappevent(u.channel_app_event):u.user_status_event?this.onuserstatusevent(u.user_status_event):u.join_channel_app_data?this.onjoinchannelappevent(u.join_channel_app_data):u.unpin_message_event?this.onunpinmessageevent(u.unpin_message_event):u.quick_menu_event?this.onquickmenuevent(u.quick_menu_event):u.meet_participant_event?this.onmeetparticipantevent(u.meet_participant_event):u.transfer_ownership_event?this.ontransferownership(u.transfer_ownership_event):u.ban_user_event?this.onbanneduser(u.ban_user_event):u.allow_anonymous_event?this.onallowanonymousevent(u.allow_anonymous_event):this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",u)});let c=new Promise((u,o)=>{this.adapter.onOpen=n=>{this.verbose&&window&&window.console&&console.log(n);let r=X;X=!0,this.clearConnectTimeout(),this._connectionState=U.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,u(e),r&&this.onreconnect(n)},this.adapter.onError=n=>{this._connectionState=U.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(n),this._connectPromise=void 0,this.adapter.close(),o(n)},this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=U.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.close(),this._connectPromise=void 0,o("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},a)});return this._connectPromise=c,this._connectPromise}disconnect(e=!0){this._connectionState=U.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.isOpen()&&this.adapter.close(),e&&this.ondisconnect({})}setHeartbeatTimeoutMs(e){this._heartbeatTimeoutMs=e}getHeartbeatTimeoutMs(){return this._heartbeatTimeoutMs}onreconnect(e){this.verbose&&window&&window.console&&console.log(e)}ondisconnect(e){this.verbose&&window&&window.console&&console.log(e)}onerror(e){this._connectionState=U.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)}onstreampresence(e){this.verbose&&window&&window.console&&console.log(e)}onstreamdata(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)}onmeetparticipantevent(e){this.verbose&&window&&window.console&&console.log(e)}onallowanonymousevent(e){this.verbose&&window&&window.console&&console.log(e)}send(e,t=k.DefaultSendTimeoutMs){let i=e;return new Promise((a,l)=>{var d,c;if(!this.adapter.isOpen())l("Socket connection has not been established yet.");else{i.channel_message_send?i.channel_message_send.content=JSON.stringify(i.channel_message_send.content):i.channel_message_update?i.channel_message_update.content=JSON.stringify(i.channel_message_update.content):i.ephemeral_message_send?i.ephemeral_message_send.message.content=JSON.stringify((d=i.ephemeral_message_send.message)==null?void 0:d.content):i.quick_menu_event&&(i.quick_menu_event.message.content=JSON.stringify((c=i.quick_menu_event.message)==null?void 0:c.content));let u=this.generatecid();this.cIds[u]={resolve:a,reject:l},t!==1/0&&t>0&&setTimeout(()=>{l("The socket timed out while waiting for a response.")},t),i.cid=u,this.adapter.send(i)}})}followUsers(e){return h(this,null,function*(){return(yield this.send({status_follow:{user_ids:e}})).status})}joinClanChat(e){return h(this,null,function*(){return(yield this.send({clan_join:{clan_id:e}})).clan_join})}follower(){return h(this,null,function*(){return(yield this.send({follow_event:{}})).follow_event})}joinChat(e,t,i,a){return h(this,null,function*(){return(yield this.send({channel_join:{clan_id:e,channel_id:t,channel_type:i,is_public:a}})).channel})}leaveChat(e,t,i,a){return this.send({channel_leave:{clan_id:e,channel_id:t,channel_type:i,is_public:a}})}removeChatMessage(e,t,i,a,l,d,c,u,o){return h(this,null,function*(){return(yield this.send({channel_message_remove:{clan_id:e,channel_id:t,mode:i,message_id:l,is_public:a,has_attachment:d,topic_id:c,mentions:u,references:o}})).channel_message_ack})}rpc(e,t,i){return h(this,null,function*(){return(yield this.send({rpc:{id:e,payload:t,http_key:i}})).rpc})}unfollowUsers(e){return this.send({status_unfollow:{user_ids:e}})}updateChatMessage(e,t,i,a,l,d,c,u,o,n,r){return h(this,null,function*(){return(yield this.send({channel_message_update:{clan_id:e,channel_id:t,message_id:l,content:d,mentions:c,attachments:u,mode:i,is_public:a,hide_editted:o,topic_id:n,is_update_msg_topic:r}})).channel_message_ack})}updateStatus(e){return this.send({status_update:{status:e}})}writeQuickMenuEvent(e,t,i,a,l,d,c,u,o,n,r,f,g,y){return h(this,null,function*(){return(yield this.send({quick_menu_event:{menu_name:e,message:{clan_id:t,channel_id:i,mode:a,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:f,code:g,topic_id:y}}})).ephemeral_message_send})}writeEphemeralMessage(e,t,i,a,l,d,c,u,o,n,r,f,g,y,b){return h(this,null,function*(){return(yield this.send({ephemeral_message_send:{receiver_id:e,message:{clan_id:t,channel_id:i,mode:a,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:f,code:g,topic_id:y,id:b}}})).ephemeral_message_send})}writeChatMessage(e,t,i,a,l,d,c,u,o,n,r,f,g){return h(this,null,function*(){return(yield this.send({channel_message_send:{clan_id:e,channel_id:t,mode:i,is_public:a,content:l,mentions:d,attachments:c,references:u,anonymous_message:o,mention_everyone:n,avatar:r,code:f,topic_id:g}},1/0)).channel_message_ack})}writeMessageReaction(e,t,i,a,l,d,c,u,o,n,r,f,g,y){return h(this,null,function*(){return(yield this.send({message_reaction_event:{id:e,clan_id:t,channel_id:i,mode:a,is_public:l,message_id:d,emoji_id:c,emoji:u,count:o,message_sender_id:n,action:r,topic_id:f,emoji_recent_id:g,sender_name:y}})).message_reaction_event})}writeMessageTyping(e,t,i,a,l,d){return h(this,null,function*(){return(yield this.send({message_typing_event:{clan_id:e,channel_id:t,mode:i,is_public:a,sender_display_name:l,topic_id:d}})).message_typing_event})}writeLastSeenMessage(e,t,i,a,l,d){return h(this,null,function*(){return(yield this.send({last_seen_message_event:{clan_id:e,channel_id:t,mode:i,message_id:a,timestamp_seconds:l,badge_count:d}})).last_seen_message_event})}writeLastPinMessage(e,t,i,a,l,d,c,u,o,n,r,f,g){return h(this,null,function*(){return(yield this.send({last_pin_message_event:{clan_id:e,channel_id:t,mode:i,is_public:a,message_id:l,timestamp_seconds:d,operation:c,message_sender_avatar:u,message_sender_id:o,message_sender_username:n,message_content:r,message_attachment:f,message_created_time:g}})).last_pin_message_event})}writeCustomStatus(e,t,i,a){return h(this,null,function*(){return(yield this.send({custom_status_event:{clan_id:e,status:t,time_reset:i,no_clear:a}})).custom_status_event})}checkDuplicateName(e,t,i,a){return h(this,null,function*(){return(yield this.send({check_name_existed_event:{name:e,condition_id:t,type:i,clan_id:a}})).check_name_existed_event})}writeVoiceReaction(e,t){return h(this,null,function*(){return(yield this.send({voice_reaction_send:{emojis:e,channel_id:t}})).voice_reaction_send})}forwardWebrtcSignaling(e,t,i,a,l){return h(this,null,function*(){return(yield this.send({webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:i,channel_id:a,caller_id:l}})).webrtc_signaling_fwd})}makeCallPush(e,t,i,a){return h(this,null,function*(){return(yield this.send({incoming_call_push:{receiver_id:e,json_data:t,channel_id:i,caller_id:a}})).incoming_call_push})}writeChannelAppEvent(e,t,i){return h(this,null,function*(){return(yield this.send({channel_app_event:{clan_id:e,channel_id:t,action:i}})).channel_app_event})}listDataSocket(e){return h(this,null,function*(){return(yield this.send({list_data_socket:e})).list_data_socket})}pingPong(){return h(this,null,function*(){if(!this.isOpen()){this._connectionState=U.DISCONNECTED,this.stopHeartbeatLoop();return}try{yield this.send({ping:{}},this._heartbeatTimeoutMs)}catch(e){this._connectionState=U.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.isOpen()&&(window&&window.console&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this.adapter.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)}};k.DefaultHeartbeatTimeoutMs=1e4,k.DefaultSendTimeoutMs=1e4,k.DefaultConnectTimeoutMs=3e4;var B=k;var te=require("mezon-js-protobuf");var ve="127.0.0.1",Me="7350",Se="defaultkey",Ue=3e4,ne=(o=>(o[o.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",o[o.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",o[o.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",o[o.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",o[o.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",o[o.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",o[o.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",o[o.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",o[o.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",o))(ne||{}),ie=(l=>(l[l.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",l[l.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",l[l.STREAM_MODE_DM=4]="STREAM_MODE_DM",l[l.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",l[l.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",l))(ie||{}),re=(i=>(i[i.ALL_MESSAGE=1]="ALL_MESSAGE",i[i.MENTION_MESSAGE=2]="MENTION_MESSAGE",i[i.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",i))(re||{}),se=(o=>(o[o.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",o[o.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",o[o.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",o[o.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",o[o.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",o[o.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",o[o.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",o[o.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",o[o.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",o))(se||{}),K=class{constructor(e=Se,t=ve,i=Me,a=!1,l=Ue,d=!0){this.serverkey=e;this.timeout=l;this.autoRefreshSession=d;this.refreshTokenPromise=null;this.host=t,this.port=i,this.useSSL=a;let u=`${a?"https://":"http://"}${t}:${i}`;this.apiClient=new j(e,l,u)}onRefreshSession(e){console.log(`Token refresh occurred. Token: ${e.token}`)}isexpired(e){return e.isexpired(Date.now()/1e3)}authenticateMezon(e,t,i,a,l={},d={}){let c={token:e,vars:l};return this.apiClient.authenticateMezon(this.serverkey,"",c,t,i,a,d).then(u=>new L(u.token||"",u.refresh_token||"",u.created||!1,u.api_url||"",u.ws_url||"",u.id_token||"",u.is_remember||!1))}authenticateSMSOTPRequest(e,t,i){let a={username:t,account:{phoneno:e,vars:i}};return this.apiClient.AuthenticateSMSOTPRequest(this.serverkey,"",a,t).then(l=>Promise.resolve(l))}authenticateEmailOTPRequest(e,t,i){let a={username:t,account:{email:e,vars:i}};return this.apiClient.AuthenticateEmailOTPRequest(this.serverkey,"",a,t).then(l=>Promise.resolve(l))}confirmAuthenticateOTP(e){return h(this,null,function*(){return this.apiClient.confirmAuthenticateOTP(this.serverkey,"",e).then(t=>new L(t.token||"",t.refresh_token||"",t.created||!1,t.api_url||"",t.ws_url||"",t.id_token||"",t.is_remember||!1))})}authenticateEmail(e,t,i,a){let l={username:i,account:{email:e,password:t,vars:a}};return this.apiClient.authenticateEmail(this.serverkey,"",l,i).then(d=>new L(d.token||"",d.refresh_token||"",d.created||!1,d.api_url||"",d.ws_url||"",d.id_token||"",d.is_remember||!1))}setBasePath(e,t,i){this.host=e,this.port=t,this.useSSL=i;let l=`${i?"https://":"http://"}${e}:${t}`;return this.apiClient.setBasePath(l)}addChannelUsers(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addChannelUsers(e.token,t,i).then(a=>a!==void 0)})}addFriends(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addFriends(e.token,t,i)})}blockFriends(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.blockFriends(e.token,t,i).then(a=>Promise.resolve(a!=null))})}unblockFriends(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.unblockFriends(e.token,t,i).then(a=>Promise.resolve(a!=null))})}uploadOauthFile(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.uploadOauthFile(e.token,t)})}uploadAttachmentFile(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.uploadAttachmentFile(e.token,t)})}createChannelDesc(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createChannelDesc(e.token,t).then(i=>Promise.resolve(i))})}createClanDesc(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createClanDesc(e.token,t).then(i=>Promise.resolve(i))})}createCategoryDesc(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createCategoryDesc(e.token,t).then(i=>Promise.resolve(i))})}createRole(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createRole(e.token,t).then(i=>Promise.resolve(i))})}createEvent(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createEvent(e.token,t).then(i=>Promise.resolve(i))})}addRolesChannelDesc(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addRolesChannelDesc(e.token,t).then(i=>i!==void 0)})}deleteRoleChannelDesc(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteRoleChannelDesc(e.token,t).then(i=>i!==void 0)})}deleteApp(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteApp(e.token,t).then(i=>i!==void 0)})}createSocket(e=!1,t,i,a=!1,l=new te.WebSocketAdapterPb,d=B.DefaultSendTimeoutMs){return new B(t,i,e,a,l,d)}deleteFriends(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteFriends(e.token,t,i).then(a=>a!==void 0)})}deleteChannelDesc(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteChannelDesc(e.token,t,i).then(a=>a!==void 0)})}deleteClanDesc(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteClanDesc(e.token,t).then(i=>i!==void 0)})}deleteCategoryDesc(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteCategoryDesc(e.token,t,i,a).then(l=>l!==void 0)})}deleteNotifications(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteNotifications(e.token,t,i).then(a=>Promise.resolve(a!=null))})}deleteRole(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteRole(e.token,t,"0",i,a).then(l=>l!==void 0)})}deleteEvent(e,t,i,a,l,d){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteEvent(e.token,t,i,a,l,d).then(c=>c!==void 0)})}updateEventUser(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateEventUser(e.token,t).then(i=>i!==void 0)})}emitEvent(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.event(e.token,t).then(i=>Promise.resolve(i!=null))})}getAccount(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getAccount(e.token)})}removeClanUsers(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.removeClanUsers(e.token,t,i).then(a=>Promise.resolve(a!=null))})}listBannedUsers(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listBannedUsers(e.token,t,i).then(a=>Promise.resolve(a))})}unbanClanUsers(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.unbanClanUsers(e.token,t,i,a).then(l=>Promise.resolve(l!=null))})}banClanUsers(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.banClanUsers(e.token,t,i,a,l).then(d=>Promise.resolve(d!=null))})}removeChannelUsers(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.removeChannelUsers(e.token,t,i).then(a=>Promise.resolve(a!=null))})}listChannelMessages(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelMessages(e.token,t,i,a,l,d,c).then(u=>{let o={messages:[],last_seen_message:u.last_seen_message,last_sent_message:u.last_sent_message};return u.messages==null||u.messages.forEach(n=>{let r,f,g,y,b;try{r=w(n.content)}catch(A){console.log("error parse content",A)}try{let A=F(n.reactions);f=(A==null?void 0:A.reactions)||A||w(n.reactions||"[]")}catch(A){f=w(n.reactions||"[]")}try{let A=x(n.mentions);g=(A==null?void 0:A.mentions)||A||w(n.mentions||"[]")}catch(A){g=w(n.mentions||"[]")}try{let A=T(n.attachments);y=(A==null?void 0:A.attachments)||A||w(n.attachments||"[]")}catch(A){y=w(n.attachments||"[]")}try{let A=W(n.references);b=(A==null?void 0:A.refs)||A||w(n.references||"[]")}catch(A){b=w(n.references||"[]")}o.messages.push({channel_id:n.channel_id,code:n.code?Number(n.code):0,id:n.message_id||"",sender_id:n.sender_id,username:n.username,display_name:n.display_name,avatar:n.avatar,content:r,channel_label:n.channel_label,clan_logo:n.clan_logo,category_name:n.category_name,clan_nick:n.clan_nick,clan_avatar:n.clan_avatar,attachments:y,mentions:g,reactions:f,references:b,clan_id:n.clan_id,create_time_seconds:n.create_time_seconds,update_time_seconds:n.update_time_seconds,hide_editted:n.hide_editted})}),Promise.resolve(o)})})}listChannelVoiceUsers(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelVoiceUsers(e.token,t,i).then(a=>{let l={voice_channel_users:[]};return a.voice_channel_users==null||a.voice_channel_users.forEach(d=>{l.voice_channel_users.push({id:d.id,channel_id:d.channel_id,user_ids:d.user_ids,participant:d.participant})}),Promise.resolve(l)})})}listChannelUsers(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelUsers(e.token,t,i,a,d,l,c).then(u=>{let o={channel_users:[],cursor:u.cursor,channel_id:u.channel_id};return u.channel_users==null||u.channel_users.forEach(n=>{o.channel_users.push({user_id:n.user_id,role_id:n.role_id,thread_id:n.thread_id,clan_avatar:n.clan_avatar,clan_nick:n.clan_nick,id:n.id,clan_id:n.clan_id,added_by:n.added_by,is_banned:n.is_banned})}),Promise.resolve(o)})})}listChannelAttachments(e,t,i,a,l,d,c,u){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelAttachment(e.token,i,t,a,d,l,c,u).then(o=>{let n={attachments:[]};return o.attachments==null||o.attachments.forEach(r=>{n.attachments.push({filename:r.filename,filesize:r.filesize,filetype:r.filetype,id:r.id,uploader:r.uploader,url:r.url,message_id:r.message_id,create_time_seconds:r.create_time_seconds,width:r.width,height:r.height})}),Promise.resolve(n)})})}listClanUsers(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listClanUsers(e.token,t).then(i=>{let a={clan_users:[],cursor:i.cursor,clan_id:i.clan_id};return i.clan_users==null||i.clan_users.forEach(l=>{var d;a.clan_users.push({user:{avatar_url:l.user.avatar_url,create_time_seconds:l.user.create_time_seconds,display_name:l.user.display_name,edge_count:l.user.edge_count?Number(l.user.edge_count):0,id:l.user.id,lang_tag:l.user.lang_tag,location:l.user.location,online:l.user.online,is_mobile:(d=l.user)==null?void 0:d.is_mobile,timezone:l.user.timezone,update_time:l.user.update_time,username:l.user.username,user_status:l.user.user_status,status:l.user.status,about_me:l.user.about_me,mezon_id:l.user.mezon_id,list_nick_names:l.user.list_nick_names,phone_number:l.user.phone_number},role_id:l.role_id,clan_nick:l.clan_nick,clan_avatar:l.clan_avatar})}),Promise.resolve(a)})})}listChannelDetail(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelDetail(e.token,t).then(i=>Promise.resolve(i))})}listChannelDescs(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelDescs(e.token,t,i,a,l,d,c).then(u=>{let o={channeldesc:[],next_cursor:u.next_cursor,prev_cursor:u.prev_cursor,cacheable_cursor:u.cacheable_cursor};return u.channeldesc==null||(o.channeldesc=u.channeldesc),Promise.resolve(o)})})}listClanUnreadMsgIndicator(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listClanUnreadMsgIndicator(e.token,t).then(i=>Promise.resolve(i))})}listClanDescs(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listClanDescs(e.token,t,i,a).then(l=>{let d={clandesc:[]};return l.clandesc==null||(d.clandesc=l.clandesc),Promise.resolve(d)})})}listCategoryDescs(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listCategoryDescs(e.token,t,i,a).then(l=>{let d={categorydesc:[]};return l.categorydesc==null||(d.categorydesc=l.categorydesc),Promise.resolve(d)})})}listEvents(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listEvents(e.token,t).then(i=>Promise.resolve(i))})}getListPermission(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getListPermission(e.token).then(t=>Promise.resolve(t))})}listRolePermissions(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listRolePermissions(e.token,t).then(i=>Promise.resolve(i))})}listRoleUsers(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listRoleUsers(e.token,t,i,a).then(l=>Promise.resolve(l))})}registFCMDeviceToken(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.registFCMDeviceToken(e.token,t,i,a,l).then(d=>Promise.resolve(d))})}getUserProfileOnClan(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getUserProfileOnClan(e.token,t).then(i=>Promise.resolve(i))})}closeDirectMess(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.closeDirectMess(e.token,t).then(i=>i!==void 0)})}openDirectMess(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.openDirectMess(e.token,t).then(i=>i!==void 0)})}confirmLinkMezonOTP(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.confirmLinkMezonOTP(e.token,t)})}linkSMS(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.linkSMS(e.token,t).then(i=>Promise.resolve(i))})}linkEmail(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.linkEmail(e.token,t).then(i=>Promise.resolve(i))})}listFriends(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listFriends(e.token,i,t,a).then(l=>{let d={friends:[],cursor:l.cursor};return l.friends==null||l.friends.forEach(c=>{var u;d.friends.push({user:{avatar_url:c.user.avatar_url,create_time_seconds:c.user.create_time_seconds,display_name:c.user.display_name,edge_count:c.user.edge_count?Number(c.user.edge_count):0,id:c.user.id,lang_tag:c.user.lang_tag,location:c.user.location,online:c.user.online,timezone:c.user.timezone,update_time:c.user.update_time,username:c.user.username,is_mobile:(u=c.user)==null?void 0:u.is_mobile,user_status:c.user.user_status,status:c.user.status,mezon_id:c.user.mezon_id,list_nick_names:c.user.list_nick_names,phone_number:c.user.phone_number,about_me:c.user.about_me},state:c.state,source_id:c.source_id})}),Promise.resolve(d)})})}listNotifications(e,t,i,a,l,d){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listNotifications(e.token,i,t,a,l,d).then(c=>{let u={cacheable_cursor:c.cacheable_cursor,notifications:[]};return c.notifications==null||c.notifications.forEach(o=>{u.notifications.push({id:o.id,subject:o.subject,content:o.content?N(o.content):void 0,code:o.code?Number(o.code):0,sender_id:o.sender_id,create_time_seconds:o.create_time_seconds,persistent:o.persistent,category:o.category})}),Promise.resolve(u)})})}sessionLogout(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.sessionLogout(e.token,{refresh_token:i,token:t,device_id:a,platform:l}).then(d=>d!==void 0)})}sessionRefresh(i){return h(this,arguments,function*(e,t={}){return e?(e.created&&e.expires_at-e.created_at<70&&console.warn("Session lifetime too short, please set '--session.token_expiry_sec' option. See the documentation for more info: https://mezon.vn/docs/mezon/getting-started/configuration/#session"),e.created&&e.refresh_expires_at-e.created_at<3700&&console.warn("Session refresh lifetime too short, please set '--session.refresh_token_expiry_sec' option. See the documentation for more info: https://mezon.vn/docs/mezon/getting-started/configuration/#session"),this.refreshTokenPromise?this.refreshTokenPromise:(this.refreshTokenPromise=h(this,null,function*(){try{let a=yield this.apiClient.sessionRefresh(this.serverkey,"",{token:e.refresh_token,vars:t,is_remember:e.is_remember});return e.update(a.token,a.refresh_token,a.is_remember||!1),this.onRefreshSession(a),e}catch(a){throw console.error("Session refresh failed:",a),a}finally{this.refreshTokenPromise=null}}),this.refreshTokenPromise)):(console.error("Cannot refresh a null session."),e)})}unlinkEmail(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.unlinkEmail(e.token,t).then(i=>i!==void 0)})}updateUsername(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateUsername(e.token,t).then(i=>Promise.resolve(i))})}updateAccount(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateAccount(e.token,t).then(i=>i!==void 0)})}updateChannelDesc(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateChannelDesc(e.token,t,i).then(a=>a!==void 0)})}updateClanDesc(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanDesc(e.token,t,i).then(a=>a!==void 0)})}updateCategory(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateCategory(e.token,t,i).then(a=>a!==void 0)})}updateUserProfileByClan(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateUserProfileByClan(e.token,t,i).then(a=>a!==void 0)})}updateRole(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateRole(e.token,t,i).then(a=>a!==void 0)})}updateEvent(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateEvent(e.token,t,i).then(a=>a!==void 0)})}updateApp(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateApp(e.token,t,i).then(a=>Promise.resolve(a))})}createLinkInviteUser(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createLinkInviteUser(e.token,t).then(i=>Promise.resolve(i))})}getLinkInvite(e){return h(this,null,function*(){return this.apiClient.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getRoleOfUserInTheClan(e.token,t).then(i=>Promise.resolve(i))})}inviteUser(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.inviteUser(e.token,t).then(i=>Promise.resolve(i))})}setNotificationClan(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setNotificationClanSetting(e.token,t).then(i=>i!==void 0)})}setNotificationChannel(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setNotificationChannelSetting(e.token,t).then(i=>i!==void 0)})}setMuteCategory(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setMuteCategory(e.token,t).then(i=>i!==void 0)})}setMuteChannel(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setMuteChannel(e.token,t).then(i=>i!==void 0)})}updateChannelPrivate(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateChannelPrivate(e.token,t).then(i=>i!==void 0)})}setNotificationCategory(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setNotificationCategorySetting(e.token,t).then(i=>i!==void 0)})}deleteNotificationCategory(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteNotificationCategorySetting(e.token,t).then(i=>i!==void 0)})}deleteNotificationChannel(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteNotificationChannel(e.token,t).then(i=>i!==void 0)})}setNotificationReactMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setNotificationReactMessage(e.token,{channel_id:t}).then(i=>i!==void 0)})}deleteNotiReactMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteNotiReactMessage(e.token,t).then(i=>i!==void 0)})}searchMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.searchMessage(e.token,t).then(i=>Promise.resolve(i))})}createMessage2Inbox(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createMessage2Inbox(e.token,t).then(i=>Promise.resolve(i))})}createPinMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createPinMessage(e.token,t).then(i=>Promise.resolve(i))})}pinMessagesList(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getPinMessagesList(e.token,t,i,a).then(l=>{let d={pin_messages_list:[]};return l.pin_messages_list==null||l.pin_messages_list.forEach(c=>{d.pin_messages_list.push({id:c.id,avatar:c.avatar,channel_id:c.channel_id,content:c.content,create_time_seconds:c.create_time_seconds,message_id:c.message_id,sender_id:c.sender_id,username:c.username,attachment:c.attachment})}),Promise.resolve(d)})})}deletePinMessage(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deletePinMessage(e.token,t,i,a,l).then(d=>d!==void 0)})}createClanEmoji(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createClanEmoji(e.token,t).then(i=>i!==void 0)})}updateClanEmojiById(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanEmojiById(e.token,t,i).then(a=>a!==void 0)})}deleteByIdClanEmoji(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteClanEmojiById(e.token,t,i,a).then(l=>l!==void 0)})}generateWebhookLink(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.generateWebhook(e.token,t).then(i=>Promise.resolve(i))})}listWebhookByChannelId(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listWebhookByChannelId(e.token,t,i).then(a=>Promise.resolve(a))})}updateWebhookById(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateWebhookById(e.token,t,i).then(a=>a!==void 0)})}deleteWebhookById(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteWebhookById(e.token,t,i).then(a=>a!==void 0)})}addClanSticker(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addClanSticker(e.token,t).then(i=>i!==void 0)})}deleteClanStickerById(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteClanStickerById(e.token,t,i,a).then(l=>l!==void 0)})}updateClanStickerById(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanStickerById(e.token,t,i).then(a=>a!==void 0)})}changeChannelCategory(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.changeChannelCategory(e.token,t,i).then(a=>a!==void 0)})}setRoleChannelPermission(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setRoleChannelPermission(e.token,t).then(i=>i!==void 0)})}addApp(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addApp(e.token,t).then(i=>Promise.resolve(i))})}getApp(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getApp(e.token,t).then(i=>Promise.resolve(i))})}listApps(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listApps(e.token).then(t=>Promise.resolve(t))})}addAppToClan(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addAppToClan(e.token,t,i).then(a=>a!==void 0)})}getSystemMessagesList(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getSystemMessagesList(e.token).then(t=>Promise.resolve(t))})}getSystemMessageByClanId(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getSystemMessageByClanId(e.token,t).then(i=>Promise.resolve(i))})}createSystemMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createSystemMessage(e.token,t).then(i=>Promise.resolve(i))})}updateSystemMessage(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateSystemMessage(e.token,t,i).then(a=>Promise.resolve(a))})}deleteSystemMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteSystemMessage(e.token,t).then(i=>Promise.resolve(i))})}updateCategoryOrder(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateCategoryOrder(e.token,t).then(i=>Promise.resolve(i))})}givecoffee(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.giveMeACoffee(e.token,t).then(i=>i!==void 0)})}sendToken(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.sendToken(e.token,t).then(i=>i!==void 0)})}listStreamingChannelUsers(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listStreamingChannelUsers(e.token,t,i,a,d,l,c).then(u=>{let o={streaming_channel_users:[]};return u.streaming_channel_users==null||u.streaming_channel_users.forEach(n=>{o.streaming_channel_users.push({id:n.id,channel_id:n.channel_id,user_id:n.user_id,participant:n.participant})}),Promise.resolve(o)})})}registerStreamingChannel(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.registerStreamingChannel(e.token,t).then(i=>i!==void 0)})}listChannelApps(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelApps(e.token,t).then(i=>{let a={channel_apps:[]};return i.channel_apps==null||i.channel_apps.forEach(l=>{a.channel_apps.push({id:l.id,channel_id:l.channel_id,app_id:l.app_id,clan_id:l.clan_id,app_url:l.app_url,app_name:l.app_name,app_logo:l.app_logo})}),Promise.resolve(a)})})}getChannelCategoryNotiSettingsList(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getChannelCategoryNotiSettingsList(e.token,t).then(i=>Promise.resolve(i))})}getNotificationCategory(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getNotificationCategory(e.token,t).then(i=>Promise.resolve(i))})}getNotificationChannel(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getNotificationChannel(e.token,t).then(i=>Promise.resolve(i))})}getNotificationClan(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getNotificationClan(e.token,t).then(i=>Promise.resolve(i))})}getNotificationReactMessage(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getNotificationReactMessage(e.token,t).then(i=>Promise.resolve(i))})}listChannelByUserId(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelByUserId(e.token).then(t=>Promise.resolve(t))})}listChannelUsersUC(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelUsersUC(e.token,t,i).then(a=>Promise.resolve(a))})}getListEmojisByUserId(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getListEmojisByUserId(e.token).then(t=>Promise.resolve(t))})}emojiRecentList(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.emojiRecentList(e.token).then(t=>Promise.resolve(t))})}getListStickersByUserId(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getListStickersByUserId(e.token).then(t=>Promise.resolve(t))})}listUserClansByUserId(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listUserClansByUserId(e.token).then(t=>Promise.resolve(t))})}listRoles(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listRoles(e.token,t,i,a,l).then(d=>{let c={clan_id:t,roles:d.roles};return Promise.resolve(c)})})}listUserPermissionInChannel(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listUserPermissionInChannel(e.token,t,i).then(a=>{let l={clan_id:t,channel_id:i,permissions:a.permissions};return Promise.resolve(l)})})}getPermissionByRoleIdChannelId(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getPermissionByRoleIdChannelId(e.token,t,i,a).then(l=>{let d={role_id:t,channel_id:i,permission_role_channel:l.permission_role_channel,user_id:a};return Promise.resolve(d)})})}markAsRead(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.markAsRead(e.token,t).then(i=>Promise.resolve(i))})}listThreadDescs(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listThreadDescs(e.token,t,i,a,l,d,c).then(u=>{let o={channeldesc:[]};return u.channeldesc==null||(o.channeldesc=u.channeldesc),Promise.resolve(o)})})}leaveThread(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.leaveThread(e.token,t,i).then(a=>Promise.resolve(a))})}getChannelSettingInClan(e,t,i,a,l,d,c,u,o,n,r){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelSetting(e.token,t,i,a,l,d,c,u,o,n,r).then(f=>Promise.resolve(f))})}getChannelCanvasList(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getChannelCanvasList(e.token,t,i,a,l).then(d=>{let c={channel_canvases:[]};return d.channel_canvases==null||(c.clan_id=d.clan_id,c.channel_id=d.channel_id,c.channel_canvases=d.channel_canvases,c.count=d.count),Promise.resolve(c)})})}getChannelCanvasDetail(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getChannelCanvasDetail(e.token,t,i,a).then(l=>Promise.resolve(l))})}editChannelCanvases(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.editChannelCanvases(e.token,t).then(i=>Promise.resolve(i))})}deleteChannelCanvas(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteChannelCanvas(e.token,t,i,a).then(l=>l!==void 0)})}addFavoriteChannel(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addChannelFavorite(e.token,{channel_id:t,clan_id:i}).then(a=>a)})}removeFavoriteChannel(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.removeChannelFavorite(e.token,t,i).then(a=>a)})}getListFavoriteChannel(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getListFavoriteChannel(e.token,t).then(i=>i)})}listActivity(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listActivity(e.token).then(t=>t)})}createActiviy(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createActiviy(e.token,t).then(i=>i)})}createQRLogin(e){return h(this,null,function*(){let t=yield this.apiClient.createQRLogin(this.serverkey,"",e);return{login_id:t.login_id,create_time_second:t.create_time_second}})}checkLoginRequest(e){return h(this,null,function*(){let t=yield this.apiClient.checkLoginRequest(this.serverkey,"",e);return t!=null&&t.token?new L(t.token||"",t.refresh_token||"",t.created||!1,t.api_url||"",t.ws_url||"",t.id_token||"",t.is_remember||!1):null})}confirmLogin(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.confirmLogin(e.token,t,i).then(a=>a)})}getChanEncryptionMethod(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getChanEncryptionMethod(e.token,t).then(i=>i)})}setChanEncryptionMethod(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setChanEncryptionMethod(e.token,t,{method:i}).then(a=>a)})}getPubKeys(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getPubKeys(e.token,t).then(i=>i)})}pushPubKey(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.pushPubKey(e.token,{PK:t}).then(i=>i)})}getKeyServer(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getKeyServer(e.token).then(t=>t)})}listAuditLog(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listAuditLog(e.token,t,i,a,l).then(d=>d)})}listOnboarding(e,t,i,a,l){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listOnboarding(e.token,t,i,a,l).then(d=>d)})}getOnboardingDetail(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getOnboardingDetail(e.token,t,i).then(a=>Promise.resolve(a))})}createOnboarding(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createOnboarding(e.token,t).then(i=>i)})}updateOnboarding(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateOnboarding(e.token,t,i).then(a=>a!==void 0)})}deleteOnboarding(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteOnboarding(e.token,t,i).then(a=>a!==void 0)})}generateClanWebhook(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.generateClanWebhook(e.token,t).then(i=>Promise.resolve(i))})}listClanWebhook(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listClanWebhook(e.token,t).then(i=>Promise.resolve(i))})}deleteClanWebhookById(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteClanWebhookById(e.token,t,i).then(a=>a!==void 0)})}updateClanWebhookById(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanWebhookById(e.token,t,i).then(a=>a!==void 0)})}listOnboardingStep(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listOnboardingStep(e.token,t,i,a).then(l=>Promise.resolve(l))})}updateOnboardingStepByClanId(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateOnboardingStepByClanId(e.token,t,i).then(a=>a!==void 0)})}updateUserStatus(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateUserStatus(e.token,t).then(i=>i!==void 0)})}getUserStatus(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getUserStatus(e.token).then(t=>Promise.resolve(t))})}listSdTopic(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listSdTopic(e.token,t,i).then(a=>Promise.resolve(a))})}createSdTopic(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createSdTopic(e.token,t).then(i=>i)})}getTopicDetail(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getTopicDetail(e.token,t).then(i=>Promise.resolve(i))})}createRoomChannelApps(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createRoomChannelApps(e.token,t).then(i=>Promise.resolve(i))})}generateMeetToken(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.generateMeetToken(e.token,t).then(i=>Promise.resolve(i))})}listMezonOauthClient(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listMezonOauthClient(e.token).then(t=>Promise.resolve(t))})}getMezonOauthClient(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getMezonOauthClient(e.token,t,i).then(a=>Promise.resolve(a))})}updateMezonOauthClient(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateMezonOauthClient(e.token,t).then(i=>Promise.resolve(i))})}searchThread(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.searchThread(e.token,t,i,a).then(l=>Promise.resolve(l))})}generateHashChannelApps(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.generateHashChannelApps(e.token,t).then(i=>Promise.resolve(i))})}registrationPassword(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.registrationEmail(e.token,{email:t,password:i,old_password:a}).then(l=>Promise.resolve(l))})}addUserEvent(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addUserEvent(e.token,t).then(i=>i!==void 0)})}deleteUserEvent(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteUserEvent(e.token,t,i).then(a=>a!==void 0)})}updateRoleOrder(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateRoleOrder(e.token,t).then(i=>Promise.resolve(i))})}deleteAccount(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteAccount(e.token).then(t=>Promise.resolve(t))})}createExternalMezonMeet(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createExternalMezonMeet(e.token).then(t=>Promise.resolve(t))})}generateMeetTokenExternal(e,t,i,a){return h(this,null,function*(){return this.apiClient.generateMeetTokenExternal("",e,t,i,a).then(l=>Promise.resolve(l))})}removeMezonMeetParticipant(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.removeParticipantMezonMeet(e.token,t).then(i=>Promise.resolve(i))})}muteMezonMeetParticipant(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.muteParticipantMezonMeet(e.token,t).then(i=>Promise.resolve(i))})}updateClanOrder(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanOrder(e.token,t).then(i=>i!==void 0)})}listClanDiscover(e,t){return h(this,null,function*(){return this.apiClient.clanDiscover(this.serverkey,"",e,t).then(i=>Promise.resolve(i))})}listQuickMenuAccess(e,t,i,a){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listQuickMenuAccess(e.token,t,i,a).then(l=>Promise.resolve(l))})}deleteQuickMenuAccess(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteQuickMenuAccess(e.token,t,i).then(a=>a!==void 0)})}addQuickMenuAccess(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addQuickMenuAccess(e.token,t).then(i=>i!==void 0)})}updateQuickMenuAccess(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateQuickMenuAccess(e.token,t).then(i=>i!==void 0)})}listForSaleItems(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listForSaleItems(e.token,t).then(i=>Promise.resolve(i))})}isFollower(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.isFollower(e.token,t).then(i=>Promise.resolve(i))})}transferOwnership(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.transferOwnership(e.token,t).then(i=>i!==void 0)})}isBanned(e,t){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.isBanned(e.token,t).then(i=>Promise.resolve(i))})}reportMessageAbuse(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.reportMessageAbuse(e.token,t,i).then(a=>a!==void 0)})}listLogedDevice(e){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listLogedDevice(e.token).then(t=>Promise.resolve(t))})}updateMezonVoiceState(e,t,i,a,l,d){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateMezonVoiceState(e.token,t,i,a,l,d).then(c=>c!==void 0)})}sendChannelMessage(e,t,i,a,l,d,c,u,o,n,r,f,g,y){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.sendChannelMessage(e.token,t,i,a,l,d,c,u,o,n,r,f,g,y).then(b=>Promise.resolve(b))})}updateChannelMessage(e,t,i,a,l,d,c,u,o,n,r,f){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateChannelMessage(e.token,t,i,a,l,d,c,u,o,n,r,f).then(g=>Promise.resolve(g))})}deleteChannelMessage(e,t,i,a,l,d,c,u,o,n){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteChannelMessage(e.token,t,i,a,l,d,c,u,o,n).then(r=>Promise.resolve(r))})}messageButtonClick(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.messageButtonClick(e.token,t,i,a,l,d,c).then(u=>Promise.resolve(u))})}dropdownBoxSelected(e,t,i,a,l,d,c){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.dropdownBoxSelected(e.token,t,i,a,l,d,c).then(u=>Promise.resolve(u))})}activeArchivedThread(e,t,i){return h(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.activeArchivedThread(e.token,t,i).then(a=>Promise.resolve(a))})}};
|