mezon-light-sdk 1.0.8 → 1.0.9
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/index.cjs.js +1 -1
- package/dist/index.esm.mjs +1 -1
- package/dist/src/types.d.ts +2 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var An=Object.create;var se=Object.defineProperty;var xn=Object.getOwnPropertyDescriptor;var Mn=Object.getOwnPropertyNames,Fe=Object.getOwnPropertySymbols,In=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty,Nn=Object.prototype.propertyIsEnumerable;var Ke=(e,n,t)=>n in e?se(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,xe=(e,n)=>{for(var t in n||(n={}))Ye.call(n,t)&&Ke(e,t,n[t]);if(Fe)for(var t of Fe(n))Nn.call(n,t)&&Ke(e,t,n[t]);return e};var Rn=(e,n)=>{for(var t in n)se(e,t,{get:n[t],enumerable:!0})},Ge=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Mn(n))!Ye.call(e,a)&&a!==t&&se(e,a,{get:()=>n[a],enumerable:!(r=xn(n,a))||r.enumerable});return e};var D=(e,n,t)=>(t=e!=null?An(In(e)):{},Ge(n||!e||!e.__esModule?se(t,"default",{value:e,enumerable:!0}):t,e)),On=e=>Ge(se({},"__esModule",{value:!0}),e);var g=(e,n,t)=>new Promise((r,a)=>{var i=c=>{try{l(t.next(c))}catch(d){a(d)}},o=c=>{try{l(t.throw(c))}catch(d){a(d)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,o);l((t=t.apply(e,n)).next())});var Bn={};Rn(Bn,{AuthenticationError:()=>X,CHANNEL_TYPE_DM:()=>U,CHANNEL_TYPE_GROUP:()=>L,CLAN_DM:()=>A,DEFAULT_SERVER_KEY:()=>J,LightClient:()=>Ee,LightSocket:()=>Ae,MEZON_GW_URL:()=>pe,SOCKET_READY_MAX_RETRY:()=>me,SOCKET_READY_RETRY_DELAY:()=>ge,STREAM_MODE_DM:()=>ye,STREAM_MODE_GROUP:()=>ke,SessionError:()=>he,SocketError:()=>O});module.exports=On(Bn);var pe="https://gw.mezon.ai",me=20,ge=100,A="0",U=3,L=2,ye=4,ke=3,J="DefaultServerKey";var Me=D(require("js-base64")),oe=class e{constructor(n,t,r,a,i,o,l){this.created=r;this.api_url=a;this.ws_url=i;this.id_token=o;this.token=n,this.refresh_token=t,this.id_token=o,this.api_url=a,this.ws_url=i,this.created_at=Math.floor(new Date().getTime()/1e3),this.is_remember=l,this.update(n,t,l)}isexpired(n){return this.expires_at-n<=0}isrefreshexpired(n){return this.refresh_expires_at-n<=0}update(n,t,r){let a=n.split(".");if(a.length!=3)throw"jwt is not valid.";let i=JSON.parse(Me.atob(a[1])),o=Math.floor(parseInt(i.exp));if(t){let l=t.split(".");if(l.length!=3)throw"refresh jwt is not valid.";let c=JSON.parse(Me.atob(l[1])),d=Math.floor(parseInt(c.exp));this.refresh_expires_at=d,this.refresh_token=t,this.is_remember=r}this.token=n,this.expires_at=o,this.username=i.usn,this.user_id=i.uid,this.vars=i.vrs}static restore(n,t,r,a,i){return new e(n,t,!1,r,a,"",i)}};var Ie=D(require("long")),f=D(require("protobufjs/minimal"));function Xe(){return{created:!1,token:"",refresh_token:"",user_id:"0",is_remember:!1,api_url:"",id_token:""}}var Re={encode(e,n=f.default.Writer.create()){return e.created!==!1&&n.uint32(8).bool(e.created),e.token!==""&&n.uint32(18).string(e.token),e.refresh_token!==""&&n.uint32(26).string(e.refresh_token),e.user_id!=="0"&&n.uint32(32).int64(e.user_id),e.is_remember!==!1&&n.uint32(40).bool(e.is_remember),e.api_url!==""&&n.uint32(50).string(e.api_url),e.id_token!==""&&n.uint32(58).string(e.id_token),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Xe();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.created=t.bool();continue;case 2:if(i!==18)break;a.token=t.string();continue;case 3:if(i!==26)break;a.refresh_token=t.string();continue;case 4:if(i!==32)break;a.user_id=m(t.int64());continue;case 5:if(i!==40)break;a.is_remember=t.bool();continue;case 6:if(i!==50)break;a.api_url=t.string();continue;case 7:if(i!==58)break;a.id_token=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{created:s(e.created)?globalThis.Boolean(e.created):!1,token:s(e.token)?globalThis.String(e.token):"",refresh_token:s(e.refresh_token)?globalThis.String(e.refresh_token):"",user_id:s(e.user_id)?globalThis.String(e.user_id):"0",is_remember:s(e.is_remember)?globalThis.Boolean(e.is_remember):!1,api_url:s(e.api_url)?globalThis.String(e.api_url):"",id_token:s(e.id_token)?globalThis.String(e.id_token):""}},toJSON(e){let n={};return e.created!==!1&&(n.created=e.created),e.token!==""&&(n.token=e.token),e.refresh_token!==""&&(n.refresh_token=e.refresh_token),e.user_id!=="0"&&(n.user_id=e.user_id),e.is_remember!==!1&&(n.is_remember=e.is_remember),e.api_url!==""&&(n.api_url=e.api_url),e.id_token!==""&&(n.id_token=e.id_token),n},create(e){return Re.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c;let n=Xe();return n.created=(t=e.created)!=null?t:!1,n.token=(r=e.token)!=null?r:"",n.refresh_token=(a=e.refresh_token)!=null?a:"",n.user_id=(i=e.user_id)!=null?i:"0",n.is_remember=(o=e.is_remember)!=null?o:!1,n.api_url=(l=e.api_url)!=null?l:"",n.id_token=(c=e.id_token)!=null?c:"",n}};function Ze(){return{token:"",vars:{},is_remember:!1}}var Se={encode(e,n=f.default.Writer.create()){return e.token!==""&&n.uint32(10).string(e.token),Object.entries(e.vars).forEach(([t,r])=>{Ne.encode({key:t,value:r},n.uint32(18).fork()).ldelim()}),e.is_remember!==!1&&n.uint32(24).bool(e.is_remember),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Ze();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.token=t.string();continue;case 2:if(i!==18)break;let o=Ne.decode(t,t.uint32());o.value!==void 0&&(a.vars[o.key]=o.value);continue;case 3:if(i!==24)break;a.is_remember=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{token:s(e.token)?globalThis.String(e.token):"",vars:Dn(e.vars)?Object.entries(e.vars).reduce((n,[t,r])=>(n[t]=String(r),n),{}):{},is_remember:s(e.is_remember)?globalThis.Boolean(e.is_remember):!1}},toJSON(e){let n={};if(e.token!==""&&(n.token=e.token),e.vars){let t=Object.entries(e.vars);t.length>0&&(n.vars={},t.forEach(([r,a])=>{n.vars[r]=a}))}return e.is_remember!==!1&&(n.is_remember=e.is_remember),n},create(e){return Se.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a;let n=Ze();return n.token=(t=e.token)!=null?t:"",n.vars=Object.entries((r=e.vars)!=null?r:{}).reduce((i,[o,l])=>(l!==void 0&&(i[o]=globalThis.String(l)),i),{}),n.is_remember=(a=e.is_remember)!=null?a:!1,n}};function $e(){return{key:"",value:""}}var Ne={encode(e,n=f.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=$e();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.key=t.string();continue;case 2:if(i!==18)break;a.value=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{key:s(e.key)?globalThis.String(e.key):"",value:s(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Ne.fromPartial(e!=null?e:{})},fromPartial(e){var t,r;let n=$e();return n.key=(t=e.key)!=null?t:"",n.value=(r=e.value)!=null?r:"",n}};function Qe(){return{clan_id:"0",parent_id:"0",channel_id:"0",category_id:"0",type:0,channel_label:"",channel_private:0,user_ids:[],app_id:"0"}}var ve={encode(e,n=f.default.Writer.create()){e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.parent_id!=="0"&&n.uint32(16).int64(e.parent_id),e.channel_id!=="0"&&n.uint32(24).int64(e.channel_id),e.category_id!=="0"&&n.uint32(32).int64(e.category_id),e.type!==0&&n.uint32(40).int32(e.type),e.channel_label!==""&&n.uint32(50).string(e.channel_label),e.channel_private!==0&&n.uint32(56).int32(e.channel_private),n.uint32(66).fork();for(let t of e.user_ids)n.int64(t);return n.ldelim(),e.app_id!=="0"&&n.uint32(72).int64(e.app_id),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Qe();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=m(t.int64());continue;case 2:if(i!==16)break;a.parent_id=m(t.int64());continue;case 3:if(i!==24)break;a.channel_id=m(t.int64());continue;case 4:if(i!==32)break;a.category_id=m(t.int64());continue;case 5:if(i!==40)break;a.type=t.int32();continue;case 6:if(i!==50)break;a.channel_label=t.string();continue;case 7:if(i!==56)break;a.channel_private=t.int32();continue;case 8:if(i===64){a.user_ids.push(m(t.int64()));continue}if(i===66){let o=t.uint32()+t.pos;for(;t.pos<o;)a.user_ids.push(m(t.int64()));continue}break;case 9:if(i!==72)break;a.app_id=m(t.int64());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:s(e.clan_id)?globalThis.String(e.clan_id):"0",parent_id:s(e.parent_id)?globalThis.String(e.parent_id):"0",channel_id:s(e.channel_id)?globalThis.String(e.channel_id):"0",category_id:s(e.category_id)?globalThis.String(e.category_id):"0",type:s(e.type)?globalThis.Number(e.type):0,channel_label:s(e.channel_label)?globalThis.String(e.channel_label):"",channel_private:s(e.channel_private)?globalThis.Number(e.channel_private):0,user_ids:globalThis.Array.isArray(e==null?void 0:e.user_ids)?e.user_ids.map(n=>globalThis.String(n)):[],app_id:s(e.app_id)?globalThis.String(e.app_id):"0"}},toJSON(e){var t;let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.parent_id!=="0"&&(n.parent_id=e.parent_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.category_id!=="0"&&(n.category_id=e.category_id),e.type!==0&&(n.type=Math.round(e.type)),e.channel_label!==""&&(n.channel_label=e.channel_label),e.channel_private!==0&&(n.channel_private=Math.round(e.channel_private)),(t=e.user_ids)!=null&&t.length&&(n.user_ids=e.user_ids),e.app_id!=="0"&&(n.app_id=e.app_id),n},create(e){return ve.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_;let n=Qe();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.parent_id=(r=e.parent_id)!=null?r:"0",n.channel_id=(a=e.channel_id)!=null?a:"0",n.category_id=(i=e.category_id)!=null?i:"0",n.type=(o=e.type)!=null?o:0,n.channel_label=(l=e.channel_label)!=null?l:"",n.channel_private=(c=e.channel_private)!=null?c:0,n.user_ids=((d=e.user_ids)==null?void 0:d.map(p=>p))||[],n.app_id=(_=e.app_id)!=null?_:"0",n}};function je(){return{clan_id:"0",parent_id:"0",channel_id:"0",category_id:"0",category_name:"",type:0,creator_id:"0",channel_label:"",channel_private:0,avatars:[],user_ids:[],last_sent_message:void 0,last_seen_message:void 0,onlines:[],meeting_code:"",count_mess_unread:0,active:0,last_pin_message:"",usernames:[],creator_name:"",create_time_seconds:0,update_time_seconds:0,display_names:[],channel_avatar:"",clan_name:"",app_id:"0",is_mute:!1,age_restricted:0,topic:"",e2ee:0,member_count:0}}var Oe={encode(e,n=f.default.Writer.create()){e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.parent_id!=="0"&&n.uint32(16).int64(e.parent_id),e.channel_id!=="0"&&n.uint32(24).int64(e.channel_id),e.category_id!=="0"&&n.uint32(32).int64(e.category_id),e.category_name!==""&&n.uint32(42).string(e.category_name),e.type!==0&&n.uint32(48).int32(e.type),e.creator_id!=="0"&&n.uint32(56).int64(e.creator_id),e.channel_label!==""&&n.uint32(66).string(e.channel_label),e.channel_private!==0&&n.uint32(72).int32(e.channel_private);for(let t of e.avatars)n.uint32(82).string(t);n.uint32(90).fork();for(let t of e.user_ids)n.int64(t);n.ldelim(),e.last_sent_message!==void 0&&S.encode(e.last_sent_message,n.uint32(98).fork()).ldelim(),e.last_seen_message!==void 0&&S.encode(e.last_seen_message,n.uint32(106).fork()).ldelim(),n.uint32(114).fork();for(let t of e.onlines)n.bool(t);n.ldelim(),e.meeting_code!==""&&n.uint32(122).string(e.meeting_code),e.count_mess_unread!==0&&n.uint32(128).int32(e.count_mess_unread),e.active!==0&&n.uint32(136).int32(e.active),e.last_pin_message!==""&&n.uint32(146).string(e.last_pin_message);for(let t of e.usernames)n.uint32(154).string(t);e.creator_name!==""&&n.uint32(162).string(e.creator_name),e.create_time_seconds!==0&&n.uint32(168).uint32(e.create_time_seconds),e.update_time_seconds!==0&&n.uint32(176).uint32(e.update_time_seconds);for(let t of e.display_names)n.uint32(186).string(t);return e.channel_avatar!==""&&n.uint32(194).string(e.channel_avatar),e.clan_name!==""&&n.uint32(202).string(e.clan_name),e.app_id!=="0"&&n.uint32(208).int64(e.app_id),e.is_mute!==!1&&n.uint32(216).bool(e.is_mute),e.age_restricted!==0&&n.uint32(224).int32(e.age_restricted),e.topic!==""&&n.uint32(234).string(e.topic),e.e2ee!==0&&n.uint32(240).int32(e.e2ee),e.member_count!==0&&n.uint32(248).int32(e.member_count),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=je();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=m(t.int64());continue;case 2:if(i!==16)break;a.parent_id=m(t.int64());continue;case 3:if(i!==24)break;a.channel_id=m(t.int64());continue;case 4:if(i!==32)break;a.category_id=m(t.int64());continue;case 5:if(i!==42)break;a.category_name=t.string();continue;case 6:if(i!==48)break;a.type=t.int32();continue;case 7:if(i!==56)break;a.creator_id=m(t.int64());continue;case 8:if(i!==66)break;a.channel_label=t.string();continue;case 9:if(i!==72)break;a.channel_private=t.int32();continue;case 10:if(i!==82)break;a.avatars.push(t.string());continue;case 11:if(i===88){a.user_ids.push(m(t.int64()));continue}if(i===90){let o=t.uint32()+t.pos;for(;t.pos<o;)a.user_ids.push(m(t.int64()));continue}break;case 12:if(i!==98)break;a.last_sent_message=S.decode(t,t.uint32());continue;case 13:if(i!==106)break;a.last_seen_message=S.decode(t,t.uint32());continue;case 14:if(i===112){a.onlines.push(t.bool());continue}if(i===114){let o=t.uint32()+t.pos;for(;t.pos<o;)a.onlines.push(t.bool());continue}break;case 15:if(i!==122)break;a.meeting_code=t.string();continue;case 16:if(i!==128)break;a.count_mess_unread=t.int32();continue;case 17:if(i!==136)break;a.active=t.int32();continue;case 18:if(i!==146)break;a.last_pin_message=t.string();continue;case 19:if(i!==154)break;a.usernames.push(t.string());continue;case 20:if(i!==162)break;a.creator_name=t.string();continue;case 21:if(i!==168)break;a.create_time_seconds=t.uint32();continue;case 22:if(i!==176)break;a.update_time_seconds=t.uint32();continue;case 23:if(i!==186)break;a.display_names.push(t.string());continue;case 24:if(i!==194)break;a.channel_avatar=t.string();continue;case 25:if(i!==202)break;a.clan_name=t.string();continue;case 26:if(i!==208)break;a.app_id=m(t.int64());continue;case 27:if(i!==216)break;a.is_mute=t.bool();continue;case 28:if(i!==224)break;a.age_restricted=t.int32();continue;case 29:if(i!==234)break;a.topic=t.string();continue;case 30:if(i!==240)break;a.e2ee=t.int32();continue;case 31:if(i!==248)break;a.member_count=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:s(e.clan_id)?globalThis.String(e.clan_id):"0",parent_id:s(e.parent_id)?globalThis.String(e.parent_id):"0",channel_id:s(e.channel_id)?globalThis.String(e.channel_id):"0",category_id:s(e.category_id)?globalThis.String(e.category_id):"0",category_name:s(e.category_name)?globalThis.String(e.category_name):"",type:s(e.type)?globalThis.Number(e.type):0,creator_id:s(e.creator_id)?globalThis.String(e.creator_id):"0",channel_label:s(e.channel_label)?globalThis.String(e.channel_label):"",channel_private:s(e.channel_private)?globalThis.Number(e.channel_private):0,avatars:globalThis.Array.isArray(e==null?void 0:e.avatars)?e.avatars.map(n=>globalThis.String(n)):[],user_ids:globalThis.Array.isArray(e==null?void 0:e.user_ids)?e.user_ids.map(n=>globalThis.String(n)):[],last_sent_message:s(e.last_sent_message)?S.fromJSON(e.last_sent_message):void 0,last_seen_message:s(e.last_seen_message)?S.fromJSON(e.last_seen_message):void 0,onlines:globalThis.Array.isArray(e==null?void 0:e.onlines)?e.onlines.map(n=>globalThis.Boolean(n)):[],meeting_code:s(e.meeting_code)?globalThis.String(e.meeting_code):"",count_mess_unread:s(e.count_mess_unread)?globalThis.Number(e.count_mess_unread):0,active:s(e.active)?globalThis.Number(e.active):0,last_pin_message:s(e.last_pin_message)?globalThis.String(e.last_pin_message):"",usernames:globalThis.Array.isArray(e==null?void 0:e.usernames)?e.usernames.map(n=>globalThis.String(n)):[],creator_name:s(e.creator_name)?globalThis.String(e.creator_name):"",create_time_seconds:s(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,update_time_seconds:s(e.update_time_seconds)?globalThis.Number(e.update_time_seconds):0,display_names:globalThis.Array.isArray(e==null?void 0:e.display_names)?e.display_names.map(n=>globalThis.String(n)):[],channel_avatar:s(e.channel_avatar)?globalThis.String(e.channel_avatar):"",clan_name:s(e.clan_name)?globalThis.String(e.clan_name):"",app_id:s(e.app_id)?globalThis.String(e.app_id):"0",is_mute:s(e.is_mute)?globalThis.Boolean(e.is_mute):!1,age_restricted:s(e.age_restricted)?globalThis.Number(e.age_restricted):0,topic:s(e.topic)?globalThis.String(e.topic):"",e2ee:s(e.e2ee)?globalThis.Number(e.e2ee):0,member_count:s(e.member_count)?globalThis.Number(e.member_count):0}},toJSON(e){var t,r,a,i,o;let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.parent_id!=="0"&&(n.parent_id=e.parent_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.category_id!=="0"&&(n.category_id=e.category_id),e.category_name!==""&&(n.category_name=e.category_name),e.type!==0&&(n.type=Math.round(e.type)),e.creator_id!=="0"&&(n.creator_id=e.creator_id),e.channel_label!==""&&(n.channel_label=e.channel_label),e.channel_private!==0&&(n.channel_private=Math.round(e.channel_private)),(t=e.avatars)!=null&&t.length&&(n.avatars=e.avatars),(r=e.user_ids)!=null&&r.length&&(n.user_ids=e.user_ids),e.last_sent_message!==void 0&&(n.last_sent_message=S.toJSON(e.last_sent_message)),e.last_seen_message!==void 0&&(n.last_seen_message=S.toJSON(e.last_seen_message)),(a=e.onlines)!=null&&a.length&&(n.onlines=e.onlines),e.meeting_code!==""&&(n.meeting_code=e.meeting_code),e.count_mess_unread!==0&&(n.count_mess_unread=Math.round(e.count_mess_unread)),e.active!==0&&(n.active=Math.round(e.active)),e.last_pin_message!==""&&(n.last_pin_message=e.last_pin_message),(i=e.usernames)!=null&&i.length&&(n.usernames=e.usernames),e.creator_name!==""&&(n.creator_name=e.creator_name),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.update_time_seconds!==0&&(n.update_time_seconds=Math.round(e.update_time_seconds)),(o=e.display_names)!=null&&o.length&&(n.display_names=e.display_names),e.channel_avatar!==""&&(n.channel_avatar=e.channel_avatar),e.clan_name!==""&&(n.clan_name=e.clan_name),e.app_id!=="0"&&(n.app_id=e.app_id),e.is_mute!==!1&&(n.is_mute=e.is_mute),e.age_restricted!==0&&(n.age_restricted=Math.round(e.age_restricted)),e.topic!==""&&(n.topic=e.topic),e.e2ee!==0&&(n.e2ee=Math.round(e.e2ee)),e.member_count!==0&&(n.member_count=Math.round(e.member_count)),n},create(e){return Oe.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p,y,M,I,N,C,Z,$,Q,j,ee,ne,te,ie,ae,re,we,qe,Ve,ze;let n=je();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.parent_id=(r=e.parent_id)!=null?r:"0",n.channel_id=(a=e.channel_id)!=null?a:"0",n.category_id=(i=e.category_id)!=null?i:"0",n.category_name=(o=e.category_name)!=null?o:"",n.type=(l=e.type)!=null?l:0,n.creator_id=(c=e.creator_id)!=null?c:"0",n.channel_label=(d=e.channel_label)!=null?d:"",n.channel_private=(_=e.channel_private)!=null?_:0,n.avatars=((p=e.avatars)==null?void 0:p.map(E=>E))||[],n.user_ids=((y=e.user_ids)==null?void 0:y.map(E=>E))||[],n.last_sent_message=e.last_sent_message!==void 0&&e.last_sent_message!==null?S.fromPartial(e.last_sent_message):void 0,n.last_seen_message=e.last_seen_message!==void 0&&e.last_seen_message!==null?S.fromPartial(e.last_seen_message):void 0,n.onlines=((M=e.onlines)==null?void 0:M.map(E=>E))||[],n.meeting_code=(I=e.meeting_code)!=null?I:"",n.count_mess_unread=(N=e.count_mess_unread)!=null?N:0,n.active=(C=e.active)!=null?C:0,n.last_pin_message=(Z=e.last_pin_message)!=null?Z:"",n.usernames=(($=e.usernames)==null?void 0:$.map(E=>E))||[],n.creator_name=(Q=e.creator_name)!=null?Q:"",n.create_time_seconds=(j=e.create_time_seconds)!=null?j:0,n.update_time_seconds=(ee=e.update_time_seconds)!=null?ee:0,n.display_names=((ne=e.display_names)==null?void 0:ne.map(E=>E))||[],n.channel_avatar=(te=e.channel_avatar)!=null?te:"",n.clan_name=(ie=e.clan_name)!=null?ie:"",n.app_id=(ae=e.app_id)!=null?ae:"0",n.is_mute=(re=e.is_mute)!=null?re:!1,n.age_restricted=(we=e.age_restricted)!=null?we:0,n.topic=(qe=e.topic)!=null?qe:"",n.e2ee=(Ve=e.e2ee)!=null?Ve:0,n.member_count=(ze=e.member_count)!=null?ze:0,n}};function m(e){return e.toString()}f.default.util.Long!==Ie.default&&(f.default.util.Long=Ie.default,f.default.configure());function Dn(e){return typeof e=="object"&&e!==null}function s(e){return e!=null}function en(){return{clan_id:"0",channel_id:"0",message_id:"0",code:0,sender_id:"0",username:"",avatar:"",content:"",channel_label:"",clan_logo:"",category_name:"",display_name:"",clan_nick:"",clan_avatar:"",reactions:new Uint8Array(0),mentions:new Uint8Array(0),attachments:new Uint8Array(0),references:new Uint8Array(0),referenced_message:new Uint8Array(0),create_time_seconds:0,update_time_seconds:0,mode:0,hide_editted:!1,is_public:!1,topic_id:"0"}}var W={encode(e,n=f.default.Writer.create()){return e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.message_id!=="0"&&n.uint32(24).int64(e.message_id),e.code!==0&&n.uint32(32).int32(e.code),e.sender_id!=="0"&&n.uint32(40).int64(e.sender_id),e.username!==""&&n.uint32(50).string(e.username),e.avatar!==""&&n.uint32(58).string(e.avatar),e.content!==""&&n.uint32(66).string(e.content),e.channel_label!==""&&n.uint32(74).string(e.channel_label),e.clan_logo!==""&&n.uint32(82).string(e.clan_logo),e.category_name!==""&&n.uint32(90).string(e.category_name),e.display_name!==""&&n.uint32(98).string(e.display_name),e.clan_nick!==""&&n.uint32(106).string(e.clan_nick),e.clan_avatar!==""&&n.uint32(114).string(e.clan_avatar),e.reactions.length!==0&&n.uint32(122).bytes(e.reactions),e.mentions.length!==0&&n.uint32(130).bytes(e.mentions),e.attachments.length!==0&&n.uint32(138).bytes(e.attachments),e.references.length!==0&&n.uint32(146).bytes(e.references),e.referenced_message.length!==0&&n.uint32(154).bytes(e.referenced_message),e.create_time_seconds!==0&&n.uint32(160).uint32(e.create_time_seconds),e.update_time_seconds!==0&&n.uint32(168).uint32(e.update_time_seconds),e.mode!==0&&n.uint32(176).int32(e.mode),e.hide_editted!==!1&&n.uint32(184).bool(e.hide_editted),e.is_public!==!1&&n.uint32(192).bool(e.is_public),e.topic_id!=="0"&&n.uint32(200).int64(e.topic_id),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=en();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=m(t.int64());continue;case 2:if(i!==16)break;a.channel_id=m(t.int64());continue;case 3:if(i!==24)break;a.message_id=m(t.int64());continue;case 4:if(i!==32)break;a.code=t.int32();continue;case 5:if(i!==40)break;a.sender_id=m(t.int64());continue;case 6:if(i!==50)break;a.username=t.string();continue;case 7:if(i!==58)break;a.avatar=t.string();continue;case 8:if(i!==66)break;a.content=t.string();continue;case 9:if(i!==74)break;a.channel_label=t.string();continue;case 10:if(i!==82)break;a.clan_logo=t.string();continue;case 11:if(i!==90)break;a.category_name=t.string();continue;case 12:if(i!==98)break;a.display_name=t.string();continue;case 13:if(i!==106)break;a.clan_nick=t.string();continue;case 14:if(i!==114)break;a.clan_avatar=t.string();continue;case 15:if(i!==122)break;a.reactions=t.bytes();continue;case 16:if(i!==130)break;a.mentions=t.bytes();continue;case 17:if(i!==138)break;a.attachments=t.bytes();continue;case 18:if(i!==146)break;a.references=t.bytes();continue;case 19:if(i!==154)break;a.referenced_message=t.bytes();continue;case 20:if(i!==160)break;a.create_time_seconds=t.uint32();continue;case 21:if(i!==168)break;a.update_time_seconds=t.uint32();continue;case 22:if(i!==176)break;a.mode=t.int32();continue;case 23:if(i!==184)break;a.hide_editted=t.bool();continue;case 24:if(i!==192)break;a.is_public=t.bool();continue;case 25:if(i!==200)break;a.topic_id=m(t.int64());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:s(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:s(e.channel_id)?globalThis.String(e.channel_id):"0",message_id:s(e.message_id)?globalThis.String(e.message_id):"0",code:s(e.code)?globalThis.Number(e.code):0,sender_id:s(e.sender_id)?globalThis.String(e.sender_id):"0",username:s(e.username)?globalThis.String(e.username):"",avatar:s(e.avatar)?globalThis.String(e.avatar):"",content:s(e.content)?globalThis.String(e.content):"",channel_label:s(e.channel_label)?globalThis.String(e.channel_label):"",clan_logo:s(e.clan_logo)?globalThis.String(e.clan_logo):"",category_name:s(e.category_name)?globalThis.String(e.category_name):"",display_name:s(e.display_name)?globalThis.String(e.display_name):"",clan_nick:s(e.clan_nick)?globalThis.String(e.clan_nick):"",clan_avatar:s(e.clan_avatar)?globalThis.String(e.clan_avatar):"",reactions:s(e.reactions)?le(e.reactions):new Uint8Array(0),mentions:s(e.mentions)?le(e.mentions):new Uint8Array(0),attachments:s(e.attachments)?le(e.attachments):new Uint8Array(0),references:s(e.references)?le(e.references):new Uint8Array(0),referenced_message:s(e.referenced_message)?le(e.referenced_message):new Uint8Array(0),create_time_seconds:s(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,update_time_seconds:s(e.update_time_seconds)?globalThis.Number(e.update_time_seconds):0,mode:s(e.mode)?globalThis.Number(e.mode):0,hide_editted:s(e.hide_editted)?globalThis.Boolean(e.hide_editted):!1,is_public:s(e.is_public)?globalThis.Boolean(e.is_public):!1,topic_id:s(e.topic_id)?globalThis.String(e.topic_id):"0"}},toJSON(e){let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.message_id!=="0"&&(n.message_id=e.message_id),e.code!==0&&(n.code=Math.round(e.code)),e.sender_id!=="0"&&(n.sender_id=e.sender_id),e.username!==""&&(n.username=e.username),e.avatar!==""&&(n.avatar=e.avatar),e.content!==""&&(n.content=e.content),e.channel_label!==""&&(n.channel_label=e.channel_label),e.clan_logo!==""&&(n.clan_logo=e.clan_logo),e.category_name!==""&&(n.category_name=e.category_name),e.display_name!==""&&(n.display_name=e.display_name),e.clan_nick!==""&&(n.clan_nick=e.clan_nick),e.clan_avatar!==""&&(n.clan_avatar=e.clan_avatar),e.reactions.length!==0&&(n.reactions=ce(e.reactions)),e.mentions.length!==0&&(n.mentions=ce(e.mentions)),e.attachments.length!==0&&(n.attachments=ce(e.attachments)),e.references.length!==0&&(n.references=ce(e.references)),e.referenced_message.length!==0&&(n.referenced_message=ce(e.referenced_message)),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.update_time_seconds!==0&&(n.update_time_seconds=Math.round(e.update_time_seconds)),e.mode!==0&&(n.mode=Math.round(e.mode)),e.hide_editted!==!1&&(n.hide_editted=e.hide_editted),e.is_public!==!1&&(n.is_public=e.is_public),e.topic_id!=="0"&&(n.topic_id=e.topic_id),n},create(e){return W.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p,y,M,I,N,C,Z,$,Q,j,ee,ne,te,ie,ae,re;let n=en();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.message_id=(a=e.message_id)!=null?a:"0",n.code=(i=e.code)!=null?i:0,n.sender_id=(o=e.sender_id)!=null?o:"0",n.username=(l=e.username)!=null?l:"",n.avatar=(c=e.avatar)!=null?c:"",n.content=(d=e.content)!=null?d:"",n.channel_label=(_=e.channel_label)!=null?_:"",n.clan_logo=(p=e.clan_logo)!=null?p:"",n.category_name=(y=e.category_name)!=null?y:"",n.display_name=(M=e.display_name)!=null?M:"",n.clan_nick=(I=e.clan_nick)!=null?I:"",n.clan_avatar=(N=e.clan_avatar)!=null?N:"",n.reactions=(C=e.reactions)!=null?C:new Uint8Array(0),n.mentions=(Z=e.mentions)!=null?Z:new Uint8Array(0),n.attachments=($=e.attachments)!=null?$:new Uint8Array(0),n.references=(Q=e.references)!=null?Q:new Uint8Array(0),n.referenced_message=(j=e.referenced_message)!=null?j:new Uint8Array(0),n.create_time_seconds=(ee=e.create_time_seconds)!=null?ee:0,n.update_time_seconds=(ne=e.update_time_seconds)!=null?ne:0,n.mode=(te=e.mode)!=null?te:0,n.hide_editted=(ie=e.hide_editted)!=null?ie:!1,n.is_public=(ae=e.is_public)!=null?ae:!1,n.topic_id=(re=e.topic_id)!=null?re:"0",n}};function nn(){return{id:"0",timestamp_seconds:0,sender_id:"0",content:""}}var S={encode(e,n=f.default.Writer.create()){return e.id!=="0"&&n.uint32(8).int64(e.id),e.timestamp_seconds!==0&&n.uint32(16).uint32(e.timestamp_seconds),e.sender_id!=="0"&&n.uint32(24).int64(e.sender_id),e.content!==""&&n.uint32(34).string(e.content),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=nn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.id=m(t.int64());continue;case 2:if(i!==16)break;a.timestamp_seconds=t.uint32();continue;case 3:if(i!==24)break;a.sender_id=m(t.int64());continue;case 4:if(i!==34)break;a.content=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{id:s(e.id)?globalThis.String(e.id):"0",timestamp_seconds:s(e.timestamp_seconds)?globalThis.Number(e.timestamp_seconds):0,sender_id:s(e.sender_id)?globalThis.String(e.sender_id):"0",content:s(e.content)?globalThis.String(e.content):""}},toJSON(e){let n={};return e.id!=="0"&&(n.id=e.id),e.timestamp_seconds!==0&&(n.timestamp_seconds=Math.round(e.timestamp_seconds)),e.sender_id!=="0"&&(n.sender_id=e.sender_id),e.content!==""&&(n.content=e.content),n},create(e){return S.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i;let n=nn();return n.id=(t=e.id)!=null?t:"0",n.timestamp_seconds=(r=e.timestamp_seconds)!=null?r:0,n.sender_id=(a=e.sender_id)!=null?a:"0",n.content=(i=e.content)!=null?i:"",n}};function tn(){return{id:"0",user_id:"0",username:"",role_id:"0",rolename:"",create_time_seconds:0,s:0,e:0}}var B={encode(e,n=f.default.Writer.create()){return e.id!=="0"&&n.uint32(8).int64(e.id),e.user_id!=="0"&&n.uint32(16).int64(e.user_id),e.username!==""&&n.uint32(26).string(e.username),e.role_id!=="0"&&n.uint32(32).int64(e.role_id),e.rolename!==""&&n.uint32(42).string(e.rolename),e.create_time_seconds!==0&&n.uint32(48).uint32(e.create_time_seconds),e.s!==0&&n.uint32(56).int32(e.s),e.e!==0&&n.uint32(64).int32(e.e),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=tn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.id=m(t.int64());continue;case 2:if(i!==16)break;a.user_id=m(t.int64());continue;case 3:if(i!==26)break;a.username=t.string();continue;case 4:if(i!==32)break;a.role_id=m(t.int64());continue;case 5:if(i!==42)break;a.rolename=t.string();continue;case 6:if(i!==48)break;a.create_time_seconds=t.uint32();continue;case 7:if(i!==56)break;a.s=t.int32();continue;case 8:if(i!==64)break;a.e=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{id:s(e.id)?globalThis.String(e.id):"0",user_id:s(e.user_id)?globalThis.String(e.user_id):"0",username:s(e.username)?globalThis.String(e.username):"",role_id:s(e.role_id)?globalThis.String(e.role_id):"0",rolename:s(e.rolename)?globalThis.String(e.rolename):"",create_time_seconds:s(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,s:s(e.s)?globalThis.Number(e.s):0,e:s(e.e)?globalThis.Number(e.e):0}},toJSON(e){let n={};return e.id!=="0"&&(n.id=e.id),e.user_id!=="0"&&(n.user_id=e.user_id),e.username!==""&&(n.username=e.username),e.role_id!=="0"&&(n.role_id=e.role_id),e.rolename!==""&&(n.rolename=e.rolename),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.s!==0&&(n.s=Math.round(e.s)),e.e!==0&&(n.e=Math.round(e.e)),n},create(e){return B.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d;let n=tn();return n.id=(t=e.id)!=null?t:"0",n.user_id=(r=e.user_id)!=null?r:"0",n.username=(a=e.username)!=null?a:"",n.role_id=(i=e.role_id)!=null?i:"0",n.rolename=(o=e.rolename)!=null?o:"",n.create_time_seconds=(l=e.create_time_seconds)!=null?l:0,n.s=(c=e.s)!=null?c:0,n.e=(d=e.e)!=null?d:0,n}};function an(){return{filename:"",size:0,url:"",filetype:"",width:0,height:0,thumbnail:"",duration:0}}var v={encode(e,n=f.default.Writer.create()){return e.filename!==""&&n.uint32(10).string(e.filename),e.size!==0&&n.uint32(16).int32(e.size),e.url!==""&&n.uint32(26).string(e.url),e.filetype!==""&&n.uint32(34).string(e.filetype),e.width!==0&&n.uint32(40).int32(e.width),e.height!==0&&n.uint32(48).int32(e.height),e.thumbnail!==""&&n.uint32(58).string(e.thumbnail),e.duration!==0&&n.uint32(64).int32(e.duration),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=an();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.filename=t.string();continue;case 2:if(i!==16)break;a.size=t.int32();continue;case 3:if(i!==26)break;a.url=t.string();continue;case 4:if(i!==34)break;a.filetype=t.string();continue;case 5:if(i!==40)break;a.width=t.int32();continue;case 6:if(i!==48)break;a.height=t.int32();continue;case 7:if(i!==58)break;a.thumbnail=t.string();continue;case 8:if(i!==64)break;a.duration=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{filename:s(e.filename)?globalThis.String(e.filename):"",size:s(e.size)?globalThis.Number(e.size):0,url:s(e.url)?globalThis.String(e.url):"",filetype:s(e.filetype)?globalThis.String(e.filetype):"",width:s(e.width)?globalThis.Number(e.width):0,height:s(e.height)?globalThis.Number(e.height):0,thumbnail:s(e.thumbnail)?globalThis.String(e.thumbnail):"",duration:s(e.duration)?globalThis.Number(e.duration):0}},toJSON(e){let n={};return e.filename!==""&&(n.filename=e.filename),e.size!==0&&(n.size=Math.round(e.size)),e.url!==""&&(n.url=e.url),e.filetype!==""&&(n.filetype=e.filetype),e.width!==0&&(n.width=Math.round(e.width)),e.height!==0&&(n.height=Math.round(e.height)),e.thumbnail!==""&&(n.thumbnail=e.thumbnail),e.duration!==0&&(n.duration=Math.round(e.duration)),n},create(e){return v.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d;let n=an();return n.filename=(t=e.filename)!=null?t:"",n.size=(r=e.size)!=null?r:0,n.url=(a=e.url)!=null?a:"",n.filetype=(i=e.filetype)!=null?i:"",n.width=(o=e.width)!=null?o:0,n.height=(l=e.height)!=null?l:0,n.thumbnail=(c=e.thumbnail)!=null?c:"",n.duration=(d=e.duration)!=null?d:0,n}};function rn(){return{message_id:"0",message_ref_id:"0",content:"",has_attachment:!1,ref_type:0,message_sender_id:"0",message_sender_username:"",mesages_sender_avatar:"",message_sender_clan_nick:"",message_sender_display_name:""}}var H={encode(e,n=f.default.Writer.create()){return e.message_id!=="0"&&n.uint32(8).int64(e.message_id),e.message_ref_id!=="0"&&n.uint32(16).int64(e.message_ref_id),e.content!==""&&n.uint32(26).string(e.content),e.has_attachment!==!1&&n.uint32(32).bool(e.has_attachment),e.ref_type!==0&&n.uint32(40).int32(e.ref_type),e.message_sender_id!=="0"&&n.uint32(48).int64(e.message_sender_id),e.message_sender_username!==""&&n.uint32(58).string(e.message_sender_username),e.mesages_sender_avatar!==""&&n.uint32(66).string(e.mesages_sender_avatar),e.message_sender_clan_nick!==""&&n.uint32(74).string(e.message_sender_clan_nick),e.message_sender_display_name!==""&&n.uint32(82).string(e.message_sender_display_name),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=rn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.message_id=m(t.int64());continue;case 2:if(i!==16)break;a.message_ref_id=m(t.int64());continue;case 3:if(i!==26)break;a.content=t.string();continue;case 4:if(i!==32)break;a.has_attachment=t.bool();continue;case 5:if(i!==40)break;a.ref_type=t.int32();continue;case 6:if(i!==48)break;a.message_sender_id=m(t.int64());continue;case 7:if(i!==58)break;a.message_sender_username=t.string();continue;case 8:if(i!==66)break;a.mesages_sender_avatar=t.string();continue;case 9:if(i!==74)break;a.message_sender_clan_nick=t.string();continue;case 10:if(i!==82)break;a.message_sender_display_name=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{message_id:s(e.message_id)?globalThis.String(e.message_id):"0",message_ref_id:s(e.message_ref_id)?globalThis.String(e.message_ref_id):"0",content:s(e.content)?globalThis.String(e.content):"",has_attachment:s(e.has_attachment)?globalThis.Boolean(e.has_attachment):!1,ref_type:s(e.ref_type)?globalThis.Number(e.ref_type):0,message_sender_id:s(e.message_sender_id)?globalThis.String(e.message_sender_id):"0",message_sender_username:s(e.message_sender_username)?globalThis.String(e.message_sender_username):"",mesages_sender_avatar:s(e.mesages_sender_avatar)?globalThis.String(e.mesages_sender_avatar):"",message_sender_clan_nick:s(e.message_sender_clan_nick)?globalThis.String(e.message_sender_clan_nick):"",message_sender_display_name:s(e.message_sender_display_name)?globalThis.String(e.message_sender_display_name):""}},toJSON(e){let n={};return e.message_id!=="0"&&(n.message_id=e.message_id),e.message_ref_id!=="0"&&(n.message_ref_id=e.message_ref_id),e.content!==""&&(n.content=e.content),e.has_attachment!==!1&&(n.has_attachment=e.has_attachment),e.ref_type!==0&&(n.ref_type=Math.round(e.ref_type)),e.message_sender_id!=="0"&&(n.message_sender_id=e.message_sender_id),e.message_sender_username!==""&&(n.message_sender_username=e.message_sender_username),e.mesages_sender_avatar!==""&&(n.mesages_sender_avatar=e.mesages_sender_avatar),e.message_sender_clan_nick!==""&&(n.message_sender_clan_nick=e.message_sender_clan_nick),e.message_sender_display_name!==""&&(n.message_sender_display_name=e.message_sender_display_name),n},create(e){return H.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p;let n=rn();return n.message_id=(t=e.message_id)!=null?t:"0",n.message_ref_id=(r=e.message_ref_id)!=null?r:"0",n.content=(a=e.content)!=null?a:"",n.has_attachment=(i=e.has_attachment)!=null?i:!1,n.ref_type=(o=e.ref_type)!=null?o:0,n.message_sender_id=(l=e.message_sender_id)!=null?l:"0",n.message_sender_username=(c=e.message_sender_username)!=null?c:"",n.mesages_sender_avatar=(d=e.mesages_sender_avatar)!=null?d:"",n.message_sender_clan_nick=(_=e.message_sender_clan_nick)!=null?_:"",n.message_sender_display_name=(p=e.message_sender_display_name)!=null?p:"",n}};function sn(){return{attachments:[]}}var De={encode(e,n=f.default.Writer.create()){for(let t of e.attachments)v.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=sn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.attachments.push(v.decode(t,t.uint32()));continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{attachments:globalThis.Array.isArray(e==null?void 0:e.attachments)?e.attachments.map(n=>v.fromJSON(n)):[]}},toJSON(e){var t;let n={};return(t=e.attachments)!=null&&t.length&&(n.attachments=e.attachments.map(r=>v.toJSON(r))),n},create(e){return De.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=sn();return n.attachments=((t=e.attachments)==null?void 0:t.map(r=>v.fromPartial(r)))||[],n}};function le(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{let n=globalThis.atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;++r)t[r]=n.charCodeAt(r);return t}}function ce(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{let n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function on(){return{filename:"",filetype:"",size:0,width:0,height:0}}var Te={encode(e,n=f.default.Writer.create()){return e.filename!==""&&n.uint32(10).string(e.filename),e.filetype!==""&&n.uint32(18).string(e.filetype),e.size!==0&&n.uint32(24).int32(e.size),e.width!==0&&n.uint32(32).int32(e.width),e.height!==0&&n.uint32(40).int32(e.height),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=on();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.filename=t.string();continue;case 2:if(i!==18)break;a.filetype=t.string();continue;case 3:if(i!==24)break;a.size=t.int32();continue;case 4:if(i!==32)break;a.width=t.int32();continue;case 5:if(i!==40)break;a.height=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{filename:s(e.filename)?globalThis.String(e.filename):"",filetype:s(e.filetype)?globalThis.String(e.filetype):"",size:s(e.size)?globalThis.Number(e.size):0,width:s(e.width)?globalThis.Number(e.width):0,height:s(e.height)?globalThis.Number(e.height):0}},toJSON(e){let n={};return e.filename!==""&&(n.filename=e.filename),e.filetype!==""&&(n.filetype=e.filetype),e.size!==0&&(n.size=Math.round(e.size)),e.width!==0&&(n.width=Math.round(e.width)),e.height!==0&&(n.height=Math.round(e.height)),n},create(e){return Te.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o;let n=on();return n.filename=(t=e.filename)!=null?t:"",n.filetype=(r=e.filetype)!=null?r:"",n.size=(a=e.size)!=null?a:0,n.width=(i=e.width)!=null?i:0,n.height=(o=e.height)!=null?o:0,n}};function ln(){return{filename:"",url:""}}var Ue={encode(e,n=f.default.Writer.create()){return e.filename!==""&&n.uint32(10).string(e.filename),e.url!==""&&n.uint32(18).string(e.url),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=ln();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.filename=t.string();continue;case 2:if(i!==18)break;a.url=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{filename:s(e.filename)?globalThis.String(e.filename):"",url:s(e.url)?globalThis.String(e.url):""}},toJSON(e){let n={};return e.filename!==""&&(n.filename=e.filename),e.url!==""&&(n.url=e.url),n},create(e){return Ue.fromPartial(e!=null?e:{})},fromPartial(e){var t,r;let n=ln();return n.filename=(t=e.filename)!=null?t:"",n.url=(r=e.url)!=null?r:"",n}};function de(e,n,t){let r=xe({method:e},n);if(r.headers=xe({},n.headers),typeof XMLHttpRequest!="undefined"){let a=Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype,"withCredentials");a!=null&&a.set||(r.credentials="cocos-ignore")}return Object.keys(r.headers).includes("Accept")||(r.headers.Accept="application/proto"),Object.keys(r.headers).includes("Content-Type")||(r.headers["Content-Type"]="application/proto"),Object.keys(r.headers).forEach(a=>{r.headers[a]||delete r.headers[a]}),t&&(r.body=t),r}function Ce(e){if(e==null)return{t:e};let n;if(e instanceof Uint8Array)n=new TextDecoder().decode(e);else if(typeof e=="string")n=e;else return typeof e=="object"?e:{t:e};if(!n||n===""||n==="[]")return{t:n};try{return JSON.parse(n)}catch(t){try{let r=n.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(r)}catch(r){return console.error("JSON Parse failed completely:",{original:n,error:r}),{t:n}}}}var Un=e=>!e||e===null||e===void 0||e===""||e==="[]";function dn(e){if(Un(e))return;let n=e[0];if(n===91||n===123)return Ce(e);try{let r=e,a=new Uint8Array(r);return De.decode(a)}catch(r){return Ce(e)}}var Le=require("js-base64");var _e=class{constructor(n,t,r){this.serverKey=n;this.timeoutMs=t;this.basePath=r}setBasePath(n){this.basePath=n}authenticateIdToken(n,t,r,a={}){if(r==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/v2/account/authenticate/idtoken",o=new Map,l="";l=JSON.stringify(r||{});let c=this.buildFullUrl(this.basePath,i,o),d=de("POST",a,l);return n&&(d.headers.Authorization="Basic "+(0,Le.encode)(n+":"+t)),Promise.race([fetch(c,d).then(_=>{if(_.status==204)return _;if(_.status>=200&&_.status<300)return _.json();throw _}),new Promise((_,p)=>setTimeout(p,this.timeoutMs,"Request timed out."))])}sessionRefresh(n,t,r,a={}){if(r==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SessionRefresh",o=new Map,c=Se.encode(Se.fromPartial(r)).finish(),d=this.buildFullUrl(this.basePath,i,o),_=de("POST",a,"");return _.body=c,n&&(_.headers.Authorization="Basic "+(0,Le.encode)(n+":"+t)),Promise.race([fetch(d,_).then(p=>g(this,null,function*(){if(p.status==204)return{};if(p.status>=200&&p.status<300){let y=yield p.arrayBuffer();return Re.decode(new Uint8Array(y))}else throw p})),new Promise((p,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(n,t,r={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateChannelDesc",i=new Map,l=ve.encode(ve.fromPartial(t)).finish(),c=this.buildFullUrl(this.basePath,a,i),d=de("POST",r,"");return d.body=l,n&&(d.headers.Authorization="Bearer "+n),Promise.race([fetch(c,d).then(_=>g(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let p=yield _.arrayBuffer();return Oe.decode(new Uint8Array(p))}else throw _})),new Promise((_,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(n,t,r={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UploadAttachmentFile",i=new Map,l=Te.encode(Te.fromPartial(t)).finish(),c=this.buildFullUrl(this.basePath,a,i),d=de("POST",r,"");return d.body=l,n&&(d.headers.Authorization="Bearer "+n),Promise.race([fetch(c,d).then(_=>g(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let p=yield _.arrayBuffer();return Ue.decode(new Uint8Array(p))}else throw _})),new Promise((_,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}buildFullUrl(n,t,r){let a=n+t+"?";for(let[i,o]of r)o instanceof Array?a+=o.reduce((l,c)=>l+encodeURIComponent(i)+"="+encodeURIComponent(c)+"&",""):o!=null&&(a+=encodeURIComponent(i)+"="+encodeURIComponent(o)+"&");return a}};var We=D(require("long")),h=D(require("protobufjs/minimal"));var Je=D(require("long")),P=D(require("protobufjs/minimal"));function _n(){return{value:!1}}var be={encode(e,n=P.default.Writer.create()){return e.value!==!1&&n.uint32(8).bool(e.value),n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=_n();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.value=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{value:fn(e.value)?globalThis.Boolean(e.value):!1}},toJSON(e){let n={};return e.value!==!1&&(n.value=e.value),n},create(e){return be.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=_n();return n.value=(t=e.value)!=null?t:!1,n}};function un(){return{value:""}}var Pe={encode(e,n=P.default.Writer.create()){return e.value!==""&&n.uint32(10).string(e.value),n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=un();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.value=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{value:fn(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.value!==""&&(n.value=e.value),n},create(e){return Pe.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=un();return n.value=(t=e.value)!=null?t:"",n}};P.default.util.Long!==Je.default&&(P.default.util.Long=Je.default,P.default.configure());function fn(e){return e!=null}function hn(){return{cid:"",channel:void 0,channel_join:void 0,channel_leave:void 0,channel_message:void 0,channel_message_ack:void 0,channel_message_send:void 0,error:void 0,ping:void 0,pong:void 0}}var ue={encode(e,n=h.default.Writer.create()){return e.cid!==""&&n.uint32(10).string(e.cid),e.channel!==void 0&&w.encode(e.channel,n.uint32(18).fork()).ldelim(),e.channel_join!==void 0&&q.encode(e.channel_join,n.uint32(34).fork()).ldelim(),e.channel_leave!==void 0&&V.encode(e.channel_leave,n.uint32(42).fork()).ldelim(),e.channel_message!==void 0&&W.encode(e.channel_message,n.uint32(50).fork()).ldelim(),e.channel_message_ack!==void 0&&z.encode(e.channel_message_ack,n.uint32(58).fork()).ldelim(),e.channel_message_send!==void 0&&F.encode(e.channel_message_send,n.uint32(66).fork()).ldelim(),e.error!==void 0&&K.encode(e.error,n.uint32(98).fork()).ldelim(),e.ping!==void 0&&Y.encode(e.ping,n.uint32(178).fork()).ldelim(),e.pong!==void 0&&G.encode(e.pong,n.uint32(186).fork()).ldelim(),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=hn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.cid=t.string();continue;case 2:if(i!==18)break;a.channel=w.decode(t,t.uint32());continue;case 4:if(i!==34)break;a.channel_join=q.decode(t,t.uint32());continue;case 5:if(i!==42)break;a.channel_leave=V.decode(t,t.uint32());continue;case 6:if(i!==50)break;a.channel_message=W.decode(t,t.uint32());continue;case 7:if(i!==58)break;a.channel_message_ack=z.decode(t,t.uint32());continue;case 8:if(i!==66)break;a.channel_message_send=F.decode(t,t.uint32());continue;case 12:if(i!==98)break;a.error=K.decode(t,t.uint32());continue;case 22:if(i!==178)break;a.ping=Y.decode(t,t.uint32());continue;case 23:if(i!==186)break;a.pong=G.decode(t,t.uint32());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{cid:u(e.cid)?globalThis.String(e.cid):"",channel:u(e.channel)?w.fromJSON(e.channel):void 0,channel_join:u(e.channel_join)?q.fromJSON(e.channel_join):void 0,channel_leave:u(e.channel_leave)?V.fromJSON(e.channel_leave):void 0,channel_message:u(e.channel_message)?W.fromJSON(e.channel_message):void 0,channel_message_ack:u(e.channel_message_ack)?z.fromJSON(e.channel_message_ack):void 0,channel_message_send:u(e.channel_message_send)?F.fromJSON(e.channel_message_send):void 0,error:u(e.error)?K.fromJSON(e.error):void 0,ping:u(e.ping)?Y.fromJSON(e.ping):void 0,pong:u(e.pong)?G.fromJSON(e.pong):void 0}},toJSON(e){let n={};return e.cid!==""&&(n.cid=e.cid),e.channel!==void 0&&(n.channel=w.toJSON(e.channel)),e.channel_join!==void 0&&(n.channel_join=q.toJSON(e.channel_join)),e.channel_leave!==void 0&&(n.channel_leave=V.toJSON(e.channel_leave)),e.channel_message!==void 0&&(n.channel_message=W.toJSON(e.channel_message)),e.channel_message_ack!==void 0&&(n.channel_message_ack=z.toJSON(e.channel_message_ack)),e.channel_message_send!==void 0&&(n.channel_message_send=F.toJSON(e.channel_message_send)),e.error!==void 0&&(n.error=K.toJSON(e.error)),e.ping!==void 0&&(n.ping=Y.toJSON(e.ping)),e.pong!==void 0&&(n.pong=G.toJSON(e.pong)),n},create(e){return ue.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=hn();return n.cid=(t=e.cid)!=null?t:"",n.channel=e.channel!==void 0&&e.channel!==null?w.fromPartial(e.channel):void 0,n.channel_join=e.channel_join!==void 0&&e.channel_join!==null?q.fromPartial(e.channel_join):void 0,n.channel_leave=e.channel_leave!==void 0&&e.channel_leave!==null?V.fromPartial(e.channel_leave):void 0,n.channel_message=e.channel_message!==void 0&&e.channel_message!==null?W.fromPartial(e.channel_message):void 0,n.channel_message_ack=e.channel_message_ack!==void 0&&e.channel_message_ack!==null?z.fromPartial(e.channel_message_ack):void 0,n.channel_message_send=e.channel_message_send!==void 0&&e.channel_message_send!==null?F.fromPartial(e.channel_message_send):void 0,n.error=e.error!==void 0&&e.error!==null?K.fromPartial(e.error):void 0,n.ping=e.ping!==void 0&&e.ping!==null?Y.fromPartial(e.ping):void 0,n.pong=e.pong!==void 0&&e.pong!==null?G.fromPartial(e.pong):void 0,n}};function pn(){return{id:"0",presences:[],self:void 0,chanel_label:"",clan_logo:"",category_name:""}}var w={encode(e,n=h.default.Writer.create()){e.id!=="0"&&n.uint32(8).int64(e.id);for(let t of e.presences)b.encode(t,n.uint32(18).fork()).ldelim();return e.self!==void 0&&b.encode(e.self,n.uint32(26).fork()).ldelim(),e.chanel_label!==""&&n.uint32(34).string(e.chanel_label),e.clan_logo!==""&&n.uint32(42).string(e.clan_logo),e.category_name!==""&&n.uint32(50).string(e.category_name),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=pn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.id=T(t.int64());continue;case 2:if(i!==18)break;a.presences.push(b.decode(t,t.uint32()));continue;case 3:if(i!==26)break;a.self=b.decode(t,t.uint32());continue;case 4:if(i!==34)break;a.chanel_label=t.string();continue;case 5:if(i!==42)break;a.clan_logo=t.string();continue;case 6:if(i!==50)break;a.category_name=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{id:u(e.id)?globalThis.String(e.id):"0",presences:globalThis.Array.isArray(e==null?void 0:e.presences)?e.presences.map(n=>b.fromJSON(n)):[],self:u(e.self)?b.fromJSON(e.self):void 0,chanel_label:u(e.chanel_label)?globalThis.String(e.chanel_label):"",clan_logo:u(e.clan_logo)?globalThis.String(e.clan_logo):"",category_name:u(e.category_name)?globalThis.String(e.category_name):""}},toJSON(e){var t;let n={};return e.id!=="0"&&(n.id=e.id),(t=e.presences)!=null&&t.length&&(n.presences=e.presences.map(r=>b.toJSON(r))),e.self!==void 0&&(n.self=b.toJSON(e.self)),e.chanel_label!==""&&(n.chanel_label=e.chanel_label),e.clan_logo!==""&&(n.clan_logo=e.clan_logo),e.category_name!==""&&(n.category_name=e.category_name),n},create(e){return w.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o;let n=pn();return n.id=(t=e.id)!=null?t:"0",n.presences=((r=e.presences)==null?void 0:r.map(l=>b.fromPartial(l)))||[],n.self=e.self!==void 0&&e.self!==null?b.fromPartial(e.self):void 0,n.chanel_label=(a=e.chanel_label)!=null?a:"",n.clan_logo=(i=e.clan_logo)!=null?i:"",n.category_name=(o=e.category_name)!=null?o:"",n}};function mn(){return{clan_id:"0",channel_id:"0",channel_type:0,is_public:!1}}var q={encode(e,n=h.default.Writer.create()){return e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.channel_type!==0&&n.uint32(24).int32(e.channel_type),e.is_public!==!1&&n.uint32(32).bool(e.is_public),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=mn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=T(t.int64());continue;case 2:if(i!==16)break;a.channel_id=T(t.int64());continue;case 3:if(i!==24)break;a.channel_type=t.int32();continue;case 4:if(i!==32)break;a.is_public=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:u(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",channel_type:u(e.channel_type)?globalThis.Number(e.channel_type):0,is_public:u(e.is_public)?globalThis.Boolean(e.is_public):!1}},toJSON(e){let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.channel_type!==0&&(n.channel_type=Math.round(e.channel_type)),e.is_public!==!1&&(n.is_public=e.is_public),n},create(e){return q.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i;let n=mn();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.channel_type=(a=e.channel_type)!=null?a:0,n.is_public=(i=e.is_public)!=null?i:!1,n}};function gn(){return{clan_id:"0",channel_id:"0",channel_type:0,is_public:!1}}var V={encode(e,n=h.default.Writer.create()){return e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.channel_type!==0&&n.uint32(24).int32(e.channel_type),e.is_public!==!1&&n.uint32(32).bool(e.is_public),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=gn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=T(t.int64());continue;case 2:if(i!==16)break;a.channel_id=T(t.int64());continue;case 3:if(i!==24)break;a.channel_type=t.int32();continue;case 4:if(i!==32)break;a.is_public=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:u(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",channel_type:u(e.channel_type)?globalThis.Number(e.channel_type):0,is_public:u(e.is_public)?globalThis.Boolean(e.is_public):!1}},toJSON(e){let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.channel_type!==0&&(n.channel_type=Math.round(e.channel_type)),e.is_public!==!1&&(n.is_public=e.is_public),n},create(e){return V.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i;let n=gn();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.channel_type=(a=e.channel_type)!=null?a:0,n.is_public=(i=e.is_public)!=null?i:!1,n}};function yn(){return{channel_id:"0",message_id:"0",code:0,username:"",create_time_seconds:0,update_time_seconds:0,persistent:void 0,clan_logo:"",category_name:""}}var z={encode(e,n=h.default.Writer.create()){return e.channel_id!=="0"&&n.uint32(8).int64(e.channel_id),e.message_id!=="0"&&n.uint32(16).int64(e.message_id),e.code!==0&&n.uint32(24).int32(e.code),e.username!==""&&n.uint32(34).string(e.username),e.create_time_seconds!==0&&n.uint32(40).uint32(e.create_time_seconds),e.update_time_seconds!==0&&n.uint32(48).uint32(e.update_time_seconds),e.persistent!==void 0&&be.encode({value:e.persistent},n.uint32(58).fork()).ldelim(),e.clan_logo!==""&&n.uint32(66).string(e.clan_logo),e.category_name!==""&&n.uint32(74).string(e.category_name),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=yn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.channel_id=T(t.int64());continue;case 2:if(i!==16)break;a.message_id=T(t.int64());continue;case 3:if(i!==24)break;a.code=t.int32();continue;case 4:if(i!==34)break;a.username=t.string();continue;case 5:if(i!==40)break;a.create_time_seconds=t.uint32();continue;case 6:if(i!==48)break;a.update_time_seconds=t.uint32();continue;case 7:if(i!==58)break;a.persistent=be.decode(t,t.uint32()).value;continue;case 8:if(i!==66)break;a.clan_logo=t.string();continue;case 9:if(i!==74)break;a.category_name=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",message_id:u(e.message_id)?globalThis.String(e.message_id):"0",code:u(e.code)?globalThis.Number(e.code):0,username:u(e.username)?globalThis.String(e.username):"",create_time_seconds:u(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,update_time_seconds:u(e.update_time_seconds)?globalThis.Number(e.update_time_seconds):0,persistent:u(e.persistent)?!!e.persistent:void 0,clan_logo:u(e.clan_logo)?globalThis.String(e.clan_logo):"",category_name:u(e.category_name)?globalThis.String(e.category_name):""}},toJSON(e){let n={};return e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.message_id!=="0"&&(n.message_id=e.message_id),e.code!==0&&(n.code=Math.round(e.code)),e.username!==""&&(n.username=e.username),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.update_time_seconds!==0&&(n.update_time_seconds=Math.round(e.update_time_seconds)),e.persistent!==void 0&&(n.persistent=e.persistent),e.clan_logo!==""&&(n.clan_logo=e.clan_logo),e.category_name!==""&&(n.category_name=e.category_name),n},create(e){return z.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_;let n=yn();return n.channel_id=(t=e.channel_id)!=null?t:"0",n.message_id=(r=e.message_id)!=null?r:"0",n.code=(a=e.code)!=null?a:0,n.username=(i=e.username)!=null?i:"",n.create_time_seconds=(o=e.create_time_seconds)!=null?o:0,n.update_time_seconds=(l=e.update_time_seconds)!=null?l:0,n.persistent=(c=e.persistent)!=null?c:void 0,n.clan_logo=(d=e.clan_logo)!=null?d:"",n.category_name=(_=e.category_name)!=null?_:"",n}};function kn(){return{clan_id:"0",channel_id:"0",content:"",mentions:[],attachments:[],references:[],mode:0,anonymous_message:!1,mention_everyone:!1,avatar:"",is_public:!1,code:0,topic_id:"0",id:"0"}}var F={encode(e,n=h.default.Writer.create()){e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.content!==""&&n.uint32(26).string(e.content);for(let t of e.mentions)B.encode(t,n.uint32(34).fork()).ldelim();for(let t of e.attachments)v.encode(t,n.uint32(42).fork()).ldelim();for(let t of e.references)H.encode(t,n.uint32(50).fork()).ldelim();return e.mode!==0&&n.uint32(56).int32(e.mode),e.anonymous_message!==!1&&n.uint32(64).bool(e.anonymous_message),e.mention_everyone!==!1&&n.uint32(72).bool(e.mention_everyone),e.avatar!==""&&n.uint32(82).string(e.avatar),e.is_public!==!1&&n.uint32(88).bool(e.is_public),e.code!==0&&n.uint32(96).int32(e.code),e.topic_id!=="0"&&n.uint32(104).int64(e.topic_id),e.id!=="0"&&n.uint32(112).int64(e.id),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=kn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=T(t.int64());continue;case 2:if(i!==16)break;a.channel_id=T(t.int64());continue;case 3:if(i!==26)break;a.content=t.string();continue;case 4:if(i!==34)break;a.mentions.push(B.decode(t,t.uint32()));continue;case 5:if(i!==42)break;a.attachments.push(v.decode(t,t.uint32()));continue;case 6:if(i!==50)break;a.references.push(H.decode(t,t.uint32()));continue;case 7:if(i!==56)break;a.mode=t.int32();continue;case 8:if(i!==64)break;a.anonymous_message=t.bool();continue;case 9:if(i!==72)break;a.mention_everyone=t.bool();continue;case 10:if(i!==82)break;a.avatar=t.string();continue;case 11:if(i!==88)break;a.is_public=t.bool();continue;case 12:if(i!==96)break;a.code=t.int32();continue;case 13:if(i!==104)break;a.topic_id=T(t.int64());continue;case 14:if(i!==112)break;a.id=T(t.int64());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:u(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",content:u(e.content)?globalThis.String(e.content):"",mentions:globalThis.Array.isArray(e==null?void 0:e.mentions)?e.mentions.map(n=>B.fromJSON(n)):[],attachments:globalThis.Array.isArray(e==null?void 0:e.attachments)?e.attachments.map(n=>v.fromJSON(n)):[],references:globalThis.Array.isArray(e==null?void 0:e.references)?e.references.map(n=>H.fromJSON(n)):[],mode:u(e.mode)?globalThis.Number(e.mode):0,anonymous_message:u(e.anonymous_message)?globalThis.Boolean(e.anonymous_message):!1,mention_everyone:u(e.mention_everyone)?globalThis.Boolean(e.mention_everyone):!1,avatar:u(e.avatar)?globalThis.String(e.avatar):"",is_public:u(e.is_public)?globalThis.Boolean(e.is_public):!1,code:u(e.code)?globalThis.Number(e.code):0,topic_id:u(e.topic_id)?globalThis.String(e.topic_id):"0",id:u(e.id)?globalThis.String(e.id):"0"}},toJSON(e){var t,r,a;let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.content!==""&&(n.content=e.content),(t=e.mentions)!=null&&t.length&&(n.mentions=e.mentions.map(i=>B.toJSON(i))),(r=e.attachments)!=null&&r.length&&(n.attachments=e.attachments.map(i=>v.toJSON(i))),(a=e.references)!=null&&a.length&&(n.references=e.references.map(i=>H.toJSON(i))),e.mode!==0&&(n.mode=Math.round(e.mode)),e.anonymous_message!==!1&&(n.anonymous_message=e.anonymous_message),e.mention_everyone!==!1&&(n.mention_everyone=e.mention_everyone),e.avatar!==""&&(n.avatar=e.avatar),e.is_public!==!1&&(n.is_public=e.is_public),e.code!==0&&(n.code=Math.round(e.code)),e.topic_id!=="0"&&(n.topic_id=e.topic_id),e.id!=="0"&&(n.id=e.id),n},create(e){return F.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p,y,M,I,N;let n=kn();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.content=(a=e.content)!=null?a:"",n.mentions=((i=e.mentions)==null?void 0:i.map(C=>B.fromPartial(C)))||[],n.attachments=((o=e.attachments)==null?void 0:o.map(C=>v.fromPartial(C)))||[],n.references=((l=e.references)==null?void 0:l.map(C=>H.fromPartial(C)))||[],n.mode=(c=e.mode)!=null?c:0,n.anonymous_message=(d=e.anonymous_message)!=null?d:!1,n.mention_everyone=(_=e.mention_everyone)!=null?_:!1,n.avatar=(p=e.avatar)!=null?p:"",n.is_public=(y=e.is_public)!=null?y:!1,n.code=(M=e.code)!=null?M:0,n.topic_id=(I=e.topic_id)!=null?I:"0",n.id=(N=e.id)!=null?N:"0",n}};function Sn(){return{code:0,message:"",context:{}}}var K={encode(e,n=h.default.Writer.create()){return e.code!==0&&n.uint32(8).int32(e.code),e.message!==""&&n.uint32(18).string(e.message),Object.entries(e.context).forEach(([t,r])=>{Be.encode({key:t,value:r},n.uint32(26).fork()).ldelim()}),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Sn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.code=t.int32();continue;case 2:if(i!==18)break;a.message=t.string();continue;case 3:if(i!==26)break;let o=Be.decode(t,t.uint32());o.value!==void 0&&(a.context[o.key]=o.value);continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{code:u(e.code)?globalThis.Number(e.code):0,message:u(e.message)?globalThis.String(e.message):"",context:Ln(e.context)?Object.entries(e.context).reduce((n,[t,r])=>(n[t]=String(r),n),{}):{}}},toJSON(e){let n={};if(e.code!==0&&(n.code=Math.round(e.code)),e.message!==""&&(n.message=e.message),e.context){let t=Object.entries(e.context);t.length>0&&(n.context={},t.forEach(([r,a])=>{n.context[r]=a}))}return n},create(e){return K.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a;let n=Sn();return n.code=(t=e.code)!=null?t:0,n.message=(r=e.message)!=null?r:"",n.context=Object.entries((a=e.context)!=null?a:{}).reduce((i,[o,l])=>(l!==void 0&&(i[o]=globalThis.String(l)),i),{}),n}};function vn(){return{key:"",value:""}}var Be={encode(e,n=h.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=vn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.key=t.string();continue;case 2:if(i!==18)break;a.value=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{key:u(e.key)?globalThis.String(e.key):"",value:u(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Be.fromPartial(e!=null?e:{})},fromPartial(e){var t,r;let n=vn();return n.key=(t=e.key)!=null?t:"",n.value=(r=e.value)!=null?r:"",n}};function Tn(){return{}}var Y={encode(e,n=h.default.Writer.create()){return n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Tn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return Y.fromPartial(e!=null?e:{})},fromPartial(e){return Tn()}};function Cn(){return{}}var G={encode(e,n=h.default.Writer.create()){return n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Cn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return G.fromPartial(e!=null?e:{})},fromPartial(e){return Cn()}};function bn(){return{user_id:"0",session_id:"",username:"",status:void 0,is_mobile:!1,user_status:""}}var b={encode(e,n=h.default.Writer.create()){return e.user_id!=="0"&&n.uint32(8).int64(e.user_id),e.session_id!==""&&n.uint32(18).string(e.session_id),e.username!==""&&n.uint32(26).string(e.username),e.status!==void 0&&Pe.encode({value:e.status},n.uint32(34).fork()).ldelim(),e.is_mobile!==!1&&n.uint32(40).bool(e.is_mobile),e.user_status!==""&&n.uint32(50).string(e.user_status),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=bn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.user_id=T(t.int64());continue;case 2:if(i!==18)break;a.session_id=t.string();continue;case 3:if(i!==26)break;a.username=t.string();continue;case 4:if(i!==34)break;a.status=Pe.decode(t,t.uint32()).value;continue;case 5:if(i!==40)break;a.is_mobile=t.bool();continue;case 6:if(i!==50)break;a.user_status=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{user_id:u(e.user_id)?globalThis.String(e.user_id):"0",session_id:u(e.session_id)?globalThis.String(e.session_id):"",username:u(e.username)?globalThis.String(e.username):"",status:u(e.status)?String(e.status):void 0,is_mobile:u(e.is_mobile)?globalThis.Boolean(e.is_mobile):!1,user_status:u(e.user_status)?globalThis.String(e.user_status):""}},toJSON(e){let n={};return e.user_id!=="0"&&(n.user_id=e.user_id),e.session_id!==""&&(n.session_id=e.session_id),e.username!==""&&(n.username=e.username),e.status!==void 0&&(n.status=e.status),e.is_mobile!==!1&&(n.is_mobile=e.is_mobile),e.user_status!==""&&(n.user_status=e.user_status),n},create(e){return b.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l;let n=bn();return n.user_id=(t=e.user_id)!=null?t:"0",n.session_id=(r=e.session_id)!=null?r:"",n.username=(a=e.username)!=null?a:"",n.status=(i=e.status)!=null?i:void 0,n.is_mobile=(o=e.is_mobile)!=null?o:!1,n.user_status=(l=e.user_status)!=null?l:"",n}};function T(e){return e.toString()}h.default.util.Long!==We.default&&(h.default.util.Long=We.default,h.default.configure());function Ln(e){return typeof e=="object"&&e!==null}function u(e){return e!=null}var R=class{constructor(){}get onClose(){return this._socket.onclose}set onClose(n){this._socket.onclose=n}get onError(){return this._socket.onerror}set onError(n){this._socket.onerror=n}get onMessage(){return this._socket.onmessage}set onMessage(n){n?this._socket.onmessage=t=>{let r=t.data,a=new Uint8Array(r),i=ue.decode(a);i.channel_message&&i.channel_message.code==null&&(i.channel_message.code=0),n(i)}:n=null}get onOpen(){return this._socket.onopen}set onOpen(n){this._socket.onopen=n}isOpen(){var n;return((n=this._socket)==null?void 0:n.readyState)==WebSocket.OPEN}close(){var n;(n=this._socket)==null||n.close(),this._socket=void 0}connect(n,t,r,a,i,o,l){l&&l.addEventListener("abort",()=>{this.close()});let c=r?`:${r}`:"",d=`${n}${t}${c}/ws?lang=en&status=${encodeURIComponent(a.toString())}&token=${encodeURIComponent(i)}&format=protobuf&platform=${encodeURIComponent(o)}`;this._socket=new WebSocket(d),this._socket.binaryType="arraybuffer"}send(n){let r=ue.encode(ue.fromPartial(n)).finish();this._socket.send(r)}};var Pn=!1,k={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},x=class x{constructor(n,t,r=!1,a=!1,i=new R,o=x.DefaultSendTimeoutMs){this.host=n;this.port=t;this.useSSL=r;this.verbose=a;this.adapter=i;this.sendTimeoutMs=o;this.cIds={},this.nextCid=1,this._heartbeatTimeoutMs=x.DefaultHeartbeatTimeoutMs,this._connectionState=k.DISCONNECTED}generatecid(){let n=this.nextCid.toString();return++this.nextCid,n}isOpen(){return this._connectionState===k.CONNECTED}connect(n,t=!1,r="",a=x.DefaultConnectTimeoutMs,i){if(this._connectionState===k.CONNECTED)return Promise.resolve(n);if(this._connectionState===k.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=k.CONNECTING;let o=this.useSSL?"wss://":"ws://";this.adapter.connect(o,this.host,this.port,t,n.token,r,i),this.adapter.onClose=c=>{this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(c)},this.adapter.onMessage=c=>g(this,null,function*(){if(this.verbose&&window&&window.console&&console.log("Response: %o",JSON.stringify(c)),c.cid){let d=this.cIds[c.cid];if(!d){this.verbose&&window&&window.console&&console.error("No promise executor for message: %o",c);return}delete this.cIds[c.cid],c.error?d.reject(c.error):d.resolve(c)}else if(c.channel_message){let d=Wn(c);this.onchannelmessage(d)}else this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",c)});let l=new Promise((c,d)=>{this.adapter.onOpen=_=>{this.verbose&&window&&window.console&&console.log(_);let p=Pn;Pn=!0,this.clearConnectTimeout(),this._connectionState=k.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,c(n),p&&this.onreconnect(_)},this.adapter.onError=_=>{this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(_),this._connectPromise=void 0,this.adapter.close(),d(_)},this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.close(),this._connectPromise=void 0,d("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},a)});return this._connectPromise=l,this._connectPromise}disconnect(n=!0){this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.isOpen()&&this.adapter.close(),n&&this.ondisconnect({})}setHeartbeatTimeoutMs(n){this._heartbeatTimeoutMs=n}getHeartbeatTimeoutMs(){return this._heartbeatTimeoutMs}onreconnect(n){this.verbose&&window&&window.console&&console.log(n)}ondisconnect(n){this.verbose&&window&&window.console&&console.log(n)}onerror(n){this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.verbose&&window&&window.console&&console.log(n)}onheartbeattimeout(){this.verbose&&window&&window.console&&console.log("Heartbeat timeout.")}onchannelmessage(n){this.verbose&&window&&window.console&&console.log(n)}send(n,t=x.DefaultSendTimeoutMs){let r=n;return new Promise((a,i)=>{var o,l;if(!this.adapter.isOpen())i("Socket connection has not been established yet.");else{r.channel_message_send?r.channel_message_send.content=JSON.stringify(r.channel_message_send.content):r.channel_message_update?r.channel_message_update.content=JSON.stringify(r.channel_message_update.content):r.ephemeral_message_send?r.ephemeral_message_send.message.content=JSON.stringify((o=r.ephemeral_message_send.message)==null?void 0:o.content):r.quick_menu_event&&(r.quick_menu_event.message.content=JSON.stringify((l=r.quick_menu_event.message)==null?void 0:l.content));let c=this.generatecid();this.cIds[c]={resolve:a,reject:i},t!==1/0&&t>0&&setTimeout(()=>{i("The socket timed out while waiting for a response.")},t),r.cid=c,this.adapter.send(r)}})}joinChat(n,t,r,a){return g(this,null,function*(){return(yield this.send({channel_join:{clan_id:n,channel_id:t,channel_type:r,is_public:a}})).channel})}leaveChat(n,t,r,a){return g(this,null,function*(){return this.send({channel_leave:{clan_id:n,channel_id:t,channel_type:r,is_public:a}})})}writeChatMessage(n,t,r,a,i,o,l,c,d,_,p){return g(this,null,function*(){return(yield this.send({channel_message_send:{clan_id:n,channel_id:t,mode:r,is_public:a,content:i,reactions:[],mentions:[],attachments:o,references:[],anonymous_message:l,mention_everyone:c,avatar:d,code:_,topic_id:p}},1/0)).channel_message_ack})}pingPong(){return g(this,null,function*(){if(!this.isOpen()){this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop();return}try{yield this.send({ping:{}},this._heartbeatTimeoutMs)}catch(n){this._connectionState=k.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)}};x.DefaultHeartbeatTimeoutMs=1e4,x.DefaultSendTimeoutMs=1e4,x.DefaultConnectTimeoutMs=3e4;var fe=x;function Wn(e){var n,t;try{n=Ce(e.channel_message.content)}catch(a){console.log("content is invalid",a)}try{t=dn(e.channel_message.attachments)}catch(a){console.log("attachments is invalid",a)}var r={id:e.id||e.channel_message.message_id,avatar:e.channel_message.avatar,channel_id:e.channel_message.channel_id,mode:e.channel_message.mode,channel_label:e.channel_message.channel_label,clan_id:e.channel_message.clan_id,code:e.channel_message.code,message_id:e.channel_message.message_id,sender_id:e.channel_message.sender_id,update_time:e.channel_message.update_time,clan_logo:e.channel_message.clan_logo,category_name:e.channel_message.category_name,username:e.channel_message.username,clan_nick:e.channel_message.clan_nick,clan_avatar:e.channel_message.clan_avatar,display_name:e.channel_message.display_name,content:n,attachments:t==null?void 0:t.attachments,hide_editted:e.channel_message.hide_editted,is_public:e.channel_message.is_public,create_time_seconds:e.channel_message.create_time_seconds,update_time_seconds:e.channel_message.update_time_seconds,topic_id:e.channel_message.topic_id};return r}var X=class extends Error{constructor(t,r){super(t!=null?t:"Authentication failed.");this.statusCode=r;this.name="AuthenticationError"}},he=class extends Error{constructor(n){super(n!=null?n:"Session error."),this.name="SessionError"}};function He(e){let n=new URL(e);return`${n.protocol==="https:"?"https://":"http://"}${n.hostname}:${n.port}`}var Ee=class e{constructor(n,t,r){this.refreshTokenPromise=null;this._session=n,this._client=t,this._userId=r}get userId(){return this._userId}get session(){return this._session}get client(){return this._client}static initClient(n){let{token:t,refresh_token:r,api_url:a,ws_url:i,user_id:o,serverkey:l}=n;if(!t||!r||!a||!i||!o)throw new he("Missing required fields: token, refresh_token, api_url, ws_url, and user_id are all required");let c=oe.restore(t,r,a,i,!0),d=new _e(l||J,7e3,He(a));return new e(c,d,o)}static authenticate(n){return g(this,null,function*(){let{id_token:t,user_id:r,username:a,serverkey:i=J,gateway_url:o=pe}=n,l=new _e(i||J,7e3,He(o)),c={id_token:t,user_id:r,username:a},d=yield l.authenticateIdToken(i,"",c);if(!d)throw new X("Authentication failed: No response from server.");if(!d.token||!d.refresh_token||!d.api_url||!d.ws_url||!d.user_id)throw new X("Invalid authentication response: missing required fields");let _=oe.restore(d.token,d.refresh_token,d.api_url,d.ws_url,!0);return l.setBasePath(He(d.api_url)),new e(_,l,d.user_id)})}createDM(n){return g(this,null,function*(){let t={type:3,channel_private:1,user_ids:[n]};return this._client.createChannelDesc(this._session.token,t)})}createGroupDM(n){return g(this,null,function*(){if(n.length===0)throw new Error("At least one user ID is required for a group DM");let t={type:2,channel_private:1,user_ids:n};return this._client.createChannelDesc(this._session.token,t)})}uploadAttachment(n){return g(this,null,function*(){return this._client.uploadAttachmentFile(this._session.token,n)})}refreshSession(){return g(this,null,function*(){return this._session?(this._session.created&&this._session.expires_at-this._session.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"),this._session.created&&this._session.refresh_expires_at-this._session.created_at<3700&&console.warn("Session refresh lifetime too short, please set '--session.refresh_token_expiry_sec' option. See the documentation for more info: https://mezon.vn/docs/mezon/getting-started/configuration/#session"),this.refreshTokenPromise?this.refreshTokenPromise:(this.refreshTokenPromise=new Promise((n,t)=>g(this,null,function*(){try{let r=yield this.client.sessionRefresh(this._client.serverKey||J,"",{token:this._session.refresh_token,vars:this._session.vars,is_remember:this._session.is_remember});this._session.update(r.token,r.refresh_token,r.is_remember||!1),this.onRefreshSession(r),n(this._session)}catch(r){console.error("Session refresh failed:",r),t(r)}finally{this.refreshTokenPromise=null}})),this.refreshTokenPromise)):(console.error("Cannot refresh a null session."),this._session)})}createSocket(n=!1,t=new R,r=fe.DefaultSendTimeoutMs){let{host:a,port:i,useSSL:o}={host:this._session.ws_url,port:"443",useSSL:!0};return new fe(a,i,o,n,t,r)}onRefreshSession(n){console.log(`Token refresh occurred. Token: ${n.token}`)}isSessionExpired(){return this._session.isexpired(Date.now()/1e3)}isRefreshSessionExpired(){return this._session.isrefreshexpired(Date.now()/1e3)}getToken(){return this._session.token}getRefreshToken(){return this._session.refresh_token}getSession(){return this.session}exportSession(){return{token:this._session.token,refresh_token:this._session.refresh_token,api_url:this._session.api_url||"",ws_url:this._session.ws_url||"",user_id:this._userId}}};var O=class extends Error{constructor(n){super(n),this.name="SocketError"}};function En(r){return g(this,arguments,function*(e,n=20,t=100){var l;let a=0,i=t,o=e;for(;a<n;){if((l=o.adapter)!=null&&l.isOpen())return;yield new Promise(c=>setTimeout(c,i)),i*=2,a++}throw new O(`Socket failed to connect after ${n} attempts (total wait: ~${Math.pow(2,n)*t}ms)`)})}var Ae=class{constructor(n,t){this._client=n;this._session=t;this._socket=null;this._isConnected=!1;this._messageHandlers=[]}get isConnected(){return this._isConnected}get socket(){if(!this._socket)throw new O("Socket is not connected. Call connect() first.");return this._socket}connect(){return g(this,arguments,function*(n={}){if(this._isConnected)throw new O("Socket is already connected. Call disconnect() first.");let{onError:t,onDisconnect:r,verbose:a=!1}=n;this._errorHandler=t,this._disconnectHandler=r,this._socket=this._client.createSocket(a,new R),this._socket.onerror=i=>{var o;(o=this._errorHandler)==null||o.call(this,i)},this._socket.ondisconnect=()=>{var i;this._isConnected=!1,(i=this._disconnectHandler)==null||i.call(this)},this._socket.onchannelmessage=i=>{var o;if(!i){(o=this._errorHandler)==null||o.call(this,new O("Received null or undefined channel message"));return}this._messageHandlers.forEach(l=>{try{l(i)}catch(c){console.error("Error in message handler:",c)}})},yield this._socket.connect(this._session,!0,"0"),this._isConnected=!0})}disconnect(){this._socket&&(this._socket.disconnect(!0),this._socket=null,this._isConnected=!1)}setChannelMessageHandler(n){this.onChannelMessage(n)}onChannelMessage(n){return this._messageHandlers.push(n),()=>{let t=this._messageHandlers.indexOf(n);t!==-1&&this._messageHandlers.splice(t,1)}}joinDMChannel(n){return g(this,null,function*(){yield En(this.socket),yield this.socket.joinChat(A,n,3,!1)})}joinGroupChannel(n){return g(this,null,function*(){yield En(this.socket),yield this.socket.joinChat(A,n,2,!1)})}leaveDMChannel(n){return g(this,null,function*(){yield this.socket.leaveChat(A,n,3,!1)})}leaveGroupChannel(n){return g(this,null,function*(){yield this.socket.leaveChat(A,n,2,!1)})}sendDM(n){return g(this,null,function*(){let{channelId:t,content:r,attachments:a,hideLink:i=!1}=n;yield this.socket.writeChatMessage(A,t,4,!1,r,a,!1,i,"",0)})}sendGroup(n){return g(this,null,function*(){let{channelId:t,content:r,attachments:a,hideLink:i=!1}=n;yield this.socket.writeChatMessage(A,t,3,!1,r,a,!1,i,"",0)})}setErrorHandler(n){this._errorHandler=n,this._socket&&(this._socket.onerror=n)}};
|
|
1
|
+
"use strict";var An=Object.create;var se=Object.defineProperty;var xn=Object.getOwnPropertyDescriptor;var Mn=Object.getOwnPropertyNames,Fe=Object.getOwnPropertySymbols,In=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty,Nn=Object.prototype.propertyIsEnumerable;var Ke=(e,n,t)=>n in e?se(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,xe=(e,n)=>{for(var t in n||(n={}))Ye.call(n,t)&&Ke(e,t,n[t]);if(Fe)for(var t of Fe(n))Nn.call(n,t)&&Ke(e,t,n[t]);return e};var Rn=(e,n)=>{for(var t in n)se(e,t,{get:n[t],enumerable:!0})},Ge=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Mn(n))!Ye.call(e,a)&&a!==t&&se(e,a,{get:()=>n[a],enumerable:!(r=xn(n,a))||r.enumerable});return e};var D=(e,n,t)=>(t=e!=null?An(In(e)):{},Ge(n||!e||!e.__esModule?se(t,"default",{value:e,enumerable:!0}):t,e)),On=e=>Ge(se({},"__esModule",{value:!0}),e);var g=(e,n,t)=>new Promise((r,a)=>{var i=c=>{try{l(t.next(c))}catch(d){a(d)}},o=c=>{try{l(t.throw(c))}catch(d){a(d)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,o);l((t=t.apply(e,n)).next())});var Bn={};Rn(Bn,{AuthenticationError:()=>X,CHANNEL_TYPE_DM:()=>U,CHANNEL_TYPE_GROUP:()=>L,CLAN_DM:()=>A,DEFAULT_SERVER_KEY:()=>J,LightClient:()=>Ee,LightSocket:()=>Ae,MEZON_GW_URL:()=>pe,SOCKET_READY_MAX_RETRY:()=>me,SOCKET_READY_RETRY_DELAY:()=>ge,STREAM_MODE_DM:()=>ye,STREAM_MODE_GROUP:()=>ke,SessionError:()=>he,SocketError:()=>O});module.exports=On(Bn);var pe="https://gw.mezon.ai",me=20,ge=100,A="0",U=3,L=2,ye=4,ke=3,J="DefaultServerKey";var Me=D(require("js-base64")),oe=class e{constructor(n,t,r,a,i,o,l){this.created=r;this.api_url=a;this.ws_url=i;this.id_token=o;this.token=n,this.refresh_token=t,this.id_token=o,this.api_url=a,this.ws_url=i,this.created_at=Math.floor(new Date().getTime()/1e3),this.is_remember=l,this.update(n,t,l)}isexpired(n){return this.expires_at-n<=0}isrefreshexpired(n){return this.refresh_expires_at-n<=0}update(n,t,r){let a=n.split(".");if(a.length!=3)throw"jwt is not valid.";let i=JSON.parse(Me.atob(a[1])),o=Math.floor(parseInt(i.exp));if(t){let l=t.split(".");if(l.length!=3)throw"refresh jwt is not valid.";let c=JSON.parse(Me.atob(l[1])),d=Math.floor(parseInt(c.exp));this.refresh_expires_at=d,this.refresh_token=t,this.is_remember=r}this.token=n,this.expires_at=o,this.username=i.usn,this.user_id=i.uid,this.vars=i.vrs}static restore(n,t,r,a,i){return new e(n,t,!1,r,a,"",i)}};var Ie=D(require("long")),f=D(require("protobufjs/minimal"));function Xe(){return{created:!1,token:"",refresh_token:"",user_id:"0",is_remember:!1,api_url:"",id_token:""}}var Re={encode(e,n=f.default.Writer.create()){return e.created!==!1&&n.uint32(8).bool(e.created),e.token!==""&&n.uint32(18).string(e.token),e.refresh_token!==""&&n.uint32(26).string(e.refresh_token),e.user_id!=="0"&&n.uint32(32).int64(e.user_id),e.is_remember!==!1&&n.uint32(40).bool(e.is_remember),e.api_url!==""&&n.uint32(50).string(e.api_url),e.id_token!==""&&n.uint32(58).string(e.id_token),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Xe();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.created=t.bool();continue;case 2:if(i!==18)break;a.token=t.string();continue;case 3:if(i!==26)break;a.refresh_token=t.string();continue;case 4:if(i!==32)break;a.user_id=m(t.int64());continue;case 5:if(i!==40)break;a.is_remember=t.bool();continue;case 6:if(i!==50)break;a.api_url=t.string();continue;case 7:if(i!==58)break;a.id_token=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{created:s(e.created)?globalThis.Boolean(e.created):!1,token:s(e.token)?globalThis.String(e.token):"",refresh_token:s(e.refresh_token)?globalThis.String(e.refresh_token):"",user_id:s(e.user_id)?globalThis.String(e.user_id):"0",is_remember:s(e.is_remember)?globalThis.Boolean(e.is_remember):!1,api_url:s(e.api_url)?globalThis.String(e.api_url):"",id_token:s(e.id_token)?globalThis.String(e.id_token):""}},toJSON(e){let n={};return e.created!==!1&&(n.created=e.created),e.token!==""&&(n.token=e.token),e.refresh_token!==""&&(n.refresh_token=e.refresh_token),e.user_id!=="0"&&(n.user_id=e.user_id),e.is_remember!==!1&&(n.is_remember=e.is_remember),e.api_url!==""&&(n.api_url=e.api_url),e.id_token!==""&&(n.id_token=e.id_token),n},create(e){return Re.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c;let n=Xe();return n.created=(t=e.created)!=null?t:!1,n.token=(r=e.token)!=null?r:"",n.refresh_token=(a=e.refresh_token)!=null?a:"",n.user_id=(i=e.user_id)!=null?i:"0",n.is_remember=(o=e.is_remember)!=null?o:!1,n.api_url=(l=e.api_url)!=null?l:"",n.id_token=(c=e.id_token)!=null?c:"",n}};function Ze(){return{token:"",vars:{},is_remember:!1}}var Se={encode(e,n=f.default.Writer.create()){return e.token!==""&&n.uint32(10).string(e.token),Object.entries(e.vars).forEach(([t,r])=>{Ne.encode({key:t,value:r},n.uint32(18).fork()).ldelim()}),e.is_remember!==!1&&n.uint32(24).bool(e.is_remember),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Ze();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.token=t.string();continue;case 2:if(i!==18)break;let o=Ne.decode(t,t.uint32());o.value!==void 0&&(a.vars[o.key]=o.value);continue;case 3:if(i!==24)break;a.is_remember=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{token:s(e.token)?globalThis.String(e.token):"",vars:Dn(e.vars)?Object.entries(e.vars).reduce((n,[t,r])=>(n[t]=String(r),n),{}):{},is_remember:s(e.is_remember)?globalThis.Boolean(e.is_remember):!1}},toJSON(e){let n={};if(e.token!==""&&(n.token=e.token),e.vars){let t=Object.entries(e.vars);t.length>0&&(n.vars={},t.forEach(([r,a])=>{n.vars[r]=a}))}return e.is_remember!==!1&&(n.is_remember=e.is_remember),n},create(e){return Se.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a;let n=Ze();return n.token=(t=e.token)!=null?t:"",n.vars=Object.entries((r=e.vars)!=null?r:{}).reduce((i,[o,l])=>(l!==void 0&&(i[o]=globalThis.String(l)),i),{}),n.is_remember=(a=e.is_remember)!=null?a:!1,n}};function $e(){return{key:"",value:""}}var Ne={encode(e,n=f.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=$e();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.key=t.string();continue;case 2:if(i!==18)break;a.value=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{key:s(e.key)?globalThis.String(e.key):"",value:s(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Ne.fromPartial(e!=null?e:{})},fromPartial(e){var t,r;let n=$e();return n.key=(t=e.key)!=null?t:"",n.value=(r=e.value)!=null?r:"",n}};function Qe(){return{clan_id:"0",parent_id:"0",channel_id:"0",category_id:"0",type:0,channel_label:"",channel_private:0,user_ids:[],app_id:"0"}}var ve={encode(e,n=f.default.Writer.create()){e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.parent_id!=="0"&&n.uint32(16).int64(e.parent_id),e.channel_id!=="0"&&n.uint32(24).int64(e.channel_id),e.category_id!=="0"&&n.uint32(32).int64(e.category_id),e.type!==0&&n.uint32(40).int32(e.type),e.channel_label!==""&&n.uint32(50).string(e.channel_label),e.channel_private!==0&&n.uint32(56).int32(e.channel_private),n.uint32(66).fork();for(let t of e.user_ids)n.int64(t);return n.ldelim(),e.app_id!=="0"&&n.uint32(72).int64(e.app_id),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Qe();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=m(t.int64());continue;case 2:if(i!==16)break;a.parent_id=m(t.int64());continue;case 3:if(i!==24)break;a.channel_id=m(t.int64());continue;case 4:if(i!==32)break;a.category_id=m(t.int64());continue;case 5:if(i!==40)break;a.type=t.int32();continue;case 6:if(i!==50)break;a.channel_label=t.string();continue;case 7:if(i!==56)break;a.channel_private=t.int32();continue;case 8:if(i===64){a.user_ids.push(m(t.int64()));continue}if(i===66){let o=t.uint32()+t.pos;for(;t.pos<o;)a.user_ids.push(m(t.int64()));continue}break;case 9:if(i!==72)break;a.app_id=m(t.int64());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:s(e.clan_id)?globalThis.String(e.clan_id):"0",parent_id:s(e.parent_id)?globalThis.String(e.parent_id):"0",channel_id:s(e.channel_id)?globalThis.String(e.channel_id):"0",category_id:s(e.category_id)?globalThis.String(e.category_id):"0",type:s(e.type)?globalThis.Number(e.type):0,channel_label:s(e.channel_label)?globalThis.String(e.channel_label):"",channel_private:s(e.channel_private)?globalThis.Number(e.channel_private):0,user_ids:globalThis.Array.isArray(e==null?void 0:e.user_ids)?e.user_ids.map(n=>globalThis.String(n)):[],app_id:s(e.app_id)?globalThis.String(e.app_id):"0"}},toJSON(e){var t;let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.parent_id!=="0"&&(n.parent_id=e.parent_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.category_id!=="0"&&(n.category_id=e.category_id),e.type!==0&&(n.type=Math.round(e.type)),e.channel_label!==""&&(n.channel_label=e.channel_label),e.channel_private!==0&&(n.channel_private=Math.round(e.channel_private)),(t=e.user_ids)!=null&&t.length&&(n.user_ids=e.user_ids),e.app_id!=="0"&&(n.app_id=e.app_id),n},create(e){return ve.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_;let n=Qe();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.parent_id=(r=e.parent_id)!=null?r:"0",n.channel_id=(a=e.channel_id)!=null?a:"0",n.category_id=(i=e.category_id)!=null?i:"0",n.type=(o=e.type)!=null?o:0,n.channel_label=(l=e.channel_label)!=null?l:"",n.channel_private=(c=e.channel_private)!=null?c:0,n.user_ids=((d=e.user_ids)==null?void 0:d.map(p=>p))||[],n.app_id=(_=e.app_id)!=null?_:"0",n}};function je(){return{clan_id:"0",parent_id:"0",channel_id:"0",category_id:"0",category_name:"",type:0,creator_id:"0",channel_label:"",channel_private:0,avatars:[],user_ids:[],last_sent_message:void 0,last_seen_message:void 0,onlines:[],meeting_code:"",count_mess_unread:0,active:0,last_pin_message:"",usernames:[],creator_name:"",create_time_seconds:0,update_time_seconds:0,display_names:[],channel_avatar:"",clan_name:"",app_id:"0",is_mute:!1,age_restricted:0,topic:"",e2ee:0,member_count:0}}var Oe={encode(e,n=f.default.Writer.create()){e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.parent_id!=="0"&&n.uint32(16).int64(e.parent_id),e.channel_id!=="0"&&n.uint32(24).int64(e.channel_id),e.category_id!=="0"&&n.uint32(32).int64(e.category_id),e.category_name!==""&&n.uint32(42).string(e.category_name),e.type!==0&&n.uint32(48).int32(e.type),e.creator_id!=="0"&&n.uint32(56).int64(e.creator_id),e.channel_label!==""&&n.uint32(66).string(e.channel_label),e.channel_private!==0&&n.uint32(72).int32(e.channel_private);for(let t of e.avatars)n.uint32(82).string(t);n.uint32(90).fork();for(let t of e.user_ids)n.int64(t);n.ldelim(),e.last_sent_message!==void 0&&S.encode(e.last_sent_message,n.uint32(98).fork()).ldelim(),e.last_seen_message!==void 0&&S.encode(e.last_seen_message,n.uint32(106).fork()).ldelim(),n.uint32(114).fork();for(let t of e.onlines)n.bool(t);n.ldelim(),e.meeting_code!==""&&n.uint32(122).string(e.meeting_code),e.count_mess_unread!==0&&n.uint32(128).int32(e.count_mess_unread),e.active!==0&&n.uint32(136).int32(e.active),e.last_pin_message!==""&&n.uint32(146).string(e.last_pin_message);for(let t of e.usernames)n.uint32(154).string(t);e.creator_name!==""&&n.uint32(162).string(e.creator_name),e.create_time_seconds!==0&&n.uint32(168).uint32(e.create_time_seconds),e.update_time_seconds!==0&&n.uint32(176).uint32(e.update_time_seconds);for(let t of e.display_names)n.uint32(186).string(t);return e.channel_avatar!==""&&n.uint32(194).string(e.channel_avatar),e.clan_name!==""&&n.uint32(202).string(e.clan_name),e.app_id!=="0"&&n.uint32(208).int64(e.app_id),e.is_mute!==!1&&n.uint32(216).bool(e.is_mute),e.age_restricted!==0&&n.uint32(224).int32(e.age_restricted),e.topic!==""&&n.uint32(234).string(e.topic),e.e2ee!==0&&n.uint32(240).int32(e.e2ee),e.member_count!==0&&n.uint32(248).int32(e.member_count),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=je();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=m(t.int64());continue;case 2:if(i!==16)break;a.parent_id=m(t.int64());continue;case 3:if(i!==24)break;a.channel_id=m(t.int64());continue;case 4:if(i!==32)break;a.category_id=m(t.int64());continue;case 5:if(i!==42)break;a.category_name=t.string();continue;case 6:if(i!==48)break;a.type=t.int32();continue;case 7:if(i!==56)break;a.creator_id=m(t.int64());continue;case 8:if(i!==66)break;a.channel_label=t.string();continue;case 9:if(i!==72)break;a.channel_private=t.int32();continue;case 10:if(i!==82)break;a.avatars.push(t.string());continue;case 11:if(i===88){a.user_ids.push(m(t.int64()));continue}if(i===90){let o=t.uint32()+t.pos;for(;t.pos<o;)a.user_ids.push(m(t.int64()));continue}break;case 12:if(i!==98)break;a.last_sent_message=S.decode(t,t.uint32());continue;case 13:if(i!==106)break;a.last_seen_message=S.decode(t,t.uint32());continue;case 14:if(i===112){a.onlines.push(t.bool());continue}if(i===114){let o=t.uint32()+t.pos;for(;t.pos<o;)a.onlines.push(t.bool());continue}break;case 15:if(i!==122)break;a.meeting_code=t.string();continue;case 16:if(i!==128)break;a.count_mess_unread=t.int32();continue;case 17:if(i!==136)break;a.active=t.int32();continue;case 18:if(i!==146)break;a.last_pin_message=t.string();continue;case 19:if(i!==154)break;a.usernames.push(t.string());continue;case 20:if(i!==162)break;a.creator_name=t.string();continue;case 21:if(i!==168)break;a.create_time_seconds=t.uint32();continue;case 22:if(i!==176)break;a.update_time_seconds=t.uint32();continue;case 23:if(i!==186)break;a.display_names.push(t.string());continue;case 24:if(i!==194)break;a.channel_avatar=t.string();continue;case 25:if(i!==202)break;a.clan_name=t.string();continue;case 26:if(i!==208)break;a.app_id=m(t.int64());continue;case 27:if(i!==216)break;a.is_mute=t.bool();continue;case 28:if(i!==224)break;a.age_restricted=t.int32();continue;case 29:if(i!==234)break;a.topic=t.string();continue;case 30:if(i!==240)break;a.e2ee=t.int32();continue;case 31:if(i!==248)break;a.member_count=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:s(e.clan_id)?globalThis.String(e.clan_id):"0",parent_id:s(e.parent_id)?globalThis.String(e.parent_id):"0",channel_id:s(e.channel_id)?globalThis.String(e.channel_id):"0",category_id:s(e.category_id)?globalThis.String(e.category_id):"0",category_name:s(e.category_name)?globalThis.String(e.category_name):"",type:s(e.type)?globalThis.Number(e.type):0,creator_id:s(e.creator_id)?globalThis.String(e.creator_id):"0",channel_label:s(e.channel_label)?globalThis.String(e.channel_label):"",channel_private:s(e.channel_private)?globalThis.Number(e.channel_private):0,avatars:globalThis.Array.isArray(e==null?void 0:e.avatars)?e.avatars.map(n=>globalThis.String(n)):[],user_ids:globalThis.Array.isArray(e==null?void 0:e.user_ids)?e.user_ids.map(n=>globalThis.String(n)):[],last_sent_message:s(e.last_sent_message)?S.fromJSON(e.last_sent_message):void 0,last_seen_message:s(e.last_seen_message)?S.fromJSON(e.last_seen_message):void 0,onlines:globalThis.Array.isArray(e==null?void 0:e.onlines)?e.onlines.map(n=>globalThis.Boolean(n)):[],meeting_code:s(e.meeting_code)?globalThis.String(e.meeting_code):"",count_mess_unread:s(e.count_mess_unread)?globalThis.Number(e.count_mess_unread):0,active:s(e.active)?globalThis.Number(e.active):0,last_pin_message:s(e.last_pin_message)?globalThis.String(e.last_pin_message):"",usernames:globalThis.Array.isArray(e==null?void 0:e.usernames)?e.usernames.map(n=>globalThis.String(n)):[],creator_name:s(e.creator_name)?globalThis.String(e.creator_name):"",create_time_seconds:s(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,update_time_seconds:s(e.update_time_seconds)?globalThis.Number(e.update_time_seconds):0,display_names:globalThis.Array.isArray(e==null?void 0:e.display_names)?e.display_names.map(n=>globalThis.String(n)):[],channel_avatar:s(e.channel_avatar)?globalThis.String(e.channel_avatar):"",clan_name:s(e.clan_name)?globalThis.String(e.clan_name):"",app_id:s(e.app_id)?globalThis.String(e.app_id):"0",is_mute:s(e.is_mute)?globalThis.Boolean(e.is_mute):!1,age_restricted:s(e.age_restricted)?globalThis.Number(e.age_restricted):0,topic:s(e.topic)?globalThis.String(e.topic):"",e2ee:s(e.e2ee)?globalThis.Number(e.e2ee):0,member_count:s(e.member_count)?globalThis.Number(e.member_count):0}},toJSON(e){var t,r,a,i,o;let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.parent_id!=="0"&&(n.parent_id=e.parent_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.category_id!=="0"&&(n.category_id=e.category_id),e.category_name!==""&&(n.category_name=e.category_name),e.type!==0&&(n.type=Math.round(e.type)),e.creator_id!=="0"&&(n.creator_id=e.creator_id),e.channel_label!==""&&(n.channel_label=e.channel_label),e.channel_private!==0&&(n.channel_private=Math.round(e.channel_private)),(t=e.avatars)!=null&&t.length&&(n.avatars=e.avatars),(r=e.user_ids)!=null&&r.length&&(n.user_ids=e.user_ids),e.last_sent_message!==void 0&&(n.last_sent_message=S.toJSON(e.last_sent_message)),e.last_seen_message!==void 0&&(n.last_seen_message=S.toJSON(e.last_seen_message)),(a=e.onlines)!=null&&a.length&&(n.onlines=e.onlines),e.meeting_code!==""&&(n.meeting_code=e.meeting_code),e.count_mess_unread!==0&&(n.count_mess_unread=Math.round(e.count_mess_unread)),e.active!==0&&(n.active=Math.round(e.active)),e.last_pin_message!==""&&(n.last_pin_message=e.last_pin_message),(i=e.usernames)!=null&&i.length&&(n.usernames=e.usernames),e.creator_name!==""&&(n.creator_name=e.creator_name),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.update_time_seconds!==0&&(n.update_time_seconds=Math.round(e.update_time_seconds)),(o=e.display_names)!=null&&o.length&&(n.display_names=e.display_names),e.channel_avatar!==""&&(n.channel_avatar=e.channel_avatar),e.clan_name!==""&&(n.clan_name=e.clan_name),e.app_id!=="0"&&(n.app_id=e.app_id),e.is_mute!==!1&&(n.is_mute=e.is_mute),e.age_restricted!==0&&(n.age_restricted=Math.round(e.age_restricted)),e.topic!==""&&(n.topic=e.topic),e.e2ee!==0&&(n.e2ee=Math.round(e.e2ee)),e.member_count!==0&&(n.member_count=Math.round(e.member_count)),n},create(e){return Oe.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p,y,M,I,N,C,Z,$,Q,j,ee,ne,te,ie,ae,re,we,qe,Ve,ze;let n=je();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.parent_id=(r=e.parent_id)!=null?r:"0",n.channel_id=(a=e.channel_id)!=null?a:"0",n.category_id=(i=e.category_id)!=null?i:"0",n.category_name=(o=e.category_name)!=null?o:"",n.type=(l=e.type)!=null?l:0,n.creator_id=(c=e.creator_id)!=null?c:"0",n.channel_label=(d=e.channel_label)!=null?d:"",n.channel_private=(_=e.channel_private)!=null?_:0,n.avatars=((p=e.avatars)==null?void 0:p.map(E=>E))||[],n.user_ids=((y=e.user_ids)==null?void 0:y.map(E=>E))||[],n.last_sent_message=e.last_sent_message!==void 0&&e.last_sent_message!==null?S.fromPartial(e.last_sent_message):void 0,n.last_seen_message=e.last_seen_message!==void 0&&e.last_seen_message!==null?S.fromPartial(e.last_seen_message):void 0,n.onlines=((M=e.onlines)==null?void 0:M.map(E=>E))||[],n.meeting_code=(I=e.meeting_code)!=null?I:"",n.count_mess_unread=(N=e.count_mess_unread)!=null?N:0,n.active=(C=e.active)!=null?C:0,n.last_pin_message=(Z=e.last_pin_message)!=null?Z:"",n.usernames=(($=e.usernames)==null?void 0:$.map(E=>E))||[],n.creator_name=(Q=e.creator_name)!=null?Q:"",n.create_time_seconds=(j=e.create_time_seconds)!=null?j:0,n.update_time_seconds=(ee=e.update_time_seconds)!=null?ee:0,n.display_names=((ne=e.display_names)==null?void 0:ne.map(E=>E))||[],n.channel_avatar=(te=e.channel_avatar)!=null?te:"",n.clan_name=(ie=e.clan_name)!=null?ie:"",n.app_id=(ae=e.app_id)!=null?ae:"0",n.is_mute=(re=e.is_mute)!=null?re:!1,n.age_restricted=(we=e.age_restricted)!=null?we:0,n.topic=(qe=e.topic)!=null?qe:"",n.e2ee=(Ve=e.e2ee)!=null?Ve:0,n.member_count=(ze=e.member_count)!=null?ze:0,n}};function m(e){return e.toString()}f.default.util.Long!==Ie.default&&(f.default.util.Long=Ie.default,f.default.configure());function Dn(e){return typeof e=="object"&&e!==null}function s(e){return e!=null}function en(){return{clan_id:"0",channel_id:"0",message_id:"0",code:0,sender_id:"0",username:"",avatar:"",content:"",channel_label:"",clan_logo:"",category_name:"",display_name:"",clan_nick:"",clan_avatar:"",reactions:new Uint8Array(0),mentions:new Uint8Array(0),attachments:new Uint8Array(0),references:new Uint8Array(0),referenced_message:new Uint8Array(0),create_time_seconds:0,update_time_seconds:0,mode:0,hide_editted:!1,is_public:!1,topic_id:"0"}}var W={encode(e,n=f.default.Writer.create()){return e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.message_id!=="0"&&n.uint32(24).int64(e.message_id),e.code!==0&&n.uint32(32).int32(e.code),e.sender_id!=="0"&&n.uint32(40).int64(e.sender_id),e.username!==""&&n.uint32(50).string(e.username),e.avatar!==""&&n.uint32(58).string(e.avatar),e.content!==""&&n.uint32(66).string(e.content),e.channel_label!==""&&n.uint32(74).string(e.channel_label),e.clan_logo!==""&&n.uint32(82).string(e.clan_logo),e.category_name!==""&&n.uint32(90).string(e.category_name),e.display_name!==""&&n.uint32(98).string(e.display_name),e.clan_nick!==""&&n.uint32(106).string(e.clan_nick),e.clan_avatar!==""&&n.uint32(114).string(e.clan_avatar),e.reactions.length!==0&&n.uint32(122).bytes(e.reactions),e.mentions.length!==0&&n.uint32(130).bytes(e.mentions),e.attachments.length!==0&&n.uint32(138).bytes(e.attachments),e.references.length!==0&&n.uint32(146).bytes(e.references),e.referenced_message.length!==0&&n.uint32(154).bytes(e.referenced_message),e.create_time_seconds!==0&&n.uint32(160).uint32(e.create_time_seconds),e.update_time_seconds!==0&&n.uint32(168).uint32(e.update_time_seconds),e.mode!==0&&n.uint32(176).int32(e.mode),e.hide_editted!==!1&&n.uint32(184).bool(e.hide_editted),e.is_public!==!1&&n.uint32(192).bool(e.is_public),e.topic_id!=="0"&&n.uint32(200).int64(e.topic_id),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=en();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=m(t.int64());continue;case 2:if(i!==16)break;a.channel_id=m(t.int64());continue;case 3:if(i!==24)break;a.message_id=m(t.int64());continue;case 4:if(i!==32)break;a.code=t.int32();continue;case 5:if(i!==40)break;a.sender_id=m(t.int64());continue;case 6:if(i!==50)break;a.username=t.string();continue;case 7:if(i!==58)break;a.avatar=t.string();continue;case 8:if(i!==66)break;a.content=t.string();continue;case 9:if(i!==74)break;a.channel_label=t.string();continue;case 10:if(i!==82)break;a.clan_logo=t.string();continue;case 11:if(i!==90)break;a.category_name=t.string();continue;case 12:if(i!==98)break;a.display_name=t.string();continue;case 13:if(i!==106)break;a.clan_nick=t.string();continue;case 14:if(i!==114)break;a.clan_avatar=t.string();continue;case 15:if(i!==122)break;a.reactions=t.bytes();continue;case 16:if(i!==130)break;a.mentions=t.bytes();continue;case 17:if(i!==138)break;a.attachments=t.bytes();continue;case 18:if(i!==146)break;a.references=t.bytes();continue;case 19:if(i!==154)break;a.referenced_message=t.bytes();continue;case 20:if(i!==160)break;a.create_time_seconds=t.uint32();continue;case 21:if(i!==168)break;a.update_time_seconds=t.uint32();continue;case 22:if(i!==176)break;a.mode=t.int32();continue;case 23:if(i!==184)break;a.hide_editted=t.bool();continue;case 24:if(i!==192)break;a.is_public=t.bool();continue;case 25:if(i!==200)break;a.topic_id=m(t.int64());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:s(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:s(e.channel_id)?globalThis.String(e.channel_id):"0",message_id:s(e.message_id)?globalThis.String(e.message_id):"0",code:s(e.code)?globalThis.Number(e.code):0,sender_id:s(e.sender_id)?globalThis.String(e.sender_id):"0",username:s(e.username)?globalThis.String(e.username):"",avatar:s(e.avatar)?globalThis.String(e.avatar):"",content:s(e.content)?globalThis.String(e.content):"",channel_label:s(e.channel_label)?globalThis.String(e.channel_label):"",clan_logo:s(e.clan_logo)?globalThis.String(e.clan_logo):"",category_name:s(e.category_name)?globalThis.String(e.category_name):"",display_name:s(e.display_name)?globalThis.String(e.display_name):"",clan_nick:s(e.clan_nick)?globalThis.String(e.clan_nick):"",clan_avatar:s(e.clan_avatar)?globalThis.String(e.clan_avatar):"",reactions:s(e.reactions)?le(e.reactions):new Uint8Array(0),mentions:s(e.mentions)?le(e.mentions):new Uint8Array(0),attachments:s(e.attachments)?le(e.attachments):new Uint8Array(0),references:s(e.references)?le(e.references):new Uint8Array(0),referenced_message:s(e.referenced_message)?le(e.referenced_message):new Uint8Array(0),create_time_seconds:s(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,update_time_seconds:s(e.update_time_seconds)?globalThis.Number(e.update_time_seconds):0,mode:s(e.mode)?globalThis.Number(e.mode):0,hide_editted:s(e.hide_editted)?globalThis.Boolean(e.hide_editted):!1,is_public:s(e.is_public)?globalThis.Boolean(e.is_public):!1,topic_id:s(e.topic_id)?globalThis.String(e.topic_id):"0"}},toJSON(e){let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.message_id!=="0"&&(n.message_id=e.message_id),e.code!==0&&(n.code=Math.round(e.code)),e.sender_id!=="0"&&(n.sender_id=e.sender_id),e.username!==""&&(n.username=e.username),e.avatar!==""&&(n.avatar=e.avatar),e.content!==""&&(n.content=e.content),e.channel_label!==""&&(n.channel_label=e.channel_label),e.clan_logo!==""&&(n.clan_logo=e.clan_logo),e.category_name!==""&&(n.category_name=e.category_name),e.display_name!==""&&(n.display_name=e.display_name),e.clan_nick!==""&&(n.clan_nick=e.clan_nick),e.clan_avatar!==""&&(n.clan_avatar=e.clan_avatar),e.reactions.length!==0&&(n.reactions=ce(e.reactions)),e.mentions.length!==0&&(n.mentions=ce(e.mentions)),e.attachments.length!==0&&(n.attachments=ce(e.attachments)),e.references.length!==0&&(n.references=ce(e.references)),e.referenced_message.length!==0&&(n.referenced_message=ce(e.referenced_message)),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.update_time_seconds!==0&&(n.update_time_seconds=Math.round(e.update_time_seconds)),e.mode!==0&&(n.mode=Math.round(e.mode)),e.hide_editted!==!1&&(n.hide_editted=e.hide_editted),e.is_public!==!1&&(n.is_public=e.is_public),e.topic_id!=="0"&&(n.topic_id=e.topic_id),n},create(e){return W.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p,y,M,I,N,C,Z,$,Q,j,ee,ne,te,ie,ae,re;let n=en();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.message_id=(a=e.message_id)!=null?a:"0",n.code=(i=e.code)!=null?i:0,n.sender_id=(o=e.sender_id)!=null?o:"0",n.username=(l=e.username)!=null?l:"",n.avatar=(c=e.avatar)!=null?c:"",n.content=(d=e.content)!=null?d:"",n.channel_label=(_=e.channel_label)!=null?_:"",n.clan_logo=(p=e.clan_logo)!=null?p:"",n.category_name=(y=e.category_name)!=null?y:"",n.display_name=(M=e.display_name)!=null?M:"",n.clan_nick=(I=e.clan_nick)!=null?I:"",n.clan_avatar=(N=e.clan_avatar)!=null?N:"",n.reactions=(C=e.reactions)!=null?C:new Uint8Array(0),n.mentions=(Z=e.mentions)!=null?Z:new Uint8Array(0),n.attachments=($=e.attachments)!=null?$:new Uint8Array(0),n.references=(Q=e.references)!=null?Q:new Uint8Array(0),n.referenced_message=(j=e.referenced_message)!=null?j:new Uint8Array(0),n.create_time_seconds=(ee=e.create_time_seconds)!=null?ee:0,n.update_time_seconds=(ne=e.update_time_seconds)!=null?ne:0,n.mode=(te=e.mode)!=null?te:0,n.hide_editted=(ie=e.hide_editted)!=null?ie:!1,n.is_public=(ae=e.is_public)!=null?ae:!1,n.topic_id=(re=e.topic_id)!=null?re:"0",n}};function nn(){return{id:"0",timestamp_seconds:0,sender_id:"0",content:""}}var S={encode(e,n=f.default.Writer.create()){return e.id!=="0"&&n.uint32(8).int64(e.id),e.timestamp_seconds!==0&&n.uint32(16).uint32(e.timestamp_seconds),e.sender_id!=="0"&&n.uint32(24).int64(e.sender_id),e.content!==""&&n.uint32(34).string(e.content),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=nn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.id=m(t.int64());continue;case 2:if(i!==16)break;a.timestamp_seconds=t.uint32();continue;case 3:if(i!==24)break;a.sender_id=m(t.int64());continue;case 4:if(i!==34)break;a.content=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{id:s(e.id)?globalThis.String(e.id):"0",timestamp_seconds:s(e.timestamp_seconds)?globalThis.Number(e.timestamp_seconds):0,sender_id:s(e.sender_id)?globalThis.String(e.sender_id):"0",content:s(e.content)?globalThis.String(e.content):""}},toJSON(e){let n={};return e.id!=="0"&&(n.id=e.id),e.timestamp_seconds!==0&&(n.timestamp_seconds=Math.round(e.timestamp_seconds)),e.sender_id!=="0"&&(n.sender_id=e.sender_id),e.content!==""&&(n.content=e.content),n},create(e){return S.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i;let n=nn();return n.id=(t=e.id)!=null?t:"0",n.timestamp_seconds=(r=e.timestamp_seconds)!=null?r:0,n.sender_id=(a=e.sender_id)!=null?a:"0",n.content=(i=e.content)!=null?i:"",n}};function tn(){return{id:"0",user_id:"0",username:"",role_id:"0",rolename:"",create_time_seconds:0,s:0,e:0}}var B={encode(e,n=f.default.Writer.create()){return e.id!=="0"&&n.uint32(8).int64(e.id),e.user_id!=="0"&&n.uint32(16).int64(e.user_id),e.username!==""&&n.uint32(26).string(e.username),e.role_id!=="0"&&n.uint32(32).int64(e.role_id),e.rolename!==""&&n.uint32(42).string(e.rolename),e.create_time_seconds!==0&&n.uint32(48).uint32(e.create_time_seconds),e.s!==0&&n.uint32(56).int32(e.s),e.e!==0&&n.uint32(64).int32(e.e),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=tn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.id=m(t.int64());continue;case 2:if(i!==16)break;a.user_id=m(t.int64());continue;case 3:if(i!==26)break;a.username=t.string();continue;case 4:if(i!==32)break;a.role_id=m(t.int64());continue;case 5:if(i!==42)break;a.rolename=t.string();continue;case 6:if(i!==48)break;a.create_time_seconds=t.uint32();continue;case 7:if(i!==56)break;a.s=t.int32();continue;case 8:if(i!==64)break;a.e=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{id:s(e.id)?globalThis.String(e.id):"0",user_id:s(e.user_id)?globalThis.String(e.user_id):"0",username:s(e.username)?globalThis.String(e.username):"",role_id:s(e.role_id)?globalThis.String(e.role_id):"0",rolename:s(e.rolename)?globalThis.String(e.rolename):"",create_time_seconds:s(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,s:s(e.s)?globalThis.Number(e.s):0,e:s(e.e)?globalThis.Number(e.e):0}},toJSON(e){let n={};return e.id!=="0"&&(n.id=e.id),e.user_id!=="0"&&(n.user_id=e.user_id),e.username!==""&&(n.username=e.username),e.role_id!=="0"&&(n.role_id=e.role_id),e.rolename!==""&&(n.rolename=e.rolename),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.s!==0&&(n.s=Math.round(e.s)),e.e!==0&&(n.e=Math.round(e.e)),n},create(e){return B.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d;let n=tn();return n.id=(t=e.id)!=null?t:"0",n.user_id=(r=e.user_id)!=null?r:"0",n.username=(a=e.username)!=null?a:"",n.role_id=(i=e.role_id)!=null?i:"0",n.rolename=(o=e.rolename)!=null?o:"",n.create_time_seconds=(l=e.create_time_seconds)!=null?l:0,n.s=(c=e.s)!=null?c:0,n.e=(d=e.e)!=null?d:0,n}};function an(){return{filename:"",size:0,url:"",filetype:"",width:0,height:0,thumbnail:"",duration:0}}var v={encode(e,n=f.default.Writer.create()){return e.filename!==""&&n.uint32(10).string(e.filename),e.size!==0&&n.uint32(16).int32(e.size),e.url!==""&&n.uint32(26).string(e.url),e.filetype!==""&&n.uint32(34).string(e.filetype),e.width!==0&&n.uint32(40).int32(e.width),e.height!==0&&n.uint32(48).int32(e.height),e.thumbnail!==""&&n.uint32(58).string(e.thumbnail),e.duration!==0&&n.uint32(64).int32(e.duration),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=an();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.filename=t.string();continue;case 2:if(i!==16)break;a.size=t.int32();continue;case 3:if(i!==26)break;a.url=t.string();continue;case 4:if(i!==34)break;a.filetype=t.string();continue;case 5:if(i!==40)break;a.width=t.int32();continue;case 6:if(i!==48)break;a.height=t.int32();continue;case 7:if(i!==58)break;a.thumbnail=t.string();continue;case 8:if(i!==64)break;a.duration=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{filename:s(e.filename)?globalThis.String(e.filename):"",size:s(e.size)?globalThis.Number(e.size):0,url:s(e.url)?globalThis.String(e.url):"",filetype:s(e.filetype)?globalThis.String(e.filetype):"",width:s(e.width)?globalThis.Number(e.width):0,height:s(e.height)?globalThis.Number(e.height):0,thumbnail:s(e.thumbnail)?globalThis.String(e.thumbnail):"",duration:s(e.duration)?globalThis.Number(e.duration):0}},toJSON(e){let n={};return e.filename!==""&&(n.filename=e.filename),e.size!==0&&(n.size=Math.round(e.size)),e.url!==""&&(n.url=e.url),e.filetype!==""&&(n.filetype=e.filetype),e.width!==0&&(n.width=Math.round(e.width)),e.height!==0&&(n.height=Math.round(e.height)),e.thumbnail!==""&&(n.thumbnail=e.thumbnail),e.duration!==0&&(n.duration=Math.round(e.duration)),n},create(e){return v.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d;let n=an();return n.filename=(t=e.filename)!=null?t:"",n.size=(r=e.size)!=null?r:0,n.url=(a=e.url)!=null?a:"",n.filetype=(i=e.filetype)!=null?i:"",n.width=(o=e.width)!=null?o:0,n.height=(l=e.height)!=null?l:0,n.thumbnail=(c=e.thumbnail)!=null?c:"",n.duration=(d=e.duration)!=null?d:0,n}};function rn(){return{message_id:"0",message_ref_id:"0",content:"",has_attachment:!1,ref_type:0,message_sender_id:"0",message_sender_username:"",mesages_sender_avatar:"",message_sender_clan_nick:"",message_sender_display_name:""}}var H={encode(e,n=f.default.Writer.create()){return e.message_id!=="0"&&n.uint32(8).int64(e.message_id),e.message_ref_id!=="0"&&n.uint32(16).int64(e.message_ref_id),e.content!==""&&n.uint32(26).string(e.content),e.has_attachment!==!1&&n.uint32(32).bool(e.has_attachment),e.ref_type!==0&&n.uint32(40).int32(e.ref_type),e.message_sender_id!=="0"&&n.uint32(48).int64(e.message_sender_id),e.message_sender_username!==""&&n.uint32(58).string(e.message_sender_username),e.mesages_sender_avatar!==""&&n.uint32(66).string(e.mesages_sender_avatar),e.message_sender_clan_nick!==""&&n.uint32(74).string(e.message_sender_clan_nick),e.message_sender_display_name!==""&&n.uint32(82).string(e.message_sender_display_name),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=rn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.message_id=m(t.int64());continue;case 2:if(i!==16)break;a.message_ref_id=m(t.int64());continue;case 3:if(i!==26)break;a.content=t.string();continue;case 4:if(i!==32)break;a.has_attachment=t.bool();continue;case 5:if(i!==40)break;a.ref_type=t.int32();continue;case 6:if(i!==48)break;a.message_sender_id=m(t.int64());continue;case 7:if(i!==58)break;a.message_sender_username=t.string();continue;case 8:if(i!==66)break;a.mesages_sender_avatar=t.string();continue;case 9:if(i!==74)break;a.message_sender_clan_nick=t.string();continue;case 10:if(i!==82)break;a.message_sender_display_name=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{message_id:s(e.message_id)?globalThis.String(e.message_id):"0",message_ref_id:s(e.message_ref_id)?globalThis.String(e.message_ref_id):"0",content:s(e.content)?globalThis.String(e.content):"",has_attachment:s(e.has_attachment)?globalThis.Boolean(e.has_attachment):!1,ref_type:s(e.ref_type)?globalThis.Number(e.ref_type):0,message_sender_id:s(e.message_sender_id)?globalThis.String(e.message_sender_id):"0",message_sender_username:s(e.message_sender_username)?globalThis.String(e.message_sender_username):"",mesages_sender_avatar:s(e.mesages_sender_avatar)?globalThis.String(e.mesages_sender_avatar):"",message_sender_clan_nick:s(e.message_sender_clan_nick)?globalThis.String(e.message_sender_clan_nick):"",message_sender_display_name:s(e.message_sender_display_name)?globalThis.String(e.message_sender_display_name):""}},toJSON(e){let n={};return e.message_id!=="0"&&(n.message_id=e.message_id),e.message_ref_id!=="0"&&(n.message_ref_id=e.message_ref_id),e.content!==""&&(n.content=e.content),e.has_attachment!==!1&&(n.has_attachment=e.has_attachment),e.ref_type!==0&&(n.ref_type=Math.round(e.ref_type)),e.message_sender_id!=="0"&&(n.message_sender_id=e.message_sender_id),e.message_sender_username!==""&&(n.message_sender_username=e.message_sender_username),e.mesages_sender_avatar!==""&&(n.mesages_sender_avatar=e.mesages_sender_avatar),e.message_sender_clan_nick!==""&&(n.message_sender_clan_nick=e.message_sender_clan_nick),e.message_sender_display_name!==""&&(n.message_sender_display_name=e.message_sender_display_name),n},create(e){return H.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p;let n=rn();return n.message_id=(t=e.message_id)!=null?t:"0",n.message_ref_id=(r=e.message_ref_id)!=null?r:"0",n.content=(a=e.content)!=null?a:"",n.has_attachment=(i=e.has_attachment)!=null?i:!1,n.ref_type=(o=e.ref_type)!=null?o:0,n.message_sender_id=(l=e.message_sender_id)!=null?l:"0",n.message_sender_username=(c=e.message_sender_username)!=null?c:"",n.mesages_sender_avatar=(d=e.mesages_sender_avatar)!=null?d:"",n.message_sender_clan_nick=(_=e.message_sender_clan_nick)!=null?_:"",n.message_sender_display_name=(p=e.message_sender_display_name)!=null?p:"",n}};function sn(){return{attachments:[]}}var De={encode(e,n=f.default.Writer.create()){for(let t of e.attachments)v.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=sn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.attachments.push(v.decode(t,t.uint32()));continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{attachments:globalThis.Array.isArray(e==null?void 0:e.attachments)?e.attachments.map(n=>v.fromJSON(n)):[]}},toJSON(e){var t;let n={};return(t=e.attachments)!=null&&t.length&&(n.attachments=e.attachments.map(r=>v.toJSON(r))),n},create(e){return De.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=sn();return n.attachments=((t=e.attachments)==null?void 0:t.map(r=>v.fromPartial(r)))||[],n}};function le(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{let n=globalThis.atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;++r)t[r]=n.charCodeAt(r);return t}}function ce(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{let n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function on(){return{filename:"",filetype:"",size:0,width:0,height:0}}var Te={encode(e,n=f.default.Writer.create()){return e.filename!==""&&n.uint32(10).string(e.filename),e.filetype!==""&&n.uint32(18).string(e.filetype),e.size!==0&&n.uint32(24).int32(e.size),e.width!==0&&n.uint32(32).int32(e.width),e.height!==0&&n.uint32(40).int32(e.height),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=on();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.filename=t.string();continue;case 2:if(i!==18)break;a.filetype=t.string();continue;case 3:if(i!==24)break;a.size=t.int32();continue;case 4:if(i!==32)break;a.width=t.int32();continue;case 5:if(i!==40)break;a.height=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{filename:s(e.filename)?globalThis.String(e.filename):"",filetype:s(e.filetype)?globalThis.String(e.filetype):"",size:s(e.size)?globalThis.Number(e.size):0,width:s(e.width)?globalThis.Number(e.width):0,height:s(e.height)?globalThis.Number(e.height):0}},toJSON(e){let n={};return e.filename!==""&&(n.filename=e.filename),e.filetype!==""&&(n.filetype=e.filetype),e.size!==0&&(n.size=Math.round(e.size)),e.width!==0&&(n.width=Math.round(e.width)),e.height!==0&&(n.height=Math.round(e.height)),n},create(e){return Te.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o;let n=on();return n.filename=(t=e.filename)!=null?t:"",n.filetype=(r=e.filetype)!=null?r:"",n.size=(a=e.size)!=null?a:0,n.width=(i=e.width)!=null?i:0,n.height=(o=e.height)!=null?o:0,n}};function ln(){return{filename:"",url:""}}var Ue={encode(e,n=f.default.Writer.create()){return e.filename!==""&&n.uint32(10).string(e.filename),e.url!==""&&n.uint32(18).string(e.url),n},decode(e,n){let t=e instanceof f.default.Reader?e:f.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=ln();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.filename=t.string();continue;case 2:if(i!==18)break;a.url=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{filename:s(e.filename)?globalThis.String(e.filename):"",url:s(e.url)?globalThis.String(e.url):""}},toJSON(e){let n={};return e.filename!==""&&(n.filename=e.filename),e.url!==""&&(n.url=e.url),n},create(e){return Ue.fromPartial(e!=null?e:{})},fromPartial(e){var t,r;let n=ln();return n.filename=(t=e.filename)!=null?t:"",n.url=(r=e.url)!=null?r:"",n}};function de(e,n,t){let r=xe({method:e},n);if(r.headers=xe({},n.headers),typeof XMLHttpRequest!="undefined"){let a=Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype,"withCredentials");a!=null&&a.set||(r.credentials="cocos-ignore")}return Object.keys(r.headers).includes("Accept")||(r.headers.Accept="application/proto"),Object.keys(r.headers).includes("Content-Type")||(r.headers["Content-Type"]="application/proto"),Object.keys(r.headers).forEach(a=>{r.headers[a]||delete r.headers[a]}),t&&(r.body=t),r}function Ce(e){if(e==null)return{t:e};let n;if(e instanceof Uint8Array)n=new TextDecoder().decode(e);else if(typeof e=="string")n=e;else return typeof e=="object"?e:{t:e};if(!n||n===""||n==="[]")return{t:n};try{return JSON.parse(n)}catch(t){try{let r=n.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(r)}catch(r){return console.error("JSON Parse failed completely:",{original:n,error:r}),{t:n}}}}var Un=e=>!e||e===null||e===void 0||e===""||e==="[]";function dn(e){if(Un(e))return;let n=e[0];if(n===91||n===123)return Ce(e);try{let r=e,a=new Uint8Array(r);return De.decode(a)}catch(r){return Ce(e)}}var Le=require("js-base64");var _e=class{constructor(n,t,r){this.serverKey=n;this.timeoutMs=t;this.basePath=r}setBasePath(n){this.basePath=n}authenticateIdToken(n,t,r,a={}){if(r==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/v2/account/authenticate/idtoken",o=new Map,l="";l=JSON.stringify(r||{});let c=this.buildFullUrl(this.basePath,i,o),d=de("POST",a,l);return n&&(d.headers.Authorization="Basic "+(0,Le.encode)(n+":"+t)),Promise.race([fetch(c,d).then(_=>{if(_.status==204)return _;if(_.status>=200&&_.status<300)return _.json();throw _}),new Promise((_,p)=>setTimeout(p,this.timeoutMs,"Request timed out."))])}sessionRefresh(n,t,r,a={}){if(r==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SessionRefresh",o=new Map,c=Se.encode(Se.fromPartial(r)).finish(),d=this.buildFullUrl(this.basePath,i,o),_=de("POST",a,"");return _.body=c,n&&(_.headers.Authorization="Basic "+(0,Le.encode)(n+":"+t)),Promise.race([fetch(d,_).then(p=>g(this,null,function*(){if(p.status==204)return{};if(p.status>=200&&p.status<300){let y=yield p.arrayBuffer();return Re.decode(new Uint8Array(y))}else throw p})),new Promise((p,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(n,t,r={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateChannelDesc",i=new Map,l=ve.encode(ve.fromPartial(t)).finish(),c=this.buildFullUrl(this.basePath,a,i),d=de("POST",r,"");return d.body=l,n&&(d.headers.Authorization="Bearer "+n),Promise.race([fetch(c,d).then(_=>g(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let p=yield _.arrayBuffer();return Oe.decode(new Uint8Array(p))}else throw _})),new Promise((_,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(n,t,r={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UploadAttachmentFile",i=new Map,l=Te.encode(Te.fromPartial(t)).finish(),c=this.buildFullUrl(this.basePath,a,i),d=de("POST",r,"");return d.body=l,n&&(d.headers.Authorization="Bearer "+n),Promise.race([fetch(c,d).then(_=>g(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let p=yield _.arrayBuffer();return Ue.decode(new Uint8Array(p))}else throw _})),new Promise((_,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}buildFullUrl(n,t,r){let a=n+t+"?";for(let[i,o]of r)o instanceof Array?a+=o.reduce((l,c)=>l+encodeURIComponent(i)+"="+encodeURIComponent(c)+"&",""):o!=null&&(a+=encodeURIComponent(i)+"="+encodeURIComponent(o)+"&");return a}};var We=D(require("long")),h=D(require("protobufjs/minimal"));var Je=D(require("long")),P=D(require("protobufjs/minimal"));function _n(){return{value:!1}}var be={encode(e,n=P.default.Writer.create()){return e.value!==!1&&n.uint32(8).bool(e.value),n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=_n();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.value=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{value:fn(e.value)?globalThis.Boolean(e.value):!1}},toJSON(e){let n={};return e.value!==!1&&(n.value=e.value),n},create(e){return be.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=_n();return n.value=(t=e.value)!=null?t:!1,n}};function un(){return{value:""}}var Pe={encode(e,n=P.default.Writer.create()){return e.value!==""&&n.uint32(10).string(e.value),n},decode(e,n){let t=e instanceof P.default.Reader?e:P.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=un();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.value=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{value:fn(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.value!==""&&(n.value=e.value),n},create(e){return Pe.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=un();return n.value=(t=e.value)!=null?t:"",n}};P.default.util.Long!==Je.default&&(P.default.util.Long=Je.default,P.default.configure());function fn(e){return e!=null}function hn(){return{cid:"",channel:void 0,channel_join:void 0,channel_leave:void 0,channel_message:void 0,channel_message_ack:void 0,channel_message_send:void 0,error:void 0,ping:void 0,pong:void 0}}var ue={encode(e,n=h.default.Writer.create()){return e.cid!==""&&n.uint32(10).string(e.cid),e.channel!==void 0&&w.encode(e.channel,n.uint32(18).fork()).ldelim(),e.channel_join!==void 0&&q.encode(e.channel_join,n.uint32(34).fork()).ldelim(),e.channel_leave!==void 0&&V.encode(e.channel_leave,n.uint32(42).fork()).ldelim(),e.channel_message!==void 0&&W.encode(e.channel_message,n.uint32(50).fork()).ldelim(),e.channel_message_ack!==void 0&&z.encode(e.channel_message_ack,n.uint32(58).fork()).ldelim(),e.channel_message_send!==void 0&&F.encode(e.channel_message_send,n.uint32(66).fork()).ldelim(),e.error!==void 0&&K.encode(e.error,n.uint32(98).fork()).ldelim(),e.ping!==void 0&&Y.encode(e.ping,n.uint32(178).fork()).ldelim(),e.pong!==void 0&&G.encode(e.pong,n.uint32(186).fork()).ldelim(),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=hn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.cid=t.string();continue;case 2:if(i!==18)break;a.channel=w.decode(t,t.uint32());continue;case 4:if(i!==34)break;a.channel_join=q.decode(t,t.uint32());continue;case 5:if(i!==42)break;a.channel_leave=V.decode(t,t.uint32());continue;case 6:if(i!==50)break;a.channel_message=W.decode(t,t.uint32());continue;case 7:if(i!==58)break;a.channel_message_ack=z.decode(t,t.uint32());continue;case 8:if(i!==66)break;a.channel_message_send=F.decode(t,t.uint32());continue;case 12:if(i!==98)break;a.error=K.decode(t,t.uint32());continue;case 22:if(i!==178)break;a.ping=Y.decode(t,t.uint32());continue;case 23:if(i!==186)break;a.pong=G.decode(t,t.uint32());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{cid:u(e.cid)?globalThis.String(e.cid):"",channel:u(e.channel)?w.fromJSON(e.channel):void 0,channel_join:u(e.channel_join)?q.fromJSON(e.channel_join):void 0,channel_leave:u(e.channel_leave)?V.fromJSON(e.channel_leave):void 0,channel_message:u(e.channel_message)?W.fromJSON(e.channel_message):void 0,channel_message_ack:u(e.channel_message_ack)?z.fromJSON(e.channel_message_ack):void 0,channel_message_send:u(e.channel_message_send)?F.fromJSON(e.channel_message_send):void 0,error:u(e.error)?K.fromJSON(e.error):void 0,ping:u(e.ping)?Y.fromJSON(e.ping):void 0,pong:u(e.pong)?G.fromJSON(e.pong):void 0}},toJSON(e){let n={};return e.cid!==""&&(n.cid=e.cid),e.channel!==void 0&&(n.channel=w.toJSON(e.channel)),e.channel_join!==void 0&&(n.channel_join=q.toJSON(e.channel_join)),e.channel_leave!==void 0&&(n.channel_leave=V.toJSON(e.channel_leave)),e.channel_message!==void 0&&(n.channel_message=W.toJSON(e.channel_message)),e.channel_message_ack!==void 0&&(n.channel_message_ack=z.toJSON(e.channel_message_ack)),e.channel_message_send!==void 0&&(n.channel_message_send=F.toJSON(e.channel_message_send)),e.error!==void 0&&(n.error=K.toJSON(e.error)),e.ping!==void 0&&(n.ping=Y.toJSON(e.ping)),e.pong!==void 0&&(n.pong=G.toJSON(e.pong)),n},create(e){return ue.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=hn();return n.cid=(t=e.cid)!=null?t:"",n.channel=e.channel!==void 0&&e.channel!==null?w.fromPartial(e.channel):void 0,n.channel_join=e.channel_join!==void 0&&e.channel_join!==null?q.fromPartial(e.channel_join):void 0,n.channel_leave=e.channel_leave!==void 0&&e.channel_leave!==null?V.fromPartial(e.channel_leave):void 0,n.channel_message=e.channel_message!==void 0&&e.channel_message!==null?W.fromPartial(e.channel_message):void 0,n.channel_message_ack=e.channel_message_ack!==void 0&&e.channel_message_ack!==null?z.fromPartial(e.channel_message_ack):void 0,n.channel_message_send=e.channel_message_send!==void 0&&e.channel_message_send!==null?F.fromPartial(e.channel_message_send):void 0,n.error=e.error!==void 0&&e.error!==null?K.fromPartial(e.error):void 0,n.ping=e.ping!==void 0&&e.ping!==null?Y.fromPartial(e.ping):void 0,n.pong=e.pong!==void 0&&e.pong!==null?G.fromPartial(e.pong):void 0,n}};function pn(){return{id:"0",presences:[],self:void 0,chanel_label:"",clan_logo:"",category_name:""}}var w={encode(e,n=h.default.Writer.create()){e.id!=="0"&&n.uint32(8).int64(e.id);for(let t of e.presences)b.encode(t,n.uint32(18).fork()).ldelim();return e.self!==void 0&&b.encode(e.self,n.uint32(26).fork()).ldelim(),e.chanel_label!==""&&n.uint32(34).string(e.chanel_label),e.clan_logo!==""&&n.uint32(42).string(e.clan_logo),e.category_name!==""&&n.uint32(50).string(e.category_name),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=pn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.id=T(t.int64());continue;case 2:if(i!==18)break;a.presences.push(b.decode(t,t.uint32()));continue;case 3:if(i!==26)break;a.self=b.decode(t,t.uint32());continue;case 4:if(i!==34)break;a.chanel_label=t.string();continue;case 5:if(i!==42)break;a.clan_logo=t.string();continue;case 6:if(i!==50)break;a.category_name=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{id:u(e.id)?globalThis.String(e.id):"0",presences:globalThis.Array.isArray(e==null?void 0:e.presences)?e.presences.map(n=>b.fromJSON(n)):[],self:u(e.self)?b.fromJSON(e.self):void 0,chanel_label:u(e.chanel_label)?globalThis.String(e.chanel_label):"",clan_logo:u(e.clan_logo)?globalThis.String(e.clan_logo):"",category_name:u(e.category_name)?globalThis.String(e.category_name):""}},toJSON(e){var t;let n={};return e.id!=="0"&&(n.id=e.id),(t=e.presences)!=null&&t.length&&(n.presences=e.presences.map(r=>b.toJSON(r))),e.self!==void 0&&(n.self=b.toJSON(e.self)),e.chanel_label!==""&&(n.chanel_label=e.chanel_label),e.clan_logo!==""&&(n.clan_logo=e.clan_logo),e.category_name!==""&&(n.category_name=e.category_name),n},create(e){return w.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o;let n=pn();return n.id=(t=e.id)!=null?t:"0",n.presences=((r=e.presences)==null?void 0:r.map(l=>b.fromPartial(l)))||[],n.self=e.self!==void 0&&e.self!==null?b.fromPartial(e.self):void 0,n.chanel_label=(a=e.chanel_label)!=null?a:"",n.clan_logo=(i=e.clan_logo)!=null?i:"",n.category_name=(o=e.category_name)!=null?o:"",n}};function mn(){return{clan_id:"0",channel_id:"0",channel_type:0,is_public:!1}}var q={encode(e,n=h.default.Writer.create()){return e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.channel_type!==0&&n.uint32(24).int32(e.channel_type),e.is_public!==!1&&n.uint32(32).bool(e.is_public),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=mn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=T(t.int64());continue;case 2:if(i!==16)break;a.channel_id=T(t.int64());continue;case 3:if(i!==24)break;a.channel_type=t.int32();continue;case 4:if(i!==32)break;a.is_public=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:u(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",channel_type:u(e.channel_type)?globalThis.Number(e.channel_type):0,is_public:u(e.is_public)?globalThis.Boolean(e.is_public):!1}},toJSON(e){let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.channel_type!==0&&(n.channel_type=Math.round(e.channel_type)),e.is_public!==!1&&(n.is_public=e.is_public),n},create(e){return q.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i;let n=mn();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.channel_type=(a=e.channel_type)!=null?a:0,n.is_public=(i=e.is_public)!=null?i:!1,n}};function gn(){return{clan_id:"0",channel_id:"0",channel_type:0,is_public:!1}}var V={encode(e,n=h.default.Writer.create()){return e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.channel_type!==0&&n.uint32(24).int32(e.channel_type),e.is_public!==!1&&n.uint32(32).bool(e.is_public),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=gn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=T(t.int64());continue;case 2:if(i!==16)break;a.channel_id=T(t.int64());continue;case 3:if(i!==24)break;a.channel_type=t.int32();continue;case 4:if(i!==32)break;a.is_public=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:u(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",channel_type:u(e.channel_type)?globalThis.Number(e.channel_type):0,is_public:u(e.is_public)?globalThis.Boolean(e.is_public):!1}},toJSON(e){let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.channel_type!==0&&(n.channel_type=Math.round(e.channel_type)),e.is_public!==!1&&(n.is_public=e.is_public),n},create(e){return V.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i;let n=gn();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.channel_type=(a=e.channel_type)!=null?a:0,n.is_public=(i=e.is_public)!=null?i:!1,n}};function yn(){return{channel_id:"0",message_id:"0",code:0,username:"",create_time_seconds:0,update_time_seconds:0,persistent:void 0,clan_logo:"",category_name:""}}var z={encode(e,n=h.default.Writer.create()){return e.channel_id!=="0"&&n.uint32(8).int64(e.channel_id),e.message_id!=="0"&&n.uint32(16).int64(e.message_id),e.code!==0&&n.uint32(24).int32(e.code),e.username!==""&&n.uint32(34).string(e.username),e.create_time_seconds!==0&&n.uint32(40).uint32(e.create_time_seconds),e.update_time_seconds!==0&&n.uint32(48).uint32(e.update_time_seconds),e.persistent!==void 0&&be.encode({value:e.persistent},n.uint32(58).fork()).ldelim(),e.clan_logo!==""&&n.uint32(66).string(e.clan_logo),e.category_name!==""&&n.uint32(74).string(e.category_name),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=yn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.channel_id=T(t.int64());continue;case 2:if(i!==16)break;a.message_id=T(t.int64());continue;case 3:if(i!==24)break;a.code=t.int32();continue;case 4:if(i!==34)break;a.username=t.string();continue;case 5:if(i!==40)break;a.create_time_seconds=t.uint32();continue;case 6:if(i!==48)break;a.update_time_seconds=t.uint32();continue;case 7:if(i!==58)break;a.persistent=be.decode(t,t.uint32()).value;continue;case 8:if(i!==66)break;a.clan_logo=t.string();continue;case 9:if(i!==74)break;a.category_name=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",message_id:u(e.message_id)?globalThis.String(e.message_id):"0",code:u(e.code)?globalThis.Number(e.code):0,username:u(e.username)?globalThis.String(e.username):"",create_time_seconds:u(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,update_time_seconds:u(e.update_time_seconds)?globalThis.Number(e.update_time_seconds):0,persistent:u(e.persistent)?!!e.persistent:void 0,clan_logo:u(e.clan_logo)?globalThis.String(e.clan_logo):"",category_name:u(e.category_name)?globalThis.String(e.category_name):""}},toJSON(e){let n={};return e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.message_id!=="0"&&(n.message_id=e.message_id),e.code!==0&&(n.code=Math.round(e.code)),e.username!==""&&(n.username=e.username),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.update_time_seconds!==0&&(n.update_time_seconds=Math.round(e.update_time_seconds)),e.persistent!==void 0&&(n.persistent=e.persistent),e.clan_logo!==""&&(n.clan_logo=e.clan_logo),e.category_name!==""&&(n.category_name=e.category_name),n},create(e){return z.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_;let n=yn();return n.channel_id=(t=e.channel_id)!=null?t:"0",n.message_id=(r=e.message_id)!=null?r:"0",n.code=(a=e.code)!=null?a:0,n.username=(i=e.username)!=null?i:"",n.create_time_seconds=(o=e.create_time_seconds)!=null?o:0,n.update_time_seconds=(l=e.update_time_seconds)!=null?l:0,n.persistent=(c=e.persistent)!=null?c:void 0,n.clan_logo=(d=e.clan_logo)!=null?d:"",n.category_name=(_=e.category_name)!=null?_:"",n}};function kn(){return{clan_id:"0",channel_id:"0",content:"",mentions:[],attachments:[],references:[],mode:0,anonymous_message:!1,mention_everyone:!1,avatar:"",is_public:!1,code:0,topic_id:"0",id:"0"}}var F={encode(e,n=h.default.Writer.create()){e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.content!==""&&n.uint32(26).string(e.content);for(let t of e.mentions)B.encode(t,n.uint32(34).fork()).ldelim();for(let t of e.attachments)v.encode(t,n.uint32(42).fork()).ldelim();for(let t of e.references)H.encode(t,n.uint32(50).fork()).ldelim();return e.mode!==0&&n.uint32(56).int32(e.mode),e.anonymous_message!==!1&&n.uint32(64).bool(e.anonymous_message),e.mention_everyone!==!1&&n.uint32(72).bool(e.mention_everyone),e.avatar!==""&&n.uint32(82).string(e.avatar),e.is_public!==!1&&n.uint32(88).bool(e.is_public),e.code!==0&&n.uint32(96).int32(e.code),e.topic_id!=="0"&&n.uint32(104).int64(e.topic_id),e.id!=="0"&&n.uint32(112).int64(e.id),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=kn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=T(t.int64());continue;case 2:if(i!==16)break;a.channel_id=T(t.int64());continue;case 3:if(i!==26)break;a.content=t.string();continue;case 4:if(i!==34)break;a.mentions.push(B.decode(t,t.uint32()));continue;case 5:if(i!==42)break;a.attachments.push(v.decode(t,t.uint32()));continue;case 6:if(i!==50)break;a.references.push(H.decode(t,t.uint32()));continue;case 7:if(i!==56)break;a.mode=t.int32();continue;case 8:if(i!==64)break;a.anonymous_message=t.bool();continue;case 9:if(i!==72)break;a.mention_everyone=t.bool();continue;case 10:if(i!==82)break;a.avatar=t.string();continue;case 11:if(i!==88)break;a.is_public=t.bool();continue;case 12:if(i!==96)break;a.code=t.int32();continue;case 13:if(i!==104)break;a.topic_id=T(t.int64());continue;case 14:if(i!==112)break;a.id=T(t.int64());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:u(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",content:u(e.content)?globalThis.String(e.content):"",mentions:globalThis.Array.isArray(e==null?void 0:e.mentions)?e.mentions.map(n=>B.fromJSON(n)):[],attachments:globalThis.Array.isArray(e==null?void 0:e.attachments)?e.attachments.map(n=>v.fromJSON(n)):[],references:globalThis.Array.isArray(e==null?void 0:e.references)?e.references.map(n=>H.fromJSON(n)):[],mode:u(e.mode)?globalThis.Number(e.mode):0,anonymous_message:u(e.anonymous_message)?globalThis.Boolean(e.anonymous_message):!1,mention_everyone:u(e.mention_everyone)?globalThis.Boolean(e.mention_everyone):!1,avatar:u(e.avatar)?globalThis.String(e.avatar):"",is_public:u(e.is_public)?globalThis.Boolean(e.is_public):!1,code:u(e.code)?globalThis.Number(e.code):0,topic_id:u(e.topic_id)?globalThis.String(e.topic_id):"0",id:u(e.id)?globalThis.String(e.id):"0"}},toJSON(e){var t,r,a;let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.content!==""&&(n.content=e.content),(t=e.mentions)!=null&&t.length&&(n.mentions=e.mentions.map(i=>B.toJSON(i))),(r=e.attachments)!=null&&r.length&&(n.attachments=e.attachments.map(i=>v.toJSON(i))),(a=e.references)!=null&&a.length&&(n.references=e.references.map(i=>H.toJSON(i))),e.mode!==0&&(n.mode=Math.round(e.mode)),e.anonymous_message!==!1&&(n.anonymous_message=e.anonymous_message),e.mention_everyone!==!1&&(n.mention_everyone=e.mention_everyone),e.avatar!==""&&(n.avatar=e.avatar),e.is_public!==!1&&(n.is_public=e.is_public),e.code!==0&&(n.code=Math.round(e.code)),e.topic_id!=="0"&&(n.topic_id=e.topic_id),e.id!=="0"&&(n.id=e.id),n},create(e){return F.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p,y,M,I,N;let n=kn();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.content=(a=e.content)!=null?a:"",n.mentions=((i=e.mentions)==null?void 0:i.map(C=>B.fromPartial(C)))||[],n.attachments=((o=e.attachments)==null?void 0:o.map(C=>v.fromPartial(C)))||[],n.references=((l=e.references)==null?void 0:l.map(C=>H.fromPartial(C)))||[],n.mode=(c=e.mode)!=null?c:0,n.anonymous_message=(d=e.anonymous_message)!=null?d:!1,n.mention_everyone=(_=e.mention_everyone)!=null?_:!1,n.avatar=(p=e.avatar)!=null?p:"",n.is_public=(y=e.is_public)!=null?y:!1,n.code=(M=e.code)!=null?M:0,n.topic_id=(I=e.topic_id)!=null?I:"0",n.id=(N=e.id)!=null?N:"0",n}};function Sn(){return{code:0,message:"",context:{}}}var K={encode(e,n=h.default.Writer.create()){return e.code!==0&&n.uint32(8).int32(e.code),e.message!==""&&n.uint32(18).string(e.message),Object.entries(e.context).forEach(([t,r])=>{Be.encode({key:t,value:r},n.uint32(26).fork()).ldelim()}),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Sn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.code=t.int32();continue;case 2:if(i!==18)break;a.message=t.string();continue;case 3:if(i!==26)break;let o=Be.decode(t,t.uint32());o.value!==void 0&&(a.context[o.key]=o.value);continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{code:u(e.code)?globalThis.Number(e.code):0,message:u(e.message)?globalThis.String(e.message):"",context:Ln(e.context)?Object.entries(e.context).reduce((n,[t,r])=>(n[t]=String(r),n),{}):{}}},toJSON(e){let n={};if(e.code!==0&&(n.code=Math.round(e.code)),e.message!==""&&(n.message=e.message),e.context){let t=Object.entries(e.context);t.length>0&&(n.context={},t.forEach(([r,a])=>{n.context[r]=a}))}return n},create(e){return K.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a;let n=Sn();return n.code=(t=e.code)!=null?t:0,n.message=(r=e.message)!=null?r:"",n.context=Object.entries((a=e.context)!=null?a:{}).reduce((i,[o,l])=>(l!==void 0&&(i[o]=globalThis.String(l)),i),{}),n}};function vn(){return{key:"",value:""}}var Be={encode(e,n=h.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=vn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.key=t.string();continue;case 2:if(i!==18)break;a.value=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{key:u(e.key)?globalThis.String(e.key):"",value:u(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Be.fromPartial(e!=null?e:{})},fromPartial(e){var t,r;let n=vn();return n.key=(t=e.key)!=null?t:"",n.value=(r=e.value)!=null?r:"",n}};function Tn(){return{}}var Y={encode(e,n=h.default.Writer.create()){return n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Tn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return Y.fromPartial(e!=null?e:{})},fromPartial(e){return Tn()}};function Cn(){return{}}var G={encode(e,n=h.default.Writer.create()){return n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Cn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return G.fromPartial(e!=null?e:{})},fromPartial(e){return Cn()}};function bn(){return{user_id:"0",session_id:"",username:"",status:void 0,is_mobile:!1,user_status:""}}var b={encode(e,n=h.default.Writer.create()){return e.user_id!=="0"&&n.uint32(8).int64(e.user_id),e.session_id!==""&&n.uint32(18).string(e.session_id),e.username!==""&&n.uint32(26).string(e.username),e.status!==void 0&&Pe.encode({value:e.status},n.uint32(34).fork()).ldelim(),e.is_mobile!==!1&&n.uint32(40).bool(e.is_mobile),e.user_status!==""&&n.uint32(50).string(e.user_status),n},decode(e,n){let t=e instanceof h.default.Reader?e:h.default.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=bn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.user_id=T(t.int64());continue;case 2:if(i!==18)break;a.session_id=t.string();continue;case 3:if(i!==26)break;a.username=t.string();continue;case 4:if(i!==34)break;a.status=Pe.decode(t,t.uint32()).value;continue;case 5:if(i!==40)break;a.is_mobile=t.bool();continue;case 6:if(i!==50)break;a.user_status=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{user_id:u(e.user_id)?globalThis.String(e.user_id):"0",session_id:u(e.session_id)?globalThis.String(e.session_id):"",username:u(e.username)?globalThis.String(e.username):"",status:u(e.status)?String(e.status):void 0,is_mobile:u(e.is_mobile)?globalThis.Boolean(e.is_mobile):!1,user_status:u(e.user_status)?globalThis.String(e.user_status):""}},toJSON(e){let n={};return e.user_id!=="0"&&(n.user_id=e.user_id),e.session_id!==""&&(n.session_id=e.session_id),e.username!==""&&(n.username=e.username),e.status!==void 0&&(n.status=e.status),e.is_mobile!==!1&&(n.is_mobile=e.is_mobile),e.user_status!==""&&(n.user_status=e.user_status),n},create(e){return b.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l;let n=bn();return n.user_id=(t=e.user_id)!=null?t:"0",n.session_id=(r=e.session_id)!=null?r:"",n.username=(a=e.username)!=null?a:"",n.status=(i=e.status)!=null?i:void 0,n.is_mobile=(o=e.is_mobile)!=null?o:!1,n.user_status=(l=e.user_status)!=null?l:"",n}};function T(e){return e.toString()}h.default.util.Long!==We.default&&(h.default.util.Long=We.default,h.default.configure());function Ln(e){return typeof e=="object"&&e!==null}function u(e){return e!=null}var R=class{constructor(){}get onClose(){return this._socket.onclose}set onClose(n){this._socket.onclose=n}get onError(){return this._socket.onerror}set onError(n){this._socket.onerror=n}get onMessage(){return this._socket.onmessage}set onMessage(n){n?this._socket.onmessage=t=>{let r=t.data,a=new Uint8Array(r),i=ue.decode(a);i.channel_message&&i.channel_message.code==null&&(i.channel_message.code=0),n(i)}:n=null}get onOpen(){return this._socket.onopen}set onOpen(n){this._socket.onopen=n}isOpen(){var n;return((n=this._socket)==null?void 0:n.readyState)==WebSocket.OPEN}close(){var n;(n=this._socket)==null||n.close(),this._socket=void 0}connect(n,t,r,a,i,o,l){l&&l.addEventListener("abort",()=>{this.close()});let c=r?`:${r}`:"",d=`${n}${t}${c}/ws?lang=en&status=${encodeURIComponent(a.toString())}&token=${encodeURIComponent(i)}&format=protobuf&platform=${encodeURIComponent(o)}`;this._socket=new WebSocket(d),this._socket.binaryType="arraybuffer"}send(n){let r=ue.encode(ue.fromPartial(n)).finish();this._socket.send(r)}};var Pn=!1,k={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},x=class x{constructor(n,t,r=!1,a=!1,i=new R,o=x.DefaultSendTimeoutMs){this.host=n;this.port=t;this.useSSL=r;this.verbose=a;this.adapter=i;this.sendTimeoutMs=o;this.cIds={},this.nextCid=1,this._heartbeatTimeoutMs=x.DefaultHeartbeatTimeoutMs,this._connectionState=k.DISCONNECTED}generatecid(){let n=this.nextCid.toString();return++this.nextCid,n}isOpen(){return this._connectionState===k.CONNECTED}connect(n,t=!1,r="",a=x.DefaultConnectTimeoutMs,i){if(this._connectionState===k.CONNECTED)return Promise.resolve(n);if(this._connectionState===k.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=k.CONNECTING;let o=this.useSSL?"wss://":"ws://";this.adapter.connect(o,this.host,this.port,t,n.token,r,i),this.adapter.onClose=c=>{this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(c)},this.adapter.onMessage=c=>g(this,null,function*(){if(this.verbose&&window&&window.console&&console.log("Response: %o",JSON.stringify(c)),c.cid){let d=this.cIds[c.cid];if(!d){this.verbose&&window&&window.console&&console.error("No promise executor for message: %o",c);return}delete this.cIds[c.cid],c.error?d.reject(c.error):d.resolve(c)}else if(c.channel_message){let d=Wn(c);this.onchannelmessage(d)}else this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",c)});let l=new Promise((c,d)=>{this.adapter.onOpen=_=>{this.verbose&&window&&window.console&&console.log(_);let p=Pn;Pn=!0,this.clearConnectTimeout(),this._connectionState=k.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,c(n),p&&this.onreconnect(_)},this.adapter.onError=_=>{this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(_),this._connectPromise=void 0,this.adapter.close(),d(_)},this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.close(),this._connectPromise=void 0,d("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},a)});return this._connectPromise=l,this._connectPromise}disconnect(n=!0){this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.isOpen()&&this.adapter.close(),n&&this.ondisconnect({})}setHeartbeatTimeoutMs(n){this._heartbeatTimeoutMs=n}getHeartbeatTimeoutMs(){return this._heartbeatTimeoutMs}onreconnect(n){this.verbose&&window&&window.console&&console.log(n)}ondisconnect(n){this.verbose&&window&&window.console&&console.log(n)}onerror(n){this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.verbose&&window&&window.console&&console.log(n)}onheartbeattimeout(){this.verbose&&window&&window.console&&console.log("Heartbeat timeout.")}onchannelmessage(n){this.verbose&&window&&window.console&&console.log(n)}send(n,t=x.DefaultSendTimeoutMs){let r=n;return new Promise((a,i)=>{var o,l;if(!this.adapter.isOpen())i("Socket connection has not been established yet.");else{r.channel_message_send?r.channel_message_send.content=JSON.stringify(r.channel_message_send.content):r.channel_message_update?r.channel_message_update.content=JSON.stringify(r.channel_message_update.content):r.ephemeral_message_send?r.ephemeral_message_send.message.content=JSON.stringify((o=r.ephemeral_message_send.message)==null?void 0:o.content):r.quick_menu_event&&(r.quick_menu_event.message.content=JSON.stringify((l=r.quick_menu_event.message)==null?void 0:l.content));let c=this.generatecid();this.cIds[c]={resolve:a,reject:i},t!==1/0&&t>0&&setTimeout(()=>{i("The socket timed out while waiting for a response.")},t),r.cid=c,this.adapter.send(r)}})}joinChat(n,t,r,a){return g(this,null,function*(){return(yield this.send({channel_join:{clan_id:n,channel_id:t,channel_type:r,is_public:a}})).channel})}leaveChat(n,t,r,a){return g(this,null,function*(){return this.send({channel_leave:{clan_id:n,channel_id:t,channel_type:r,is_public:a}})})}writeChatMessage(n,t,r,a,i,o,l,c,d,_,p){return g(this,null,function*(){return(yield this.send({channel_message_send:{clan_id:n,channel_id:t,mode:r,is_public:a,content:i,reactions:[],mentions:[],attachments:o,references:[],anonymous_message:l,mention_everyone:c,avatar:d,code:_,topic_id:p}},1/0)).channel_message_ack})}pingPong(){return g(this,null,function*(){if(!this.isOpen()){this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop();return}try{yield this.send({ping:{}},this._heartbeatTimeoutMs)}catch(n){this._connectionState=k.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)}};x.DefaultHeartbeatTimeoutMs=1e4,x.DefaultSendTimeoutMs=1e4,x.DefaultConnectTimeoutMs=3e4;var fe=x;function Wn(e){var n,t;try{n=Ce(e.channel_message.content)}catch(a){console.log("content is invalid",a)}try{t=dn(e.channel_message.attachments)}catch(a){console.log("attachments is invalid",a)}var r={id:e.id||e.channel_message.message_id,avatar:e.channel_message.avatar,channel_id:e.channel_message.channel_id,mode:e.channel_message.mode,channel_label:e.channel_message.channel_label,clan_id:e.channel_message.clan_id,code:e.channel_message.code,message_id:e.channel_message.message_id,sender_id:e.channel_message.sender_id,update_time:e.channel_message.update_time,clan_logo:e.channel_message.clan_logo,category_name:e.channel_message.category_name,username:e.channel_message.username,clan_nick:e.channel_message.clan_nick,clan_avatar:e.channel_message.clan_avatar,display_name:e.channel_message.display_name,content:n,attachments:t==null?void 0:t.attachments,hide_editted:e.channel_message.hide_editted,is_public:e.channel_message.is_public,create_time_seconds:e.channel_message.create_time_seconds,update_time_seconds:e.channel_message.update_time_seconds,topic_id:e.channel_message.topic_id};return r}var X=class extends Error{constructor(t,r){super(t!=null?t:"Authentication failed.");this.statusCode=r;this.name="AuthenticationError"}},he=class extends Error{constructor(n){super(n!=null?n:"Session error."),this.name="SessionError"}};function He(e){let n=new URL(e);return`${n.protocol==="https:"?"https://":"http://"}${n.hostname}:${n.port}`}var Ee=class e{constructor(n,t,r){this.refreshTokenPromise=null;this._session=n,this._client=t,this._userId=r}get userId(){return this._userId}get session(){return this._session}get client(){return this._client}static initClient(n){let{token:t,refresh_token:r,api_url:a,ws_url:i,user_id:o,serverkey:l}=n;if(!t||!r||!a||!i||!o)throw new he("Missing required fields: token, refresh_token, api_url, ws_url, and user_id are all required");let c=oe.restore(t,r,a,i,!0),d=new _e(l||J,7e3,He(a));return new e(c,d,o)}static authenticate(n){return g(this,null,function*(){let{id_token:t,user_id:r,username:a,serverkey:i=J,gateway_url:o=pe}=n,l=new _e(i||J,7e3,He(o)),c={id_token:t,user_id:r,username:a},d=yield l.authenticateIdToken(i,"",c);if(!d)throw new X("Authentication failed: No response from server.");if(!d.token||!d.refresh_token||!d.api_url||!d.ws_url||!d.user_id)throw new X("Invalid authentication response: missing required fields");let _=oe.restore(d.token,d.refresh_token,d.api_url,d.ws_url,!0);return l.setBasePath(He(d.api_url)),new e(_,l,d.user_id)})}createDM(n){return g(this,null,function*(){let t={type:3,channel_private:1,user_ids:[n]};return this._client.createChannelDesc(this._session.token,t)})}createGroupDM(n){return g(this,null,function*(){if(n.length===0)throw new Error("At least one user ID is required for a group DM");let t={type:2,channel_private:1,user_ids:n};return this._client.createChannelDesc(this._session.token,t)})}uploadAttachment(n){return g(this,null,function*(){return this._client.uploadAttachmentFile(this._session.token,n)})}refreshSession(){return g(this,null,function*(){return this._session?(this._session.created&&this._session.expires_at-this._session.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"),this._session.created&&this._session.refresh_expires_at-this._session.created_at<3700&&console.warn("Session refresh lifetime too short, please set '--session.refresh_token_expiry_sec' option. See the documentation for more info: https://mezon.vn/docs/mezon/getting-started/configuration/#session"),this.refreshTokenPromise?this.refreshTokenPromise:(this.refreshTokenPromise=new Promise((n,t)=>g(this,null,function*(){try{let r=yield this.client.sessionRefresh(this._client.serverKey||J,"",{token:this._session.refresh_token,vars:this._session.vars,is_remember:this._session.is_remember});this._session.update(r.token,r.refresh_token,r.is_remember||!1),this.onRefreshSession(r),n(this._session)}catch(r){console.error("Session refresh failed:",r),t(r)}finally{this.refreshTokenPromise=null}})),this.refreshTokenPromise)):(console.error("Cannot refresh a null session."),this._session)})}createSocket(n=!1,t=new R,r=fe.DefaultSendTimeoutMs){let{host:a,port:i,useSSL:o}={host:this._session.ws_url,port:"443",useSSL:!0};return new fe(a,i,o,n,t,r)}onRefreshSession(n){console.log(`Token refresh occurred. Token: ${n.token}`)}isSessionExpired(){return this._session.isexpired(Date.now()/1e3)}isRefreshSessionExpired(){return this._session.isrefreshexpired(Date.now()/1e3)}getToken(){return this._session.token}getRefreshToken(){return this._session.refresh_token}getSession(){return this.session}exportSession(){return{token:this._session.token,refresh_token:this._session.refresh_token,api_url:this._session.api_url||"",ws_url:this._session.ws_url||"",user_id:this._userId}}};var O=class extends Error{constructor(n){super(n),this.name="SocketError"}};function En(r){return g(this,arguments,function*(e,n=20,t=100){var l;let a=0,i=t,o=e;for(;a<n;){if((l=o.adapter)!=null&&l.isOpen())return;yield new Promise(c=>setTimeout(c,i)),i*=2,a++}throw new O(`Socket failed to connect after ${n} attempts (total wait: ~${Math.pow(2,n)*t}ms)`)})}var Ae=class{constructor(n,t){this._client=n;this._session=t;this._socket=null;this._isConnected=!1;this._messageHandlers=[]}get isConnected(){return this._isConnected}get socket(){if(!this._socket)throw new O("Socket is not connected. Call connect() first.");return this._socket}connect(){return g(this,arguments,function*(n={}){if(this._isConnected)throw new O("Socket is already connected. Call disconnect() first.");let{onError:t,onDisconnect:r,verbose:a=!1}=n;this._errorHandler=t,this._disconnectHandler=r,this._socket=this._client.createSocket(a,new R),this._socket.onerror=i=>{var o;(o=this._errorHandler)==null||o.call(this,i)},this._socket.ondisconnect=()=>{var i;this._isConnected=!1,(i=this._disconnectHandler)==null||i.call(this)},this._socket.onchannelmessage=i=>{var o;if(!i){(o=this._errorHandler)==null||o.call(this,new O("Received null or undefined channel message"));return}this._messageHandlers.forEach(l=>{try{l(i)}catch(c){console.error("Error in message handler:",c)}})},yield this._socket.connect(this._session,!0,"0"),this._isConnected=!0})}disconnect(){this._socket&&(this._socket.disconnect(!0),this._socket=null,this._isConnected=!1)}setChannelMessageHandler(n){this.onChannelMessage(n)}onChannelMessage(n){return this._messageHandlers.push(n),()=>{let t=this._messageHandlers.indexOf(n);t!==-1&&this._messageHandlers.splice(t,1)}}joinDMChannel(n){return g(this,null,function*(){yield En(this.socket),yield this.socket.joinChat(A,n,3,!1)})}joinGroupChannel(n){return g(this,null,function*(){yield En(this.socket),yield this.socket.joinChat(A,n,2,!1)})}leaveDMChannel(n){return g(this,null,function*(){yield this.socket.leaveChat(A,n,3,!1)})}leaveGroupChannel(n){return g(this,null,function*(){yield this.socket.leaveChat(A,n,2,!1)})}sendDM(n){return g(this,null,function*(){let{channelId:t,content:r,attachments:a,hideLink:i=!1,code:o=0}=n;yield this.socket.writeChatMessage(A,t,4,!1,r,a,!1,i,"",o)})}sendGroup(n){return g(this,null,function*(){let{channelId:t,content:r,attachments:a,hideLink:i=!1}=n;yield this.socket.writeChatMessage(A,t,3,!1,r,a,!1,i,"",0)})}setErrorHandler(n){this._errorHandler=n,this._socket&&(this._socket.onerror=n)}};
|
package/dist/index.esm.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Cn=Object.defineProperty;var Be=Object.getOwnPropertySymbols;var bn=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable;var He=(e,n,t)=>n in e?Cn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ke=(e,n)=>{for(var t in n||(n={}))bn.call(n,t)&&He(e,t,n[t]);if(Be)for(var t of Be(n))Pn.call(n,t)&&He(e,t,n[t]);return e};var g=(e,n,t)=>new Promise((r,a)=>{var i=c=>{try{l(t.next(c))}catch(d){a(d)}},o=c=>{try{l(t.throw(c))}catch(d){a(d)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,o);l((t=t.apply(e,n)).next())});var Se="https://gw.mezon.ai",ve=20,Te=100,N="0",J=3,W=2,Ce=4,be=3,B="DefaultServerKey";import*as Pe from"js-base64";var ae=class e{constructor(n,t,r,a,i,o,l){this.created=r;this.api_url=a;this.ws_url=i;this.id_token=o;this.token=n,this.refresh_token=t,this.id_token=o,this.api_url=a,this.ws_url=i,this.created_at=Math.floor(new Date().getTime()/1e3),this.is_remember=l,this.update(n,t,l)}isexpired(n){return this.expires_at-n<=0}isrefreshexpired(n){return this.refresh_expires_at-n<=0}update(n,t,r){let a=n.split(".");if(a.length!=3)throw"jwt is not valid.";let i=JSON.parse(Pe.atob(a[1])),o=Math.floor(parseInt(i.exp));if(t){let l=t.split(".");if(l.length!=3)throw"refresh jwt is not valid.";let c=JSON.parse(Pe.atob(l[1])),d=Math.floor(parseInt(c.exp));this.refresh_expires_at=d,this.refresh_token=t,this.is_remember=r}this.token=n,this.expires_at=o,this.username=i.usn,this.user_id=i.uid,this.vars=i.vrs}static restore(n,t,r,a,i){return new e(n,t,!1,r,a,"",i)}};import we from"long";import f from"protobufjs/minimal";function qe(){return{created:!1,token:"",refresh_token:"",user_id:"0",is_remember:!1,api_url:"",id_token:""}}var Ae={encode(e,n=f.Writer.create()){return e.created!==!1&&n.uint32(8).bool(e.created),e.token!==""&&n.uint32(18).string(e.token),e.refresh_token!==""&&n.uint32(26).string(e.refresh_token),e.user_id!=="0"&&n.uint32(32).int64(e.user_id),e.is_remember!==!1&&n.uint32(40).bool(e.is_remember),e.api_url!==""&&n.uint32(50).string(e.api_url),e.id_token!==""&&n.uint32(58).string(e.id_token),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=qe();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.created=t.bool();continue;case 2:if(i!==18)break;a.token=t.string();continue;case 3:if(i!==26)break;a.refresh_token=t.string();continue;case 4:if(i!==32)break;a.user_id=m(t.int64());continue;case 5:if(i!==40)break;a.is_remember=t.bool();continue;case 6:if(i!==50)break;a.api_url=t.string();continue;case 7:if(i!==58)break;a.id_token=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{created:s(e.created)?globalThis.Boolean(e.created):!1,token:s(e.token)?globalThis.String(e.token):"",refresh_token:s(e.refresh_token)?globalThis.String(e.refresh_token):"",user_id:s(e.user_id)?globalThis.String(e.user_id):"0",is_remember:s(e.is_remember)?globalThis.Boolean(e.is_remember):!1,api_url:s(e.api_url)?globalThis.String(e.api_url):"",id_token:s(e.id_token)?globalThis.String(e.id_token):""}},toJSON(e){let n={};return e.created!==!1&&(n.created=e.created),e.token!==""&&(n.token=e.token),e.refresh_token!==""&&(n.refresh_token=e.refresh_token),e.user_id!=="0"&&(n.user_id=e.user_id),e.is_remember!==!1&&(n.is_remember=e.is_remember),e.api_url!==""&&(n.api_url=e.api_url),e.id_token!==""&&(n.id_token=e.id_token),n},create(e){return Ae.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c;let n=qe();return n.created=(t=e.created)!=null?t:!1,n.token=(r=e.token)!=null?r:"",n.refresh_token=(a=e.refresh_token)!=null?a:"",n.user_id=(i=e.user_id)!=null?i:"0",n.is_remember=(o=e.is_remember)!=null?o:!1,n.api_url=(l=e.api_url)!=null?l:"",n.id_token=(c=e.id_token)!=null?c:"",n}};function Ve(){return{token:"",vars:{},is_remember:!1}}var ue={encode(e,n=f.Writer.create()){return e.token!==""&&n.uint32(10).string(e.token),Object.entries(e.vars).forEach(([t,r])=>{Ee.encode({key:t,value:r},n.uint32(18).fork()).ldelim()}),e.is_remember!==!1&&n.uint32(24).bool(e.is_remember),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Ve();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.token=t.string();continue;case 2:if(i!==18)break;let o=Ee.decode(t,t.uint32());o.value!==void 0&&(a.vars[o.key]=o.value);continue;case 3:if(i!==24)break;a.is_remember=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{token:s(e.token)?globalThis.String(e.token):"",vars:En(e.vars)?Object.entries(e.vars).reduce((n,[t,r])=>(n[t]=String(r),n),{}):{},is_remember:s(e.is_remember)?globalThis.Boolean(e.is_remember):!1}},toJSON(e){let n={};if(e.token!==""&&(n.token=e.token),e.vars){let t=Object.entries(e.vars);t.length>0&&(n.vars={},t.forEach(([r,a])=>{n.vars[r]=a}))}return e.is_remember!==!1&&(n.is_remember=e.is_remember),n},create(e){return ue.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a;let n=Ve();return n.token=(t=e.token)!=null?t:"",n.vars=Object.entries((r=e.vars)!=null?r:{}).reduce((i,[o,l])=>(l!==void 0&&(i[o]=globalThis.String(l)),i),{}),n.is_remember=(a=e.is_remember)!=null?a:!1,n}};function ze(){return{key:"",value:""}}var Ee={encode(e,n=f.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=ze();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.key=t.string();continue;case 2:if(i!==18)break;a.value=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{key:s(e.key)?globalThis.String(e.key):"",value:s(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Ee.fromPartial(e!=null?e:{})},fromPartial(e){var t,r;let n=ze();return n.key=(t=e.key)!=null?t:"",n.value=(r=e.value)!=null?r:"",n}};function Fe(){return{clan_id:"0",parent_id:"0",channel_id:"0",category_id:"0",type:0,channel_label:"",channel_private:0,user_ids:[],app_id:"0"}}var fe={encode(e,n=f.Writer.create()){e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.parent_id!=="0"&&n.uint32(16).int64(e.parent_id),e.channel_id!=="0"&&n.uint32(24).int64(e.channel_id),e.category_id!=="0"&&n.uint32(32).int64(e.category_id),e.type!==0&&n.uint32(40).int32(e.type),e.channel_label!==""&&n.uint32(50).string(e.channel_label),e.channel_private!==0&&n.uint32(56).int32(e.channel_private),n.uint32(66).fork();for(let t of e.user_ids)n.int64(t);return n.ldelim(),e.app_id!=="0"&&n.uint32(72).int64(e.app_id),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Fe();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=m(t.int64());continue;case 2:if(i!==16)break;a.parent_id=m(t.int64());continue;case 3:if(i!==24)break;a.channel_id=m(t.int64());continue;case 4:if(i!==32)break;a.category_id=m(t.int64());continue;case 5:if(i!==40)break;a.type=t.int32();continue;case 6:if(i!==50)break;a.channel_label=t.string();continue;case 7:if(i!==56)break;a.channel_private=t.int32();continue;case 8:if(i===64){a.user_ids.push(m(t.int64()));continue}if(i===66){let o=t.uint32()+t.pos;for(;t.pos<o;)a.user_ids.push(m(t.int64()));continue}break;case 9:if(i!==72)break;a.app_id=m(t.int64());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:s(e.clan_id)?globalThis.String(e.clan_id):"0",parent_id:s(e.parent_id)?globalThis.String(e.parent_id):"0",channel_id:s(e.channel_id)?globalThis.String(e.channel_id):"0",category_id:s(e.category_id)?globalThis.String(e.category_id):"0",type:s(e.type)?globalThis.Number(e.type):0,channel_label:s(e.channel_label)?globalThis.String(e.channel_label):"",channel_private:s(e.channel_private)?globalThis.Number(e.channel_private):0,user_ids:globalThis.Array.isArray(e==null?void 0:e.user_ids)?e.user_ids.map(n=>globalThis.String(n)):[],app_id:s(e.app_id)?globalThis.String(e.app_id):"0"}},toJSON(e){var t;let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.parent_id!=="0"&&(n.parent_id=e.parent_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.category_id!=="0"&&(n.category_id=e.category_id),e.type!==0&&(n.type=Math.round(e.type)),e.channel_label!==""&&(n.channel_label=e.channel_label),e.channel_private!==0&&(n.channel_private=Math.round(e.channel_private)),(t=e.user_ids)!=null&&t.length&&(n.user_ids=e.user_ids),e.app_id!=="0"&&(n.app_id=e.app_id),n},create(e){return fe.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_;let n=Fe();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.parent_id=(r=e.parent_id)!=null?r:"0",n.channel_id=(a=e.channel_id)!=null?a:"0",n.category_id=(i=e.category_id)!=null?i:"0",n.type=(o=e.type)!=null?o:0,n.channel_label=(l=e.channel_label)!=null?l:"",n.channel_private=(c=e.channel_private)!=null?c:0,n.user_ids=((d=e.user_ids)==null?void 0:d.map(p=>p))||[],n.app_id=(_=e.app_id)!=null?_:"0",n}};function Ke(){return{clan_id:"0",parent_id:"0",channel_id:"0",category_id:"0",category_name:"",type:0,creator_id:"0",channel_label:"",channel_private:0,avatars:[],user_ids:[],last_sent_message:void 0,last_seen_message:void 0,onlines:[],meeting_code:"",count_mess_unread:0,active:0,last_pin_message:"",usernames:[],creator_name:"",create_time_seconds:0,update_time_seconds:0,display_names:[],channel_avatar:"",clan_name:"",app_id:"0",is_mute:!1,age_restricted:0,topic:"",e2ee:0,member_count:0}}var xe={encode(e,n=f.Writer.create()){e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.parent_id!=="0"&&n.uint32(16).int64(e.parent_id),e.channel_id!=="0"&&n.uint32(24).int64(e.channel_id),e.category_id!=="0"&&n.uint32(32).int64(e.category_id),e.category_name!==""&&n.uint32(42).string(e.category_name),e.type!==0&&n.uint32(48).int32(e.type),e.creator_id!=="0"&&n.uint32(56).int64(e.creator_id),e.channel_label!==""&&n.uint32(66).string(e.channel_label),e.channel_private!==0&&n.uint32(72).int32(e.channel_private);for(let t of e.avatars)n.uint32(82).string(t);n.uint32(90).fork();for(let t of e.user_ids)n.int64(t);n.ldelim(),e.last_sent_message!==void 0&&S.encode(e.last_sent_message,n.uint32(98).fork()).ldelim(),e.last_seen_message!==void 0&&S.encode(e.last_seen_message,n.uint32(106).fork()).ldelim(),n.uint32(114).fork();for(let t of e.onlines)n.bool(t);n.ldelim(),e.meeting_code!==""&&n.uint32(122).string(e.meeting_code),e.count_mess_unread!==0&&n.uint32(128).int32(e.count_mess_unread),e.active!==0&&n.uint32(136).int32(e.active),e.last_pin_message!==""&&n.uint32(146).string(e.last_pin_message);for(let t of e.usernames)n.uint32(154).string(t);e.creator_name!==""&&n.uint32(162).string(e.creator_name),e.create_time_seconds!==0&&n.uint32(168).uint32(e.create_time_seconds),e.update_time_seconds!==0&&n.uint32(176).uint32(e.update_time_seconds);for(let t of e.display_names)n.uint32(186).string(t);return e.channel_avatar!==""&&n.uint32(194).string(e.channel_avatar),e.clan_name!==""&&n.uint32(202).string(e.clan_name),e.app_id!=="0"&&n.uint32(208).int64(e.app_id),e.is_mute!==!1&&n.uint32(216).bool(e.is_mute),e.age_restricted!==0&&n.uint32(224).int32(e.age_restricted),e.topic!==""&&n.uint32(234).string(e.topic),e.e2ee!==0&&n.uint32(240).int32(e.e2ee),e.member_count!==0&&n.uint32(248).int32(e.member_count),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Ke();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=m(t.int64());continue;case 2:if(i!==16)break;a.parent_id=m(t.int64());continue;case 3:if(i!==24)break;a.channel_id=m(t.int64());continue;case 4:if(i!==32)break;a.category_id=m(t.int64());continue;case 5:if(i!==42)break;a.category_name=t.string();continue;case 6:if(i!==48)break;a.type=t.int32();continue;case 7:if(i!==56)break;a.creator_id=m(t.int64());continue;case 8:if(i!==66)break;a.channel_label=t.string();continue;case 9:if(i!==72)break;a.channel_private=t.int32();continue;case 10:if(i!==82)break;a.avatars.push(t.string());continue;case 11:if(i===88){a.user_ids.push(m(t.int64()));continue}if(i===90){let o=t.uint32()+t.pos;for(;t.pos<o;)a.user_ids.push(m(t.int64()));continue}break;case 12:if(i!==98)break;a.last_sent_message=S.decode(t,t.uint32());continue;case 13:if(i!==106)break;a.last_seen_message=S.decode(t,t.uint32());continue;case 14:if(i===112){a.onlines.push(t.bool());continue}if(i===114){let o=t.uint32()+t.pos;for(;t.pos<o;)a.onlines.push(t.bool());continue}break;case 15:if(i!==122)break;a.meeting_code=t.string();continue;case 16:if(i!==128)break;a.count_mess_unread=t.int32();continue;case 17:if(i!==136)break;a.active=t.int32();continue;case 18:if(i!==146)break;a.last_pin_message=t.string();continue;case 19:if(i!==154)break;a.usernames.push(t.string());continue;case 20:if(i!==162)break;a.creator_name=t.string();continue;case 21:if(i!==168)break;a.create_time_seconds=t.uint32();continue;case 22:if(i!==176)break;a.update_time_seconds=t.uint32();continue;case 23:if(i!==186)break;a.display_names.push(t.string());continue;case 24:if(i!==194)break;a.channel_avatar=t.string();continue;case 25:if(i!==202)break;a.clan_name=t.string();continue;case 26:if(i!==208)break;a.app_id=m(t.int64());continue;case 27:if(i!==216)break;a.is_mute=t.bool();continue;case 28:if(i!==224)break;a.age_restricted=t.int32();continue;case 29:if(i!==234)break;a.topic=t.string();continue;case 30:if(i!==240)break;a.e2ee=t.int32();continue;case 31:if(i!==248)break;a.member_count=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:s(e.clan_id)?globalThis.String(e.clan_id):"0",parent_id:s(e.parent_id)?globalThis.String(e.parent_id):"0",channel_id:s(e.channel_id)?globalThis.String(e.channel_id):"0",category_id:s(e.category_id)?globalThis.String(e.category_id):"0",category_name:s(e.category_name)?globalThis.String(e.category_name):"",type:s(e.type)?globalThis.Number(e.type):0,creator_id:s(e.creator_id)?globalThis.String(e.creator_id):"0",channel_label:s(e.channel_label)?globalThis.String(e.channel_label):"",channel_private:s(e.channel_private)?globalThis.Number(e.channel_private):0,avatars:globalThis.Array.isArray(e==null?void 0:e.avatars)?e.avatars.map(n=>globalThis.String(n)):[],user_ids:globalThis.Array.isArray(e==null?void 0:e.user_ids)?e.user_ids.map(n=>globalThis.String(n)):[],last_sent_message:s(e.last_sent_message)?S.fromJSON(e.last_sent_message):void 0,last_seen_message:s(e.last_seen_message)?S.fromJSON(e.last_seen_message):void 0,onlines:globalThis.Array.isArray(e==null?void 0:e.onlines)?e.onlines.map(n=>globalThis.Boolean(n)):[],meeting_code:s(e.meeting_code)?globalThis.String(e.meeting_code):"",count_mess_unread:s(e.count_mess_unread)?globalThis.Number(e.count_mess_unread):0,active:s(e.active)?globalThis.Number(e.active):0,last_pin_message:s(e.last_pin_message)?globalThis.String(e.last_pin_message):"",usernames:globalThis.Array.isArray(e==null?void 0:e.usernames)?e.usernames.map(n=>globalThis.String(n)):[],creator_name:s(e.creator_name)?globalThis.String(e.creator_name):"",create_time_seconds:s(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,update_time_seconds:s(e.update_time_seconds)?globalThis.Number(e.update_time_seconds):0,display_names:globalThis.Array.isArray(e==null?void 0:e.display_names)?e.display_names.map(n=>globalThis.String(n)):[],channel_avatar:s(e.channel_avatar)?globalThis.String(e.channel_avatar):"",clan_name:s(e.clan_name)?globalThis.String(e.clan_name):"",app_id:s(e.app_id)?globalThis.String(e.app_id):"0",is_mute:s(e.is_mute)?globalThis.Boolean(e.is_mute):!1,age_restricted:s(e.age_restricted)?globalThis.Number(e.age_restricted):0,topic:s(e.topic)?globalThis.String(e.topic):"",e2ee:s(e.e2ee)?globalThis.Number(e.e2ee):0,member_count:s(e.member_count)?globalThis.Number(e.member_count):0}},toJSON(e){var t,r,a,i,o;let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.parent_id!=="0"&&(n.parent_id=e.parent_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.category_id!=="0"&&(n.category_id=e.category_id),e.category_name!==""&&(n.category_name=e.category_name),e.type!==0&&(n.type=Math.round(e.type)),e.creator_id!=="0"&&(n.creator_id=e.creator_id),e.channel_label!==""&&(n.channel_label=e.channel_label),e.channel_private!==0&&(n.channel_private=Math.round(e.channel_private)),(t=e.avatars)!=null&&t.length&&(n.avatars=e.avatars),(r=e.user_ids)!=null&&r.length&&(n.user_ids=e.user_ids),e.last_sent_message!==void 0&&(n.last_sent_message=S.toJSON(e.last_sent_message)),e.last_seen_message!==void 0&&(n.last_seen_message=S.toJSON(e.last_seen_message)),(a=e.onlines)!=null&&a.length&&(n.onlines=e.onlines),e.meeting_code!==""&&(n.meeting_code=e.meeting_code),e.count_mess_unread!==0&&(n.count_mess_unread=Math.round(e.count_mess_unread)),e.active!==0&&(n.active=Math.round(e.active)),e.last_pin_message!==""&&(n.last_pin_message=e.last_pin_message),(i=e.usernames)!=null&&i.length&&(n.usernames=e.usernames),e.creator_name!==""&&(n.creator_name=e.creator_name),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.update_time_seconds!==0&&(n.update_time_seconds=Math.round(e.update_time_seconds)),(o=e.display_names)!=null&&o.length&&(n.display_names=e.display_names),e.channel_avatar!==""&&(n.channel_avatar=e.channel_avatar),e.clan_name!==""&&(n.clan_name=e.clan_name),e.app_id!=="0"&&(n.app_id=e.app_id),e.is_mute!==!1&&(n.is_mute=e.is_mute),e.age_restricted!==0&&(n.age_restricted=Math.round(e.age_restricted)),e.topic!==""&&(n.topic=e.topic),e.e2ee!==0&&(n.e2ee=Math.round(e.e2ee)),e.member_count!==0&&(n.member_count=Math.round(e.member_count)),n},create(e){return xe.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p,y,x,M,I,C,G,X,Z,$,Q,j,ee,ne,te,ie,Ue,Le,Je,We;let n=Ke();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.parent_id=(r=e.parent_id)!=null?r:"0",n.channel_id=(a=e.channel_id)!=null?a:"0",n.category_id=(i=e.category_id)!=null?i:"0",n.category_name=(o=e.category_name)!=null?o:"",n.type=(l=e.type)!=null?l:0,n.creator_id=(c=e.creator_id)!=null?c:"0",n.channel_label=(d=e.channel_label)!=null?d:"",n.channel_private=(_=e.channel_private)!=null?_:0,n.avatars=((p=e.avatars)==null?void 0:p.map(P=>P))||[],n.user_ids=((y=e.user_ids)==null?void 0:y.map(P=>P))||[],n.last_sent_message=e.last_sent_message!==void 0&&e.last_sent_message!==null?S.fromPartial(e.last_sent_message):void 0,n.last_seen_message=e.last_seen_message!==void 0&&e.last_seen_message!==null?S.fromPartial(e.last_seen_message):void 0,n.onlines=((x=e.onlines)==null?void 0:x.map(P=>P))||[],n.meeting_code=(M=e.meeting_code)!=null?M:"",n.count_mess_unread=(I=e.count_mess_unread)!=null?I:0,n.active=(C=e.active)!=null?C:0,n.last_pin_message=(G=e.last_pin_message)!=null?G:"",n.usernames=((X=e.usernames)==null?void 0:X.map(P=>P))||[],n.creator_name=(Z=e.creator_name)!=null?Z:"",n.create_time_seconds=($=e.create_time_seconds)!=null?$:0,n.update_time_seconds=(Q=e.update_time_seconds)!=null?Q:0,n.display_names=((j=e.display_names)==null?void 0:j.map(P=>P))||[],n.channel_avatar=(ee=e.channel_avatar)!=null?ee:"",n.clan_name=(ne=e.clan_name)!=null?ne:"",n.app_id=(te=e.app_id)!=null?te:"0",n.is_mute=(ie=e.is_mute)!=null?ie:!1,n.age_restricted=(Ue=e.age_restricted)!=null?Ue:0,n.topic=(Le=e.topic)!=null?Le:"",n.e2ee=(Je=e.e2ee)!=null?Je:0,n.member_count=(We=e.member_count)!=null?We:0,n}};function m(e){return e.toString()}f.util.Long!==we&&(f.util.Long=we,f.configure());function En(e){return typeof e=="object"&&e!==null}function s(e){return e!=null}function Ye(){return{clan_id:"0",channel_id:"0",message_id:"0",code:0,sender_id:"0",username:"",avatar:"",content:"",channel_label:"",clan_logo:"",category_name:"",display_name:"",clan_nick:"",clan_avatar:"",reactions:new Uint8Array(0),mentions:new Uint8Array(0),attachments:new Uint8Array(0),references:new Uint8Array(0),referenced_message:new Uint8Array(0),create_time_seconds:0,update_time_seconds:0,mode:0,hide_editted:!1,is_public:!1,topic_id:"0"}}var O={encode(e,n=f.Writer.create()){return e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.message_id!=="0"&&n.uint32(24).int64(e.message_id),e.code!==0&&n.uint32(32).int32(e.code),e.sender_id!=="0"&&n.uint32(40).int64(e.sender_id),e.username!==""&&n.uint32(50).string(e.username),e.avatar!==""&&n.uint32(58).string(e.avatar),e.content!==""&&n.uint32(66).string(e.content),e.channel_label!==""&&n.uint32(74).string(e.channel_label),e.clan_logo!==""&&n.uint32(82).string(e.clan_logo),e.category_name!==""&&n.uint32(90).string(e.category_name),e.display_name!==""&&n.uint32(98).string(e.display_name),e.clan_nick!==""&&n.uint32(106).string(e.clan_nick),e.clan_avatar!==""&&n.uint32(114).string(e.clan_avatar),e.reactions.length!==0&&n.uint32(122).bytes(e.reactions),e.mentions.length!==0&&n.uint32(130).bytes(e.mentions),e.attachments.length!==0&&n.uint32(138).bytes(e.attachments),e.references.length!==0&&n.uint32(146).bytes(e.references),e.referenced_message.length!==0&&n.uint32(154).bytes(e.referenced_message),e.create_time_seconds!==0&&n.uint32(160).uint32(e.create_time_seconds),e.update_time_seconds!==0&&n.uint32(168).uint32(e.update_time_seconds),e.mode!==0&&n.uint32(176).int32(e.mode),e.hide_editted!==!1&&n.uint32(184).bool(e.hide_editted),e.is_public!==!1&&n.uint32(192).bool(e.is_public),e.topic_id!=="0"&&n.uint32(200).int64(e.topic_id),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Ye();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=m(t.int64());continue;case 2:if(i!==16)break;a.channel_id=m(t.int64());continue;case 3:if(i!==24)break;a.message_id=m(t.int64());continue;case 4:if(i!==32)break;a.code=t.int32();continue;case 5:if(i!==40)break;a.sender_id=m(t.int64());continue;case 6:if(i!==50)break;a.username=t.string();continue;case 7:if(i!==58)break;a.avatar=t.string();continue;case 8:if(i!==66)break;a.content=t.string();continue;case 9:if(i!==74)break;a.channel_label=t.string();continue;case 10:if(i!==82)break;a.clan_logo=t.string();continue;case 11:if(i!==90)break;a.category_name=t.string();continue;case 12:if(i!==98)break;a.display_name=t.string();continue;case 13:if(i!==106)break;a.clan_nick=t.string();continue;case 14:if(i!==114)break;a.clan_avatar=t.string();continue;case 15:if(i!==122)break;a.reactions=t.bytes();continue;case 16:if(i!==130)break;a.mentions=t.bytes();continue;case 17:if(i!==138)break;a.attachments=t.bytes();continue;case 18:if(i!==146)break;a.references=t.bytes();continue;case 19:if(i!==154)break;a.referenced_message=t.bytes();continue;case 20:if(i!==160)break;a.create_time_seconds=t.uint32();continue;case 21:if(i!==168)break;a.update_time_seconds=t.uint32();continue;case 22:if(i!==176)break;a.mode=t.int32();continue;case 23:if(i!==184)break;a.hide_editted=t.bool();continue;case 24:if(i!==192)break;a.is_public=t.bool();continue;case 25:if(i!==200)break;a.topic_id=m(t.int64());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:s(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:s(e.channel_id)?globalThis.String(e.channel_id):"0",message_id:s(e.message_id)?globalThis.String(e.message_id):"0",code:s(e.code)?globalThis.Number(e.code):0,sender_id:s(e.sender_id)?globalThis.String(e.sender_id):"0",username:s(e.username)?globalThis.String(e.username):"",avatar:s(e.avatar)?globalThis.String(e.avatar):"",content:s(e.content)?globalThis.String(e.content):"",channel_label:s(e.channel_label)?globalThis.String(e.channel_label):"",clan_logo:s(e.clan_logo)?globalThis.String(e.clan_logo):"",category_name:s(e.category_name)?globalThis.String(e.category_name):"",display_name:s(e.display_name)?globalThis.String(e.display_name):"",clan_nick:s(e.clan_nick)?globalThis.String(e.clan_nick):"",clan_avatar:s(e.clan_avatar)?globalThis.String(e.clan_avatar):"",reactions:s(e.reactions)?re(e.reactions):new Uint8Array(0),mentions:s(e.mentions)?re(e.mentions):new Uint8Array(0),attachments:s(e.attachments)?re(e.attachments):new Uint8Array(0),references:s(e.references)?re(e.references):new Uint8Array(0),referenced_message:s(e.referenced_message)?re(e.referenced_message):new Uint8Array(0),create_time_seconds:s(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,update_time_seconds:s(e.update_time_seconds)?globalThis.Number(e.update_time_seconds):0,mode:s(e.mode)?globalThis.Number(e.mode):0,hide_editted:s(e.hide_editted)?globalThis.Boolean(e.hide_editted):!1,is_public:s(e.is_public)?globalThis.Boolean(e.is_public):!1,topic_id:s(e.topic_id)?globalThis.String(e.topic_id):"0"}},toJSON(e){let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.message_id!=="0"&&(n.message_id=e.message_id),e.code!==0&&(n.code=Math.round(e.code)),e.sender_id!=="0"&&(n.sender_id=e.sender_id),e.username!==""&&(n.username=e.username),e.avatar!==""&&(n.avatar=e.avatar),e.content!==""&&(n.content=e.content),e.channel_label!==""&&(n.channel_label=e.channel_label),e.clan_logo!==""&&(n.clan_logo=e.clan_logo),e.category_name!==""&&(n.category_name=e.category_name),e.display_name!==""&&(n.display_name=e.display_name),e.clan_nick!==""&&(n.clan_nick=e.clan_nick),e.clan_avatar!==""&&(n.clan_avatar=e.clan_avatar),e.reactions.length!==0&&(n.reactions=se(e.reactions)),e.mentions.length!==0&&(n.mentions=se(e.mentions)),e.attachments.length!==0&&(n.attachments=se(e.attachments)),e.references.length!==0&&(n.references=se(e.references)),e.referenced_message.length!==0&&(n.referenced_message=se(e.referenced_message)),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.update_time_seconds!==0&&(n.update_time_seconds=Math.round(e.update_time_seconds)),e.mode!==0&&(n.mode=Math.round(e.mode)),e.hide_editted!==!1&&(n.hide_editted=e.hide_editted),e.is_public!==!1&&(n.is_public=e.is_public),e.topic_id!=="0"&&(n.topic_id=e.topic_id),n},create(e){return O.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p,y,x,M,I,C,G,X,Z,$,Q,j,ee,ne,te,ie;let n=Ye();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.message_id=(a=e.message_id)!=null?a:"0",n.code=(i=e.code)!=null?i:0,n.sender_id=(o=e.sender_id)!=null?o:"0",n.username=(l=e.username)!=null?l:"",n.avatar=(c=e.avatar)!=null?c:"",n.content=(d=e.content)!=null?d:"",n.channel_label=(_=e.channel_label)!=null?_:"",n.clan_logo=(p=e.clan_logo)!=null?p:"",n.category_name=(y=e.category_name)!=null?y:"",n.display_name=(x=e.display_name)!=null?x:"",n.clan_nick=(M=e.clan_nick)!=null?M:"",n.clan_avatar=(I=e.clan_avatar)!=null?I:"",n.reactions=(C=e.reactions)!=null?C:new Uint8Array(0),n.mentions=(G=e.mentions)!=null?G:new Uint8Array(0),n.attachments=(X=e.attachments)!=null?X:new Uint8Array(0),n.references=(Z=e.references)!=null?Z:new Uint8Array(0),n.referenced_message=($=e.referenced_message)!=null?$:new Uint8Array(0),n.create_time_seconds=(Q=e.create_time_seconds)!=null?Q:0,n.update_time_seconds=(j=e.update_time_seconds)!=null?j:0,n.mode=(ee=e.mode)!=null?ee:0,n.hide_editted=(ne=e.hide_editted)!=null?ne:!1,n.is_public=(te=e.is_public)!=null?te:!1,n.topic_id=(ie=e.topic_id)!=null?ie:"0",n}};function Ge(){return{id:"0",timestamp_seconds:0,sender_id:"0",content:""}}var S={encode(e,n=f.Writer.create()){return e.id!=="0"&&n.uint32(8).int64(e.id),e.timestamp_seconds!==0&&n.uint32(16).uint32(e.timestamp_seconds),e.sender_id!=="0"&&n.uint32(24).int64(e.sender_id),e.content!==""&&n.uint32(34).string(e.content),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Ge();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.id=m(t.int64());continue;case 2:if(i!==16)break;a.timestamp_seconds=t.uint32();continue;case 3:if(i!==24)break;a.sender_id=m(t.int64());continue;case 4:if(i!==34)break;a.content=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{id:s(e.id)?globalThis.String(e.id):"0",timestamp_seconds:s(e.timestamp_seconds)?globalThis.Number(e.timestamp_seconds):0,sender_id:s(e.sender_id)?globalThis.String(e.sender_id):"0",content:s(e.content)?globalThis.String(e.content):""}},toJSON(e){let n={};return e.id!=="0"&&(n.id=e.id),e.timestamp_seconds!==0&&(n.timestamp_seconds=Math.round(e.timestamp_seconds)),e.sender_id!=="0"&&(n.sender_id=e.sender_id),e.content!==""&&(n.content=e.content),n},create(e){return S.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i;let n=Ge();return n.id=(t=e.id)!=null?t:"0",n.timestamp_seconds=(r=e.timestamp_seconds)!=null?r:0,n.sender_id=(a=e.sender_id)!=null?a:"0",n.content=(i=e.content)!=null?i:"",n}};function Xe(){return{id:"0",user_id:"0",username:"",role_id:"0",rolename:"",create_time_seconds:0,s:0,e:0}}var D={encode(e,n=f.Writer.create()){return e.id!=="0"&&n.uint32(8).int64(e.id),e.user_id!=="0"&&n.uint32(16).int64(e.user_id),e.username!==""&&n.uint32(26).string(e.username),e.role_id!=="0"&&n.uint32(32).int64(e.role_id),e.rolename!==""&&n.uint32(42).string(e.rolename),e.create_time_seconds!==0&&n.uint32(48).uint32(e.create_time_seconds),e.s!==0&&n.uint32(56).int32(e.s),e.e!==0&&n.uint32(64).int32(e.e),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Xe();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.id=m(t.int64());continue;case 2:if(i!==16)break;a.user_id=m(t.int64());continue;case 3:if(i!==26)break;a.username=t.string();continue;case 4:if(i!==32)break;a.role_id=m(t.int64());continue;case 5:if(i!==42)break;a.rolename=t.string();continue;case 6:if(i!==48)break;a.create_time_seconds=t.uint32();continue;case 7:if(i!==56)break;a.s=t.int32();continue;case 8:if(i!==64)break;a.e=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{id:s(e.id)?globalThis.String(e.id):"0",user_id:s(e.user_id)?globalThis.String(e.user_id):"0",username:s(e.username)?globalThis.String(e.username):"",role_id:s(e.role_id)?globalThis.String(e.role_id):"0",rolename:s(e.rolename)?globalThis.String(e.rolename):"",create_time_seconds:s(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,s:s(e.s)?globalThis.Number(e.s):0,e:s(e.e)?globalThis.Number(e.e):0}},toJSON(e){let n={};return e.id!=="0"&&(n.id=e.id),e.user_id!=="0"&&(n.user_id=e.user_id),e.username!==""&&(n.username=e.username),e.role_id!=="0"&&(n.role_id=e.role_id),e.rolename!==""&&(n.rolename=e.rolename),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.s!==0&&(n.s=Math.round(e.s)),e.e!==0&&(n.e=Math.round(e.e)),n},create(e){return D.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d;let n=Xe();return n.id=(t=e.id)!=null?t:"0",n.user_id=(r=e.user_id)!=null?r:"0",n.username=(a=e.username)!=null?a:"",n.role_id=(i=e.role_id)!=null?i:"0",n.rolename=(o=e.rolename)!=null?o:"",n.create_time_seconds=(l=e.create_time_seconds)!=null?l:0,n.s=(c=e.s)!=null?c:0,n.e=(d=e.e)!=null?d:0,n}};function Ze(){return{filename:"",size:0,url:"",filetype:"",width:0,height:0,thumbnail:"",duration:0}}var v={encode(e,n=f.Writer.create()){return e.filename!==""&&n.uint32(10).string(e.filename),e.size!==0&&n.uint32(16).int32(e.size),e.url!==""&&n.uint32(26).string(e.url),e.filetype!==""&&n.uint32(34).string(e.filetype),e.width!==0&&n.uint32(40).int32(e.width),e.height!==0&&n.uint32(48).int32(e.height),e.thumbnail!==""&&n.uint32(58).string(e.thumbnail),e.duration!==0&&n.uint32(64).int32(e.duration),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Ze();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.filename=t.string();continue;case 2:if(i!==16)break;a.size=t.int32();continue;case 3:if(i!==26)break;a.url=t.string();continue;case 4:if(i!==34)break;a.filetype=t.string();continue;case 5:if(i!==40)break;a.width=t.int32();continue;case 6:if(i!==48)break;a.height=t.int32();continue;case 7:if(i!==58)break;a.thumbnail=t.string();continue;case 8:if(i!==64)break;a.duration=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{filename:s(e.filename)?globalThis.String(e.filename):"",size:s(e.size)?globalThis.Number(e.size):0,url:s(e.url)?globalThis.String(e.url):"",filetype:s(e.filetype)?globalThis.String(e.filetype):"",width:s(e.width)?globalThis.Number(e.width):0,height:s(e.height)?globalThis.Number(e.height):0,thumbnail:s(e.thumbnail)?globalThis.String(e.thumbnail):"",duration:s(e.duration)?globalThis.Number(e.duration):0}},toJSON(e){let n={};return e.filename!==""&&(n.filename=e.filename),e.size!==0&&(n.size=Math.round(e.size)),e.url!==""&&(n.url=e.url),e.filetype!==""&&(n.filetype=e.filetype),e.width!==0&&(n.width=Math.round(e.width)),e.height!==0&&(n.height=Math.round(e.height)),e.thumbnail!==""&&(n.thumbnail=e.thumbnail),e.duration!==0&&(n.duration=Math.round(e.duration)),n},create(e){return v.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d;let n=Ze();return n.filename=(t=e.filename)!=null?t:"",n.size=(r=e.size)!=null?r:0,n.url=(a=e.url)!=null?a:"",n.filetype=(i=e.filetype)!=null?i:"",n.width=(o=e.width)!=null?o:0,n.height=(l=e.height)!=null?l:0,n.thumbnail=(c=e.thumbnail)!=null?c:"",n.duration=(d=e.duration)!=null?d:0,n}};function $e(){return{message_id:"0",message_ref_id:"0",content:"",has_attachment:!1,ref_type:0,message_sender_id:"0",message_sender_username:"",mesages_sender_avatar:"",message_sender_clan_nick:"",message_sender_display_name:""}}var U={encode(e,n=f.Writer.create()){return e.message_id!=="0"&&n.uint32(8).int64(e.message_id),e.message_ref_id!=="0"&&n.uint32(16).int64(e.message_ref_id),e.content!==""&&n.uint32(26).string(e.content),e.has_attachment!==!1&&n.uint32(32).bool(e.has_attachment),e.ref_type!==0&&n.uint32(40).int32(e.ref_type),e.message_sender_id!=="0"&&n.uint32(48).int64(e.message_sender_id),e.message_sender_username!==""&&n.uint32(58).string(e.message_sender_username),e.mesages_sender_avatar!==""&&n.uint32(66).string(e.mesages_sender_avatar),e.message_sender_clan_nick!==""&&n.uint32(74).string(e.message_sender_clan_nick),e.message_sender_display_name!==""&&n.uint32(82).string(e.message_sender_display_name),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=$e();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.message_id=m(t.int64());continue;case 2:if(i!==16)break;a.message_ref_id=m(t.int64());continue;case 3:if(i!==26)break;a.content=t.string();continue;case 4:if(i!==32)break;a.has_attachment=t.bool();continue;case 5:if(i!==40)break;a.ref_type=t.int32();continue;case 6:if(i!==48)break;a.message_sender_id=m(t.int64());continue;case 7:if(i!==58)break;a.message_sender_username=t.string();continue;case 8:if(i!==66)break;a.mesages_sender_avatar=t.string();continue;case 9:if(i!==74)break;a.message_sender_clan_nick=t.string();continue;case 10:if(i!==82)break;a.message_sender_display_name=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{message_id:s(e.message_id)?globalThis.String(e.message_id):"0",message_ref_id:s(e.message_ref_id)?globalThis.String(e.message_ref_id):"0",content:s(e.content)?globalThis.String(e.content):"",has_attachment:s(e.has_attachment)?globalThis.Boolean(e.has_attachment):!1,ref_type:s(e.ref_type)?globalThis.Number(e.ref_type):0,message_sender_id:s(e.message_sender_id)?globalThis.String(e.message_sender_id):"0",message_sender_username:s(e.message_sender_username)?globalThis.String(e.message_sender_username):"",mesages_sender_avatar:s(e.mesages_sender_avatar)?globalThis.String(e.mesages_sender_avatar):"",message_sender_clan_nick:s(e.message_sender_clan_nick)?globalThis.String(e.message_sender_clan_nick):"",message_sender_display_name:s(e.message_sender_display_name)?globalThis.String(e.message_sender_display_name):""}},toJSON(e){let n={};return e.message_id!=="0"&&(n.message_id=e.message_id),e.message_ref_id!=="0"&&(n.message_ref_id=e.message_ref_id),e.content!==""&&(n.content=e.content),e.has_attachment!==!1&&(n.has_attachment=e.has_attachment),e.ref_type!==0&&(n.ref_type=Math.round(e.ref_type)),e.message_sender_id!=="0"&&(n.message_sender_id=e.message_sender_id),e.message_sender_username!==""&&(n.message_sender_username=e.message_sender_username),e.mesages_sender_avatar!==""&&(n.mesages_sender_avatar=e.mesages_sender_avatar),e.message_sender_clan_nick!==""&&(n.message_sender_clan_nick=e.message_sender_clan_nick),e.message_sender_display_name!==""&&(n.message_sender_display_name=e.message_sender_display_name),n},create(e){return U.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p;let n=$e();return n.message_id=(t=e.message_id)!=null?t:"0",n.message_ref_id=(r=e.message_ref_id)!=null?r:"0",n.content=(a=e.content)!=null?a:"",n.has_attachment=(i=e.has_attachment)!=null?i:!1,n.ref_type=(o=e.ref_type)!=null?o:0,n.message_sender_id=(l=e.message_sender_id)!=null?l:"0",n.message_sender_username=(c=e.message_sender_username)!=null?c:"",n.mesages_sender_avatar=(d=e.mesages_sender_avatar)!=null?d:"",n.message_sender_clan_nick=(_=e.message_sender_clan_nick)!=null?_:"",n.message_sender_display_name=(p=e.message_sender_display_name)!=null?p:"",n}};function Qe(){return{attachments:[]}}var Me={encode(e,n=f.Writer.create()){for(let t of e.attachments)v.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Qe();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.attachments.push(v.decode(t,t.uint32()));continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{attachments:globalThis.Array.isArray(e==null?void 0:e.attachments)?e.attachments.map(n=>v.fromJSON(n)):[]}},toJSON(e){var t;let n={};return(t=e.attachments)!=null&&t.length&&(n.attachments=e.attachments.map(r=>v.toJSON(r))),n},create(e){return Me.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=Qe();return n.attachments=((t=e.attachments)==null?void 0:t.map(r=>v.fromPartial(r)))||[],n}};function re(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{let n=globalThis.atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;++r)t[r]=n.charCodeAt(r);return t}}function se(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{let n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function je(){return{filename:"",filetype:"",size:0,width:0,height:0}}var he={encode(e,n=f.Writer.create()){return e.filename!==""&&n.uint32(10).string(e.filename),e.filetype!==""&&n.uint32(18).string(e.filetype),e.size!==0&&n.uint32(24).int32(e.size),e.width!==0&&n.uint32(32).int32(e.width),e.height!==0&&n.uint32(40).int32(e.height),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=je();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.filename=t.string();continue;case 2:if(i!==18)break;a.filetype=t.string();continue;case 3:if(i!==24)break;a.size=t.int32();continue;case 4:if(i!==32)break;a.width=t.int32();continue;case 5:if(i!==40)break;a.height=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{filename:s(e.filename)?globalThis.String(e.filename):"",filetype:s(e.filetype)?globalThis.String(e.filetype):"",size:s(e.size)?globalThis.Number(e.size):0,width:s(e.width)?globalThis.Number(e.width):0,height:s(e.height)?globalThis.Number(e.height):0}},toJSON(e){let n={};return e.filename!==""&&(n.filename=e.filename),e.filetype!==""&&(n.filetype=e.filetype),e.size!==0&&(n.size=Math.round(e.size)),e.width!==0&&(n.width=Math.round(e.width)),e.height!==0&&(n.height=Math.round(e.height)),n},create(e){return he.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o;let n=je();return n.filename=(t=e.filename)!=null?t:"",n.filetype=(r=e.filetype)!=null?r:"",n.size=(a=e.size)!=null?a:0,n.width=(i=e.width)!=null?i:0,n.height=(o=e.height)!=null?o:0,n}};function en(){return{filename:"",url:""}}var Ie={encode(e,n=f.Writer.create()){return e.filename!==""&&n.uint32(10).string(e.filename),e.url!==""&&n.uint32(18).string(e.url),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=en();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.filename=t.string();continue;case 2:if(i!==18)break;a.url=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{filename:s(e.filename)?globalThis.String(e.filename):"",url:s(e.url)?globalThis.String(e.url):""}},toJSON(e){let n={};return e.filename!==""&&(n.filename=e.filename),e.url!==""&&(n.url=e.url),n},create(e){return Ie.fromPartial(e!=null?e:{})},fromPartial(e){var t,r;let n=en();return n.filename=(t=e.filename)!=null?t:"",n.url=(r=e.url)!=null?r:"",n}};function oe(e,n,t){let r=ke({method:e},n);if(r.headers=ke({},n.headers),typeof XMLHttpRequest!="undefined"){let a=Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype,"withCredentials");a!=null&&a.set||(r.credentials="cocos-ignore")}return Object.keys(r.headers).includes("Accept")||(r.headers.Accept="application/proto"),Object.keys(r.headers).includes("Content-Type")||(r.headers["Content-Type"]="application/proto"),Object.keys(r.headers).forEach(a=>{r.headers[a]||delete r.headers[a]}),t&&(r.body=t),r}function pe(e){if(e==null)return{t:e};let n;if(e instanceof Uint8Array)n=new TextDecoder().decode(e);else if(typeof e=="string")n=e;else return typeof e=="object"?e:{t:e};if(!n||n===""||n==="[]")return{t:n};try{return JSON.parse(n)}catch(t){try{let r=n.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(r)}catch(r){return console.error("JSON Parse failed completely:",{original:n,error:r}),{t:n}}}}var An=e=>!e||e===null||e===void 0||e===""||e==="[]";function tn(e){if(An(e))return;let n=e[0];if(n===91||n===123)return pe(e);try{let r=e,a=new Uint8Array(r);return Me.decode(a)}catch(r){return pe(e)}}import{encode as an}from"js-base64";var le=class{constructor(n,t,r){this.serverKey=n;this.timeoutMs=t;this.basePath=r}setBasePath(n){this.basePath=n}authenticateIdToken(n,t,r,a={}){if(r==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/v2/account/authenticate/idtoken",o=new Map,l="";l=JSON.stringify(r||{});let c=this.buildFullUrl(this.basePath,i,o),d=oe("POST",a,l);return n&&(d.headers.Authorization="Basic "+an(n+":"+t)),Promise.race([fetch(c,d).then(_=>{if(_.status==204)return _;if(_.status>=200&&_.status<300)return _.json();throw _}),new Promise((_,p)=>setTimeout(p,this.timeoutMs,"Request timed out."))])}sessionRefresh(n,t,r,a={}){if(r==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SessionRefresh",o=new Map,c=ue.encode(ue.fromPartial(r)).finish(),d=this.buildFullUrl(this.basePath,i,o),_=oe("POST",a,"");return _.body=c,n&&(_.headers.Authorization="Basic "+an(n+":"+t)),Promise.race([fetch(d,_).then(p=>g(this,null,function*(){if(p.status==204)return{};if(p.status>=200&&p.status<300){let y=yield p.arrayBuffer();return Ae.decode(new Uint8Array(y))}else throw p})),new Promise((p,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(n,t,r={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateChannelDesc",i=new Map,l=fe.encode(fe.fromPartial(t)).finish(),c=this.buildFullUrl(this.basePath,a,i),d=oe("POST",r,"");return d.body=l,n&&(d.headers.Authorization="Bearer "+n),Promise.race([fetch(c,d).then(_=>g(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let p=yield _.arrayBuffer();return xe.decode(new Uint8Array(p))}else throw _})),new Promise((_,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(n,t,r={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UploadAttachmentFile",i=new Map,l=he.encode(he.fromPartial(t)).finish(),c=this.buildFullUrl(this.basePath,a,i),d=oe("POST",r,"");return d.body=l,n&&(d.headers.Authorization="Bearer "+n),Promise.race([fetch(c,d).then(_=>g(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let p=yield _.arrayBuffer();return Ie.decode(new Uint8Array(p))}else throw _})),new Promise((_,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}buildFullUrl(n,t,r){let a=n+t+"?";for(let[i,o]of r)o instanceof Array?a+=o.reduce((l,c)=>l+encodeURIComponent(i)+"="+encodeURIComponent(c)+"&",""):o!=null&&(a+=encodeURIComponent(i)+"="+encodeURIComponent(o)+"&");return a}};import cn from"long";import h from"protobufjs/minimal";import rn from"long";import E from"protobufjs/minimal";function sn(){return{value:!1}}var me={encode(e,n=E.Writer.create()){return e.value!==!1&&n.uint32(8).bool(e.value),n},decode(e,n){let t=e instanceof E.Reader?e:E.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=sn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.value=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{value:ln(e.value)?globalThis.Boolean(e.value):!1}},toJSON(e){let n={};return e.value!==!1&&(n.value=e.value),n},create(e){return me.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=sn();return n.value=(t=e.value)!=null?t:!1,n}};function on(){return{value:""}}var ge={encode(e,n=E.Writer.create()){return e.value!==""&&n.uint32(10).string(e.value),n},decode(e,n){let t=e instanceof E.Reader?e:E.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=on();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.value=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{value:ln(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.value!==""&&(n.value=e.value),n},create(e){return ge.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=on();return n.value=(t=e.value)!=null?t:"",n}};E.util.Long!==rn&&(E.util.Long=rn,E.configure());function ln(e){return e!=null}function dn(){return{cid:"",channel:void 0,channel_join:void 0,channel_leave:void 0,channel_message:void 0,channel_message_ack:void 0,channel_message_send:void 0,error:void 0,ping:void 0,pong:void 0}}var ce={encode(e,n=h.Writer.create()){return e.cid!==""&&n.uint32(10).string(e.cid),e.channel!==void 0&&H.encode(e.channel,n.uint32(18).fork()).ldelim(),e.channel_join!==void 0&&w.encode(e.channel_join,n.uint32(34).fork()).ldelim(),e.channel_leave!==void 0&&q.encode(e.channel_leave,n.uint32(42).fork()).ldelim(),e.channel_message!==void 0&&O.encode(e.channel_message,n.uint32(50).fork()).ldelim(),e.channel_message_ack!==void 0&&V.encode(e.channel_message_ack,n.uint32(58).fork()).ldelim(),e.channel_message_send!==void 0&&z.encode(e.channel_message_send,n.uint32(66).fork()).ldelim(),e.error!==void 0&&F.encode(e.error,n.uint32(98).fork()).ldelim(),e.ping!==void 0&&K.encode(e.ping,n.uint32(178).fork()).ldelim(),e.pong!==void 0&&Y.encode(e.pong,n.uint32(186).fork()).ldelim(),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=dn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.cid=t.string();continue;case 2:if(i!==18)break;a.channel=H.decode(t,t.uint32());continue;case 4:if(i!==34)break;a.channel_join=w.decode(t,t.uint32());continue;case 5:if(i!==42)break;a.channel_leave=q.decode(t,t.uint32());continue;case 6:if(i!==50)break;a.channel_message=O.decode(t,t.uint32());continue;case 7:if(i!==58)break;a.channel_message_ack=V.decode(t,t.uint32());continue;case 8:if(i!==66)break;a.channel_message_send=z.decode(t,t.uint32());continue;case 12:if(i!==98)break;a.error=F.decode(t,t.uint32());continue;case 22:if(i!==178)break;a.ping=K.decode(t,t.uint32());continue;case 23:if(i!==186)break;a.pong=Y.decode(t,t.uint32());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{cid:u(e.cid)?globalThis.String(e.cid):"",channel:u(e.channel)?H.fromJSON(e.channel):void 0,channel_join:u(e.channel_join)?w.fromJSON(e.channel_join):void 0,channel_leave:u(e.channel_leave)?q.fromJSON(e.channel_leave):void 0,channel_message:u(e.channel_message)?O.fromJSON(e.channel_message):void 0,channel_message_ack:u(e.channel_message_ack)?V.fromJSON(e.channel_message_ack):void 0,channel_message_send:u(e.channel_message_send)?z.fromJSON(e.channel_message_send):void 0,error:u(e.error)?F.fromJSON(e.error):void 0,ping:u(e.ping)?K.fromJSON(e.ping):void 0,pong:u(e.pong)?Y.fromJSON(e.pong):void 0}},toJSON(e){let n={};return e.cid!==""&&(n.cid=e.cid),e.channel!==void 0&&(n.channel=H.toJSON(e.channel)),e.channel_join!==void 0&&(n.channel_join=w.toJSON(e.channel_join)),e.channel_leave!==void 0&&(n.channel_leave=q.toJSON(e.channel_leave)),e.channel_message!==void 0&&(n.channel_message=O.toJSON(e.channel_message)),e.channel_message_ack!==void 0&&(n.channel_message_ack=V.toJSON(e.channel_message_ack)),e.channel_message_send!==void 0&&(n.channel_message_send=z.toJSON(e.channel_message_send)),e.error!==void 0&&(n.error=F.toJSON(e.error)),e.ping!==void 0&&(n.ping=K.toJSON(e.ping)),e.pong!==void 0&&(n.pong=Y.toJSON(e.pong)),n},create(e){return ce.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=dn();return n.cid=(t=e.cid)!=null?t:"",n.channel=e.channel!==void 0&&e.channel!==null?H.fromPartial(e.channel):void 0,n.channel_join=e.channel_join!==void 0&&e.channel_join!==null?w.fromPartial(e.channel_join):void 0,n.channel_leave=e.channel_leave!==void 0&&e.channel_leave!==null?q.fromPartial(e.channel_leave):void 0,n.channel_message=e.channel_message!==void 0&&e.channel_message!==null?O.fromPartial(e.channel_message):void 0,n.channel_message_ack=e.channel_message_ack!==void 0&&e.channel_message_ack!==null?V.fromPartial(e.channel_message_ack):void 0,n.channel_message_send=e.channel_message_send!==void 0&&e.channel_message_send!==null?z.fromPartial(e.channel_message_send):void 0,n.error=e.error!==void 0&&e.error!==null?F.fromPartial(e.error):void 0,n.ping=e.ping!==void 0&&e.ping!==null?K.fromPartial(e.ping):void 0,n.pong=e.pong!==void 0&&e.pong!==null?Y.fromPartial(e.pong):void 0,n}};function _n(){return{id:"0",presences:[],self:void 0,chanel_label:"",clan_logo:"",category_name:""}}var H={encode(e,n=h.Writer.create()){e.id!=="0"&&n.uint32(8).int64(e.id);for(let t of e.presences)b.encode(t,n.uint32(18).fork()).ldelim();return e.self!==void 0&&b.encode(e.self,n.uint32(26).fork()).ldelim(),e.chanel_label!==""&&n.uint32(34).string(e.chanel_label),e.clan_logo!==""&&n.uint32(42).string(e.clan_logo),e.category_name!==""&&n.uint32(50).string(e.category_name),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=_n();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.id=T(t.int64());continue;case 2:if(i!==18)break;a.presences.push(b.decode(t,t.uint32()));continue;case 3:if(i!==26)break;a.self=b.decode(t,t.uint32());continue;case 4:if(i!==34)break;a.chanel_label=t.string();continue;case 5:if(i!==42)break;a.clan_logo=t.string();continue;case 6:if(i!==50)break;a.category_name=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{id:u(e.id)?globalThis.String(e.id):"0",presences:globalThis.Array.isArray(e==null?void 0:e.presences)?e.presences.map(n=>b.fromJSON(n)):[],self:u(e.self)?b.fromJSON(e.self):void 0,chanel_label:u(e.chanel_label)?globalThis.String(e.chanel_label):"",clan_logo:u(e.clan_logo)?globalThis.String(e.clan_logo):"",category_name:u(e.category_name)?globalThis.String(e.category_name):""}},toJSON(e){var t;let n={};return e.id!=="0"&&(n.id=e.id),(t=e.presences)!=null&&t.length&&(n.presences=e.presences.map(r=>b.toJSON(r))),e.self!==void 0&&(n.self=b.toJSON(e.self)),e.chanel_label!==""&&(n.chanel_label=e.chanel_label),e.clan_logo!==""&&(n.clan_logo=e.clan_logo),e.category_name!==""&&(n.category_name=e.category_name),n},create(e){return H.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o;let n=_n();return n.id=(t=e.id)!=null?t:"0",n.presences=((r=e.presences)==null?void 0:r.map(l=>b.fromPartial(l)))||[],n.self=e.self!==void 0&&e.self!==null?b.fromPartial(e.self):void 0,n.chanel_label=(a=e.chanel_label)!=null?a:"",n.clan_logo=(i=e.clan_logo)!=null?i:"",n.category_name=(o=e.category_name)!=null?o:"",n}};function un(){return{clan_id:"0",channel_id:"0",channel_type:0,is_public:!1}}var w={encode(e,n=h.Writer.create()){return e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.channel_type!==0&&n.uint32(24).int32(e.channel_type),e.is_public!==!1&&n.uint32(32).bool(e.is_public),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=un();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=T(t.int64());continue;case 2:if(i!==16)break;a.channel_id=T(t.int64());continue;case 3:if(i!==24)break;a.channel_type=t.int32();continue;case 4:if(i!==32)break;a.is_public=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:u(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",channel_type:u(e.channel_type)?globalThis.Number(e.channel_type):0,is_public:u(e.is_public)?globalThis.Boolean(e.is_public):!1}},toJSON(e){let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.channel_type!==0&&(n.channel_type=Math.round(e.channel_type)),e.is_public!==!1&&(n.is_public=e.is_public),n},create(e){return w.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i;let n=un();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.channel_type=(a=e.channel_type)!=null?a:0,n.is_public=(i=e.is_public)!=null?i:!1,n}};function fn(){return{clan_id:"0",channel_id:"0",channel_type:0,is_public:!1}}var q={encode(e,n=h.Writer.create()){return e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.channel_type!==0&&n.uint32(24).int32(e.channel_type),e.is_public!==!1&&n.uint32(32).bool(e.is_public),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=fn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=T(t.int64());continue;case 2:if(i!==16)break;a.channel_id=T(t.int64());continue;case 3:if(i!==24)break;a.channel_type=t.int32();continue;case 4:if(i!==32)break;a.is_public=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:u(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",channel_type:u(e.channel_type)?globalThis.Number(e.channel_type):0,is_public:u(e.is_public)?globalThis.Boolean(e.is_public):!1}},toJSON(e){let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.channel_type!==0&&(n.channel_type=Math.round(e.channel_type)),e.is_public!==!1&&(n.is_public=e.is_public),n},create(e){return q.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i;let n=fn();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.channel_type=(a=e.channel_type)!=null?a:0,n.is_public=(i=e.is_public)!=null?i:!1,n}};function hn(){return{channel_id:"0",message_id:"0",code:0,username:"",create_time_seconds:0,update_time_seconds:0,persistent:void 0,clan_logo:"",category_name:""}}var V={encode(e,n=h.Writer.create()){return e.channel_id!=="0"&&n.uint32(8).int64(e.channel_id),e.message_id!=="0"&&n.uint32(16).int64(e.message_id),e.code!==0&&n.uint32(24).int32(e.code),e.username!==""&&n.uint32(34).string(e.username),e.create_time_seconds!==0&&n.uint32(40).uint32(e.create_time_seconds),e.update_time_seconds!==0&&n.uint32(48).uint32(e.update_time_seconds),e.persistent!==void 0&&me.encode({value:e.persistent},n.uint32(58).fork()).ldelim(),e.clan_logo!==""&&n.uint32(66).string(e.clan_logo),e.category_name!==""&&n.uint32(74).string(e.category_name),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=hn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.channel_id=T(t.int64());continue;case 2:if(i!==16)break;a.message_id=T(t.int64());continue;case 3:if(i!==24)break;a.code=t.int32();continue;case 4:if(i!==34)break;a.username=t.string();continue;case 5:if(i!==40)break;a.create_time_seconds=t.uint32();continue;case 6:if(i!==48)break;a.update_time_seconds=t.uint32();continue;case 7:if(i!==58)break;a.persistent=me.decode(t,t.uint32()).value;continue;case 8:if(i!==66)break;a.clan_logo=t.string();continue;case 9:if(i!==74)break;a.category_name=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",message_id:u(e.message_id)?globalThis.String(e.message_id):"0",code:u(e.code)?globalThis.Number(e.code):0,username:u(e.username)?globalThis.String(e.username):"",create_time_seconds:u(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,update_time_seconds:u(e.update_time_seconds)?globalThis.Number(e.update_time_seconds):0,persistent:u(e.persistent)?!!e.persistent:void 0,clan_logo:u(e.clan_logo)?globalThis.String(e.clan_logo):"",category_name:u(e.category_name)?globalThis.String(e.category_name):""}},toJSON(e){let n={};return e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.message_id!=="0"&&(n.message_id=e.message_id),e.code!==0&&(n.code=Math.round(e.code)),e.username!==""&&(n.username=e.username),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.update_time_seconds!==0&&(n.update_time_seconds=Math.round(e.update_time_seconds)),e.persistent!==void 0&&(n.persistent=e.persistent),e.clan_logo!==""&&(n.clan_logo=e.clan_logo),e.category_name!==""&&(n.category_name=e.category_name),n},create(e){return V.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_;let n=hn();return n.channel_id=(t=e.channel_id)!=null?t:"0",n.message_id=(r=e.message_id)!=null?r:"0",n.code=(a=e.code)!=null?a:0,n.username=(i=e.username)!=null?i:"",n.create_time_seconds=(o=e.create_time_seconds)!=null?o:0,n.update_time_seconds=(l=e.update_time_seconds)!=null?l:0,n.persistent=(c=e.persistent)!=null?c:void 0,n.clan_logo=(d=e.clan_logo)!=null?d:"",n.category_name=(_=e.category_name)!=null?_:"",n}};function pn(){return{clan_id:"0",channel_id:"0",content:"",mentions:[],attachments:[],references:[],mode:0,anonymous_message:!1,mention_everyone:!1,avatar:"",is_public:!1,code:0,topic_id:"0",id:"0"}}var z={encode(e,n=h.Writer.create()){e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.content!==""&&n.uint32(26).string(e.content);for(let t of e.mentions)D.encode(t,n.uint32(34).fork()).ldelim();for(let t of e.attachments)v.encode(t,n.uint32(42).fork()).ldelim();for(let t of e.references)U.encode(t,n.uint32(50).fork()).ldelim();return e.mode!==0&&n.uint32(56).int32(e.mode),e.anonymous_message!==!1&&n.uint32(64).bool(e.anonymous_message),e.mention_everyone!==!1&&n.uint32(72).bool(e.mention_everyone),e.avatar!==""&&n.uint32(82).string(e.avatar),e.is_public!==!1&&n.uint32(88).bool(e.is_public),e.code!==0&&n.uint32(96).int32(e.code),e.topic_id!=="0"&&n.uint32(104).int64(e.topic_id),e.id!=="0"&&n.uint32(112).int64(e.id),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=pn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=T(t.int64());continue;case 2:if(i!==16)break;a.channel_id=T(t.int64());continue;case 3:if(i!==26)break;a.content=t.string();continue;case 4:if(i!==34)break;a.mentions.push(D.decode(t,t.uint32()));continue;case 5:if(i!==42)break;a.attachments.push(v.decode(t,t.uint32()));continue;case 6:if(i!==50)break;a.references.push(U.decode(t,t.uint32()));continue;case 7:if(i!==56)break;a.mode=t.int32();continue;case 8:if(i!==64)break;a.anonymous_message=t.bool();continue;case 9:if(i!==72)break;a.mention_everyone=t.bool();continue;case 10:if(i!==82)break;a.avatar=t.string();continue;case 11:if(i!==88)break;a.is_public=t.bool();continue;case 12:if(i!==96)break;a.code=t.int32();continue;case 13:if(i!==104)break;a.topic_id=T(t.int64());continue;case 14:if(i!==112)break;a.id=T(t.int64());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:u(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",content:u(e.content)?globalThis.String(e.content):"",mentions:globalThis.Array.isArray(e==null?void 0:e.mentions)?e.mentions.map(n=>D.fromJSON(n)):[],attachments:globalThis.Array.isArray(e==null?void 0:e.attachments)?e.attachments.map(n=>v.fromJSON(n)):[],references:globalThis.Array.isArray(e==null?void 0:e.references)?e.references.map(n=>U.fromJSON(n)):[],mode:u(e.mode)?globalThis.Number(e.mode):0,anonymous_message:u(e.anonymous_message)?globalThis.Boolean(e.anonymous_message):!1,mention_everyone:u(e.mention_everyone)?globalThis.Boolean(e.mention_everyone):!1,avatar:u(e.avatar)?globalThis.String(e.avatar):"",is_public:u(e.is_public)?globalThis.Boolean(e.is_public):!1,code:u(e.code)?globalThis.Number(e.code):0,topic_id:u(e.topic_id)?globalThis.String(e.topic_id):"0",id:u(e.id)?globalThis.String(e.id):"0"}},toJSON(e){var t,r,a;let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.content!==""&&(n.content=e.content),(t=e.mentions)!=null&&t.length&&(n.mentions=e.mentions.map(i=>D.toJSON(i))),(r=e.attachments)!=null&&r.length&&(n.attachments=e.attachments.map(i=>v.toJSON(i))),(a=e.references)!=null&&a.length&&(n.references=e.references.map(i=>U.toJSON(i))),e.mode!==0&&(n.mode=Math.round(e.mode)),e.anonymous_message!==!1&&(n.anonymous_message=e.anonymous_message),e.mention_everyone!==!1&&(n.mention_everyone=e.mention_everyone),e.avatar!==""&&(n.avatar=e.avatar),e.is_public!==!1&&(n.is_public=e.is_public),e.code!==0&&(n.code=Math.round(e.code)),e.topic_id!=="0"&&(n.topic_id=e.topic_id),e.id!=="0"&&(n.id=e.id),n},create(e){return z.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p,y,x,M,I;let n=pn();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.content=(a=e.content)!=null?a:"",n.mentions=((i=e.mentions)==null?void 0:i.map(C=>D.fromPartial(C)))||[],n.attachments=((o=e.attachments)==null?void 0:o.map(C=>v.fromPartial(C)))||[],n.references=((l=e.references)==null?void 0:l.map(C=>U.fromPartial(C)))||[],n.mode=(c=e.mode)!=null?c:0,n.anonymous_message=(d=e.anonymous_message)!=null?d:!1,n.mention_everyone=(_=e.mention_everyone)!=null?_:!1,n.avatar=(p=e.avatar)!=null?p:"",n.is_public=(y=e.is_public)!=null?y:!1,n.code=(x=e.code)!=null?x:0,n.topic_id=(M=e.topic_id)!=null?M:"0",n.id=(I=e.id)!=null?I:"0",n}};function mn(){return{code:0,message:"",context:{}}}var F={encode(e,n=h.Writer.create()){return e.code!==0&&n.uint32(8).int32(e.code),e.message!==""&&n.uint32(18).string(e.message),Object.entries(e.context).forEach(([t,r])=>{Ne.encode({key:t,value:r},n.uint32(26).fork()).ldelim()}),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=mn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.code=t.int32();continue;case 2:if(i!==18)break;a.message=t.string();continue;case 3:if(i!==26)break;let o=Ne.decode(t,t.uint32());o.value!==void 0&&(a.context[o.key]=o.value);continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{code:u(e.code)?globalThis.Number(e.code):0,message:u(e.message)?globalThis.String(e.message):"",context:xn(e.context)?Object.entries(e.context).reduce((n,[t,r])=>(n[t]=String(r),n),{}):{}}},toJSON(e){let n={};if(e.code!==0&&(n.code=Math.round(e.code)),e.message!==""&&(n.message=e.message),e.context){let t=Object.entries(e.context);t.length>0&&(n.context={},t.forEach(([r,a])=>{n.context[r]=a}))}return n},create(e){return F.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a;let n=mn();return n.code=(t=e.code)!=null?t:0,n.message=(r=e.message)!=null?r:"",n.context=Object.entries((a=e.context)!=null?a:{}).reduce((i,[o,l])=>(l!==void 0&&(i[o]=globalThis.String(l)),i),{}),n}};function gn(){return{key:"",value:""}}var Ne={encode(e,n=h.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=gn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.key=t.string();continue;case 2:if(i!==18)break;a.value=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{key:u(e.key)?globalThis.String(e.key):"",value:u(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Ne.fromPartial(e!=null?e:{})},fromPartial(e){var t,r;let n=gn();return n.key=(t=e.key)!=null?t:"",n.value=(r=e.value)!=null?r:"",n}};function yn(){return{}}var K={encode(e,n=h.Writer.create()){return n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=yn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return K.fromPartial(e!=null?e:{})},fromPartial(e){return yn()}};function kn(){return{}}var Y={encode(e,n=h.Writer.create()){return n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=kn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return Y.fromPartial(e!=null?e:{})},fromPartial(e){return kn()}};function Sn(){return{user_id:"0",session_id:"",username:"",status:void 0,is_mobile:!1,user_status:""}}var b={encode(e,n=h.Writer.create()){return e.user_id!=="0"&&n.uint32(8).int64(e.user_id),e.session_id!==""&&n.uint32(18).string(e.session_id),e.username!==""&&n.uint32(26).string(e.username),e.status!==void 0&&ge.encode({value:e.status},n.uint32(34).fork()).ldelim(),e.is_mobile!==!1&&n.uint32(40).bool(e.is_mobile),e.user_status!==""&&n.uint32(50).string(e.user_status),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Sn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.user_id=T(t.int64());continue;case 2:if(i!==18)break;a.session_id=t.string();continue;case 3:if(i!==26)break;a.username=t.string();continue;case 4:if(i!==34)break;a.status=ge.decode(t,t.uint32()).value;continue;case 5:if(i!==40)break;a.is_mobile=t.bool();continue;case 6:if(i!==50)break;a.user_status=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{user_id:u(e.user_id)?globalThis.String(e.user_id):"0",session_id:u(e.session_id)?globalThis.String(e.session_id):"",username:u(e.username)?globalThis.String(e.username):"",status:u(e.status)?String(e.status):void 0,is_mobile:u(e.is_mobile)?globalThis.Boolean(e.is_mobile):!1,user_status:u(e.user_status)?globalThis.String(e.user_status):""}},toJSON(e){let n={};return e.user_id!=="0"&&(n.user_id=e.user_id),e.session_id!==""&&(n.session_id=e.session_id),e.username!==""&&(n.username=e.username),e.status!==void 0&&(n.status=e.status),e.is_mobile!==!1&&(n.is_mobile=e.is_mobile),e.user_status!==""&&(n.user_status=e.user_status),n},create(e){return b.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l;let n=Sn();return n.user_id=(t=e.user_id)!=null?t:"0",n.session_id=(r=e.session_id)!=null?r:"",n.username=(a=e.username)!=null?a:"",n.status=(i=e.status)!=null?i:void 0,n.is_mobile=(o=e.is_mobile)!=null?o:!1,n.user_status=(l=e.user_status)!=null?l:"",n}};function T(e){return e.toString()}h.util.Long!==cn&&(h.util.Long=cn,h.configure());function xn(e){return typeof e=="object"&&e!==null}function u(e){return e!=null}var R=class{constructor(){}get onClose(){return this._socket.onclose}set onClose(n){this._socket.onclose=n}get onError(){return this._socket.onerror}set onError(n){this._socket.onerror=n}get onMessage(){return this._socket.onmessage}set onMessage(n){n?this._socket.onmessage=t=>{let r=t.data,a=new Uint8Array(r),i=ce.decode(a);i.channel_message&&i.channel_message.code==null&&(i.channel_message.code=0),n(i)}:n=null}get onOpen(){return this._socket.onopen}set onOpen(n){this._socket.onopen=n}isOpen(){var n;return((n=this._socket)==null?void 0:n.readyState)==WebSocket.OPEN}close(){var n;(n=this._socket)==null||n.close(),this._socket=void 0}connect(n,t,r,a,i,o,l){l&&l.addEventListener("abort",()=>{this.close()});let c=r?`:${r}`:"",d=`${n}${t}${c}/ws?lang=en&status=${encodeURIComponent(a.toString())}&token=${encodeURIComponent(i)}&format=protobuf&platform=${encodeURIComponent(o)}`;this._socket=new WebSocket(d),this._socket.binaryType="arraybuffer"}send(n){let r=ce.encode(ce.fromPartial(n)).finish();this._socket.send(r)}};var vn=!1,k={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},A=class A{constructor(n,t,r=!1,a=!1,i=new R,o=A.DefaultSendTimeoutMs){this.host=n;this.port=t;this.useSSL=r;this.verbose=a;this.adapter=i;this.sendTimeoutMs=o;this.cIds={},this.nextCid=1,this._heartbeatTimeoutMs=A.DefaultHeartbeatTimeoutMs,this._connectionState=k.DISCONNECTED}generatecid(){let n=this.nextCid.toString();return++this.nextCid,n}isOpen(){return this._connectionState===k.CONNECTED}connect(n,t=!1,r="",a=A.DefaultConnectTimeoutMs,i){if(this._connectionState===k.CONNECTED)return Promise.resolve(n);if(this._connectionState===k.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=k.CONNECTING;let o=this.useSSL?"wss://":"ws://";this.adapter.connect(o,this.host,this.port,t,n.token,r,i),this.adapter.onClose=c=>{this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(c)},this.adapter.onMessage=c=>g(this,null,function*(){if(this.verbose&&window&&window.console&&console.log("Response: %o",JSON.stringify(c)),c.cid){let d=this.cIds[c.cid];if(!d){this.verbose&&window&&window.console&&console.error("No promise executor for message: %o",c);return}delete this.cIds[c.cid],c.error?d.reject(c.error):d.resolve(c)}else if(c.channel_message){let d=In(c);this.onchannelmessage(d)}else this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",c)});let l=new Promise((c,d)=>{this.adapter.onOpen=_=>{this.verbose&&window&&window.console&&console.log(_);let p=vn;vn=!0,this.clearConnectTimeout(),this._connectionState=k.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,c(n),p&&this.onreconnect(_)},this.adapter.onError=_=>{this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(_),this._connectPromise=void 0,this.adapter.close(),d(_)},this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.close(),this._connectPromise=void 0,d("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},a)});return this._connectPromise=l,this._connectPromise}disconnect(n=!0){this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.isOpen()&&this.adapter.close(),n&&this.ondisconnect({})}setHeartbeatTimeoutMs(n){this._heartbeatTimeoutMs=n}getHeartbeatTimeoutMs(){return this._heartbeatTimeoutMs}onreconnect(n){this.verbose&&window&&window.console&&console.log(n)}ondisconnect(n){this.verbose&&window&&window.console&&console.log(n)}onerror(n){this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.verbose&&window&&window.console&&console.log(n)}onheartbeattimeout(){this.verbose&&window&&window.console&&console.log("Heartbeat timeout.")}onchannelmessage(n){this.verbose&&window&&window.console&&console.log(n)}send(n,t=A.DefaultSendTimeoutMs){let r=n;return new Promise((a,i)=>{var o,l;if(!this.adapter.isOpen())i("Socket connection has not been established yet.");else{r.channel_message_send?r.channel_message_send.content=JSON.stringify(r.channel_message_send.content):r.channel_message_update?r.channel_message_update.content=JSON.stringify(r.channel_message_update.content):r.ephemeral_message_send?r.ephemeral_message_send.message.content=JSON.stringify((o=r.ephemeral_message_send.message)==null?void 0:o.content):r.quick_menu_event&&(r.quick_menu_event.message.content=JSON.stringify((l=r.quick_menu_event.message)==null?void 0:l.content));let c=this.generatecid();this.cIds[c]={resolve:a,reject:i},t!==1/0&&t>0&&setTimeout(()=>{i("The socket timed out while waiting for a response.")},t),r.cid=c,this.adapter.send(r)}})}joinChat(n,t,r,a){return g(this,null,function*(){return(yield this.send({channel_join:{clan_id:n,channel_id:t,channel_type:r,is_public:a}})).channel})}leaveChat(n,t,r,a){return g(this,null,function*(){return this.send({channel_leave:{clan_id:n,channel_id:t,channel_type:r,is_public:a}})})}writeChatMessage(n,t,r,a,i,o,l,c,d,_,p){return g(this,null,function*(){return(yield this.send({channel_message_send:{clan_id:n,channel_id:t,mode:r,is_public:a,content:i,reactions:[],mentions:[],attachments:o,references:[],anonymous_message:l,mention_everyone:c,avatar:d,code:_,topic_id:p}},1/0)).channel_message_ack})}pingPong(){return g(this,null,function*(){if(!this.isOpen()){this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop();return}try{yield this.send({ping:{}},this._heartbeatTimeoutMs)}catch(n){this._connectionState=k.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)}};A.DefaultHeartbeatTimeoutMs=1e4,A.DefaultSendTimeoutMs=1e4,A.DefaultConnectTimeoutMs=3e4;var de=A;function In(e){var n,t;try{n=pe(e.channel_message.content)}catch(a){console.log("content is invalid",a)}try{t=tn(e.channel_message.attachments)}catch(a){console.log("attachments is invalid",a)}var r={id:e.id||e.channel_message.message_id,avatar:e.channel_message.avatar,channel_id:e.channel_message.channel_id,mode:e.channel_message.mode,channel_label:e.channel_message.channel_label,clan_id:e.channel_message.clan_id,code:e.channel_message.code,message_id:e.channel_message.message_id,sender_id:e.channel_message.sender_id,update_time:e.channel_message.update_time,clan_logo:e.channel_message.clan_logo,category_name:e.channel_message.category_name,username:e.channel_message.username,clan_nick:e.channel_message.clan_nick,clan_avatar:e.channel_message.clan_avatar,display_name:e.channel_message.display_name,content:n,attachments:t==null?void 0:t.attachments,hide_editted:e.channel_message.hide_editted,is_public:e.channel_message.is_public,create_time_seconds:e.channel_message.create_time_seconds,update_time_seconds:e.channel_message.update_time_seconds,topic_id:e.channel_message.topic_id};return r}var _e=class extends Error{constructor(t,r){super(t!=null?t:"Authentication failed.");this.statusCode=r;this.name="AuthenticationError"}},ye=class extends Error{constructor(n){super(n!=null?n:"Session error."),this.name="SessionError"}};function Re(e){let n=new URL(e);return`${n.protocol==="https:"?"https://":"http://"}${n.hostname}:${n.port}`}var Oe=class e{constructor(n,t,r){this.refreshTokenPromise=null;this._session=n,this._client=t,this._userId=r}get userId(){return this._userId}get session(){return this._session}get client(){return this._client}static initClient(n){let{token:t,refresh_token:r,api_url:a,ws_url:i,user_id:o,serverkey:l}=n;if(!t||!r||!a||!i||!o)throw new ye("Missing required fields: token, refresh_token, api_url, ws_url, and user_id are all required");let c=ae.restore(t,r,a,i,!0),d=new le(l||B,7e3,Re(a));return new e(c,d,o)}static authenticate(n){return g(this,null,function*(){let{id_token:t,user_id:r,username:a,serverkey:i=B,gateway_url:o=Se}=n,l=new le(i||B,7e3,Re(o)),c={id_token:t,user_id:r,username:a},d=yield l.authenticateIdToken(i,"",c);if(!d)throw new _e("Authentication failed: No response from server.");if(!d.token||!d.refresh_token||!d.api_url||!d.ws_url||!d.user_id)throw new _e("Invalid authentication response: missing required fields");let _=ae.restore(d.token,d.refresh_token,d.api_url,d.ws_url,!0);return l.setBasePath(Re(d.api_url)),new e(_,l,d.user_id)})}createDM(n){return g(this,null,function*(){let t={type:3,channel_private:1,user_ids:[n]};return this._client.createChannelDesc(this._session.token,t)})}createGroupDM(n){return g(this,null,function*(){if(n.length===0)throw new Error("At least one user ID is required for a group DM");let t={type:2,channel_private:1,user_ids:n};return this._client.createChannelDesc(this._session.token,t)})}uploadAttachment(n){return g(this,null,function*(){return this._client.uploadAttachmentFile(this._session.token,n)})}refreshSession(){return g(this,null,function*(){return this._session?(this._session.created&&this._session.expires_at-this._session.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"),this._session.created&&this._session.refresh_expires_at-this._session.created_at<3700&&console.warn("Session refresh lifetime too short, please set '--session.refresh_token_expiry_sec' option. See the documentation for more info: https://mezon.vn/docs/mezon/getting-started/configuration/#session"),this.refreshTokenPromise?this.refreshTokenPromise:(this.refreshTokenPromise=new Promise((n,t)=>g(this,null,function*(){try{let r=yield this.client.sessionRefresh(this._client.serverKey||B,"",{token:this._session.refresh_token,vars:this._session.vars,is_remember:this._session.is_remember});this._session.update(r.token,r.refresh_token,r.is_remember||!1),this.onRefreshSession(r),n(this._session)}catch(r){console.error("Session refresh failed:",r),t(r)}finally{this.refreshTokenPromise=null}})),this.refreshTokenPromise)):(console.error("Cannot refresh a null session."),this._session)})}createSocket(n=!1,t=new R,r=de.DefaultSendTimeoutMs){let{host:a,port:i,useSSL:o}={host:this._session.ws_url,port:"443",useSSL:!0};return new de(a,i,o,n,t,r)}onRefreshSession(n){console.log(`Token refresh occurred. Token: ${n.token}`)}isSessionExpired(){return this._session.isexpired(Date.now()/1e3)}isRefreshSessionExpired(){return this._session.isrefreshexpired(Date.now()/1e3)}getToken(){return this._session.token}getRefreshToken(){return this._session.refresh_token}getSession(){return this.session}exportSession(){return{token:this._session.token,refresh_token:this._session.refresh_token,api_url:this._session.api_url||"",ws_url:this._session.ws_url||"",user_id:this._userId}}};var L=class extends Error{constructor(n){super(n),this.name="SocketError"}};function Tn(r){return g(this,arguments,function*(e,n=20,t=100){var l;let a=0,i=t,o=e;for(;a<n;){if((l=o.adapter)!=null&&l.isOpen())return;yield new Promise(c=>setTimeout(c,i)),i*=2,a++}throw new L(`Socket failed to connect after ${n} attempts (total wait: ~${Math.pow(2,n)*t}ms)`)})}var De=class{constructor(n,t){this._client=n;this._session=t;this._socket=null;this._isConnected=!1;this._messageHandlers=[]}get isConnected(){return this._isConnected}get socket(){if(!this._socket)throw new L("Socket is not connected. Call connect() first.");return this._socket}connect(){return g(this,arguments,function*(n={}){if(this._isConnected)throw new L("Socket is already connected. Call disconnect() first.");let{onError:t,onDisconnect:r,verbose:a=!1}=n;this._errorHandler=t,this._disconnectHandler=r,this._socket=this._client.createSocket(a,new R),this._socket.onerror=i=>{var o;(o=this._errorHandler)==null||o.call(this,i)},this._socket.ondisconnect=()=>{var i;this._isConnected=!1,(i=this._disconnectHandler)==null||i.call(this)},this._socket.onchannelmessage=i=>{var o;if(!i){(o=this._errorHandler)==null||o.call(this,new L("Received null or undefined channel message"));return}this._messageHandlers.forEach(l=>{try{l(i)}catch(c){console.error("Error in message handler:",c)}})},yield this._socket.connect(this._session,!0,"0"),this._isConnected=!0})}disconnect(){this._socket&&(this._socket.disconnect(!0),this._socket=null,this._isConnected=!1)}setChannelMessageHandler(n){this.onChannelMessage(n)}onChannelMessage(n){return this._messageHandlers.push(n),()=>{let t=this._messageHandlers.indexOf(n);t!==-1&&this._messageHandlers.splice(t,1)}}joinDMChannel(n){return g(this,null,function*(){yield Tn(this.socket),yield this.socket.joinChat(N,n,3,!1)})}joinGroupChannel(n){return g(this,null,function*(){yield Tn(this.socket),yield this.socket.joinChat(N,n,2,!1)})}leaveDMChannel(n){return g(this,null,function*(){yield this.socket.leaveChat(N,n,3,!1)})}leaveGroupChannel(n){return g(this,null,function*(){yield this.socket.leaveChat(N,n,2,!1)})}sendDM(n){return g(this,null,function*(){let{channelId:t,content:r,attachments:a,hideLink:i=!1}=n;yield this.socket.writeChatMessage(N,t,4,!1,r,a,!1,i,"",0)})}sendGroup(n){return g(this,null,function*(){let{channelId:t,content:r,attachments:a,hideLink:i=!1}=n;yield this.socket.writeChatMessage(N,t,3,!1,r,a,!1,i,"",0)})}setErrorHandler(n){this._errorHandler=n,this._socket&&(this._socket.onerror=n)}};export{_e as AuthenticationError,J as CHANNEL_TYPE_DM,W as CHANNEL_TYPE_GROUP,N as CLAN_DM,B as DEFAULT_SERVER_KEY,Oe as LightClient,De as LightSocket,Se as MEZON_GW_URL,ve as SOCKET_READY_MAX_RETRY,Te as SOCKET_READY_RETRY_DELAY,Ce as STREAM_MODE_DM,be as STREAM_MODE_GROUP,ye as SessionError,L as SocketError};
|
|
1
|
+
var Cn=Object.defineProperty;var Be=Object.getOwnPropertySymbols;var bn=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable;var He=(e,n,t)=>n in e?Cn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ke=(e,n)=>{for(var t in n||(n={}))bn.call(n,t)&&He(e,t,n[t]);if(Be)for(var t of Be(n))Pn.call(n,t)&&He(e,t,n[t]);return e};var g=(e,n,t)=>new Promise((r,a)=>{var i=c=>{try{l(t.next(c))}catch(d){a(d)}},o=c=>{try{l(t.throw(c))}catch(d){a(d)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,o);l((t=t.apply(e,n)).next())});var Se="https://gw.mezon.ai",ve=20,Te=100,N="0",J=3,W=2,Ce=4,be=3,B="DefaultServerKey";import*as Pe from"js-base64";var ae=class e{constructor(n,t,r,a,i,o,l){this.created=r;this.api_url=a;this.ws_url=i;this.id_token=o;this.token=n,this.refresh_token=t,this.id_token=o,this.api_url=a,this.ws_url=i,this.created_at=Math.floor(new Date().getTime()/1e3),this.is_remember=l,this.update(n,t,l)}isexpired(n){return this.expires_at-n<=0}isrefreshexpired(n){return this.refresh_expires_at-n<=0}update(n,t,r){let a=n.split(".");if(a.length!=3)throw"jwt is not valid.";let i=JSON.parse(Pe.atob(a[1])),o=Math.floor(parseInt(i.exp));if(t){let l=t.split(".");if(l.length!=3)throw"refresh jwt is not valid.";let c=JSON.parse(Pe.atob(l[1])),d=Math.floor(parseInt(c.exp));this.refresh_expires_at=d,this.refresh_token=t,this.is_remember=r}this.token=n,this.expires_at=o,this.username=i.usn,this.user_id=i.uid,this.vars=i.vrs}static restore(n,t,r,a,i){return new e(n,t,!1,r,a,"",i)}};import we from"long";import f from"protobufjs/minimal";function qe(){return{created:!1,token:"",refresh_token:"",user_id:"0",is_remember:!1,api_url:"",id_token:""}}var Ae={encode(e,n=f.Writer.create()){return e.created!==!1&&n.uint32(8).bool(e.created),e.token!==""&&n.uint32(18).string(e.token),e.refresh_token!==""&&n.uint32(26).string(e.refresh_token),e.user_id!=="0"&&n.uint32(32).int64(e.user_id),e.is_remember!==!1&&n.uint32(40).bool(e.is_remember),e.api_url!==""&&n.uint32(50).string(e.api_url),e.id_token!==""&&n.uint32(58).string(e.id_token),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=qe();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.created=t.bool();continue;case 2:if(i!==18)break;a.token=t.string();continue;case 3:if(i!==26)break;a.refresh_token=t.string();continue;case 4:if(i!==32)break;a.user_id=m(t.int64());continue;case 5:if(i!==40)break;a.is_remember=t.bool();continue;case 6:if(i!==50)break;a.api_url=t.string();continue;case 7:if(i!==58)break;a.id_token=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{created:s(e.created)?globalThis.Boolean(e.created):!1,token:s(e.token)?globalThis.String(e.token):"",refresh_token:s(e.refresh_token)?globalThis.String(e.refresh_token):"",user_id:s(e.user_id)?globalThis.String(e.user_id):"0",is_remember:s(e.is_remember)?globalThis.Boolean(e.is_remember):!1,api_url:s(e.api_url)?globalThis.String(e.api_url):"",id_token:s(e.id_token)?globalThis.String(e.id_token):""}},toJSON(e){let n={};return e.created!==!1&&(n.created=e.created),e.token!==""&&(n.token=e.token),e.refresh_token!==""&&(n.refresh_token=e.refresh_token),e.user_id!=="0"&&(n.user_id=e.user_id),e.is_remember!==!1&&(n.is_remember=e.is_remember),e.api_url!==""&&(n.api_url=e.api_url),e.id_token!==""&&(n.id_token=e.id_token),n},create(e){return Ae.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c;let n=qe();return n.created=(t=e.created)!=null?t:!1,n.token=(r=e.token)!=null?r:"",n.refresh_token=(a=e.refresh_token)!=null?a:"",n.user_id=(i=e.user_id)!=null?i:"0",n.is_remember=(o=e.is_remember)!=null?o:!1,n.api_url=(l=e.api_url)!=null?l:"",n.id_token=(c=e.id_token)!=null?c:"",n}};function Ve(){return{token:"",vars:{},is_remember:!1}}var ue={encode(e,n=f.Writer.create()){return e.token!==""&&n.uint32(10).string(e.token),Object.entries(e.vars).forEach(([t,r])=>{Ee.encode({key:t,value:r},n.uint32(18).fork()).ldelim()}),e.is_remember!==!1&&n.uint32(24).bool(e.is_remember),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Ve();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.token=t.string();continue;case 2:if(i!==18)break;let o=Ee.decode(t,t.uint32());o.value!==void 0&&(a.vars[o.key]=o.value);continue;case 3:if(i!==24)break;a.is_remember=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{token:s(e.token)?globalThis.String(e.token):"",vars:En(e.vars)?Object.entries(e.vars).reduce((n,[t,r])=>(n[t]=String(r),n),{}):{},is_remember:s(e.is_remember)?globalThis.Boolean(e.is_remember):!1}},toJSON(e){let n={};if(e.token!==""&&(n.token=e.token),e.vars){let t=Object.entries(e.vars);t.length>0&&(n.vars={},t.forEach(([r,a])=>{n.vars[r]=a}))}return e.is_remember!==!1&&(n.is_remember=e.is_remember),n},create(e){return ue.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a;let n=Ve();return n.token=(t=e.token)!=null?t:"",n.vars=Object.entries((r=e.vars)!=null?r:{}).reduce((i,[o,l])=>(l!==void 0&&(i[o]=globalThis.String(l)),i),{}),n.is_remember=(a=e.is_remember)!=null?a:!1,n}};function ze(){return{key:"",value:""}}var Ee={encode(e,n=f.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=ze();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.key=t.string();continue;case 2:if(i!==18)break;a.value=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{key:s(e.key)?globalThis.String(e.key):"",value:s(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Ee.fromPartial(e!=null?e:{})},fromPartial(e){var t,r;let n=ze();return n.key=(t=e.key)!=null?t:"",n.value=(r=e.value)!=null?r:"",n}};function Fe(){return{clan_id:"0",parent_id:"0",channel_id:"0",category_id:"0",type:0,channel_label:"",channel_private:0,user_ids:[],app_id:"0"}}var fe={encode(e,n=f.Writer.create()){e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.parent_id!=="0"&&n.uint32(16).int64(e.parent_id),e.channel_id!=="0"&&n.uint32(24).int64(e.channel_id),e.category_id!=="0"&&n.uint32(32).int64(e.category_id),e.type!==0&&n.uint32(40).int32(e.type),e.channel_label!==""&&n.uint32(50).string(e.channel_label),e.channel_private!==0&&n.uint32(56).int32(e.channel_private),n.uint32(66).fork();for(let t of e.user_ids)n.int64(t);return n.ldelim(),e.app_id!=="0"&&n.uint32(72).int64(e.app_id),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Fe();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=m(t.int64());continue;case 2:if(i!==16)break;a.parent_id=m(t.int64());continue;case 3:if(i!==24)break;a.channel_id=m(t.int64());continue;case 4:if(i!==32)break;a.category_id=m(t.int64());continue;case 5:if(i!==40)break;a.type=t.int32();continue;case 6:if(i!==50)break;a.channel_label=t.string();continue;case 7:if(i!==56)break;a.channel_private=t.int32();continue;case 8:if(i===64){a.user_ids.push(m(t.int64()));continue}if(i===66){let o=t.uint32()+t.pos;for(;t.pos<o;)a.user_ids.push(m(t.int64()));continue}break;case 9:if(i!==72)break;a.app_id=m(t.int64());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:s(e.clan_id)?globalThis.String(e.clan_id):"0",parent_id:s(e.parent_id)?globalThis.String(e.parent_id):"0",channel_id:s(e.channel_id)?globalThis.String(e.channel_id):"0",category_id:s(e.category_id)?globalThis.String(e.category_id):"0",type:s(e.type)?globalThis.Number(e.type):0,channel_label:s(e.channel_label)?globalThis.String(e.channel_label):"",channel_private:s(e.channel_private)?globalThis.Number(e.channel_private):0,user_ids:globalThis.Array.isArray(e==null?void 0:e.user_ids)?e.user_ids.map(n=>globalThis.String(n)):[],app_id:s(e.app_id)?globalThis.String(e.app_id):"0"}},toJSON(e){var t;let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.parent_id!=="0"&&(n.parent_id=e.parent_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.category_id!=="0"&&(n.category_id=e.category_id),e.type!==0&&(n.type=Math.round(e.type)),e.channel_label!==""&&(n.channel_label=e.channel_label),e.channel_private!==0&&(n.channel_private=Math.round(e.channel_private)),(t=e.user_ids)!=null&&t.length&&(n.user_ids=e.user_ids),e.app_id!=="0"&&(n.app_id=e.app_id),n},create(e){return fe.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_;let n=Fe();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.parent_id=(r=e.parent_id)!=null?r:"0",n.channel_id=(a=e.channel_id)!=null?a:"0",n.category_id=(i=e.category_id)!=null?i:"0",n.type=(o=e.type)!=null?o:0,n.channel_label=(l=e.channel_label)!=null?l:"",n.channel_private=(c=e.channel_private)!=null?c:0,n.user_ids=((d=e.user_ids)==null?void 0:d.map(p=>p))||[],n.app_id=(_=e.app_id)!=null?_:"0",n}};function Ke(){return{clan_id:"0",parent_id:"0",channel_id:"0",category_id:"0",category_name:"",type:0,creator_id:"0",channel_label:"",channel_private:0,avatars:[],user_ids:[],last_sent_message:void 0,last_seen_message:void 0,onlines:[],meeting_code:"",count_mess_unread:0,active:0,last_pin_message:"",usernames:[],creator_name:"",create_time_seconds:0,update_time_seconds:0,display_names:[],channel_avatar:"",clan_name:"",app_id:"0",is_mute:!1,age_restricted:0,topic:"",e2ee:0,member_count:0}}var xe={encode(e,n=f.Writer.create()){e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.parent_id!=="0"&&n.uint32(16).int64(e.parent_id),e.channel_id!=="0"&&n.uint32(24).int64(e.channel_id),e.category_id!=="0"&&n.uint32(32).int64(e.category_id),e.category_name!==""&&n.uint32(42).string(e.category_name),e.type!==0&&n.uint32(48).int32(e.type),e.creator_id!=="0"&&n.uint32(56).int64(e.creator_id),e.channel_label!==""&&n.uint32(66).string(e.channel_label),e.channel_private!==0&&n.uint32(72).int32(e.channel_private);for(let t of e.avatars)n.uint32(82).string(t);n.uint32(90).fork();for(let t of e.user_ids)n.int64(t);n.ldelim(),e.last_sent_message!==void 0&&S.encode(e.last_sent_message,n.uint32(98).fork()).ldelim(),e.last_seen_message!==void 0&&S.encode(e.last_seen_message,n.uint32(106).fork()).ldelim(),n.uint32(114).fork();for(let t of e.onlines)n.bool(t);n.ldelim(),e.meeting_code!==""&&n.uint32(122).string(e.meeting_code),e.count_mess_unread!==0&&n.uint32(128).int32(e.count_mess_unread),e.active!==0&&n.uint32(136).int32(e.active),e.last_pin_message!==""&&n.uint32(146).string(e.last_pin_message);for(let t of e.usernames)n.uint32(154).string(t);e.creator_name!==""&&n.uint32(162).string(e.creator_name),e.create_time_seconds!==0&&n.uint32(168).uint32(e.create_time_seconds),e.update_time_seconds!==0&&n.uint32(176).uint32(e.update_time_seconds);for(let t of e.display_names)n.uint32(186).string(t);return e.channel_avatar!==""&&n.uint32(194).string(e.channel_avatar),e.clan_name!==""&&n.uint32(202).string(e.clan_name),e.app_id!=="0"&&n.uint32(208).int64(e.app_id),e.is_mute!==!1&&n.uint32(216).bool(e.is_mute),e.age_restricted!==0&&n.uint32(224).int32(e.age_restricted),e.topic!==""&&n.uint32(234).string(e.topic),e.e2ee!==0&&n.uint32(240).int32(e.e2ee),e.member_count!==0&&n.uint32(248).int32(e.member_count),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Ke();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=m(t.int64());continue;case 2:if(i!==16)break;a.parent_id=m(t.int64());continue;case 3:if(i!==24)break;a.channel_id=m(t.int64());continue;case 4:if(i!==32)break;a.category_id=m(t.int64());continue;case 5:if(i!==42)break;a.category_name=t.string();continue;case 6:if(i!==48)break;a.type=t.int32();continue;case 7:if(i!==56)break;a.creator_id=m(t.int64());continue;case 8:if(i!==66)break;a.channel_label=t.string();continue;case 9:if(i!==72)break;a.channel_private=t.int32();continue;case 10:if(i!==82)break;a.avatars.push(t.string());continue;case 11:if(i===88){a.user_ids.push(m(t.int64()));continue}if(i===90){let o=t.uint32()+t.pos;for(;t.pos<o;)a.user_ids.push(m(t.int64()));continue}break;case 12:if(i!==98)break;a.last_sent_message=S.decode(t,t.uint32());continue;case 13:if(i!==106)break;a.last_seen_message=S.decode(t,t.uint32());continue;case 14:if(i===112){a.onlines.push(t.bool());continue}if(i===114){let o=t.uint32()+t.pos;for(;t.pos<o;)a.onlines.push(t.bool());continue}break;case 15:if(i!==122)break;a.meeting_code=t.string();continue;case 16:if(i!==128)break;a.count_mess_unread=t.int32();continue;case 17:if(i!==136)break;a.active=t.int32();continue;case 18:if(i!==146)break;a.last_pin_message=t.string();continue;case 19:if(i!==154)break;a.usernames.push(t.string());continue;case 20:if(i!==162)break;a.creator_name=t.string();continue;case 21:if(i!==168)break;a.create_time_seconds=t.uint32();continue;case 22:if(i!==176)break;a.update_time_seconds=t.uint32();continue;case 23:if(i!==186)break;a.display_names.push(t.string());continue;case 24:if(i!==194)break;a.channel_avatar=t.string();continue;case 25:if(i!==202)break;a.clan_name=t.string();continue;case 26:if(i!==208)break;a.app_id=m(t.int64());continue;case 27:if(i!==216)break;a.is_mute=t.bool();continue;case 28:if(i!==224)break;a.age_restricted=t.int32();continue;case 29:if(i!==234)break;a.topic=t.string();continue;case 30:if(i!==240)break;a.e2ee=t.int32();continue;case 31:if(i!==248)break;a.member_count=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:s(e.clan_id)?globalThis.String(e.clan_id):"0",parent_id:s(e.parent_id)?globalThis.String(e.parent_id):"0",channel_id:s(e.channel_id)?globalThis.String(e.channel_id):"0",category_id:s(e.category_id)?globalThis.String(e.category_id):"0",category_name:s(e.category_name)?globalThis.String(e.category_name):"",type:s(e.type)?globalThis.Number(e.type):0,creator_id:s(e.creator_id)?globalThis.String(e.creator_id):"0",channel_label:s(e.channel_label)?globalThis.String(e.channel_label):"",channel_private:s(e.channel_private)?globalThis.Number(e.channel_private):0,avatars:globalThis.Array.isArray(e==null?void 0:e.avatars)?e.avatars.map(n=>globalThis.String(n)):[],user_ids:globalThis.Array.isArray(e==null?void 0:e.user_ids)?e.user_ids.map(n=>globalThis.String(n)):[],last_sent_message:s(e.last_sent_message)?S.fromJSON(e.last_sent_message):void 0,last_seen_message:s(e.last_seen_message)?S.fromJSON(e.last_seen_message):void 0,onlines:globalThis.Array.isArray(e==null?void 0:e.onlines)?e.onlines.map(n=>globalThis.Boolean(n)):[],meeting_code:s(e.meeting_code)?globalThis.String(e.meeting_code):"",count_mess_unread:s(e.count_mess_unread)?globalThis.Number(e.count_mess_unread):0,active:s(e.active)?globalThis.Number(e.active):0,last_pin_message:s(e.last_pin_message)?globalThis.String(e.last_pin_message):"",usernames:globalThis.Array.isArray(e==null?void 0:e.usernames)?e.usernames.map(n=>globalThis.String(n)):[],creator_name:s(e.creator_name)?globalThis.String(e.creator_name):"",create_time_seconds:s(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,update_time_seconds:s(e.update_time_seconds)?globalThis.Number(e.update_time_seconds):0,display_names:globalThis.Array.isArray(e==null?void 0:e.display_names)?e.display_names.map(n=>globalThis.String(n)):[],channel_avatar:s(e.channel_avatar)?globalThis.String(e.channel_avatar):"",clan_name:s(e.clan_name)?globalThis.String(e.clan_name):"",app_id:s(e.app_id)?globalThis.String(e.app_id):"0",is_mute:s(e.is_mute)?globalThis.Boolean(e.is_mute):!1,age_restricted:s(e.age_restricted)?globalThis.Number(e.age_restricted):0,topic:s(e.topic)?globalThis.String(e.topic):"",e2ee:s(e.e2ee)?globalThis.Number(e.e2ee):0,member_count:s(e.member_count)?globalThis.Number(e.member_count):0}},toJSON(e){var t,r,a,i,o;let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.parent_id!=="0"&&(n.parent_id=e.parent_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.category_id!=="0"&&(n.category_id=e.category_id),e.category_name!==""&&(n.category_name=e.category_name),e.type!==0&&(n.type=Math.round(e.type)),e.creator_id!=="0"&&(n.creator_id=e.creator_id),e.channel_label!==""&&(n.channel_label=e.channel_label),e.channel_private!==0&&(n.channel_private=Math.round(e.channel_private)),(t=e.avatars)!=null&&t.length&&(n.avatars=e.avatars),(r=e.user_ids)!=null&&r.length&&(n.user_ids=e.user_ids),e.last_sent_message!==void 0&&(n.last_sent_message=S.toJSON(e.last_sent_message)),e.last_seen_message!==void 0&&(n.last_seen_message=S.toJSON(e.last_seen_message)),(a=e.onlines)!=null&&a.length&&(n.onlines=e.onlines),e.meeting_code!==""&&(n.meeting_code=e.meeting_code),e.count_mess_unread!==0&&(n.count_mess_unread=Math.round(e.count_mess_unread)),e.active!==0&&(n.active=Math.round(e.active)),e.last_pin_message!==""&&(n.last_pin_message=e.last_pin_message),(i=e.usernames)!=null&&i.length&&(n.usernames=e.usernames),e.creator_name!==""&&(n.creator_name=e.creator_name),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.update_time_seconds!==0&&(n.update_time_seconds=Math.round(e.update_time_seconds)),(o=e.display_names)!=null&&o.length&&(n.display_names=e.display_names),e.channel_avatar!==""&&(n.channel_avatar=e.channel_avatar),e.clan_name!==""&&(n.clan_name=e.clan_name),e.app_id!=="0"&&(n.app_id=e.app_id),e.is_mute!==!1&&(n.is_mute=e.is_mute),e.age_restricted!==0&&(n.age_restricted=Math.round(e.age_restricted)),e.topic!==""&&(n.topic=e.topic),e.e2ee!==0&&(n.e2ee=Math.round(e.e2ee)),e.member_count!==0&&(n.member_count=Math.round(e.member_count)),n},create(e){return xe.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p,y,x,M,I,C,G,X,Z,$,Q,j,ee,ne,te,ie,Ue,Le,Je,We;let n=Ke();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.parent_id=(r=e.parent_id)!=null?r:"0",n.channel_id=(a=e.channel_id)!=null?a:"0",n.category_id=(i=e.category_id)!=null?i:"0",n.category_name=(o=e.category_name)!=null?o:"",n.type=(l=e.type)!=null?l:0,n.creator_id=(c=e.creator_id)!=null?c:"0",n.channel_label=(d=e.channel_label)!=null?d:"",n.channel_private=(_=e.channel_private)!=null?_:0,n.avatars=((p=e.avatars)==null?void 0:p.map(P=>P))||[],n.user_ids=((y=e.user_ids)==null?void 0:y.map(P=>P))||[],n.last_sent_message=e.last_sent_message!==void 0&&e.last_sent_message!==null?S.fromPartial(e.last_sent_message):void 0,n.last_seen_message=e.last_seen_message!==void 0&&e.last_seen_message!==null?S.fromPartial(e.last_seen_message):void 0,n.onlines=((x=e.onlines)==null?void 0:x.map(P=>P))||[],n.meeting_code=(M=e.meeting_code)!=null?M:"",n.count_mess_unread=(I=e.count_mess_unread)!=null?I:0,n.active=(C=e.active)!=null?C:0,n.last_pin_message=(G=e.last_pin_message)!=null?G:"",n.usernames=((X=e.usernames)==null?void 0:X.map(P=>P))||[],n.creator_name=(Z=e.creator_name)!=null?Z:"",n.create_time_seconds=($=e.create_time_seconds)!=null?$:0,n.update_time_seconds=(Q=e.update_time_seconds)!=null?Q:0,n.display_names=((j=e.display_names)==null?void 0:j.map(P=>P))||[],n.channel_avatar=(ee=e.channel_avatar)!=null?ee:"",n.clan_name=(ne=e.clan_name)!=null?ne:"",n.app_id=(te=e.app_id)!=null?te:"0",n.is_mute=(ie=e.is_mute)!=null?ie:!1,n.age_restricted=(Ue=e.age_restricted)!=null?Ue:0,n.topic=(Le=e.topic)!=null?Le:"",n.e2ee=(Je=e.e2ee)!=null?Je:0,n.member_count=(We=e.member_count)!=null?We:0,n}};function m(e){return e.toString()}f.util.Long!==we&&(f.util.Long=we,f.configure());function En(e){return typeof e=="object"&&e!==null}function s(e){return e!=null}function Ye(){return{clan_id:"0",channel_id:"0",message_id:"0",code:0,sender_id:"0",username:"",avatar:"",content:"",channel_label:"",clan_logo:"",category_name:"",display_name:"",clan_nick:"",clan_avatar:"",reactions:new Uint8Array(0),mentions:new Uint8Array(0),attachments:new Uint8Array(0),references:new Uint8Array(0),referenced_message:new Uint8Array(0),create_time_seconds:0,update_time_seconds:0,mode:0,hide_editted:!1,is_public:!1,topic_id:"0"}}var O={encode(e,n=f.Writer.create()){return e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.message_id!=="0"&&n.uint32(24).int64(e.message_id),e.code!==0&&n.uint32(32).int32(e.code),e.sender_id!=="0"&&n.uint32(40).int64(e.sender_id),e.username!==""&&n.uint32(50).string(e.username),e.avatar!==""&&n.uint32(58).string(e.avatar),e.content!==""&&n.uint32(66).string(e.content),e.channel_label!==""&&n.uint32(74).string(e.channel_label),e.clan_logo!==""&&n.uint32(82).string(e.clan_logo),e.category_name!==""&&n.uint32(90).string(e.category_name),e.display_name!==""&&n.uint32(98).string(e.display_name),e.clan_nick!==""&&n.uint32(106).string(e.clan_nick),e.clan_avatar!==""&&n.uint32(114).string(e.clan_avatar),e.reactions.length!==0&&n.uint32(122).bytes(e.reactions),e.mentions.length!==0&&n.uint32(130).bytes(e.mentions),e.attachments.length!==0&&n.uint32(138).bytes(e.attachments),e.references.length!==0&&n.uint32(146).bytes(e.references),e.referenced_message.length!==0&&n.uint32(154).bytes(e.referenced_message),e.create_time_seconds!==0&&n.uint32(160).uint32(e.create_time_seconds),e.update_time_seconds!==0&&n.uint32(168).uint32(e.update_time_seconds),e.mode!==0&&n.uint32(176).int32(e.mode),e.hide_editted!==!1&&n.uint32(184).bool(e.hide_editted),e.is_public!==!1&&n.uint32(192).bool(e.is_public),e.topic_id!=="0"&&n.uint32(200).int64(e.topic_id),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Ye();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=m(t.int64());continue;case 2:if(i!==16)break;a.channel_id=m(t.int64());continue;case 3:if(i!==24)break;a.message_id=m(t.int64());continue;case 4:if(i!==32)break;a.code=t.int32();continue;case 5:if(i!==40)break;a.sender_id=m(t.int64());continue;case 6:if(i!==50)break;a.username=t.string();continue;case 7:if(i!==58)break;a.avatar=t.string();continue;case 8:if(i!==66)break;a.content=t.string();continue;case 9:if(i!==74)break;a.channel_label=t.string();continue;case 10:if(i!==82)break;a.clan_logo=t.string();continue;case 11:if(i!==90)break;a.category_name=t.string();continue;case 12:if(i!==98)break;a.display_name=t.string();continue;case 13:if(i!==106)break;a.clan_nick=t.string();continue;case 14:if(i!==114)break;a.clan_avatar=t.string();continue;case 15:if(i!==122)break;a.reactions=t.bytes();continue;case 16:if(i!==130)break;a.mentions=t.bytes();continue;case 17:if(i!==138)break;a.attachments=t.bytes();continue;case 18:if(i!==146)break;a.references=t.bytes();continue;case 19:if(i!==154)break;a.referenced_message=t.bytes();continue;case 20:if(i!==160)break;a.create_time_seconds=t.uint32();continue;case 21:if(i!==168)break;a.update_time_seconds=t.uint32();continue;case 22:if(i!==176)break;a.mode=t.int32();continue;case 23:if(i!==184)break;a.hide_editted=t.bool();continue;case 24:if(i!==192)break;a.is_public=t.bool();continue;case 25:if(i!==200)break;a.topic_id=m(t.int64());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:s(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:s(e.channel_id)?globalThis.String(e.channel_id):"0",message_id:s(e.message_id)?globalThis.String(e.message_id):"0",code:s(e.code)?globalThis.Number(e.code):0,sender_id:s(e.sender_id)?globalThis.String(e.sender_id):"0",username:s(e.username)?globalThis.String(e.username):"",avatar:s(e.avatar)?globalThis.String(e.avatar):"",content:s(e.content)?globalThis.String(e.content):"",channel_label:s(e.channel_label)?globalThis.String(e.channel_label):"",clan_logo:s(e.clan_logo)?globalThis.String(e.clan_logo):"",category_name:s(e.category_name)?globalThis.String(e.category_name):"",display_name:s(e.display_name)?globalThis.String(e.display_name):"",clan_nick:s(e.clan_nick)?globalThis.String(e.clan_nick):"",clan_avatar:s(e.clan_avatar)?globalThis.String(e.clan_avatar):"",reactions:s(e.reactions)?re(e.reactions):new Uint8Array(0),mentions:s(e.mentions)?re(e.mentions):new Uint8Array(0),attachments:s(e.attachments)?re(e.attachments):new Uint8Array(0),references:s(e.references)?re(e.references):new Uint8Array(0),referenced_message:s(e.referenced_message)?re(e.referenced_message):new Uint8Array(0),create_time_seconds:s(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,update_time_seconds:s(e.update_time_seconds)?globalThis.Number(e.update_time_seconds):0,mode:s(e.mode)?globalThis.Number(e.mode):0,hide_editted:s(e.hide_editted)?globalThis.Boolean(e.hide_editted):!1,is_public:s(e.is_public)?globalThis.Boolean(e.is_public):!1,topic_id:s(e.topic_id)?globalThis.String(e.topic_id):"0"}},toJSON(e){let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.message_id!=="0"&&(n.message_id=e.message_id),e.code!==0&&(n.code=Math.round(e.code)),e.sender_id!=="0"&&(n.sender_id=e.sender_id),e.username!==""&&(n.username=e.username),e.avatar!==""&&(n.avatar=e.avatar),e.content!==""&&(n.content=e.content),e.channel_label!==""&&(n.channel_label=e.channel_label),e.clan_logo!==""&&(n.clan_logo=e.clan_logo),e.category_name!==""&&(n.category_name=e.category_name),e.display_name!==""&&(n.display_name=e.display_name),e.clan_nick!==""&&(n.clan_nick=e.clan_nick),e.clan_avatar!==""&&(n.clan_avatar=e.clan_avatar),e.reactions.length!==0&&(n.reactions=se(e.reactions)),e.mentions.length!==0&&(n.mentions=se(e.mentions)),e.attachments.length!==0&&(n.attachments=se(e.attachments)),e.references.length!==0&&(n.references=se(e.references)),e.referenced_message.length!==0&&(n.referenced_message=se(e.referenced_message)),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.update_time_seconds!==0&&(n.update_time_seconds=Math.round(e.update_time_seconds)),e.mode!==0&&(n.mode=Math.round(e.mode)),e.hide_editted!==!1&&(n.hide_editted=e.hide_editted),e.is_public!==!1&&(n.is_public=e.is_public),e.topic_id!=="0"&&(n.topic_id=e.topic_id),n},create(e){return O.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p,y,x,M,I,C,G,X,Z,$,Q,j,ee,ne,te,ie;let n=Ye();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.message_id=(a=e.message_id)!=null?a:"0",n.code=(i=e.code)!=null?i:0,n.sender_id=(o=e.sender_id)!=null?o:"0",n.username=(l=e.username)!=null?l:"",n.avatar=(c=e.avatar)!=null?c:"",n.content=(d=e.content)!=null?d:"",n.channel_label=(_=e.channel_label)!=null?_:"",n.clan_logo=(p=e.clan_logo)!=null?p:"",n.category_name=(y=e.category_name)!=null?y:"",n.display_name=(x=e.display_name)!=null?x:"",n.clan_nick=(M=e.clan_nick)!=null?M:"",n.clan_avatar=(I=e.clan_avatar)!=null?I:"",n.reactions=(C=e.reactions)!=null?C:new Uint8Array(0),n.mentions=(G=e.mentions)!=null?G:new Uint8Array(0),n.attachments=(X=e.attachments)!=null?X:new Uint8Array(0),n.references=(Z=e.references)!=null?Z:new Uint8Array(0),n.referenced_message=($=e.referenced_message)!=null?$:new Uint8Array(0),n.create_time_seconds=(Q=e.create_time_seconds)!=null?Q:0,n.update_time_seconds=(j=e.update_time_seconds)!=null?j:0,n.mode=(ee=e.mode)!=null?ee:0,n.hide_editted=(ne=e.hide_editted)!=null?ne:!1,n.is_public=(te=e.is_public)!=null?te:!1,n.topic_id=(ie=e.topic_id)!=null?ie:"0",n}};function Ge(){return{id:"0",timestamp_seconds:0,sender_id:"0",content:""}}var S={encode(e,n=f.Writer.create()){return e.id!=="0"&&n.uint32(8).int64(e.id),e.timestamp_seconds!==0&&n.uint32(16).uint32(e.timestamp_seconds),e.sender_id!=="0"&&n.uint32(24).int64(e.sender_id),e.content!==""&&n.uint32(34).string(e.content),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Ge();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.id=m(t.int64());continue;case 2:if(i!==16)break;a.timestamp_seconds=t.uint32();continue;case 3:if(i!==24)break;a.sender_id=m(t.int64());continue;case 4:if(i!==34)break;a.content=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{id:s(e.id)?globalThis.String(e.id):"0",timestamp_seconds:s(e.timestamp_seconds)?globalThis.Number(e.timestamp_seconds):0,sender_id:s(e.sender_id)?globalThis.String(e.sender_id):"0",content:s(e.content)?globalThis.String(e.content):""}},toJSON(e){let n={};return e.id!=="0"&&(n.id=e.id),e.timestamp_seconds!==0&&(n.timestamp_seconds=Math.round(e.timestamp_seconds)),e.sender_id!=="0"&&(n.sender_id=e.sender_id),e.content!==""&&(n.content=e.content),n},create(e){return S.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i;let n=Ge();return n.id=(t=e.id)!=null?t:"0",n.timestamp_seconds=(r=e.timestamp_seconds)!=null?r:0,n.sender_id=(a=e.sender_id)!=null?a:"0",n.content=(i=e.content)!=null?i:"",n}};function Xe(){return{id:"0",user_id:"0",username:"",role_id:"0",rolename:"",create_time_seconds:0,s:0,e:0}}var D={encode(e,n=f.Writer.create()){return e.id!=="0"&&n.uint32(8).int64(e.id),e.user_id!=="0"&&n.uint32(16).int64(e.user_id),e.username!==""&&n.uint32(26).string(e.username),e.role_id!=="0"&&n.uint32(32).int64(e.role_id),e.rolename!==""&&n.uint32(42).string(e.rolename),e.create_time_seconds!==0&&n.uint32(48).uint32(e.create_time_seconds),e.s!==0&&n.uint32(56).int32(e.s),e.e!==0&&n.uint32(64).int32(e.e),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Xe();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.id=m(t.int64());continue;case 2:if(i!==16)break;a.user_id=m(t.int64());continue;case 3:if(i!==26)break;a.username=t.string();continue;case 4:if(i!==32)break;a.role_id=m(t.int64());continue;case 5:if(i!==42)break;a.rolename=t.string();continue;case 6:if(i!==48)break;a.create_time_seconds=t.uint32();continue;case 7:if(i!==56)break;a.s=t.int32();continue;case 8:if(i!==64)break;a.e=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{id:s(e.id)?globalThis.String(e.id):"0",user_id:s(e.user_id)?globalThis.String(e.user_id):"0",username:s(e.username)?globalThis.String(e.username):"",role_id:s(e.role_id)?globalThis.String(e.role_id):"0",rolename:s(e.rolename)?globalThis.String(e.rolename):"",create_time_seconds:s(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,s:s(e.s)?globalThis.Number(e.s):0,e:s(e.e)?globalThis.Number(e.e):0}},toJSON(e){let n={};return e.id!=="0"&&(n.id=e.id),e.user_id!=="0"&&(n.user_id=e.user_id),e.username!==""&&(n.username=e.username),e.role_id!=="0"&&(n.role_id=e.role_id),e.rolename!==""&&(n.rolename=e.rolename),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.s!==0&&(n.s=Math.round(e.s)),e.e!==0&&(n.e=Math.round(e.e)),n},create(e){return D.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d;let n=Xe();return n.id=(t=e.id)!=null?t:"0",n.user_id=(r=e.user_id)!=null?r:"0",n.username=(a=e.username)!=null?a:"",n.role_id=(i=e.role_id)!=null?i:"0",n.rolename=(o=e.rolename)!=null?o:"",n.create_time_seconds=(l=e.create_time_seconds)!=null?l:0,n.s=(c=e.s)!=null?c:0,n.e=(d=e.e)!=null?d:0,n}};function Ze(){return{filename:"",size:0,url:"",filetype:"",width:0,height:0,thumbnail:"",duration:0}}var v={encode(e,n=f.Writer.create()){return e.filename!==""&&n.uint32(10).string(e.filename),e.size!==0&&n.uint32(16).int32(e.size),e.url!==""&&n.uint32(26).string(e.url),e.filetype!==""&&n.uint32(34).string(e.filetype),e.width!==0&&n.uint32(40).int32(e.width),e.height!==0&&n.uint32(48).int32(e.height),e.thumbnail!==""&&n.uint32(58).string(e.thumbnail),e.duration!==0&&n.uint32(64).int32(e.duration),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Ze();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.filename=t.string();continue;case 2:if(i!==16)break;a.size=t.int32();continue;case 3:if(i!==26)break;a.url=t.string();continue;case 4:if(i!==34)break;a.filetype=t.string();continue;case 5:if(i!==40)break;a.width=t.int32();continue;case 6:if(i!==48)break;a.height=t.int32();continue;case 7:if(i!==58)break;a.thumbnail=t.string();continue;case 8:if(i!==64)break;a.duration=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{filename:s(e.filename)?globalThis.String(e.filename):"",size:s(e.size)?globalThis.Number(e.size):0,url:s(e.url)?globalThis.String(e.url):"",filetype:s(e.filetype)?globalThis.String(e.filetype):"",width:s(e.width)?globalThis.Number(e.width):0,height:s(e.height)?globalThis.Number(e.height):0,thumbnail:s(e.thumbnail)?globalThis.String(e.thumbnail):"",duration:s(e.duration)?globalThis.Number(e.duration):0}},toJSON(e){let n={};return e.filename!==""&&(n.filename=e.filename),e.size!==0&&(n.size=Math.round(e.size)),e.url!==""&&(n.url=e.url),e.filetype!==""&&(n.filetype=e.filetype),e.width!==0&&(n.width=Math.round(e.width)),e.height!==0&&(n.height=Math.round(e.height)),e.thumbnail!==""&&(n.thumbnail=e.thumbnail),e.duration!==0&&(n.duration=Math.round(e.duration)),n},create(e){return v.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d;let n=Ze();return n.filename=(t=e.filename)!=null?t:"",n.size=(r=e.size)!=null?r:0,n.url=(a=e.url)!=null?a:"",n.filetype=(i=e.filetype)!=null?i:"",n.width=(o=e.width)!=null?o:0,n.height=(l=e.height)!=null?l:0,n.thumbnail=(c=e.thumbnail)!=null?c:"",n.duration=(d=e.duration)!=null?d:0,n}};function $e(){return{message_id:"0",message_ref_id:"0",content:"",has_attachment:!1,ref_type:0,message_sender_id:"0",message_sender_username:"",mesages_sender_avatar:"",message_sender_clan_nick:"",message_sender_display_name:""}}var U={encode(e,n=f.Writer.create()){return e.message_id!=="0"&&n.uint32(8).int64(e.message_id),e.message_ref_id!=="0"&&n.uint32(16).int64(e.message_ref_id),e.content!==""&&n.uint32(26).string(e.content),e.has_attachment!==!1&&n.uint32(32).bool(e.has_attachment),e.ref_type!==0&&n.uint32(40).int32(e.ref_type),e.message_sender_id!=="0"&&n.uint32(48).int64(e.message_sender_id),e.message_sender_username!==""&&n.uint32(58).string(e.message_sender_username),e.mesages_sender_avatar!==""&&n.uint32(66).string(e.mesages_sender_avatar),e.message_sender_clan_nick!==""&&n.uint32(74).string(e.message_sender_clan_nick),e.message_sender_display_name!==""&&n.uint32(82).string(e.message_sender_display_name),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=$e();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.message_id=m(t.int64());continue;case 2:if(i!==16)break;a.message_ref_id=m(t.int64());continue;case 3:if(i!==26)break;a.content=t.string();continue;case 4:if(i!==32)break;a.has_attachment=t.bool();continue;case 5:if(i!==40)break;a.ref_type=t.int32();continue;case 6:if(i!==48)break;a.message_sender_id=m(t.int64());continue;case 7:if(i!==58)break;a.message_sender_username=t.string();continue;case 8:if(i!==66)break;a.mesages_sender_avatar=t.string();continue;case 9:if(i!==74)break;a.message_sender_clan_nick=t.string();continue;case 10:if(i!==82)break;a.message_sender_display_name=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{message_id:s(e.message_id)?globalThis.String(e.message_id):"0",message_ref_id:s(e.message_ref_id)?globalThis.String(e.message_ref_id):"0",content:s(e.content)?globalThis.String(e.content):"",has_attachment:s(e.has_attachment)?globalThis.Boolean(e.has_attachment):!1,ref_type:s(e.ref_type)?globalThis.Number(e.ref_type):0,message_sender_id:s(e.message_sender_id)?globalThis.String(e.message_sender_id):"0",message_sender_username:s(e.message_sender_username)?globalThis.String(e.message_sender_username):"",mesages_sender_avatar:s(e.mesages_sender_avatar)?globalThis.String(e.mesages_sender_avatar):"",message_sender_clan_nick:s(e.message_sender_clan_nick)?globalThis.String(e.message_sender_clan_nick):"",message_sender_display_name:s(e.message_sender_display_name)?globalThis.String(e.message_sender_display_name):""}},toJSON(e){let n={};return e.message_id!=="0"&&(n.message_id=e.message_id),e.message_ref_id!=="0"&&(n.message_ref_id=e.message_ref_id),e.content!==""&&(n.content=e.content),e.has_attachment!==!1&&(n.has_attachment=e.has_attachment),e.ref_type!==0&&(n.ref_type=Math.round(e.ref_type)),e.message_sender_id!=="0"&&(n.message_sender_id=e.message_sender_id),e.message_sender_username!==""&&(n.message_sender_username=e.message_sender_username),e.mesages_sender_avatar!==""&&(n.mesages_sender_avatar=e.mesages_sender_avatar),e.message_sender_clan_nick!==""&&(n.message_sender_clan_nick=e.message_sender_clan_nick),e.message_sender_display_name!==""&&(n.message_sender_display_name=e.message_sender_display_name),n},create(e){return U.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p;let n=$e();return n.message_id=(t=e.message_id)!=null?t:"0",n.message_ref_id=(r=e.message_ref_id)!=null?r:"0",n.content=(a=e.content)!=null?a:"",n.has_attachment=(i=e.has_attachment)!=null?i:!1,n.ref_type=(o=e.ref_type)!=null?o:0,n.message_sender_id=(l=e.message_sender_id)!=null?l:"0",n.message_sender_username=(c=e.message_sender_username)!=null?c:"",n.mesages_sender_avatar=(d=e.mesages_sender_avatar)!=null?d:"",n.message_sender_clan_nick=(_=e.message_sender_clan_nick)!=null?_:"",n.message_sender_display_name=(p=e.message_sender_display_name)!=null?p:"",n}};function Qe(){return{attachments:[]}}var Me={encode(e,n=f.Writer.create()){for(let t of e.attachments)v.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Qe();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.attachments.push(v.decode(t,t.uint32()));continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{attachments:globalThis.Array.isArray(e==null?void 0:e.attachments)?e.attachments.map(n=>v.fromJSON(n)):[]}},toJSON(e){var t;let n={};return(t=e.attachments)!=null&&t.length&&(n.attachments=e.attachments.map(r=>v.toJSON(r))),n},create(e){return Me.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=Qe();return n.attachments=((t=e.attachments)==null?void 0:t.map(r=>v.fromPartial(r)))||[],n}};function re(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{let n=globalThis.atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;++r)t[r]=n.charCodeAt(r);return t}}function se(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{let n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function je(){return{filename:"",filetype:"",size:0,width:0,height:0}}var he={encode(e,n=f.Writer.create()){return e.filename!==""&&n.uint32(10).string(e.filename),e.filetype!==""&&n.uint32(18).string(e.filetype),e.size!==0&&n.uint32(24).int32(e.size),e.width!==0&&n.uint32(32).int32(e.width),e.height!==0&&n.uint32(40).int32(e.height),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=je();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.filename=t.string();continue;case 2:if(i!==18)break;a.filetype=t.string();continue;case 3:if(i!==24)break;a.size=t.int32();continue;case 4:if(i!==32)break;a.width=t.int32();continue;case 5:if(i!==40)break;a.height=t.int32();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{filename:s(e.filename)?globalThis.String(e.filename):"",filetype:s(e.filetype)?globalThis.String(e.filetype):"",size:s(e.size)?globalThis.Number(e.size):0,width:s(e.width)?globalThis.Number(e.width):0,height:s(e.height)?globalThis.Number(e.height):0}},toJSON(e){let n={};return e.filename!==""&&(n.filename=e.filename),e.filetype!==""&&(n.filetype=e.filetype),e.size!==0&&(n.size=Math.round(e.size)),e.width!==0&&(n.width=Math.round(e.width)),e.height!==0&&(n.height=Math.round(e.height)),n},create(e){return he.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o;let n=je();return n.filename=(t=e.filename)!=null?t:"",n.filetype=(r=e.filetype)!=null?r:"",n.size=(a=e.size)!=null?a:0,n.width=(i=e.width)!=null?i:0,n.height=(o=e.height)!=null?o:0,n}};function en(){return{filename:"",url:""}}var Ie={encode(e,n=f.Writer.create()){return e.filename!==""&&n.uint32(10).string(e.filename),e.url!==""&&n.uint32(18).string(e.url),n},decode(e,n){let t=e instanceof f.Reader?e:f.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=en();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.filename=t.string();continue;case 2:if(i!==18)break;a.url=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{filename:s(e.filename)?globalThis.String(e.filename):"",url:s(e.url)?globalThis.String(e.url):""}},toJSON(e){let n={};return e.filename!==""&&(n.filename=e.filename),e.url!==""&&(n.url=e.url),n},create(e){return Ie.fromPartial(e!=null?e:{})},fromPartial(e){var t,r;let n=en();return n.filename=(t=e.filename)!=null?t:"",n.url=(r=e.url)!=null?r:"",n}};function oe(e,n,t){let r=ke({method:e},n);if(r.headers=ke({},n.headers),typeof XMLHttpRequest!="undefined"){let a=Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype,"withCredentials");a!=null&&a.set||(r.credentials="cocos-ignore")}return Object.keys(r.headers).includes("Accept")||(r.headers.Accept="application/proto"),Object.keys(r.headers).includes("Content-Type")||(r.headers["Content-Type"]="application/proto"),Object.keys(r.headers).forEach(a=>{r.headers[a]||delete r.headers[a]}),t&&(r.body=t),r}function pe(e){if(e==null)return{t:e};let n;if(e instanceof Uint8Array)n=new TextDecoder().decode(e);else if(typeof e=="string")n=e;else return typeof e=="object"?e:{t:e};if(!n||n===""||n==="[]")return{t:n};try{return JSON.parse(n)}catch(t){try{let r=n.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(r)}catch(r){return console.error("JSON Parse failed completely:",{original:n,error:r}),{t:n}}}}var An=e=>!e||e===null||e===void 0||e===""||e==="[]";function tn(e){if(An(e))return;let n=e[0];if(n===91||n===123)return pe(e);try{let r=e,a=new Uint8Array(r);return Me.decode(a)}catch(r){return pe(e)}}import{encode as an}from"js-base64";var le=class{constructor(n,t,r){this.serverKey=n;this.timeoutMs=t;this.basePath=r}setBasePath(n){this.basePath=n}authenticateIdToken(n,t,r,a={}){if(r==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/v2/account/authenticate/idtoken",o=new Map,l="";l=JSON.stringify(r||{});let c=this.buildFullUrl(this.basePath,i,o),d=oe("POST",a,l);return n&&(d.headers.Authorization="Basic "+an(n+":"+t)),Promise.race([fetch(c,d).then(_=>{if(_.status==204)return _;if(_.status>=200&&_.status<300)return _.json();throw _}),new Promise((_,p)=>setTimeout(p,this.timeoutMs,"Request timed out."))])}sessionRefresh(n,t,r,a={}){if(r==null)throw new Error("'body' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/SessionRefresh",o=new Map,c=ue.encode(ue.fromPartial(r)).finish(),d=this.buildFullUrl(this.basePath,i,o),_=oe("POST",a,"");return _.body=c,n&&(_.headers.Authorization="Basic "+an(n+":"+t)),Promise.race([fetch(d,_).then(p=>g(this,null,function*(){if(p.status==204)return{};if(p.status>=200&&p.status<300){let y=yield p.arrayBuffer();return Ae.decode(new Uint8Array(y))}else throw p})),new Promise((p,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(n,t,r={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateChannelDesc",i=new Map,l=fe.encode(fe.fromPartial(t)).finish(),c=this.buildFullUrl(this.basePath,a,i),d=oe("POST",r,"");return d.body=l,n&&(d.headers.Authorization="Bearer "+n),Promise.race([fetch(c,d).then(_=>g(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let p=yield _.arrayBuffer();return xe.decode(new Uint8Array(p))}else throw _})),new Promise((_,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(n,t,r={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UploadAttachmentFile",i=new Map,l=he.encode(he.fromPartial(t)).finish(),c=this.buildFullUrl(this.basePath,a,i),d=oe("POST",r,"");return d.body=l,n&&(d.headers.Authorization="Bearer "+n),Promise.race([fetch(c,d).then(_=>g(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let p=yield _.arrayBuffer();return Ie.decode(new Uint8Array(p))}else throw _})),new Promise((_,p)=>setTimeout(()=>p(new Error("Request timed out.")),this.timeoutMs))])}buildFullUrl(n,t,r){let a=n+t+"?";for(let[i,o]of r)o instanceof Array?a+=o.reduce((l,c)=>l+encodeURIComponent(i)+"="+encodeURIComponent(c)+"&",""):o!=null&&(a+=encodeURIComponent(i)+"="+encodeURIComponent(o)+"&");return a}};import cn from"long";import h from"protobufjs/minimal";import rn from"long";import E from"protobufjs/minimal";function sn(){return{value:!1}}var me={encode(e,n=E.Writer.create()){return e.value!==!1&&n.uint32(8).bool(e.value),n},decode(e,n){let t=e instanceof E.Reader?e:E.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=sn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.value=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{value:ln(e.value)?globalThis.Boolean(e.value):!1}},toJSON(e){let n={};return e.value!==!1&&(n.value=e.value),n},create(e){return me.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=sn();return n.value=(t=e.value)!=null?t:!1,n}};function on(){return{value:""}}var ge={encode(e,n=E.Writer.create()){return e.value!==""&&n.uint32(10).string(e.value),n},decode(e,n){let t=e instanceof E.Reader?e:E.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=on();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.value=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{value:ln(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.value!==""&&(n.value=e.value),n},create(e){return ge.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=on();return n.value=(t=e.value)!=null?t:"",n}};E.util.Long!==rn&&(E.util.Long=rn,E.configure());function ln(e){return e!=null}function dn(){return{cid:"",channel:void 0,channel_join:void 0,channel_leave:void 0,channel_message:void 0,channel_message_ack:void 0,channel_message_send:void 0,error:void 0,ping:void 0,pong:void 0}}var ce={encode(e,n=h.Writer.create()){return e.cid!==""&&n.uint32(10).string(e.cid),e.channel!==void 0&&H.encode(e.channel,n.uint32(18).fork()).ldelim(),e.channel_join!==void 0&&w.encode(e.channel_join,n.uint32(34).fork()).ldelim(),e.channel_leave!==void 0&&q.encode(e.channel_leave,n.uint32(42).fork()).ldelim(),e.channel_message!==void 0&&O.encode(e.channel_message,n.uint32(50).fork()).ldelim(),e.channel_message_ack!==void 0&&V.encode(e.channel_message_ack,n.uint32(58).fork()).ldelim(),e.channel_message_send!==void 0&&z.encode(e.channel_message_send,n.uint32(66).fork()).ldelim(),e.error!==void 0&&F.encode(e.error,n.uint32(98).fork()).ldelim(),e.ping!==void 0&&K.encode(e.ping,n.uint32(178).fork()).ldelim(),e.pong!==void 0&&Y.encode(e.pong,n.uint32(186).fork()).ldelim(),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=dn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.cid=t.string();continue;case 2:if(i!==18)break;a.channel=H.decode(t,t.uint32());continue;case 4:if(i!==34)break;a.channel_join=w.decode(t,t.uint32());continue;case 5:if(i!==42)break;a.channel_leave=q.decode(t,t.uint32());continue;case 6:if(i!==50)break;a.channel_message=O.decode(t,t.uint32());continue;case 7:if(i!==58)break;a.channel_message_ack=V.decode(t,t.uint32());continue;case 8:if(i!==66)break;a.channel_message_send=z.decode(t,t.uint32());continue;case 12:if(i!==98)break;a.error=F.decode(t,t.uint32());continue;case 22:if(i!==178)break;a.ping=K.decode(t,t.uint32());continue;case 23:if(i!==186)break;a.pong=Y.decode(t,t.uint32());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{cid:u(e.cid)?globalThis.String(e.cid):"",channel:u(e.channel)?H.fromJSON(e.channel):void 0,channel_join:u(e.channel_join)?w.fromJSON(e.channel_join):void 0,channel_leave:u(e.channel_leave)?q.fromJSON(e.channel_leave):void 0,channel_message:u(e.channel_message)?O.fromJSON(e.channel_message):void 0,channel_message_ack:u(e.channel_message_ack)?V.fromJSON(e.channel_message_ack):void 0,channel_message_send:u(e.channel_message_send)?z.fromJSON(e.channel_message_send):void 0,error:u(e.error)?F.fromJSON(e.error):void 0,ping:u(e.ping)?K.fromJSON(e.ping):void 0,pong:u(e.pong)?Y.fromJSON(e.pong):void 0}},toJSON(e){let n={};return e.cid!==""&&(n.cid=e.cid),e.channel!==void 0&&(n.channel=H.toJSON(e.channel)),e.channel_join!==void 0&&(n.channel_join=w.toJSON(e.channel_join)),e.channel_leave!==void 0&&(n.channel_leave=q.toJSON(e.channel_leave)),e.channel_message!==void 0&&(n.channel_message=O.toJSON(e.channel_message)),e.channel_message_ack!==void 0&&(n.channel_message_ack=V.toJSON(e.channel_message_ack)),e.channel_message_send!==void 0&&(n.channel_message_send=z.toJSON(e.channel_message_send)),e.error!==void 0&&(n.error=F.toJSON(e.error)),e.ping!==void 0&&(n.ping=K.toJSON(e.ping)),e.pong!==void 0&&(n.pong=Y.toJSON(e.pong)),n},create(e){return ce.fromPartial(e!=null?e:{})},fromPartial(e){var t;let n=dn();return n.cid=(t=e.cid)!=null?t:"",n.channel=e.channel!==void 0&&e.channel!==null?H.fromPartial(e.channel):void 0,n.channel_join=e.channel_join!==void 0&&e.channel_join!==null?w.fromPartial(e.channel_join):void 0,n.channel_leave=e.channel_leave!==void 0&&e.channel_leave!==null?q.fromPartial(e.channel_leave):void 0,n.channel_message=e.channel_message!==void 0&&e.channel_message!==null?O.fromPartial(e.channel_message):void 0,n.channel_message_ack=e.channel_message_ack!==void 0&&e.channel_message_ack!==null?V.fromPartial(e.channel_message_ack):void 0,n.channel_message_send=e.channel_message_send!==void 0&&e.channel_message_send!==null?z.fromPartial(e.channel_message_send):void 0,n.error=e.error!==void 0&&e.error!==null?F.fromPartial(e.error):void 0,n.ping=e.ping!==void 0&&e.ping!==null?K.fromPartial(e.ping):void 0,n.pong=e.pong!==void 0&&e.pong!==null?Y.fromPartial(e.pong):void 0,n}};function _n(){return{id:"0",presences:[],self:void 0,chanel_label:"",clan_logo:"",category_name:""}}var H={encode(e,n=h.Writer.create()){e.id!=="0"&&n.uint32(8).int64(e.id);for(let t of e.presences)b.encode(t,n.uint32(18).fork()).ldelim();return e.self!==void 0&&b.encode(e.self,n.uint32(26).fork()).ldelim(),e.chanel_label!==""&&n.uint32(34).string(e.chanel_label),e.clan_logo!==""&&n.uint32(42).string(e.clan_logo),e.category_name!==""&&n.uint32(50).string(e.category_name),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=_n();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.id=T(t.int64());continue;case 2:if(i!==18)break;a.presences.push(b.decode(t,t.uint32()));continue;case 3:if(i!==26)break;a.self=b.decode(t,t.uint32());continue;case 4:if(i!==34)break;a.chanel_label=t.string();continue;case 5:if(i!==42)break;a.clan_logo=t.string();continue;case 6:if(i!==50)break;a.category_name=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{id:u(e.id)?globalThis.String(e.id):"0",presences:globalThis.Array.isArray(e==null?void 0:e.presences)?e.presences.map(n=>b.fromJSON(n)):[],self:u(e.self)?b.fromJSON(e.self):void 0,chanel_label:u(e.chanel_label)?globalThis.String(e.chanel_label):"",clan_logo:u(e.clan_logo)?globalThis.String(e.clan_logo):"",category_name:u(e.category_name)?globalThis.String(e.category_name):""}},toJSON(e){var t;let n={};return e.id!=="0"&&(n.id=e.id),(t=e.presences)!=null&&t.length&&(n.presences=e.presences.map(r=>b.toJSON(r))),e.self!==void 0&&(n.self=b.toJSON(e.self)),e.chanel_label!==""&&(n.chanel_label=e.chanel_label),e.clan_logo!==""&&(n.clan_logo=e.clan_logo),e.category_name!==""&&(n.category_name=e.category_name),n},create(e){return H.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o;let n=_n();return n.id=(t=e.id)!=null?t:"0",n.presences=((r=e.presences)==null?void 0:r.map(l=>b.fromPartial(l)))||[],n.self=e.self!==void 0&&e.self!==null?b.fromPartial(e.self):void 0,n.chanel_label=(a=e.chanel_label)!=null?a:"",n.clan_logo=(i=e.clan_logo)!=null?i:"",n.category_name=(o=e.category_name)!=null?o:"",n}};function un(){return{clan_id:"0",channel_id:"0",channel_type:0,is_public:!1}}var w={encode(e,n=h.Writer.create()){return e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.channel_type!==0&&n.uint32(24).int32(e.channel_type),e.is_public!==!1&&n.uint32(32).bool(e.is_public),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=un();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=T(t.int64());continue;case 2:if(i!==16)break;a.channel_id=T(t.int64());continue;case 3:if(i!==24)break;a.channel_type=t.int32();continue;case 4:if(i!==32)break;a.is_public=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:u(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",channel_type:u(e.channel_type)?globalThis.Number(e.channel_type):0,is_public:u(e.is_public)?globalThis.Boolean(e.is_public):!1}},toJSON(e){let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.channel_type!==0&&(n.channel_type=Math.round(e.channel_type)),e.is_public!==!1&&(n.is_public=e.is_public),n},create(e){return w.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i;let n=un();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.channel_type=(a=e.channel_type)!=null?a:0,n.is_public=(i=e.is_public)!=null?i:!1,n}};function fn(){return{clan_id:"0",channel_id:"0",channel_type:0,is_public:!1}}var q={encode(e,n=h.Writer.create()){return e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.channel_type!==0&&n.uint32(24).int32(e.channel_type),e.is_public!==!1&&n.uint32(32).bool(e.is_public),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=fn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=T(t.int64());continue;case 2:if(i!==16)break;a.channel_id=T(t.int64());continue;case 3:if(i!==24)break;a.channel_type=t.int32();continue;case 4:if(i!==32)break;a.is_public=t.bool();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:u(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",channel_type:u(e.channel_type)?globalThis.Number(e.channel_type):0,is_public:u(e.is_public)?globalThis.Boolean(e.is_public):!1}},toJSON(e){let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.channel_type!==0&&(n.channel_type=Math.round(e.channel_type)),e.is_public!==!1&&(n.is_public=e.is_public),n},create(e){return q.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i;let n=fn();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.channel_type=(a=e.channel_type)!=null?a:0,n.is_public=(i=e.is_public)!=null?i:!1,n}};function hn(){return{channel_id:"0",message_id:"0",code:0,username:"",create_time_seconds:0,update_time_seconds:0,persistent:void 0,clan_logo:"",category_name:""}}var V={encode(e,n=h.Writer.create()){return e.channel_id!=="0"&&n.uint32(8).int64(e.channel_id),e.message_id!=="0"&&n.uint32(16).int64(e.message_id),e.code!==0&&n.uint32(24).int32(e.code),e.username!==""&&n.uint32(34).string(e.username),e.create_time_seconds!==0&&n.uint32(40).uint32(e.create_time_seconds),e.update_time_seconds!==0&&n.uint32(48).uint32(e.update_time_seconds),e.persistent!==void 0&&me.encode({value:e.persistent},n.uint32(58).fork()).ldelim(),e.clan_logo!==""&&n.uint32(66).string(e.clan_logo),e.category_name!==""&&n.uint32(74).string(e.category_name),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=hn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.channel_id=T(t.int64());continue;case 2:if(i!==16)break;a.message_id=T(t.int64());continue;case 3:if(i!==24)break;a.code=t.int32();continue;case 4:if(i!==34)break;a.username=t.string();continue;case 5:if(i!==40)break;a.create_time_seconds=t.uint32();continue;case 6:if(i!==48)break;a.update_time_seconds=t.uint32();continue;case 7:if(i!==58)break;a.persistent=me.decode(t,t.uint32()).value;continue;case 8:if(i!==66)break;a.clan_logo=t.string();continue;case 9:if(i!==74)break;a.category_name=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",message_id:u(e.message_id)?globalThis.String(e.message_id):"0",code:u(e.code)?globalThis.Number(e.code):0,username:u(e.username)?globalThis.String(e.username):"",create_time_seconds:u(e.create_time_seconds)?globalThis.Number(e.create_time_seconds):0,update_time_seconds:u(e.update_time_seconds)?globalThis.Number(e.update_time_seconds):0,persistent:u(e.persistent)?!!e.persistent:void 0,clan_logo:u(e.clan_logo)?globalThis.String(e.clan_logo):"",category_name:u(e.category_name)?globalThis.String(e.category_name):""}},toJSON(e){let n={};return e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.message_id!=="0"&&(n.message_id=e.message_id),e.code!==0&&(n.code=Math.round(e.code)),e.username!==""&&(n.username=e.username),e.create_time_seconds!==0&&(n.create_time_seconds=Math.round(e.create_time_seconds)),e.update_time_seconds!==0&&(n.update_time_seconds=Math.round(e.update_time_seconds)),e.persistent!==void 0&&(n.persistent=e.persistent),e.clan_logo!==""&&(n.clan_logo=e.clan_logo),e.category_name!==""&&(n.category_name=e.category_name),n},create(e){return V.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_;let n=hn();return n.channel_id=(t=e.channel_id)!=null?t:"0",n.message_id=(r=e.message_id)!=null?r:"0",n.code=(a=e.code)!=null?a:0,n.username=(i=e.username)!=null?i:"",n.create_time_seconds=(o=e.create_time_seconds)!=null?o:0,n.update_time_seconds=(l=e.update_time_seconds)!=null?l:0,n.persistent=(c=e.persistent)!=null?c:void 0,n.clan_logo=(d=e.clan_logo)!=null?d:"",n.category_name=(_=e.category_name)!=null?_:"",n}};function pn(){return{clan_id:"0",channel_id:"0",content:"",mentions:[],attachments:[],references:[],mode:0,anonymous_message:!1,mention_everyone:!1,avatar:"",is_public:!1,code:0,topic_id:"0",id:"0"}}var z={encode(e,n=h.Writer.create()){e.clan_id!=="0"&&n.uint32(8).int64(e.clan_id),e.channel_id!=="0"&&n.uint32(16).int64(e.channel_id),e.content!==""&&n.uint32(26).string(e.content);for(let t of e.mentions)D.encode(t,n.uint32(34).fork()).ldelim();for(let t of e.attachments)v.encode(t,n.uint32(42).fork()).ldelim();for(let t of e.references)U.encode(t,n.uint32(50).fork()).ldelim();return e.mode!==0&&n.uint32(56).int32(e.mode),e.anonymous_message!==!1&&n.uint32(64).bool(e.anonymous_message),e.mention_everyone!==!1&&n.uint32(72).bool(e.mention_everyone),e.avatar!==""&&n.uint32(82).string(e.avatar),e.is_public!==!1&&n.uint32(88).bool(e.is_public),e.code!==0&&n.uint32(96).int32(e.code),e.topic_id!=="0"&&n.uint32(104).int64(e.topic_id),e.id!=="0"&&n.uint32(112).int64(e.id),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=pn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.clan_id=T(t.int64());continue;case 2:if(i!==16)break;a.channel_id=T(t.int64());continue;case 3:if(i!==26)break;a.content=t.string();continue;case 4:if(i!==34)break;a.mentions.push(D.decode(t,t.uint32()));continue;case 5:if(i!==42)break;a.attachments.push(v.decode(t,t.uint32()));continue;case 6:if(i!==50)break;a.references.push(U.decode(t,t.uint32()));continue;case 7:if(i!==56)break;a.mode=t.int32();continue;case 8:if(i!==64)break;a.anonymous_message=t.bool();continue;case 9:if(i!==72)break;a.mention_everyone=t.bool();continue;case 10:if(i!==82)break;a.avatar=t.string();continue;case 11:if(i!==88)break;a.is_public=t.bool();continue;case 12:if(i!==96)break;a.code=t.int32();continue;case 13:if(i!==104)break;a.topic_id=T(t.int64());continue;case 14:if(i!==112)break;a.id=T(t.int64());continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{clan_id:u(e.clan_id)?globalThis.String(e.clan_id):"0",channel_id:u(e.channel_id)?globalThis.String(e.channel_id):"0",content:u(e.content)?globalThis.String(e.content):"",mentions:globalThis.Array.isArray(e==null?void 0:e.mentions)?e.mentions.map(n=>D.fromJSON(n)):[],attachments:globalThis.Array.isArray(e==null?void 0:e.attachments)?e.attachments.map(n=>v.fromJSON(n)):[],references:globalThis.Array.isArray(e==null?void 0:e.references)?e.references.map(n=>U.fromJSON(n)):[],mode:u(e.mode)?globalThis.Number(e.mode):0,anonymous_message:u(e.anonymous_message)?globalThis.Boolean(e.anonymous_message):!1,mention_everyone:u(e.mention_everyone)?globalThis.Boolean(e.mention_everyone):!1,avatar:u(e.avatar)?globalThis.String(e.avatar):"",is_public:u(e.is_public)?globalThis.Boolean(e.is_public):!1,code:u(e.code)?globalThis.Number(e.code):0,topic_id:u(e.topic_id)?globalThis.String(e.topic_id):"0",id:u(e.id)?globalThis.String(e.id):"0"}},toJSON(e){var t,r,a;let n={};return e.clan_id!=="0"&&(n.clan_id=e.clan_id),e.channel_id!=="0"&&(n.channel_id=e.channel_id),e.content!==""&&(n.content=e.content),(t=e.mentions)!=null&&t.length&&(n.mentions=e.mentions.map(i=>D.toJSON(i))),(r=e.attachments)!=null&&r.length&&(n.attachments=e.attachments.map(i=>v.toJSON(i))),(a=e.references)!=null&&a.length&&(n.references=e.references.map(i=>U.toJSON(i))),e.mode!==0&&(n.mode=Math.round(e.mode)),e.anonymous_message!==!1&&(n.anonymous_message=e.anonymous_message),e.mention_everyone!==!1&&(n.mention_everyone=e.mention_everyone),e.avatar!==""&&(n.avatar=e.avatar),e.is_public!==!1&&(n.is_public=e.is_public),e.code!==0&&(n.code=Math.round(e.code)),e.topic_id!=="0"&&(n.topic_id=e.topic_id),e.id!=="0"&&(n.id=e.id),n},create(e){return z.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l,c,d,_,p,y,x,M,I;let n=pn();return n.clan_id=(t=e.clan_id)!=null?t:"0",n.channel_id=(r=e.channel_id)!=null?r:"0",n.content=(a=e.content)!=null?a:"",n.mentions=((i=e.mentions)==null?void 0:i.map(C=>D.fromPartial(C)))||[],n.attachments=((o=e.attachments)==null?void 0:o.map(C=>v.fromPartial(C)))||[],n.references=((l=e.references)==null?void 0:l.map(C=>U.fromPartial(C)))||[],n.mode=(c=e.mode)!=null?c:0,n.anonymous_message=(d=e.anonymous_message)!=null?d:!1,n.mention_everyone=(_=e.mention_everyone)!=null?_:!1,n.avatar=(p=e.avatar)!=null?p:"",n.is_public=(y=e.is_public)!=null?y:!1,n.code=(x=e.code)!=null?x:0,n.topic_id=(M=e.topic_id)!=null?M:"0",n.id=(I=e.id)!=null?I:"0",n}};function mn(){return{code:0,message:"",context:{}}}var F={encode(e,n=h.Writer.create()){return e.code!==0&&n.uint32(8).int32(e.code),e.message!==""&&n.uint32(18).string(e.message),Object.entries(e.context).forEach(([t,r])=>{Ne.encode({key:t,value:r},n.uint32(26).fork()).ldelim()}),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=mn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.code=t.int32();continue;case 2:if(i!==18)break;a.message=t.string();continue;case 3:if(i!==26)break;let o=Ne.decode(t,t.uint32());o.value!==void 0&&(a.context[o.key]=o.value);continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{code:u(e.code)?globalThis.Number(e.code):0,message:u(e.message)?globalThis.String(e.message):"",context:xn(e.context)?Object.entries(e.context).reduce((n,[t,r])=>(n[t]=String(r),n),{}):{}}},toJSON(e){let n={};if(e.code!==0&&(n.code=Math.round(e.code)),e.message!==""&&(n.message=e.message),e.context){let t=Object.entries(e.context);t.length>0&&(n.context={},t.forEach(([r,a])=>{n.context[r]=a}))}return n},create(e){return F.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a;let n=mn();return n.code=(t=e.code)!=null?t:0,n.message=(r=e.message)!=null?r:"",n.context=Object.entries((a=e.context)!=null?a:{}).reduce((i,[o,l])=>(l!==void 0&&(i[o]=globalThis.String(l)),i),{}),n}};function gn(){return{key:"",value:""}}var Ne={encode(e,n=h.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=gn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==10)break;a.key=t.string();continue;case 2:if(i!==18)break;a.value=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{key:u(e.key)?globalThis.String(e.key):"",value:u(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return Ne.fromPartial(e!=null?e:{})},fromPartial(e){var t,r;let n=gn();return n.key=(t=e.key)!=null?t:"",n.value=(r=e.value)!=null?r:"",n}};function yn(){return{}}var K={encode(e,n=h.Writer.create()){return n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=yn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return K.fromPartial(e!=null?e:{})},fromPartial(e){return yn()}};function kn(){return{}}var Y={encode(e,n=h.Writer.create()){return n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=kn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return Y.fromPartial(e!=null?e:{})},fromPartial(e){return kn()}};function Sn(){return{user_id:"0",session_id:"",username:"",status:void 0,is_mobile:!1,user_status:""}}var b={encode(e,n=h.Writer.create()){return e.user_id!=="0"&&n.uint32(8).int64(e.user_id),e.session_id!==""&&n.uint32(18).string(e.session_id),e.username!==""&&n.uint32(26).string(e.username),e.status!==void 0&&ge.encode({value:e.status},n.uint32(34).fork()).ldelim(),e.is_mobile!==!1&&n.uint32(40).bool(e.is_mobile),e.user_status!==""&&n.uint32(50).string(e.user_status),n},decode(e,n){let t=e instanceof h.Reader?e:h.Reader.create(e),r=n===void 0?t.len:t.pos+n,a=Sn();for(;t.pos<r;){let i=t.uint32();switch(i>>>3){case 1:if(i!==8)break;a.user_id=T(t.int64());continue;case 2:if(i!==18)break;a.session_id=t.string();continue;case 3:if(i!==26)break;a.username=t.string();continue;case 4:if(i!==34)break;a.status=ge.decode(t,t.uint32()).value;continue;case 5:if(i!==40)break;a.is_mobile=t.bool();continue;case 6:if(i!==50)break;a.user_status=t.string();continue}if((i&7)===4||i===0)break;t.skipType(i&7)}return a},fromJSON(e){return{user_id:u(e.user_id)?globalThis.String(e.user_id):"0",session_id:u(e.session_id)?globalThis.String(e.session_id):"",username:u(e.username)?globalThis.String(e.username):"",status:u(e.status)?String(e.status):void 0,is_mobile:u(e.is_mobile)?globalThis.Boolean(e.is_mobile):!1,user_status:u(e.user_status)?globalThis.String(e.user_status):""}},toJSON(e){let n={};return e.user_id!=="0"&&(n.user_id=e.user_id),e.session_id!==""&&(n.session_id=e.session_id),e.username!==""&&(n.username=e.username),e.status!==void 0&&(n.status=e.status),e.is_mobile!==!1&&(n.is_mobile=e.is_mobile),e.user_status!==""&&(n.user_status=e.user_status),n},create(e){return b.fromPartial(e!=null?e:{})},fromPartial(e){var t,r,a,i,o,l;let n=Sn();return n.user_id=(t=e.user_id)!=null?t:"0",n.session_id=(r=e.session_id)!=null?r:"",n.username=(a=e.username)!=null?a:"",n.status=(i=e.status)!=null?i:void 0,n.is_mobile=(o=e.is_mobile)!=null?o:!1,n.user_status=(l=e.user_status)!=null?l:"",n}};function T(e){return e.toString()}h.util.Long!==cn&&(h.util.Long=cn,h.configure());function xn(e){return typeof e=="object"&&e!==null}function u(e){return e!=null}var R=class{constructor(){}get onClose(){return this._socket.onclose}set onClose(n){this._socket.onclose=n}get onError(){return this._socket.onerror}set onError(n){this._socket.onerror=n}get onMessage(){return this._socket.onmessage}set onMessage(n){n?this._socket.onmessage=t=>{let r=t.data,a=new Uint8Array(r),i=ce.decode(a);i.channel_message&&i.channel_message.code==null&&(i.channel_message.code=0),n(i)}:n=null}get onOpen(){return this._socket.onopen}set onOpen(n){this._socket.onopen=n}isOpen(){var n;return((n=this._socket)==null?void 0:n.readyState)==WebSocket.OPEN}close(){var n;(n=this._socket)==null||n.close(),this._socket=void 0}connect(n,t,r,a,i,o,l){l&&l.addEventListener("abort",()=>{this.close()});let c=r?`:${r}`:"",d=`${n}${t}${c}/ws?lang=en&status=${encodeURIComponent(a.toString())}&token=${encodeURIComponent(i)}&format=protobuf&platform=${encodeURIComponent(o)}`;this._socket=new WebSocket(d),this._socket.binaryType="arraybuffer"}send(n){let r=ce.encode(ce.fromPartial(n)).finish();this._socket.send(r)}};var vn=!1,k={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},A=class A{constructor(n,t,r=!1,a=!1,i=new R,o=A.DefaultSendTimeoutMs){this.host=n;this.port=t;this.useSSL=r;this.verbose=a;this.adapter=i;this.sendTimeoutMs=o;this.cIds={},this.nextCid=1,this._heartbeatTimeoutMs=A.DefaultHeartbeatTimeoutMs,this._connectionState=k.DISCONNECTED}generatecid(){let n=this.nextCid.toString();return++this.nextCid,n}isOpen(){return this._connectionState===k.CONNECTED}connect(n,t=!1,r="",a=A.DefaultConnectTimeoutMs,i){if(this._connectionState===k.CONNECTED)return Promise.resolve(n);if(this._connectionState===k.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=k.CONNECTING;let o=this.useSSL?"wss://":"ws://";this.adapter.connect(o,this.host,this.port,t,n.token,r,i),this.adapter.onClose=c=>{this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(c)},this.adapter.onMessage=c=>g(this,null,function*(){if(this.verbose&&window&&window.console&&console.log("Response: %o",JSON.stringify(c)),c.cid){let d=this.cIds[c.cid];if(!d){this.verbose&&window&&window.console&&console.error("No promise executor for message: %o",c);return}delete this.cIds[c.cid],c.error?d.reject(c.error):d.resolve(c)}else if(c.channel_message){let d=In(c);this.onchannelmessage(d)}else this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",c)});let l=new Promise((c,d)=>{this.adapter.onOpen=_=>{this.verbose&&window&&window.console&&console.log(_);let p=vn;vn=!0,this.clearConnectTimeout(),this._connectionState=k.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,c(n),p&&this.onreconnect(_)},this.adapter.onError=_=>{this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(_),this._connectPromise=void 0,this.adapter.close(),d(_)},this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.close(),this._connectPromise=void 0,d("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},a)});return this._connectPromise=l,this._connectPromise}disconnect(n=!0){this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.isOpen()&&this.adapter.close(),n&&this.ondisconnect({})}setHeartbeatTimeoutMs(n){this._heartbeatTimeoutMs=n}getHeartbeatTimeoutMs(){return this._heartbeatTimeoutMs}onreconnect(n){this.verbose&&window&&window.console&&console.log(n)}ondisconnect(n){this.verbose&&window&&window.console&&console.log(n)}onerror(n){this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop(),this.verbose&&window&&window.console&&console.log(n)}onheartbeattimeout(){this.verbose&&window&&window.console&&console.log("Heartbeat timeout.")}onchannelmessage(n){this.verbose&&window&&window.console&&console.log(n)}send(n,t=A.DefaultSendTimeoutMs){let r=n;return new Promise((a,i)=>{var o,l;if(!this.adapter.isOpen())i("Socket connection has not been established yet.");else{r.channel_message_send?r.channel_message_send.content=JSON.stringify(r.channel_message_send.content):r.channel_message_update?r.channel_message_update.content=JSON.stringify(r.channel_message_update.content):r.ephemeral_message_send?r.ephemeral_message_send.message.content=JSON.stringify((o=r.ephemeral_message_send.message)==null?void 0:o.content):r.quick_menu_event&&(r.quick_menu_event.message.content=JSON.stringify((l=r.quick_menu_event.message)==null?void 0:l.content));let c=this.generatecid();this.cIds[c]={resolve:a,reject:i},t!==1/0&&t>0&&setTimeout(()=>{i("The socket timed out while waiting for a response.")},t),r.cid=c,this.adapter.send(r)}})}joinChat(n,t,r,a){return g(this,null,function*(){return(yield this.send({channel_join:{clan_id:n,channel_id:t,channel_type:r,is_public:a}})).channel})}leaveChat(n,t,r,a){return g(this,null,function*(){return this.send({channel_leave:{clan_id:n,channel_id:t,channel_type:r,is_public:a}})})}writeChatMessage(n,t,r,a,i,o,l,c,d,_,p){return g(this,null,function*(){return(yield this.send({channel_message_send:{clan_id:n,channel_id:t,mode:r,is_public:a,content:i,reactions:[],mentions:[],attachments:o,references:[],anonymous_message:l,mention_everyone:c,avatar:d,code:_,topic_id:p}},1/0)).channel_message_ack})}pingPong(){return g(this,null,function*(){if(!this.isOpen()){this._connectionState=k.DISCONNECTED,this.stopHeartbeatLoop();return}try{yield this.send({ping:{}},this._heartbeatTimeoutMs)}catch(n){this._connectionState=k.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)}};A.DefaultHeartbeatTimeoutMs=1e4,A.DefaultSendTimeoutMs=1e4,A.DefaultConnectTimeoutMs=3e4;var de=A;function In(e){var n,t;try{n=pe(e.channel_message.content)}catch(a){console.log("content is invalid",a)}try{t=tn(e.channel_message.attachments)}catch(a){console.log("attachments is invalid",a)}var r={id:e.id||e.channel_message.message_id,avatar:e.channel_message.avatar,channel_id:e.channel_message.channel_id,mode:e.channel_message.mode,channel_label:e.channel_message.channel_label,clan_id:e.channel_message.clan_id,code:e.channel_message.code,message_id:e.channel_message.message_id,sender_id:e.channel_message.sender_id,update_time:e.channel_message.update_time,clan_logo:e.channel_message.clan_logo,category_name:e.channel_message.category_name,username:e.channel_message.username,clan_nick:e.channel_message.clan_nick,clan_avatar:e.channel_message.clan_avatar,display_name:e.channel_message.display_name,content:n,attachments:t==null?void 0:t.attachments,hide_editted:e.channel_message.hide_editted,is_public:e.channel_message.is_public,create_time_seconds:e.channel_message.create_time_seconds,update_time_seconds:e.channel_message.update_time_seconds,topic_id:e.channel_message.topic_id};return r}var _e=class extends Error{constructor(t,r){super(t!=null?t:"Authentication failed.");this.statusCode=r;this.name="AuthenticationError"}},ye=class extends Error{constructor(n){super(n!=null?n:"Session error."),this.name="SessionError"}};function Re(e){let n=new URL(e);return`${n.protocol==="https:"?"https://":"http://"}${n.hostname}:${n.port}`}var Oe=class e{constructor(n,t,r){this.refreshTokenPromise=null;this._session=n,this._client=t,this._userId=r}get userId(){return this._userId}get session(){return this._session}get client(){return this._client}static initClient(n){let{token:t,refresh_token:r,api_url:a,ws_url:i,user_id:o,serverkey:l}=n;if(!t||!r||!a||!i||!o)throw new ye("Missing required fields: token, refresh_token, api_url, ws_url, and user_id are all required");let c=ae.restore(t,r,a,i,!0),d=new le(l||B,7e3,Re(a));return new e(c,d,o)}static authenticate(n){return g(this,null,function*(){let{id_token:t,user_id:r,username:a,serverkey:i=B,gateway_url:o=Se}=n,l=new le(i||B,7e3,Re(o)),c={id_token:t,user_id:r,username:a},d=yield l.authenticateIdToken(i,"",c);if(!d)throw new _e("Authentication failed: No response from server.");if(!d.token||!d.refresh_token||!d.api_url||!d.ws_url||!d.user_id)throw new _e("Invalid authentication response: missing required fields");let _=ae.restore(d.token,d.refresh_token,d.api_url,d.ws_url,!0);return l.setBasePath(Re(d.api_url)),new e(_,l,d.user_id)})}createDM(n){return g(this,null,function*(){let t={type:3,channel_private:1,user_ids:[n]};return this._client.createChannelDesc(this._session.token,t)})}createGroupDM(n){return g(this,null,function*(){if(n.length===0)throw new Error("At least one user ID is required for a group DM");let t={type:2,channel_private:1,user_ids:n};return this._client.createChannelDesc(this._session.token,t)})}uploadAttachment(n){return g(this,null,function*(){return this._client.uploadAttachmentFile(this._session.token,n)})}refreshSession(){return g(this,null,function*(){return this._session?(this._session.created&&this._session.expires_at-this._session.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"),this._session.created&&this._session.refresh_expires_at-this._session.created_at<3700&&console.warn("Session refresh lifetime too short, please set '--session.refresh_token_expiry_sec' option. See the documentation for more info: https://mezon.vn/docs/mezon/getting-started/configuration/#session"),this.refreshTokenPromise?this.refreshTokenPromise:(this.refreshTokenPromise=new Promise((n,t)=>g(this,null,function*(){try{let r=yield this.client.sessionRefresh(this._client.serverKey||B,"",{token:this._session.refresh_token,vars:this._session.vars,is_remember:this._session.is_remember});this._session.update(r.token,r.refresh_token,r.is_remember||!1),this.onRefreshSession(r),n(this._session)}catch(r){console.error("Session refresh failed:",r),t(r)}finally{this.refreshTokenPromise=null}})),this.refreshTokenPromise)):(console.error("Cannot refresh a null session."),this._session)})}createSocket(n=!1,t=new R,r=de.DefaultSendTimeoutMs){let{host:a,port:i,useSSL:o}={host:this._session.ws_url,port:"443",useSSL:!0};return new de(a,i,o,n,t,r)}onRefreshSession(n){console.log(`Token refresh occurred. Token: ${n.token}`)}isSessionExpired(){return this._session.isexpired(Date.now()/1e3)}isRefreshSessionExpired(){return this._session.isrefreshexpired(Date.now()/1e3)}getToken(){return this._session.token}getRefreshToken(){return this._session.refresh_token}getSession(){return this.session}exportSession(){return{token:this._session.token,refresh_token:this._session.refresh_token,api_url:this._session.api_url||"",ws_url:this._session.ws_url||"",user_id:this._userId}}};var L=class extends Error{constructor(n){super(n),this.name="SocketError"}};function Tn(r){return g(this,arguments,function*(e,n=20,t=100){var l;let a=0,i=t,o=e;for(;a<n;){if((l=o.adapter)!=null&&l.isOpen())return;yield new Promise(c=>setTimeout(c,i)),i*=2,a++}throw new L(`Socket failed to connect after ${n} attempts (total wait: ~${Math.pow(2,n)*t}ms)`)})}var De=class{constructor(n,t){this._client=n;this._session=t;this._socket=null;this._isConnected=!1;this._messageHandlers=[]}get isConnected(){return this._isConnected}get socket(){if(!this._socket)throw new L("Socket is not connected. Call connect() first.");return this._socket}connect(){return g(this,arguments,function*(n={}){if(this._isConnected)throw new L("Socket is already connected. Call disconnect() first.");let{onError:t,onDisconnect:r,verbose:a=!1}=n;this._errorHandler=t,this._disconnectHandler=r,this._socket=this._client.createSocket(a,new R),this._socket.onerror=i=>{var o;(o=this._errorHandler)==null||o.call(this,i)},this._socket.ondisconnect=()=>{var i;this._isConnected=!1,(i=this._disconnectHandler)==null||i.call(this)},this._socket.onchannelmessage=i=>{var o;if(!i){(o=this._errorHandler)==null||o.call(this,new L("Received null or undefined channel message"));return}this._messageHandlers.forEach(l=>{try{l(i)}catch(c){console.error("Error in message handler:",c)}})},yield this._socket.connect(this._session,!0,"0"),this._isConnected=!0})}disconnect(){this._socket&&(this._socket.disconnect(!0),this._socket=null,this._isConnected=!1)}setChannelMessageHandler(n){this.onChannelMessage(n)}onChannelMessage(n){return this._messageHandlers.push(n),()=>{let t=this._messageHandlers.indexOf(n);t!==-1&&this._messageHandlers.splice(t,1)}}joinDMChannel(n){return g(this,null,function*(){yield Tn(this.socket),yield this.socket.joinChat(N,n,3,!1)})}joinGroupChannel(n){return g(this,null,function*(){yield Tn(this.socket),yield this.socket.joinChat(N,n,2,!1)})}leaveDMChannel(n){return g(this,null,function*(){yield this.socket.leaveChat(N,n,3,!1)})}leaveGroupChannel(n){return g(this,null,function*(){yield this.socket.leaveChat(N,n,2,!1)})}sendDM(n){return g(this,null,function*(){let{channelId:t,content:r,attachments:a,hideLink:i=!1,code:o=0}=n;yield this.socket.writeChatMessage(N,t,4,!1,r,a,!1,i,"",o)})}sendGroup(n){return g(this,null,function*(){let{channelId:t,content:r,attachments:a,hideLink:i=!1}=n;yield this.socket.writeChatMessage(N,t,3,!1,r,a,!1,i,"",0)})}setErrorHandler(n){this._errorHandler=n,this._socket&&(this._socket.onerror=n)}};export{_e as AuthenticationError,J as CHANNEL_TYPE_DM,W as CHANNEL_TYPE_GROUP,N as CLAN_DM,B as DEFAULT_SERVER_KEY,Oe as LightClient,De as LightSocket,Se as MEZON_GW_URL,ve as SOCKET_READY_MAX_RETRY,Te as SOCKET_READY_RETRY_DELAY,Ce as STREAM_MODE_DM,be as STREAM_MODE_GROUP,ye as SessionError,L as SocketError};
|
package/dist/src/types.d.ts
CHANGED
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACrC,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACrC,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAClB,8BAA8B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/long/types.d.ts","../../../node_modules/long/index.d.ts","../node_modules/protobufjs/index.d.ts","../node_modules/protobufjs/minimal.d.ts","../src/proto/api.ts","../src/utils.ts","../../../node_modules/js-base64/base64.d.mts","../src/api.gen.ts","../src/session.ts","../src/constants.ts","../src/types.ts","../src/google/protobuf/wrappers.ts","../src/proto/realtime.ts","../src/web_socket_adapter_pb.ts","../src/socket.gen.ts","../src/client.ts","../src/socket.ts","../src/index.ts","../../../node_modules/@babel/types/lib/index.d.ts","../../../node_modules/@types/babel__generator/index.d.ts","../../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../../node_modules/@types/babel__template/index.d.ts","../../../node_modules/@types/babel__traverse/index.d.ts","../../../node_modules/@types/babel__core/index.d.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../node_modules/@types/node/web-globals/blob.d.ts","../../../node_modules/@types/node/web-globals/console.d.ts","../../../node_modules/@types/node/web-globals/crypto.d.ts","../../../node_modules/@types/node/web-globals/domexception.d.ts","../../../node_modules/@types/node/web-globals/encoding.d.ts","../../../node_modules/@types/node/web-globals/events.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/utility.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client-stats.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/h2c-client.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-call-history.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/snapshot-agent.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cache-interceptor.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/web-globals/fetch.d.ts","../../../node_modules/@types/node/web-globals/importmeta.d.ts","../../../node_modules/@types/node/web-globals/messaging.d.ts","../../../node_modules/@types/node/web-globals/navigator.d.ts","../../../node_modules/@types/node/web-globals/performance.d.ts","../../../node_modules/@types/node/web-globals/storage.d.ts","../../../node_modules/@types/node/web-globals/streams.d.ts","../../../node_modules/@types/node/web-globals/timers.d.ts","../../../node_modules/@types/node/web-globals/url.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/inspector.generated.d.ts","../../../node_modules/@types/node/inspector/promises.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/path/posix.d.ts","../../../node_modules/@types/node/path/win32.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/quic.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/sqlite.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/test/reporters.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/util/types.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/better-sqlite3/index.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/eslint/use-at-your-own-risk.d.ts","../../../node_modules/@types/eslint/index.d.ts","../../../node_modules/@eslint/core/dist/cjs/types.d.cts","../../../node_modules/eslint/lib/types/use-at-your-own-risk.d.ts","../../../node_modules/eslint/lib/types/index.d.ts","../../../node_modules/@types/eslint-scope/index.d.ts","../../../node_modules/minimatch/dist/commonjs/ast.d.ts","../../../node_modules/minimatch/dist/commonjs/escape.d.ts","../../../node_modules/minimatch/dist/commonjs/unescape.d.ts","../../../node_modules/minimatch/dist/commonjs/index.d.ts","../../../node_modules/@types/glob/index.d.ts","../../../node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/hast/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/@jest/expect-utils/build/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/@sinclair/typebox/typebox.d.ts","../../../node_modules/@jest/schemas/build/index.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/expect/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts","../../../node_modules/@types/long/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/prettier/index.d.ts","../../../node_modules/@types/resolve/index.d.ts","../../../node_modules/@types/stack-utils/index.d.ts","../../../node_modules/@types/uuid/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts"],"fileIdsList":[[67,75,138,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169,197],[75,138,146,150,153,155,156,157,169,217],[67,68,69,70,71,75,138,146,150,153,155,156,157,169],[67,69,75,138,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169,194],[75,138,146,150,153,155,156,157,169,196,202],[75,138,146,150,153,155,156,157,169,196,197,198],[75,138,146,150,153,155,156,157,169,199],[75,138,146,149,150,153,155,156,157,169,194,207],[75,138,146,150,153,155,156,157,169,210],[75,138,146,150,153,155,156,157,169,212],[75,138,146,150,153,155,156,157,169,213],[75,138,146,150,153,155,156,157,169,219,222],[75,135,136,138,146,150,153,155,156,157,169],[75,137,138,146,150,153,155,156,157,169],[138,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169,177],[75,138,139,144,146,149,150,153,155,156,157,159,169,174,186],[75,138,139,140,146,149,150,153,155,156,157,169],[75,138,141,146,150,153,155,156,157,169,187],[75,138,142,143,146,150,153,155,156,157,160,169],[75,138,143,146,150,153,155,156,157,169,174,183],[75,138,144,146,149,150,153,155,156,157,159,169],[75,137,138,145,146,150,153,155,156,157,169],[75,138,146,147,150,153,155,156,157,169],[75,138,146,148,149,150,153,155,156,157,169],[75,137,138,146,149,150,153,155,156,157,169],[75,138,146,149,150,151,153,155,156,157,169,174,186],[75,138,146,149,150,151,153,155,156,157,169,174,177],[75,125,138,146,149,150,152,153,155,156,157,159,169,174,186],[75,138,146,149,150,152,153,155,156,157,159,169,174,183,186],[75,138,146,150,152,153,154,155,156,157,169,174,183,186],[73,74,75,76,77,78,79,80,81,82,83,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193],[75,138,146,149,150,153,155,156,157,169],[75,138,146,150,153,155,157,169],[75,138,146,150,153,155,156,157,158,169,186],[75,138,146,149,150,153,155,156,157,159,169,174],[75,138,146,150,153,155,156,157,160,169],[75,138,146,150,153,155,156,157,161,169],[75,138,146,149,150,153,155,156,157,164,169],[75,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193],[75,138,146,150,153,155,156,157,166,169],[75,138,146,150,153,155,156,157,167,169],[75,138,143,146,150,153,155,156,157,159,169,177],[75,138,146,149,150,153,155,156,157,169,170],[75,138,146,150,153,155,156,157,169,171,187,190],[75,138,146,149,150,153,155,156,157,169,174,176,177],[75,138,146,150,153,155,156,157,169,175,177],[75,138,146,150,153,155,156,157,169,177,187],[75,138,146,150,153,155,156,157,169,178],[75,135,138,146,150,153,155,156,157,169,174,180],[75,138,146,150,153,155,156,157,169,174,179],[75,138,146,149,150,153,155,156,157,169,181,182],[75,138,146,150,153,155,156,157,169,181,182],[75,138,143,146,150,153,155,156,157,159,169,174,183],[75,138,146,150,153,155,156,157,169,184],[75,138,146,150,153,155,156,157,159,169,185],[75,138,146,150,152,153,155,156,157,167,169,186],[75,138,146,150,153,155,156,157,169,187,188],[75,138,143,146,150,153,155,156,157,169,188],[75,138,146,150,153,155,156,157,169,174,189],[75,138,146,150,153,155,156,157,158,169,190],[75,138,146,150,153,155,156,157,169,191],[75,138,141,146,150,153,155,156,157,169],[75,138,143,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169,187],[75,125,138,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169,186],[75,138,146,150,153,155,156,157,169,192],[75,138,146,150,153,155,156,157,164,169],[75,138,146,150,153,155,156,157,169,182],[75,125,138,146,149,150,151,153,155,156,157,164,169,174,177,186,189,190,192],[75,138,146,150,153,155,156,157,169,174,193],[75,138,146,149,150,152,153,154,155,156,157,159,169,174,183,186,193,194],[75,138,146,150,153,155,156,157,169,232],[75,138,146,150,153,155,156,157,169,196,200,201],[75,138,146,150,153,155,156,157,169,202],[75,138,146,150,153,155,156,157,169,215,221],[75,138,146,150,153,155,156,157,169,219],[75,138,146,150,153,155,156,157,169,216,220],[49,75,138,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169,207],[75,138,146,150,153,155,156,157,169,204,205,206],[75,138,146,150,153,155,156,157,169,218],[75,91,94,97,98,138,146,150,153,155,156,157,169,186],[75,94,138,146,150,153,155,156,157,169,174,186],[75,94,98,138,146,150,153,155,156,157,169,186],[75,138,146,150,153,155,156,157,169,174],[75,88,138,146,150,153,155,156,157,169],[75,92,138,146,150,153,155,156,157,169],[75,90,91,94,138,146,150,153,155,156,157,169,186],[75,138,146,150,153,155,156,157,159,169,183],[75,88,138,146,150,153,155,156,157,169,194],[75,90,94,138,146,150,153,155,156,157,159,169,186],[75,85,86,87,89,93,138,146,149,150,153,155,156,157,169,174,186],[75,94,102,110,138,146,150,153,155,156,157,169],[75,86,92,138,146,150,153,155,156,157,169],[75,94,119,120,138,146,150,153,155,156,157,169],[75,86,89,94,138,146,150,153,155,156,157,169,177,186,194],[75,94,138,146,150,153,155,156,157,169],[75,90,94,138,146,150,153,155,156,157,169,186],[75,85,138,146,150,153,155,156,157,169],[75,88,89,90,92,93,94,95,96,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,120,121,122,123,124,138,146,150,153,155,156,157,169],[75,94,112,115,138,146,150,153,155,156,157,169],[75,94,102,103,104,138,146,150,153,155,156,157,169],[75,92,94,103,105,138,146,150,153,155,156,157,169],[75,93,138,146,150,153,155,156,157,169],[75,86,88,94,138,146,150,153,155,156,157,169],[75,94,98,103,105,138,146,150,153,155,156,157,169],[75,98,138,146,150,153,155,156,157,169],[75,92,94,97,138,146,150,153,155,156,157,169,186],[75,86,90,94,102,138,146,150,153,155,156,157,169],[75,94,112,138,146,150,153,155,156,157,169],[75,105,138,146,150,153,155,156,157,169],[75,88,94,119,138,146,150,153,155,156,157,169,177,192,194],[51,75,138,146,150,153,155,156,157,169],[53,54,55,75,138,146,150,153,155,156,157,169],[56,57,58,59,62,63,75,138,146,150,153,155,156,157,169],[50,52,75,138,146,150,153,155,156,157,169],[58,59,64,65,75,138,146,150,153,155,156,157,169],[50,52,53,60,75,138,146,150,153,155,156,157,169],[55,75,138,146,150,153,155,156,157,169],[54,56,57,61,62,75,138,146,150,153,155,156,157,169],[56,57,58,59,62,63,64,75,138,146,150,153,155,156,157,169],[56,75,138,146,150,153,155,156,157,169],[53,75,138,146,150,153,155,156,157,169],[61,75,138,146,150,153,155,156,157,169]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"196cb558a13d4533a5163286f30b0509ce0210e4b316c56c38d4c0fd2fb38405","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"84206a85be8e7e8f9307c1d5c087aedb4d389e05b755234aa8f37cc22f717aaf","impliedFormat":99},{"version":"b040cca7e788c8de6fb758eaf4f0e5887d4e4591a829aa1d2379650f065516a2","impliedFormat":99},{"version":"116b961153d86b304e788884c4a05630fe98423bcfc14c7a7ea8d542092aac10","impliedFormat":1},{"version":"932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","impliedFormat":1},{"version":"1a3d9c139dd72963bf3a5d91e161b362f07546532f1f06facc0f5396f25884e5","signature":"60a84033713569426c978a5c75dbd5e40a0f2b0f17578198ea2e3dd7517f5e6c"},{"version":"08a7795bac113c1612f1a21fed82e9f4cde79ba646533e60cd03a6d863ea89ff","signature":"1cb716f426798f5cb335e9a0b394efc25505958b2657cf5ced3e880f3c5aaeeb"},{"version":"5918ed78e08ab39292daad19a5890e2cfb43d9334475ad18398f9ec7a2ecab6d","impliedFormat":99},{"version":"9f021c518e3174265f19346c7fdf2ab657d2929f4e3959333e1a9716e72acc9d","signature":"7fe2a5f8c3726098aaab3445d6bb9aa0d6b83f0dff0f95f6f076137a532cd2f3"},{"version":"bca722c4e203ded1d21ef0b13019801778000b8e68b0ee1b6f86c99a2d941781","signature":"02c203f395d04e9e34351a6403c01b67d701f1edbdde5aeef3f9457959af71ee"},{"version":"f91adad20587df4c04b22e05e0550394fdb2fdcd0703e3357a6ac190e415df37","signature":"69d228042a92f16beee4c8a00861a0981635089d5b800aa6e92abb5282bed6dd"},{"version":"fcb5a7b621c1c8bf5f649e07f7b93ae54d31e102ec233b520f91073d36bf6b10","signature":"1b27834c06b255c576a8138976dd5e42c87c5d1f498475180eb1616dfc1285de"},{"version":"8fe1e8cc1408dca188975d976cfb70d5a892e3dbd288f32bb1364c1fc711e845","signature":"3498a019ba1c72ce00ab5c27377fd33af48547d734f1a5cca5f372a83d2842e1"},{"version":"6025f976624b1183a4737db38fd2b9cab2895c8d0aed8aabd29fa3268c8140bb","signature":"4565447ddf35de967d3c8f6bfda8e24f3e128cee9d9d34d5f83d04bd000d0762"},{"version":"44f9f881debbabd6db638dbd42f3d67f3dc9e3ddc4e33d129941229333afd99d","signature":"3772848bd1cf05696aaf3874f998f914a0cace669807ac3dd0e6991e3f67ffb4"},{"version":"397f2fcc40d684e9eda9c24f758cf6b18b7b358262a99739f0386266a2932aca","signature":"47b202a98248f81e0f0defa6d286152336f2364374bbffacbb9b2eaf83ddcb12"},{"version":"9130bfd66699ca67b2c5ef33141435ab67f3e470cae78bbf50503aac0d0dbccb","signature":"609c77a4828b366ed87edb6e00d0cbdb64600b266631bca134aeacc259393ea7"},{"version":"b56ac7205ce88458cdaa1bd2acac61a4c894871d52cc6d736cab6b8f4a271724","signature":"a5d325e259a4d395f5b83ccef481d992184a42287fbfd46dccc4e482c76a9751"},{"version":"3c31743d2cc5edd9b0e975a48a2180a93786639082df531a8b948deae3b7b124","signature":"8875e8781471ff16fabaee50ed48601809f4822c78dd60944ce7adbda508d953"},{"version":"511a5f4f77165dc1b73ceae1e28b4a8f78f3443d8e18a1fd43bfafd2b0133bbe","impliedFormat":1},{"version":"b6d03c9cfe2cf0ba4c673c209fcd7c46c815b2619fd2aad59fc4229aaef2ed43","impliedFormat":1},{"version":"95aba78013d782537cc5e23868e736bec5d377b918990e28ed56110e3ae8b958","impliedFormat":1},{"version":"670a76db379b27c8ff42f1ba927828a22862e2ab0b0908e38b671f0e912cc5ed","impliedFormat":1},{"version":"13b77ab19ef7aadd86a1e54f2f08ea23a6d74e102909e3c00d31f231ed040f62","impliedFormat":1},{"version":"069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"0ccdaa19852d25ecd84eec365c3bfa16e7859cadecf6e9ca6d0dbbbee439743f","affectsGlobalScope":true,"impliedFormat":1},{"version":"438b41419b1df9f1fbe33b5e1b18f5853432be205991d1b19f5b7f351675541e","affectsGlobalScope":true,"impliedFormat":1},{"version":"096116f8fedc1765d5bd6ef360c257b4a9048e5415054b3bf3c41b07f8951b0b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5e01375c9e124a83b52ee4b3244ed1a4d214a6cfb54ac73e164a823a4a7860a","affectsGlobalScope":true,"impliedFormat":1},{"version":"f90ae2bbce1505e67f2f6502392e318f5714bae82d2d969185c4a6cecc8af2fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b58e207b93a8f1c88bbf2a95ddc686ac83962b13830fe8ad3f404ffc7051fb4","affectsGlobalScope":true,"impliedFormat":1},{"version":"1fefabcb2b06736a66d2904074d56268753654805e829989a46a0161cd8412c5","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"c18a99f01eb788d849ad032b31cafd49de0b19e083fe775370834c5675d7df8e","affectsGlobalScope":true,"impliedFormat":1},{"version":"5247874c2a23b9a62d178ae84f2db6a1d54e6c9a2e7e057e178cc5eea13757fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"cdcf9ea426ad970f96ac930cd176d5c69c6c24eebd9fc580e1572d6c6a88f62c","impliedFormat":1},{"version":"23cd712e2ce083d68afe69224587438e5914b457b8acf87073c22494d706a3d0","impliedFormat":1},{"version":"487b694c3de27ddf4ad107d4007ad304d29effccf9800c8ae23c2093638d906a","impliedFormat":1},{"version":"3a80bc85f38526ca3b08007ee80712e7bb0601df178b23fbf0bf87036fce40ce","impliedFormat":1},{"version":"ccf4552357ce3c159ef75f0f0114e80401702228f1898bdc9402214c9499e8c0","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"68834d631c8838c715f225509cfc3927913b9cc7a4870460b5b60c8dbdb99baf","impliedFormat":1},{"version":"2931540c47ee0ff8a62860e61782eb17b155615db61e36986e54645ec67f67c2","impliedFormat":1},{"version":"ccab02f3920fc75c01174c47fcf67882a11daf16baf9e81701d0a94636e94556","impliedFormat":1},{"version":"f6faf5f74e4c4cc309a6c6a6c4da02dbb840be5d3e92905a23dcd7b2b0bd1986","impliedFormat":1},{"version":"ea6bc8de8b59f90a7a3960005fd01988f98fd0784e14bc6922dde2e93305ec7d","impliedFormat":1},{"version":"36107995674b29284a115e21a0618c4c2751b32a8766dd4cb3ba740308b16d59","impliedFormat":1},{"version":"914a0ae30d96d71915fc519ccb4efbf2b62c0ddfb3a3fc6129151076bc01dc60","impliedFormat":1},{"version":"33e981bf6376e939f99bd7f89abec757c64897d33c005036b9a10d9587d80187","impliedFormat":1},{"version":"7fd1b31fd35876b0aa650811c25ec2c97a3c6387e5473eb18004bed86cdd76b6","impliedFormat":1},{"version":"b41767d372275c154c7ea6c9d5449d9a741b8ce080f640155cc88ba1763e35b3","impliedFormat":1},{"version":"3bacf516d686d08682751a3bd2519ea3b8041a164bfb4f1d35728993e70a2426","impliedFormat":1},{"version":"7fb266686238369442bd1719bc0d7edd0199da4fb8540354e1ff7f16669b4323","impliedFormat":1},{"version":"0a60a292b89ca7218b8616f78e5bbd1c96b87e048849469cccb4355e98af959a","impliedFormat":1},{"version":"0b6e25234b4eec6ed96ab138d96eb70b135690d7dd01f3dd8a8ab291c35a683a","impliedFormat":1},{"version":"9666f2f84b985b62400d2e5ab0adae9ff44de9b2a34803c2c5bd3c8325b17dc0","impliedFormat":1},{"version":"40cd35c95e9cf22cfa5bd84e96408b6fcbca55295f4ff822390abb11afbc3dca","impliedFormat":1},{"version":"b1616b8959bf557feb16369c6124a97a0e74ed6f49d1df73bb4b9ddf68acf3f3","impliedFormat":1},{"version":"5b03a034c72146b61573aab280f295b015b9168470f2df05f6080a2122f9b4df","impliedFormat":1},{"version":"40b463c6766ca1b689bfcc46d26b5e295954f32ad43e37ee6953c0a677e4ae2b","impliedFormat":1},{"version":"249b9cab7f5d628b71308c7d9bb0a808b50b091e640ba3ed6e2d0516f4a8d91d","impliedFormat":1},{"version":"80aae6afc67faa5ac0b32b5b8bc8cc9f7fa299cff15cf09cc2e11fd28c6ae29e","impliedFormat":1},{"version":"f473cd2288991ff3221165dcf73cd5d24da30391f87e85b3dd4d0450c787a391","impliedFormat":1},{"version":"499e5b055a5aba1e1998f7311a6c441a369831c70905cc565ceac93c28083d53","impliedFormat":1},{"version":"54c3e2371e3d016469ad959697fd257e5621e16296fa67082c2575d0bf8eced0","impliedFormat":1},{"version":"beb8233b2c220cfa0feea31fbe9218d89fa02faa81ef744be8dce5acb89bb1fd","impliedFormat":1},{"version":"c183b931b68ad184bc8e8372bf663f3d33304772fb482f29fb91b3c391031f3e","impliedFormat":1},{"version":"5d0375ca7310efb77e3ef18d068d53784faf62705e0ad04569597ae0e755c401","impliedFormat":1},{"version":"59af37caec41ecf7b2e76059c9672a49e682c1a2aa6f9d7dc78878f53aa284d6","impliedFormat":1},{"version":"addf417b9eb3f938fddf8d81e96393a165e4be0d4a8b6402292f9c634b1cb00d","impliedFormat":1},{"version":"48cc3ec153b50985fb95153258a710782b25975b10dd4ac8a4f3920632d10790","impliedFormat":1},{"version":"adf27937dba6af9f08a68c5b1d3fce0ca7d4b960c57e6d6c844e7d1a8e53adae","impliedFormat":1},{"version":"e1528ca65ac90f6fa0e4a247eb656b4263c470bb22d9033e466463e13395e599","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"866078923a56d026e39243b4392e282c1c63159723996fa89243140e1388a98d","impliedFormat":1},{"version":"dd0109710de4cd93e245121ab86d8c66d20f3ead80074b68e9c3e349c4f53342","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3275d55fac10b799c9546804126239baf020d220136163f763b55a74e50e750","affectsGlobalScope":true,"impliedFormat":1},{"version":"fa68a0a3b7cb32c00e39ee3cd31f8f15b80cac97dce51b6ee7fc14a1e8deb30b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1cf059eaf468efcc649f8cf6075d3cb98e9a35a0fe9c44419ec3d2f5428d7123","affectsGlobalScope":true,"impliedFormat":1},{"version":"6c36e755bced82df7fb6ce8169265d0a7bb046ab4e2cb6d0da0cb72b22033e89","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"7a93de4ff8a63bafe62ba86b89af1df0ccb5e40bb85b0c67d6bbcfdcf96bf3d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"90e85f9bc549dfe2b5749b45fe734144e96cd5d04b38eae244028794e142a77e","affectsGlobalScope":true,"impliedFormat":1},{"version":"e0a5deeb610b2a50a6350bd23df6490036a1773a8a71d70f2f9549ab009e67ee","affectsGlobalScope":true,"impliedFormat":1},{"version":"435b3711465425770ed2ee2f1cf00ce071835265e0851a7dc4600ab4b007550e","impliedFormat":1},{"version":"7e49f52a159435fc8df4de9dc377ef5860732ca2dc9efec1640531d3cf5da7a3","impliedFormat":1},{"version":"dd4bde4bdc2e5394aed6855e98cf135dfdf5dd6468cad842e03116d31bbcc9bc","impliedFormat":1},{"version":"4d4e879009a84a47c05350b8dca823036ba3a29a3038efed1be76c9f81e45edf","affectsGlobalScope":true,"impliedFormat":1},{"version":"cf83d90d5faf27b994c2e79af02e32b555dbfe42cd9bd1571445f2168d1f4e2d","impliedFormat":1},{"version":"9ba13b47cb450a438e3076c4a3f6afb9dc85e17eae50f26d4b2d72c0688c9251","impliedFormat":1},{"version":"b64cd4401633ea4ecadfd700ddc8323a13b63b106ac7127c1d2726f32424622c","impliedFormat":1},{"version":"37c6e5fe5715814412b43cc9b50b24c67a63c4e04e753e0d1305970d65417a60","impliedFormat":1},{"version":"0e28335ac43f4d94dd2fe6d9e6fa6813570640839addd10d309d7985f33a6308","impliedFormat":1},{"version":"ee0e4946247f842c6dd483cbb60a5e6b484fee07996e3a7bc7343dfb68a04c5d","impliedFormat":1},{"version":"ef051f42b7e0ef5ca04552f54c4552eac84099d64b6c5ad0ef4033574b6035b8","impliedFormat":1},{"version":"853a43154f1d01b0173d9cbd74063507ece57170bad7a3b68f3fa1229ad0a92f","impliedFormat":1},{"version":"56231e3c39a031bfb0afb797690b20ed4537670c93c0318b72d5180833d98b72","impliedFormat":1},{"version":"5cc7c39031bfd8b00ad58f32143d59eb6ffc24f5d41a20931269011dccd36c5e","impliedFormat":1},{"version":"b0b69c61b0f0ec8ca15db4c8c41f6e77f4cacb784d42bca948f42dea33e8757e","affectsGlobalScope":true,"impliedFormat":1},{"version":"f96a48183254c00d24575401f1a761b4ce4927d927407e7862a83e06ce5d6964","impliedFormat":1},{"version":"cc25940cfb27aa538e60d465f98bb5068d4d7d33131861ace43f04fe6947d68f","impliedFormat":1},{"version":"ac86245c2f31335bfd52cbe7fc760f9fc4f165387875869a478a6d9616a95e72","impliedFormat":1},{"version":"01ff95aa1443e3f7248974e5a771f513cb2ac158c8898f470a1792f817bee497","impliedFormat":1},{"version":"9d96a7ce809392ff2cb99691acf7c62e632fe56897356ba013b689277aca3619","impliedFormat":1},{"version":"42a05d8f239f74587d4926aba8cc54792eed8e8a442c7adc9b38b516642aadfe","impliedFormat":1},{"version":"5d21b58d60383cc6ab9ad3d3e265d7d25af24a2c9b506247e0e50b0a884920be","impliedFormat":1},{"version":"101f482fd48cb4c7c0468dcc6d62c843d842977aea6235644b1edd05e81fbf22","impliedFormat":1},{"version":"ae6757460f37078884b1571a3de3ebaf724d827d7e1d53626c02b3c2a408ac63","affectsGlobalScope":true,"impliedFormat":1},{"version":"27c0a08e343c6a0ae17bd13ba6d44a9758236dc904cd5e4b43456996cd51f520","impliedFormat":1},{"version":"3ef397f12387eff17f550bc484ea7c27d21d43816bbe609d495107f44b97e933","impliedFormat":1},{"version":"1023282e2ba810bc07905d3668349fbd37a26411f0c8f94a70ef3c05fe523fcf","impliedFormat":1},{"version":"b214ebcf76c51b115453f69729ee8aa7b7f8eccdae2a922b568a45c2d7ff52f7","impliedFormat":1},{"version":"429c9cdfa7d126255779efd7e6d9057ced2d69c81859bbab32073bad52e9ba76","impliedFormat":1},{"version":"6f80e51ba310608cd71bcdc09a171d7bbfb3b316048601c9ec215ce16a8dcfbc","impliedFormat":1},{"version":"10947bb49601aeec9ea1dddf61ef6e4f8442f949bd40a8008e12b129deb037be","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f2c62938251b45715fd2a9887060ec4fbc8724727029d1cbce373747252bdd7","impliedFormat":1},{"version":"e3ace08b6bbd84655d41e244677b474fd995923ffef7149ddb68af8848b60b05","impliedFormat":1},{"version":"132580b0e86c48fab152bab850fc57a4b74fe915c8958d2ccb052b809a44b61c","impliedFormat":1},{"version":"af4ab0aa8908fc9a655bb833d3bc28e117c4f0e1038c5a891546158beb25accb","impliedFormat":1},{"version":"69c9a5a9392e8564bd81116e1ed93b13205201fb44cb35a7fde8c9f9e21c4b23","impliedFormat":1},{"version":"5f8fc37f8434691ffac1bfd8fc2634647da2c0e84253ab5d2dd19a7718915b35","impliedFormat":1},{"version":"5981c2340fd8b076cae8efbae818d42c11ffc615994cb060b1cd390795f1be2b","impliedFormat":1},{"version":"2ca2bca6845a7234eff5c3d192727a068fca72ac565f3c819c6b04ccc83dadc0","impliedFormat":1},{"version":"ed4f674fc8c0c993cc7e145069ac44129e03519b910c62be206a0cc777bdc60b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0250da3eb85c99624f974e77ef355cdf86f43980251bc371475c2b397ba55bcd","impliedFormat":1},{"version":"f1c93e046fb3d9b7f8249629f4b63dc068dd839b824dd0aa39a5e68476dc9420","impliedFormat":1},{"version":"3d3a5f27ffbc06c885dd4d5f9ee20de61faf877fe2c3a7051c4825903d9a7fdc","impliedFormat":1},{"version":"12806f9f085598ef930edaf2467a5fa1789a878fba077cd27e85dc5851e11834","impliedFormat":1},{"version":"17d06eb5709839c7ce719f0c38ada6f308fb433f2cd6d8c87b35856e07400950","impliedFormat":1},{"version":"a43fe41c33d0a192a0ecaf9b92e87bef3709c9972e6d53c42c49251ccb962d69","impliedFormat":1},{"version":"a177959203c017fad3ecc4f3d96c8757a840957a4959a3ae00dab9d35961ca6c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6fc727ccf9b36e257ff982ea0badeffbfc2c151802f741bddff00c6af3b784cf","impliedFormat":1},{"version":"2a00d005e3af99cd1cfa75220e60c61b04bfb6be7ca7453bfe2ef6cca37cc03c","impliedFormat":1},{"version":"4844a4c9b4b1e812b257676ed8a80b3f3be0e29bf05e742cc2ea9c3c6865e6c6","impliedFormat":1},{"version":"064878a60367e0407c42fb7ba02a2ea4d83257357dc20088e549bd4d89433e9c","impliedFormat":1},{"version":"14d4bd22d1b05824971b98f7e91b2484c90f1a684805c330476641417c3d9735","impliedFormat":1},{"version":"586eaf66bace2e731cee0ddfbfac326ad74a83c1acfeac4afb2db85ad23226c7","impliedFormat":1},{"version":"b484ec11ba00e3a2235562a41898d55372ccabe607986c6fa4f4aba72093749f","impliedFormat":1},{"version":"d1a14d87cedcf4f0b8173720d6eb29cc02878bf2b6dabf9c9d9cee742f275368","impliedFormat":1},{"version":"e60efae9fe48a2955f66bf4cbf0f082516185b877daf50d9c5e2a009660a7714","impliedFormat":1},{"version":"041a7781b9127ab568d2cdcce62c58fdea7c7407f40b8c50045d7866a2727130","impliedFormat":1},{"version":"b37f83e7deea729aa9ce5593f78905afb45b7532fdff63041d374f60059e7852","impliedFormat":1},{"version":"e1cb68f3ef3a8dd7b2a9dfb3de482ed6c0f1586ba0db4e7d73c1d2147b6ffc51","impliedFormat":1},{"version":"55cdbeebe76a1fa18bbd7e7bf73350a2173926bd3085bb050cf5a5397025ee4e","impliedFormat":1},{"version":"c2a6a737189ced24ffe0634e9239b087e4c26378d0490f95141b9b9b042b746c","impliedFormat":1},{"version":"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"a4a39b5714adfcadd3bbea6698ca2e942606d833bde62ad5fb6ec55f5e438ff8","impliedFormat":1},{"version":"bbc1d029093135d7d9bfa4b38cbf8761db505026cc458b5e9c8b74f4000e5e75","impliedFormat":1},{"version":"ac450542cbfd50a4d7bf0f3ec8aeedb9e95791ecc6f2b2b19367696bd303e8c6","impliedFormat":1},{"version":"8a190298d0ff502ad1c7294ba6b0abb3a290fc905b3a00603016a97c363a4c7a","impliedFormat":1},{"version":"5ba4a4a1f9fae0550de86889fb06cd997c8406795d85647cbcd992245625680c","impliedFormat":1},{"version":"1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe","impliedFormat":1},{"version":"7212c2d58855b8df35275180e97903a4b6093d4fbaefea863d8d028da63938c6","impliedFormat":1},{"version":"de0199a112f75809a7f80ec071495159dcf3e434bc021347e0175627398264c3","impliedFormat":1},{"version":"1a2bed55cfa62b4649485df27c0e560b04d4da4911e3a9f0475468721495563f","impliedFormat":1},{"version":"854045924626ba585f454b53531c42aed4365f02301aa8eca596423f4675b71f","impliedFormat":1},{"version":"fd326577c62145816fe1acc306c734c2396487f76719d3785d4e825b34540b33","impliedFormat":1},{"version":"afe73051ff6a03a9565cbd8ebb0e956ee3df5e913ad5c1ded64218aabfa3dcb5","impliedFormat":1},{"version":"89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","impliedFormat":1},{"version":"79b4369233a12c6fa4a07301ecb7085802c98f3a77cf9ab97eee27e1656f82e6","impliedFormat":1},{"version":"035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","impliedFormat":1},{"version":"a4809f4d92317535e6b22b01019437030077a76fec1d93b9881c9ed4738fcc54","impliedFormat":1},{"version":"5f53fa0bd22096d2a78533f94e02c899143b8f0f9891a46965294ee8b91a9434","impliedFormat":1},{"version":"763e521cf114b80e0dd0e21ca49b9f8ae62e8999555a5e7bade8ce36b33001c2","impliedFormat":1},{"version":"0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","impliedFormat":1},{"version":"3054ef91b855e005b9c4681399e9d64d2a7b07a22d539314d794f09e53b876a7","impliedFormat":1},{"version":"ffcc5500e77223169833fc6eb59b3a507944a1f89574e0a1276b0ea7fc22c4a4","impliedFormat":1},{"version":"22f13de9e2fe5f0f4724797abd3d34a1cdd6e47ef81fc4933fea3b8bf4ad524b","impliedFormat":1},{"version":"e3ba509d3dce019b3190ceb2f3fc88e2610ab717122dabd91a9efaa37804040d","impliedFormat":1},{"version":"cda0cb09b995489b7f4c57f168cd31b83dcbaa7aad49612734fb3c9c73f6e4f2","impliedFormat":1},{"version":"f72f8428f3c1caa22e9c247d046603b85b442c0dae7b77a7a0bc092c18867cb7","impliedFormat":1},{"version":"195f63105abc03e72b6a176e3e34dfb5ac932b55db378fdc7874b1617e24b465","affectsGlobalScope":true,"impliedFormat":1},{"version":"0e60e0cbf2283adfd5a15430ae548cd2f662d581b5da6ecd98220203e7067c70","impliedFormat":1},{"version":"963d59066dd6742da1918a6213a209bcc205b8ee53b1876ee2b4e6d80f97c85e","impliedFormat":1},{"version":"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","impliedFormat":1},{"version":"d88a5e779faf033be3d52142a04fbe1cb96009868e3bbdd296b2bc6c59e06c0e","impliedFormat":1},{"version":"8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","impliedFormat":1},{"version":"ab82804a14454734010dcdcd43f564ff7b0389bee4c5692eec76ff5b30d4cf66","impliedFormat":1},{"version":"fab58e600970e66547644a44bc9918e3223aa2cbd9e8763cec004b2cfb48827e","impliedFormat":1},{"version":"1ba59c8bbeed2cb75b239bb12041582fa3e8ef32f8d0bd0ec802e38442d3f317","impliedFormat":1},{"version":"bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","impliedFormat":1},{"version":"26a770cec4bd2e7dbba95c6e536390fffe83c6268b78974a93727903b515c4e7","impliedFormat":1}],"root":[53,54,[56,66]],"options":{"allowSyntheticDefaultImports":true,"alwaysStrict":true,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"inlineSources":false,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":false,"strict":true,"strictFunctionTypes":true,"strictNullChecks":true,"target":2},"referencedMap":[[69,1],[67,2],[200,3],[215,2],[218,4],[217,2],[72,5],[68,1],[70,6],[71,1],[195,7],[203,8],[199,9],[198,10],[196,2],[208,11],[209,7],[211,12],[212,2],[213,13],[214,14],[223,15],[197,2],[224,2],[225,2],[135,16],[136,16],[137,17],[75,18],[138,19],[139,20],[140,21],[73,2],[141,22],[142,23],[143,24],[144,25],[145,26],[146,27],[147,27],[148,28],[149,29],[150,30],[151,31],[76,2],[74,2],[152,32],[153,33],[154,34],[194,35],[155,36],[156,37],[157,36],[158,38],[159,39],[160,40],[161,41],[162,41],[163,41],[164,42],[165,43],[166,44],[167,45],[168,46],[169,47],[170,47],[171,48],[172,2],[173,2],[174,49],[175,50],[176,49],[177,51],[178,52],[179,53],[180,54],[181,55],[182,56],[183,57],[184,58],[185,59],[186,60],[187,61],[188,62],[189,63],[190,64],[191,65],[77,36],[78,2],[79,66],[80,67],[81,2],[82,68],[83,2],[126,69],[127,70],[128,71],[129,71],[130,72],[131,2],[132,19],[133,73],[134,70],[192,74],[193,75],[226,2],[227,2],[228,2],[229,2],[210,2],[230,2],[231,76],[232,2],[233,77],[84,2],[216,2],[202,78],[201,79],[222,80],[220,81],[221,82],[55,2],[50,83],[49,2],[204,84],[205,84],[207,85],[206,84],[219,86],[47,2],[48,2],[8,2],[10,2],[9,2],[2,2],[11,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[3,2],[19,2],[20,2],[4,2],[21,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[36,2],[33,2],[34,2],[35,2],[37,2],[7,2],[38,2],[43,2],[44,2],[39,2],[40,2],[41,2],[42,2],[1,2],[45,2],[46,2],[102,87],[114,88],[100,89],[115,90],[124,91],[91,92],[92,93],[90,94],[123,7],[118,95],[122,96],[94,97],[111,98],[93,99],[121,100],[88,101],[89,95],[95,102],[96,2],[101,103],[99,102],[86,104],[125,105],[116,106],[105,107],[104,102],[106,108],[109,109],[103,110],[107,111],[119,7],[97,112],[98,113],[110,114],[87,90],[113,115],[112,102],[108,116],[117,2],[85,2],[120,117],[51,2],[52,118],[56,119],[64,120],[58,2],[60,121],[66,122],[53,121],[61,123],[57,124],[63,125],[65,126],[59,127],[54,128],[62,129]],"latestChangedDtsFile":"./src/types.d.ts","version":"5.9.3"}
|
|
1
|
+
{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/long/types.d.ts","../../../node_modules/long/index.d.ts","../node_modules/protobufjs/index.d.ts","../node_modules/protobufjs/minimal.d.ts","../src/proto/api.ts","../src/utils.ts","../../../node_modules/js-base64/base64.d.mts","../src/api.gen.ts","../src/session.ts","../src/constants.ts","../src/types.ts","../src/google/protobuf/wrappers.ts","../src/proto/realtime.ts","../src/web_socket_adapter_pb.ts","../src/socket.gen.ts","../src/client.ts","../src/socket.ts","../src/index.ts","../../../node_modules/@babel/types/lib/index.d.ts","../../../node_modules/@types/babel__generator/index.d.ts","../../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../../node_modules/@types/babel__template/index.d.ts","../../../node_modules/@types/babel__traverse/index.d.ts","../../../node_modules/@types/babel__core/index.d.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../node_modules/@types/node/web-globals/blob.d.ts","../../../node_modules/@types/node/web-globals/console.d.ts","../../../node_modules/@types/node/web-globals/crypto.d.ts","../../../node_modules/@types/node/web-globals/domexception.d.ts","../../../node_modules/@types/node/web-globals/encoding.d.ts","../../../node_modules/@types/node/web-globals/events.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/utility.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client-stats.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/h2c-client.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-call-history.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/snapshot-agent.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/cache-interceptor.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/web-globals/fetch.d.ts","../../../node_modules/@types/node/web-globals/importmeta.d.ts","../../../node_modules/@types/node/web-globals/messaging.d.ts","../../../node_modules/@types/node/web-globals/navigator.d.ts","../../../node_modules/@types/node/web-globals/performance.d.ts","../../../node_modules/@types/node/web-globals/storage.d.ts","../../../node_modules/@types/node/web-globals/streams.d.ts","../../../node_modules/@types/node/web-globals/timers.d.ts","../../../node_modules/@types/node/web-globals/url.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/inspector.generated.d.ts","../../../node_modules/@types/node/inspector/promises.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/path/posix.d.ts","../../../node_modules/@types/node/path/win32.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/quic.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/sqlite.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/test/reporters.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/util/types.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@types/better-sqlite3/index.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/eslint/use-at-your-own-risk.d.ts","../../../node_modules/@types/eslint/index.d.ts","../../../node_modules/@eslint/core/dist/cjs/types.d.cts","../../../node_modules/eslint/lib/types/use-at-your-own-risk.d.ts","../../../node_modules/eslint/lib/types/index.d.ts","../../../node_modules/@types/eslint-scope/index.d.ts","../../../node_modules/minimatch/dist/commonjs/ast.d.ts","../../../node_modules/minimatch/dist/commonjs/escape.d.ts","../../../node_modules/minimatch/dist/commonjs/unescape.d.ts","../../../node_modules/minimatch/dist/commonjs/index.d.ts","../../../node_modules/@types/glob/index.d.ts","../../../node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/@types/unist/index.d.ts","../../../node_modules/@types/hast/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/@jest/expect-utils/build/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/@sinclair/typebox/typebox.d.ts","../../../node_modules/@jest/schemas/build/index.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/expect/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts","../../../node_modules/@types/long/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/prettier/index.d.ts","../../../node_modules/@types/resolve/index.d.ts","../../../node_modules/@types/stack-utils/index.d.ts","../../../node_modules/@types/uuid/index.d.ts","../../../node_modules/@types/ws/index.d.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts"],"fileIdsList":[[67,75,138,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169,197],[75,138,146,150,153,155,156,157,169,217],[67,68,69,70,71,75,138,146,150,153,155,156,157,169],[67,69,75,138,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169,194],[75,138,146,150,153,155,156,157,169,196,202],[75,138,146,150,153,155,156,157,169,196,197,198],[75,138,146,150,153,155,156,157,169,199],[75,138,146,149,150,153,155,156,157,169,194,207],[75,138,146,150,153,155,156,157,169,210],[75,138,146,150,153,155,156,157,169,212],[75,138,146,150,153,155,156,157,169,213],[75,138,146,150,153,155,156,157,169,219,222],[75,135,136,138,146,150,153,155,156,157,169],[75,137,138,146,150,153,155,156,157,169],[138,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169,177],[75,138,139,144,146,149,150,153,155,156,157,159,169,174,186],[75,138,139,140,146,149,150,153,155,156,157,169],[75,138,141,146,150,153,155,156,157,169,187],[75,138,142,143,146,150,153,155,156,157,160,169],[75,138,143,146,150,153,155,156,157,169,174,183],[75,138,144,146,149,150,153,155,156,157,159,169],[75,137,138,145,146,150,153,155,156,157,169],[75,138,146,147,150,153,155,156,157,169],[75,138,146,148,149,150,153,155,156,157,169],[75,137,138,146,149,150,153,155,156,157,169],[75,138,146,149,150,151,153,155,156,157,169,174,186],[75,138,146,149,150,151,153,155,156,157,169,174,177],[75,125,138,146,149,150,152,153,155,156,157,159,169,174,186],[75,138,146,149,150,152,153,155,156,157,159,169,174,183,186],[75,138,146,150,152,153,154,155,156,157,169,174,183,186],[73,74,75,76,77,78,79,80,81,82,83,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193],[75,138,146,149,150,153,155,156,157,169],[75,138,146,150,153,155,157,169],[75,138,146,150,153,155,156,157,158,169,186],[75,138,146,149,150,153,155,156,157,159,169,174],[75,138,146,150,153,155,156,157,160,169],[75,138,146,150,153,155,156,157,161,169],[75,138,146,149,150,153,155,156,157,164,169],[75,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193],[75,138,146,150,153,155,156,157,166,169],[75,138,146,150,153,155,156,157,167,169],[75,138,143,146,150,153,155,156,157,159,169,177],[75,138,146,149,150,153,155,156,157,169,170],[75,138,146,150,153,155,156,157,169,171,187,190],[75,138,146,149,150,153,155,156,157,169,174,176,177],[75,138,146,150,153,155,156,157,169,175,177],[75,138,146,150,153,155,156,157,169,177,187],[75,138,146,150,153,155,156,157,169,178],[75,135,138,146,150,153,155,156,157,169,174,180],[75,138,146,150,153,155,156,157,169,174,179],[75,138,146,149,150,153,155,156,157,169,181,182],[75,138,146,150,153,155,156,157,169,181,182],[75,138,143,146,150,153,155,156,157,159,169,174,183],[75,138,146,150,153,155,156,157,169,184],[75,138,146,150,153,155,156,157,159,169,185],[75,138,146,150,152,153,155,156,157,167,169,186],[75,138,146,150,153,155,156,157,169,187,188],[75,138,143,146,150,153,155,156,157,169,188],[75,138,146,150,153,155,156,157,169,174,189],[75,138,146,150,153,155,156,157,158,169,190],[75,138,146,150,153,155,156,157,169,191],[75,138,141,146,150,153,155,156,157,169],[75,138,143,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169,187],[75,125,138,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169,186],[75,138,146,150,153,155,156,157,169,192],[75,138,146,150,153,155,156,157,164,169],[75,138,146,150,153,155,156,157,169,182],[75,125,138,146,149,150,151,153,155,156,157,164,169,174,177,186,189,190,192],[75,138,146,150,153,155,156,157,169,174,193],[75,138,146,149,150,152,153,154,155,156,157,159,169,174,183,186,193,194],[75,138,146,150,153,155,156,157,169,232],[75,138,146,150,153,155,156,157,169,196,200,201],[75,138,146,150,153,155,156,157,169,202],[75,138,146,150,153,155,156,157,169,215,221],[75,138,146,150,153,155,156,157,169,219],[75,138,146,150,153,155,156,157,169,216,220],[49,75,138,146,150,153,155,156,157,169],[75,138,146,150,153,155,156,157,169,207],[75,138,146,150,153,155,156,157,169,204,205,206],[75,138,146,150,153,155,156,157,169,218],[75,91,94,97,98,138,146,150,153,155,156,157,169,186],[75,94,138,146,150,153,155,156,157,169,174,186],[75,94,98,138,146,150,153,155,156,157,169,186],[75,138,146,150,153,155,156,157,169,174],[75,88,138,146,150,153,155,156,157,169],[75,92,138,146,150,153,155,156,157,169],[75,90,91,94,138,146,150,153,155,156,157,169,186],[75,138,146,150,153,155,156,157,159,169,183],[75,88,138,146,150,153,155,156,157,169,194],[75,90,94,138,146,150,153,155,156,157,159,169,186],[75,85,86,87,89,93,138,146,149,150,153,155,156,157,169,174,186],[75,94,102,110,138,146,150,153,155,156,157,169],[75,86,92,138,146,150,153,155,156,157,169],[75,94,119,120,138,146,150,153,155,156,157,169],[75,86,89,94,138,146,150,153,155,156,157,169,177,186,194],[75,94,138,146,150,153,155,156,157,169],[75,90,94,138,146,150,153,155,156,157,169,186],[75,85,138,146,150,153,155,156,157,169],[75,88,89,90,92,93,94,95,96,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,120,121,122,123,124,138,146,150,153,155,156,157,169],[75,94,112,115,138,146,150,153,155,156,157,169],[75,94,102,103,104,138,146,150,153,155,156,157,169],[75,92,94,103,105,138,146,150,153,155,156,157,169],[75,93,138,146,150,153,155,156,157,169],[75,86,88,94,138,146,150,153,155,156,157,169],[75,94,98,103,105,138,146,150,153,155,156,157,169],[75,98,138,146,150,153,155,156,157,169],[75,92,94,97,138,146,150,153,155,156,157,169,186],[75,86,90,94,102,138,146,150,153,155,156,157,169],[75,94,112,138,146,150,153,155,156,157,169],[75,105,138,146,150,153,155,156,157,169],[75,88,94,119,138,146,150,153,155,156,157,169,177,192,194],[51,75,138,146,150,153,155,156,157,169],[53,54,55,75,138,146,150,153,155,156,157,169],[56,57,58,59,62,63,75,138,146,150,153,155,156,157,169],[50,52,75,138,146,150,153,155,156,157,169],[58,59,64,65,75,138,146,150,153,155,156,157,169],[50,52,53,60,75,138,146,150,153,155,156,157,169],[55,75,138,146,150,153,155,156,157,169],[54,56,57,61,62,75,138,146,150,153,155,156,157,169],[56,57,58,59,62,63,64,75,138,146,150,153,155,156,157,169],[56,75,138,146,150,153,155,156,157,169],[53,75,138,146,150,153,155,156,157,169],[61,75,138,146,150,153,155,156,157,169]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"196cb558a13d4533a5163286f30b0509ce0210e4b316c56c38d4c0fd2fb38405","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"84206a85be8e7e8f9307c1d5c087aedb4d389e05b755234aa8f37cc22f717aaf","impliedFormat":99},{"version":"b040cca7e788c8de6fb758eaf4f0e5887d4e4591a829aa1d2379650f065516a2","impliedFormat":99},{"version":"116b961153d86b304e788884c4a05630fe98423bcfc14c7a7ea8d542092aac10","impliedFormat":1},{"version":"932cade1c5802123b5831f332ad8a6297f0f7d14d0ee04f5a774408f393e2200","impliedFormat":1},{"version":"1a3d9c139dd72963bf3a5d91e161b362f07546532f1f06facc0f5396f25884e5","signature":"60a84033713569426c978a5c75dbd5e40a0f2b0f17578198ea2e3dd7517f5e6c"},{"version":"08a7795bac113c1612f1a21fed82e9f4cde79ba646533e60cd03a6d863ea89ff","signature":"1cb716f426798f5cb335e9a0b394efc25505958b2657cf5ced3e880f3c5aaeeb"},{"version":"5918ed78e08ab39292daad19a5890e2cfb43d9334475ad18398f9ec7a2ecab6d","impliedFormat":99},{"version":"9f021c518e3174265f19346c7fdf2ab657d2929f4e3959333e1a9716e72acc9d","signature":"7fe2a5f8c3726098aaab3445d6bb9aa0d6b83f0dff0f95f6f076137a532cd2f3"},{"version":"bca722c4e203ded1d21ef0b13019801778000b8e68b0ee1b6f86c99a2d941781","signature":"02c203f395d04e9e34351a6403c01b67d701f1edbdde5aeef3f9457959af71ee"},{"version":"f91adad20587df4c04b22e05e0550394fdb2fdcd0703e3357a6ac190e415df37","signature":"69d228042a92f16beee4c8a00861a0981635089d5b800aa6e92abb5282bed6dd"},{"version":"34dad0bff314b394bef5e3b8d95e0e62872850a2c179c210876da5dbcd5101a9","signature":"0519a1d04f94fc6fcaa1c63167af4ada5e5ab6c490977c7ace454eecb83633c6"},{"version":"8fe1e8cc1408dca188975d976cfb70d5a892e3dbd288f32bb1364c1fc711e845","signature":"3498a019ba1c72ce00ab5c27377fd33af48547d734f1a5cca5f372a83d2842e1"},{"version":"6025f976624b1183a4737db38fd2b9cab2895c8d0aed8aabd29fa3268c8140bb","signature":"4565447ddf35de967d3c8f6bfda8e24f3e128cee9d9d34d5f83d04bd000d0762"},{"version":"44f9f881debbabd6db638dbd42f3d67f3dc9e3ddc4e33d129941229333afd99d","signature":"3772848bd1cf05696aaf3874f998f914a0cace669807ac3dd0e6991e3f67ffb4"},{"version":"397f2fcc40d684e9eda9c24f758cf6b18b7b358262a99739f0386266a2932aca","signature":"47b202a98248f81e0f0defa6d286152336f2364374bbffacbb9b2eaf83ddcb12"},{"version":"9130bfd66699ca67b2c5ef33141435ab67f3e470cae78bbf50503aac0d0dbccb","signature":"609c77a4828b366ed87edb6e00d0cbdb64600b266631bca134aeacc259393ea7"},{"version":"5dded81b528a89d25e9de25d1126124d9e03af9fba4bdd71076c80d04adb04c6","signature":"a5d325e259a4d395f5b83ccef481d992184a42287fbfd46dccc4e482c76a9751"},{"version":"3c31743d2cc5edd9b0e975a48a2180a93786639082df531a8b948deae3b7b124","signature":"8875e8781471ff16fabaee50ed48601809f4822c78dd60944ce7adbda508d953"},{"version":"511a5f4f77165dc1b73ceae1e28b4a8f78f3443d8e18a1fd43bfafd2b0133bbe","impliedFormat":1},{"version":"b6d03c9cfe2cf0ba4c673c209fcd7c46c815b2619fd2aad59fc4229aaef2ed43","impliedFormat":1},{"version":"95aba78013d782537cc5e23868e736bec5d377b918990e28ed56110e3ae8b958","impliedFormat":1},{"version":"670a76db379b27c8ff42f1ba927828a22862e2ab0b0908e38b671f0e912cc5ed","impliedFormat":1},{"version":"13b77ab19ef7aadd86a1e54f2f08ea23a6d74e102909e3c00d31f231ed040f62","impliedFormat":1},{"version":"069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"0ccdaa19852d25ecd84eec365c3bfa16e7859cadecf6e9ca6d0dbbbee439743f","affectsGlobalScope":true,"impliedFormat":1},{"version":"438b41419b1df9f1fbe33b5e1b18f5853432be205991d1b19f5b7f351675541e","affectsGlobalScope":true,"impliedFormat":1},{"version":"096116f8fedc1765d5bd6ef360c257b4a9048e5415054b3bf3c41b07f8951b0b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5e01375c9e124a83b52ee4b3244ed1a4d214a6cfb54ac73e164a823a4a7860a","affectsGlobalScope":true,"impliedFormat":1},{"version":"f90ae2bbce1505e67f2f6502392e318f5714bae82d2d969185c4a6cecc8af2fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b58e207b93a8f1c88bbf2a95ddc686ac83962b13830fe8ad3f404ffc7051fb4","affectsGlobalScope":true,"impliedFormat":1},{"version":"1fefabcb2b06736a66d2904074d56268753654805e829989a46a0161cd8412c5","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"c18a99f01eb788d849ad032b31cafd49de0b19e083fe775370834c5675d7df8e","affectsGlobalScope":true,"impliedFormat":1},{"version":"5247874c2a23b9a62d178ae84f2db6a1d54e6c9a2e7e057e178cc5eea13757fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"cdcf9ea426ad970f96ac930cd176d5c69c6c24eebd9fc580e1572d6c6a88f62c","impliedFormat":1},{"version":"23cd712e2ce083d68afe69224587438e5914b457b8acf87073c22494d706a3d0","impliedFormat":1},{"version":"487b694c3de27ddf4ad107d4007ad304d29effccf9800c8ae23c2093638d906a","impliedFormat":1},{"version":"3a80bc85f38526ca3b08007ee80712e7bb0601df178b23fbf0bf87036fce40ce","impliedFormat":1},{"version":"ccf4552357ce3c159ef75f0f0114e80401702228f1898bdc9402214c9499e8c0","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"68834d631c8838c715f225509cfc3927913b9cc7a4870460b5b60c8dbdb99baf","impliedFormat":1},{"version":"2931540c47ee0ff8a62860e61782eb17b155615db61e36986e54645ec67f67c2","impliedFormat":1},{"version":"ccab02f3920fc75c01174c47fcf67882a11daf16baf9e81701d0a94636e94556","impliedFormat":1},{"version":"f6faf5f74e4c4cc309a6c6a6c4da02dbb840be5d3e92905a23dcd7b2b0bd1986","impliedFormat":1},{"version":"ea6bc8de8b59f90a7a3960005fd01988f98fd0784e14bc6922dde2e93305ec7d","impliedFormat":1},{"version":"36107995674b29284a115e21a0618c4c2751b32a8766dd4cb3ba740308b16d59","impliedFormat":1},{"version":"914a0ae30d96d71915fc519ccb4efbf2b62c0ddfb3a3fc6129151076bc01dc60","impliedFormat":1},{"version":"33e981bf6376e939f99bd7f89abec757c64897d33c005036b9a10d9587d80187","impliedFormat":1},{"version":"7fd1b31fd35876b0aa650811c25ec2c97a3c6387e5473eb18004bed86cdd76b6","impliedFormat":1},{"version":"b41767d372275c154c7ea6c9d5449d9a741b8ce080f640155cc88ba1763e35b3","impliedFormat":1},{"version":"3bacf516d686d08682751a3bd2519ea3b8041a164bfb4f1d35728993e70a2426","impliedFormat":1},{"version":"7fb266686238369442bd1719bc0d7edd0199da4fb8540354e1ff7f16669b4323","impliedFormat":1},{"version":"0a60a292b89ca7218b8616f78e5bbd1c96b87e048849469cccb4355e98af959a","impliedFormat":1},{"version":"0b6e25234b4eec6ed96ab138d96eb70b135690d7dd01f3dd8a8ab291c35a683a","impliedFormat":1},{"version":"9666f2f84b985b62400d2e5ab0adae9ff44de9b2a34803c2c5bd3c8325b17dc0","impliedFormat":1},{"version":"40cd35c95e9cf22cfa5bd84e96408b6fcbca55295f4ff822390abb11afbc3dca","impliedFormat":1},{"version":"b1616b8959bf557feb16369c6124a97a0e74ed6f49d1df73bb4b9ddf68acf3f3","impliedFormat":1},{"version":"5b03a034c72146b61573aab280f295b015b9168470f2df05f6080a2122f9b4df","impliedFormat":1},{"version":"40b463c6766ca1b689bfcc46d26b5e295954f32ad43e37ee6953c0a677e4ae2b","impliedFormat":1},{"version":"249b9cab7f5d628b71308c7d9bb0a808b50b091e640ba3ed6e2d0516f4a8d91d","impliedFormat":1},{"version":"80aae6afc67faa5ac0b32b5b8bc8cc9f7fa299cff15cf09cc2e11fd28c6ae29e","impliedFormat":1},{"version":"f473cd2288991ff3221165dcf73cd5d24da30391f87e85b3dd4d0450c787a391","impliedFormat":1},{"version":"499e5b055a5aba1e1998f7311a6c441a369831c70905cc565ceac93c28083d53","impliedFormat":1},{"version":"54c3e2371e3d016469ad959697fd257e5621e16296fa67082c2575d0bf8eced0","impliedFormat":1},{"version":"beb8233b2c220cfa0feea31fbe9218d89fa02faa81ef744be8dce5acb89bb1fd","impliedFormat":1},{"version":"c183b931b68ad184bc8e8372bf663f3d33304772fb482f29fb91b3c391031f3e","impliedFormat":1},{"version":"5d0375ca7310efb77e3ef18d068d53784faf62705e0ad04569597ae0e755c401","impliedFormat":1},{"version":"59af37caec41ecf7b2e76059c9672a49e682c1a2aa6f9d7dc78878f53aa284d6","impliedFormat":1},{"version":"addf417b9eb3f938fddf8d81e96393a165e4be0d4a8b6402292f9c634b1cb00d","impliedFormat":1},{"version":"48cc3ec153b50985fb95153258a710782b25975b10dd4ac8a4f3920632d10790","impliedFormat":1},{"version":"adf27937dba6af9f08a68c5b1d3fce0ca7d4b960c57e6d6c844e7d1a8e53adae","impliedFormat":1},{"version":"e1528ca65ac90f6fa0e4a247eb656b4263c470bb22d9033e466463e13395e599","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"866078923a56d026e39243b4392e282c1c63159723996fa89243140e1388a98d","impliedFormat":1},{"version":"dd0109710de4cd93e245121ab86d8c66d20f3ead80074b68e9c3e349c4f53342","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3275d55fac10b799c9546804126239baf020d220136163f763b55a74e50e750","affectsGlobalScope":true,"impliedFormat":1},{"version":"fa68a0a3b7cb32c00e39ee3cd31f8f15b80cac97dce51b6ee7fc14a1e8deb30b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1cf059eaf468efcc649f8cf6075d3cb98e9a35a0fe9c44419ec3d2f5428d7123","affectsGlobalScope":true,"impliedFormat":1},{"version":"6c36e755bced82df7fb6ce8169265d0a7bb046ab4e2cb6d0da0cb72b22033e89","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"7a93de4ff8a63bafe62ba86b89af1df0ccb5e40bb85b0c67d6bbcfdcf96bf3d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"90e85f9bc549dfe2b5749b45fe734144e96cd5d04b38eae244028794e142a77e","affectsGlobalScope":true,"impliedFormat":1},{"version":"e0a5deeb610b2a50a6350bd23df6490036a1773a8a71d70f2f9549ab009e67ee","affectsGlobalScope":true,"impliedFormat":1},{"version":"435b3711465425770ed2ee2f1cf00ce071835265e0851a7dc4600ab4b007550e","impliedFormat":1},{"version":"7e49f52a159435fc8df4de9dc377ef5860732ca2dc9efec1640531d3cf5da7a3","impliedFormat":1},{"version":"dd4bde4bdc2e5394aed6855e98cf135dfdf5dd6468cad842e03116d31bbcc9bc","impliedFormat":1},{"version":"4d4e879009a84a47c05350b8dca823036ba3a29a3038efed1be76c9f81e45edf","affectsGlobalScope":true,"impliedFormat":1},{"version":"cf83d90d5faf27b994c2e79af02e32b555dbfe42cd9bd1571445f2168d1f4e2d","impliedFormat":1},{"version":"9ba13b47cb450a438e3076c4a3f6afb9dc85e17eae50f26d4b2d72c0688c9251","impliedFormat":1},{"version":"b64cd4401633ea4ecadfd700ddc8323a13b63b106ac7127c1d2726f32424622c","impliedFormat":1},{"version":"37c6e5fe5715814412b43cc9b50b24c67a63c4e04e753e0d1305970d65417a60","impliedFormat":1},{"version":"0e28335ac43f4d94dd2fe6d9e6fa6813570640839addd10d309d7985f33a6308","impliedFormat":1},{"version":"ee0e4946247f842c6dd483cbb60a5e6b484fee07996e3a7bc7343dfb68a04c5d","impliedFormat":1},{"version":"ef051f42b7e0ef5ca04552f54c4552eac84099d64b6c5ad0ef4033574b6035b8","impliedFormat":1},{"version":"853a43154f1d01b0173d9cbd74063507ece57170bad7a3b68f3fa1229ad0a92f","impliedFormat":1},{"version":"56231e3c39a031bfb0afb797690b20ed4537670c93c0318b72d5180833d98b72","impliedFormat":1},{"version":"5cc7c39031bfd8b00ad58f32143d59eb6ffc24f5d41a20931269011dccd36c5e","impliedFormat":1},{"version":"b0b69c61b0f0ec8ca15db4c8c41f6e77f4cacb784d42bca948f42dea33e8757e","affectsGlobalScope":true,"impliedFormat":1},{"version":"f96a48183254c00d24575401f1a761b4ce4927d927407e7862a83e06ce5d6964","impliedFormat":1},{"version":"cc25940cfb27aa538e60d465f98bb5068d4d7d33131861ace43f04fe6947d68f","impliedFormat":1},{"version":"ac86245c2f31335bfd52cbe7fc760f9fc4f165387875869a478a6d9616a95e72","impliedFormat":1},{"version":"01ff95aa1443e3f7248974e5a771f513cb2ac158c8898f470a1792f817bee497","impliedFormat":1},{"version":"9d96a7ce809392ff2cb99691acf7c62e632fe56897356ba013b689277aca3619","impliedFormat":1},{"version":"42a05d8f239f74587d4926aba8cc54792eed8e8a442c7adc9b38b516642aadfe","impliedFormat":1},{"version":"5d21b58d60383cc6ab9ad3d3e265d7d25af24a2c9b506247e0e50b0a884920be","impliedFormat":1},{"version":"101f482fd48cb4c7c0468dcc6d62c843d842977aea6235644b1edd05e81fbf22","impliedFormat":1},{"version":"ae6757460f37078884b1571a3de3ebaf724d827d7e1d53626c02b3c2a408ac63","affectsGlobalScope":true,"impliedFormat":1},{"version":"27c0a08e343c6a0ae17bd13ba6d44a9758236dc904cd5e4b43456996cd51f520","impliedFormat":1},{"version":"3ef397f12387eff17f550bc484ea7c27d21d43816bbe609d495107f44b97e933","impliedFormat":1},{"version":"1023282e2ba810bc07905d3668349fbd37a26411f0c8f94a70ef3c05fe523fcf","impliedFormat":1},{"version":"b214ebcf76c51b115453f69729ee8aa7b7f8eccdae2a922b568a45c2d7ff52f7","impliedFormat":1},{"version":"429c9cdfa7d126255779efd7e6d9057ced2d69c81859bbab32073bad52e9ba76","impliedFormat":1},{"version":"6f80e51ba310608cd71bcdc09a171d7bbfb3b316048601c9ec215ce16a8dcfbc","impliedFormat":1},{"version":"10947bb49601aeec9ea1dddf61ef6e4f8442f949bd40a8008e12b129deb037be","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f2c62938251b45715fd2a9887060ec4fbc8724727029d1cbce373747252bdd7","impliedFormat":1},{"version":"e3ace08b6bbd84655d41e244677b474fd995923ffef7149ddb68af8848b60b05","impliedFormat":1},{"version":"132580b0e86c48fab152bab850fc57a4b74fe915c8958d2ccb052b809a44b61c","impliedFormat":1},{"version":"af4ab0aa8908fc9a655bb833d3bc28e117c4f0e1038c5a891546158beb25accb","impliedFormat":1},{"version":"69c9a5a9392e8564bd81116e1ed93b13205201fb44cb35a7fde8c9f9e21c4b23","impliedFormat":1},{"version":"5f8fc37f8434691ffac1bfd8fc2634647da2c0e84253ab5d2dd19a7718915b35","impliedFormat":1},{"version":"5981c2340fd8b076cae8efbae818d42c11ffc615994cb060b1cd390795f1be2b","impliedFormat":1},{"version":"2ca2bca6845a7234eff5c3d192727a068fca72ac565f3c819c6b04ccc83dadc0","impliedFormat":1},{"version":"ed4f674fc8c0c993cc7e145069ac44129e03519b910c62be206a0cc777bdc60b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0250da3eb85c99624f974e77ef355cdf86f43980251bc371475c2b397ba55bcd","impliedFormat":1},{"version":"f1c93e046fb3d9b7f8249629f4b63dc068dd839b824dd0aa39a5e68476dc9420","impliedFormat":1},{"version":"3d3a5f27ffbc06c885dd4d5f9ee20de61faf877fe2c3a7051c4825903d9a7fdc","impliedFormat":1},{"version":"12806f9f085598ef930edaf2467a5fa1789a878fba077cd27e85dc5851e11834","impliedFormat":1},{"version":"17d06eb5709839c7ce719f0c38ada6f308fb433f2cd6d8c87b35856e07400950","impliedFormat":1},{"version":"a43fe41c33d0a192a0ecaf9b92e87bef3709c9972e6d53c42c49251ccb962d69","impliedFormat":1},{"version":"a177959203c017fad3ecc4f3d96c8757a840957a4959a3ae00dab9d35961ca6c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6fc727ccf9b36e257ff982ea0badeffbfc2c151802f741bddff00c6af3b784cf","impliedFormat":1},{"version":"2a00d005e3af99cd1cfa75220e60c61b04bfb6be7ca7453bfe2ef6cca37cc03c","impliedFormat":1},{"version":"4844a4c9b4b1e812b257676ed8a80b3f3be0e29bf05e742cc2ea9c3c6865e6c6","impliedFormat":1},{"version":"064878a60367e0407c42fb7ba02a2ea4d83257357dc20088e549bd4d89433e9c","impliedFormat":1},{"version":"14d4bd22d1b05824971b98f7e91b2484c90f1a684805c330476641417c3d9735","impliedFormat":1},{"version":"586eaf66bace2e731cee0ddfbfac326ad74a83c1acfeac4afb2db85ad23226c7","impliedFormat":1},{"version":"b484ec11ba00e3a2235562a41898d55372ccabe607986c6fa4f4aba72093749f","impliedFormat":1},{"version":"d1a14d87cedcf4f0b8173720d6eb29cc02878bf2b6dabf9c9d9cee742f275368","impliedFormat":1},{"version":"e60efae9fe48a2955f66bf4cbf0f082516185b877daf50d9c5e2a009660a7714","impliedFormat":1},{"version":"041a7781b9127ab568d2cdcce62c58fdea7c7407f40b8c50045d7866a2727130","impliedFormat":1},{"version":"b37f83e7deea729aa9ce5593f78905afb45b7532fdff63041d374f60059e7852","impliedFormat":1},{"version":"e1cb68f3ef3a8dd7b2a9dfb3de482ed6c0f1586ba0db4e7d73c1d2147b6ffc51","impliedFormat":1},{"version":"55cdbeebe76a1fa18bbd7e7bf73350a2173926bd3085bb050cf5a5397025ee4e","impliedFormat":1},{"version":"c2a6a737189ced24ffe0634e9239b087e4c26378d0490f95141b9b9b042b746c","impliedFormat":1},{"version":"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","impliedFormat":1},{"version":"f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","impliedFormat":1},{"version":"a4a39b5714adfcadd3bbea6698ca2e942606d833bde62ad5fb6ec55f5e438ff8","impliedFormat":1},{"version":"bbc1d029093135d7d9bfa4b38cbf8761db505026cc458b5e9c8b74f4000e5e75","impliedFormat":1},{"version":"ac450542cbfd50a4d7bf0f3ec8aeedb9e95791ecc6f2b2b19367696bd303e8c6","impliedFormat":1},{"version":"8a190298d0ff502ad1c7294ba6b0abb3a290fc905b3a00603016a97c363a4c7a","impliedFormat":1},{"version":"5ba4a4a1f9fae0550de86889fb06cd997c8406795d85647cbcd992245625680c","impliedFormat":1},{"version":"1f68ab0e055994eb337b67aa87d2a15e0200951e9664959b3866ee6f6b11a0fe","impliedFormat":1},{"version":"7212c2d58855b8df35275180e97903a4b6093d4fbaefea863d8d028da63938c6","impliedFormat":1},{"version":"de0199a112f75809a7f80ec071495159dcf3e434bc021347e0175627398264c3","impliedFormat":1},{"version":"1a2bed55cfa62b4649485df27c0e560b04d4da4911e3a9f0475468721495563f","impliedFormat":1},{"version":"854045924626ba585f454b53531c42aed4365f02301aa8eca596423f4675b71f","impliedFormat":1},{"version":"fd326577c62145816fe1acc306c734c2396487f76719d3785d4e825b34540b33","impliedFormat":1},{"version":"afe73051ff6a03a9565cbd8ebb0e956ee3df5e913ad5c1ded64218aabfa3dcb5","impliedFormat":1},{"version":"89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","impliedFormat":1},{"version":"79b4369233a12c6fa4a07301ecb7085802c98f3a77cf9ab97eee27e1656f82e6","impliedFormat":1},{"version":"035a5df183489c2e22f3cf59fc1ed2b043d27f357eecc0eb8d8e840059d44245","impliedFormat":1},{"version":"a4809f4d92317535e6b22b01019437030077a76fec1d93b9881c9ed4738fcc54","impliedFormat":1},{"version":"5f53fa0bd22096d2a78533f94e02c899143b8f0f9891a46965294ee8b91a9434","impliedFormat":1},{"version":"763e521cf114b80e0dd0e21ca49b9f8ae62e8999555a5e7bade8ce36b33001c2","impliedFormat":1},{"version":"0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","impliedFormat":1},{"version":"3054ef91b855e005b9c4681399e9d64d2a7b07a22d539314d794f09e53b876a7","impliedFormat":1},{"version":"ffcc5500e77223169833fc6eb59b3a507944a1f89574e0a1276b0ea7fc22c4a4","impliedFormat":1},{"version":"22f13de9e2fe5f0f4724797abd3d34a1cdd6e47ef81fc4933fea3b8bf4ad524b","impliedFormat":1},{"version":"e3ba509d3dce019b3190ceb2f3fc88e2610ab717122dabd91a9efaa37804040d","impliedFormat":1},{"version":"cda0cb09b995489b7f4c57f168cd31b83dcbaa7aad49612734fb3c9c73f6e4f2","impliedFormat":1},{"version":"f72f8428f3c1caa22e9c247d046603b85b442c0dae7b77a7a0bc092c18867cb7","impliedFormat":1},{"version":"195f63105abc03e72b6a176e3e34dfb5ac932b55db378fdc7874b1617e24b465","affectsGlobalScope":true,"impliedFormat":1},{"version":"0e60e0cbf2283adfd5a15430ae548cd2f662d581b5da6ecd98220203e7067c70","impliedFormat":1},{"version":"963d59066dd6742da1918a6213a209bcc205b8ee53b1876ee2b4e6d80f97c85e","impliedFormat":1},{"version":"22293bd6fa12747929f8dfca3ec1684a3fe08638aa18023dd286ab337e88a592","impliedFormat":1},{"version":"d88a5e779faf033be3d52142a04fbe1cb96009868e3bbdd296b2bc6c59e06c0e","impliedFormat":1},{"version":"8baa5d0febc68db886c40bf341e5c90dc215a90cd64552e47e8184be6b7e3358","impliedFormat":1},{"version":"ab82804a14454734010dcdcd43f564ff7b0389bee4c5692eec76ff5b30d4cf66","impliedFormat":1},{"version":"fab58e600970e66547644a44bc9918e3223aa2cbd9e8763cec004b2cfb48827e","impliedFormat":1},{"version":"1ba59c8bbeed2cb75b239bb12041582fa3e8ef32f8d0bd0ec802e38442d3f317","impliedFormat":1},{"version":"bae8d023ef6b23df7da26f51cea44321f95817c190342a36882e93b80d07a960","impliedFormat":1},{"version":"26a770cec4bd2e7dbba95c6e536390fffe83c6268b78974a93727903b515c4e7","impliedFormat":1}],"root":[53,54,[56,66]],"options":{"allowSyntheticDefaultImports":true,"alwaysStrict":true,"composite":true,"declaration":true,"declarationMap":true,"downlevelIteration":true,"emitDeclarationOnly":true,"esModuleInterop":true,"inlineSources":false,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","removeComments":false,"skipLibCheck":true,"sourceMap":false,"strict":true,"strictFunctionTypes":true,"strictNullChecks":true,"target":2},"referencedMap":[[69,1],[67,2],[200,3],[215,2],[218,4],[217,2],[72,5],[68,1],[70,6],[71,1],[195,7],[203,8],[199,9],[198,10],[196,2],[208,11],[209,7],[211,12],[212,2],[213,13],[214,14],[223,15],[197,2],[224,2],[225,2],[135,16],[136,16],[137,17],[75,18],[138,19],[139,20],[140,21],[73,2],[141,22],[142,23],[143,24],[144,25],[145,26],[146,27],[147,27],[148,28],[149,29],[150,30],[151,31],[76,2],[74,2],[152,32],[153,33],[154,34],[194,35],[155,36],[156,37],[157,36],[158,38],[159,39],[160,40],[161,41],[162,41],[163,41],[164,42],[165,43],[166,44],[167,45],[168,46],[169,47],[170,47],[171,48],[172,2],[173,2],[174,49],[175,50],[176,49],[177,51],[178,52],[179,53],[180,54],[181,55],[182,56],[183,57],[184,58],[185,59],[186,60],[187,61],[188,62],[189,63],[190,64],[191,65],[77,36],[78,2],[79,66],[80,67],[81,2],[82,68],[83,2],[126,69],[127,70],[128,71],[129,71],[130,72],[131,2],[132,19],[133,73],[134,70],[192,74],[193,75],[226,2],[227,2],[228,2],[229,2],[210,2],[230,2],[231,76],[232,2],[233,77],[84,2],[216,2],[202,78],[201,79],[222,80],[220,81],[221,82],[55,2],[50,83],[49,2],[204,84],[205,84],[207,85],[206,84],[219,86],[47,2],[48,2],[8,2],[10,2],[9,2],[2,2],[11,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[3,2],[19,2],[20,2],[4,2],[21,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[36,2],[33,2],[34,2],[35,2],[37,2],[7,2],[38,2],[43,2],[44,2],[39,2],[40,2],[41,2],[42,2],[1,2],[45,2],[46,2],[102,87],[114,88],[100,89],[115,90],[124,91],[91,92],[92,93],[90,94],[123,7],[118,95],[122,96],[94,97],[111,98],[93,99],[121,100],[88,101],[89,95],[95,102],[96,2],[101,103],[99,102],[86,104],[125,105],[116,106],[105,107],[104,102],[106,108],[109,109],[103,110],[107,111],[119,7],[97,112],[98,113],[110,114],[87,90],[113,115],[112,102],[108,116],[117,2],[85,2],[120,117],[51,2],[52,118],[56,119],[64,120],[58,2],[60,121],[66,122],[53,121],[61,123],[57,124],[63,125],[65,126],[59,127],[54,128],[62,129]],"latestChangedDtsFile":"./src/types.d.ts","version":"5.9.3"}
|