mezon-js 2.15.6 → 2.15.8
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 le=Object.create;var T=Object.defineProperty,ce=Object.defineProperties,de=Object.getOwnPropertyDescriptor,he=Object.getOwnPropertyDescriptors,me=Object.getOwnPropertyNames,Z=Object.getOwnPropertySymbols,fe=Object.getPrototypeOf,ee=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable;var X=(y,e,t)=>e in y?T(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t,M=(y,e)=>{for(var t in e||(e={}))ee.call(e,t)&&X(y,t,e[t]);if(Z)for(var t of Z(e))pe.call(e,t)&&X(y,t,e[t]);return y},S=(y,e)=>ce(y,he(e));var ge=(y,e)=>{for(var t in e)T(y,t,{get:e[t],enumerable:!0})},te=(y,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of me(e))!ee.call(y,s)&&s!==t&&T(y,s,{get:()=>e[s],enumerable:!(i=de(e,s))||i.enumerable});return y};var K=(y,e,t)=>(t=y!=null?le(fe(y)):{},te(e||!y||!y.__esModule?T(t,"default",{value:y,enumerable:!0}):t,y)),_e=y=>te(T({},"__esModule",{value:!0}),y);var m=(y,e,t)=>new Promise((i,s)=>{var l=u=>{try{c(t.next(u))}catch(o){s(o)}},d=u=>{try{c(t.throw(u))}catch(o){s(o)}},c=u=>u.done?i(u.value):Promise.resolve(u.value).then(l,d);c((t=t.apply(y,e)).next())});var ze={};ge(ze,{ChannelStreamMode:()=>ae,ChannelType:()=>se,Client:()=>$,ConnectionState:()=>q,DefaultSocket:()=>D,NotificationType:()=>oe,RefreshTokenManager:()=>G,Session:()=>L,WebrtcSignalingType:()=>ue,b64DecodeUnicode:()=>Ae,b64EncodeUnicode:()=>ye,buildFetchOptions:()=>p,decodeAttachments:()=>F,decodeChannelTimelineAttachments:()=>z,decodeMentions:()=>W,decodeNotificationFcm:()=>j,decodeReactions:()=>I,decodeRefs:()=>N,encodeAttachments:()=>be,encodeMentions:()=>Pe,encodeNotificationFcm:()=>Ce,encodeReactions:()=>Re,encodeRefs:()=>we,getFetcher:()=>g,resetFetchStrategy:()=>Me,safeJSONParse:()=>b,setFetchStrategy:()=>ve});module.exports=_e(ze);var pr=require("whatwg-fetch");var H=require("js-base64"),C=K(require("mezon-js-protobuf"));function p(y,e,t){let i=M({method:y},e);return i.headers=M({},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(s=>{i.headers[s]||delete i.headers[s]}),t&&(i.body=t),i}function ye(y){return(0,H.encode)(encodeURIComponent(y).replace(/%([0-9A-F]{2})/g,function(t,i){return String.fromCharCode(+("0x"+i))}))}function Ae(y){return decodeURIComponent((0,H.decode)(y).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function b(y){if(y==null)return{t:y};let e;if(y instanceof Uint8Array)e=new TextDecoder().decode(y);else if(typeof y=="string")e=y;else return typeof y=="object"?y:{t:y};if(!e||e===""||e==="[]")return{t:e};try{return JSON.parse(e)}catch(t){try{let 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 O=y=>!y||y===null||y===void 0||y===""||y==="[]";function W(y){if(O(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,s=new Uint8Array(i);return C.MessageMentionList.decode(s)}catch(i){return b(y)}}function F(y){if(O(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,s=new Uint8Array(i);return C.MessageAttachmentList.decode(s)}catch(i){return b(y)}}function z(y){if(O(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,s=new Uint8Array(i);return C.ListChannelTimelineAttachment.decode(s)}catch(i){return b(y)}}function N(y){if(O(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,s=new Uint8Array(i);return C.MessageRefList.decode(s)}catch(i){return b(y)}}function I(y){if(O(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,s=new Uint8Array(i);return C.MessageReactionList.decode(s)}catch(i){return b(y)}}function j(y){if(O(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,s=new Uint8Array(i);return C.DirectFcmProto.decode(s)}catch(i){return b(y)}}function Pe(y){return C.MessageMentionList.encode(C.MessageMentionList.fromPartial(y)).finish()}function be(y){return C.MessageAttachmentList.encode(C.MessageAttachmentList.fromPartial(y)).finish()}function we(y){return C.MessageRefList.encode(C.MessageRefList.fromPartial(y)).finish()}function Re(y){return C.MessageReactionList.encode(C.MessageReactionList.fromPartial(y)).finish()}function Ce(y){return C.DirectFcmProto.encode(C.DirectFcmProto.fromPartial(y)).finish()}var k=require("js-base64"),a=K(require("mezon-js-protobuf"));var Q=fetch,ve=y=>{Q=y},Me=()=>{Q=fetch},g=()=>Q;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",s=new Map,l="",d=this.buildFullUrl(this.basePath,i,s),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([g()(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",s=new Map,l="",d=this.buildFullUrl(this.basePath,i,s),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([g()(d,c).then(u=>m(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return a.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 s="/mezon.api.Mezon/UpdateAccount",l=new Map,c=a.UpdateAccountRequest.encode(a.UpdateAccountRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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",s,c);return e&&(o.headers.Authorization="Bearer "+e),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,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",s),o.set("username",l),o.set("is_remember",d);let n="";n=JSON.stringify(i||{});let r=this.buildFullUrl(this.basePath,u,o),h=p("POST",c,n);return e&&(h.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),h.headers.Accept="application/x-protobuf",Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.Session.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/LinkEmail",l=new Map,c=a.AccountEmail.encode(a.AccountEmail.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/LinkSMS",l=new Map,c=a.AccountMezon.encode(a.AccountMezon.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/ConfirmLinkMezonOTP",l=new Map,c=a.LinkAccountConfirmRequest.encode(a.LinkAccountConfirmRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),o.headers.Accept="application/x-protobuf",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/RegistrationEmail",l=new Map,c=a.RegistrationEmailRequest.encode(a.RegistrationEmailRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.SessionRefreshRequest.encode(a.SessionRefreshRequest.fromPartial(i)).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.Session.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/UnlinkEmail",l=new Map,c=a.AccountEmail.encode(a.AccountEmail.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreateActiviy",l=new Map,c=a.CreateActivityRequest.encode(a.CreateActivityRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/AddApp",l=new Map,c=a.AddAppRequest.encode(a.AddAppRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,l={}){let d="/mezon.api.Mezon/ListApps",c=new Map,o=a.ListAppsRequest.encode(a.ListAppsRequest.fromPartial({filter:t,tombstones:i,cursor:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.AppList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,i,s={}){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=a.AppClan.encode(a.AppClan.fromPartial({app_id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,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 s="/mezon.api.Mezon/DeleteApp",l=new Map,c=a.App.encode(a.App.fromPartial({id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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 s="/mezon.api.Mezon/GetApp",l=new Map,c=a.App.encode(a.App.fromPartial({id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.UpdateAppRequest.encode(a.UpdateAppRequest.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.App.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,i,s,l,d={}){let c="/mezon.api.Mezon/ListAuditLog",u=new Map,n=a.ListAuditLogRequest.encode(a.ListAuditLogRequest.fromPartial({clan_id:s,user_id:i,action_log:t,date_log:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.ListAuditLog.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/UpdateCategoryOrder",l=new Map,c=a.UpdateCategoryOrderRequest.encode(a.UpdateCategoryOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s,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=a.CategoryDesc.encode(a.CategoryDesc.fromPartial({clan_id:t,creator_id:i,category_name:s,category_id:l,category_order:d})).finish(),h=this.buildFullUrl(this.basePath,u,o),f=p("POST",c,"");return f.body=r,e&&(f.headers.Authorization="Bearer "+e),Promise.race([g()(h,f).then(_=>m(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let A=yield _.arrayBuffer();return a.CategoryDescList.decode(new Uint8Array(A))}else throw _})),new Promise((_,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t,i={}){let s="/mezon.api.Mezon/ListChannelApps",l=new Map,c=a.ListChannelAppsRequest.encode(a.ListChannelAppsRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,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=a.ChannelCanvasListRequest.encode(a.ChannelCanvasListRequest.fromPartial({channel_id:t,clan_id:i,limit:s,page:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.ChannelCanvasListResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/AddChannelFavorite",l=new Map,c=a.AddFavoriteChannelRequest.encode(a.AddFavoriteChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.AddFavoriteChannelResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,i,s={}){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=a.RemoveFavoriteChannelRequest.encode(a.RemoveFavoriteChannelRequest.fromPartial({channel_id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,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 s="/mezon.api.Mezon/GetListFavoriteChannel",l=new Map,c=a.ListFavoriteChannelRequest.encode(a.ListFavoriteChannelRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,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,h=a.ListChannelMessagesRequest.encode(a.ListChannelMessagesRequest.fromPartial({clan_id:t,channel_id:i,message_id:s,direction:l,limit:d,topic_id:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return a.ChannelMessageList.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,i,s={}){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=a.AddChannelUsersRequest.encode(a.AddChannelUsersRequest.fromPartial({channel_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,i,s,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",h=new Map,_=a.ListChannelAttachmentRequest.encode(a.ListChannelAttachmentRequest.fromPartial({channel_id:t,clan_id:i,file_type:s,limit:l,state:d,before:c,after:u,around:o})).finish(),A=this.buildFullUrl(this.basePath,r,h),P=p("POST",n,"");return P.body=_,e&&(P.headers.Authorization="Bearer "+e),Promise.race([g()(A,P).then(R=>m(this,null,function*(){if(R.status==204)return{};if(R.status>=200&&R.status<300){let w=yield R.arrayBuffer();return a.ChannelAttachmentList.decode(new Uint8Array(w))}else throw R})),new Promise((R,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,i,s={}){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=a.ChanEncryptionMethod.encode(a.ChanEncryptionMethod.fromPartial({channel_id:t,method:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.ChanEncryptionMethod.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,i,s={}){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=a.ChanEncryptionMethod.encode(a.ChanEncryptionMethod.fromPartial(S(M({},i),{channel_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,i,s={}){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=a.LeaveThreadRequest.encode(a.LeaveThreadRequest.fromPartial({channel_id:i,clan_id:t})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}removeChannelUsers(e,t,i,s={}){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=a.RemoveChannelUsersRequest.encode(a.RemoveChannelUsersRequest.fromPartial({channel_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,i,s,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,h=a.ListChannelUsersRequest.encode(a.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:i,channel_type:s,limit:l,state:d,cursor:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return a.ChannelUserList.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,i,s,l,d,c,u={}){let o="/mezon.api.Mezon/ListChannelDescs",n=new Map,h=a.ListChannelDescsRequest.encode(a.ListChannelDescsRequest.fromPartial({limit:t,state:i,page:s,clan_id:l,channel_type:d,is_mobile:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return a.ChannelDescList.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(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 s="/mezon.api.Mezon/CreateChannelDesc",l=new Map,c=a.CreateChannelDescRequest.encode(a.CreateChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){let l="/mezon.api.Mezon/ListChannelUsersUC",d=new Map,u=a.AllUsersAddChannelRequest.encode(a.AllUsersAddChannelRequest.fromPartial({channel_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.AllUsersAddChannelResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,i,s={}){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=a.DeleteChannelDescRequest.encode(a.DeleteChannelDescRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,i,s={}){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=a.UpdateChannelDescRequest.encode(a.UpdateChannelDescRequest.fromPartial(S(M({},i),{channel_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,i,s,l,d,c,u,o,n,r,h={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let f="/mezon.api.Mezon/ListChannelSetting",_=new Map,P=a.ChannelSettingListRequest.encode(a.ChannelSettingListRequest.fromPartial({clan_id:t,parent_id:i,category_id:s,active:d,private_channel:l,status:c,type:u,limit:o,page:n,channel_label:r})).finish(),R=this.buildFullUrl(this.basePath,f,_),w=p("POST",h,"");return w.body=P,e&&(w.headers.Authorization="Bearer "+e),Promise.race([g()(R,w).then(v=>m(this,null,function*(){if(v.status==204)return{};if(v.status>=200&&v.status<300){let U=yield v.arrayBuffer();return a.ChannelSettingListResponse.decode(new Uint8Array(U))}else throw v})),new Promise((v,U)=>setTimeout(()=>U(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,i,s={}){let l="/mezon.api.Mezon/ListChannelVoiceUsers",d=new Map,u=a.ListChannelUsersRequest.encode(a.ListChannelUsersRequest.fromPartial({clan_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.VoiceChannelUserList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/ListClanUnreadMsgIndicator",l=new Map,c=a.ListClanUnreadMsgIndicatorRequest.encode(a.ListClanUnreadMsgIndicatorRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,l={}){let d="/mezon.api.Mezon/ListClanDescs",c=new Map,o=a.ListClanDescRequest.encode(a.ListClanDescRequest.fromPartial({limit:t,state:i,cursor:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.ClanDescList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(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 s="/mezon.api.Mezon/CreateClanDesc",l=new Map,c=a.CreateClanDescRequest.encode(a.CreateClanDescRequest.fromPartial({clan_name:t.clan_name,logo:t.logo,banner:t.banner})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/DeleteClanDesc",l=new Map,c=a.DeleteClanDescRequest.encode(a.DeleteClanDescRequest.fromPartial({clan_desc_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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,s={}){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=a.UpdateClanDescRequest.encode(a.UpdateClanDescRequest.fromPartial(M({clan_id:t},i))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,i,s={}){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=a.RemoveClanUsersRequest.encode(a.RemoveClanUsersRequest.fromPartial({clan_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(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,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,i,s={}){let l="/mezon.api.Mezon/ListBannedUsers",d=new Map,u=a.BannedUserListRequest.encode(a.BannedUserListRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.BannedUserList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,i,s,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=a.BanClanUsersRequest.encode(a.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:i,user_ids:s,ban_time:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(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,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,i,s,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=a.BanClanUsersRequest.encode(a.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:i,user_ids:s,ban_time:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(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,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/ListClanUsers",l=new Map,c=a.ListClanUsersRequest.encode(a.ListClanUsersRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreateCategoryDesc",l=new Map,c=a.CreateCategoryDescRequest.encode(a.CreateCategoryDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,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=a.DeleteCategoryDescRequest.encode(a.DeleteCategoryDescRequest.fromPartial({category_id:t,clan_id:i,category_label:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300)return(yield h.arrayBuffer()).byteLength>0?{}:{};throw h})),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,i,s,l,d={}){let c="/mezon.api.Mezon/RegistFCMDeviceToken",u=new Map,n=a.RegistFcmDeviceTokenRequest.encode(a.RegistFcmDeviceTokenRequest.fromPartial({token:t,device_id:i,platform:s,voip_token:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.RegistFcmDeviceTokenResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/CloseDMByChannelId",l=new Map,c=a.DeleteChannelDescRequest.encode(a.DeleteChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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 s="/mezon.api.Mezon/OpenDMByChannelId",l=new Map,c=a.DeleteChannelDescRequest.encode(a.DeleteChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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 s="/mezon.api.Mezon/CreateClanEmoji",l=new Map,c=a.ClanEmojiCreateRequest.encode(a.ClanEmojiCreateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s,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=a.ClanEmojiDeleteRequest.encode(a.ClanEmojiDeleteRequest.fromPartial({id:t,clan_id:i,emoji_label:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300)return(yield h.arrayBuffer()).byteLength>0?{}:{};throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,i,s={}){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=a.ClanEmojiUpdateRequest.encode(a.ClanEmojiUpdateRequest.fromPartial({id:i.id,shortname:i.shortname,clan_id:i.clan_id})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(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,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e,t={}){let i="/mezon.api.Mezon/EmojiRecentList",s=new Map,l="",d=this.buildFullUrl(this.basePath,i,s),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([g()(d,c).then(u=>m(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return a.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",s=new Map,l="",d=this.buildFullUrl(this.basePath,i,s),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([g()(d,c).then(u=>m(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return a.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 s="/mezon.api.Mezon/SearchMessage",l=new Map,c=a.SearchMessageRequest.encode(a.SearchMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreateEvent",l=new Map,c=a.Event.encode(a.Event.fromPartial({external:t.external,name:t.name,properties:t.properties})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/ListEvents",l=new Map,c=a.ListEventsRequest.encode(a.ListEventsRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreateEvent",l=new Map,c=a.CreateEventRequest.encode(a.CreateEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/UpdateEventUser",l=new Map,c=a.DeleteEventRequest.encode(a.DeleteEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s,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=a.DeleteEventRequest.encode(a.DeleteEventRequest.fromPartial({event_id:t,clan_id:i,creator_id:s,event_label:l,channel_id:d})).finish(),h=this.buildFullUrl(this.basePath,u,o),f=p("POST",c,"");return f.body=r,e&&(f.headers.Authorization="Bearer "+e),Promise.race([g()(h,f).then(_=>m(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300)return{};throw _})),new Promise((_,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,i,s={}){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=a.UpdateEventRequest.encode(a.UpdateEventRequest.fromPartial(i)).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,i,s={}){let l="/mezon.api.Mezon/DeleteFriends",d=new Map,u=a.DeleteFriendsRequest.encode(a.DeleteFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listFriends(e,t,i,s,l={}){let d="/mezon.api.Mezon/ListFriends",c=new Map,o=a.ListFriendsRequest.encode(a.ListFriendsRequest.fromPartial({limit:t,state:i,cursor:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.FriendList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,i,s={}){let l="/mezon.api.Mezon/AddFriends",d=new Map,u=a.AddFriendsRequest.encode(a.AddFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.AddFriendsResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,i,s={}){let l="/mezon.api.Mezon/BlockFriends",d=new Map,u=a.BlockFriendsRequest.encode(a.BlockFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,i,s={}){let l="/mezon.api.Mezon/UnblockFriends",d=new Map,u=a.BlockFriendsRequest.encode(a.BlockFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t,i={}){let s="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",l=new Map,c=a.NotificationClan.encode(a.NotificationClan.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GetUserProfileOnClan",l=new Map,c=a.ClanProfileRequest.encode(a.ClanProfileRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GetNotificationCategory",l=new Map,c=a.DefaultNotificationCategory.encode(a.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GetNotificationChannel",l=new Map,c=a.NotificationChannel.encode(a.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GetNotificationClan",l=new Map,c=a.NotificationClan.encode(a.NotificationClan.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GetNotificationReactMessage",l=new Map,c=a.NotifiReactMessage.encode(a.NotifiReactMessage.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GiveMeACoffee",l=new Map,c=a.GiveCoffeeEvent.encode(a.GiveCoffeeEvent.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreateLinkInviteUser",l=new Map,c=a.LinkInviteUserRequest.encode(a.LinkInviteUserRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/InviteUser",l=new Map,c=a.InviteUserRequest.encode(a.InviteUserRequest.fromPartial({invite_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.InviteUserRes.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e,t={}){let i="/mezon.api.Mezon/ListChannelByUserId",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/MarkAsRead",l=new Map,c=a.MarkAsReadRequest.encode(a.MarkAsReadRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/SetMuteCategory",l=new Map,c=a.SetMuteRequest.encode(a.SetMuteRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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 s="/mezon.api.Mezon/SetMuteChannel",l=new Map,c=a.SetMuteRequest.encode(a.SetMuteRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s={}){let l="/mezon.api.Mezon/DeleteNotifications",d=new Map,u=a.DeleteNotificationsRequest.encode(a.DeleteNotificationsRequest.fromPartial({ids:t||[],category:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,i,s,l,d,c={}){let u="/mezon.api.Mezon/ListNotifications",o=new Map,r=a.ListNotificationsRequest.encode(a.ListNotificationsRequest.fromPartial({limit:t,clan_id:i,notification_id:s,category:l,direction:d})).finish(),h=this.buildFullUrl(this.basePath,u,o),f=p("POST",c,"");return f.body=r,e&&(f.headers.Authorization="Bearer "+e),Promise.race([g()(h,f).then(_=>m(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let A=yield _.arrayBuffer();return a.NotificationList.decode(new Uint8Array(A))}else throw _})),new Promise((_,A)=>setTimeout(()=>A(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 s="/mezon.api.Mezon/SetNotificationChannelSetting",l=new Map,c=a.SetNotificationRequest.encode(a.SetNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/SetNotificationClanSetting",l=new Map,c=a.SetDefaultNotificationRequest.encode(a.SetDefaultNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/SetNotificationCategorySetting",l=new Map,c=a.SetNotificationRequest.encode(a.SetNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/DeleteNotificationCategorySetting",l=new Map,c=a.DefaultNotificationCategory.encode(a.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/DeleteNotificationChannel",l=new Map,c=a.NotificationChannel.encode(a.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/DeleteNotiReactMessage",l=new Map,c=a.NotificationChannel.encode(a.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/SetNotificationReactMessage",l=new Map,c=a.NotificationChannel.encode(a.NotificationChannel.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/SetRoleChannelPermission",l=new Map,c=a.UpdateRoleChannelRequest.encode(a.UpdateRoleChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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,s,l={}){let d="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",c=new Map,o=a.PermissionRoleChannelListEventRequest.encode(a.PermissionRoleChannelListEventRequest.fromPartial({role_id:t,channel_id:i,user_id:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.PermissionRoleChannelListEventResponse.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,i,s,l,d={}){let c="/mezon.api.Mezon/DeletePinMessage",u=new Map,n=a.DeletePinMessage.encode(a.DeletePinMessage.fromPartial({id:t,message_id:i,channel_id:s,clan_id:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,i,s,l={}){let d="/mezon.api.Mezon/GetPinMessagesList",c=new Map,o=a.PinMessageRequest.encode(a.PinMessageRequest.fromPartial({message_id:t,channel_id:i,clan_id:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.PinMessagesList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(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 s="/mezon.api.Mezon/CreateMessage2Inbox",l=new Map,c=a.Message2InboxRequest.encode(a.Message2InboxRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreatePinMessage",l=new Map,c=a.PinMessageRequest.encode(a.PinMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GetPubKeys",l=new Map,c=a.GetPubKeysRequest.encode(a.GetPubKeysRequest.fromPartial({user_ids:t||[]})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/PushPubKey",l=new Map,c=a.PushPubKeyRequest.encode(a.PushPubKeyRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/AddRolesChannelDesc",l=new Map,c=a.AddRoleChannelDescRequest.encode(a.AddRoleChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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,s={}){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=a.ChangeChannelCategoryRequest.encode(a.ChangeChannelCategoryRequest.fromPartial(S(M({},i),{new_category_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,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 s="/mezon.api.Mezon/DeleteRoleChannelDesc",l=new Map,c=a.DeleteRoleRequest.encode(a.DeleteRoleRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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,s,l,d={}){let c="/mezon.api.Mezon/ListRoles",u=new Map,n=a.RoleListEventRequest.encode(a.RoleListEventRequest.fromPartial({clan_id:t,limit:i,state:s,cursor:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.RoleListEventResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/CreateRole",l=new Map,c=a.CreateRoleRequest.encode(a.CreateRoleRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.DeleteRoleRequest.encode(a.DeleteRoleRequest.fromPartial(S(M({},i),{role_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,i,s,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=a.DeleteRoleRequest.encode(a.DeleteRoleRequest.fromPartial({role_id:t,channel_id:i,clan_id:s,role_label:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}updateRole(e,t,i,s={}){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=a.UpdateRoleRequest.encode(a.UpdateRoleRequest.fromPartial(S(M({},i),{role_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,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 s="/mezon.api.Mezon/ListRolePermissions",l=new Map,c=a.ListPermissionsRequest.encode(a.ListPermissionsRequest.fromPartial({role_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,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=a.ListRoleUsersRequest.encode(a.ListRoleUsersRequest.fromPartial({role_id:t,limit:i,cursor:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.RoleUserList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,i,s={}){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=a.ListPermissionOfUsersRequest.encode(a.ListPermissionOfUsersRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.RoleList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,i,s,l={}){let d="/mezon.api.Mezon/SearchThread",c=new Map,o=a.SearchThreadRequest.encode(a.SearchThreadRequest.fromPartial({clan_id:t,channel_id:i,label:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.ChannelDescList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(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 s="/mezon.api.Mezon/SendToken",l=new Map,c=a.TokenSentEvent.encode(a.TokenSentEvent.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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 s="/mezon.api.Mezon/SessionLogout",l=new Map,c=a.SessionLogoutRequest.encode(a.SessionLogoutRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/AddClanSticker",l=new Map,c=a.ClanStickerAddRequest.encode(a.ClanStickerAddRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s,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=a.ClanStickerDeleteRequest.encode(a.ClanStickerDeleteRequest.fromPartial({id:t,clan_id:i,sticker_label:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300)return{};throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,i,s={}){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=a.ClanStickerUpdateByIdRequest.encode(a.ClanStickerUpdateByIdRequest.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e,t={}){let i="/mezon.api.Mezon/GetListStickersByUserId",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/RegisterStreamingChannel",l=new Map,c=a.RegisterStreamingChannelRequest.encode(a.RegisterStreamingChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,l,d,c,u={}){let o="/mezon.api.Mezon/ListStreamingChannelUsers",n=new Map,h=a.ListChannelUsersRequest.encode(a.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:i,channel_type:s,limit:l,state:d,cursor:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return a.StreamingChannelUserList.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e,t={}){let i="/mezon.api.Mezon/GetSystemMessagesList",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreateSystemMessage",l=new Map,c=a.SystemMessageRequest.encode(a.SystemMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s={}){let l="/mezon.api.Mezon/ListSdTopic",d=new Map,u=a.ListSdTopicRequest.encode(a.ListSdTopicRequest.fromPartial({clan_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.SdTopicList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/CreateSdTopic",l=new Map,c=a.SdTopicRequest.encode(a.SdTopicRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/DeleteSystemMessage",l=new Map,c=a.DeleteSystemMessage.encode(a.DeleteSystemMessage.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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 s="/mezon.api.Mezon/GetSystemMessageByClanId",l=new Map,c=a.GetSystemMessage.encode(a.GetSystemMessage.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.SystemMessageRequest.encode(a.SystemMessageRequest.fromPartial(S(M({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,i,s,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,h=a.ListThreadRequest.encode(a.ListThreadRequest.fromPartial({channel_id:t,limit:i,state:s,clan_id:l,thread_id:d,page:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return a.ChannelDescListNoPool.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,i,s={}){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=a.UpdateCategoryDescRequest.encode(a.UpdateCategoryDescRequest.fromPartial(S(M({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/UpdateChannelPrivate",l=new Map,c=a.ChangeChannelPrivateRequest.encode(a.ChangeChannelPrivateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s={}){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=a.UpdateClanProfileRequest.encode(a.UpdateClanProfileRequest.fromPartial(S(M({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/UploadOauthFile",l=new Map,c=a.UploadAttachmentRequest.encode(a.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/UploadAttachmentFile",l=new Map,c=a.UploadAttachmentRequest.encode(a.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.UploadAttachment.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFile(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",l=new Map,c=a.UploadAttachmentRequest.encode(a.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.MultipartUploadAttachment.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFileFinsih(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",l=new Map,c=a.MultipartUploadAttachmentFinishRequest.encode(a.MultipartUploadAttachmentFinishRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){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))])}updateUser(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateUser",l=new Map,c=a.UpdateUsersRequest.encode(a.UpdateUsersRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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,s={}){let l="/mezon.api.Mezon/ListUserPermissionInChannel",d=new Map,u=a.UserPermissionInChannelListRequest.encode(a.UserPermissionInChannelListRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.UserPermissionInChannelListResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e,t={}){let i="/mezon.api.Mezon/GetUserStatus",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/UpdateUserStatus",l=new Map,c=a.UserStatusUpdate.encode(a.UserStatusUpdate.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/GenerateWebhook",l=new Map,c=a.WebhookCreateRequest.encode(a.WebhookCreateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.WebhookUpdateRequestById.encode(a.WebhookUpdateRequestById.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,i,s={}){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=a.WebhookListRequest.encode(a.WebhookListRequest.fromPartial({channel_id:t,clan_id:i||""})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.WebhookListResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,i,s={}){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=a.WebhookDeleteRequestById.encode(a.WebhookDeleteRequestById.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,i){let s=e+t+"?";for(let[l,d]of i)d instanceof Array?s+=d.reduce((c,u)=>c+encodeURIComponent(l)+"="+encodeURIComponent(u)+"&",""):d!=null&&(s+=encodeURIComponent(l)+"="+encodeURIComponent(d)+"&");return s}editChannelCanvases(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/EditChannelCanvases",l=new Map,c=a.EditChannelCanvasRequest.encode(a.EditChannelCanvasRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,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=a.ChannelCanvasDetailRequest.encode(a.ChannelCanvasDetailRequest.fromPartial({id:t,clan_id:i||"",channel_id:s||""})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.ChannelCanvasDetailResponse.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,i,s,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=a.DeleteChannelCanvasRequest.encode(a.DeleteChannelCanvasRequest.fromPartial({canvas_id:t,clan_id:i||"",channel_id:s||""})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,i,s,l,d={}){let c="/mezon.api.Mezon/ListOnboarding",u=new Map,n=a.ListOnboardingRequest.encode(a.ListOnboardingRequest.fromPartial({clan_id:t,guide_type:i,limit:s,page:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.ListOnboardingResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/CreateOnboarding",l=new Map,c=a.CreateOnboardingRequest.encode(a.CreateOnboardingRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.OnboardingRequest.encode(a.OnboardingRequest.fromPartial({id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,i,s={}){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=a.OnboardingRequest.encode(a.OnboardingRequest.fromPartial({id:t,clan_id:i||""})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.OnboardingItem.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,i,s={}){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=a.UpdateOnboardingRequest.encode(a.UpdateOnboardingRequest.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,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 s="/mezon.api.Mezon/GenerateClanWebhook",l=new Map,c=a.GenerateClanWebhookRequest.encode(a.GenerateClanWebhookRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/ListClanWebhook",l=new Map,c=a.ListClanWebhookRequest.encode(a.ListClanWebhookRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.ClanWebhookRequest.encode(a.ClanWebhookRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,i,s={}){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=S(M({},i),{id:t}),o=a.UpdateClanWebhookRequest.encode(a.UpdateClanWebhookRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t,i={}){let s="/mezon.api.Mezon/GetTopicDetail",l=new Map,d={topic_id:t},u=a.SdTopicDetailRequest.encode(a.SdTopicDetailRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,s,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.SdTopic.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,i,s,l={}){let d="/mezon.api.Mezon/ListOnboardingStep",c=new Map,u={clan_id:t,limit:i,page:s},n=a.ListOnboardingStepRequest.encode(a.ListOnboardingStepRequest.fromPartial(u)).finish(),r=this.buildFullUrl(this.basePath,d,c),h=p("POST",l,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.ListOnboardingStepResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,i,s={}){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=S(M({},i),{clan_id:t}),o=a.UpdateOnboardingStepRequest.encode(a.UpdateOnboardingStepRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,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 s="/mezon.api.Mezon/CreateRoomChannelApps",l=new Map,c=a.CreateRoomChannelApps.encode(a.CreateRoomChannelApps.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GenerateMeetToken",l=new Map,c=a.GenerateMeetTokenRequest.encode(a.GenerateMeetTokenRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){let l="/mezon.api.Mezon/GetMezonOauthClient",d=new Map,c={client_id:t,client_name:i},o=a.GetMezonOauthClientRequest.encode(a.GetMezonOauthClientRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.MezonOauthClient.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(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 s="/mezon.api.Mezon/UpdateMezonOauthClient",l=new Map,c=a.MezonOauthClient.encode(a.MezonOauthClient.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GenerateHashChannelApps",l=new Map,d={app_id:t},u=a.GenerateHashChannelAppsRequest.encode(a.GenerateHashChannelAppsRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,s,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.GenerateHashChannelAppsResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/AddUserEvent",l=new Map,c=a.UserEventRequest.encode(a.UserEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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,s={}){let l="/mezon.api.Mezon/DeleteUserEvent",d=new Map,c={clan_id:t,event_id:i},o=a.UserEventRequest.encode(a.UserEventRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,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 s="/mezon.api.Mezon/UpdateRoleOrder",l=new Map,c=a.UpdateRoleOrderRequest.encode(a.UpdateRoleOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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,s,l,d,c={}){if(i==null)throw new Error("'token' is a required parameter but is null or undefined.");let u="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(i))),o=new Map;o.set("username",s),o.set("metadata",l),o.set("is_guest",d);let n="",r=this.buildFullUrl(t,u,o),h=p("POST",c,n);return e&&(h.headers.Authorization="Bearer "+e),h.headers.Accept="application/x-protobuf",h.headers["Content-Type"]="application/json",Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.GenerateMeetTokenExternalResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/MuteParticipantMezonMeet",l=new Map,c=a.MeetParticipantRequest.encode(a.MeetParticipantRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/RemoveParticipantMezonMeet",l=new Map,c=a.MeetParticipantRequest.encode(a.MeetParticipantRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/ListChannelDetail",l=new Map,d={channel_id:t},u=a.ListChannelDetailRequest.encode(a.ListChannelDetailRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,s,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.ChannelDescription.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listChannelTimeline(e,t,i={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListChannelTimeline",l=new Map,c=a.ListChannelTimelineRequest.encode(a.ListChannelTimelineRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.ListChannelTimelineResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createChannelTimeline(e,t,i={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateChannelTimeline",l=new Map,c=a.CreateChannelTimelineRequest.encode(a.CreateChannelTimelineRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.CreateChannelTimelineResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateChannelTimeline(e,t,i={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateChannelTimeline",l=new Map,c=a.UpdateChannelTimelineRequest.encode(a.UpdateChannelTimelineRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.UpdateChannelTimelineResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}detailChannelTimeline(e,t,i={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/DetailChannelTimeline",l=new Map,c=a.ChannelTimelineDetailRequest.encode(a.ChannelTimelineDetailRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.ChannelTimelineDetailResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(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 s="/mezon.api.Mezon/UpdateClanOrder",l=new Map,c=a.UpdateClanOrderRequest.encode(a.UpdateClanOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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,s,l={}){if(s==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(s||{});let o=this.buildFullUrl(i,d,c),n=p("POST",l,u);return e&&(n.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),n.headers.Accept="application/x-protobuf",n.headers["Content-Type"]="application/json",Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.ListClanDiscover.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,i,s,l,d,c,u={}){let o="/mezon.api.Mezon/DeleteQuickMenuAccess",n=new Map,r={id:t,clan_id:i,bot_id:s,menu_name:l,background:d,action_msg:c},f=a.QuickMenuAccess.encode(a.QuickMenuAccess.fromPartial(r)).finish(),_=this.buildFullUrl(this.basePath,o,n),A=p("POST",u,"");return A.body=f,e&&(A.headers.Authorization="Bearer "+e),Promise.race([g()(_,A).then(P=>{if(P.status==204)return P;if(P.status>=200&&P.status<300)return P;throw P}),new Promise((P,R)=>setTimeout(R,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,i,s,l={}){let d="/mezon.api.Mezon/ListQuickMenuAccess",c=new Map,u={bot_id:t,channel_id:i,menu_type:s},n=a.ListQuickMenuAccessRequest.encode(a.ListQuickMenuAccessRequest.fromPartial(u)).finish(),r=this.buildFullUrl(this.basePath,d,c),h=p("POST",l,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.QuickMenuAccessList.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/AddQuickMenuAccess",l=new Map,c=a.QuickMenuAccess.encode(a.QuickMenuAccess.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/UpdateQuickMenuAccess",l=new Map,c=a.QuickMenuAccess.encode(a.QuickMenuAccess.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/ListForSaleItems",l=new Map,d={page:t},u=a.ListForSaleItemsRequest.encode(a.ListForSaleItemsRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,s,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.ForSaleItemList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/IsFollower",l=new Map,c=a.IsFollowerRequest.encode(a.IsFollowerRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/TransferOwnership",l=new Map,c=a.TransferOwnershipRequest.encode(a.TransferOwnershipRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/UpdateUsername",l=new Map,c=a.UpdateUsernameRequest.encode(a.UpdateUsernameRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/IsBanned",l=new Map,d={channel_id:t},u=a.IsBannedRequest.encode(a.IsBannedRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,s,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.IsBannedResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,i,s={}){let l="/mezon.api.Mezon/ReportMessageAbuse",d=new Map,c={message_id:t,abuse_type:i},o=a.ReportMessageAbuseReqest.encode(a.ReportMessageAbuseReqest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,i,s,l,d,c,u,o,n,r,h,f,_){let A="/mezon.api.Mezon/SendChannelMessage",P=new Map,w=a.ChannelMessageSend.encode(a.ChannelMessageSend.fromPartial({clan_id:t,channel_id:i,mode:s,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:h,code:f,topic_id:_})).finish(),v=this.buildFullUrl(this.basePath,A,P),U=p("POST",{},"");return U.body=w,e&&(U.headers.Authorization="Bearer "+e),Promise.race([g()(v,U).then(E=>m(this,null,function*(){if(E.status==204)return{};if(E.status>=200&&E.status<300){let x=yield E.arrayBuffer();return a.ChannelMessageSend.decode(new Uint8Array(x))}else throw E})),new Promise((E,x)=>setTimeout(()=>x(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,i,s,l,d,c,u,o,n,r,h){let f="/mezon.api.Mezon/UpdateChannelMessage",_=new Map,P=a.ChannelMessageUpdate.encode(a.ChannelMessageUpdate.fromPartial({clan_id:t,channel_id:i,message_id:d,mode:s,is_public:l,content:c,mentions:u,attachments:o,hide_editted:n,topic_id:r,is_update_msg_topic:h})).finish(),R=this.buildFullUrl(this.basePath,f,_),w=p("POST",{},"");return w.body=P,e&&(w.headers.Authorization="Bearer "+e),Promise.race([g()(R,w).then(v=>m(this,null,function*(){if(v.status==204)return{};if(v.status>=200&&v.status<300){let U=yield v.arrayBuffer();return a.ChannelMessageUpdate.decode(new Uint8Array(U))}else throw v})),new Promise((v,U)=>setTimeout(()=>U(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,i,s,l,d,c,u,o,n){let r="/mezon.api.Mezon/DeleteChannelMessage",h=new Map,_=a.ChannelMessageRemove.encode(a.ChannelMessageRemove.fromPartial({clan_id:t,channel_id:i,message_id:d,mode:s,is_public:l,has_attachment:c,mentions:o,references:n,topic_id:u})).finish(),A=this.buildFullUrl(this.basePath,r,h),P=p("POST",{},"");return P.body=_,e&&(P.headers.Authorization="Bearer "+e),Promise.race([g()(A,P).then(R=>m(this,null,function*(){if(R.status==204)return{};if(R.status>=200&&R.status<300){let w=yield R.arrayBuffer();return a.ChannelMessageRemove.decode(new Uint8Array(w))}else throw R})),new Promise((R,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,i,s,l,d,c={}){let u="/mezon.api.Mezon/UpdateMezonVoiceState",o=new Map,n={clan_id:t,channel_id:i,display_name:s,room_name:l,state:d},h=a.HandleParticipantMeetStateEvent.encode(a.HandleParticipantMeetStateEvent.fromPartial(n)).finish(),f=this.buildFullUrl(this.basePath,u,o),_=p("POST",c,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).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."))])}messageButtonClick(e,t,i,s,l,d,c,u={}){let o="/mezon.api.Mezon/MessageButtonClick",n=new Map,r={message_id:t,channel_id:i,button_id:s,sender_id:l,user_id:d,extra_data:c},f=a.MessageButtonClicked.encode(a.MessageButtonClicked.fromPartial(r)).finish(),_=this.buildFullUrl(this.basePath,o,n),A=p("POST",u,"");return A.body=f,e&&(A.headers.Authorization="Bearer "+e),Promise.race([g()(_,A).then(P=>{if(P.status==204)return P;if(P.status>=200&&P.status<300)return P;throw P}),new Promise((P,R)=>setTimeout(R,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,i,s,l,d,c,u={}){let o="/mezon.api.Mezon/DropdownBoxSelected",n=new Map,r={message_id:t,channel_id:i,selectbox_id:s,sender_id:l,user_id:d,values:c},f=a.DropdownBoxSelected.encode(a.DropdownBoxSelected.fromPartial(r)).finish(),_=this.buildFullUrl(this.basePath,o,n),A=p("POST",u,"");return A.body=f,e&&(A.headers.Authorization="Bearer "+e),Promise.race([g()(_,A).then(P=>{if(P.status==204)return P;if(P.status>=200&&P.status<300)return P;throw P}),new Promise((P,R)=>setTimeout(R,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,i,s={}){let l="/mezon.api.Mezon/ActiveArchivedThread",d=new Map,c={clan_id:t,channel_id:i},o=a.ActiveArchivedThread.encode(a.ActiveArchivedThread.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,i,s={}){let l="/mezon.api.Mezon/AddAgentToChannel",d=new Map,c={room_name:t,channel_id:i},o=a.UpdateAIAgentRequest.encode(a.UpdateAIAgentRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,i,s={}){let l="/mezon.api.Mezon/DisconnectAgent",d=new Map,c={room_name:t,channel_id:i},o=a.UpdateAIAgentRequest.encode(a.UpdateAIAgentRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listMutedChannel(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListMutedChannel",l=new Map,c=a.ListMutedChannelRequest.encode(a.ListMutedChannelRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.MutedChannelList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,i,s,l,d,c,u,o,n,r,h,f,_){let A="/mezon.api.Mezon/ReactChannelMessage",P=new Map,w=a.MessageReaction.encode(a.MessageReaction.fromPartial({clan_id:t,channel_id:i,mode:s,is_public:l,message_id:d,emoji_id:c,emoji:u,count:o,message_sender_id:n,action:r,emoji_recent_id:f,sender_name:_,topic_id:h})).finish(),v=this.buildFullUrl(this.basePath,A,P),U=p("POST",{},"");return U.body=w,e&&(U.headers.Authorization="Bearer "+e),Promise.race([g()(v,U).then(E=>m(this,null,function*(){if(E.status==204)return{};if(E.status>=200&&E.status<300){let x=yield E.arrayBuffer();return a.ChannelMessageSend.decode(new Uint8Array(x))}else throw E})),new Promise((E,x)=>setTimeout(()=>x(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t,i={}){var n,r,h,f,_,A;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreatePoll",l=new Map,c=a.CreatePollRequest.encode(a.CreatePollRequest.fromPartial({channel_id:(n=t.channel_id)!=null?n:"0",clan_id:(r=t.clan_id)!=null?r:"0",question:(h=t.question)!=null?h:"",answers:(f=t.answers)!=null?f:[],expire_hours:(_=t.expire_hours)!=null?_:0,type:(A=t.type)!=null?A:0})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(P=>m(this,null,function*(){if(P.status==204)return{};if(P.status>=200&&P.status<300){let R=yield P.arrayBuffer(),w=a.CreatePollResponse.decode(new Uint8Array(R));return{poll_id:w.poll_id,message_id:w.message_id,question:w.question,answers:w.answers.map(v=>({index:v.index,label:v.label})),answer_counts:w.answer_counts,exp:w.exp,is_closed:w.is_closed,creator_id:w.creator_id,type:w.type,total_votes:w.total_votes}}else throw P})),new Promise((P,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t,i={}){var n,r,h,f;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/VotePoll",l=new Map,c=a.VotePollRequest.encode(a.VotePollRequest.fromPartial({poll_id:(n=t.poll_id)!=null?n:"0",message_id:(r=t.message_id)!=null?r:"0",channel_id:(h=t.channel_id)!=null?h:"0",answer_indices:(f=t.answer_indices)!=null?f:[]})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(_=>{if(_.status==204||_.status>=200&&_.status<300)return{};throw _}),new Promise((_,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t,i={}){var n,r,h;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ClosePoll",l=new Map,c=a.ClosePollRequest.encode(a.ClosePollRequest.fromPartial({poll_id:(n=t.poll_id)!=null?n:"0",message_id:(r=t.message_id)!=null?r:"0",channel_id:(h=t.channel_id)!=null?h:"0"})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(f=>{if(f.status==204||f.status>=200&&f.status<300)return{};throw f}),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t,i={}){var n,r,h;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/GetPoll",l=new Map,c=a.GetPollRequest.encode(a.GetPollRequest.fromPartial({poll_id:(n=t.poll_id)!=null?n:"0",message_id:(r=t.message_id)!=null?r:"0",channel_id:(h=t.channel_id)!=null?h:"0"})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer(),A=a.GetPollResponse.decode(new Uint8Array(_));return{poll_id:A.poll_id,message_id:A.message_id,question:A.question,answers:A.answers.map(P=>({index:P.index,label:P.label})),answer_counts:A.answer_counts,exp:A.exp,is_closed:A.is_closed,creator_id:A.creator_id,type:A.type,total_votes:A.total_votes,voter_details:A.voter_details.map(P=>({answer_index:P.answer_index,user_ids:P.user_ids}))}}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}};var V=K(require("js-base64")),L=class y{constructor(e,t,i,s,l,d,c){this.created=i;this.api_url=s;this.ws_url=l;this.id_token=d;this.token=e,this.refresh_token=t,this.id_token=d,this.api_url=s,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 s=e.split(".");if(s.length!=3)throw"jwt is not valid.";let l=JSON.parse(V.atob(s[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(V.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,s,l){return new y(e,t,!1,i,s,"",l)}};var Y=Symbol.for("mezon.refreshTokenManager"),G=class y{constructor(){this.pendingRefreshes=new Map}static getInstance(){let e=globalThis;return e[Y]||(e[Y]=new y),e[Y]}refresh(e,t){return m(this,null,function*(){let i=this.pendingRefreshes.get(e);if(i)return i;let s=t().finally(()=>{this.pendingRefreshes.delete(e)});return this.pendingRefreshes.set(e,s),s})}isRefreshing(e){return this.pendingRefreshes.has(e)}get pendingCount(){return this.pendingRefreshes.size}};var ie=require("mezon-js-protobuf");function Se(y){let e,t,i,s,l,d;try{e=b(y.channel_message.content)}catch(u){console.log("content is invalid",u)}try{t=I(y.channel_message.reactions)}catch(u){console.log("reactions is invalid",u)}try{i=W(y.channel_message.mentions)}catch(u){console.log("mentions is invalid",u)}try{s=F(y.channel_message.attachments)}catch(u){console.log("attachments is invalid",u)}try{l=N(y.channel_message.references)}catch(u){console.log("references is invalid",u)}try{d=y.channel_message.referenced_message}catch(u){console.log("referenced messages is invalid",u)}return{id:y.id||y.channel_message.message_id,avatar:y.channel_message.avatar,channel_id:y.channel_message.channel_id,mode:y.channel_message.mode,channel_label:y.channel_message.channel_label,clan_id:y.channel_message.clan_id,code:y.channel_message.code,message_id:y.channel_message.message_id,sender_id:y.channel_message.sender_id,update_time:y.channel_message.update_time,clan_logo:y.channel_message.clan_logo,category_name:y.channel_message.category_name,username:y.channel_message.username,clan_nick:y.channel_message.clan_nick,clan_avatar:y.channel_message.clan_avatar,display_name:y.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:i==null?void 0:i.mentions,attachments:s==null?void 0:s.attachments,referenced_message:d,references:l==null?void 0:l.refs,hide_editted:y.channel_message.hide_editted,is_public:y.channel_message.is_public,create_time_seconds:y.channel_message.create_time_seconds,update_time_seconds:y.channel_message.update_time_seconds,topic_id:y.channel_message.topic_id}}var ne=!1,q={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},B=class B{constructor(e,t,i=!1,s=!1,l=new ie.WebSocketAdapterPb,d=B.DefaultSendTimeoutMs){this.host=e;this.port=t;this.useSSL=i;this.verbose=s;this.adapter=l;this.sendTimeoutMs=d;this.cIds={},this.nextCid=1,this._heartbeatTimeoutMs=B.DefaultHeartbeatTimeoutMs,this._connectionState=q.DISCONNECTED}generatecid(){let e=this.nextCid.toString();return++this.nextCid,e}isOpen(){return this._connectionState===q.CONNECTED}connect(e,t=!1,i="",s=B.DefaultConnectTimeoutMs,l){if(this._connectionState===q.CONNECTED)return Promise.resolve(e);if(this._connectionState===q.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=q.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=q.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(u)},this.adapter.onMessage=u=>m(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?j(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=Se(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):u.aiagent_enabled_event?this.onaiagentenabled(u.aiagent_enabled_event):u.channel_listed_event?this.onchannellisted(u.channel_listed_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=ne;ne=!0,this.clearConnectTimeout(),this._connectionState=q.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,u(e),r&&this.onreconnect(n)},this.adapter.onError=n=>{this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(n),this._connectPromise=void 0,this.adapter.close(),o(n)},this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.close(),this._connectPromise=void 0,o("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},s)});return this._connectPromise=c,this._connectPromise}disconnect(e=!0){this._connectionState=q.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=q.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)}onaiagentenabled(e){this.verbose&&window&&window.console&&console.log(e)}onchannellisted(e){this.verbose&&window&&window.console&&console.log(e)}send(e,t=B.DefaultSendTimeoutMs){let i=e;return new Promise((s,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:s,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 m(this,null,function*(){return(yield this.send({status_follow:{user_ids:e}})).status})}joinClanChat(e){return m(this,null,function*(){return(yield this.send({clan_join:{clan_id:e}})).clan_join})}follower(){return m(this,null,function*(){return(yield this.send({follow_event:{}})).follow_event})}joinChat(e,t,i,s){return m(this,null,function*(){return(yield this.send({channel_join:{clan_id:e,channel_id:t,channel_type:i,is_public:s}})).channel})}leaveChat(e,t,i,s){return this.send({channel_leave:{clan_id:e,channel_id:t,channel_type:i,is_public:s}})}removeChatMessage(e,t,i,s,l,d,c,u,o){return m(this,null,function*(){return(yield this.send({channel_message_remove:{clan_id:e,channel_id:t,mode:i,message_id:l,is_public:s,has_attachment:d,topic_id:c,mentions:u,references:o}})).channel_message_ack})}rpc(e,t,i){return m(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,s,l,d,c,u,o,n,r){return m(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:s,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,s,l,d,c,u,o,n,r,h,f,_){return m(this,null,function*(){return(yield this.send({quick_menu_event:{menu_name:e,message:{clan_id:t,channel_id:i,mode:s,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:h,code:f,topic_id:_}}})).ephemeral_message_send})}writeEphemeralMessage(e,t,i,s,l,d,c,u,o,n,r,h,f,_,A){return m(this,null,function*(){return(yield this.send({ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:i,mode:s,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:h,code:f,topic_id:_,id:A}}})).ephemeral_message_send})}writeChatMessage(e,t,i,s,l,d,c,u,o,n,r,h,f){return m(this,null,function*(){return(yield this.send({channel_message_send:{clan_id:e,channel_id:t,mode:i,is_public:s,content:l,mentions:d,attachments:c,references:u,anonymous_message:o,mention_everyone:n,avatar:r,code:h,topic_id:f}},1/0)).channel_message_ack})}writeMessageReaction(e,t,i,s,l,d,c,u,o,n,r,h,f,_){return m(this,null,function*(){return(yield this.send({message_reaction_event:{id:e,clan_id:t,channel_id:i,mode:s,is_public:l,message_id:d,emoji_id:c,emoji:u,count:o,message_sender_id:n,action:r,topic_id:h,emoji_recent_id:f,sender_name:_}})).message_reaction_event})}writeMessageTyping(e,t,i,s,l,d){return m(this,null,function*(){return(yield this.send({message_typing_event:{clan_id:e,channel_id:t,mode:i,is_public:s,sender_display_name:l,topic_id:d}})).message_typing_event})}writeLastSeenMessage(e,t,i,s,l,d){return m(this,null,function*(){return(yield this.send({last_seen_message_event:{clan_id:e,channel_id:t,mode:i,message_id:s,timestamp_seconds:l,badge_count:d}})).last_seen_message_event})}writeLastPinMessage(e,t,i,s,l,d,c,u,o,n,r,h,f){return m(this,null,function*(){return(yield this.send({last_pin_message_event:{clan_id:e,channel_id:t,mode:i,is_public:s,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:h,message_created_time:f}})).last_pin_message_event})}writeCustomStatus(e,t,i,s){return m(this,null,function*(){return(yield this.send({custom_status_event:{clan_id:e,status:t,time_reset:i,no_clear:s}})).custom_status_event})}checkDuplicateName(e,t,i,s){return m(this,null,function*(){return(yield this.send({check_name_existed_event:{name:e,condition_id:t,type:i,clan_id:s}})).check_name_existed_event})}writeVoiceReaction(e,t){return m(this,null,function*(){return(yield this.send({voice_reaction_send:{emojis:e,channel_id:t}})).voice_reaction_send})}forwardWebrtcSignaling(e,t,i,s,l){return m(this,null,function*(){return(yield this.send({webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:i,channel_id:s,caller_id:l}})).webrtc_signaling_fwd})}makeCallPush(e,t,i,s){return m(this,null,function*(){return(yield this.send({incoming_call_push:{receiver_id:e,json_data:t,channel_id:i,caller_id:s}})).incoming_call_push})}writeChannelAppEvent(e,t,i){return m(this,null,function*(){return(yield this.send({channel_app_event:{clan_id:e,channel_id:t,action:i}})).channel_app_event})}listDataSocket(e){return m(this,null,function*(){return(yield this.send({list_data_socket:e})).list_data_socket})}pingPong(){return m(this,null,function*(){if(!this.isOpen()){this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop();return}try{yield this.send({ping:{}},this._heartbeatTimeoutMs)}catch(e){this._connectionState=q.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)}};B.DefaultHeartbeatTimeoutMs=1e4,B.DefaultSendTimeoutMs=1e4,B.DefaultConnectTimeoutMs=3e4;var D=B;var re=require("mezon-js-protobuf");var Ue="127.0.0.1",qe="7350",Ee="defaultkey",ke=3e4,se=(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))(se||{}),ae=(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))(ae||{}),oe=(i=>(i[i.ALL_MESSAGE=1]="ALL_MESSAGE",i[i.MENTION_MESSAGE=2]="MENTION_MESSAGE",i[i.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",i))(oe||{}),ue=(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))(ue||{}),$=class{constructor(e=Ee,t=Ue,i=qe,s=!1,l=ke,d=!0){this.serverkey=e;this.timeout=l;this.autoRefreshSession=d;this.refreshTokenManager=G.getInstance();this.host=t,this.port=i,this.useSSL=s;let u=`${s?"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,s,l={},d={}){let c={token:e,vars:l};return this.apiClient.authenticateMezon(this.serverkey,"",c,t,i,s,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 s={username:t,account:{phoneno:e,vars:i}};return this.apiClient.AuthenticateSMSOTPRequest(this.serverkey,"",s,t).then(l=>Promise.resolve(l))}authenticateEmailOTPRequest(e,t,i){let s={username:t,account:{email:e,vars:i}};return this.apiClient.AuthenticateEmailOTPRequest(this.serverkey,"",s,t).then(l=>Promise.resolve(l))}confirmAuthenticateOTP(e){return m(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,s){let l={username:i,account:{email:e,password:t,vars:s}};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 m(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(s=>s!==void 0)})}addFriends(e,t,i){return m(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 m(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(s=>Promise.resolve(s!=null))})}unblockFriends(e,t,i){return m(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(s=>Promise.resolve(s!=null))})}uploadOauthFile(e,t){return m(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 m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.uploadAttachmentFile(e.token,t)})}multipartUploadAttachmentFile(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.multipartUploadAttachmentFile(e.token,t)})}multipartUploadAttachmentFileFinish(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.multipartUploadAttachmentFileFinsih(e.token,t)})}createChannelDesc(e,t){return m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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,s=!1,l=new re.WebSocketAdapterPb,d=D.DefaultSendTimeoutMs){return new D(t,i,e,s,l,d)}deleteFriends(e,t,i){return m(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(s=>s!==void 0)})}deleteChannelDesc(e,t,i){return m(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(s=>s!==void 0)})}deleteClanDesc(e,t){return m(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,s){return m(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,s).then(l=>l!==void 0)})}deleteNotifications(e,t,i){return m(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(s=>Promise.resolve(s!=null))})}deleteRole(e,t,i,s){return m(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,s).then(l=>l!==void 0)})}deleteEvent(e,t,i,s,l,d){return m(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,s,l,d).then(c=>c!==void 0)})}updateEventUser(e,t){return m(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 m(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 m(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 m(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(s=>Promise.resolve(s!=null))})}listBannedUsers(e,t,i){return m(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(s=>Promise.resolve(s))})}unbanClanUsers(e,t,i,s){return m(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,s).then(l=>Promise.resolve(l!=null))})}banClanUsers(e,t,i,s,l){return m(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,s,l).then(d=>Promise.resolve(d!=null))})}removeChannelUsers(e,t,i){return m(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(s=>Promise.resolve(s!=null))})}listChannelMessages(e,t,i,s,l,d,c){return m(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,s,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,h,f,_,A;try{r=b(n.content)}catch(P){console.log("error parse content",P)}try{let P=I(n.reactions);h=(P==null?void 0:P.reactions)||P||b(n.reactions||"[]")}catch(P){h=b(n.reactions||"[]")}try{let P=W(n.mentions);f=(P==null?void 0:P.mentions)||P||b(n.mentions||"[]")}catch(P){f=b(n.mentions||"[]")}try{let P=F(n.attachments);_=(P==null?void 0:P.attachments)||P||b(n.attachments||"[]")}catch(P){_=b(n.attachments||"[]")}try{let P=N(n.references);A=(P==null?void 0:P.refs)||P||b(n.references||"[]")}catch(P){A=b(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:_,mentions:f,reactions:h,references:A,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 m(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(s=>{let l={voice_channel_users:[]};return s.voice_channel_users==null||s.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,s,l,d,c){return m(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,s,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,s,l,d,c,u){return m(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,s,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 m(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 s={clan_users:[],cursor:i.cursor,clan_id:i.clan_id};return i.clan_users==null||i.clan_users.forEach(l=>{var d;s.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,join_time_seconds:l.user.join_time_seconds},role_id:l.role_id,clan_nick:l.clan_nick,clan_avatar:l.clan_avatar})}),Promise.resolve(s)})})}listChannelDetail(e,t){return m(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,s,l,d,c){return m(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,s,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 m(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,s){return m(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,s).then(l=>{let d={clandesc:[]};return l.clandesc==null||(d.clandesc=l.clandesc),Promise.resolve(d)})})}listCategoryDescs(e,t,i,s){return m(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,s).then(l=>{let d={categorydesc:[]};return l.categorydesc==null||(d.categorydesc=l.categorydesc),Promise.resolve(d)})})}listEvents(e,t){return m(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 m(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 m(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,s){return m(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,s).then(l=>Promise.resolve(l))})}registFCMDeviceToken(e,t,i,s,l){return m(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,s,l).then(d=>Promise.resolve(d))})}getUserProfileOnClan(e,t){return m(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 m(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 m(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 m(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 m(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 m(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,s){return m(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,s).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,s,l,d){return m(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,s,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?j(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,s,l){return m(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:s,platform:l}).then(d=>d!==void 0)})}sessionRefresh(i){return m(this,arguments,function*(e,t={}){if(!e)return console.error("Cannot refresh a null session."),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");let s=yield this.refreshTokenManager.refresh(e.refresh_token,()=>m(this,null,function*(){try{let l=yield this.apiClient.sessionRefresh(this.serverkey,"",{token:e.refresh_token,vars:t,is_remember:e.is_remember});return{token:l.token,refresh_token:l.refresh_token,is_remember:l.is_remember||!1}}catch(l){throw console.error("Session refresh failed:",l),l}}));return e.update(s.token,s.refresh_token,s.is_remember),this.onRefreshSession(s),e})}unlinkEmail(e,t){return m(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 m(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 m(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 m(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(s=>s!==void 0)})}updateClanDesc(e,t,i){return m(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(s=>s!==void 0)})}updateCategory(e,t,i){return m(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(s=>s!==void 0)})}updateUserProfileByClan(e,t,i){return m(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(s=>s!==void 0)})}updateRole(e,t,i){return m(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(s=>s!==void 0)})}updateEvent(e,t,i){return m(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(s=>s!==void 0)})}updateApp(e,t,i){return m(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(s=>Promise.resolve(s))})}createLinkInviteUser(e,t){return m(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 m(this,null,function*(){return this.apiClient.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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,s){return m(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,s).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,s,l){return m(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,s,l).then(d=>d!==void 0)})}createClanEmoji(e,t){return m(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 m(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(s=>s!==void 0)})}deleteByIdClanEmoji(e,t,i,s){return m(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,s).then(l=>l!==void 0)})}generateWebhookLink(e,t){return m(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 m(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(s=>Promise.resolve(s))})}updateWebhookById(e,t,i){return m(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(s=>s!==void 0)})}deleteWebhookById(e,t,i){return m(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(s=>s!==void 0)})}addClanSticker(e,t){return m(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,s){return m(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,s).then(l=>l!==void 0)})}updateClanStickerById(e,t,i){return m(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(s=>s!==void 0)})}changeChannelCategory(e,t,i){return m(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(s=>s!==void 0)})}setRoleChannelPermission(e,t){return m(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 m(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 m(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 m(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 m(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(s=>s!==void 0)})}getSystemMessagesList(e){return m(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 m(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 m(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 m(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(s=>Promise.resolve(s))})}deleteSystemMessage(e,t){return m(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 m(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 m(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 m(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,s,l,d,c){return m(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,s,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 m(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 m(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 s={channel_apps:[]};return i.channel_apps==null||i.channel_apps.forEach(l=>{s.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(s)})})}getChannelCategoryNotiSettingsList(e,t){return m(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 m(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 m(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 m(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 m(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 m(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 m(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(s=>Promise.resolve(s))})}getListEmojisByUserId(e){return m(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 m(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 m(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 m(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,s,l){return m(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,s,l).then(d=>{let c={clan_id:t,roles:d.roles};return Promise.resolve(c)})})}listUserPermissionInChannel(e,t,i){return m(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(s=>{let l={clan_id:t,channel_id:i,permissions:s.permissions};return Promise.resolve(l)})})}getPermissionByRoleIdChannelId(e,t,i,s){return m(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,s).then(l=>{let d={role_id:t,channel_id:i,permission_role_channel:l.permission_role_channel,user_id:s};return Promise.resolve(d)})})}markAsRead(e,t){return m(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,s,l,d,c){return m(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,s,l,d,c).then(u=>{let o={channeldesc:[]};return u.channeldesc==null||(o.channeldesc=u.channeldesc),Promise.resolve(o)})})}listChannelTimeline(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelTimeline(e.token,t).then(i=>{var s;return(s=i.events)==null||s.forEach(l=>{l.attachments=[];let d;try{let c=z(l.preview_imgs);d=(c==null?void 0:c.attachments)||c||b(l.preview_imgs||"[]")}catch(c){d=b(l.preview_imgs||"[]")}Array.isArray(d)?l.preview_imgs=d:l.preview_imgs=[]}),Promise.resolve(i)})})}createChannelTimeline(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createChannelTimeline(e.token,t).then(i=>{let s=i.event;if(s){let l,d;try{let c=z(s.attachments),u=z(s.preview_imgs);l=(c==null?void 0:c.attachments)||c||b(s.attachments||"[]"),d=(u==null?void 0:u.attachments)||u||b(s.preview_imgs||"[]")}catch(c){l=b(s.attachments||"[]"),d=b(s.preview_imgs||"[]")}Array.isArray(l)?s.attachments=l:s.attachments=[],Array.isArray(d)?s.preview_imgs=d:s.preview_imgs=[]}return Promise.resolve(i)})})}updateChannelTimeline(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateChannelTimeline(e.token,t).then(i=>{let s=i.event;if(s){let l,d;try{let c=z(s.attachments),u=z(s.preview_imgs);l=(c==null?void 0:c.attachments)||c||b(s.attachments||"[]"),d=(u==null?void 0:u.attachments)||u||b(s.preview_imgs||"[]")}catch(c){l=b(s.attachments||"[]"),d=b(s.preview_imgs||"[]")}Array.isArray(l)?s.attachments=l:s.attachments=[],Array.isArray(d)?s.preview_imgs=d:s.preview_imgs=[]}return Promise.resolve(i)})})}detailChannelTimeline(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.detailChannelTimeline(e.token,t).then(i=>{let s=i.event;if(s){let l,d;try{let c=z(s.attachments),u=z(s.preview_imgs);l=(c==null?void 0:c.attachments)||c||b(s.attachments||"[]"),d=(u==null?void 0:u.attachments)||u||b(s.preview_imgs||"[]")}catch(c){l=b(s.attachments||"[]"),d=b(s.preview_imgs||"[]")}Array.isArray(l)?s.attachments=l:s.attachments=[],Array.isArray(d)?s.preview_imgs=d:s.preview_imgs=[]}return Promise.resolve(i)})})}leaveThread(e,t,i){return m(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(s=>Promise.resolve(s))})}getChannelSettingInClan(e,t,i,s,l,d,c,u,o,n,r){return m(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,s,l,d,c,u,o,n,r).then(h=>Promise.resolve(h))})}getChannelCanvasList(e,t,i,s,l){return m(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,s,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,s){return m(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,s).then(l=>Promise.resolve(l))})}editChannelCanvases(e,t){return m(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,s){return m(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,s).then(l=>l!==void 0)})}addFavoriteChannel(e,t,i){return m(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(s=>s)})}removeFavoriteChannel(e,t,i){return m(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(s=>s)})}getListFavoriteChannel(e,t){return m(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 m(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 m(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 m(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 m(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 m(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(s=>s)})}getChanEncryptionMethod(e,t){return m(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 m(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(s=>s)})}getPubKeys(e,t){return m(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 m(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 m(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,s,l){return m(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,s,l).then(d=>d)})}listOnboarding(e,t,i,s,l){return m(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,s,l).then(d=>d)})}getOnboardingDetail(e,t,i){return m(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(s=>Promise.resolve(s))})}createOnboarding(e,t){return m(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 m(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(s=>s!==void 0)})}deleteOnboarding(e,t,i){return m(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(s=>s!==void 0)})}generateClanWebhook(e,t){return m(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 m(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 m(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(s=>s!==void 0)})}updateClanWebhookById(e,t,i){return m(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(s=>s!==void 0)})}listOnboardingStep(e,t,i,s){return m(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,s).then(l=>Promise.resolve(l))})}updateOnboardingStepByClanId(e,t,i){return m(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(s=>s!==void 0)})}updateUserStatus(e,t){return m(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 m(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 m(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(s=>Promise.resolve(s))})}createSdTopic(e,t){return m(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 m(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 m(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 m(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 m(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 m(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(s=>Promise.resolve(s))})}updateMezonOauthClient(e,t){return m(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,s){return m(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,s).then(l=>Promise.resolve(l))})}generateHashChannelApps(e,t){return m(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,s){return m(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:s}).then(l=>Promise.resolve(l))})}addUserEvent(e,t){return m(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 m(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(s=>s!==void 0)})}updateRoleOrder(e,t){return m(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 m(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 m(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,s,l){return m(this,null,function*(){return this.apiClient.generateMeetTokenExternal("",e,t,i,s,l).then(d=>Promise.resolve(d))})}removeMezonMeetParticipant(e,t){return m(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 m(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 m(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 m(this,null,function*(){return this.apiClient.clanDiscover(this.serverkey,"",e,t).then(i=>Promise.resolve(i))})}listQuickMenuAccess(e,t,i,s){return m(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,s).then(l=>Promise.resolve(l))})}deleteQuickMenuAccess(e,t,i){return m(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(s=>s!==void 0)})}addQuickMenuAccess(e,t){return m(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 m(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 m(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 m(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 m(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 m(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 m(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(s=>s!==void 0)})}updateMezonVoiceState(e,t,i,s,l,d){return m(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,s,l,d).then(c=>c!==void 0)})}sendChannelMessage(e,t,i,s,l,d,c,u,o,n,r,h,f,_){return m(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,s,l,d,c,u,o,n,r,h,f,_).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,i,s,l,d,c,u,o,n,r,h){return m(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,s,l,d,c,u,o,n,r,h).then(f=>Promise.resolve(f))})}deleteChannelMessage(e,t,i,s,l,d,c,u,o,n){return m(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,s,l,d,c,u,o,n).then(r=>Promise.resolve(r))})}messageButtonClick(e,t,i,s,l,d,c){return m(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,s,l,d,c).then(u=>Promise.resolve(u))})}dropdownBoxSelected(e,t,i,s,l,d,c){return m(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,s,l,d,c).then(u=>Promise.resolve(u))})}activeArchivedThread(e,t,i){return m(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(s=>Promise.resolve(s))})}addAgentToChannel(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addAgentToChannel(e.token,t,i).then(s=>Promise.resolve(s))})}disconnectAgent(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.disconnectAgent(e.token,t,i).then(s=>Promise.resolve(s))})}listMutedChannel(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listMutedChannel(e.token,t).then(i=>Promise.resolve(i))})}channelMessageReact(e,t,i,s,l,d,c,u,o,n,r,h,f,_){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.channelMessageReact(e.token,t,i,s,l,d,c,u,o,n,r,h,f,_).then(A=>Promise.resolve(A))})}createPoll(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createPoll(e.token,t)})}votePoll(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.votePoll(e.token,t)})}closePoll(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.closePoll(e.token,t)})}getPoll(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getPoll(e.token,t)})}};
|
|
1
|
+
"use strict";var le=Object.create;var T=Object.defineProperty,ce=Object.defineProperties,de=Object.getOwnPropertyDescriptor,he=Object.getOwnPropertyDescriptors,me=Object.getOwnPropertyNames,Z=Object.getOwnPropertySymbols,fe=Object.getPrototypeOf,ee=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable;var X=(y,e,t)=>e in y?T(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t,M=(y,e)=>{for(var t in e||(e={}))ee.call(e,t)&&X(y,t,e[t]);if(Z)for(var t of Z(e))pe.call(e,t)&&X(y,t,e[t]);return y},S=(y,e)=>ce(y,he(e));var ge=(y,e)=>{for(var t in e)T(y,t,{get:e[t],enumerable:!0})},te=(y,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of me(e))!ee.call(y,s)&&s!==t&&T(y,s,{get:()=>e[s],enumerable:!(i=de(e,s))||i.enumerable});return y};var K=(y,e,t)=>(t=y!=null?le(fe(y)):{},te(e||!y||!y.__esModule?T(t,"default",{value:y,enumerable:!0}):t,y)),_e=y=>te(T({},"__esModule",{value:!0}),y);var m=(y,e,t)=>new Promise((i,s)=>{var l=u=>{try{c(t.next(u))}catch(o){s(o)}},d=u=>{try{c(t.throw(u))}catch(o){s(o)}},c=u=>u.done?i(u.value):Promise.resolve(u.value).then(l,d);c((t=t.apply(y,e)).next())});var ze={};ge(ze,{ChannelStreamMode:()=>ae,ChannelType:()=>se,Client:()=>$,ConnectionState:()=>q,DefaultSocket:()=>D,NotificationType:()=>oe,RefreshTokenManager:()=>G,Session:()=>L,WebrtcSignalingType:()=>ue,b64DecodeUnicode:()=>Ae,b64EncodeUnicode:()=>ye,buildFetchOptions:()=>p,decodeAttachments:()=>F,decodeChannelTimelineAttachments:()=>z,decodeMentions:()=>W,decodeNotificationFcm:()=>j,decodeReactions:()=>I,decodeRefs:()=>N,encodeAttachments:()=>be,encodeMentions:()=>Pe,encodeNotificationFcm:()=>Ce,encodeReactions:()=>Re,encodeRefs:()=>we,getFetcher:()=>g,resetFetchStrategy:()=>Me,safeJSONParse:()=>b,setFetchStrategy:()=>ve});module.exports=_e(ze);var pr=require("whatwg-fetch");var H=require("js-base64"),C=K(require("mezon-js-protobuf"));function p(y,e,t){let i=M({method:y},e);return i.headers=M({},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(s=>{i.headers[s]||delete i.headers[s]}),t&&(i.body=t),i}function ye(y){return(0,H.encode)(encodeURIComponent(y).replace(/%([0-9A-F]{2})/g,function(t,i){return String.fromCharCode(+("0x"+i))}))}function Ae(y){return decodeURIComponent((0,H.decode)(y).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function b(y){if(y==null)return{t:y};let e;if(y instanceof Uint8Array)e=new TextDecoder().decode(y);else if(typeof y=="string")e=y;else return typeof y=="object"?y:{t:y};if(!e||e===""||e==="[]")return{t:e};try{return JSON.parse(e)}catch(t){try{let 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 O=y=>!y||y===null||y===void 0||y===""||y==="[]";function W(y){if(O(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,s=new Uint8Array(i);return C.MessageMentionList.decode(s)}catch(i){return b(y)}}function F(y){if(O(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,s=new Uint8Array(i);return C.MessageAttachmentList.decode(s)}catch(i){return b(y)}}function z(y){if(O(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,s=new Uint8Array(i);return C.ListChannelTimelineAttachment.decode(s)}catch(i){return b(y)}}function N(y){if(O(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,s=new Uint8Array(i);return C.MessageRefList.decode(s)}catch(i){return b(y)}}function I(y){if(O(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,s=new Uint8Array(i);return C.MessageReactionList.decode(s)}catch(i){return b(y)}}function j(y){if(O(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,s=new Uint8Array(i);return C.DirectFcmProto.decode(s)}catch(i){return b(y)}}function Pe(y){return C.MessageMentionList.encode(C.MessageMentionList.fromPartial(y)).finish()}function be(y){return C.MessageAttachmentList.encode(C.MessageAttachmentList.fromPartial(y)).finish()}function we(y){return C.MessageRefList.encode(C.MessageRefList.fromPartial(y)).finish()}function Re(y){return C.MessageReactionList.encode(C.MessageReactionList.fromPartial(y)).finish()}function Ce(y){return C.DirectFcmProto.encode(C.DirectFcmProto.fromPartial(y)).finish()}var k=require("js-base64"),a=K(require("mezon-js-protobuf"));var Q=fetch,ve=y=>{Q=y},Me=()=>{Q=fetch},g=()=>Q;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",s=new Map,l="",d=this.buildFullUrl(this.basePath,i,s),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([g()(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",s=new Map,l="",d=this.buildFullUrl(this.basePath,i,s),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([g()(d,c).then(u=>m(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return a.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 s="/mezon.api.Mezon/UpdateAccount",l=new Map,c=a.UpdateAccountRequest.encode(a.UpdateAccountRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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",s,c);return e&&(o.headers.Authorization="Bearer "+e),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,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",s),o.set("username",l),o.set("is_remember",d);let n="";n=JSON.stringify(i||{});let r=this.buildFullUrl(this.basePath,u,o),h=p("POST",c,n);return e&&(h.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),h.headers.Accept="application/x-protobuf",Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.Session.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/LinkEmail",l=new Map,c=a.AccountEmail.encode(a.AccountEmail.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/LinkSMS",l=new Map,c=a.AccountMezon.encode(a.AccountMezon.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/ConfirmLinkMezonOTP",l=new Map,c=a.LinkAccountConfirmRequest.encode(a.LinkAccountConfirmRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),o.headers.Accept="application/x-protobuf",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/RegistrationEmail",l=new Map,c=a.RegistrationEmailRequest.encode(a.RegistrationEmailRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.SessionRefreshRequest.encode(a.SessionRefreshRequest.fromPartial(i)).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.Session.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/UnlinkEmail",l=new Map,c=a.AccountEmail.encode(a.AccountEmail.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreateActiviy",l=new Map,c=a.CreateActivityRequest.encode(a.CreateActivityRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/AddApp",l=new Map,c=a.AddAppRequest.encode(a.AddAppRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,l={}){let d="/mezon.api.Mezon/ListApps",c=new Map,o=a.ListAppsRequest.encode(a.ListAppsRequest.fromPartial({filter:t,tombstones:i,cursor:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.AppList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,i,s={}){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=a.AppClan.encode(a.AppClan.fromPartial({app_id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,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 s="/mezon.api.Mezon/DeleteApp",l=new Map,c=a.App.encode(a.App.fromPartial({id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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 s="/mezon.api.Mezon/GetApp",l=new Map,c=a.App.encode(a.App.fromPartial({id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.UpdateAppRequest.encode(a.UpdateAppRequest.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.App.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,i,s,l,d={}){let c="/mezon.api.Mezon/ListAuditLog",u=new Map,n=a.ListAuditLogRequest.encode(a.ListAuditLogRequest.fromPartial({clan_id:s,user_id:i,action_log:t,date_log:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.ListAuditLog.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/UpdateCategoryOrder",l=new Map,c=a.UpdateCategoryOrderRequest.encode(a.UpdateCategoryOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s,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=a.CategoryDesc.encode(a.CategoryDesc.fromPartial({clan_id:t,creator_id:i,category_name:s,category_id:l,category_order:d})).finish(),h=this.buildFullUrl(this.basePath,u,o),f=p("POST",c,"");return f.body=r,e&&(f.headers.Authorization="Bearer "+e),Promise.race([g()(h,f).then(_=>m(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let A=yield _.arrayBuffer();return a.CategoryDescList.decode(new Uint8Array(A))}else throw _})),new Promise((_,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t,i={}){let s="/mezon.api.Mezon/ListChannelApps",l=new Map,c=a.ListChannelAppsRequest.encode(a.ListChannelAppsRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,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=a.ChannelCanvasListRequest.encode(a.ChannelCanvasListRequest.fromPartial({channel_id:t,clan_id:i,limit:s,page:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.ChannelCanvasListResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/AddChannelFavorite",l=new Map,c=a.AddFavoriteChannelRequest.encode(a.AddFavoriteChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.AddFavoriteChannelResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,i,s={}){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=a.RemoveFavoriteChannelRequest.encode(a.RemoveFavoriteChannelRequest.fromPartial({channel_id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,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 s="/mezon.api.Mezon/GetListFavoriteChannel",l=new Map,c=a.ListFavoriteChannelRequest.encode(a.ListFavoriteChannelRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,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,h=a.ListChannelMessagesRequest.encode(a.ListChannelMessagesRequest.fromPartial({clan_id:t,channel_id:i,message_id:s,direction:l,limit:d,topic_id:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return a.ChannelMessageList.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,i,s={}){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=a.AddChannelUsersRequest.encode(a.AddChannelUsersRequest.fromPartial({channel_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,i,s,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",h=new Map,_=a.ListChannelAttachmentRequest.encode(a.ListChannelAttachmentRequest.fromPartial({channel_id:t,clan_id:i,file_type:s,limit:l,state:d,before:c,after:u,around:o})).finish(),A=this.buildFullUrl(this.basePath,r,h),P=p("POST",n,"");return P.body=_,e&&(P.headers.Authorization="Bearer "+e),Promise.race([g()(A,P).then(R=>m(this,null,function*(){if(R.status==204)return{};if(R.status>=200&&R.status<300){let w=yield R.arrayBuffer();return a.ChannelAttachmentList.decode(new Uint8Array(w))}else throw R})),new Promise((R,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,i,s={}){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=a.ChanEncryptionMethod.encode(a.ChanEncryptionMethod.fromPartial({channel_id:t,method:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.ChanEncryptionMethod.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,i,s={}){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=a.ChanEncryptionMethod.encode(a.ChanEncryptionMethod.fromPartial(S(M({},i),{channel_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,i,s={}){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=a.LeaveThreadRequest.encode(a.LeaveThreadRequest.fromPartial({channel_id:i,clan_id:t})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}removeChannelUsers(e,t,i,s={}){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=a.RemoveChannelUsersRequest.encode(a.RemoveChannelUsersRequest.fromPartial({channel_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,i,s,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,h=a.ListChannelUsersRequest.encode(a.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:i,channel_type:s,limit:l,state:d,cursor:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return a.ChannelUserList.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,i,s,l,d,c,u={}){let o="/mezon.api.Mezon/ListChannelDescs",n=new Map,h=a.ListChannelDescsRequest.encode(a.ListChannelDescsRequest.fromPartial({limit:t,state:i,page:s,clan_id:l,channel_type:d,is_mobile:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return a.ChannelDescList.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(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 s="/mezon.api.Mezon/CreateChannelDesc",l=new Map,c=a.CreateChannelDescRequest.encode(a.CreateChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){let l="/mezon.api.Mezon/ListChannelUsersUC",d=new Map,u=a.AllUsersAddChannelRequest.encode(a.AllUsersAddChannelRequest.fromPartial({channel_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.AllUsersAddChannelResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,i,s={}){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=a.DeleteChannelDescRequest.encode(a.DeleteChannelDescRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,i,s={}){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=a.UpdateChannelDescRequest.encode(a.UpdateChannelDescRequest.fromPartial(S(M({},i),{channel_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,i,s,l,d,c,u,o,n,r,h={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let f="/mezon.api.Mezon/ListChannelSetting",_=new Map,P=a.ChannelSettingListRequest.encode(a.ChannelSettingListRequest.fromPartial({clan_id:t,parent_id:i,category_id:s,active:d,private_channel:l,status:c,type:u,limit:o,page:n,channel_label:r})).finish(),R=this.buildFullUrl(this.basePath,f,_),w=p("POST",h,"");return w.body=P,e&&(w.headers.Authorization="Bearer "+e),Promise.race([g()(R,w).then(v=>m(this,null,function*(){if(v.status==204)return{};if(v.status>=200&&v.status<300){let U=yield v.arrayBuffer();return a.ChannelSettingListResponse.decode(new Uint8Array(U))}else throw v})),new Promise((v,U)=>setTimeout(()=>U(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,i,s={}){let l="/mezon.api.Mezon/ListChannelVoiceUsers",d=new Map,u=a.ListChannelUsersRequest.encode(a.ListChannelUsersRequest.fromPartial({clan_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.VoiceChannelUserList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/ListClanUnreadMsgIndicator",l=new Map,c=a.ListClanUnreadMsgIndicatorRequest.encode(a.ListClanUnreadMsgIndicatorRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,l={}){let d="/mezon.api.Mezon/ListClanDescs",c=new Map,o=a.ListClanDescRequest.encode(a.ListClanDescRequest.fromPartial({limit:t,state:i,cursor:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.ClanDescList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(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 s="/mezon.api.Mezon/CreateClanDesc",l=new Map,c=a.CreateClanDescRequest.encode(a.CreateClanDescRequest.fromPartial({clan_name:t.clan_name,logo:t.logo,banner:t.banner})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/DeleteClanDesc",l=new Map,c=a.DeleteClanDescRequest.encode(a.DeleteClanDescRequest.fromPartial({clan_desc_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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,s={}){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=a.UpdateClanDescRequest.encode(a.UpdateClanDescRequest.fromPartial(M({clan_id:t},i))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,i,s={}){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=a.RemoveClanUsersRequest.encode(a.RemoveClanUsersRequest.fromPartial({clan_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(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,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,i,s={}){let l="/mezon.api.Mezon/ListBannedUsers",d=new Map,u=a.BannedUserListRequest.encode(a.BannedUserListRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.BannedUserList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,i,s,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=a.BanClanUsersRequest.encode(a.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:i,user_ids:s,ban_time:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(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,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,i,s,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=a.BanClanUsersRequest.encode(a.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:i,user_ids:s,ban_time:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(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,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/ListClanUsers",l=new Map,c=a.ListClanUsersRequest.encode(a.ListClanUsersRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreateCategoryDesc",l=new Map,c=a.CreateCategoryDescRequest.encode(a.CreateCategoryDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,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=a.DeleteCategoryDescRequest.encode(a.DeleteCategoryDescRequest.fromPartial({category_id:t,clan_id:i,category_label:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300)return(yield h.arrayBuffer()).byteLength>0?{}:{};throw h})),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,i,s,l,d={}){let c="/mezon.api.Mezon/RegistFCMDeviceToken",u=new Map,n=a.RegistFcmDeviceTokenRequest.encode(a.RegistFcmDeviceTokenRequest.fromPartial({token:t,device_id:i,platform:s,voip_token:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.RegistFcmDeviceTokenResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/CloseDMByChannelId",l=new Map,c=a.DeleteChannelDescRequest.encode(a.DeleteChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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 s="/mezon.api.Mezon/OpenDMByChannelId",l=new Map,c=a.DeleteChannelDescRequest.encode(a.DeleteChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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 s="/mezon.api.Mezon/CreateClanEmoji",l=new Map,c=a.ClanEmojiCreateRequest.encode(a.ClanEmojiCreateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s,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=a.ClanEmojiDeleteRequest.encode(a.ClanEmojiDeleteRequest.fromPartial({id:t,clan_id:i,emoji_label:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300)return(yield h.arrayBuffer()).byteLength>0?{}:{};throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,i,s={}){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=a.ClanEmojiUpdateRequest.encode(a.ClanEmojiUpdateRequest.fromPartial({id:i.id,shortname:i.shortname,clan_id:i.clan_id})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(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,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e,t={}){let i="/mezon.api.Mezon/EmojiRecentList",s=new Map,l="",d=this.buildFullUrl(this.basePath,i,s),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([g()(d,c).then(u=>m(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return a.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",s=new Map,l="",d=this.buildFullUrl(this.basePath,i,s),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([g()(d,c).then(u=>m(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return a.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 s="/mezon.api.Mezon/SearchMessage",l=new Map,c=a.SearchMessageRequest.encode(a.SearchMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreateEvent",l=new Map,c=a.Event.encode(a.Event.fromPartial({external:t.external,name:t.name,properties:t.properties})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/ListEvents",l=new Map,c=a.ListEventsRequest.encode(a.ListEventsRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreateEvent",l=new Map,c=a.CreateEventRequest.encode(a.CreateEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/UpdateEventUser",l=new Map,c=a.DeleteEventRequest.encode(a.DeleteEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s,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=a.DeleteEventRequest.encode(a.DeleteEventRequest.fromPartial({event_id:t,clan_id:i,creator_id:s,event_label:l,channel_id:d})).finish(),h=this.buildFullUrl(this.basePath,u,o),f=p("POST",c,"");return f.body=r,e&&(f.headers.Authorization="Bearer "+e),Promise.race([g()(h,f).then(_=>m(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300)return{};throw _})),new Promise((_,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,i,s={}){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=a.UpdateEventRequest.encode(a.UpdateEventRequest.fromPartial(i)).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,i,s={}){let l="/mezon.api.Mezon/DeleteFriends",d=new Map,u=a.DeleteFriendsRequest.encode(a.DeleteFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listFriends(e,t,i,s,l={}){let d="/mezon.api.Mezon/ListFriends",c=new Map,o=a.ListFriendsRequest.encode(a.ListFriendsRequest.fromPartial({limit:t,state:i,cursor:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.FriendList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,i,s={}){let l="/mezon.api.Mezon/AddFriends",d=new Map,u=a.AddFriendsRequest.encode(a.AddFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.AddFriendsResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,i,s={}){let l="/mezon.api.Mezon/BlockFriends",d=new Map,u=a.BlockFriendsRequest.encode(a.BlockFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,i,s={}){let l="/mezon.api.Mezon/UnblockFriends",d=new Map,u=a.BlockFriendsRequest.encode(a.BlockFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t,i={}){let s="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",l=new Map,c=a.NotificationClan.encode(a.NotificationClan.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GetUserProfileOnClan",l=new Map,c=a.ClanProfileRequest.encode(a.ClanProfileRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GetNotificationCategory",l=new Map,c=a.DefaultNotificationCategory.encode(a.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GetNotificationChannel",l=new Map,c=a.NotificationChannel.encode(a.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GetNotificationClan",l=new Map,c=a.NotificationClan.encode(a.NotificationClan.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GetNotificationReactMessage",l=new Map,c=a.NotifiReactMessage.encode(a.NotifiReactMessage.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GiveMeACoffee",l=new Map,c=a.GiveCoffeeEvent.encode(a.GiveCoffeeEvent.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreateLinkInviteUser",l=new Map,c=a.LinkInviteUserRequest.encode(a.LinkInviteUserRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/InviteUser",l=new Map,c=a.InviteUserRequest.encode(a.InviteUserRequest.fromPartial({invite_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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",s,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.InviteUserRes.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e,t={}){let i="/mezon.api.Mezon/ListChannelByUserId",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/MarkAsRead",l=new Map,c=a.MarkAsReadRequest.encode(a.MarkAsReadRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/SetMuteCategory",l=new Map,c=a.SetMuteRequest.encode(a.SetMuteRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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 s="/mezon.api.Mezon/SetMuteChannel",l=new Map,c=a.SetMuteRequest.encode(a.SetMuteRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s={}){let l="/mezon.api.Mezon/DeleteNotifications",d=new Map,u=a.DeleteNotificationsRequest.encode(a.DeleteNotificationsRequest.fromPartial({ids:t||[],category:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,i,s,l,d,c={}){let u="/mezon.api.Mezon/ListNotifications",o=new Map,r=a.ListNotificationsRequest.encode(a.ListNotificationsRequest.fromPartial({limit:t,clan_id:i,notification_id:s,category:l,direction:d})).finish(),h=this.buildFullUrl(this.basePath,u,o),f=p("POST",c,"");return f.body=r,e&&(f.headers.Authorization="Bearer "+e),Promise.race([g()(h,f).then(_=>m(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let A=yield _.arrayBuffer();return a.NotificationList.decode(new Uint8Array(A))}else throw _})),new Promise((_,A)=>setTimeout(()=>A(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 s="/mezon.api.Mezon/SetNotificationChannelSetting",l=new Map,c=a.SetNotificationRequest.encode(a.SetNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/SetNotificationClanSetting",l=new Map,c=a.SetDefaultNotificationRequest.encode(a.SetDefaultNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/SetNotificationCategorySetting",l=new Map,c=a.SetNotificationRequest.encode(a.SetNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/DeleteNotificationCategorySetting",l=new Map,c=a.DefaultNotificationCategory.encode(a.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/DeleteNotificationChannel",l=new Map,c=a.NotificationChannel.encode(a.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/DeleteNotiReactMessage",l=new Map,c=a.NotificationChannel.encode(a.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/SetNotificationReactMessage",l=new Map,c=a.NotificationChannel.encode(a.NotificationChannel.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/SetRoleChannelPermission",l=new Map,c=a.UpdateRoleChannelRequest.encode(a.UpdateRoleChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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,s,l={}){let d="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",c=new Map,o=a.PermissionRoleChannelListEventRequest.encode(a.PermissionRoleChannelListEventRequest.fromPartial({role_id:t,channel_id:i,user_id:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.PermissionRoleChannelListEventResponse.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,i,s,l,d={}){let c="/mezon.api.Mezon/DeletePinMessage",u=new Map,n=a.DeletePinMessage.encode(a.DeletePinMessage.fromPartial({id:t,message_id:i,channel_id:s,clan_id:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,i,s,l={}){let d="/mezon.api.Mezon/GetPinMessagesList",c=new Map,o=a.PinMessageRequest.encode(a.PinMessageRequest.fromPartial({message_id:t,channel_id:i,clan_id:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.PinMessagesList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(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 s="/mezon.api.Mezon/CreateMessage2Inbox",l=new Map,c=a.Message2InboxRequest.encode(a.Message2InboxRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreatePinMessage",l=new Map,c=a.PinMessageRequest.encode(a.PinMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GetPubKeys",l=new Map,c=a.GetPubKeysRequest.encode(a.GetPubKeysRequest.fromPartial({user_ids:t||[]})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/PushPubKey",l=new Map,c=a.PushPubKeyRequest.encode(a.PushPubKeyRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/AddRolesChannelDesc",l=new Map,c=a.AddRoleChannelDescRequest.encode(a.AddRoleChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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,s={}){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=a.ChangeChannelCategoryRequest.encode(a.ChangeChannelCategoryRequest.fromPartial(S(M({},i),{new_category_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,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 s="/mezon.api.Mezon/DeleteRoleChannelDesc",l=new Map,c=a.DeleteRoleRequest.encode(a.DeleteRoleRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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,s,l,d={}){let c="/mezon.api.Mezon/ListRoles",u=new Map,n=a.RoleListEventRequest.encode(a.RoleListEventRequest.fromPartial({clan_id:t,limit:i,state:s,cursor:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.RoleListEventResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/CreateRole",l=new Map,c=a.CreateRoleRequest.encode(a.CreateRoleRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.DeleteRoleRequest.encode(a.DeleteRoleRequest.fromPartial(S(M({},i),{role_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,i,s,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=a.DeleteRoleRequest.encode(a.DeleteRoleRequest.fromPartial({role_id:t,channel_id:i,clan_id:s,role_label:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}updateRole(e,t,i,s={}){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=a.UpdateRoleRequest.encode(a.UpdateRoleRequest.fromPartial(S(M({},i),{role_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,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 s="/mezon.api.Mezon/ListRolePermissions",l=new Map,c=a.ListPermissionsRequest.encode(a.ListPermissionsRequest.fromPartial({role_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,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=a.ListRoleUsersRequest.encode(a.ListRoleUsersRequest.fromPartial({role_id:t,limit:i,cursor:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.RoleUserList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,i,s={}){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=a.ListPermissionOfUsersRequest.encode(a.ListPermissionOfUsersRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.RoleList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,i,s,l={}){let d="/mezon.api.Mezon/SearchThread",c=new Map,o=a.SearchThreadRequest.encode(a.SearchThreadRequest.fromPartial({clan_id:t,channel_id:i,label:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.ChannelDescList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(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 s="/mezon.api.Mezon/SendToken",l=new Map,c=a.TokenSentEvent.encode(a.TokenSentEvent.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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 s="/mezon.api.Mezon/SessionLogout",l=new Map,c=a.SessionLogoutRequest.encode(a.SessionLogoutRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/AddClanSticker",l=new Map,c=a.ClanStickerAddRequest.encode(a.ClanStickerAddRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s,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=a.ClanStickerDeleteRequest.encode(a.ClanStickerDeleteRequest.fromPartial({id:t,clan_id:i,sticker_label:s})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300)return{};throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,i,s={}){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=a.ClanStickerUpdateByIdRequest.encode(a.ClanStickerUpdateByIdRequest.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e,t={}){let i="/mezon.api.Mezon/GetListStickersByUserId",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/RegisterStreamingChannel",l=new Map,c=a.RegisterStreamingChannelRequest.encode(a.RegisterStreamingChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,l,d,c,u={}){let o="/mezon.api.Mezon/ListStreamingChannelUsers",n=new Map,h=a.ListChannelUsersRequest.encode(a.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:i,channel_type:s,limit:l,state:d,cursor:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return a.StreamingChannelUserList.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e,t={}){let i="/mezon.api.Mezon/GetSystemMessagesList",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/CreateSystemMessage",l=new Map,c=a.SystemMessageRequest.encode(a.SystemMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s={}){let l="/mezon.api.Mezon/ListSdTopic",d=new Map,u=a.ListSdTopicRequest.encode(a.ListSdTopicRequest.fromPartial({clan_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.SdTopicList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/CreateSdTopic",l=new Map,c=a.SdTopicRequest.encode(a.SdTopicRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/DeleteSystemMessage",l=new Map,c=a.DeleteSystemMessage.encode(a.DeleteSystemMessage.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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 s="/mezon.api.Mezon/GetSystemMessageByClanId",l=new Map,c=a.GetSystemMessage.encode(a.GetSystemMessage.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.SystemMessageRequest.encode(a.SystemMessageRequest.fromPartial(S(M({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,i,s,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,h=a.ListThreadRequest.encode(a.ListThreadRequest.fromPartial({channel_id:t,limit:i,state:s,clan_id:l,thread_id:d,page:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return a.ChannelDescListNoPool.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,i,s={}){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=a.UpdateCategoryDescRequest.encode(a.UpdateCategoryDescRequest.fromPartial(S(M({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/UpdateChannelPrivate",l=new Map,c=a.ChangeChannelPrivateRequest.encode(a.ChangeChannelPrivateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(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,s={}){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=a.UpdateClanProfileRequest.encode(a.UpdateClanProfileRequest.fromPartial(S(M({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/UploadOauthFile",l=new Map,c=a.UploadAttachmentRequest.encode(a.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/UploadAttachmentFile",l=new Map,c=a.UploadAttachmentRequest.encode(a.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.UploadAttachment.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFile(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",l=new Map,c=a.UploadAttachmentRequest.encode(a.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.MultipartUploadAttachment.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFileFinsih(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",l=new Map,c=a.MultipartUploadAttachmentFinishRequest.encode(a.MultipartUploadAttachmentFinishRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){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))])}updateUser(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateUser",l=new Map,c=a.UpdateUsersRequest.encode(a.UpdateUsersRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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,s={}){let l="/mezon.api.Mezon/ListUserPermissionInChannel",d=new Map,u=a.UserPermissionInChannelListRequest.encode(a.UserPermissionInChannelListRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.UserPermissionInChannelListResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e,t={}){let i="/mezon.api.Mezon/GetUserStatus",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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 s="/mezon.api.Mezon/UpdateUserStatus",l=new Map,c=a.UserStatusUpdate.encode(a.UserStatusUpdate.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/GenerateWebhook",l=new Map,c=a.WebhookCreateRequest.encode(a.WebhookCreateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.WebhookUpdateRequestById.encode(a.WebhookUpdateRequestById.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,i,s={}){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=a.WebhookListRequest.encode(a.WebhookListRequest.fromPartial({channel_id:t,clan_id:i||""})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.WebhookListResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,i,s={}){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=a.WebhookDeleteRequestById.encode(a.WebhookDeleteRequestById.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,i){let s=e+t+"?";for(let[l,d]of i)d instanceof Array?s+=d.reduce((c,u)=>c+encodeURIComponent(l)+"="+encodeURIComponent(u)+"&",""):d!=null&&(s+=encodeURIComponent(l)+"="+encodeURIComponent(d)+"&");return s}editChannelCanvases(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/EditChannelCanvases",l=new Map,c=a.EditChannelCanvasRequest.encode(a.EditChannelCanvasRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s,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=a.ChannelCanvasDetailRequest.encode(a.ChannelCanvasDetailRequest.fromPartial({id:t,clan_id:i||"",channel_id:s||""})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.ChannelCanvasDetailResponse.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,i,s,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=a.DeleteChannelCanvasRequest.encode(a.DeleteChannelCanvasRequest.fromPartial({canvas_id:t,clan_id:i||"",channel_id:s||""})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,i,s,l,d={}){let c="/mezon.api.Mezon/ListOnboarding",u=new Map,n=a.ListOnboardingRequest.encode(a.ListOnboardingRequest.fromPartial({clan_id:t,guide_type:i,limit:s,page:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.ListOnboardingResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/CreateOnboarding",l=new Map,c=a.CreateOnboardingRequest.encode(a.CreateOnboardingRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.OnboardingRequest.encode(a.OnboardingRequest.fromPartial({id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,i,s={}){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=a.OnboardingRequest.encode(a.OnboardingRequest.fromPartial({id:t,clan_id:i||""})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.OnboardingItem.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,i,s={}){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=a.UpdateOnboardingRequest.encode(a.UpdateOnboardingRequest.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",s,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,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 s="/mezon.api.Mezon/GenerateClanWebhook",l=new Map,c=a.GenerateClanWebhookRequest.encode(a.GenerateClanWebhookRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/ListClanWebhook",l=new Map,c=a.ListClanWebhookRequest.encode(a.ListClanWebhookRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){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=a.ClanWebhookRequest.encode(a.ClanWebhookRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,i,s={}){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=S(M({},i),{id:t}),o=a.UpdateClanWebhookRequest.encode(a.UpdateClanWebhookRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t,i={}){let s="/mezon.api.Mezon/GetTopicDetail",l=new Map,d={topic_id:t},u=a.SdTopicDetailRequest.encode(a.SdTopicDetailRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,s,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.SdTopic.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,i,s,l={}){let d="/mezon.api.Mezon/ListOnboardingStep",c=new Map,u={clan_id:t,limit:i,page:s},n=a.ListOnboardingStepRequest.encode(a.ListOnboardingStepRequest.fromPartial(u)).finish(),r=this.buildFullUrl(this.basePath,d,c),h=p("POST",l,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.ListOnboardingStepResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,i,s={}){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=S(M({},i),{clan_id:t}),o=a.UpdateOnboardingStepRequest.encode(a.UpdateOnboardingStepRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,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 s="/mezon.api.Mezon/CreateRoomChannelApps",l=new Map,c=a.CreateRoomChannelApps.encode(a.CreateRoomChannelApps.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GenerateMeetToken",l=new Map,c=a.GenerateMeetTokenRequest.encode(a.GenerateMeetTokenRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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,s={}){let l="/mezon.api.Mezon/GetMezonOauthClient",d=new Map,c={client_id:t,client_name:i},o=a.GetMezonOauthClientRequest.encode(a.GetMezonOauthClientRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return a.MezonOauthClient.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(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 s="/mezon.api.Mezon/UpdateMezonOauthClient",l=new Map,c=a.MezonOauthClient.encode(a.MezonOauthClient.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/GenerateHashChannelApps",l=new Map,d={app_id:t},u=a.GenerateHashChannelAppsRequest.encode(a.GenerateHashChannelAppsRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,s,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.GenerateHashChannelAppsResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/AddUserEvent",l=new Map,c=a.UserEventRequest.encode(a.UserEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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,s={}){let l="/mezon.api.Mezon/DeleteUserEvent",d=new Map,c={clan_id:t,event_id:i},o=a.UserEventRequest.encode(a.UserEventRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,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 s="/mezon.api.Mezon/UpdateRoleOrder",l=new Map,c=a.UpdateRoleOrderRequest.encode(a.UpdateRoleOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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",s=new Map,l=this.buildFullUrl(this.basePath,i,s),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return a.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,s,l,d,c={}){if(i==null)throw new Error("'token' is a required parameter but is null or undefined.");let u="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(i))),o=new Map;o.set("username",s),o.set("metadata",l),o.set("is_guest",d);let n="",r=this.buildFullUrl(t,u,o),h=p("POST",c,n);return e&&(h.headers.Authorization="Bearer "+e),h.headers.Accept="application/x-protobuf",h.headers["Content-Type"]="application/json",Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.GenerateMeetTokenExternalResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/MuteParticipantMezonMeet",l=new Map,c=a.MeetParticipantRequest.encode(a.MeetParticipantRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/RemoveParticipantMezonMeet",l=new Map,c=a.MeetParticipantRequest.encode(a.MeetParticipantRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/ListChannelDetail",l=new Map,d={channel_id:t},u=a.ListChannelDetailRequest.encode(a.ListChannelDetailRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,s,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.ChannelDescription.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listChannelTimeline(e,t,i={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListChannelTimeline",l=new Map,c=a.ListChannelTimelineRequest.encode(a.ListChannelTimelineRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.ListChannelTimelineResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createChannelTimeline(e,t,i={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateChannelTimeline",l=new Map,c=a.CreateChannelTimelineRequest.encode(a.CreateChannelTimelineRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.CreateChannelTimelineResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateChannelTimeline(e,t,i={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateChannelTimeline",l=new Map,c=a.UpdateChannelTimelineRequest.encode(a.UpdateChannelTimelineRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.UpdateChannelTimelineResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}detailChannelTimeline(e,t,i={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/DetailChannelTimeline",l=new Map,c=a.ChannelTimelineDetailRequest.encode(a.ChannelTimelineDetailRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.ChannelTimelineDetailResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(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 s="/mezon.api.Mezon/UpdateClanOrder",l=new Map,c=a.UpdateClanOrderRequest.encode(a.UpdateClanOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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,s,l={}){if(s==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(s||{});let o=this.buildFullUrl(i,d,c),n=p("POST",l,u);return e&&(n.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),n.headers.Accept="application/x-protobuf",n.headers["Content-Type"]="application/json",Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.ListClanDiscover.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,i,s,l,d,c,u={}){let o="/mezon.api.Mezon/DeleteQuickMenuAccess",n=new Map,r={id:t,clan_id:i,bot_id:s,menu_name:l,background:d,action_msg:c},f=a.QuickMenuAccess.encode(a.QuickMenuAccess.fromPartial(r)).finish(),_=this.buildFullUrl(this.basePath,o,n),A=p("POST",u,"");return A.body=f,e&&(A.headers.Authorization="Bearer "+e),Promise.race([g()(_,A).then(P=>{if(P.status==204)return P;if(P.status>=200&&P.status<300)return P;throw P}),new Promise((P,R)=>setTimeout(R,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,i,s,l={}){let d="/mezon.api.Mezon/ListQuickMenuAccess",c=new Map,u={bot_id:t,channel_id:i,menu_type:s},n=a.ListQuickMenuAccessRequest.encode(a.ListQuickMenuAccessRequest.fromPartial(u)).finish(),r=this.buildFullUrl(this.basePath,d,c),h=p("POST",l,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return a.QuickMenuAccessList.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(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 s="/mezon.api.Mezon/AddQuickMenuAccess",l=new Map,c=a.QuickMenuAccess.encode(a.QuickMenuAccess.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/UpdateQuickMenuAccess",l=new Map,c=a.QuickMenuAccess.encode(a.QuickMenuAccess.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/ListForSaleItems",l=new Map,d={page:t},u=a.ListForSaleItemsRequest.encode(a.ListForSaleItemsRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,s,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.ForSaleItemList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(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 s="/mezon.api.Mezon/IsFollower",l=new Map,c=a.IsFollowerRequest.encode(a.IsFollowerRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/TransferOwnership",l=new Map,c=a.TransferOwnershipRequest.encode(a.TransferOwnershipRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(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 s="/mezon.api.Mezon/UpdateUsername",l=new Map,c=a.UpdateUsernameRequest.encode(a.UpdateUsernameRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.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 s="/mezon.api.Mezon/IsBanned",l=new Map,d={channel_id:t},u=a.IsBannedRequest.encode(a.IsBannedRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,s,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return a.IsBannedResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,i,s={}){let l="/mezon.api.Mezon/ReportMessageAbuse",d=new Map,c={message_id:t,abuse_type:i},o=a.ReportMessageAbuseReqest.encode(a.ReportMessageAbuseReqest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,i,s,l,d,c,u,o,n,r,h,f,_){let A="/mezon.api.Mezon/SendChannelMessage",P=new Map,w=a.ChannelMessageSend.encode(a.ChannelMessageSend.fromPartial({clan_id:t,channel_id:i,mode:s,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:h,code:f,topic_id:_})).finish(),v=this.buildFullUrl(this.basePath,A,P),U=p("POST",{},"");return U.body=w,e&&(U.headers.Authorization="Bearer "+e),Promise.race([g()(v,U).then(E=>m(this,null,function*(){if(E.status==204)return{};if(E.status>=200&&E.status<300){let x=yield E.arrayBuffer();return a.ChannelMessageSend.decode(new Uint8Array(x))}else throw E})),new Promise((E,x)=>setTimeout(()=>x(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,i,s,l,d,c,u,o,n,r,h){let f="/mezon.api.Mezon/UpdateChannelMessage",_=new Map,P=a.ChannelMessageUpdate.encode(a.ChannelMessageUpdate.fromPartial({clan_id:t,channel_id:i,message_id:d,mode:s,is_public:l,content:c,mentions:u,attachments:o,hide_editted:n,topic_id:r,is_update_msg_topic:h})).finish(),R=this.buildFullUrl(this.basePath,f,_),w=p("POST",{},"");return w.body=P,e&&(w.headers.Authorization="Bearer "+e),Promise.race([g()(R,w).then(v=>m(this,null,function*(){if(v.status==204)return{};if(v.status>=200&&v.status<300){let U=yield v.arrayBuffer();return a.ChannelMessageUpdate.decode(new Uint8Array(U))}else throw v})),new Promise((v,U)=>setTimeout(()=>U(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,i,s,l,d,c,u,o,n){let r="/mezon.api.Mezon/DeleteChannelMessage",h=new Map,_=a.ChannelMessageRemove.encode(a.ChannelMessageRemove.fromPartial({clan_id:t,channel_id:i,message_id:d,mode:s,is_public:l,has_attachment:c,mentions:o,references:n,topic_id:u})).finish(),A=this.buildFullUrl(this.basePath,r,h),P=p("POST",{},"");return P.body=_,e&&(P.headers.Authorization="Bearer "+e),Promise.race([g()(A,P).then(R=>m(this,null,function*(){if(R.status==204)return{};if(R.status>=200&&R.status<300){let w=yield R.arrayBuffer();return a.ChannelMessageRemove.decode(new Uint8Array(w))}else throw R})),new Promise((R,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,i,s,l,d,c={}){let u="/mezon.api.Mezon/UpdateMezonVoiceState",o=new Map,n={clan_id:t,channel_id:i,display_name:s,room_name:l,state:d},h=a.HandleParticipantMeetStateEvent.encode(a.HandleParticipantMeetStateEvent.fromPartial(n)).finish(),f=this.buildFullUrl(this.basePath,u,o),_=p("POST",c,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).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."))])}messageButtonClick(e,t,i,s,l,d,c,u={}){let o="/mezon.api.Mezon/MessageButtonClick",n=new Map,r={message_id:t,channel_id:i,button_id:s,sender_id:l,user_id:d,extra_data:c},f=a.MessageButtonClicked.encode(a.MessageButtonClicked.fromPartial(r)).finish(),_=this.buildFullUrl(this.basePath,o,n),A=p("POST",u,"");return A.body=f,e&&(A.headers.Authorization="Bearer "+e),Promise.race([g()(_,A).then(P=>{if(P.status==204)return P;if(P.status>=200&&P.status<300)return P;throw P}),new Promise((P,R)=>setTimeout(R,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,i,s,l,d,c,u={}){let o="/mezon.api.Mezon/DropdownBoxSelected",n=new Map,r={message_id:t,channel_id:i,selectbox_id:s,sender_id:l,user_id:d,values:c},f=a.DropdownBoxSelected.encode(a.DropdownBoxSelected.fromPartial(r)).finish(),_=this.buildFullUrl(this.basePath,o,n),A=p("POST",u,"");return A.body=f,e&&(A.headers.Authorization="Bearer "+e),Promise.race([g()(_,A).then(P=>{if(P.status==204)return P;if(P.status>=200&&P.status<300)return P;throw P}),new Promise((P,R)=>setTimeout(R,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,i,s={}){let l="/mezon.api.Mezon/ActiveArchivedThread",d=new Map,c={clan_id:t,channel_id:i},o=a.ActiveArchivedThread.encode(a.ActiveArchivedThread.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,i,s={}){let l="/mezon.api.Mezon/AddAgentToChannel",d=new Map,c={room_name:t,channel_id:i},o=a.UpdateAIAgentRequest.encode(a.UpdateAIAgentRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,i,s={}){let l="/mezon.api.Mezon/DisconnectAgent",d=new Map,c={room_name:t,channel_id:i},o=a.UpdateAIAgentRequest.encode(a.UpdateAIAgentRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",s,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listMutedChannel(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListMutedChannel",l=new Map,c=a.ListMutedChannelRequest.encode(a.ListMutedChannelRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return a.MutedChannelList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,i,s,l,d,c,u,o,n,r,h,f,_){let A="/mezon.api.Mezon/ReactChannelMessage",P=new Map,w=a.MessageReaction.encode(a.MessageReaction.fromPartial({clan_id:t,channel_id:i,mode:s,is_public:l,message_id:d,emoji_id:c,emoji:u,count:o,message_sender_id:n,action:r,emoji_recent_id:f,sender_name:_,topic_id:h})).finish(),v=this.buildFullUrl(this.basePath,A,P),U=p("POST",{},"");return U.body=w,e&&(U.headers.Authorization="Bearer "+e),Promise.race([g()(v,U).then(E=>m(this,null,function*(){if(E.status==204)return{};if(E.status>=200&&E.status<300){let x=yield E.arrayBuffer();return a.ChannelMessageSend.decode(new Uint8Array(x))}else throw E})),new Promise((E,x)=>setTimeout(()=>x(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t,i={}){var n,r,h,f,_,A;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreatePoll",l=new Map,c=a.CreatePollRequest.encode(a.CreatePollRequest.fromPartial({channel_id:(n=t.channel_id)!=null?n:"0",clan_id:(r=t.clan_id)!=null?r:"0",question:(h=t.question)!=null?h:"",answers:(f=t.answers)!=null?f:[],expire_hours:(_=t.expire_hours)!=null?_:0,type:(A=t.type)!=null?A:0})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(P=>m(this,null,function*(){if(P.status==204)return{};if(P.status>=200&&P.status<300){let R=yield P.arrayBuffer(),w=a.CreatePollResponse.decode(new Uint8Array(R));return{poll_id:w.poll_id,message_id:w.message_id,question:w.question,answers:w.answers.map(v=>({index:v.index,label:v.label})),answer_counts:w.answer_counts,exp:w.exp,is_closed:w.is_closed,creator_id:w.creator_id,type:w.type,total_votes:w.total_votes}}else throw P})),new Promise((P,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t,i={}){var n,r,h,f;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/VotePoll",l=new Map,c=a.VotePollRequest.encode(a.VotePollRequest.fromPartial({poll_id:(n=t.poll_id)!=null?n:"0",message_id:(r=t.message_id)!=null?r:"0",channel_id:(h=t.channel_id)!=null?h:"0",answer_indices:(f=t.answer_indices)!=null?f:[]})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(_=>{if(_.status==204||_.status>=200&&_.status<300)return{};throw _}),new Promise((_,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t,i={}){var n,r,h;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ClosePoll",l=new Map,c=a.ClosePollRequest.encode(a.ClosePollRequest.fromPartial({poll_id:(n=t.poll_id)!=null?n:"0",message_id:(r=t.message_id)!=null?r:"0",channel_id:(h=t.channel_id)!=null?h:"0"})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(f=>{if(f.status==204||f.status>=200&&f.status<300)return{};throw f}),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t,i={}){var n,r,h;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/GetPoll",l=new Map,c=a.GetPollRequest.encode(a.GetPollRequest.fromPartial({poll_id:(n=t.poll_id)!=null?n:"0",message_id:(r=t.message_id)!=null?r:"0",channel_id:(h=t.channel_id)!=null?h:"0"})).finish(),u=this.buildFullUrl(this.basePath,s,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer(),A=a.GetPollResponse.decode(new Uint8Array(_));return{poll_id:A.poll_id,message_id:A.message_id,question:A.question,answers:A.answers.map(P=>({index:P.index,label:P.label})),answer_counts:A.answer_counts,exp:A.exp,is_closed:A.is_closed,creator_id:A.creator_id,type:A.type,total_votes:A.total_votes,voter_details:A.voter_details.map(P=>({answer_index:P.answer_index,user_ids:P.user_ids}))}}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}};var V=K(require("js-base64")),L=class y{constructor(e,t,i,s,l,d,c){this.created=i;this.api_url=s;this.ws_url=l;this.id_token=d;this.token=e,this.refresh_token=t,this.id_token=d,this.api_url=s,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 s=e.split(".");if(s.length!=3)throw"jwt is not valid.";let l=JSON.parse(V.atob(s[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(V.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,s,l){return new y(e,t,!1,i,s,"",l)}};var Y=Symbol.for("mezon.refreshTokenManager"),G=class y{constructor(){this.pendingRefreshes=new Map}static getInstance(){let e=globalThis;return e[Y]||(e[Y]=new y),e[Y]}refresh(e,t){return m(this,null,function*(){let i=this.pendingRefreshes.get(e);if(i)return i;let s=t().finally(()=>{this.pendingRefreshes.delete(e)});return this.pendingRefreshes.set(e,s),s})}isRefreshing(e){return this.pendingRefreshes.has(e)}get pendingCount(){return this.pendingRefreshes.size}};var ie=require("mezon-js-protobuf");function Se(y){let e,t,i,s,l,d;try{e=b(y.channel_message.content)}catch(u){console.log("content is invalid",u)}try{t=I(y.channel_message.reactions)}catch(u){console.log("reactions is invalid",u)}try{i=W(y.channel_message.mentions)}catch(u){console.log("mentions is invalid",u)}try{s=F(y.channel_message.attachments)}catch(u){console.log("attachments is invalid",u)}try{l=N(y.channel_message.references)}catch(u){console.log("references is invalid",u)}try{d=y.channel_message.referenced_message}catch(u){console.log("referenced messages is invalid",u)}return{id:y.id||y.channel_message.message_id,avatar:y.channel_message.avatar,channel_id:y.channel_message.channel_id,mode:y.channel_message.mode,channel_label:y.channel_message.channel_label,clan_id:y.channel_message.clan_id,code:y.channel_message.code,message_id:y.channel_message.message_id,sender_id:y.channel_message.sender_id,update_time:y.channel_message.update_time,clan_logo:y.channel_message.clan_logo,category_name:y.channel_message.category_name,username:y.channel_message.username,clan_nick:y.channel_message.clan_nick,clan_avatar:y.channel_message.clan_avatar,display_name:y.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:i==null?void 0:i.mentions,attachments:s==null?void 0:s.attachments,referenced_message:d,references:l==null?void 0:l.refs,hide_editted:y.channel_message.hide_editted,is_public:y.channel_message.is_public,create_time_seconds:y.channel_message.create_time_seconds,update_time_seconds:y.channel_message.update_time_seconds,topic_id:y.channel_message.topic_id}}var ne=!1,q={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},B=class B{constructor(e,t,i=!1,s=!1,l=new ie.WebSocketAdapterPb,d=B.DefaultSendTimeoutMs){this.host=e;this.port=t;this.useSSL=i;this.verbose=s;this.adapter=l;this.sendTimeoutMs=d;this.cIds={},this.nextCid=1,this._heartbeatTimeoutMs=B.DefaultHeartbeatTimeoutMs,this._connectionState=q.DISCONNECTED}generatecid(){let e=this.nextCid.toString();return++this.nextCid,e}isOpen(){return this._connectionState===q.CONNECTED}connect(e,t=!1,i="",s=B.DefaultConnectTimeoutMs,l){if(this._connectionState===q.CONNECTED)return Promise.resolve(e);if(this._connectionState===q.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=q.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=q.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(u)},this.adapter.onMessage=u=>m(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?j(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=Se(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):u.aiagent_enabled_event?this.onaiagentenabled(u.aiagent_enabled_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=ne;ne=!0,this.clearConnectTimeout(),this._connectionState=q.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,u(e),r&&this.onreconnect(n)},this.adapter.onError=n=>{this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(n),this._connectPromise=void 0,this.adapter.close(),o(n)},this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.close(),this._connectPromise=void 0,o("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},s)});return this._connectPromise=c,this._connectPromise}disconnect(e=!0){this._connectionState=q.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=q.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)}onaiagentenabled(e){this.verbose&&window&&window.console&&console.log(e)}send(e,t=B.DefaultSendTimeoutMs){let i=e;return new Promise((s,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:s,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 m(this,null,function*(){return(yield this.send({status_follow:{user_ids:e}})).status})}joinClanChat(e){return m(this,null,function*(){return(yield this.send({clan_join:{clan_id:e}})).clan_join})}follower(){return m(this,null,function*(){return(yield this.send({follow_event:{}})).follow_event})}joinChat(e,t,i,s){return m(this,null,function*(){return(yield this.send({channel_join:{clan_id:e,channel_id:t,channel_type:i,is_public:s}})).channel})}leaveChat(e,t,i,s){return this.send({channel_leave:{clan_id:e,channel_id:t,channel_type:i,is_public:s}})}removeChatMessage(e,t,i,s,l,d,c,u,o){return m(this,null,function*(){return(yield this.send({channel_message_remove:{clan_id:e,channel_id:t,mode:i,message_id:l,is_public:s,has_attachment:d,topic_id:c,mentions:u,references:o}})).channel_message_ack})}rpc(e,t,i){return m(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,s,l,d,c,u,o,n,r){return m(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:s,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,s,l,d,c,u,o,n,r,h,f,_){return m(this,null,function*(){return(yield this.send({quick_menu_event:{menu_name:e,message:{clan_id:t,channel_id:i,mode:s,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:h,code:f,topic_id:_}}})).ephemeral_message_send})}writeEphemeralMessage(e,t,i,s,l,d,c,u,o,n,r,h,f,_,A){return m(this,null,function*(){return(yield this.send({ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:i,mode:s,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:h,code:f,topic_id:_,id:A}}})).ephemeral_message_send})}writeChatMessage(e,t,i,s,l,d,c,u,o,n,r,h,f){return m(this,null,function*(){return(yield this.send({channel_message_send:{clan_id:e,channel_id:t,mode:i,is_public:s,content:l,mentions:d,attachments:c,references:u,anonymous_message:o,mention_everyone:n,avatar:r,code:h,topic_id:f}},1/0)).channel_message_ack})}writeMessageReaction(e,t,i,s,l,d,c,u,o,n,r,h,f,_){return m(this,null,function*(){return(yield this.send({message_reaction_event:{id:e,clan_id:t,channel_id:i,mode:s,is_public:l,message_id:d,emoji_id:c,emoji:u,count:o,message_sender_id:n,action:r,topic_id:h,emoji_recent_id:f,sender_name:_}})).message_reaction_event})}writeMessageTyping(e,t,i,s,l,d){return m(this,null,function*(){return(yield this.send({message_typing_event:{clan_id:e,channel_id:t,mode:i,is_public:s,sender_display_name:l,topic_id:d}})).message_typing_event})}writeLastSeenMessage(e,t,i,s,l,d){return m(this,null,function*(){return(yield this.send({last_seen_message_event:{clan_id:e,channel_id:t,mode:i,message_id:s,timestamp_seconds:l,badge_count:d}})).last_seen_message_event})}writeLastPinMessage(e,t,i,s,l,d,c,u,o,n,r,h,f){return m(this,null,function*(){return(yield this.send({last_pin_message_event:{clan_id:e,channel_id:t,mode:i,is_public:s,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:h,message_created_time:f}})).last_pin_message_event})}writeCustomStatus(e,t,i,s){return m(this,null,function*(){return(yield this.send({custom_status_event:{clan_id:e,status:t,time_reset:i,no_clear:s}})).custom_status_event})}checkDuplicateName(e,t,i,s){return m(this,null,function*(){return(yield this.send({check_name_existed_event:{name:e,condition_id:t,type:i,clan_id:s}})).check_name_existed_event})}writeVoiceReaction(e,t){return m(this,null,function*(){return(yield this.send({voice_reaction_send:{emojis:e,channel_id:t}})).voice_reaction_send})}forwardWebrtcSignaling(e,t,i,s,l){return m(this,null,function*(){return(yield this.send({webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:i,channel_id:s,caller_id:l}})).webrtc_signaling_fwd})}makeCallPush(e,t,i,s){return m(this,null,function*(){return(yield this.send({incoming_call_push:{receiver_id:e,json_data:t,channel_id:i,caller_id:s}})).incoming_call_push})}writeChannelAppEvent(e,t,i){return m(this,null,function*(){return(yield this.send({channel_app_event:{clan_id:e,channel_id:t,action:i}})).channel_app_event})}listDataSocket(e){return m(this,null,function*(){return(yield this.send({list_data_socket:e})).list_data_socket})}pingPong(){return m(this,null,function*(){if(!this.isOpen()){this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop();return}try{yield this.send({ping:{}},this._heartbeatTimeoutMs)}catch(e){this._connectionState=q.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)}};B.DefaultHeartbeatTimeoutMs=1e4,B.DefaultSendTimeoutMs=1e4,B.DefaultConnectTimeoutMs=3e4;var D=B;var re=require("mezon-js-protobuf");var Ue="127.0.0.1",qe="7350",Ee="defaultkey",ke=3e4,se=(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))(se||{}),ae=(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))(ae||{}),oe=(i=>(i[i.ALL_MESSAGE=1]="ALL_MESSAGE",i[i.MENTION_MESSAGE=2]="MENTION_MESSAGE",i[i.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",i))(oe||{}),ue=(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))(ue||{}),$=class{constructor(e=Ee,t=Ue,i=qe,s=!1,l=ke,d=!0){this.serverkey=e;this.timeout=l;this.autoRefreshSession=d;this.refreshTokenManager=G.getInstance();this.host=t,this.port=i,this.useSSL=s;let u=`${s?"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,s,l={},d={}){let c={token:e,vars:l};return this.apiClient.authenticateMezon(this.serverkey,"",c,t,i,s,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 s={username:t,account:{phoneno:e,vars:i}};return this.apiClient.AuthenticateSMSOTPRequest(this.serverkey,"",s,t).then(l=>Promise.resolve(l))}authenticateEmailOTPRequest(e,t,i){let s={username:t,account:{email:e,vars:i}};return this.apiClient.AuthenticateEmailOTPRequest(this.serverkey,"",s,t).then(l=>Promise.resolve(l))}confirmAuthenticateOTP(e){return m(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,s){let l={username:i,account:{email:e,password:t,vars:s}};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 m(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(s=>s!==void 0)})}addFriends(e,t,i){return m(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 m(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(s=>Promise.resolve(s!=null))})}unblockFriends(e,t,i){return m(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(s=>Promise.resolve(s!=null))})}uploadOauthFile(e,t){return m(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 m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.uploadAttachmentFile(e.token,t)})}multipartUploadAttachmentFile(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.multipartUploadAttachmentFile(e.token,t)})}multipartUploadAttachmentFileFinish(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.multipartUploadAttachmentFileFinsih(e.token,t)})}createChannelDesc(e,t){return m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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,s=!1,l=new re.WebSocketAdapterPb,d=D.DefaultSendTimeoutMs){return new D(t,i,e,s,l,d)}deleteFriends(e,t,i){return m(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(s=>s!==void 0)})}deleteChannelDesc(e,t,i){return m(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(s=>s!==void 0)})}deleteClanDesc(e,t){return m(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,s){return m(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,s).then(l=>l!==void 0)})}deleteNotifications(e,t,i){return m(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(s=>Promise.resolve(s!=null))})}deleteRole(e,t,i,s){return m(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,s).then(l=>l!==void 0)})}deleteEvent(e,t,i,s,l,d){return m(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,s,l,d).then(c=>c!==void 0)})}updateEventUser(e,t){return m(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 m(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 m(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 m(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(s=>Promise.resolve(s!=null))})}listBannedUsers(e,t,i){return m(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(s=>Promise.resolve(s))})}unbanClanUsers(e,t,i,s){return m(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,s).then(l=>Promise.resolve(l!=null))})}banClanUsers(e,t,i,s,l){return m(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,s,l).then(d=>Promise.resolve(d!=null))})}removeChannelUsers(e,t,i){return m(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(s=>Promise.resolve(s!=null))})}listChannelMessages(e,t,i,s,l,d,c){return m(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,s,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,h,f,_,A;try{r=b(n.content)}catch(P){console.log("error parse content",P)}try{let P=I(n.reactions);h=(P==null?void 0:P.reactions)||P||b(n.reactions||"[]")}catch(P){h=b(n.reactions||"[]")}try{let P=W(n.mentions);f=(P==null?void 0:P.mentions)||P||b(n.mentions||"[]")}catch(P){f=b(n.mentions||"[]")}try{let P=F(n.attachments);_=(P==null?void 0:P.attachments)||P||b(n.attachments||"[]")}catch(P){_=b(n.attachments||"[]")}try{let P=N(n.references);A=(P==null?void 0:P.refs)||P||b(n.references||"[]")}catch(P){A=b(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:_,mentions:f,reactions:h,references:A,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 m(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(s=>{let l={voice_channel_users:[]};return s.voice_channel_users==null||s.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,s,l,d,c){return m(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,s,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,s,l,d,c,u){return m(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,s,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 m(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 s={clan_users:[],cursor:i.cursor,clan_id:i.clan_id};return i.clan_users==null||i.clan_users.forEach(l=>{var d;s.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,join_time_seconds:l.user.join_time_seconds},role_id:l.role_id,clan_nick:l.clan_nick,clan_avatar:l.clan_avatar})}),Promise.resolve(s)})})}listChannelDetail(e,t){return m(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,s,l,d,c){return m(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,s,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 m(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,s){return m(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,s).then(l=>{let d={clandesc:[]};return l.clandesc==null||(d.clandesc=l.clandesc),Promise.resolve(d)})})}listCategoryDescs(e,t,i,s){return m(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,s).then(l=>{let d={categorydesc:[]};return l.categorydesc==null||(d.categorydesc=l.categorydesc),Promise.resolve(d)})})}listEvents(e,t){return m(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 m(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 m(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,s){return m(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,s).then(l=>Promise.resolve(l))})}registFCMDeviceToken(e,t,i,s,l){return m(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,s,l).then(d=>Promise.resolve(d))})}getUserProfileOnClan(e,t){return m(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 m(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 m(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 m(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 m(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 m(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,s){return m(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,s).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,s,l,d){return m(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,s,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?j(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,s,l){return m(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:s,platform:l}).then(d=>d!==void 0)})}sessionRefresh(i){return m(this,arguments,function*(e,t={}){if(!e)return console.error("Cannot refresh a null session."),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");let s=yield this.refreshTokenManager.refresh(e.refresh_token,()=>m(this,null,function*(){try{let l=yield this.apiClient.sessionRefresh(this.serverkey,"",{token:e.refresh_token,vars:t,is_remember:e.is_remember});return{token:l.token,refresh_token:l.refresh_token,is_remember:l.is_remember||!1}}catch(l){throw console.error("Session refresh failed:",l),l}}));return e.update(s.token,s.refresh_token,s.is_remember),this.onRefreshSession(s),e})}unlinkEmail(e,t){return m(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 m(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 m(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 m(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(s=>s!==void 0)})}updateClanDesc(e,t,i){return m(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(s=>s!==void 0)})}updateCategory(e,t,i){return m(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(s=>s!==void 0)})}updateUserProfileByClan(e,t,i){return m(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(s=>s!==void 0)})}updateRole(e,t,i){return m(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(s=>s!==void 0)})}updateEvent(e,t,i){return m(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(s=>s!==void 0)})}updateApp(e,t,i){return m(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(s=>Promise.resolve(s))})}createLinkInviteUser(e,t){return m(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 m(this,null,function*(){return this.apiClient.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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 m(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,s){return m(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,s).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,s,l){return m(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,s,l).then(d=>d!==void 0)})}createClanEmoji(e,t){return m(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 m(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(s=>s!==void 0)})}deleteByIdClanEmoji(e,t,i,s){return m(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,s).then(l=>l!==void 0)})}generateWebhookLink(e,t){return m(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 m(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(s=>Promise.resolve(s))})}updateWebhookById(e,t,i){return m(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(s=>s!==void 0)})}deleteWebhookById(e,t,i){return m(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(s=>s!==void 0)})}addClanSticker(e,t){return m(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,s){return m(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,s).then(l=>l!==void 0)})}updateClanStickerById(e,t,i){return m(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(s=>s!==void 0)})}changeChannelCategory(e,t,i){return m(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(s=>s!==void 0)})}setRoleChannelPermission(e,t){return m(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 m(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 m(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 m(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 m(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(s=>s!==void 0)})}getSystemMessagesList(e){return m(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 m(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 m(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 m(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(s=>Promise.resolve(s))})}deleteSystemMessage(e,t){return m(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 m(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 m(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 m(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,s,l,d,c){return m(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,s,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 m(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 m(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 s={channel_apps:[]};return i.channel_apps==null||i.channel_apps.forEach(l=>{s.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(s)})})}getChannelCategoryNotiSettingsList(e,t){return m(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 m(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 m(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 m(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 m(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 m(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 m(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(s=>Promise.resolve(s))})}getListEmojisByUserId(e){return m(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 m(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 m(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 m(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,s,l){return m(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,s,l).then(d=>{let c={clan_id:t,roles:d.roles};return Promise.resolve(c)})})}listUserPermissionInChannel(e,t,i){return m(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(s=>{let l={clan_id:t,channel_id:i,permissions:s.permissions};return Promise.resolve(l)})})}getPermissionByRoleIdChannelId(e,t,i,s){return m(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,s).then(l=>{let d={role_id:t,channel_id:i,permission_role_channel:l.permission_role_channel,user_id:s};return Promise.resolve(d)})})}markAsRead(e,t){return m(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,s,l,d,c){return m(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,s,l,d,c).then(u=>{let o={channeldesc:[]};return u.channeldesc==null||(o.channeldesc=u.channeldesc),Promise.resolve(o)})})}listChannelTimeline(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelTimeline(e.token,t).then(i=>{var s;return(s=i.events)==null||s.forEach(l=>{l.attachments=[];let d;try{let c=z(l.preview_imgs);d=(c==null?void 0:c.attachments)||c||b(l.preview_imgs||"[]")}catch(c){d=b(l.preview_imgs||"[]")}Array.isArray(d)?l.preview_imgs=d:l.preview_imgs=[]}),Promise.resolve(i)})})}createChannelTimeline(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createChannelTimeline(e.token,t).then(i=>{let s=i.event;if(s){let l,d;try{let c=z(s.attachments),u=z(s.preview_imgs);l=(c==null?void 0:c.attachments)||c||b(s.attachments||"[]"),d=(u==null?void 0:u.attachments)||u||b(s.preview_imgs||"[]")}catch(c){l=b(s.attachments||"[]"),d=b(s.preview_imgs||"[]")}Array.isArray(l)?s.attachments=l:s.attachments=[],Array.isArray(d)?s.preview_imgs=d:s.preview_imgs=[]}return Promise.resolve(i)})})}updateChannelTimeline(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateChannelTimeline(e.token,t).then(i=>{let s=i.event;if(s){let l,d;try{let c=z(s.attachments),u=z(s.preview_imgs);l=(c==null?void 0:c.attachments)||c||b(s.attachments||"[]"),d=(u==null?void 0:u.attachments)||u||b(s.preview_imgs||"[]")}catch(c){l=b(s.attachments||"[]"),d=b(s.preview_imgs||"[]")}Array.isArray(l)?s.attachments=l:s.attachments=[],Array.isArray(d)?s.preview_imgs=d:s.preview_imgs=[]}return Promise.resolve(i)})})}detailChannelTimeline(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.detailChannelTimeline(e.token,t).then(i=>{let s=i.event;if(s){let l,d;try{let c=z(s.attachments),u=z(s.preview_imgs);l=(c==null?void 0:c.attachments)||c||b(s.attachments||"[]"),d=(u==null?void 0:u.attachments)||u||b(s.preview_imgs||"[]")}catch(c){l=b(s.attachments||"[]"),d=b(s.preview_imgs||"[]")}Array.isArray(l)?s.attachments=l:s.attachments=[],Array.isArray(d)?s.preview_imgs=d:s.preview_imgs=[]}return Promise.resolve(i)})})}leaveThread(e,t,i){return m(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(s=>Promise.resolve(s))})}getChannelSettingInClan(e,t,i,s,l,d,c,u,o,n,r){return m(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,s,l,d,c,u,o,n,r).then(h=>Promise.resolve(h))})}getChannelCanvasList(e,t,i,s,l){return m(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,s,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,s){return m(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,s).then(l=>Promise.resolve(l))})}editChannelCanvases(e,t){return m(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,s){return m(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,s).then(l=>l!==void 0)})}addFavoriteChannel(e,t,i){return m(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(s=>s)})}removeFavoriteChannel(e,t,i){return m(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(s=>s)})}getListFavoriteChannel(e,t){return m(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 m(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 m(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 m(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 m(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 m(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(s=>s)})}getChanEncryptionMethod(e,t){return m(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 m(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(s=>s)})}getPubKeys(e,t){return m(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 m(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 m(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,s,l){return m(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,s,l).then(d=>d)})}listOnboarding(e,t,i,s,l){return m(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,s,l).then(d=>d)})}getOnboardingDetail(e,t,i){return m(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(s=>Promise.resolve(s))})}createOnboarding(e,t){return m(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 m(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(s=>s!==void 0)})}deleteOnboarding(e,t,i){return m(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(s=>s!==void 0)})}generateClanWebhook(e,t){return m(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 m(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 m(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(s=>s!==void 0)})}updateClanWebhookById(e,t,i){return m(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(s=>s!==void 0)})}listOnboardingStep(e,t,i,s){return m(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,s).then(l=>Promise.resolve(l))})}updateOnboardingStepByClanId(e,t,i){return m(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(s=>s!==void 0)})}updateUserStatus(e,t){return m(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 m(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 m(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(s=>Promise.resolve(s))})}createSdTopic(e,t){return m(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 m(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 m(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 m(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 m(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 m(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(s=>Promise.resolve(s))})}updateMezonOauthClient(e,t){return m(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,s){return m(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,s).then(l=>Promise.resolve(l))})}generateHashChannelApps(e,t){return m(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,s){return m(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:s}).then(l=>Promise.resolve(l))})}addUserEvent(e,t){return m(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 m(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(s=>s!==void 0)})}updateRoleOrder(e,t){return m(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 m(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 m(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,s,l){return m(this,null,function*(){return this.apiClient.generateMeetTokenExternal("",e,t,i,s,l).then(d=>Promise.resolve(d))})}removeMezonMeetParticipant(e,t){return m(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 m(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 m(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 m(this,null,function*(){return this.apiClient.clanDiscover(this.serverkey,"",e,t).then(i=>Promise.resolve(i))})}listQuickMenuAccess(e,t,i,s){return m(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,s).then(l=>Promise.resolve(l))})}deleteQuickMenuAccess(e,t,i){return m(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(s=>s!==void 0)})}addQuickMenuAccess(e,t){return m(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 m(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 m(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 m(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 m(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 m(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 m(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(s=>s!==void 0)})}updateMezonVoiceState(e,t,i,s,l,d){return m(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,s,l,d).then(c=>c!==void 0)})}sendChannelMessage(e,t,i,s,l,d,c,u,o,n,r,h,f,_){return m(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,s,l,d,c,u,o,n,r,h,f,_).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,i,s,l,d,c,u,o,n,r,h){return m(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,s,l,d,c,u,o,n,r,h).then(f=>Promise.resolve(f))})}deleteChannelMessage(e,t,i,s,l,d,c,u,o,n){return m(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,s,l,d,c,u,o,n).then(r=>Promise.resolve(r))})}messageButtonClick(e,t,i,s,l,d,c){return m(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,s,l,d,c).then(u=>Promise.resolve(u))})}dropdownBoxSelected(e,t,i,s,l,d,c){return m(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,s,l,d,c).then(u=>Promise.resolve(u))})}activeArchivedThread(e,t,i){return m(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(s=>Promise.resolve(s))})}addAgentToChannel(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addAgentToChannel(e.token,t,i).then(s=>Promise.resolve(s))})}disconnectAgent(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.disconnectAgent(e.token,t,i).then(s=>Promise.resolve(s))})}listMutedChannel(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listMutedChannel(e.token,t).then(i=>Promise.resolve(i))})}channelMessageReact(e,t,i,s,l,d,c,u,o,n,r,h,f,_){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.channelMessageReact(e.token,t,i,s,l,d,c,u,o,n,r,h,f,_).then(A=>Promise.resolve(A))})}createPoll(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createPoll(e.token,t)})}votePoll(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.votePoll(e.token,t)})}closePoll(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.closePoll(e.token,t)})}getPoll(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getPoll(e.token,t)})}};
|