@cloudflare/realtimekit 0.5.0-staging.66 → 0.5.0-staging.68

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/mock.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function at(e){let t=typeof e;if(t=="object"){if(Array.isArray(e))return"array";if(e===null)return"null"}return t}function Dn(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}let X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ie=[];for(let e=0;e<X.length;e++)Ie[X[e].charCodeAt(0)]=e;Ie["-".charCodeAt(0)]=X.indexOf("+");Ie["_".charCodeAt(0)]=X.indexOf("/");function Fn(e){let t=e.length*3/4;e[e.length-2]=="="?t-=2:e[e.length-1]=="="&&(t-=1);let n=new Uint8Array(t),s=0,r=0,o,l=0;for(let p=0;p<e.length;p++){if(o=Ie[e.charCodeAt(p)],o===void 0)switch(e[p]){case"=":r=0;case`
2
- `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(r){case 0:l=o,r=1;break;case 1:n[s++]=l<<2|(o&48)>>4,l=o,r=2;break;case 2:n[s++]=(l&15)<<4|(o&60)>>2,l=o,r=3;break;case 3:n[s++]=(l&3)<<6|o,r=0;break}}if(r==1)throw Error("invalid base64 string.");return n.subarray(0,s)}function Mn(e){let t="",n=0,s,r=0;for(let o=0;o<e.length;o++)switch(s=e[o],n){case 0:t+=X[s>>2],r=(s&3)<<4,n=1;break;case 1:t+=X[r|s>>4],r=(s&15)<<2,n=2;break;case 2:t+=X[r|s>>6],t+=X[s&63],n=0;break}return n&&(t+=X[r],t+="=",n==1&&(t+="=")),t}var be;(function(e){e.symbol=Symbol.for("protobuf-ts/unknown"),e.onRead=(n,s,r,o,l)=>{(t(s)?s[e.symbol]:s[e.symbol]=[]).push({no:r,wireType:o,data:l})},e.onWrite=(n,s,r)=>{for(let{no:o,wireType:l,data:p}of e.list(s))r.tag(o,l).raw(p)},e.list=(n,s)=>{if(t(n)){let r=n[e.symbol];return s?r.filter(o=>o.no==s):r}return[]},e.last=(n,s)=>e.list(n,s).slice(-1)[0];const t=n=>n&&Array.isArray(n[e.symbol])})(be||(be={}));var P;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(P||(P={}));function Un(){let e=0,t=0;for(let s=0;s<28;s+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<s,(r&128)==0)return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,(n&128)==0)return this.assertBounds(),[e,t];for(let s=3;s<=31;s+=7){let r=this.buf[this.pos++];if(t|=(r&127)<<s,(r&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function je(e,t,n){for(let o=0;o<28;o=o+7){const l=e>>>o,p=!(l>>>7==0&&t==0),h=(p?l|128:l)&255;if(n.push(h),!p)return}const s=e>>>28&15|(t&7)<<4,r=t>>3!=0;if(n.push((r?s|128:s)&255),!!r){for(let o=3;o<31;o=o+7){const l=t>>>o,p=l>>>7!=0,h=(p?l|128:l)&255;if(n.push(h),!p)return}n.push(t>>>31&1)}}const Te=(1<<16)*(1<<16);function qt(e){let t=e[0]=="-";t&&(e=e.slice(1));const n=1e6;let s=0,r=0;function o(l,p){const h=Number(e.slice(l,p));r*=n,s=s*n+h,s>=Te&&(r=r+(s/Te|0),s=s%Te)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),[t,s,r]}function Xe(e,t){if(t>>>0<=2097151)return""+(Te*t+(e>>>0));let n=e&16777215,s=(e>>>24|t<<8)>>>0&16777215,r=t>>16&65535,o=n+s*6777216+r*6710656,l=s+r*8147497,p=r*2,h=1e7;o>=h&&(l+=Math.floor(o/h),o%=h),l>=h&&(p+=Math.floor(l/h),l%=h);function T(_,I){let v=_?String(_):"";return I?"0000000".slice(v.length)+v:v}return T(p,0)+T(l,p)+T(o,1)}function wt(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function qn(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;(e&128)!==0&&n<10;n++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}let S;function Vn(){const e=new DataView(new ArrayBuffer(8));S=globalThis.BigInt!==void 0&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}Vn();function Vt(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const Gt=/^-?[0-9]+$/,_e=4294967296,fe=2147483648;class jt{constructor(t,n){this.lo=t|0,this.hi=n|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let t=this.hi*_e+(this.lo>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class D extends jt{static from(t){if(S)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=S.C(t);case"number":if(t===0)return this.ZERO;t=S.C(t);case"bigint":if(!t)return this.ZERO;if(t<S.UMIN)throw new Error("signed value for ulong");if(t>S.UMAX)throw new Error("ulong too large");return S.V.setBigUint64(0,t,!0),new D(S.V.getInt32(0,!0),S.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!Gt.test(t))throw new Error("string is no integer");let[n,s,r]=qt(t);if(n)throw new Error("signed value for ulong");return new D(s,r);case"number":if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");if(t<0)throw new Error("signed value for ulong");return new D(t,t/_e)}throw new Error("unknown value "+typeof t)}toString(){return S?this.toBigInt().toString():Xe(this.lo,this.hi)}toBigInt(){return Vt(S),S.V.setInt32(0,this.lo,!0),S.V.setInt32(4,this.hi,!0),S.V.getBigUint64(0,!0)}}D.ZERO=new D(0,0);class N extends jt{static from(t){if(S)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=S.C(t);case"number":if(t===0)return this.ZERO;t=S.C(t);case"bigint":if(!t)return this.ZERO;if(t<S.MIN)throw new Error("signed long too small");if(t>S.MAX)throw new Error("signed long too large");return S.V.setBigInt64(0,t,!0),new N(S.V.getInt32(0,!0),S.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!Gt.test(t))throw new Error("string is no integer");let[n,s,r]=qt(t);if(n){if(r>fe||r==fe&&s!=0)throw new Error("signed long too small")}else if(r>=fe)throw new Error("signed long too large");let o=new N(s,r);return n?o.negate():o;case"number":if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");return t>0?new N(t,t/_e):new N(-t,-t/_e).negate()}throw new Error("unknown value "+typeof t)}isNegative(){return(this.hi&fe)!==0}negate(){let t=~this.hi,n=this.lo;return n?n=~n+1:t+=1,new N(n,t)}toString(){if(S)return this.toBigInt().toString();if(this.isNegative()){let t=this.negate();return"-"+Xe(t.lo,t.hi)}return Xe(this.lo,this.hi)}toBigInt(){return Vt(S),S.V.setInt32(0,this.lo,!0),S.V.setInt32(4,this.hi,!0),S.V.getBigInt64(0,!0)}}N.ZERO=new N(0,0);const yt={readUnknownField:!0,readerFactory:e=>new jn(e)};function Gn(e){return e?Object.assign(Object.assign({},yt),e):yt}class jn{constructor(t,n){this.varint64=Un,this.uint32=qn,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=n!=null?n:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let t=this.uint32(),n=t>>>3,s=t&7;if(n<=0||s<0||s>5)throw new Error("illegal tag: field no "+n+" wire type "+s);return[n,s]}skip(t){let n=this.pos;switch(t){case P.Varint:for(;this.buf[this.pos++]&128;);break;case P.Bit64:this.pos+=4;case P.Bit32:this.pos+=4;break;case P.LengthDelimited:let s=this.uint32();this.pos+=s;break;case P.StartGroup:let r;for(;(r=this.tag()[1])!==P.EndGroup;)this.skip(r);break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return new N(...this.varint64())}uint64(){return new D(...this.varint64())}sint64(){let[t,n]=this.varint64(),s=-(t&1);return t=(t>>>1|(n&1)<<31)^s,n=n>>>1^s,new N(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new D(this.sfixed32(),this.sfixed32())}sfixed64(){return new N(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.textDecoder.decode(this.bytes())}}function E(e,t){if(!e)throw new Error(t)}const Wn=34028234663852886e22,Kn=-34028234663852886e22,Jn=4294967295,Zn=2147483647,Xn=-2147483648;function ue(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>Zn||e<Xn)throw new Error("invalid int 32: "+e)}function ve(e){if(typeof e!="number")throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>Jn||e<0)throw new Error("invalid uint 32: "+e)}function it(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(!!Number.isFinite(e)&&(e>Wn||e<Kn))throw new Error("invalid float 32: "+e)}const bt={writeUnknownFields:!0,writerFactory:()=>new Yn};function $n(e){return e?Object.assign(Object.assign({},bt),e):bt}class Yn{constructor(t){this.stack=[],this.textEncoder=t!=null?t:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let r=0;r<this.chunks.length;r++)t+=this.chunks[r].length;let n=new Uint8Array(t),s=0;for(let r=0;r<this.chunks.length;r++)n.set(this.chunks[r],s),s+=this.chunks[r].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,n){return this.uint32((t<<3|n)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(ve(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return ue(t),wt(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.textEncoder.encode(t);return this.uint32(n.byteLength),this.raw(n)}float(t){it(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){ve(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){ue(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return ue(t),t=(t<<1^t>>31)>>>0,wt(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),s=new DataView(n.buffer),r=N.from(t);return s.setInt32(0,r.lo,!0),s.setInt32(4,r.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),s=new DataView(n.buffer),r=D.from(t);return s.setInt32(0,r.lo,!0),s.setInt32(4,r.hi,!0),this.raw(n)}int64(t){let n=N.from(t);return je(n.lo,n.hi,this.buf),this}sint64(t){let n=N.from(t),s=n.hi>>31,r=n.lo<<1^s,o=(n.hi<<1|n.lo>>>31)^s;return je(r,o,this.buf),this}uint64(t){let n=D.from(t);return je(n.lo,n.hi,this.buf),this}}const _t={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},vt={ignoreUnknownFields:!1};function zn(e){return e?Object.assign(Object.assign({},vt),e):vt}function Hn(e){return e?Object.assign(Object.assign({},_t),e):_t}const Wt=Symbol.for("protobuf-ts/message-type");function Et(e){let t=!1;const n=[];for(let s=0;s<e.length;s++){let r=e.charAt(s);r=="_"?t=!0:/\d/.test(r)?(n.push(r),t=!0):t?(n.push(r.toUpperCase()),t=!1):s==0?n.push(r.toLowerCase()):n.push(r)}return n.join("")}var k;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(k||(k={}));var J;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER"})(J||(J={}));var Ee;(function(e){e[e.NO=0]="NO",e[e.PACKED=1]="PACKED",e[e.UNPACKED=2]="UNPACKED"})(Ee||(Ee={}));function Qn(e){var t,n,s,r;return e.localName=(t=e.localName)!==null&&t!==void 0?t:Et(e.name),e.jsonName=(n=e.jsonName)!==null&&n!==void 0?n:Et(e.name),e.repeat=(s=e.repeat)!==null&&s!==void 0?s:Ee.NO,e.opt=(r=e.opt)!==null&&r!==void 0?r:e.repeat||e.oneof?!1:e.kind=="message",e}function es(e){if(typeof e!="object"||e===null||!e.hasOwnProperty("oneofKind"))return!1;switch(typeof e.oneofKind){case"string":return e[e.oneofKind]===void 0?!1:Object.keys(e).length==2;case"undefined":return Object.keys(e).length==1;default:return!1}}class ts{constructor(t){var n;this.fields=(n=t.fields)!==null&&n!==void 0?n:[]}prepare(){if(this.data)return;const t=[],n=[],s=[];for(let r of this.fields)if(r.oneof)s.includes(r.oneof)||(s.push(r.oneof),t.push(r.oneof),n.push(r.oneof));else switch(n.push(r.localName),r.kind){case"scalar":case"enum":(!r.opt||r.repeat)&&t.push(r.localName);break;case"message":r.repeat&&t.push(r.localName);break;case"map":t.push(r.localName);break}this.data={req:t,known:n,oneofs:Object.values(s)}}is(t,n,s=!1){if(n<0)return!0;if(t==null||typeof t!="object")return!1;this.prepare();let r=Object.keys(t),o=this.data;if(r.length<o.req.length||o.req.some(l=>!r.includes(l))||!s&&r.some(l=>!o.known.includes(l)))return!1;if(n<1)return!0;for(const l of o.oneofs){const p=t[l];if(!es(p))return!1;if(p.oneofKind===void 0)continue;const h=this.fields.find(T=>T.localName===p.oneofKind);if(!h||!this.field(p[p.oneofKind],h,s,n))return!1}for(const l of this.fields)if(l.oneof===void 0&&!this.field(t[l.localName],l,s,n))return!1;return!0}field(t,n,s,r){let o=n.repeat;switch(n.kind){case"scalar":return t===void 0?n.opt:o?this.scalars(t,n.T,r,n.L):this.scalar(t,n.T,n.L);case"enum":return t===void 0?n.opt:o?this.scalars(t,k.INT32,r):this.scalar(t,k.INT32);case"message":return t===void 0?!0:o?this.messages(t,n.T(),s,r):this.message(t,n.T(),s,r);case"map":if(typeof t!="object"||t===null)return!1;if(r<2)return!0;if(!this.mapKeys(t,n.K,r))return!1;switch(n.V.kind){case"scalar":return this.scalars(Object.values(t),n.V.T,r,n.V.L);case"enum":return this.scalars(Object.values(t),k.INT32,r);case"message":return this.messages(Object.values(t),n.V.T(),s,r)}break}return!0}message(t,n,s,r){return s?n.isAssignable(t,r):n.is(t,r)}messages(t,n,s,r){if(!Array.isArray(t))return!1;if(r<2)return!0;if(s){for(let o=0;o<t.length&&o<r;o++)if(!n.isAssignable(t[o],r-1))return!1}else for(let o=0;o<t.length&&o<r;o++)if(!n.is(t[o],r-1))return!1;return!0}scalar(t,n,s){let r=typeof t;switch(n){case k.UINT64:case k.FIXED64:case k.INT64:case k.SFIXED64:case k.SINT64:switch(s){case J.BIGINT:return r=="bigint";case J.NUMBER:return r=="number"&&!isNaN(t);default:return r=="string"}case k.BOOL:return r=="boolean";case k.STRING:return r=="string";case k.BYTES:return t instanceof Uint8Array;case k.DOUBLE:case k.FLOAT:return r=="number"&&!isNaN(t);default:return r=="number"&&Number.isInteger(t)}}scalars(t,n,s,r){if(!Array.isArray(t))return!1;if(s<2)return!0;if(Array.isArray(t)){for(let o=0;o<t.length&&o<s;o++)if(!this.scalar(t[o],n,r))return!1}return!0}mapKeys(t,n,s){let r=Object.keys(t);switch(n){case k.INT32:case k.FIXED32:case k.SFIXED32:case k.SINT32:case k.UINT32:return this.scalars(r.slice(0,s).map(o=>parseInt(o)),n,s);case k.BOOL:return this.scalars(r.slice(0,s).map(o=>o=="true"?!0:o=="false"?!1:o),n,s);default:return this.scalars(r,n,s,J.STRING)}}}function G(e,t){switch(t){case J.BIGINT:return e.toBigInt();case J.NUMBER:return e.toNumber();default:return e.toString()}}class ns{constructor(t){this.info=t}prepare(){var t;if(this.fMap===void 0){this.fMap={};const n=(t=this.info.fields)!==null&&t!==void 0?t:[];for(const s of n)this.fMap[s.name]=s,this.fMap[s.jsonName]=s,this.fMap[s.localName]=s}}assert(t,n,s){if(!t){let r=at(s);throw(r=="number"||r=="boolean")&&(r=s.toString()),new Error(`Cannot parse JSON ${r} for ${this.info.typeName}#${n}`)}}read(t,n,s){this.prepare();const r=[];for(const[o,l]of Object.entries(t)){const p=this.fMap[o];if(!p){if(!s.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${o}`);continue}const h=p.localName;let T;if(p.oneof){if(l===null&&(p.kind!=="enum"||p.T()[0]!=="google.protobuf.NullValue"))continue;if(r.includes(p.oneof))throw new Error(`Multiple members of the oneof group "${p.oneof}" of ${this.info.typeName} are present in JSON.`);r.push(p.oneof),T=n[p.oneof]={oneofKind:h}}else T=n;if(p.kind=="map"){if(l===null)continue;this.assert(Dn(l),p.name,l);const _=T[h];for(const[I,v]of Object.entries(l)){this.assert(v!==null,p.name+" map value",null);let B;switch(p.V.kind){case"message":B=p.V.T().internalJsonRead(v,s);break;case"enum":if(B=this.enum(p.V.T(),v,p.name,s.ignoreUnknownFields),B===!1)continue;break;case"scalar":B=this.scalar(v,p.V.T,p.V.L,p.name);break}this.assert(B!==void 0,p.name+" map value",v);let M=I;p.K==k.BOOL&&(M=M=="true"?!0:M=="false"?!1:M),M=this.scalar(M,p.K,J.STRING,p.name).toString(),_[M]=B}}else if(p.repeat){if(l===null)continue;this.assert(Array.isArray(l),p.name,l);const _=T[h];for(const I of l){this.assert(I!==null,p.name,null);let v;switch(p.kind){case"message":v=p.T().internalJsonRead(I,s);break;case"enum":if(v=this.enum(p.T(),I,p.name,s.ignoreUnknownFields),v===!1)continue;break;case"scalar":v=this.scalar(I,p.T,p.L,p.name);break}this.assert(v!==void 0,p.name,l),_.push(v)}}else switch(p.kind){case"message":if(l===null&&p.T().typeName!="google.protobuf.Value"){this.assert(p.oneof===void 0,p.name+" (oneof member)",null);continue}T[h]=p.T().internalJsonRead(l,s,T[h]);break;case"enum":let _=this.enum(p.T(),l,p.name,s.ignoreUnknownFields);if(_===!1)continue;T[h]=_;break;case"scalar":T[h]=this.scalar(l,p.T,p.L,p.name);break}}}enum(t,n,s,r){if(t[0]=="google.protobuf.NullValue"&&E(n===null||n==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${s}, enum ${t[0]} only accepts null.`),n===null)return 0;switch(typeof n){case"number":return E(Number.isInteger(n),`Unable to parse field ${this.info.typeName}#${s}, enum can only be integral number, got ${n}.`),n;case"string":let o=n;t[2]&&n.substring(0,t[2].length)===t[2]&&(o=n.substring(t[2].length));let l=t[1][o];return typeof l=="undefined"&&r?!1:(E(typeof l=="number",`Unable to parse field ${this.info.typeName}#${s}, enum ${t[0]} has no value for "${n}".`),l)}E(!1,`Unable to parse field ${this.info.typeName}#${s}, cannot parse enum value from ${typeof n}".`)}scalar(t,n,s,r){let o;try{switch(n){case k.DOUBLE:case k.FLOAT:if(t===null)return 0;if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""){o="empty string";break}if(typeof t=="string"&&t.trim().length!==t.length){o="extra whitespace";break}if(typeof t!="string"&&typeof t!="number")break;let l=Number(t);if(Number.isNaN(l)){o="not a number";break}if(!Number.isFinite(l)){o="too large or small";break}return n==k.FLOAT&&it(l),l;case k.INT32:case k.FIXED32:case k.SFIXED32:case k.SINT32:case k.UINT32:if(t===null)return 0;let p;if(typeof t=="number"?p=t:t===""?o="empty string":typeof t=="string"&&(t.trim().length!==t.length?o="extra whitespace":p=Number(t)),p===void 0)break;return n==k.UINT32?ve(p):ue(p),p;case k.INT64:case k.SFIXED64:case k.SINT64:if(t===null)return G(N.ZERO,s);if(typeof t!="number"&&typeof t!="string")break;return G(N.from(t),s);case k.FIXED64:case k.UINT64:if(t===null)return G(D.ZERO,s);if(typeof t!="number"&&typeof t!="string")break;return G(D.from(t),s);case k.BOOL:if(t===null)return!1;if(typeof t!="boolean")break;return t;case k.STRING:if(t===null)return"";if(typeof t!="string"){o="extra whitespace";break}try{encodeURIComponent(t)}catch(h){h="invalid UTF8";break}return t;case k.BYTES:if(t===null||t==="")return new Uint8Array(0);if(typeof t!="string")break;return Fn(t)}}catch(l){o=l.message}this.assert(!1,r+(o?" - "+o:""),t)}}class ss{constructor(t){var n;this.fields=(n=t.fields)!==null&&n!==void 0?n:[]}write(t,n){const s={},r=t;for(const o of this.fields){if(!o.oneof){let T=this.field(o,r[o.localName],n);T!==void 0&&(s[n.useProtoFieldName?o.name:o.jsonName]=T);continue}const l=r[o.oneof];if(l.oneofKind!==o.localName)continue;const p=o.kind=="scalar"||o.kind=="enum"?Object.assign(Object.assign({},n),{emitDefaultValues:!0}):n;let h=this.field(o,l[o.localName],p);E(h!==void 0),s[n.useProtoFieldName?o.name:o.jsonName]=h}return s}field(t,n,s){let r;if(t.kind=="map"){E(typeof n=="object"&&n!==null);const o={};switch(t.V.kind){case"scalar":for(const[h,T]of Object.entries(n)){const _=this.scalar(t.V.T,T,t.name,!1,!0);E(_!==void 0),o[h.toString()]=_}break;case"message":const l=t.V.T();for(const[h,T]of Object.entries(n)){const _=this.message(l,T,t.name,s);E(_!==void 0),o[h.toString()]=_}break;case"enum":const p=t.V.T();for(const[h,T]of Object.entries(n)){E(T===void 0||typeof T=="number");const _=this.enum(p,T,t.name,!1,!0,s.enumAsInteger);E(_!==void 0),o[h.toString()]=_}break}(s.emitDefaultValues||Object.keys(o).length>0)&&(r=o)}else if(t.repeat){E(Array.isArray(n));const o=[];switch(t.kind){case"scalar":for(let h=0;h<n.length;h++){const T=this.scalar(t.T,n[h],t.name,t.opt,!0);E(T!==void 0),o.push(T)}break;case"enum":const l=t.T();for(let h=0;h<n.length;h++){E(n[h]===void 0||typeof n[h]=="number");const T=this.enum(l,n[h],t.name,t.opt,!0,s.enumAsInteger);E(T!==void 0),o.push(T)}break;case"message":const p=t.T();for(let h=0;h<n.length;h++){const T=this.message(p,n[h],t.name,s);E(T!==void 0),o.push(T)}break}(s.emitDefaultValues||o.length>0||s.emitDefaultValues)&&(r=o)}else switch(t.kind){case"scalar":r=this.scalar(t.T,n,t.name,t.opt,s.emitDefaultValues);break;case"enum":r=this.enum(t.T(),n,t.name,t.opt,s.emitDefaultValues,s.enumAsInteger);break;case"message":r=this.message(t.T(),n,t.name,s);break}return r}enum(t,n,s,r,o,l){if(t[0]=="google.protobuf.NullValue")return!o&&!r?void 0:null;if(n===void 0){E(r);return}if(!(n===0&&!o&&!r))return E(typeof n=="number"),E(Number.isInteger(n)),l||!t[1].hasOwnProperty(n)?n:t[2]?t[2]+t[1][n]:t[1][n]}message(t,n,s,r){return n===void 0?r.emitDefaultValues?null:void 0:t.internalJsonWrite(n,r)}scalar(t,n,s,r,o){if(n===void 0){E(r);return}const l=o||r;switch(t){case k.INT32:case k.SFIXED32:case k.SINT32:return n===0?l?0:void 0:(ue(n),n);case k.FIXED32:case k.UINT32:return n===0?l?0:void 0:(ve(n),n);case k.FLOAT:it(n);case k.DOUBLE:return n===0?l?0:void 0:(E(typeof n=="number"),Number.isNaN(n)?"NaN":n===Number.POSITIVE_INFINITY?"Infinity":n===Number.NEGATIVE_INFINITY?"-Infinity":n);case k.STRING:return n===""?l?"":void 0:(E(typeof n=="string"),n);case k.BOOL:return n===!1?l?!1:void 0:(E(typeof n=="boolean"),n);case k.UINT64:case k.FIXED64:E(typeof n=="number"||typeof n=="string"||typeof n=="bigint");let p=D.from(n);return p.isZero()&&!l?void 0:p.toString();case k.INT64:case k.SFIXED64:case k.SINT64:E(typeof n=="number"||typeof n=="string"||typeof n=="bigint");let h=N.from(n);return h.isZero()&&!l?void 0:h.toString();case k.BYTES:return E(n instanceof Uint8Array),n.byteLength?Mn(n):l?"":void 0}}}function $e(e,t=J.STRING){switch(e){case k.BOOL:return!1;case k.UINT64:case k.FIXED64:return G(D.ZERO,t);case k.INT64:case k.SFIXED64:case k.SINT64:return G(N.ZERO,t);case k.DOUBLE:case k.FLOAT:return 0;case k.BYTES:return new Uint8Array(0);case k.STRING:return"";default:return 0}}class rs{constructor(t){this.info=t}prepare(){var t;if(!this.fieldNoToField){const n=(t=this.info.fields)!==null&&t!==void 0?t:[];this.fieldNoToField=new Map(n.map(s=>[s.no,s]))}}read(t,n,s,r){this.prepare();const o=r===void 0?t.len:t.pos+r;for(;t.pos<o;){const[l,p]=t.tag(),h=this.fieldNoToField.get(l);if(!h){let v=s.readUnknownField;if(v=="throw")throw new Error(`Unknown field ${l} (wire type ${p}) for ${this.info.typeName}`);let B=t.skip(p);v!==!1&&(v===!0?be.onRead:v)(this.info.typeName,n,l,p,B);continue}let T=n,_=h.repeat,I=h.localName;switch(h.oneof&&(T=T[h.oneof],T.oneofKind!==I&&(T=n[h.oneof]={oneofKind:I})),h.kind){case"scalar":case"enum":let v=h.kind=="enum"?k.INT32:h.T,B=h.kind=="scalar"?h.L:void 0;if(_){let z=T[I];if(p==P.LengthDelimited&&v!=k.STRING&&v!=k.BYTES){let re=t.uint32()+t.pos;for(;t.pos<re;)z.push(this.scalar(t,v,B))}else z.push(this.scalar(t,v,B))}else T[I]=this.scalar(t,v,B);break;case"message":if(_){let z=T[I],re=h.T().internalBinaryRead(t,t.uint32(),s);z.push(re)}else T[I]=h.T().internalBinaryRead(t,t.uint32(),s,T[I]);break;case"map":let[M,Ae]=this.mapEntry(h,t,s);T[I][M]=Ae;break}}}mapEntry(t,n,s){let r=n.uint32(),o=n.pos+r,l,p;for(;n.pos<o;){let[h,T]=n.tag();switch(h){case 1:t.K==k.BOOL?l=n.bool().toString():l=this.scalar(n,t.K,J.STRING);break;case 2:switch(t.V.kind){case"scalar":p=this.scalar(n,t.V.T,t.V.L);break;case"enum":p=n.int32();break;case"message":p=t.V.T().internalBinaryRead(n,n.uint32(),s);break}break;default:throw new Error(`Unknown field ${h} (wire type ${T}) in map entry for ${this.info.typeName}#${t.name}`)}}if(l===void 0){let h=$e(t.K);l=t.K==k.BOOL?h.toString():h}if(p===void 0)switch(t.V.kind){case"scalar":p=$e(t.V.T,t.V.L);break;case"enum":p=0;break;case"message":p=t.V.T().create();break}return[l,p]}scalar(t,n,s){switch(n){case k.INT32:return t.int32();case k.STRING:return t.string();case k.BOOL:return t.bool();case k.DOUBLE:return t.double();case k.FLOAT:return t.float();case k.INT64:return G(t.int64(),s);case k.UINT64:return G(t.uint64(),s);case k.FIXED64:return G(t.fixed64(),s);case k.FIXED32:return t.fixed32();case k.BYTES:return t.bytes();case k.UINT32:return t.uint32();case k.SFIXED32:return t.sfixed32();case k.SFIXED64:return G(t.sfixed64(),s);case k.SINT32:return t.sint32();case k.SINT64:return G(t.sint64(),s)}}}class os{constructor(t){this.info=t}prepare(){if(!this.fields){const t=this.info.fields?this.info.fields.concat():[];this.fields=t.sort((n,s)=>n.no-s.no)}}write(t,n,s){this.prepare();for(const o of this.fields){let l,p,h=o.repeat,T=o.localName;if(o.oneof){const _=t[o.oneof];if(_.oneofKind!==T)continue;l=_[T],p=!0}else l=t[T],p=!1;switch(o.kind){case"scalar":case"enum":let _=o.kind=="enum"?k.INT32:o.T;if(h)if(E(Array.isArray(l)),h==Ee.PACKED)this.packed(n,_,o.no,l);else for(const I of l)this.scalar(n,_,o.no,I,!0);else l===void 0?E(o.opt):this.scalar(n,_,o.no,l,p||o.opt);break;case"message":if(h){E(Array.isArray(l));for(const I of l)this.message(n,s,o.T(),o.no,I)}else this.message(n,s,o.T(),o.no,l);break;case"map":E(typeof l=="object"&&l!==null);for(const[I,v]of Object.entries(l))this.mapEntry(n,s,o,I,v);break}}let r=s.writeUnknownFields;r!==!1&&(r===!0?be.onWrite:r)(this.info.typeName,t,n)}mapEntry(t,n,s,r,o){t.tag(s.no,P.LengthDelimited),t.fork();let l=r;switch(s.K){case k.INT32:case k.FIXED32:case k.UINT32:case k.SFIXED32:case k.SINT32:l=Number.parseInt(r);break;case k.BOOL:E(r=="true"||r=="false"),l=r=="true";break}switch(this.scalar(t,s.K,1,l,!0),s.V.kind){case"scalar":this.scalar(t,s.V.T,2,o,!0);break;case"enum":this.scalar(t,k.INT32,2,o,!0);break;case"message":this.message(t,n,s.V.T(),2,o);break}t.join()}message(t,n,s,r,o){o!==void 0&&(s.internalBinaryWrite(o,t.tag(r,P.LengthDelimited).fork(),n),t.join())}scalar(t,n,s,r,o){let[l,p,h]=this.scalarInfo(n,r);(!h||o)&&(t.tag(s,l),t[p](r))}packed(t,n,s,r){if(!r.length)return;E(n!==k.BYTES&&n!==k.STRING),t.tag(s,P.LengthDelimited),t.fork();let[,o]=this.scalarInfo(n);for(let l=0;l<r.length;l++)t[o](r[l]);t.join()}scalarInfo(t,n){let s=P.Varint,r,o=n===void 0,l=n===0;switch(t){case k.INT32:r="int32";break;case k.STRING:l=o||!n.length,s=P.LengthDelimited,r="string";break;case k.BOOL:l=n===!1,r="bool";break;case k.UINT32:r="uint32";break;case k.DOUBLE:s=P.Bit64,r="double";break;case k.FLOAT:s=P.Bit32,r="float";break;case k.INT64:l=o||N.from(n).isZero(),r="int64";break;case k.UINT64:l=o||D.from(n).isZero(),r="uint64";break;case k.FIXED64:l=o||D.from(n).isZero(),s=P.Bit64,r="fixed64";break;case k.BYTES:l=o||!n.byteLength,s=P.LengthDelimited,r="bytes";break;case k.FIXED32:s=P.Bit32,r="fixed32";break;case k.SFIXED32:s=P.Bit32,r="sfixed32";break;case k.SFIXED64:l=o||N.from(n).isZero(),s=P.Bit64,r="sfixed64";break;case k.SINT32:r="sint32";break;case k.SINT64:l=o||N.from(n).isZero(),r="sint64";break}return[s,r,o||l]}}function as(e){const t=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},Wt,{value:e});for(let n of e.fields){let s=n.localName;if(!n.opt)if(n.oneof)t[n.oneof]={oneofKind:void 0};else if(n.repeat)t[s]=[];else switch(n.kind){case"scalar":t[s]=$e(n.T,n.L);break;case"enum":t[s]=0;break;case"map":t[s]={};break}}return t}function We(e,t,n){let s,r=n,o;for(let l of e.fields){let p=l.localName;if(l.oneof){const h=r[l.oneof];if((h==null?void 0:h.oneofKind)==null)continue;if(s=h[p],o=t[l.oneof],o.oneofKind=h.oneofKind,s==null){delete o[p];continue}}else if(s=r[p],o=t,s==null)continue;switch(l.repeat&&(o[p].length=s.length),l.kind){case"scalar":case"enum":if(l.repeat)for(let T=0;T<s.length;T++)o[p][T]=s[T];else o[p]=s;break;case"message":let h=l.T();if(l.repeat)for(let T=0;T<s.length;T++)o[p][T]=h.create(s[T]);else o[p]===void 0?o[p]=h.create(s):h.mergePartial(o[p],s);break;case"map":switch(l.V.kind){case"scalar":case"enum":Object.assign(o[p],s);break;case"message":let T=l.V.T();for(let _ of Object.keys(s))o[p][_]=T.create(s[_]);break}break}}}function is(e,t,n){if(t===n)return!0;if(!t||!n)return!1;for(let s of e.fields){let r=s.localName,o=s.oneof?t[s.oneof][r]:t[r],l=s.oneof?n[s.oneof][r]:n[r];switch(s.kind){case"enum":case"scalar":let p=s.kind=="enum"?k.INT32:s.T;if(!(s.repeat?Rt(p,o,l):Kt(p,o,l)))return!1;break;case"map":if(!(s.V.kind=="message"?xt(s.V.T(),he(o),he(l)):Rt(s.V.kind=="enum"?k.INT32:s.V.T,he(o),he(l))))return!1;break;case"message":let h=s.T();if(!(s.repeat?xt(h,o,l):h.equals(o,l)))return!1;break}}return!0}const he=Object.values;function Kt(e,t,n){if(t===n)return!0;if(e!==k.BYTES)return!1;let s=t,r=n;if(s.length!==r.length)return!1;for(let o=0;o<s.length;o++)if(s[o]!=r[o])return!1;return!0}function Rt(e,t,n){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(!Kt(e,t[s],n[s]))return!1;return!0}function xt(e,t,n){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(!e.equals(t[s],n[s]))return!1;return!0}const cs=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({}));class u{constructor(t,n,s){this.defaultCheckDepth=16,this.typeName=t,this.fields=n.map(Qn),this.options=s!=null?s:{},this.messagePrototype=Object.create(null,Object.assign(Object.assign({},cs),{[Wt]:{value:this}})),this.refTypeCheck=new ts(this),this.refJsonReader=new ns(this),this.refJsonWriter=new ss(this),this.refBinReader=new rs(this),this.refBinWriter=new os(this)}create(t){let n=as(this);return t!==void 0&&We(this,n,t),n}clone(t){let n=this.create();return We(this,n,t),n}equals(t,n){return is(this,t,n)}is(t,n=this.defaultCheckDepth){return this.refTypeCheck.is(t,n,!1)}isAssignable(t,n=this.defaultCheckDepth){return this.refTypeCheck.is(t,n,!0)}mergePartial(t,n){We(this,t,n)}fromBinary(t,n){let s=Gn(n);return this.internalBinaryRead(s.readerFactory(t),t.byteLength,s)}fromJson(t,n){return this.internalJsonRead(t,zn(n))}fromJsonString(t,n){let s=JSON.parse(t);return this.fromJson(s,n)}toJson(t,n){return this.internalJsonWrite(t,Hn(n))}toJsonString(t,n){var s;let r=this.toJson(t,n);return JSON.stringify(r,null,(s=n==null?void 0:n.prettySpaces)!==null&&s!==void 0?s:0)}toBinary(t,n){let s=$n(n);return this.internalBinaryWrite(t,s.writerFactory(),s).finish()}internalJsonRead(t,n,s){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let r=s!=null?s:this.create();return this.refJsonReader.read(t,r,n),r}throw new Error(`Unable to parse message ${this.typeName} from JSON ${at(t)}.`)}internalJsonWrite(t,n){return this.refJsonWriter.write(t,n)}internalBinaryWrite(t,n,s){return this.refBinWriter.write(t,n,s),n}internalBinaryRead(t,n,s,r){let o=r!=null?r:this.create();return this.refBinReader.read(t,o,s,n),o}}var us=Object.defineProperty,ls=Object.defineProperties,ds=Object.getOwnPropertyDescriptors,Ot=Object.getOwnPropertySymbols,ps=Object.prototype.hasOwnProperty,ms=Object.prototype.propertyIsEnumerable,Ye=(e,t,n)=>t in e?us(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,St=(e,t)=>{for(var n in t||(t={}))ps.call(t,n)&&Ye(e,n,t[n]);if(Ot)for(var n of Ot(t))ms.call(t,n)&&Ye(e,n,t[n]);return e},fs=(e,t)=>ls(e,ds(t)),R=(e,t,n)=>(Ye(e,typeof t!="symbol"?t+"":t,n),n),Jt=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},ke=(e,t,n)=>(Jt(e,t,"read from private field"),n?n.call(e):t.get(e)),Ke=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},hs=(e,t,n,s)=>(Jt(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),ks=(e,t,n)=>new Promise((s,r)=>{var o=h=>{try{p(n.next(h))}catch(T){r(T)}},l=h=>{try{p(n.throw(h))}catch(T){r(T)}},p=h=>h.done?s(h.value):Promise.resolve(h.value).then(o,l);p((n=n.apply(e,t)).next())}),ie=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Re={},gs={get exports(){return Re},set exports(e){Re=e}},te=typeof Reflect=="object"?Reflect:null,Nt=te&&typeof te.apply=="function"?te.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},we;te&&typeof te.ownKeys=="function"?we=te.ownKeys:Object.getOwnPropertySymbols?we=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:we=function(e){return Object.getOwnPropertyNames(e)};function Ts(e){console&&console.warn&&console.warn(e)}var Zt=Number.isNaN||function(e){return e!==e};function x(){x.init.call(this)}gs.exports=x;Re.once=_s;x.EventEmitter=x;x.prototype._events=void 0;x.prototype._eventsCount=0;x.prototype._maxListeners=void 0;var It=10;function Ce(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(x,"defaultMaxListeners",{enumerable:!0,get:function(){return It},set:function(e){if(typeof e!="number"||e<0||Zt(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");It=e}});x.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};x.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Zt(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Xt(e){return e._maxListeners===void 0?x.defaultMaxListeners:e._maxListeners}x.prototype.getMaxListeners=function(){return Xt(this)};x.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var s=e==="error",r=this._events;if(r!==void 0)s=s&&r.error===void 0;else if(!s)return!1;if(s){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var p=r[e];if(p===void 0)return!1;if(typeof p=="function")Nt(p,this,t);else for(var h=p.length,T=Qt(p,h),n=0;n<h;++n)Nt(T[n],this,t);return!0};function $t(e,t,n,s){var r,o,l;if(Ce(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),l=o[t]),l===void 0)l=o[t]=n,++e._eventsCount;else if(typeof l=="function"?l=o[t]=s?[n,l]:[l,n]:s?l.unshift(n):l.push(n),r=Xt(e),r>0&&l.length>r&&!l.warned){l.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=e,p.type=t,p.count=l.length,Ts(p)}return e}x.prototype.addListener=function(e,t){return $t(this,e,t,!1)};x.prototype.on=x.prototype.addListener;x.prototype.prependListener=function(e,t){return $t(this,e,t,!0)};function ws(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Yt(e,t,n){var s={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=ws.bind(s);return r.listener=n,s.wrapFn=r,r}x.prototype.once=function(e,t){return Ce(t),this.on(e,Yt(this,e,t)),this};x.prototype.prependOnceListener=function(e,t){return Ce(t),this.prependListener(e,Yt(this,e,t)),this};x.prototype.removeListener=function(e,t){var n,s,r,o,l;if(Ce(t),s=this._events,s===void 0)return this;if(n=s[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){l=n[o].listener,r=o;break}if(r<0)return this;r===0?n.shift():ys(n,r),n.length===1&&(s[e]=n[0]),s.removeListener!==void 0&&this.emit("removeListener",e,l||t)}return this};x.prototype.off=x.prototype.removeListener;x.prototype.removeAllListeners=function(e){var t,n,s;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var r=Object.keys(n),o;for(s=0;s<r.length;++s)o=r[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(s=t.length-1;s>=0;s--)this.removeListener(e,t[s]);return this};function zt(e,t,n){var s=e._events;if(s===void 0)return[];var r=s[t];return r===void 0?[]:typeof r=="function"?n?[r.listener||r]:[r]:n?bs(r):Qt(r,r.length)}x.prototype.listeners=function(e){return zt(this,e,!0)};x.prototype.rawListeners=function(e){return zt(this,e,!1)};x.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Ht.call(e,t)};x.prototype.listenerCount=Ht;function Ht(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}x.prototype.eventNames=function(){return this._eventsCount>0?we(this._events):[]};function Qt(e,t){for(var n=new Array(t),s=0;s<t;++s)n[s]=e[s];return n}function ys(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function bs(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function _s(e,t){return new Promise(function(n,s){function r(l){e.removeListener(t,o),s(l)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",r),n([].slice.call(arguments))}en(e,t,o,{once:!0}),t!=="error"&&vs(e,r,{once:!0})})}function vs(e,t,n){typeof e.on=="function"&&en(e,"error",t,n)}function en(e,t,n,s){if(typeof e.on=="function")s.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function r(o){s.once&&e.removeEventListener(t,r),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}const Es=`
2
+ `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(r){case 0:l=o,r=1;break;case 1:n[s++]=l<<2|(o&48)>>4,l=o,r=2;break;case 2:n[s++]=(l&15)<<4|(o&60)>>2,l=o,r=3;break;case 3:n[s++]=(l&3)<<6|o,r=0;break}}if(r==1)throw Error("invalid base64 string.");return n.subarray(0,s)}function Mn(e){let t="",n=0,s,r=0;for(let o=0;o<e.length;o++)switch(s=e[o],n){case 0:t+=X[s>>2],r=(s&3)<<4,n=1;break;case 1:t+=X[r|s>>4],r=(s&15)<<2,n=2;break;case 2:t+=X[r|s>>6],t+=X[s&63],n=0;break}return n&&(t+=X[r],t+="=",n==1&&(t+="=")),t}var _e;(function(e){e.symbol=Symbol.for("protobuf-ts/unknown"),e.onRead=(n,s,r,o,l)=>{(t(s)?s[e.symbol]:s[e.symbol]=[]).push({no:r,wireType:o,data:l})},e.onWrite=(n,s,r)=>{for(let{no:o,wireType:l,data:p}of e.list(s))r.tag(o,l).raw(p)},e.list=(n,s)=>{if(t(n)){let r=n[e.symbol];return s?r.filter(o=>o.no==s):r}return[]},e.last=(n,s)=>e.list(n,s).slice(-1)[0];const t=n=>n&&Array.isArray(n[e.symbol])})(_e||(_e={}));var P;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(P||(P={}));function Un(){let e=0,t=0;for(let s=0;s<28;s+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<s,(r&128)==0)return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,(n&128)==0)return this.assertBounds(),[e,t];for(let s=3;s<=31;s+=7){let r=this.buf[this.pos++];if(t|=(r&127)<<s,(r&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function je(e,t,n){for(let o=0;o<28;o=o+7){const l=e>>>o,p=!(l>>>7==0&&t==0),h=(p?l|128:l)&255;if(n.push(h),!p)return}const s=e>>>28&15|(t&7)<<4,r=t>>3!=0;if(n.push((r?s|128:s)&255),!!r){for(let o=3;o<31;o=o+7){const l=t>>>o,p=l>>>7!=0,h=(p?l|128:l)&255;if(n.push(h),!p)return}n.push(t>>>31&1)}}const we=(1<<16)*(1<<16);function qt(e){let t=e[0]=="-";t&&(e=e.slice(1));const n=1e6;let s=0,r=0;function o(l,p){const h=Number(e.slice(l,p));r*=n,s=s*n+h,s>=we&&(r=r+(s/we|0),s=s%we)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),[t,s,r]}function Xe(e,t){if(t>>>0<=2097151)return""+(we*t+(e>>>0));let n=e&16777215,s=(e>>>24|t<<8)>>>0&16777215,r=t>>16&65535,o=n+s*6777216+r*6710656,l=s+r*8147497,p=r*2,h=1e7;o>=h&&(l+=Math.floor(o/h),o%=h),l>=h&&(p+=Math.floor(l/h),l%=h);function T(_,I){let v=_?String(_):"";return I?"0000000".slice(v.length)+v:v}return T(p,0)+T(l,p)+T(o,1)}function wt(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function qn(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;(e&128)!==0&&n<10;n++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}let S;function Vn(){const e=new DataView(new ArrayBuffer(8));S=globalThis.BigInt!==void 0&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}Vn();function Vt(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const Gt=/^-?[0-9]+$/,ve=4294967296,he=2147483648;class jt{constructor(t,n){this.lo=t|0,this.hi=n|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let t=this.hi*ve+(this.lo>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class D extends jt{static from(t){if(S)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=S.C(t);case"number":if(t===0)return this.ZERO;t=S.C(t);case"bigint":if(!t)return this.ZERO;if(t<S.UMIN)throw new Error("signed value for ulong");if(t>S.UMAX)throw new Error("ulong too large");return S.V.setBigUint64(0,t,!0),new D(S.V.getInt32(0,!0),S.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!Gt.test(t))throw new Error("string is no integer");let[n,s,r]=qt(t);if(n)throw new Error("signed value for ulong");return new D(s,r);case"number":if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");if(t<0)throw new Error("signed value for ulong");return new D(t,t/ve)}throw new Error("unknown value "+typeof t)}toString(){return S?this.toBigInt().toString():Xe(this.lo,this.hi)}toBigInt(){return Vt(S),S.V.setInt32(0,this.lo,!0),S.V.setInt32(4,this.hi,!0),S.V.getBigUint64(0,!0)}}D.ZERO=new D(0,0);class N extends jt{static from(t){if(S)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=S.C(t);case"number":if(t===0)return this.ZERO;t=S.C(t);case"bigint":if(!t)return this.ZERO;if(t<S.MIN)throw new Error("signed long too small");if(t>S.MAX)throw new Error("signed long too large");return S.V.setBigInt64(0,t,!0),new N(S.V.getInt32(0,!0),S.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!Gt.test(t))throw new Error("string is no integer");let[n,s,r]=qt(t);if(n){if(r>he||r==he&&s!=0)throw new Error("signed long too small")}else if(r>=he)throw new Error("signed long too large");let o=new N(s,r);return n?o.negate():o;case"number":if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");return t>0?new N(t,t/ve):new N(-t,-t/ve).negate()}throw new Error("unknown value "+typeof t)}isNegative(){return(this.hi&he)!==0}negate(){let t=~this.hi,n=this.lo;return n?n=~n+1:t+=1,new N(n,t)}toString(){if(S)return this.toBigInt().toString();if(this.isNegative()){let t=this.negate();return"-"+Xe(t.lo,t.hi)}return Xe(this.lo,this.hi)}toBigInt(){return Vt(S),S.V.setInt32(0,this.lo,!0),S.V.setInt32(4,this.hi,!0),S.V.getBigInt64(0,!0)}}N.ZERO=new N(0,0);const yt={readUnknownField:!0,readerFactory:e=>new jn(e)};function Gn(e){return e?Object.assign(Object.assign({},yt),e):yt}class jn{constructor(t,n){this.varint64=Un,this.uint32=qn,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=n!=null?n:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let t=this.uint32(),n=t>>>3,s=t&7;if(n<=0||s<0||s>5)throw new Error("illegal tag: field no "+n+" wire type "+s);return[n,s]}skip(t){let n=this.pos;switch(t){case P.Varint:for(;this.buf[this.pos++]&128;);break;case P.Bit64:this.pos+=4;case P.Bit32:this.pos+=4;break;case P.LengthDelimited:let s=this.uint32();this.pos+=s;break;case P.StartGroup:let r;for(;(r=this.tag()[1])!==P.EndGroup;)this.skip(r);break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return new N(...this.varint64())}uint64(){return new D(...this.varint64())}sint64(){let[t,n]=this.varint64(),s=-(t&1);return t=(t>>>1|(n&1)<<31)^s,n=n>>>1^s,new N(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new D(this.sfixed32(),this.sfixed32())}sfixed64(){return new N(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.textDecoder.decode(this.bytes())}}function E(e,t){if(!e)throw new Error(t)}const Wn=34028234663852886e22,Kn=-34028234663852886e22,Jn=4294967295,Zn=2147483647,Xn=-2147483648;function ue(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>Zn||e<Xn)throw new Error("invalid int 32: "+e)}function Ee(e){if(typeof e!="number")throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>Jn||e<0)throw new Error("invalid uint 32: "+e)}function it(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(!!Number.isFinite(e)&&(e>Wn||e<Kn))throw new Error("invalid float 32: "+e)}const bt={writeUnknownFields:!0,writerFactory:()=>new Yn};function $n(e){return e?Object.assign(Object.assign({},bt),e):bt}class Yn{constructor(t){this.stack=[],this.textEncoder=t!=null?t:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let r=0;r<this.chunks.length;r++)t+=this.chunks[r].length;let n=new Uint8Array(t),s=0;for(let r=0;r<this.chunks.length;r++)n.set(this.chunks[r],s),s+=this.chunks[r].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,n){return this.uint32((t<<3|n)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Ee(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return ue(t),wt(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.textEncoder.encode(t);return this.uint32(n.byteLength),this.raw(n)}float(t){it(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){Ee(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){ue(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return ue(t),t=(t<<1^t>>31)>>>0,wt(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),s=new DataView(n.buffer),r=N.from(t);return s.setInt32(0,r.lo,!0),s.setInt32(4,r.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),s=new DataView(n.buffer),r=D.from(t);return s.setInt32(0,r.lo,!0),s.setInt32(4,r.hi,!0),this.raw(n)}int64(t){let n=N.from(t);return je(n.lo,n.hi,this.buf),this}sint64(t){let n=N.from(t),s=n.hi>>31,r=n.lo<<1^s,o=(n.hi<<1|n.lo>>>31)^s;return je(r,o,this.buf),this}uint64(t){let n=D.from(t);return je(n.lo,n.hi,this.buf),this}}const _t={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},vt={ignoreUnknownFields:!1};function zn(e){return e?Object.assign(Object.assign({},vt),e):vt}function Hn(e){return e?Object.assign(Object.assign({},_t),e):_t}const Wt=Symbol.for("protobuf-ts/message-type");function Et(e){let t=!1;const n=[];for(let s=0;s<e.length;s++){let r=e.charAt(s);r=="_"?t=!0:/\d/.test(r)?(n.push(r),t=!0):t?(n.push(r.toUpperCase()),t=!1):s==0?n.push(r.toLowerCase()):n.push(r)}return n.join("")}var k;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(k||(k={}));var J;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER"})(J||(J={}));var Re;(function(e){e[e.NO=0]="NO",e[e.PACKED=1]="PACKED",e[e.UNPACKED=2]="UNPACKED"})(Re||(Re={}));function Qn(e){var t,n,s,r;return e.localName=(t=e.localName)!==null&&t!==void 0?t:Et(e.name),e.jsonName=(n=e.jsonName)!==null&&n!==void 0?n:Et(e.name),e.repeat=(s=e.repeat)!==null&&s!==void 0?s:Re.NO,e.opt=(r=e.opt)!==null&&r!==void 0?r:e.repeat||e.oneof?!1:e.kind=="message",e}function es(e){if(typeof e!="object"||e===null||!e.hasOwnProperty("oneofKind"))return!1;switch(typeof e.oneofKind){case"string":return e[e.oneofKind]===void 0?!1:Object.keys(e).length==2;case"undefined":return Object.keys(e).length==1;default:return!1}}class ts{constructor(t){var n;this.fields=(n=t.fields)!==null&&n!==void 0?n:[]}prepare(){if(this.data)return;const t=[],n=[],s=[];for(let r of this.fields)if(r.oneof)s.includes(r.oneof)||(s.push(r.oneof),t.push(r.oneof),n.push(r.oneof));else switch(n.push(r.localName),r.kind){case"scalar":case"enum":(!r.opt||r.repeat)&&t.push(r.localName);break;case"message":r.repeat&&t.push(r.localName);break;case"map":t.push(r.localName);break}this.data={req:t,known:n,oneofs:Object.values(s)}}is(t,n,s=!1){if(n<0)return!0;if(t==null||typeof t!="object")return!1;this.prepare();let r=Object.keys(t),o=this.data;if(r.length<o.req.length||o.req.some(l=>!r.includes(l))||!s&&r.some(l=>!o.known.includes(l)))return!1;if(n<1)return!0;for(const l of o.oneofs){const p=t[l];if(!es(p))return!1;if(p.oneofKind===void 0)continue;const h=this.fields.find(T=>T.localName===p.oneofKind);if(!h||!this.field(p[p.oneofKind],h,s,n))return!1}for(const l of this.fields)if(l.oneof===void 0&&!this.field(t[l.localName],l,s,n))return!1;return!0}field(t,n,s,r){let o=n.repeat;switch(n.kind){case"scalar":return t===void 0?n.opt:o?this.scalars(t,n.T,r,n.L):this.scalar(t,n.T,n.L);case"enum":return t===void 0?n.opt:o?this.scalars(t,k.INT32,r):this.scalar(t,k.INT32);case"message":return t===void 0?!0:o?this.messages(t,n.T(),s,r):this.message(t,n.T(),s,r);case"map":if(typeof t!="object"||t===null)return!1;if(r<2)return!0;if(!this.mapKeys(t,n.K,r))return!1;switch(n.V.kind){case"scalar":return this.scalars(Object.values(t),n.V.T,r,n.V.L);case"enum":return this.scalars(Object.values(t),k.INT32,r);case"message":return this.messages(Object.values(t),n.V.T(),s,r)}break}return!0}message(t,n,s,r){return s?n.isAssignable(t,r):n.is(t,r)}messages(t,n,s,r){if(!Array.isArray(t))return!1;if(r<2)return!0;if(s){for(let o=0;o<t.length&&o<r;o++)if(!n.isAssignable(t[o],r-1))return!1}else for(let o=0;o<t.length&&o<r;o++)if(!n.is(t[o],r-1))return!1;return!0}scalar(t,n,s){let r=typeof t;switch(n){case k.UINT64:case k.FIXED64:case k.INT64:case k.SFIXED64:case k.SINT64:switch(s){case J.BIGINT:return r=="bigint";case J.NUMBER:return r=="number"&&!isNaN(t);default:return r=="string"}case k.BOOL:return r=="boolean";case k.STRING:return r=="string";case k.BYTES:return t instanceof Uint8Array;case k.DOUBLE:case k.FLOAT:return r=="number"&&!isNaN(t);default:return r=="number"&&Number.isInteger(t)}}scalars(t,n,s,r){if(!Array.isArray(t))return!1;if(s<2)return!0;if(Array.isArray(t)){for(let o=0;o<t.length&&o<s;o++)if(!this.scalar(t[o],n,r))return!1}return!0}mapKeys(t,n,s){let r=Object.keys(t);switch(n){case k.INT32:case k.FIXED32:case k.SFIXED32:case k.SINT32:case k.UINT32:return this.scalars(r.slice(0,s).map(o=>parseInt(o)),n,s);case k.BOOL:return this.scalars(r.slice(0,s).map(o=>o=="true"?!0:o=="false"?!1:o),n,s);default:return this.scalars(r,n,s,J.STRING)}}}function G(e,t){switch(t){case J.BIGINT:return e.toBigInt();case J.NUMBER:return e.toNumber();default:return e.toString()}}class ns{constructor(t){this.info=t}prepare(){var t;if(this.fMap===void 0){this.fMap={};const n=(t=this.info.fields)!==null&&t!==void 0?t:[];for(const s of n)this.fMap[s.name]=s,this.fMap[s.jsonName]=s,this.fMap[s.localName]=s}}assert(t,n,s){if(!t){let r=at(s);throw(r=="number"||r=="boolean")&&(r=s.toString()),new Error(`Cannot parse JSON ${r} for ${this.info.typeName}#${n}`)}}read(t,n,s){this.prepare();const r=[];for(const[o,l]of Object.entries(t)){const p=this.fMap[o];if(!p){if(!s.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${o}`);continue}const h=p.localName;let T;if(p.oneof){if(l===null&&(p.kind!=="enum"||p.T()[0]!=="google.protobuf.NullValue"))continue;if(r.includes(p.oneof))throw new Error(`Multiple members of the oneof group "${p.oneof}" of ${this.info.typeName} are present in JSON.`);r.push(p.oneof),T=n[p.oneof]={oneofKind:h}}else T=n;if(p.kind=="map"){if(l===null)continue;this.assert(Dn(l),p.name,l);const _=T[h];for(const[I,v]of Object.entries(l)){this.assert(v!==null,p.name+" map value",null);let B;switch(p.V.kind){case"message":B=p.V.T().internalJsonRead(v,s);break;case"enum":if(B=this.enum(p.V.T(),v,p.name,s.ignoreUnknownFields),B===!1)continue;break;case"scalar":B=this.scalar(v,p.V.T,p.V.L,p.name);break}this.assert(B!==void 0,p.name+" map value",v);let M=I;p.K==k.BOOL&&(M=M=="true"?!0:M=="false"?!1:M),M=this.scalar(M,p.K,J.STRING,p.name).toString(),_[M]=B}}else if(p.repeat){if(l===null)continue;this.assert(Array.isArray(l),p.name,l);const _=T[h];for(const I of l){this.assert(I!==null,p.name,null);let v;switch(p.kind){case"message":v=p.T().internalJsonRead(I,s);break;case"enum":if(v=this.enum(p.T(),I,p.name,s.ignoreUnknownFields),v===!1)continue;break;case"scalar":v=this.scalar(I,p.T,p.L,p.name);break}this.assert(v!==void 0,p.name,l),_.push(v)}}else switch(p.kind){case"message":if(l===null&&p.T().typeName!="google.protobuf.Value"){this.assert(p.oneof===void 0,p.name+" (oneof member)",null);continue}T[h]=p.T().internalJsonRead(l,s,T[h]);break;case"enum":let _=this.enum(p.T(),l,p.name,s.ignoreUnknownFields);if(_===!1)continue;T[h]=_;break;case"scalar":T[h]=this.scalar(l,p.T,p.L,p.name);break}}}enum(t,n,s,r){if(t[0]=="google.protobuf.NullValue"&&E(n===null||n==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${s}, enum ${t[0]} only accepts null.`),n===null)return 0;switch(typeof n){case"number":return E(Number.isInteger(n),`Unable to parse field ${this.info.typeName}#${s}, enum can only be integral number, got ${n}.`),n;case"string":let o=n;t[2]&&n.substring(0,t[2].length)===t[2]&&(o=n.substring(t[2].length));let l=t[1][o];return typeof l=="undefined"&&r?!1:(E(typeof l=="number",`Unable to parse field ${this.info.typeName}#${s}, enum ${t[0]} has no value for "${n}".`),l)}E(!1,`Unable to parse field ${this.info.typeName}#${s}, cannot parse enum value from ${typeof n}".`)}scalar(t,n,s,r){let o;try{switch(n){case k.DOUBLE:case k.FLOAT:if(t===null)return 0;if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""){o="empty string";break}if(typeof t=="string"&&t.trim().length!==t.length){o="extra whitespace";break}if(typeof t!="string"&&typeof t!="number")break;let l=Number(t);if(Number.isNaN(l)){o="not a number";break}if(!Number.isFinite(l)){o="too large or small";break}return n==k.FLOAT&&it(l),l;case k.INT32:case k.FIXED32:case k.SFIXED32:case k.SINT32:case k.UINT32:if(t===null)return 0;let p;if(typeof t=="number"?p=t:t===""?o="empty string":typeof t=="string"&&(t.trim().length!==t.length?o="extra whitespace":p=Number(t)),p===void 0)break;return n==k.UINT32?Ee(p):ue(p),p;case k.INT64:case k.SFIXED64:case k.SINT64:if(t===null)return G(N.ZERO,s);if(typeof t!="number"&&typeof t!="string")break;return G(N.from(t),s);case k.FIXED64:case k.UINT64:if(t===null)return G(D.ZERO,s);if(typeof t!="number"&&typeof t!="string")break;return G(D.from(t),s);case k.BOOL:if(t===null)return!1;if(typeof t!="boolean")break;return t;case k.STRING:if(t===null)return"";if(typeof t!="string"){o="extra whitespace";break}try{encodeURIComponent(t)}catch(h){h="invalid UTF8";break}return t;case k.BYTES:if(t===null||t==="")return new Uint8Array(0);if(typeof t!="string")break;return Fn(t)}}catch(l){o=l.message}this.assert(!1,r+(o?" - "+o:""),t)}}class ss{constructor(t){var n;this.fields=(n=t.fields)!==null&&n!==void 0?n:[]}write(t,n){const s={},r=t;for(const o of this.fields){if(!o.oneof){let T=this.field(o,r[o.localName],n);T!==void 0&&(s[n.useProtoFieldName?o.name:o.jsonName]=T);continue}const l=r[o.oneof];if(l.oneofKind!==o.localName)continue;const p=o.kind=="scalar"||o.kind=="enum"?Object.assign(Object.assign({},n),{emitDefaultValues:!0}):n;let h=this.field(o,l[o.localName],p);E(h!==void 0),s[n.useProtoFieldName?o.name:o.jsonName]=h}return s}field(t,n,s){let r;if(t.kind=="map"){E(typeof n=="object"&&n!==null);const o={};switch(t.V.kind){case"scalar":for(const[h,T]of Object.entries(n)){const _=this.scalar(t.V.T,T,t.name,!1,!0);E(_!==void 0),o[h.toString()]=_}break;case"message":const l=t.V.T();for(const[h,T]of Object.entries(n)){const _=this.message(l,T,t.name,s);E(_!==void 0),o[h.toString()]=_}break;case"enum":const p=t.V.T();for(const[h,T]of Object.entries(n)){E(T===void 0||typeof T=="number");const _=this.enum(p,T,t.name,!1,!0,s.enumAsInteger);E(_!==void 0),o[h.toString()]=_}break}(s.emitDefaultValues||Object.keys(o).length>0)&&(r=o)}else if(t.repeat){E(Array.isArray(n));const o=[];switch(t.kind){case"scalar":for(let h=0;h<n.length;h++){const T=this.scalar(t.T,n[h],t.name,t.opt,!0);E(T!==void 0),o.push(T)}break;case"enum":const l=t.T();for(let h=0;h<n.length;h++){E(n[h]===void 0||typeof n[h]=="number");const T=this.enum(l,n[h],t.name,t.opt,!0,s.enumAsInteger);E(T!==void 0),o.push(T)}break;case"message":const p=t.T();for(let h=0;h<n.length;h++){const T=this.message(p,n[h],t.name,s);E(T!==void 0),o.push(T)}break}(s.emitDefaultValues||o.length>0||s.emitDefaultValues)&&(r=o)}else switch(t.kind){case"scalar":r=this.scalar(t.T,n,t.name,t.opt,s.emitDefaultValues);break;case"enum":r=this.enum(t.T(),n,t.name,t.opt,s.emitDefaultValues,s.enumAsInteger);break;case"message":r=this.message(t.T(),n,t.name,s);break}return r}enum(t,n,s,r,o,l){if(t[0]=="google.protobuf.NullValue")return!o&&!r?void 0:null;if(n===void 0){E(r);return}if(!(n===0&&!o&&!r))return E(typeof n=="number"),E(Number.isInteger(n)),l||!t[1].hasOwnProperty(n)?n:t[2]?t[2]+t[1][n]:t[1][n]}message(t,n,s,r){return n===void 0?r.emitDefaultValues?null:void 0:t.internalJsonWrite(n,r)}scalar(t,n,s,r,o){if(n===void 0){E(r);return}const l=o||r;switch(t){case k.INT32:case k.SFIXED32:case k.SINT32:return n===0?l?0:void 0:(ue(n),n);case k.FIXED32:case k.UINT32:return n===0?l?0:void 0:(Ee(n),n);case k.FLOAT:it(n);case k.DOUBLE:return n===0?l?0:void 0:(E(typeof n=="number"),Number.isNaN(n)?"NaN":n===Number.POSITIVE_INFINITY?"Infinity":n===Number.NEGATIVE_INFINITY?"-Infinity":n);case k.STRING:return n===""?l?"":void 0:(E(typeof n=="string"),n);case k.BOOL:return n===!1?l?!1:void 0:(E(typeof n=="boolean"),n);case k.UINT64:case k.FIXED64:E(typeof n=="number"||typeof n=="string"||typeof n=="bigint");let p=D.from(n);return p.isZero()&&!l?void 0:p.toString();case k.INT64:case k.SFIXED64:case k.SINT64:E(typeof n=="number"||typeof n=="string"||typeof n=="bigint");let h=N.from(n);return h.isZero()&&!l?void 0:h.toString();case k.BYTES:return E(n instanceof Uint8Array),n.byteLength?Mn(n):l?"":void 0}}}function $e(e,t=J.STRING){switch(e){case k.BOOL:return!1;case k.UINT64:case k.FIXED64:return G(D.ZERO,t);case k.INT64:case k.SFIXED64:case k.SINT64:return G(N.ZERO,t);case k.DOUBLE:case k.FLOAT:return 0;case k.BYTES:return new Uint8Array(0);case k.STRING:return"";default:return 0}}class rs{constructor(t){this.info=t}prepare(){var t;if(!this.fieldNoToField){const n=(t=this.info.fields)!==null&&t!==void 0?t:[];this.fieldNoToField=new Map(n.map(s=>[s.no,s]))}}read(t,n,s,r){this.prepare();const o=r===void 0?t.len:t.pos+r;for(;t.pos<o;){const[l,p]=t.tag(),h=this.fieldNoToField.get(l);if(!h){let v=s.readUnknownField;if(v=="throw")throw new Error(`Unknown field ${l} (wire type ${p}) for ${this.info.typeName}`);let B=t.skip(p);v!==!1&&(v===!0?_e.onRead:v)(this.info.typeName,n,l,p,B);continue}let T=n,_=h.repeat,I=h.localName;switch(h.oneof&&(T=T[h.oneof],T.oneofKind!==I&&(T=n[h.oneof]={oneofKind:I})),h.kind){case"scalar":case"enum":let v=h.kind=="enum"?k.INT32:h.T,B=h.kind=="scalar"?h.L:void 0;if(_){let z=T[I];if(p==P.LengthDelimited&&v!=k.STRING&&v!=k.BYTES){let re=t.uint32()+t.pos;for(;t.pos<re;)z.push(this.scalar(t,v,B))}else z.push(this.scalar(t,v,B))}else T[I]=this.scalar(t,v,B);break;case"message":if(_){let z=T[I],re=h.T().internalBinaryRead(t,t.uint32(),s);z.push(re)}else T[I]=h.T().internalBinaryRead(t,t.uint32(),s,T[I]);break;case"map":let[M,Ae]=this.mapEntry(h,t,s);T[I][M]=Ae;break}}}mapEntry(t,n,s){let r=n.uint32(),o=n.pos+r,l,p;for(;n.pos<o;){let[h,T]=n.tag();switch(h){case 1:t.K==k.BOOL?l=n.bool().toString():l=this.scalar(n,t.K,J.STRING);break;case 2:switch(t.V.kind){case"scalar":p=this.scalar(n,t.V.T,t.V.L);break;case"enum":p=n.int32();break;case"message":p=t.V.T().internalBinaryRead(n,n.uint32(),s);break}break;default:throw new Error(`Unknown field ${h} (wire type ${T}) in map entry for ${this.info.typeName}#${t.name}`)}}if(l===void 0){let h=$e(t.K);l=t.K==k.BOOL?h.toString():h}if(p===void 0)switch(t.V.kind){case"scalar":p=$e(t.V.T,t.V.L);break;case"enum":p=0;break;case"message":p=t.V.T().create();break}return[l,p]}scalar(t,n,s){switch(n){case k.INT32:return t.int32();case k.STRING:return t.string();case k.BOOL:return t.bool();case k.DOUBLE:return t.double();case k.FLOAT:return t.float();case k.INT64:return G(t.int64(),s);case k.UINT64:return G(t.uint64(),s);case k.FIXED64:return G(t.fixed64(),s);case k.FIXED32:return t.fixed32();case k.BYTES:return t.bytes();case k.UINT32:return t.uint32();case k.SFIXED32:return t.sfixed32();case k.SFIXED64:return G(t.sfixed64(),s);case k.SINT32:return t.sint32();case k.SINT64:return G(t.sint64(),s)}}}class os{constructor(t){this.info=t}prepare(){if(!this.fields){const t=this.info.fields?this.info.fields.concat():[];this.fields=t.sort((n,s)=>n.no-s.no)}}write(t,n,s){this.prepare();for(const o of this.fields){let l,p,h=o.repeat,T=o.localName;if(o.oneof){const _=t[o.oneof];if(_.oneofKind!==T)continue;l=_[T],p=!0}else l=t[T],p=!1;switch(o.kind){case"scalar":case"enum":let _=o.kind=="enum"?k.INT32:o.T;if(h)if(E(Array.isArray(l)),h==Re.PACKED)this.packed(n,_,o.no,l);else for(const I of l)this.scalar(n,_,o.no,I,!0);else l===void 0?E(o.opt):this.scalar(n,_,o.no,l,p||o.opt);break;case"message":if(h){E(Array.isArray(l));for(const I of l)this.message(n,s,o.T(),o.no,I)}else this.message(n,s,o.T(),o.no,l);break;case"map":E(typeof l=="object"&&l!==null);for(const[I,v]of Object.entries(l))this.mapEntry(n,s,o,I,v);break}}let r=s.writeUnknownFields;r!==!1&&(r===!0?_e.onWrite:r)(this.info.typeName,t,n)}mapEntry(t,n,s,r,o){t.tag(s.no,P.LengthDelimited),t.fork();let l=r;switch(s.K){case k.INT32:case k.FIXED32:case k.UINT32:case k.SFIXED32:case k.SINT32:l=Number.parseInt(r);break;case k.BOOL:E(r=="true"||r=="false"),l=r=="true";break}switch(this.scalar(t,s.K,1,l,!0),s.V.kind){case"scalar":this.scalar(t,s.V.T,2,o,!0);break;case"enum":this.scalar(t,k.INT32,2,o,!0);break;case"message":this.message(t,n,s.V.T(),2,o);break}t.join()}message(t,n,s,r,o){o!==void 0&&(s.internalBinaryWrite(o,t.tag(r,P.LengthDelimited).fork(),n),t.join())}scalar(t,n,s,r,o){let[l,p,h]=this.scalarInfo(n,r);(!h||o)&&(t.tag(s,l),t[p](r))}packed(t,n,s,r){if(!r.length)return;E(n!==k.BYTES&&n!==k.STRING),t.tag(s,P.LengthDelimited),t.fork();let[,o]=this.scalarInfo(n);for(let l=0;l<r.length;l++)t[o](r[l]);t.join()}scalarInfo(t,n){let s=P.Varint,r,o=n===void 0,l=n===0;switch(t){case k.INT32:r="int32";break;case k.STRING:l=o||!n.length,s=P.LengthDelimited,r="string";break;case k.BOOL:l=n===!1,r="bool";break;case k.UINT32:r="uint32";break;case k.DOUBLE:s=P.Bit64,r="double";break;case k.FLOAT:s=P.Bit32,r="float";break;case k.INT64:l=o||N.from(n).isZero(),r="int64";break;case k.UINT64:l=o||D.from(n).isZero(),r="uint64";break;case k.FIXED64:l=o||D.from(n).isZero(),s=P.Bit64,r="fixed64";break;case k.BYTES:l=o||!n.byteLength,s=P.LengthDelimited,r="bytes";break;case k.FIXED32:s=P.Bit32,r="fixed32";break;case k.SFIXED32:s=P.Bit32,r="sfixed32";break;case k.SFIXED64:l=o||N.from(n).isZero(),s=P.Bit64,r="sfixed64";break;case k.SINT32:r="sint32";break;case k.SINT64:l=o||N.from(n).isZero(),r="sint64";break}return[s,r,o||l]}}function as(e){const t=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},Wt,{value:e});for(let n of e.fields){let s=n.localName;if(!n.opt)if(n.oneof)t[n.oneof]={oneofKind:void 0};else if(n.repeat)t[s]=[];else switch(n.kind){case"scalar":t[s]=$e(n.T,n.L);break;case"enum":t[s]=0;break;case"map":t[s]={};break}}return t}function We(e,t,n){let s,r=n,o;for(let l of e.fields){let p=l.localName;if(l.oneof){const h=r[l.oneof];if((h==null?void 0:h.oneofKind)==null)continue;if(s=h[p],o=t[l.oneof],o.oneofKind=h.oneofKind,s==null){delete o[p];continue}}else if(s=r[p],o=t,s==null)continue;switch(l.repeat&&(o[p].length=s.length),l.kind){case"scalar":case"enum":if(l.repeat)for(let T=0;T<s.length;T++)o[p][T]=s[T];else o[p]=s;break;case"message":let h=l.T();if(l.repeat)for(let T=0;T<s.length;T++)o[p][T]=h.create(s[T]);else o[p]===void 0?o[p]=h.create(s):h.mergePartial(o[p],s);break;case"map":switch(l.V.kind){case"scalar":case"enum":Object.assign(o[p],s);break;case"message":let T=l.V.T();for(let _ of Object.keys(s))o[p][_]=T.create(s[_]);break}break}}}function is(e,t,n){if(t===n)return!0;if(!t||!n)return!1;for(let s of e.fields){let r=s.localName,o=s.oneof?t[s.oneof][r]:t[r],l=s.oneof?n[s.oneof][r]:n[r];switch(s.kind){case"enum":case"scalar":let p=s.kind=="enum"?k.INT32:s.T;if(!(s.repeat?Rt(p,o,l):Kt(p,o,l)))return!1;break;case"map":if(!(s.V.kind=="message"?xt(s.V.T(),ke(o),ke(l)):Rt(s.V.kind=="enum"?k.INT32:s.V.T,ke(o),ke(l))))return!1;break;case"message":let h=s.T();if(!(s.repeat?xt(h,o,l):h.equals(o,l)))return!1;break}}return!0}const ke=Object.values;function Kt(e,t,n){if(t===n)return!0;if(e!==k.BYTES)return!1;let s=t,r=n;if(s.length!==r.length)return!1;for(let o=0;o<s.length;o++)if(s[o]!=r[o])return!1;return!0}function Rt(e,t,n){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(!Kt(e,t[s],n[s]))return!1;return!0}function xt(e,t,n){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(!e.equals(t[s],n[s]))return!1;return!0}const cs=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({}));class u{constructor(t,n,s){this.defaultCheckDepth=16,this.typeName=t,this.fields=n.map(Qn),this.options=s!=null?s:{},this.messagePrototype=Object.create(null,Object.assign(Object.assign({},cs),{[Wt]:{value:this}})),this.refTypeCheck=new ts(this),this.refJsonReader=new ns(this),this.refJsonWriter=new ss(this),this.refBinReader=new rs(this),this.refBinWriter=new os(this)}create(t){let n=as(this);return t!==void 0&&We(this,n,t),n}clone(t){let n=this.create();return We(this,n,t),n}equals(t,n){return is(this,t,n)}is(t,n=this.defaultCheckDepth){return this.refTypeCheck.is(t,n,!1)}isAssignable(t,n=this.defaultCheckDepth){return this.refTypeCheck.is(t,n,!0)}mergePartial(t,n){We(this,t,n)}fromBinary(t,n){let s=Gn(n);return this.internalBinaryRead(s.readerFactory(t),t.byteLength,s)}fromJson(t,n){return this.internalJsonRead(t,zn(n))}fromJsonString(t,n){let s=JSON.parse(t);return this.fromJson(s,n)}toJson(t,n){return this.internalJsonWrite(t,Hn(n))}toJsonString(t,n){var s;let r=this.toJson(t,n);return JSON.stringify(r,null,(s=n==null?void 0:n.prettySpaces)!==null&&s!==void 0?s:0)}toBinary(t,n){let s=$n(n);return this.internalBinaryWrite(t,s.writerFactory(),s).finish()}internalJsonRead(t,n,s){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let r=s!=null?s:this.create();return this.refJsonReader.read(t,r,n),r}throw new Error(`Unable to parse message ${this.typeName} from JSON ${at(t)}.`)}internalJsonWrite(t,n){return this.refJsonWriter.write(t,n)}internalBinaryWrite(t,n,s){return this.refBinWriter.write(t,n,s),n}internalBinaryRead(t,n,s,r){let o=r!=null?r:this.create();return this.refBinReader.read(t,o,s,n),o}}var us=Object.defineProperty,ls=Object.defineProperties,ds=Object.getOwnPropertyDescriptors,Ot=Object.getOwnPropertySymbols,ps=Object.prototype.hasOwnProperty,ms=Object.prototype.propertyIsEnumerable,Ye=(e,t,n)=>t in e?us(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,St=(e,t)=>{for(var n in t||(t={}))ps.call(t,n)&&Ye(e,n,t[n]);if(Ot)for(var n of Ot(t))ms.call(t,n)&&Ye(e,n,t[n]);return e},fs=(e,t)=>ls(e,ds(t)),R=(e,t,n)=>(Ye(e,typeof t!="symbol"?t+"":t,n),n),Jt=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},ge=(e,t,n)=>(Jt(e,t,"read from private field"),n?n.call(e):t.get(e)),Ke=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},hs=(e,t,n,s)=>(Jt(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),ks=(e,t,n)=>new Promise((s,r)=>{var o=h=>{try{p(n.next(h))}catch(T){r(T)}},l=h=>{try{p(n.throw(h))}catch(T){r(T)}},p=h=>h.done?s(h.value):Promise.resolve(h.value).then(o,l);p((n=n.apply(e,t)).next())}),ie=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},xe={},gs={get exports(){return xe},set exports(e){xe=e}},te=typeof Reflect=="object"?Reflect:null,Nt=te&&typeof te.apply=="function"?te.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},ye;te&&typeof te.ownKeys=="function"?ye=te.ownKeys:Object.getOwnPropertySymbols?ye=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:ye=function(e){return Object.getOwnPropertyNames(e)};function Ts(e){console&&console.warn&&console.warn(e)}var Zt=Number.isNaN||function(e){return e!==e};function x(){x.init.call(this)}gs.exports=x;xe.once=_s;x.EventEmitter=x;x.prototype._events=void 0;x.prototype._eventsCount=0;x.prototype._maxListeners=void 0;var It=10;function Ce(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(x,"defaultMaxListeners",{enumerable:!0,get:function(){return It},set:function(e){if(typeof e!="number"||e<0||Zt(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");It=e}});x.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};x.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Zt(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Xt(e){return e._maxListeners===void 0?x.defaultMaxListeners:e._maxListeners}x.prototype.getMaxListeners=function(){return Xt(this)};x.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var s=e==="error",r=this._events;if(r!==void 0)s=s&&r.error===void 0;else if(!s)return!1;if(s){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var p=r[e];if(p===void 0)return!1;if(typeof p=="function")Nt(p,this,t);else for(var h=p.length,T=Qt(p,h),n=0;n<h;++n)Nt(T[n],this,t);return!0};function $t(e,t,n,s){var r,o,l;if(Ce(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),l=o[t]),l===void 0)l=o[t]=n,++e._eventsCount;else if(typeof l=="function"?l=o[t]=s?[n,l]:[l,n]:s?l.unshift(n):l.push(n),r=Xt(e),r>0&&l.length>r&&!l.warned){l.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=e,p.type=t,p.count=l.length,Ts(p)}return e}x.prototype.addListener=function(e,t){return $t(this,e,t,!1)};x.prototype.on=x.prototype.addListener;x.prototype.prependListener=function(e,t){return $t(this,e,t,!0)};function ws(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Yt(e,t,n){var s={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=ws.bind(s);return r.listener=n,s.wrapFn=r,r}x.prototype.once=function(e,t){return Ce(t),this.on(e,Yt(this,e,t)),this};x.prototype.prependOnceListener=function(e,t){return Ce(t),this.prependListener(e,Yt(this,e,t)),this};x.prototype.removeListener=function(e,t){var n,s,r,o,l;if(Ce(t),s=this._events,s===void 0)return this;if(n=s[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){l=n[o].listener,r=o;break}if(r<0)return this;r===0?n.shift():ys(n,r),n.length===1&&(s[e]=n[0]),s.removeListener!==void 0&&this.emit("removeListener",e,l||t)}return this};x.prototype.off=x.prototype.removeListener;x.prototype.removeAllListeners=function(e){var t,n,s;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var r=Object.keys(n),o;for(s=0;s<r.length;++s)o=r[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(s=t.length-1;s>=0;s--)this.removeListener(e,t[s]);return this};function zt(e,t,n){var s=e._events;if(s===void 0)return[];var r=s[t];return r===void 0?[]:typeof r=="function"?n?[r.listener||r]:[r]:n?bs(r):Qt(r,r.length)}x.prototype.listeners=function(e){return zt(this,e,!0)};x.prototype.rawListeners=function(e){return zt(this,e,!1)};x.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Ht.call(e,t)};x.prototype.listenerCount=Ht;function Ht(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}x.prototype.eventNames=function(){return this._eventsCount>0?ye(this._events):[]};function Qt(e,t){for(var n=new Array(t),s=0;s<t;++s)n[s]=e[s];return n}function ys(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function bs(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function _s(e,t){return new Promise(function(n,s){function r(l){e.removeListener(t,o),s(l)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",r),n([].slice.call(arguments))}en(e,t,o,{once:!0}),t!=="error"&&vs(e,r,{once:!0})})}function vs(e,t,n){typeof e.on=="function"&&en(e,"error",t,n)}function en(e,t,n,s){if(typeof e.on=="function")s.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function r(o){s.once&&e.removeEventListener(t,r),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}const Es=`
3
3
  v=0
4
4
  o=- 0000000000000000000 0 IN IP4 127.0.0.1
5
5
  s=-
@@ -63,4 +63,4 @@ a=rtcp-fb:96 nack pli
63
63
  a=rid:q send
64
64
  a=rid:h send
65
65
  a=simulcast:send q;h
66
- `,Ct={track:null,transport:null,rtcpTransport:null,dtmf:{insertDTMF:()=>{},ontonechange:null,canInsertDTMF:!1,toneBuffer:"",addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!0},transform:null,mid:null,getParameters:()=>({}),setParameters:()=>Promise.resolve({}),replaceTrack:()=>Promise.resolve({}),getStats:()=>Promise.resolve(new Map),setStreams:()=>{},setTransform:()=>Promise.resolve()};class Rs extends Re{constructor(){super(),R(this,"localDescription",null),R(this,"remoteDescription",null),R(this,"currentLocalDescription",null),R(this,"currentRemoteDescription",null),R(this,"pendingLocalDescription",null),R(this,"pendingRemoteDescription",null),R(this,"signalingState","stable"),R(this,"iceConnectionState","new"),R(this,"iceGatheringState","new"),R(this,"connectionState","new"),R(this,"canTrickleIceCandidates",null),R(this,"sctp",null),R(this,"senders",[]),R(this,"receivers",[]),R(this,"transceivers",[]),R(this,"onicecandidate",null),R(this,"onicecandidateerror",null),R(this,"onconnectionstatechange",null),R(this,"oniceconnectionstatechange",null),R(this,"onicegatheringstatechange",null),R(this,"onsignalingstatechange",null),R(this,"onnegotiationneeded",null),R(this,"ontrack",null),R(this,"ondatachannel",null),R(this,"addEventListener"),R(this,"removeEventListener"),this.addEventListener=this.addListener,this.removeEventListener=this.removeListener}createOffer(){return Promise.resolve({sdp:Es,type:"offer"})}createAnswer(){return Promise.resolve({})}setLocalDescription(){return this.iceConnectionState="connected",this.iceGatheringState="complete",this.connectionState="connected",this.signalingState="stable",this.emit("iceconnectionstatechange"),Promise.resolve()}setRemoteDescription(){return Promise.resolve()}addIceCandidate(){return Promise.resolve()}getStats(){return Promise.resolve(new Map)}getConfiguration(){return{}}setConfiguration(){}close(){}createDataChannel(){return{close:()=>{},send:()=>{}}}addTrack(){return Ct}removeTrack(){}addTransceiver(){return{stop:()=>{},setDirection:()=>{},setCodecPreferences:()=>{},sender:Ct}}getTransceivers(){return[]}getSenders(){return[]}getReceivers(){return[]}restartIce(){}static generateCertificate(){return Promise.resolve({expires:Date.now(),getFingerprints:()=>[]})}}function xs(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var le={},Os={get exports(){return le},set exports(e){le=e}};(function(e,t){(function(n,s){s(t)})(ie,function(n){var s=typeof window!="undefined"?window:typeof ie!="undefined"?ie:typeof self!="undefined"?self:{},r=function(i,c){if(c=c.split(":")[0],i=+i,!i)return!1;switch(c){case"http":case"ws":return i!==80;case"https":case"wss":return i!==443;case"ftp":return i!==21;case"gopher":return i!==70;case"file":return!1}return i!==0},o=Object.prototype.hasOwnProperty,l;function p(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch(c){return null}}function h(i){try{return encodeURIComponent(i)}catch(c){return null}}function T(i){for(var c=/([^=?#&]+)=?([^&]*)/g,d={},a;a=c.exec(i);){var m=p(a[1]),f=p(a[2]);m===null||f===null||m in d||(d[m]=f)}return d}function _(i,c){c=c||"";var d=[],a,m;typeof c!="string"&&(c="?");for(m in i)if(o.call(i,m)){if(a=i[m],!a&&(a===null||a===l||isNaN(a))&&(a=""),m=h(m),a=h(a),m===null||a===null)continue;d.push(m+"="+a)}return d.length?c+d.join("&"):""}var I=_,v=T,B={stringify:I,parse:v},M=/[\n\r\t]/g,Ae=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,z=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,re=/^[a-zA-Z]:/,yn=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;function Be(i){return(i||"").toString().replace(yn,"")}var De=[["#","hash"],["?","query"],function(i,c){return W(c.protocol)?i.replace(/\\/g,"/"):i},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],dt={hash:1,query:1};function pt(i){var c;typeof window!="undefined"?c=window:typeof s!="undefined"?c=s:typeof self!="undefined"?c=self:c={};var d=c.location||{};i=i||d;var a={},m=typeof i,f;if(i.protocol==="blob:")a=new K(unescape(i.pathname),{});else if(m==="string"){a=new K(i,{});for(f in dt)delete a[f]}else if(m==="object"){for(f in i)f in dt||(a[f]=i[f]);a.slashes===void 0&&(a.slashes=Ae.test(i.href))}return a}function W(i){return i==="file:"||i==="ftp:"||i==="http:"||i==="https:"||i==="ws:"||i==="wss:"}function mt(i,c){i=Be(i),i=i.replace(M,""),c=c||{};var d=z.exec(i),a=d[1]?d[1].toLowerCase():"",m=!!d[2],f=!!d[3],g=0,w;return m?f?(w=d[2]+d[3]+d[4],g=d[2].length+d[3].length):(w=d[2]+d[4],g=d[2].length):f?(w=d[3]+d[4],g=d[3].length):w=d[4],a==="file:"?g>=2&&(w=w.slice(2)):W(a)?w=d[4]:a?m&&(w=w.slice(2)):g>=2&&W(c.protocol)&&(w=d[4]),{protocol:a,slashes:m||W(a),slashesCount:g,rest:w}}function bn(i,c){if(i==="")return c;for(var d=(c||"/").split("/").slice(0,-1).concat(i.split("/")),a=d.length,m=d[a-1],f=!1,g=0;a--;)d[a]==="."?d.splice(a,1):d[a]===".."?(d.splice(a,1),g++):g&&(a===0&&(f=!0),d.splice(a,1),g--);return f&&d.unshift(""),(m==="."||m==="..")&&d.push(""),d.join("/")}function K(i,c,d){if(i=Be(i),i=i.replace(M,""),!(this instanceof K))return new K(i,c,d);var a,m,f,g,w,b,A=De.slice(),Tt=typeof c,y=this,Ge=0;for(Tt!=="object"&&Tt!=="string"&&(d=c,c=null),d&&typeof d!="function"&&(d=B.parse),c=pt(c),m=mt(i||"",c),a=!m.protocol&&!m.slashes,y.slashes=m.slashes||a&&c.slashes,y.protocol=m.protocol||c.protocol||"",i=m.rest,(m.protocol==="file:"&&(m.slashesCount!==2||re.test(i))||!m.slashes&&(m.protocol||m.slashesCount<2||!W(y.protocol)))&&(A[3]=[/(.*)/,"pathname"]);Ge<A.length;Ge++){if(g=A[Ge],typeof g=="function"){i=g(i,y);continue}f=g[0],b=g[1],f!==f?y[b]=i:typeof f=="string"?(w=f==="@"?i.lastIndexOf(f):i.indexOf(f),~w&&(typeof g[2]=="number"?(y[b]=i.slice(0,w),i=i.slice(w+g[2])):(y[b]=i.slice(w),i=i.slice(0,w)))):(w=f.exec(i))&&(y[b]=w[1],i=i.slice(0,w.index)),y[b]=y[b]||a&&g[3]&&c[b]||"",g[4]&&(y[b]=y[b].toLowerCase())}d&&(y.query=d(y.query)),a&&c.slashes&&y.pathname.charAt(0)!=="/"&&(y.pathname!==""||c.pathname!=="")&&(y.pathname=bn(y.pathname,c.pathname)),y.pathname.charAt(0)!=="/"&&W(y.protocol)&&(y.pathname="/"+y.pathname),r(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(w=y.auth.indexOf(":"),~w?(y.username=y.auth.slice(0,w),y.username=encodeURIComponent(decodeURIComponent(y.username)),y.password=y.auth.slice(w+1),y.password=encodeURIComponent(decodeURIComponent(y.password))):y.username=encodeURIComponent(decodeURIComponent(y.auth)),y.auth=y.password?y.username+":"+y.password:y.username),y.origin=y.protocol!=="file:"&&W(y.protocol)&&y.host?y.protocol+"//"+y.host:"null",y.href=y.toString()}function _n(i,c,d){var a=this;switch(i){case"query":typeof c=="string"&&c.length&&(c=(d||B.parse)(c)),a[i]=c;break;case"port":a[i]=c,r(c,a.protocol)?c&&(a.host=a.hostname+":"+c):(a.host=a.hostname,a[i]="");break;case"hostname":a[i]=c,a.port&&(c+=":"+a.port),a.host=c;break;case"host":a[i]=c,/:\d+$/.test(c)?(c=c.split(":"),a.port=c.pop(),a.hostname=c.join(":")):(a.hostname=c,a.port="");break;case"protocol":a.protocol=c.toLowerCase(),a.slashes=!d;break;case"pathname":case"hash":if(c){var m=i==="pathname"?"/":"#";a[i]=c.charAt(0)!==m?m+c:c}else a[i]=c;break;case"username":case"password":a[i]=encodeURIComponent(c);break;case"auth":var f=c.indexOf(":");~f?(a.username=c.slice(0,f),a.username=encodeURIComponent(decodeURIComponent(a.username)),a.password=c.slice(f+1),a.password=encodeURIComponent(decodeURIComponent(a.password))):a.username=encodeURIComponent(decodeURIComponent(c))}for(var g=0;g<De.length;g++){var w=De[g];w[4]&&(a[w[1]]=a[w[1]].toLowerCase())}return a.auth=a.password?a.username+":"+a.password:a.username,a.origin=a.protocol!=="file:"&&W(a.protocol)&&a.host?a.protocol+"//"+a.host:"null",a.href=a.toString(),a}function vn(i){(!i||typeof i!="function")&&(i=B.stringify);var c,d=this,a=d.host,m=d.protocol;m&&m.charAt(m.length-1)!==":"&&(m+=":");var f=m+(d.protocol&&d.slashes||W(d.protocol)?"//":"");return d.username?(f+=d.username,d.password&&(f+=":"+d.password),f+="@"):d.password?(f+=":"+d.password,f+="@"):d.protocol!=="file:"&&W(d.protocol)&&!a&&d.pathname!=="/"&&(f+="@"),a[a.length-1]===":"&&(a+=":"),f+=a+d.pathname,c=typeof d.query=="object"?i(d.query):d.query,c&&(f+=c.charAt(0)!=="?"?"?"+c:c),d.hash&&(f+=d.hash),f}K.prototype={set:_n,toString:vn},K.extractProtocol=mt,K.location=pt,K.trimLeft=Be,K.qs=B;var Fe=K;function oe(i,c){setTimeout(function(d){return i.call(d)},4,c)}function pe(i,c){typeof process!="undefined"&&console[i].call(null,c)}function Me(i,c){i===void 0&&(i=[]);var d=[];return i.forEach(function(a){c(a)||d.push(a)}),d}function En(i,c){i===void 0&&(i=[]);var d=[];return i.forEach(function(a){c(a)&&d.push(a)}),d}var H=function(){this.listeners={}};H.prototype.addEventListener=function(i,c){typeof c=="function"&&(Array.isArray(this.listeners[i])||(this.listeners[i]=[]),En(this.listeners[i],function(d){return d===c}).length===0&&this.listeners[i].push(c))},H.prototype.removeEventListener=function(i,c){var d=this.listeners[i];this.listeners[i]=Me(d,function(a){return a===c})},H.prototype.dispatchEvent=function(i){for(var c=this,d=[],a=arguments.length-1;a-- >0;)d[a]=arguments[a+1];var m=i.type,f=this.listeners[m];return Array.isArray(f)?(f.forEach(function(g){d.length>0?g.apply(c,d):g.call(c,i)}),!0):!1};function $(i){var c=i.indexOf("?");return c>=0?i.slice(0,c):i}var Z=function(){this.urlMap={}};Z.prototype.attachWebSocket=function(i,c){var d=$(c),a=this.urlMap[d];if(a&&a.server&&a.websockets.indexOf(i)===-1)return a.websockets.push(i),a.server},Z.prototype.addMembershipToRoom=function(i,c){var d=this.urlMap[$(i.url)];d&&d.server&&d.websockets.indexOf(i)!==-1&&(d.roomMemberships[c]||(d.roomMemberships[c]=[]),d.roomMemberships[c].push(i))},Z.prototype.attachServer=function(i,c){var d=$(c),a=this.urlMap[d];if(!a)return this.urlMap[d]={server:i,websockets:[],roomMemberships:{}},i},Z.prototype.serverLookup=function(i){var c=$(i),d=this.urlMap[c];if(d)return d.server},Z.prototype.websocketsLookup=function(i,c,d){var a=$(i),m,f=this.urlMap[a];if(m=f?f.websockets:[],c){var g=f.roomMemberships[c];m=g||[]}return d?m.filter(function(w){return w!==d}):m},Z.prototype.removeServer=function(i){delete this.urlMap[$(i)]},Z.prototype.removeWebSocket=function(i,c){var d=$(c),a=this.urlMap[d];a&&(a.websockets=Me(a.websockets,function(m){return m===i}))},Z.prototype.removeMembershipFromRoom=function(i,c){var d=this.urlMap[$(i.url)],a=d.roomMemberships[c];d&&a!==null&&(d.roomMemberships[c]=Me(a,function(m){return m===i}))};var C=new Z,U={CLOSE_NORMAL:1e3,CLOSE_GOING_AWAY:1001,CLOSE_PROTOCOL_ERROR:1002,CLOSE_UNSUPPORTED:1003,CLOSE_NO_STATUS:1005,CLOSE_ABNORMAL:1006,UNSUPPORTED_DATA:1007,POLICY_VIOLATION:1008,CLOSE_TOO_LARGE:1009,MISSING_EXTENSION:1010,INTERNAL_ERROR:1011,SERVICE_RESTART:1012,TRY_AGAIN_LATER:1013,TLS_HANDSHAKE:1015},F={CONSTRUCTOR_ERROR:"Failed to construct 'WebSocket':",CLOSE_ERROR:"Failed to execute 'close' on 'WebSocket':",EVENT:{CONSTRUCT:"Failed to construct 'Event':",MESSAGE:"Failed to construct 'MessageEvent':",CLOSE:"Failed to construct 'CloseEvent':"}},Q=function(){};Q.prototype.stopPropagation=function(){},Q.prototype.stopImmediatePropagation=function(){},Q.prototype.initEvent=function(i,c,d){i===void 0&&(i="undefined"),c===void 0&&(c=!1),d===void 0&&(d=!1),this.type=""+i,this.bubbles=Boolean(c),this.cancelable=Boolean(d)};var Rn=function(i){function c(d,a){if(a===void 0&&(a={}),i.call(this),!d)throw new TypeError(F.EVENT_ERROR+" 1 argument required, but only 0 present.");if(typeof a!="object")throw new TypeError(F.EVENT_ERROR+" parameter 2 ('eventInitDict') is not an object.");var m=a.bubbles,f=a.cancelable;this.type=""+d,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=f?Boolean(f):!1,this.cancelBubble=!1,this.bubbles=m?Boolean(m):!1}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c}(Q),xn=function(i){function c(d,a){if(a===void 0&&(a={}),i.call(this),!d)throw new TypeError(F.EVENT.MESSAGE+" 1 argument required, but only 0 present.");if(typeof a!="object")throw new TypeError(F.EVENT.MESSAGE+" parameter 2 ('eventInitDict') is not an object");var m=a.bubbles,f=a.cancelable,g=a.data,w=a.origin,b=a.lastEventId,A=a.ports;this.type=""+d,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=f?Boolean(f):!1,this.canncelBubble=!1,this.bubbles=m?Boolean(m):!1,this.origin=""+w,this.ports=typeof A=="undefined"?null:A,this.data=typeof g=="undefined"?null:g,this.lastEventId=""+(b||"")}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c}(Q),On=function(i){function c(d,a){if(a===void 0&&(a={}),i.call(this),!d)throw new TypeError(F.EVENT.CLOSE+" 1 argument required, but only 0 present.");if(typeof a!="object")throw new TypeError(F.EVENT.CLOSE+" parameter 2 ('eventInitDict') is not an object");var m=a.bubbles,f=a.cancelable,g=a.code,w=a.reason,b=a.wasClean;this.type=""+d,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=f?Boolean(f):!1,this.cancelBubble=!1,this.bubbles=m?Boolean(m):!1,this.code=typeof g=="number"?parseInt(g,10):0,this.reason=""+(w||""),this.wasClean=b?Boolean(b):!1}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c}(Q);function q(i){var c=i.type,d=i.target,a=new Rn(c);return d&&(a.target=d,a.srcElement=d,a.currentTarget=d),a}function ae(i){var c=i.type,d=i.origin,a=i.data,m=i.target,f=new xn(c,{data:a,origin:d});return m&&(f.target=m,f.srcElement=m,f.currentTarget=m),f}function V(i){var c=i.code,d=i.reason,a=i.type,m=i.target,f=i.wasClean;f||(f=c===U.CLOSE_NORMAL||c===U.CLOSE_NO_STATUS);var g=new On(a,{code:c,reason:d,wasClean:f});return m&&(g.target=m,g.srcElement=m,g.currentTarget=m),g}function ft(i,c,d){i.readyState=L.CLOSING;var a=C.serverLookup(i.url),m=V({type:"close",target:i.target,code:c,reason:d});oe(function(){C.removeWebSocket(i,i.url),i.readyState=L.CLOSED,i.dispatchEvent(m),a&&a.dispatchEvent(m,a)},i)}function Sn(i,c,d){i.readyState=L.CLOSING;var a=C.serverLookup(i.url),m=V({type:"close",target:i.target,code:c,reason:d,wasClean:!1}),f=q({type:"error",target:i.target});oe(function(){C.removeWebSocket(i,i.url),i.readyState=L.CLOSED,i.dispatchEvent(f),i.dispatchEvent(m),a&&a.dispatchEvent(m,a)},i)}function me(i){return Object.prototype.toString.call(i)!=="[object Blob]"&&!(i instanceof ArrayBuffer)&&(i=String(i)),i}var Ue=new WeakMap;function ht(i){if(Ue.has(i))return Ue.get(i);var c=new Proxy(i,{get:function(d,a){if(a==="close")return function(f){f===void 0&&(f={});var g=f.code||U.CLOSE_NORMAL,w=f.reason||"";ft(c,g,w)};if(a==="send")return function(f){f=me(f),i.dispatchEvent(ae({type:"message",data:f,origin:this.url,target:i}))};var m=function(f){return f==="message"?"server::"+f:f};return a==="on"?function(f,g){i.addEventListener(m(f),g)}:a==="off"?function(f,g){i.removeEventListener(m(f),g)}:a==="target"?i:d[a]}});return Ue.set(i,c),c}function Nn(i){var c=encodeURIComponent(i).match(/%[89ABab]/g);return i.length+(c?c.length:0)}function In(i){var c=new Fe(i),d=c.pathname,a=c.protocol,m=c.hash;if(!i)throw new TypeError(F.CONSTRUCTOR_ERROR+" 1 argument required, but only 0 present.");if(d||(c.pathname="/"),a==="")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The URL '"+c.toString()+"' is invalid.");if(a!=="ws:"&&a!=="wss:")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The URL's scheme must be either 'ws' or 'wss'. '"+a+"' is not allowed.");if(m!=="")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The URL contains a fragment identifier ('"+m+"'). Fragment identifiers are not allowed in WebSocket URLs.");return c.toString()}function Cn(i){if(i===void 0&&(i=[]),!Array.isArray(i)&&typeof i!="string")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The subprotocol '"+i.toString()+"' is invalid.");typeof i=="string"&&(i=[i]);var c=i.map(function(a){return{count:1,protocol:a}}).reduce(function(a,m){return a[m.protocol]=(a[m.protocol]||0)+m.count,a},{}),d=Object.keys(c).filter(function(a){return c[a]>1});if(d.length>0)throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The subprotocol '"+d[0]+"' is duplicated.");return i}var L=function(i){function c(a,m){i.call(this),this._onopen=null,this._onmessage=null,this._onerror=null,this._onclose=null,this.url=In(a),m=Cn(m),this.protocol=m[0]||"",this.binaryType="blob",this.readyState=c.CONNECTING;var f=ht(this),g=C.attachWebSocket(f,this.url);oe(function(){if(this.readyState===c.CONNECTING)if(g)if(g.options.verifyClient&&typeof g.options.verifyClient=="function"&&!g.options.verifyClient())this.readyState=c.CLOSED,pe("error","WebSocket connection to '"+this.url+"' failed: HTTP Authentication failed; no valid credentials available"),C.removeWebSocket(f,this.url),this.dispatchEvent(q({type:"error",target:this})),this.dispatchEvent(V({type:"close",target:this,code:U.CLOSE_NORMAL}));else{if(g.options.selectProtocol&&typeof g.options.selectProtocol=="function"){var w=g.options.selectProtocol(m),b=w!=="",A=m.indexOf(w)!==-1;if(b&&!A){this.readyState=c.CLOSED,pe("error","WebSocket connection to '"+this.url+"' failed: Invalid Sub-Protocol"),C.removeWebSocket(f,this.url),this.dispatchEvent(q({type:"error",target:this})),this.dispatchEvent(V({type:"close",target:this,code:U.CLOSE_NORMAL}));return}this.protocol=w}this.readyState=c.OPEN,this.dispatchEvent(q({type:"open",target:this})),g.dispatchEvent(q({type:"connection"}),f)}else this.readyState=c.CLOSED,this.dispatchEvent(q({type:"error",target:this})),this.dispatchEvent(V({type:"close",target:this,code:U.CLOSE_NORMAL})),pe("error","WebSocket connection to '"+this.url+"' failed")},this)}i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c;var d={onopen:{},onmessage:{},onclose:{},onerror:{}};return d.onopen.get=function(){return this._onopen},d.onmessage.get=function(){return this._onmessage},d.onclose.get=function(){return this._onclose},d.onerror.get=function(){return this._onerror},d.onopen.set=function(a){this.removeEventListener("open",this._onopen),this._onopen=a,this.addEventListener("open",a)},d.onmessage.set=function(a){this.removeEventListener("message",this._onmessage),this._onmessage=a,this.addEventListener("message",a)},d.onclose.set=function(a){this.removeEventListener("close",this._onclose),this._onclose=a,this.addEventListener("close",a)},d.onerror.set=function(a){this.removeEventListener("error",this._onerror),this._onerror=a,this.addEventListener("error",a)},c.prototype.send=function(a){var m=this;if(this.readyState===c.CONNECTING)throw new Error("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state");var f=ae({type:"server::message",origin:this.url,data:me(a)}),g=C.serverLookup(this.url);g&&oe(function(){m.dispatchEvent(f,a)},g)},c.prototype.close=function(a,m){if(a!==void 0&&(typeof a!="number"||a!==1e3&&(a<3e3||a>4999)))throw new TypeError(F.CLOSE_ERROR+" The code must be either 1000, or between 3000 and 4999. "+a+" is neither.");if(m!==void 0){var f=Nn(m);if(f>123)throw new SyntaxError(F.CLOSE_ERROR+" The message must not be greater than 123 bytes.")}if(!(this.readyState===c.CLOSING||this.readyState===c.CLOSED)){var g=ht(this);this.readyState===c.CONNECTING?Sn(g,a||U.CLOSE_ABNORMAL,m):ft(g,a||U.CLOSE_NO_STATUS,m)}},Object.defineProperties(c.prototype,d),c}(H);L.CONNECTING=0,L.prototype.CONNECTING=L.CONNECTING,L.OPEN=1,L.prototype.OPEN=L.OPEN,L.CLOSING=2,L.prototype.CLOSING=L.CLOSING,L.CLOSED=3,L.prototype.CLOSED=L.CLOSED;var ee=function(i){function c(a,m){var f=this;a===void 0&&(a="socket.io"),m===void 0&&(m=""),i.call(this),this.binaryType="blob";var g=new Fe(a);g.pathname||(g.pathname="/"),this.url=g.toString(),this.readyState=c.CONNECTING,this.protocol="",this.target=this,typeof m=="string"||typeof m=="object"&&m!==null?this.protocol=m:Array.isArray(m)&&m.length>0&&(this.protocol=m[0]);var w=C.attachWebSocket(this,this.url);oe(function(){w?(this.readyState=c.OPEN,w.dispatchEvent(q({type:"connection"}),w,this),w.dispatchEvent(q({type:"connect"}),w,this),this.dispatchEvent(q({type:"connect",target:this}))):(this.readyState=c.CLOSED,this.dispatchEvent(q({type:"error",target:this})),this.dispatchEvent(V({type:"close",target:this,code:U.CLOSE_NORMAL})),pe("error","Socket.io connection to '"+this.url+"' failed"))},this),this.addEventListener("close",function(b){f.dispatchEvent(V({type:"disconnect",target:b.target,code:b.code}))})}i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c;var d={broadcast:{}};return c.prototype.close=function(){if(this.readyState===c.OPEN){var a=C.serverLookup(this.url);return C.removeWebSocket(this,this.url),this.readyState=c.CLOSED,this.dispatchEvent(V({type:"close",target:this,code:U.CLOSE_NORMAL})),a&&a.dispatchEvent(V({type:"disconnect",target:this,code:U.CLOSE_NORMAL}),a),this}},c.prototype.disconnect=function(){return this.close()},c.prototype.emit=function(a){for(var m=[],f=arguments.length-1;f-- >0;)m[f]=arguments[f+1];if(this.readyState!==c.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var g=ae({type:a,origin:this.url,data:m}),w=C.serverLookup(this.url);return w&&w.dispatchEvent.apply(w,[g].concat(m)),this},c.prototype.send=function(a){return this.emit("message",a),this},d.broadcast.get=function(){if(this.readyState!==c.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var a=this,m=C.serverLookup(this.url);if(!m)throw new Error("SocketIO can not find a server at the specified URL ("+this.url+")");return{emit:function(f,g){return m.emit(f,g,{websockets:C.websocketsLookup(a.url,null,a)}),a},to:function(f){return m.to(f,a)},in:function(f){return m.in(f,a)}}},c.prototype.on=function(a,m){return this.addEventListener(a,m),this},c.prototype.off=function(a,m){this.removeEventListener(a,m)},c.prototype.hasListeners=function(a){var m=this.listeners[a];return Array.isArray(m)?!!m.length:!1},c.prototype.join=function(a){C.addMembershipToRoom(this,a)},c.prototype.leave=function(a){C.removeMembershipFromRoom(this,a)},c.prototype.to=function(a){return this.broadcast.to(a)},c.prototype.in=function(){return this.to.apply(null,arguments)},c.prototype.dispatchEvent=function(a){for(var m=this,f=[],g=arguments.length-1;g-- >0;)f[g]=arguments[g+1];var w=a.type,b=this.listeners[w];if(!Array.isArray(b))return!1;b.forEach(function(A){f.length>0?A.apply(m,f):A.call(m,a.data?a.data:a)})},Object.defineProperties(c.prototype,d),c}(H);ee.CONNECTING=0,ee.OPEN=1,ee.CLOSING=2,ee.CLOSED=3;var qe=function(i,c){return new ee(i,c)};qe.connect=function(i,c){return qe(i,c)};var Pn=function(i){return i.reduce(function(c,d){return c.indexOf(d)>-1?c:c.concat(d)},[])};function kt(){return typeof window!="undefined"?window:typeof process=="object"&&typeof xs=="function"&&typeof ie=="object"?ie:this}var gt={mock:!0,verifyClient:null,selectProtocol:null},Ve=function(i){function c(d,a){a===void 0&&(a=gt),i.call(this);var m=new Fe(d);m.pathname||(m.pathname="/"),this.url=m.toString(),this.originalWebSocket=null;var f=C.attachServer(this,this.url);if(!f)throw this.dispatchEvent(q({type:"error"})),new Error("A mock server is already listening on this url");this.options=Object.assign({},gt,a),this.options.mock&&this.mockWebsocket()}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c.prototype.mockWebsocket=function(){var d=kt();this.originalWebSocket=d.WebSocket,d.WebSocket=L},c.prototype.restoreWebsocket=function(){var d=kt();this.originalWebSocket!==null&&(d.WebSocket=this.originalWebSocket),this.originalWebSocket=null},c.prototype.stop=function(d){d===void 0&&(d=function(){}),this.options.mock&&this.restoreWebsocket(),C.removeServer(this.url),typeof d=="function"&&d()},c.prototype.on=function(d,a){this.addEventListener(d,a)},c.prototype.off=function(d,a){this.removeEventListener(d,a)},c.prototype.close=function(d){d===void 0&&(d={});var a=d.code,m=d.reason,f=d.wasClean,g=C.websocketsLookup(this.url);C.removeServer(this.url),g.forEach(function(w){w.readyState=L.CLOSED,w.dispatchEvent(V({type:"close",target:w.target,code:a||U.CLOSE_NORMAL,reason:m||"",wasClean:f}))}),this.dispatchEvent(V({type:"close"}),this)},c.prototype.emit=function(d,a,m){var f=this;m===void 0&&(m={});var g=m.websockets;g||(g=C.websocketsLookup(this.url));var w;typeof m!="object"||arguments.length>3?(a=Array.prototype.slice.call(arguments,1,arguments.length),w=a.map(function(b){return me(b)})):w=me(a),g.forEach(function(b){var A=b instanceof ee?a:w;Array.isArray(A)?b.dispatchEvent.apply(b,[ae({type:d,data:A,origin:f.url,target:b.target})].concat(A)):b.dispatchEvent(ae({type:d,data:A,origin:f.url,target:b.target}))})},c.prototype.clients=function(){return C.websocketsLookup(this.url)},c.prototype.to=function(d,a,m){var f=this;m===void 0&&(m=[]);var g=this,w=Pn(m.concat(C.websocketsLookup(this.url,d,a)));return{to:function(b,A){return f.to.call(f,b,A,w)},emit:function(b,A){g.emit(b,A,{websockets:w})}}},c.prototype.in=function(){for(var d=[],a=arguments.length;a--;)d[a]=arguments[a];return this.to.apply(null,d)},c.prototype.simulate=function(d){var a=C.websocketsLookup(this.url);d==="error"&&a.forEach(function(m){m.readyState=L.CLOSED,m.dispatchEvent(q({type:"error",target:m.target}))})},c}(H);Ve.of=function(i){return new Ve(i)};var Ln=Ve,An=L,Bn=qe;n.Server=Ln,n.WebSocket=An,n.SocketIO=Bn,Object.defineProperty(n,"__esModule",{value:!0})})})(Os,le);var ze={},Ss={get exports(){return ze},set exports(e){ze=e}},ne=typeof Reflect=="object"?Reflect:null,Pt=ne&&typeof ne.apply=="function"?ne.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},ye;ne&&typeof ne.ownKeys=="function"?ye=ne.ownKeys:Object.getOwnPropertySymbols?ye=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:ye=function(e){return Object.getOwnPropertyNames(e)};function Ns(e){console&&console.warn&&console.warn(e)}var tn=Number.isNaN||function(e){return e!==e};function O(){O.init.call(this)}Ss.exports=O;ze.once=Ls;O.EventEmitter=O;O.prototype._events=void 0;O.prototype._eventsCount=0;O.prototype._maxListeners=void 0;var Lt=10;function Pe(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(O,"defaultMaxListeners",{enumerable:!0,get:function(){return Lt},set:function(e){if(typeof e!="number"||e<0||tn(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Lt=e}});O.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};O.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||tn(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function nn(e){return e._maxListeners===void 0?O.defaultMaxListeners:e._maxListeners}O.prototype.getMaxListeners=function(){return nn(this)};O.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var s=e==="error",r=this._events;if(r!==void 0)s=s&&r.error===void 0;else if(!s)return!1;if(s){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var p=r[e];if(p===void 0)return!1;if(typeof p=="function")Pt(p,this,t);else for(var h=p.length,T=cn(p,h),n=0;n<h;++n)Pt(T[n],this,t);return!0};function sn(e,t,n,s){var r,o,l;if(Pe(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),l=o[t]),l===void 0)l=o[t]=n,++e._eventsCount;else if(typeof l=="function"?l=o[t]=s?[n,l]:[l,n]:s?l.unshift(n):l.push(n),r=nn(e),r>0&&l.length>r&&!l.warned){l.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=e,p.type=t,p.count=l.length,Ns(p)}return e}O.prototype.addListener=function(e,t){return sn(this,e,t,!1)};O.prototype.on=O.prototype.addListener;O.prototype.prependListener=function(e,t){return sn(this,e,t,!0)};function Is(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function rn(e,t,n){var s={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=Is.bind(s);return r.listener=n,s.wrapFn=r,r}O.prototype.once=function(e,t){return Pe(t),this.on(e,rn(this,e,t)),this};O.prototype.prependOnceListener=function(e,t){return Pe(t),this.prependListener(e,rn(this,e,t)),this};O.prototype.removeListener=function(e,t){var n,s,r,o,l;if(Pe(t),s=this._events,s===void 0)return this;if(n=s[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){l=n[o].listener,r=o;break}if(r<0)return this;r===0?n.shift():Cs(n,r),n.length===1&&(s[e]=n[0]),s.removeListener!==void 0&&this.emit("removeListener",e,l||t)}return this};O.prototype.off=O.prototype.removeListener;O.prototype.removeAllListeners=function(e){var t,n,s;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var r=Object.keys(n),o;for(s=0;s<r.length;++s)o=r[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(s=t.length-1;s>=0;s--)this.removeListener(e,t[s]);return this};function on(e,t,n){var s=e._events;if(s===void 0)return[];var r=s[t];return r===void 0?[]:typeof r=="function"?n?[r.listener||r]:[r]:n?Ps(r):cn(r,r.length)}O.prototype.listeners=function(e){return on(this,e,!0)};O.prototype.rawListeners=function(e){return on(this,e,!1)};O.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):an.call(e,t)};O.prototype.listenerCount=an;function an(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}O.prototype.eventNames=function(){return this._eventsCount>0?ye(this._events):[]};function cn(e,t){for(var n=new Array(t),s=0;s<t;++s)n[s]=e[s];return n}function Cs(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Ps(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function Ls(e,t){return new Promise(function(n,s){function r(l){e.removeListener(t,o),s(l)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",r),n([].slice.call(arguments))}un(e,t,o,{once:!0}),t!=="error"&&As(e,r,{once:!0})})}function As(e,t,n){typeof e.on=="function"&&un(e,"error",t,n)}function un(e,t,n,s){if(typeof e.on=="function")s.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function r(o){s.once&&e.removeEventListener(t,r),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}class Bs extends u{constructor(){super("message.v1.SocketMessage",[{no:1,name:"event",kind:"scalar",T:13},{no:2,name:"id",kind:"scalar",opt:!0,T:9},{no:3,name:"payload",kind:"scalar",opt:!0,T:12},{no:4,name:"metadata",kind:"scalar",opt:!0,T:12}])}}const At=new Bs;var xe;(function(e){e[e.PUBLISHER=0]="PUBLISHER",e[e.SUBSCRIBER=1]="SUBSCRIBER"})(xe||(xe={}));var He;(function(e){e[e.AUDIO=0]="AUDIO",e[e.VIDEO=1]="VIDEO"})(He||(He={}));class Ds extends u{constructor(){super("media.Codec",[{no:1,name:"channels",kind:"scalar",opt:!0,T:5},{no:2,name:"clock_rate",kind:"scalar",T:5},{no:3,name:"mime_type",kind:"scalar",T:9},{no:4,name:"sdp_fmtp_line",kind:"scalar",opt:!0,T:9}])}}const Fs=new Ds;class Ms extends u{constructor(){super("media.HeaderExtension",[{no:1,name:"direction",kind:"scalar",opt:!0,T:9},{no:2,name:"uri",kind:"scalar",T:9}])}}const Us=new Ms;class qs extends u{constructor(){super("media.Fingerprint",[{no:1,name:"algorithm",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:9}])}}new qs;class Vs extends u{constructor(){super("media.SessionDescription",[{no:1,name:"target",kind:"enum",T:()=>["media.Target",xe]},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"sdp",kind:"scalar",T:9}])}}const j=new Vs;class Gs extends u{constructor(){super("media.ProducerPayload",[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8},{no:4,name:"msid",kind:"scalar",T:9},{no:5,name:"app_data",kind:"scalar",opt:!0,T:9},{no:6,name:"mime_type",kind:"scalar",opt:!0,T:9}])}}const js=new Gs;class Ws extends u{constructor(){super("media.CreateTransportRequest",[{no:1,name:"consuming",kind:"scalar",T:8},{no:2,name:"force_tcp",kind:"scalar",opt:!0,T:8},{no:3,name:"description",kind:"message",T:()=>j},{no:4,name:"private_ice",kind:"scalar",opt:!0,T:8},{no:5,name:"producers",kind:"message",repeat:1,T:()=>js}])}}new Ws;class Ks extends u{constructor(){super("media.AudioActivityRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"energy",kind:"scalar",T:5},{no:3,name:"silent",kind:"scalar",T:8}])}}new Ks;class Js extends u{constructor(){super("media.CreateTransportResponse",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>j},{no:3,name:"transcription_enabled",kind:"scalar",opt:!0,T:8},{no:4,name:"producer_ids",kind:"scalar",repeat:2,T:9}])}}const ln=new Js;class Zs extends u{constructor(){super("media.RenegotiateRequest",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>j}])}}new Zs;class Xs extends u{constructor(){super("media.RenegotiateResponse",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>j}])}}new Xs;class $s extends u{constructor(){super("media.NestedScore",[{no:1,name:"encoding_idx",kind:"scalar",T:5},{no:2,name:"rid",kind:"scalar",T:9},{no:3,name:"score",kind:"scalar",T:5},{no:4,name:"ssrc",kind:"scalar",T:3,L:0}])}}const Ys=new $s;class zs extends u{constructor(){super("media.ProducerTrack",[{no:1,name:"track_id",kind:"scalar",T:9},{no:2,name:"producer_id",kind:"scalar",T:9},{no:3,name:"stream_id",kind:"scalar",T:9}])}}const Hs=new zs;class Qs extends u{constructor(){super("media.ProducerEntry",[{no:1,name:"producing_transport_id",kind:"scalar",T:9},{no:2,name:"producer_id",kind:"scalar",T:9}])}}new Qs;class er extends u{constructor(){super("media.ConsumerEntry",[{no:1,name:"consuming_transport_id",kind:"scalar",T:9},{no:2,name:"consumer_id",kind:"scalar",T:9}])}}new er;class tr extends u{constructor(){super("media.ProducerState",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"kind",kind:"enum",T:()=>["media.ProducerKind",He]},{no:3,name:"pause",kind:"scalar",T:8},{no:4,name:"screen_share",kind:"scalar",T:8},{no:5,name:"app_data",kind:"scalar",opt:!0,T:9},{no:6,name:"producing_transport_id",kind:"scalar",opt:!0,T:9},{no:7,name:"mime_type",kind:"scalar",opt:!0,T:9}])}}const de=new tr;class nr extends u{constructor(){super("media.ConsumerState",[{no:1,name:"consumer_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>de},{no:3,name:"producer_track",kind:"message",T:()=>Hs}])}}const sr=new nr;class rr extends u{constructor(){super("media.ProducerIdToConsumerMap",[{no:1,name:"map",kind:"map",K:9,V:{kind:"message",T:()=>sr}}])}}const dn=new rr;class or extends u{constructor(){super("media.PeerRtpCapabilitites",[{no:1,name:"sender",kind:"message",T:()=>Dt},{no:2,name:"receiver",kind:"message",T:()=>Dt}])}}const pn=new or;class ar extends u{constructor(){super("media.RtpCapability",[{no:1,name:"codecs",kind:"message",repeat:1,T:()=>Fs},{no:2,name:"header_extensions",kind:"message",repeat:1,T:()=>Us}])}}const Bt=new ar;class ir extends u{constructor(){super("media.RtpCapabilitites",[{no:1,name:"audio",kind:"message",T:()=>Bt},{no:2,name:"video",kind:"message",T:()=>Bt}])}}const Dt=new ir;class cr extends u{constructor(){super("media.PreferredCodec",[{no:1,name:"audio",kind:"scalar",opt:!0,T:9},{no:2,name:"video",kind:"scalar",opt:!0,T:9}])}}const ur=new cr;class lr extends u{constructor(){super("media.edge.GeoLocation",[{no:1,name:"latitude",kind:"scalar",T:2},{no:2,name:"longitude",kind:"scalar",T:2},{no:3,name:"region",kind:"scalar",opt:!0,T:9}])}}const dr=new lr;class pr extends u{constructor(){super("media.edge.PeerJoinRequest",[{no:1,name:"display_name",kind:"scalar",opt:!0,T:9},{no:2,name:"prejoined",kind:"scalar",T:8},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:5,name:"preset",kind:"scalar",opt:!0,T:12},{no:6,name:"user_id",kind:"scalar",opt:!0,T:9},{no:7,name:"organization_id",kind:"scalar",opt:!0,T:9},{no:8,name:"location",kind:"message",T:()=>dr},{no:9,name:"capabilities",kind:"message",T:()=>pn}])}}new pr;class mr extends u{constructor(){super("media.edge.PeerJoinCompleteRequest",[])}}new mr;class fr extends u{constructor(){super("media.edge.PeerLeaveRequest",[{no:1,name:"close_room",kind:"scalar",T:8}])}}new fr;class hr extends u{constructor(){super("media.edge.ConsumeMultipleProducerRequest",[{no:1,name:"producer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"paused",kind:"scalar",opt:!0,T:8}])}}new hr;class kr extends u{constructor(){super("media.edge.ConsumePeerRequest",[{no:1,name:"producing_peer_id",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",opt:!0,T:8},{no:3,name:"producer_id",kind:"scalar",opt:!0,T:9},{no:4,name:"preferred_codec",kind:"message",T:()=>ur},{no:5,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}const gr=new kr;class Tr extends u{constructor(){super("media.edge.ConsumePeersRequest",[{no:1,name:"requests",kind:"message",repeat:1,T:()=>gr},{no:2,name:"consuming_transport_id",kind:"scalar",opt:!0,T:9}])}}new Tr;class wr extends u{constructor(){super("media.edge.ProducerCreateRequest",[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8},{no:4,name:"description",kind:"message",T:()=>j},{no:5,name:"msid",kind:"scalar",T:9},{no:6,name:"app_data",kind:"scalar",opt:!0,T:9},{no:7,name:"mime_type",kind:"scalar",opt:!0,T:9},{no:8,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}new wr;class yr extends u{constructor(){super("media.edge.SelectedPeersRequest",[])}}new yr;class br extends u{constructor(){super("media.edge.GlobalPeerPinningRequest",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new br;class _r extends u{constructor(){super("media.edge.ProducerToggleRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"pause",kind:"scalar",T:8}])}}new _r;class vr extends u{constructor(){super("media.edge.ConsumerToggleRequest",[{no:1,name:"consumer_id",kind:"scalar",T:9},{no:2,name:"pause",kind:"scalar",T:8}])}}new vr;class Er extends u{constructor(){super("media.edge.ProducerCloseRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>j},{no:3,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}new Er;class Rr extends u{constructor(){super("media.edge.ConsumerCloseRequest",[{no:1,name:"consumer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"description",kind:"message",T:()=>j},{no:3,name:"consuming_transport_id",kind:"scalar",opt:!0,T:9}])}}new Rr;class xr extends u{constructor(){super("media.edge.KickPeerRequest",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new xr;class Or extends u{constructor(){super("media.edge.KickAllPeersRequest",[{no:1,name:"propagate_kick_across_rooms",kind:"scalar",T:8}])}}new Or;class Sr extends u{constructor(){super("media.edge.PeerDisplayNameEditRequest",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9}])}}new Sr;class Nr extends u{constructor(){super("media.edge.HostMediaControlForPeerRequest",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"audio",kind:"scalar",T:8},{no:3,name:"video",kind:"scalar",T:8},{no:4,name:"scree_share",kind:"scalar",T:8}])}}new Nr;class Ir extends u{constructor(){super("media.edge.HostMediaControlForAllPeerRequest",[{no:1,name:"audio",kind:"scalar",T:8},{no:2,name:"video",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8}])}}new Ir;class Cr extends u{constructor(){super("media.edge.GetRoomStateResponse",[{no:1,name:"display_title",kind:"scalar",T:9},{no:2,name:"locked_mode",kind:"scalar",T:8},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"room_name",kind:"scalar",T:9},{no:5,name:"current_peer_id",kind:"scalar",T:9},{no:6,name:"is_recording",kind:"scalar",opt:!0,T:8},{no:7,name:"recorder_participant_id",kind:"scalar",opt:!0,T:9},{no:8,name:"pinned_peer_ids",kind:"scalar",repeat:2,T:9}])}}const Pr=new Cr;class Lr extends u{constructor(){super("media.edge.ErrorResponse",[{no:1,name:"error_message",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:5}])}}new Lr;class Ar extends u{constructor(){super("media.edge.EmptyResponse",[])}}new Ar;class Br extends u{constructor(){super("media.edge.RoomParticipants",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"producer_states",kind:"message",repeat:1,T:()=>de},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"user_id",kind:"scalar",opt:!0,T:9},{no:5,name:"capabilities",kind:"message",T:()=>pn}])}}const mn=new Br;class Dr extends u{constructor(){super("media.edge.SelectedPeersResponse",[{no:1,name:"audio_peers",kind:"scalar",repeat:2,T:9},{no:2,name:"compulsory_peers",kind:"scalar",repeat:2,T:9}])}}const Fr=new Dr;class Mr extends u{constructor(){super("media.edge.SelectedPeersDiffEntry",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"priority",kind:"scalar",T:5}])}}const Ur=new Mr;class qr extends u{constructor(){super("media.edge.SelectedPeersDiffResponse",[{no:1,name:"entries",kind:"message",repeat:1,T:()=>Ur}])}}new qr;class Vr extends u{constructor(){super("media.edge.PeerJoinResponse",[])}}new Vr;class Gr extends u{constructor(){super("media.edge.PeerJoinCompleteResponse",[{no:1,name:"room_state",kind:"message",T:()=>Pr},{no:2,name:"participants",kind:"message",repeat:1,T:()=>mn},{no:3,name:"selected_peers",kind:"message",T:()=>Fr},{no:4,name:"max_preferred_streams",kind:"scalar",T:5}])}}const jr=new Gr;class Wr extends u{constructor(){super("media.edge.PeerLeaveResponse",[{no:1,name:"closed",kind:"scalar",T:8}])}}new Wr;class Kr extends u{constructor(){super("media.edge.ConsumeMultipleProducerResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"consumer_ids_map",kind:"message",T:()=>dn}])}}new Kr;class Jr extends u{constructor(){super("media.edge.ConsumePeerResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"consumer_ids_map",kind:"message",T:()=>dn},{no:3,name:"description",kind:"message",T:()=>j}])}}new Jr;class Zr extends u{constructor(){super("media.edge.ProducerCreateResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"producer_id",kind:"scalar",T:9},{no:4,name:"description",kind:"message",T:()=>j}])}}const Xr=new Zr;class $r extends u{constructor(){super("media.edge.ProducerScoreResponse",[{no:1,name:"responseid",kind:"scalar",T:9},{no:2,name:"score",kind:"message",T:()=>Ys}])}}new $r;class Yr extends u{constructor(){super("media.edge.ActiveSpeakerResponse",[{no:1,name:"responsepeer_id",kind:"scalar",T:9},{no:2,name:"volume",kind:"scalar",T:5}])}}new Yr;class zr extends u{constructor(){super("media.edge.NoActiveSpeakerResponse",[])}}new zr;class Hr extends u{constructor(){super("media.edge.ProducerToggleResponse",[])}}new Hr;class Qr extends u{constructor(){super("media.edge.ConsumerToggleResponse",[])}}new Qr;class eo extends u{constructor(){super("media.edge.ProducerClosingResponse",[{no:1,name:"description",kind:"message",T:()=>j}])}}new eo;class to extends u{constructor(){super("media.edge.ConsumerClosingResponse",[{no:1,name:"description",kind:"message",T:()=>j}])}}new to;class no extends u{constructor(){super("media.edge.GlobalPeerPinningResponse",[])}}new no;class so extends u{constructor(){super("media.edge.KickPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new so;class ro extends u{constructor(){super("media.edge.KickAllPeersResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new ro;class oo extends u{constructor(){super("media.edge.HostMediaControlForPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new oo;class ao extends u{constructor(){super("media.edge.HostMediaControlForAllPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new ao;class io extends u{constructor(){super("media.edge.PeerDisplayNameEditResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new io;class co extends u{constructor(){super("media.edge.PeerJoinBroadcastResponse",[{no:1,name:"participant",kind:"message",T:()=>mn}])}}new co;class uo extends u{constructor(){super("media.edge.TrackSubscriptionKind",[{no:1,name:"audio",kind:"scalar",T:8},{no:2,name:"video",kind:"scalar",T:8}])}}const Ft=new uo;class lo extends u{constructor(){super("media.edge.TrackSubscription",[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"webcam",kind:"message",T:()=>Ft},{no:3,name:"screenshare",kind:"message",T:()=>Ft}])}}const po=new lo;class mo extends u{constructor(){super("media.edge.PeerProducingTransportCreateBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"transport_details",kind:"message",T:()=>ln},{no:3,name:"track_subscriptions",kind:"message",repeat:1,T:()=>po}])}}new mo;class fo extends u{constructor(){super("media.edge.PeerProducerCreateBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>de}])}}new fo;class ho extends u{constructor(){super("media.edge.PeerProducerToggleBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>de},{no:3,name:"initiator_participant_id",kind:"scalar",opt:!0,T:9}])}}new ho;class ko extends u{constructor(){super("media.edge.PeerProducerCloseBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>de}])}}new ko;class go extends u{constructor(){super("media.edge.PeerLeaveBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new go;class To extends u{constructor(){super("media.edge.GlobalPeerPinningBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new To;class wo extends u{constructor(){super("media.edge.GlobalPeerUnPinningBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new wo;class yo extends u{constructor(){super("media.edge.RecordingStartedBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new yo;class bo extends u{constructor(){super("media.edge.RecordingStoppedBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new bo;class _o extends u{constructor(){super("media.edge.PeerDisplayNameEditBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9}])}}new _o;class vo extends u{constructor(){super("media.edge.PeerPingRequestBroadcastResponse",[{no:1,name:"password",kind:"scalar",T:9}])}}new vo;class Eo extends u{constructor(){super("media.edge.MediaRoomTerminationBroadcastResponse",[{no:1,name:"reason",kind:"scalar",T:9}])}}new Eo;class Ro extends u{constructor(){super("socket.ai.MeetingTranscript",[{no:1,name:"meeting_id",kind:"scalar",T:9},{no:2,name:"transcript",kind:"scalar",T:9},{no:3,name:"is_partial",kind:"scalar",T:8}])}}new Ro;class xo extends u{constructor(){super("socket.api.BaseSocketHubMessage",[{no:1,name:"event",kind:"scalar",T:5},{no:2,name:"id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9},{no:4,name:"room_id",kind:"scalar",T:9},{no:5,name:"user_id",kind:"scalar",T:9},{no:6,name:"payload",kind:"scalar",T:12},{no:7,name:"error",kind:"scalar",opt:!0,T:8},{no:8,name:"sid",kind:"scalar",opt:!0,T:9}])}}new xo;class Oo extends u{constructor(){super("socket.api.ErrorMessage",[{no:1,name:"code",kind:"scalar",opt:!0,T:5},{no:2,name:"message",kind:"scalar",T:9}])}}new Oo;var Oe;(function(e){e[e.BROWSER=0]="BROWSER",e[e.TRACK=1]="TRACK",e[e.COMPOSITE=2]="COMPOSITE"})(Oe||(Oe={}));var Se;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ON_STAGE=1]="ON_STAGE",e[e.APPROVED_STAGE=2]="APPROVED_STAGE",e[e.REQUESTED_STAGE=3]="REQUESTED_STAGE",e[e.OFF_STAGE=4]="OFF_STAGE"})(Se||(Se={}));var Qe;(function(e){e[e.NONE=0]="NONE",e[e.RECORDER=1]="RECORDER",e[e.LIVESTREAMER=2]="LIVESTREAMER"})(Qe||(Qe={}));var et;(function(e){e[e.PEERS=0]="PEERS",e[e.ROOMS=1]="ROOMS"})(et||(et={}));var tt;(function(e){e[e.HIVE=0]="HIVE",e[e.CHAT=1]="CHAT",e[e.PING=2]="PING"})(tt||(tt={}));class So extends u{constructor(){super("socket.room.PeerFlags",[{no:1,name:"preset_name",kind:"scalar",T:9},{no:2,name:"recorder_type",kind:"scalar",T:9},{no:3,name:"hidden_participant",kind:"scalar",T:8}])}}const No=new So;class Io extends u{constructor(){super("socket.room.Peer",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"stage_type",kind:"enum",opt:!0,T:()=>["socket.room.StageType",Se,"STAGE_TYPE_"]},{no:5,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:6,name:"preset_id",kind:"scalar",opt:!0,T:9},{no:7,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:8,name:"waitlisted",kind:"scalar",T:8},{no:9,name:"flags",kind:"message",T:()=>No}])}}const Le=new Io;class Co extends u{constructor(){super("socket.room.PeerInfoResponse",[{no:1,name:"peer",kind:"message",T:()=>Le}])}}const Mt=new Co;class Po extends u{constructor(){super("socket.room.PeerStatusUpdate",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"stage_type",kind:"enum",opt:!0,T:()=>["socket.room.StageType",Se,"STAGE_TYPE_"]}])}}new Po;class Lo extends u{constructor(){super("socket.room.RoomPeersInfoRequest",[{no:1,name:"seach_query",kind:"scalar",T:9},{no:2,name:"limit",kind:"scalar",T:5},{no:3,name:"offset",kind:"scalar",T:5}])}}new Lo;class Ao extends u{constructor(){super("socket.room.RoomPeersInfoResponse",[{no:1,name:"peers",kind:"message",repeat:1,T:()=>Le}])}}const Bo=new Ao;class Do extends u{constructor(){super("socket.room.RoomPeerCountResponse",[{no:1,name:"count",kind:"scalar",T:4,L:2}])}}new Do;class Fo extends u{constructor(){super("socket.room.Room",[{no:1,name:"room_id",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",T:9},{no:4,name:"created_at",kind:"scalar",T:4,L:2},{no:5,name:"active_recordings",kind:"message",repeat:1,T:()=>Uo},{no:6,name:"room_uuid",kind:"scalar",opt:!0,T:9}])}}const fn=new Fo;class Mo extends u{constructor(){super("socket.room.ActiveRecording",[{no:1,name:"recording_id",kind:"scalar",T:9},{no:2,name:"recording_type",kind:"enum",T:()=>["common.RecordingType",Oe]},{no:3,name:"recording_status",kind:"scalar",T:9}])}}const Uo=new Mo;class qo extends u{constructor(){super("socket.room.RoomInfoResponse",[{no:1,name:"room",kind:"message",T:()=>fn}])}}const Vo=new qo;class Go extends u{constructor(){super("socket.room.GetPeerInfoRequest",[{no:1,name:"peer_id",kind:"scalar",T:9}])}}new Go;class jo extends u{constructor(){super("socket.room.UpdatePeerInfoRequest",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9}])}}new jo;class Wo extends u{constructor(){super("socket.room.JoinRoomRequest",[{no:1,name:"peer",kind:"message",T:()=>Le},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"organization_id",kind:"scalar",opt:!0,T:9},{no:5,name:"use_hive",kind:"scalar",opt:!0,T:8},{no:6,name:"preset",kind:"scalar",opt:!0,T:12},{no:7,name:"capabilities",kind:"enum",repeat:1,T:()=>["socket.room.Capabilities",tt,"CAPABILITIES_"]},{no:8,name:"timestamp",kind:"scalar",opt:!0,T:4,L:2}])}}new Wo;class Ko extends u{constructor(){super("socket.room.LeaveRoomRequest",[{no:1,name:"peer",kind:"message",T:()=>Le},{no:2,name:"timestamp",kind:"scalar",opt:!0,T:4,L:2}])}}new Ko;class Jo extends u{constructor(){super("socket.room.UpdateRoomInfoRequest",[{no:1,name:"room",kind:"message",T:()=>fn}])}}new Jo;class Zo extends u{constructor(){super("socket.room.GetConnectedRoomsDumpRequest",[])}}new Zo;class Xo extends u{constructor(){super("socket.room.ServiceError",[{no:1,name:"message",kind:"scalar",opt:!0,T:9},{no:2,name:"code",kind:"scalar",opt:!0,T:9}])}}const ct=new Xo;class $o extends u{constructor(){super("socket.room.ConnectedMeetingPeer",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9},{no:3,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:4,name:"preset_id",kind:"scalar",opt:!0,T:9},{no:5,name:"display_picture_url",kind:"scalar",opt:!0,T:9}])}}const Yo=new $o;class zo extends u{constructor(){super("socket.room.ConnectedMeetingDump",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9},{no:3,name:"participants",kind:"message",repeat:1,T:()=>Yo}])}}const Ut=new zo;class Ho extends u{constructor(){super("socket.room.GetConnectedRoomsDumpResponse",[{no:1,name:"parent_meeting",kind:"message",T:()=>Ut},{no:2,name:"meetings",kind:"message",repeat:1,T:()=>Ut}])}}const Qo=new Ho;class ea extends u{constructor(){super("socket.room.CreateRoomRequestPayload",[{no:1,name:"title",kind:"scalar",opt:!0,T:9}])}}const ta=new ea;class na extends u{constructor(){super("socket.room.CreateConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>ta}])}}new na;class sa extends u{constructor(){super("socket.room.CreateRoomResponsePayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9},{no:3,name:"error",kind:"message",T:()=>ct}])}}const ra=new sa;class oa extends u{constructor(){super("socket.room.CreateConnectedRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>ra}])}}new oa;class aa extends u{constructor(){super("socket.room.UpdateRoomRequestPayload",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9}])}}const ia=new aa;class ca extends u{constructor(){super("socket.room.UpdateConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>ia}])}}new ca;class ua extends u{constructor(){super("socket.room.DisableRoomPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9}])}}const la=new ua;class da extends u{constructor(){super("socket.room.DisableConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>la}])}}new da;class pa extends u{constructor(){super("socket.room.DisableConnectedRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>fa}])}}new pa;class ma extends u{constructor(){super("socket.room.DisableConnectedRoomPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"status",kind:"scalar",opt:!0,T:9},{no:3,name:"title",kind:"scalar",opt:!0,T:9},{no:4,name:"error",kind:"message",T:()=>ct}])}}const fa=new ma;class ha extends u{constructor(){super("socket.room.MovePeerPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"preset_id",kind:"scalar",opt:!0,T:9}])}}const ka=new ha;class ga extends u{constructor(){super("socket.room.MovePeersBetweenRoomsRequest",[{no:1,name:"source_meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"destination_meeting_id",kind:"scalar",opt:!0,T:9},{no:3,name:"participants",kind:"message",repeat:1,T:()=>ka}])}}new ga;class Ta extends u{constructor(){super("socket.room.MovedPeer",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:3,name:"error",kind:"message",T:()=>ct}])}}const wa=new Ta;class ya extends u{constructor(){super("socket.room.MovePeersBetweenRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>wa}])}}new ya;class ba extends u{constructor(){super("socket.room.TransferPeer",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"auth_token",kind:"scalar",opt:!0,T:9}])}}new ba;class _a extends u{constructor(){super("socket.room.GetAllAddedParticipantsResponse",[{no:1,name:"participants",kind:"message",repeat:1,T:()=>Ea}])}}new _a;class va extends u{constructor(){super("socket.room.AddedParticipant",[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"picture",kind:"scalar",opt:!0,T:9},{no:4,name:"custom_participant_id",kind:"scalar",T:9}])}}const Ea=new va;class Ra extends u{constructor(){super("socket.room.RemoveParticipantsRequest",[{no:1,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new Ra;class xa extends u{constructor(){super("socket.room.BroadcastMessage",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"timestamp",kind:"scalar",T:4,L:2},{no:4,name:"ids",kind:"scalar",repeat:2,T:9},{no:5,name:"broadcast_type",kind:"enum",opt:!0,T:()=>["socket.room.BroadcastType",et,"BROADCAST_TYPE_"]}])}}new xa;class Oa extends u{constructor(){super("socket.room.AcceptWaitingRoomRequests",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Oa;class Sa extends u{constructor(){super("socket.room.DenyWaitingRoomRequests",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Sa;class Na extends u{constructor(){super("socket.room.WaitingRoomRequest",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"picture",kind:"scalar",opt:!0,T:9},{no:5,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:6,name:"preset_name",kind:"scalar",opt:!0,T:9}])}}const Ia=new Na;class Ca extends u{constructor(){super("socket.room.GetWaitingRoomRequests",[{no:1,name:"requests",kind:"message",repeat:1,T:()=>Ia}])}}new Ca;class Pa extends u{constructor(){super("socket.room.GetRoomStageStateResponse",[{no:1,name:"on_stage_peers",kind:"scalar",repeat:2,T:9},{no:2,name:"approved_stage_peers",kind:"scalar",repeat:2,T:9},{no:3,name:"requested_stage_peers",kind:"scalar",repeat:2,T:9}])}}new Pa;var nt;(function(e){e[e.NONE=0]="NONE",e[e.SKIP=1]="SKIP",e[e.ON_PRIVILEGED_USER_ENTRY=2]="ON_PRIVILEGED_USER_ENTRY",e[e.SKIP_ON_ACCEPT=3]="SKIP_ON_ACCEPT"})(nt||(nt={}));var Ne;(function(e){e[e.NONE=0]="NONE",e[e.ALLOWED=1]="ALLOWED",e[e.NOT_ALLOWED=2]="NOT_ALLOWED",e[e.CAN_REQUEST=3]="CAN_REQUEST"})(Ne||(Ne={}));class La extends u{constructor(){super("socket.preset.PollsPermissionUpdate",[{no:1,name:"can_create",kind:"scalar",opt:!0,T:8},{no:2,name:"can_vote",kind:"scalar",opt:!0,T:8},{no:3,name:"can_view",kind:"scalar",opt:!0,T:8}])}}const Aa=new La;class Ba extends u{constructor(){super("socket.preset.PluginsPermissionsUpdate",[{no:1,name:"can_close",kind:"scalar",opt:!0,T:8},{no:2,name:"can_start",kind:"scalar",opt:!0,T:8}])}}const Da=new Ba;class Fa extends u{constructor(){super("socket.preset.PublicChatPermission",[{no:1,name:"can_send",kind:"scalar",opt:!0,T:8},{no:2,name:"text",kind:"scalar",opt:!0,T:8},{no:3,name:"files",kind:"scalar",opt:!0,T:8}])}}const Ma=new Fa;class Ua extends u{constructor(){super("socket.preset.PrivateChatPermission",[{no:1,name:"can_send",kind:"scalar",opt:!0,T:8},{no:2,name:"can_receive",kind:"scalar",opt:!0,T:8},{no:3,name:"text",kind:"scalar",opt:!0,T:8},{no:4,name:"files",kind:"scalar",opt:!0,T:8}])}}const qa=new Ua;class Va extends u{constructor(){super("socket.preset.ChatPermissionUpdate",[{no:1,name:"public",kind:"message",T:()=>Ma},{no:2,name:"private",kind:"message",T:()=>qa}])}}const Ga=new Va;class ja extends u{constructor(){super("socket.preset.ConnectedMeetingPermissionUpdate",[{no:1,name:"can_alter_connected_meetings",kind:"scalar",opt:!0,T:8},{no:2,name:"can_switch_to_parent_meeting",kind:"scalar",opt:!0,T:8},{no:3,name:"can_switch_connected_meetings",kind:"scalar",opt:!0,T:8}])}}const Wa=new ja;class Ka extends u{constructor(){super("socket.preset.StreamPermission",[{no:1,name:"can_produce",kind:"enum",opt:!0,T:()=>["socket.preset.StreamPermissionType",Ne,"STREAM_PERMISSION_TYPE_"]},{no:2,name:"can_consume",kind:"enum",opt:!0,T:()=>["socket.preset.StreamPermissionType",Ne,"STREAM_PERMISSION_TYPE_"]}])}}const Je=new Ka;class Ja extends u{constructor(){super("socket.preset.MediaPermissionUpdate",[{no:1,name:"video",kind:"message",T:()=>Je},{no:2,name:"audio",kind:"message",T:()=>Je},{no:3,name:"screenshare",kind:"message",T:()=>Je}])}}const Za=new Ja;class Xa extends u{constructor(){super("socket.preset.PresetUpdates",[{no:1,name:"polls",kind:"message",T:()=>Aa},{no:2,name:"plugins",kind:"message",T:()=>Da},{no:3,name:"chat",kind:"message",T:()=>Ga},{no:4,name:"accept_waiting_requests",kind:"scalar",opt:!0,T:8},{no:5,name:"can_accept_production_requests",kind:"scalar",opt:!0,T:8},{no:6,name:"can_edit_display_name",kind:"scalar",opt:!0,T:8},{no:7,name:"can_record",kind:"scalar",opt:!0,T:8},{no:8,name:"can_livestream",kind:"scalar",opt:!0,T:8},{no:9,name:"can_spotlight",kind:"scalar",opt:!0,T:8},{no:10,name:"disable_participant_audio",kind:"scalar",opt:!0,T:8},{no:11,name:"disable_participant_screensharing",kind:"scalar",opt:!0,T:8},{no:12,name:"disable_participant_video",kind:"scalar",opt:!0,T:8},{no:13,name:"kick_participant",kind:"scalar",opt:!0,T:8},{no:14,name:"pin_participant",kind:"scalar",opt:!0,T:8},{no:15,name:"transcription_enabled",kind:"scalar",opt:!0,T:8},{no:16,name:"waiting_room_type",kind:"enum",opt:!0,T:()=>["socket.preset.WaitingRoomType",nt,"WAITING_ROOM_TYPE_"]},{no:17,name:"is_recorder",kind:"scalar",opt:!0,T:8},{no:18,name:"recorder_type",kind:"enum",opt:!0,T:()=>["socket.room.RecorderType",Qe,"RECORDER_TYPE_"]},{no:19,name:"hidden_participant",kind:"scalar",opt:!0,T:8},{no:20,name:"show_participant_list",kind:"scalar",opt:!0,T:8},{no:21,name:"can_change_participant_permissions",kind:"scalar",opt:!0,T:8},{no:22,name:"connected_meetings",kind:"message",T:()=>Wa},{no:23,name:"media",kind:"message",T:()=>Za}])}}const ut=new Xa;class $a extends u{constructor(){super("socket.preset.ReadPeersPresetRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new $a;class Ya extends u{constructor(){super("socket.preset.PeerPreset",[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"preset",kind:"scalar",T:12}])}}const za=new Ya;class Ha extends u{constructor(){super("socket.preset.ReadPeersPresetResponse",[{no:1,name:"peer_presets",kind:"message",repeat:1,T:()=>za}])}}new Ha;class Qa extends u{constructor(){super("socket.preset.UpdatePeerPreset",[{no:1,name:"user_ids",kind:"scalar",T:9},{no:2,name:"patch",kind:"message",T:()=>ut}])}}const hn=new Qa;class ei extends u{constructor(){super("socket.preset.UpdatePeersPresetRequest",[{no:1,name:"update_peers_presets",kind:"message",repeat:1,T:()=>hn}])}}new ei;class ti extends u{constructor(){super("socket.preset.UpdatePeersPresetResponse",[{no:1,name:"update_peers_presets",kind:"message",repeat:1,T:()=>hn}])}}new ti;class ni extends u{constructor(){super("socket.preset.PeerUserIDMap",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9}])}}const si=new ni;class ri extends u{constructor(){super("socket.preset.BulkUpdatePeerPresetRequest",[{no:1,name:"peers",kind:"message",repeat:1,T:()=>si},{no:2,name:"patch",kind:"message",T:()=>ut}])}}new ri;class oi extends u{constructor(){super("socket.preset.BulkUpdatePeerPresetResponse",[{no:2,name:"patch",kind:"message",T:()=>ut}])}}new oi;class ai extends u{constructor(){super("socket.chat.ChatMessage",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"user_id",kind:"scalar",T:9},{no:4,name:"display_name",kind:"scalar",T:9},{no:5,name:"pinned",kind:"scalar",T:8},{no:6,name:"is_edited",kind:"scalar",T:8},{no:7,name:"payload_type",kind:"scalar",T:5},{no:8,name:"payload",kind:"scalar",T:9},{no:10,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:11,name:"created_at",kind:"scalar",T:4,L:2},{no:12,name:"created_at_ms",kind:"scalar",opt:!0,T:4,L:2},{no:13,name:"channel_id",kind:"scalar",opt:!0,T:9},{no:14,name:"channel_index",kind:"scalar",opt:!0,T:9}])}}const Y=new ai;class ii extends u{constructor(){super("socket.chat.GetPaginatedChatMessageRoomRequest",[{no:1,name:"time_stamp",kind:"scalar",T:4,L:2},{no:2,name:"size",kind:"scalar",T:5},{no:3,name:"from",kind:"scalar",T:5},{no:4,name:"reversed",kind:"scalar",T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new ii;class ci extends u{constructor(){super("socket.chat.GetPaginatedChatMessageRoomResponse",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>Y},{no:2,name:"next",kind:"scalar",T:8}])}}new ci;class ui extends u{constructor(){super("socket.chat.GetChatMessagesResponse",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>Y}])}}new ui;class li extends u{constructor(){super("socket.chat.SendChatMessageToRoomRequest",[{no:1,name:"payload_type",kind:"scalar",T:5},{no:2,name:"payload",kind:"scalar",T:9}])}}new li;class di extends u{constructor(){super("socket.chat.SendChatMessageToRoomResponse",[{no:1,name:"message",kind:"message",T:()=>Y}])}}new di;class pi extends u{constructor(){super("socket.chat.SendChatMessageToPeersRequest",[{no:1,name:"peer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"payload_type",kind:"scalar",T:5},{no:3,name:"payload",kind:"scalar",T:9}])}}new pi;class mi extends u{constructor(){super("socket.chat.SendChatMessageToPeersResponse",[{no:1,name:"message",kind:"message",T:()=>Y}])}}new mi;class fi extends u{constructor(){super("socket.chat.SendChatMessageToChannelRequest",[{no:1,name:"channel_id",kind:"scalar",T:9},{no:2,name:"payload_type",kind:"scalar",T:5},{no:3,name:"payload",kind:"scalar",T:9}])}}new fi;class hi extends u{constructor(){super("socket.chat.SendChatMessageToChannelResponse",[{no:1,name:"message",kind:"message",T:()=>Y}])}}new hi;class ki extends u{constructor(){super("socket.chat.EditChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"payload_type",kind:"scalar",opt:!0,T:5},{no:3,name:"payload",kind:"scalar",opt:!0,T:9},{no:4,name:"pinned",kind:"scalar",opt:!0,T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new ki;class gi extends u{constructor(){super("socket.chat.PinChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"pinned",kind:"scalar",T:8},{no:3,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new gi;class Ti extends u{constructor(){super("socket.chat.PinChatMessageResponse",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"pinned",kind:"scalar",T:8},{no:3,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Ti;class wi extends u{constructor(){super("socket.chat.EditChatMessageResponse",[{no:1,name:"message",kind:"message",T:()=>Y}])}}new wi;class yi extends u{constructor(){super("socket.chat.DeleteChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new yi;class bi extends u{constructor(){super("socket.chat.DeleteChatMessageResponse",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new bi;class _i extends u{constructor(){super("socket.chat.SearchChatMessagesRequest",[{no:1,name:"time_stamp",kind:"scalar",T:4,L:2},{no:2,name:"size",kind:"scalar",T:5},{no:3,name:"from",kind:"scalar",T:5},{no:4,name:"reversed",kind:"scalar",T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9},{no:6,name:"search_term",kind:"scalar",T:9}])}}new _i;class vi extends u{constructor(){super("socket.chat.MarkChannelIndexAsReadRequest",[{no:1,name:"channel_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"channel_index",kind:"scalar",T:9}])}}new vi;class Ei extends u{constructor(){super("socket.chat.MarkChannelIndexAsReadResponse",[{no:1,name:"channel_index",kind:"scalar",T:9}])}}new Ei;class Ri extends u{constructor(){super("socket.chat.CreateChatChannelRequest",[{no:1,name:"display_name",kind:"scalar",T:9},{no:2,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:3,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:4,name:"visibility",kind:"scalar",T:9},{no:5,name:"is_direct_message",kind:"scalar",T:8}])}}new Ri;class xi extends u{constructor(){super("socket.chat.UpdateChatChannelRequest",[{no:1,name:"chat_channel_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9},{no:3,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:4,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:5,name:"visibility",kind:"scalar",opt:!0,T:9},{no:6,name:"is_direct_message",kind:"scalar",opt:!0,T:8}])}}new xi;class Oi extends u{constructor(){super("socket.chat.CreateChatChannelResponse",[{no:1,name:"chat_channel_id",kind:"scalar",T:9}])}}new Oi;class Si extends u{constructor(){super("socket.chat.GetChatChannelRequest",[{no:1,name:"chat_channel_id",kind:"scalar",T:9}])}}new Si;class Ni extends u{constructor(){super("socket.chat.LatestMessageAndUnreadCount",[{no:1,name:"message",kind:"message",T:()=>Y},{no:2,name:"unread_count",kind:"scalar",T:4,L:2}])}}const Ii=new Ni;class Ci extends u{constructor(){super("socket.chat.ChatChannel",[{no:1,name:"chat_channel_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9},{no:3,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:4,name:"visibility",kind:"scalar",T:9},{no:5,name:"is_direct_message",kind:"scalar",T:8},{no:6,name:"latest_message_and_unread_count",kind:"message",T:()=>Ii},{no:7,name:"target_user_ids",kind:"scalar",repeat:2,T:9}])}}const Pi=new Ci;class Li extends u{constructor(){super("socket.chat.GetChatChannelResponse",[{no:1,name:"chat_channels",kind:"message",repeat:1,T:()=>Pi}])}}new Li;class Ai extends u{constructor(){super("socket.chat.ChannelMember",[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"picture",kind:"scalar",opt:!0,T:9},{no:4,name:"custom_participant_id",kind:"scalar",T:9}])}}const Bi=new Ai;class Di extends u{constructor(){super("socket.chat.GetChatChannelMembersResponse",[{no:1,name:"channel_members",kind:"message",repeat:1,T:()=>Bi}])}}new Di;class Fi extends u{constructor(){super("socket.plugin.AddPluginRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"staggered",kind:"scalar",T:8}])}}new Fi;class Mi extends u{constructor(){super("socket.plugin.RemovePluginRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"staggered",kind:"scalar",T:8}])}}new Mi;class Ui extends u{constructor(){super("socket.plugin.EnablePluginForRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9}])}}new Ui;class qi extends u{constructor(){super("socket.plugin.DisablePluginForRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9}])}}new qi;class Vi extends u{constructor(){super("socket.plugin.EnablePluginForPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new Vi;class Gi extends u{constructor(){super("socket.plugin.DisablePluginForPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new Gi;class ji extends u{constructor(){super("socket.plugin.PluginEventToRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"plugin_data",kind:"scalar",T:12}])}}new ji;class Wi extends u{constructor(){super("socket.plugin.PluginEventToPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9},{no:3,name:"plugin_data",kind:"scalar",T:12}])}}new Wi;class Ki extends u{constructor(){super("socket.plugin.StoreKeys",[{no:1,name:"store_key",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",opt:!0,T:12}])}}const lt=new Ki;class Ji extends u{constructor(){super("socket.plugin.PluginStoreInsertKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"insert_keys",kind:"message",repeat:1,T:()=>lt}])}}new Ji;class Zi extends u{constructor(){super("socket.plugin.PluginStoreGetKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"get_keys",kind:"message",repeat:1,T:()=>lt}])}}new Zi;class Xi extends u{constructor(){super("socket.plugin.PluginStoreDeleteKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"delete_keys",kind:"message",repeat:1,T:()=>lt}])}}new Xi;class $i extends u{constructor(){super("socket.plugin.PluginStoreDeleteRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9}])}}new $i;class Yi extends u{constructor(){super("socket.plugin.EnablePluginResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"enabled_by",kind:"scalar",T:9}])}}const zi=new Yi;class Hi extends u{constructor(){super("socket.plugin.EnablePluginsResponse",[{no:1,name:"plugins",kind:"message",repeat:1,T:()=>zi}])}}new Hi;class Qi extends u{constructor(){super("socket.plugin.DisablePluginResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"disabled_by",kind:"scalar",T:9}])}}new Qi;class ec extends u{constructor(){super("socket.plugin.PluginStoreItem",[{no:1,name:"timestamp",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"store_key",kind:"scalar",T:9},{no:4,name:"payload",kind:"scalar",T:12}])}}const tc=new ec;class nc extends u{constructor(){super("socket.plugin.PluginStoreResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"store_items",kind:"message",repeat:1,T:()=>tc}])}}new nc;class sc extends u{constructor(){super("socket.plugin.PluginEventResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"plugin_data",kind:"scalar",T:12}])}}new sc;class rc extends u{constructor(){super("socket.livestreaming.LiveStreamingEvent",[{no:1,name:"livestream_id",kind:"scalar",T:9},{no:2,name:"err_message",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"meeting_id",kind:"scalar",T:9},{no:5,name:"playback_url",kind:"scalar",T:9},{no:6,name:"org_id",kind:"scalar",T:9},{no:7,name:"room_name",kind:"scalar",T:9},{no:8,name:"room_uuid",kind:"scalar",T:9},{no:9,name:"status",kind:"scalar",T:9},{no:10,name:"manual_ingest",kind:"scalar",opt:!0,T:8}])}}new rc;class oc extends u{constructor(){super("socket.livestreaming.GetStagePeersResponse",[{no:1,name:"stage_peers",kind:"scalar",repeat:2,T:9}])}}new oc;class ac extends u{constructor(){super("socket.livestreaming.StageRequest",[{no:1,name:"display_name",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9}])}}const ic=new ac;class cc extends u{constructor(){super("socket.livestreaming.GetStageRequestsResponse",[{no:1,name:"stage_requests",kind:"message",repeat:1,T:()=>ic}])}}new cc;class uc extends u{constructor(){super("socket.livestreaming.GrantStageAccessRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new uc;class lc extends u{constructor(){super("socket.livestreaming.DenyStageAccessRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new lc;class dc extends u{constructor(){super("socket.livestreaming.LeaveStageRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new dc;class pc extends u{constructor(){super("socket.polls.Poll",[{no:1,name:"poll_id",kind:"scalar",T:9},{no:2,name:"created_by",kind:"scalar",T:9},{no:3,name:"created_by_user_id",kind:"scalar",T:9},{no:4,name:"question",kind:"scalar",T:9},{no:5,name:"options",kind:"message",repeat:1,T:()=>fc},{no:6,name:"hide_votes",kind:"scalar",T:8},{no:7,name:"anonymous",kind:"scalar",T:8},{no:8,name:"votes",kind:"scalar",repeat:2,T:9}])}}const kn=new pc;class mc extends u{constructor(){super("socket.polls.PollOption",[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"count",kind:"scalar",opt:!0,T:4,L:2},{no:3,name:"votes",kind:"message",repeat:1,T:()=>kc}])}}const fc=new mc;class hc extends u{constructor(){super("socket.polls.PollVote",[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}])}}const kc=new hc;class gc extends u{constructor(){super("socket.polls.NewPollRequest",[{no:1,name:"question",kind:"scalar",T:9},{no:2,name:"options",kind:"scalar",repeat:2,T:9},{no:3,name:"anonymous",kind:"scalar",T:8},{no:4,name:"hide_votes",kind:"scalar",T:8},{no:5,name:"created_by",kind:"scalar",opt:!0,T:9},{no:6,name:"created_by_user_id",kind:"scalar",opt:!0,T:9}])}}new gc;class Tc extends u{constructor(){super("socket.polls.VotePollRequest",[{no:1,name:"poll_id",kind:"scalar",T:9},{no:2,name:"index",kind:"scalar",T:4,L:2}])}}new Tc;class wc extends u{constructor(){super("socket.polls.UpdatePollResponse",[{no:1,name:"poll",kind:"message",T:()=>kn}])}}new wc;class yc extends u{constructor(){super("socket.polls.GetPollsResponse",[{no:1,name:"polls",kind:"message",repeat:1,T:()=>kn}])}}new yc;class bc extends u{constructor(){super("socket.recording.RecordingEvent",[{no:1,name:"recording_id",kind:"scalar",T:9},{no:2,name:"err_message",kind:"scalar",T:9},{no:3,name:"recording_type",kind:"enum",T:()=>["common.RecordingType",Oe]}])}}new bc;class _c extends u{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const t=this.create(),n=Date.now();return t.seconds=N.from(Math.floor(n/1e3)).toBigInt(),t.nanos=n%1e3*1e6,t}toDate(t){return new Date(N.from(t.seconds).toNumber()*1e3+Math.ceil(t.nanos/1e6))}fromDate(t){const n=this.create(),s=t.getTime();return n.seconds=N.from(Math.floor(s/1e3)).toBigInt(),n.nanos=s%1e3*1e6,n}internalJsonWrite(t,n){let s=N.from(t.seconds).toNumber()*1e3;if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(t.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let r="Z";if(t.nanos>0){let o=(t.nanos+1e9).toString().substring(1);o.substring(3)==="000000"?r="."+o.substring(0,3)+"Z":o.substring(6)==="000"?r="."+o.substring(0,6)+"Z":r="."+o+"Z"}return new Date(s).toISOString().replace(".000Z",r)}internalJsonRead(t,n,s){if(typeof t!="string")throw new Error("Unable to parse Timestamp from JSON "+at(t)+".");let r=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let o=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(o))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(o<Date.parse("0001-01-01T00:00:00Z")||o>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return s||(s=this.create()),s.seconds=N.from(o/1e3).toBigInt(),s.nanos=0,r[7]&&(s.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),s}}new _c;class vc extends u{constructor(){super("common.BaseHubMessage",[{no:1,name:"event",kind:"scalar",T:5},{no:2,name:"id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9},{no:4,name:"room_id",kind:"scalar",T:9},{no:5,name:"user_id",kind:"scalar",T:9},{no:6,name:"payload",kind:"scalar",T:12},{no:7,name:"error",kind:"scalar",opt:!0,T:8},{no:8,name:"sid",kind:"scalar",opt:!0,T:9},{no:9,name:"room_object_id",kind:"scalar",opt:!0,T:9},{no:10,name:"preset",kind:"scalar",opt:!0,T:9}])}}const st=new vc;class Ec extends u{constructor(){super("common.BulkedHubMessage",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>st}])}}new Ec;class Rc extends u{constructor(){super("common.CFWorkersResponse",[{no:1,name:"response",kind:"message",T:()=>st},{no:2,name:"broadcast_responses",kind:"message",repeat:1,T:()=>st}])}}new Rc;const xc=0,Oc=1,Sc=2,Nc=3,Ic=4,Cc=5,Pc={getPeerInfo:0,updatePeerInfo:1,getRoomPeersInfo:2,joinRoom:3,leaveRoom:4,getRoomInfo:5,updateRoomInfo:6,closeRoom:7,startedLivestream:8,stoppedLivestream:9,erroredLivestream:10,getStagePeers:11,getStageRequests:12,requestStageAccess:13,cancelStageRequest:14,grantStageAccess:15,denyStageAccess:16,roomPeerCount:17,joinStage:18,leaveStage:19,getConnectedRoomsDump:20,createConnectedRooms:21,deleteConnectedRooms:22,movePeers:23,transferPeer:24,movedPeer:25,connectedRoomsUpdated:26,connectedRoomsDeleted:27,getAllAddedParticipants:28,broadcastMessage:29,kick:30,kickAll:31,transcript:32,getWaitingRoomRequests:33,acceptWaitingRoomRequests:34,waitingRoomRequestAccepted:35,denyWaitingRoomRequests:36,waitingRoomRequestDenied:37,peerStageStatusUpdate:38,broadcastToEntity:39,recordingStarted:40,recordingStopped:41,recordingPaused:42,getRoomStageState:43,livestreamingInvoked:44},Lc={getMessages:0,sendMessageToRoom:1,sendMessageToPeers:2,editMessage:3,deleteMessage:4,getPaginatedMessages:5,sendMessageToChannel:6,searchChannelMessages:7,getAllChatChannels:8,markChannelIndexAsRead:9,pinMessage:10},Ac={getPlugins:0,addPlugin:1,enablePluginForRoom:2,disablePluginForPeers:3,enablePluginForPeers:4,disablePluginForRoom:5,removePlugin:6,customPluginEventToRoom:7,customPluginEventToPeers:8,storeInsertKeys:9,storeGetKeys:10,storeDeleteKeys:11,storeDelete:12},Bc={createPoll:0,getPolls:1,votePoll:2,updatePoll:3},gn={unknown:0,createWebRTCTransport:1,produce:2,consume:3,toggleProducer:4,toggleConsumer:5,closeProducer:6,closeConsumer:7,joinRoom:16,leaveRoom:17,selectedPeer:18,globalPinPeer:19,selfJoinComplete:20,peerJoinedBroadcast:25,peerLeaveBroadcast:26,peerProducerCreateBroadcast:27,peerProducerToggleBroadcast:28,peerProducerCloseBroadcast:29,globalPeerPinBroadcast:30,recordingStartedBroadcast:31,recordingStoppedBroadcast:32,peerDisplayNameEditBroadcast:33,mediaRoomTerminationBroadcastResponse:36,selectedPeerDiff:40,renegotiateSessionDescription:50,errorResponse:60,kickPeer:90,kickAll:91,changeDisplayName:92,hostControlPeer:93,hostControlAllPeers:94,audioActivity:100},Dc={createChatChannel:0,getChatChannel:1,deprecatedGetAllChatChannels:2,getChannelMembers:3,updateChatChannel:4},Fc={getUserPresets:0,updateUserPreset:1};function se(e,t){return Object.keys(t).reduce((n,s)=>(n[s]=(e<<16)+t[s],n),{})}function Tn(e,t){return Object.keys(e).reduce((n,s)=>(n[s]=t|e[s],n),{})}const ge=se(xc,Pc);se(Oc,Lc);se(Sc,Ac);se(Nc,Bc);se(Ic,Dc);const Ze=Tn(gn,16777216);Tn(gn,50331648);se(Cc,Fc);const wn="ws://localhost:8080/ws";class Mc extends le.WebSocket{constructor(t,n){super(wn,n)}}var ce,rt,ot;class Uc{constructor(){Ke(this,ce,void 0),Ke(this,rt,[]),Ke(this,ot,15e3),R(this,"roomId","roomId"),R(this,"roomUuid","roomUuid"),R(this,"cleanBuffer",t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength))}init(t){window.WebSocket=Mc,hs(this,ce,t),new le.Server(wn,{mock:!1}).on("connection",n=>{ke(this,rt).push(n),this.addConnectionListeners(n)})}addConnectionListeners(t){t.on("message",n=>{if(n==="3")return;const s=At.fromBinary(n);let r;switch(s.event){case ge.joinRoom:{r=Mt.toBinary(Mt.fromJson({peer:{peerId:"self-peerId",userId:"self-userId",displayName:"name",waitlisted:!1}}));break}case ge.getRoomPeersInfo:{r=Bo.toBinary({peers:ke(this,ce).map(h=>fs(St({},h),{userId:h.peerId,waitlisted:!1,stageType:1}))});break}case ge.getRoomInfo:{r=Vo.toBinary({room:{roomId:this.roomId,title:"title",createdAt:Date.now(),activeRecordings:[],roomUuid:this.roomUuid}});break}case Ze.createWebRTCTransport:{r=ln.toBinary({transportId:"transportId",description:{type:"answer",sdp:"sdp",target:xe.PUBLISHER},producerIds:[]});break}case Ze.selfJoinComplete:{const h=ke(this,ce).map(T=>St({producerStates:[]},T));r=jr.toBinary({maxPreferredStreams:6,participants:h,selectedPeers:{audioPeers:[],compulsoryPeers:[]},roomState:{displayTitle:"title",lockedMode:!1,roomUuid:this.roomUuid,roomName:this.roomUuid,currentPeerId:"self-peerid",pinnedPeerIds:[]}});break}case ge.getConnectedRoomsDump:{r=Qo.toBinary({parentMeeting:{participants:[]},meetings:[]});break}case Ze.produce:{r=Xr.toBinary({status:!0,producerId:"producer-id"});break}}const o={event:s.event,id:s.id,payload:r},l=At.toBinary(o),p=this.cleanBuffer(l);t.send(p)}),setInterval(()=>{t.send("2")},ke(this,ot))}}ce=new WeakMap,rt=new WeakMap,ot=new WeakMap;function qc(e){new Uc().init(e),window.RTCPeerConnection=Rs,window.fetch=()=>ks(this,null,function*(){const t=new window.Response(JSON.stringify({}),{status:200,headers:{"Content-type":"application/json"}});return Promise.resolve(t)})}exports.setupStubs=qc;
66
+ `,Ct={track:null,transport:null,rtcpTransport:null,dtmf:{insertDTMF:()=>{},ontonechange:null,canInsertDTMF:!1,toneBuffer:"",addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!0},transform:null,mid:null,getParameters:()=>({}),setParameters:()=>Promise.resolve({}),replaceTrack:()=>Promise.resolve({}),getStats:()=>Promise.resolve(new Map),setStreams:()=>{},setTransform:()=>Promise.resolve()};class Rs extends xe{constructor(){super(),R(this,"localDescription",null),R(this,"remoteDescription",null),R(this,"currentLocalDescription",null),R(this,"currentRemoteDescription",null),R(this,"pendingLocalDescription",null),R(this,"pendingRemoteDescription",null),R(this,"signalingState","stable"),R(this,"iceConnectionState","new"),R(this,"iceGatheringState","new"),R(this,"connectionState","new"),R(this,"canTrickleIceCandidates",null),R(this,"sctp",null),R(this,"senders",[]),R(this,"receivers",[]),R(this,"transceivers",[]),R(this,"onicecandidate",null),R(this,"onicecandidateerror",null),R(this,"onconnectionstatechange",null),R(this,"oniceconnectionstatechange",null),R(this,"onicegatheringstatechange",null),R(this,"onsignalingstatechange",null),R(this,"onnegotiationneeded",null),R(this,"ontrack",null),R(this,"ondatachannel",null),R(this,"addEventListener"),R(this,"removeEventListener"),this.addEventListener=this.addListener,this.removeEventListener=this.removeListener}createOffer(){return Promise.resolve({sdp:Es,type:"offer"})}createAnswer(){return Promise.resolve({})}setLocalDescription(){return this.iceConnectionState="connected",this.iceGatheringState="complete",this.connectionState="connected",this.signalingState="stable",this.emit("iceconnectionstatechange"),Promise.resolve()}setRemoteDescription(){return Promise.resolve()}addIceCandidate(){return Promise.resolve()}getStats(){return Promise.resolve(new Map)}getConfiguration(){return{}}setConfiguration(){}close(){}createDataChannel(){return{close:()=>{},send:()=>{}}}addTrack(){return Ct}removeTrack(){}addTransceiver(){return{stop:()=>{},setDirection:()=>{},setCodecPreferences:()=>{},sender:Ct}}getTransceivers(){return[]}getSenders(){return[]}getReceivers(){return[]}restartIce(){}static generateCertificate(){return Promise.resolve({expires:Date.now(),getFingerprints:()=>[]})}}function xs(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var le={},Os={get exports(){return le},set exports(e){le=e}};(function(e,t){(function(n,s){s(t)})(ie,function(n){var s=typeof window!="undefined"?window:typeof ie!="undefined"?ie:typeof self!="undefined"?self:{},r=function(i,c){if(c=c.split(":")[0],i=+i,!i)return!1;switch(c){case"http":case"ws":return i!==80;case"https":case"wss":return i!==443;case"ftp":return i!==21;case"gopher":return i!==70;case"file":return!1}return i!==0},o=Object.prototype.hasOwnProperty,l;function p(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch(c){return null}}function h(i){try{return encodeURIComponent(i)}catch(c){return null}}function T(i){for(var c=/([^=?#&]+)=?([^&]*)/g,d={},a;a=c.exec(i);){var m=p(a[1]),f=p(a[2]);m===null||f===null||m in d||(d[m]=f)}return d}function _(i,c){c=c||"";var d=[],a,m;typeof c!="string"&&(c="?");for(m in i)if(o.call(i,m)){if(a=i[m],!a&&(a===null||a===l||isNaN(a))&&(a=""),m=h(m),a=h(a),m===null||a===null)continue;d.push(m+"="+a)}return d.length?c+d.join("&"):""}var I=_,v=T,B={stringify:I,parse:v},M=/[\n\r\t]/g,Ae=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,z=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,re=/^[a-zA-Z]:/,yn=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;function Be(i){return(i||"").toString().replace(yn,"")}var De=[["#","hash"],["?","query"],function(i,c){return W(c.protocol)?i.replace(/\\/g,"/"):i},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],dt={hash:1,query:1};function pt(i){var c;typeof window!="undefined"?c=window:typeof s!="undefined"?c=s:typeof self!="undefined"?c=self:c={};var d=c.location||{};i=i||d;var a={},m=typeof i,f;if(i.protocol==="blob:")a=new K(unescape(i.pathname),{});else if(m==="string"){a=new K(i,{});for(f in dt)delete a[f]}else if(m==="object"){for(f in i)f in dt||(a[f]=i[f]);a.slashes===void 0&&(a.slashes=Ae.test(i.href))}return a}function W(i){return i==="file:"||i==="ftp:"||i==="http:"||i==="https:"||i==="ws:"||i==="wss:"}function mt(i,c){i=Be(i),i=i.replace(M,""),c=c||{};var d=z.exec(i),a=d[1]?d[1].toLowerCase():"",m=!!d[2],f=!!d[3],g=0,w;return m?f?(w=d[2]+d[3]+d[4],g=d[2].length+d[3].length):(w=d[2]+d[4],g=d[2].length):f?(w=d[3]+d[4],g=d[3].length):w=d[4],a==="file:"?g>=2&&(w=w.slice(2)):W(a)?w=d[4]:a?m&&(w=w.slice(2)):g>=2&&W(c.protocol)&&(w=d[4]),{protocol:a,slashes:m||W(a),slashesCount:g,rest:w}}function bn(i,c){if(i==="")return c;for(var d=(c||"/").split("/").slice(0,-1).concat(i.split("/")),a=d.length,m=d[a-1],f=!1,g=0;a--;)d[a]==="."?d.splice(a,1):d[a]===".."?(d.splice(a,1),g++):g&&(a===0&&(f=!0),d.splice(a,1),g--);return f&&d.unshift(""),(m==="."||m==="..")&&d.push(""),d.join("/")}function K(i,c,d){if(i=Be(i),i=i.replace(M,""),!(this instanceof K))return new K(i,c,d);var a,m,f,g,w,b,A=De.slice(),Tt=typeof c,y=this,Ge=0;for(Tt!=="object"&&Tt!=="string"&&(d=c,c=null),d&&typeof d!="function"&&(d=B.parse),c=pt(c),m=mt(i||"",c),a=!m.protocol&&!m.slashes,y.slashes=m.slashes||a&&c.slashes,y.protocol=m.protocol||c.protocol||"",i=m.rest,(m.protocol==="file:"&&(m.slashesCount!==2||re.test(i))||!m.slashes&&(m.protocol||m.slashesCount<2||!W(y.protocol)))&&(A[3]=[/(.*)/,"pathname"]);Ge<A.length;Ge++){if(g=A[Ge],typeof g=="function"){i=g(i,y);continue}f=g[0],b=g[1],f!==f?y[b]=i:typeof f=="string"?(w=f==="@"?i.lastIndexOf(f):i.indexOf(f),~w&&(typeof g[2]=="number"?(y[b]=i.slice(0,w),i=i.slice(w+g[2])):(y[b]=i.slice(w),i=i.slice(0,w)))):(w=f.exec(i))&&(y[b]=w[1],i=i.slice(0,w.index)),y[b]=y[b]||a&&g[3]&&c[b]||"",g[4]&&(y[b]=y[b].toLowerCase())}d&&(y.query=d(y.query)),a&&c.slashes&&y.pathname.charAt(0)!=="/"&&(y.pathname!==""||c.pathname!=="")&&(y.pathname=bn(y.pathname,c.pathname)),y.pathname.charAt(0)!=="/"&&W(y.protocol)&&(y.pathname="/"+y.pathname),r(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(w=y.auth.indexOf(":"),~w?(y.username=y.auth.slice(0,w),y.username=encodeURIComponent(decodeURIComponent(y.username)),y.password=y.auth.slice(w+1),y.password=encodeURIComponent(decodeURIComponent(y.password))):y.username=encodeURIComponent(decodeURIComponent(y.auth)),y.auth=y.password?y.username+":"+y.password:y.username),y.origin=y.protocol!=="file:"&&W(y.protocol)&&y.host?y.protocol+"//"+y.host:"null",y.href=y.toString()}function _n(i,c,d){var a=this;switch(i){case"query":typeof c=="string"&&c.length&&(c=(d||B.parse)(c)),a[i]=c;break;case"port":a[i]=c,r(c,a.protocol)?c&&(a.host=a.hostname+":"+c):(a.host=a.hostname,a[i]="");break;case"hostname":a[i]=c,a.port&&(c+=":"+a.port),a.host=c;break;case"host":a[i]=c,/:\d+$/.test(c)?(c=c.split(":"),a.port=c.pop(),a.hostname=c.join(":")):(a.hostname=c,a.port="");break;case"protocol":a.protocol=c.toLowerCase(),a.slashes=!d;break;case"pathname":case"hash":if(c){var m=i==="pathname"?"/":"#";a[i]=c.charAt(0)!==m?m+c:c}else a[i]=c;break;case"username":case"password":a[i]=encodeURIComponent(c);break;case"auth":var f=c.indexOf(":");~f?(a.username=c.slice(0,f),a.username=encodeURIComponent(decodeURIComponent(a.username)),a.password=c.slice(f+1),a.password=encodeURIComponent(decodeURIComponent(a.password))):a.username=encodeURIComponent(decodeURIComponent(c))}for(var g=0;g<De.length;g++){var w=De[g];w[4]&&(a[w[1]]=a[w[1]].toLowerCase())}return a.auth=a.password?a.username+":"+a.password:a.username,a.origin=a.protocol!=="file:"&&W(a.protocol)&&a.host?a.protocol+"//"+a.host:"null",a.href=a.toString(),a}function vn(i){(!i||typeof i!="function")&&(i=B.stringify);var c,d=this,a=d.host,m=d.protocol;m&&m.charAt(m.length-1)!==":"&&(m+=":");var f=m+(d.protocol&&d.slashes||W(d.protocol)?"//":"");return d.username?(f+=d.username,d.password&&(f+=":"+d.password),f+="@"):d.password?(f+=":"+d.password,f+="@"):d.protocol!=="file:"&&W(d.protocol)&&!a&&d.pathname!=="/"&&(f+="@"),a[a.length-1]===":"&&(a+=":"),f+=a+d.pathname,c=typeof d.query=="object"?i(d.query):d.query,c&&(f+=c.charAt(0)!=="?"?"?"+c:c),d.hash&&(f+=d.hash),f}K.prototype={set:_n,toString:vn},K.extractProtocol=mt,K.location=pt,K.trimLeft=Be,K.qs=B;var Fe=K;function oe(i,c){setTimeout(function(d){return i.call(d)},4,c)}function me(i,c){typeof process!="undefined"&&console[i].call(null,c)}function Me(i,c){i===void 0&&(i=[]);var d=[];return i.forEach(function(a){c(a)||d.push(a)}),d}function En(i,c){i===void 0&&(i=[]);var d=[];return i.forEach(function(a){c(a)&&d.push(a)}),d}var H=function(){this.listeners={}};H.prototype.addEventListener=function(i,c){typeof c=="function"&&(Array.isArray(this.listeners[i])||(this.listeners[i]=[]),En(this.listeners[i],function(d){return d===c}).length===0&&this.listeners[i].push(c))},H.prototype.removeEventListener=function(i,c){var d=this.listeners[i];this.listeners[i]=Me(d,function(a){return a===c})},H.prototype.dispatchEvent=function(i){for(var c=this,d=[],a=arguments.length-1;a-- >0;)d[a]=arguments[a+1];var m=i.type,f=this.listeners[m];return Array.isArray(f)?(f.forEach(function(g){d.length>0?g.apply(c,d):g.call(c,i)}),!0):!1};function $(i){var c=i.indexOf("?");return c>=0?i.slice(0,c):i}var Z=function(){this.urlMap={}};Z.prototype.attachWebSocket=function(i,c){var d=$(c),a=this.urlMap[d];if(a&&a.server&&a.websockets.indexOf(i)===-1)return a.websockets.push(i),a.server},Z.prototype.addMembershipToRoom=function(i,c){var d=this.urlMap[$(i.url)];d&&d.server&&d.websockets.indexOf(i)!==-1&&(d.roomMemberships[c]||(d.roomMemberships[c]=[]),d.roomMemberships[c].push(i))},Z.prototype.attachServer=function(i,c){var d=$(c),a=this.urlMap[d];if(!a)return this.urlMap[d]={server:i,websockets:[],roomMemberships:{}},i},Z.prototype.serverLookup=function(i){var c=$(i),d=this.urlMap[c];if(d)return d.server},Z.prototype.websocketsLookup=function(i,c,d){var a=$(i),m,f=this.urlMap[a];if(m=f?f.websockets:[],c){var g=f.roomMemberships[c];m=g||[]}return d?m.filter(function(w){return w!==d}):m},Z.prototype.removeServer=function(i){delete this.urlMap[$(i)]},Z.prototype.removeWebSocket=function(i,c){var d=$(c),a=this.urlMap[d];a&&(a.websockets=Me(a.websockets,function(m){return m===i}))},Z.prototype.removeMembershipFromRoom=function(i,c){var d=this.urlMap[$(i.url)],a=d.roomMemberships[c];d&&a!==null&&(d.roomMemberships[c]=Me(a,function(m){return m===i}))};var C=new Z,U={CLOSE_NORMAL:1e3,CLOSE_GOING_AWAY:1001,CLOSE_PROTOCOL_ERROR:1002,CLOSE_UNSUPPORTED:1003,CLOSE_NO_STATUS:1005,CLOSE_ABNORMAL:1006,UNSUPPORTED_DATA:1007,POLICY_VIOLATION:1008,CLOSE_TOO_LARGE:1009,MISSING_EXTENSION:1010,INTERNAL_ERROR:1011,SERVICE_RESTART:1012,TRY_AGAIN_LATER:1013,TLS_HANDSHAKE:1015},F={CONSTRUCTOR_ERROR:"Failed to construct 'WebSocket':",CLOSE_ERROR:"Failed to execute 'close' on 'WebSocket':",EVENT:{CONSTRUCT:"Failed to construct 'Event':",MESSAGE:"Failed to construct 'MessageEvent':",CLOSE:"Failed to construct 'CloseEvent':"}},Q=function(){};Q.prototype.stopPropagation=function(){},Q.prototype.stopImmediatePropagation=function(){},Q.prototype.initEvent=function(i,c,d){i===void 0&&(i="undefined"),c===void 0&&(c=!1),d===void 0&&(d=!1),this.type=""+i,this.bubbles=Boolean(c),this.cancelable=Boolean(d)};var Rn=function(i){function c(d,a){if(a===void 0&&(a={}),i.call(this),!d)throw new TypeError(F.EVENT_ERROR+" 1 argument required, but only 0 present.");if(typeof a!="object")throw new TypeError(F.EVENT_ERROR+" parameter 2 ('eventInitDict') is not an object.");var m=a.bubbles,f=a.cancelable;this.type=""+d,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=f?Boolean(f):!1,this.cancelBubble=!1,this.bubbles=m?Boolean(m):!1}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c}(Q),xn=function(i){function c(d,a){if(a===void 0&&(a={}),i.call(this),!d)throw new TypeError(F.EVENT.MESSAGE+" 1 argument required, but only 0 present.");if(typeof a!="object")throw new TypeError(F.EVENT.MESSAGE+" parameter 2 ('eventInitDict') is not an object");var m=a.bubbles,f=a.cancelable,g=a.data,w=a.origin,b=a.lastEventId,A=a.ports;this.type=""+d,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=f?Boolean(f):!1,this.canncelBubble=!1,this.bubbles=m?Boolean(m):!1,this.origin=""+w,this.ports=typeof A=="undefined"?null:A,this.data=typeof g=="undefined"?null:g,this.lastEventId=""+(b||"")}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c}(Q),On=function(i){function c(d,a){if(a===void 0&&(a={}),i.call(this),!d)throw new TypeError(F.EVENT.CLOSE+" 1 argument required, but only 0 present.");if(typeof a!="object")throw new TypeError(F.EVENT.CLOSE+" parameter 2 ('eventInitDict') is not an object");var m=a.bubbles,f=a.cancelable,g=a.code,w=a.reason,b=a.wasClean;this.type=""+d,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=f?Boolean(f):!1,this.cancelBubble=!1,this.bubbles=m?Boolean(m):!1,this.code=typeof g=="number"?parseInt(g,10):0,this.reason=""+(w||""),this.wasClean=b?Boolean(b):!1}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c}(Q);function q(i){var c=i.type,d=i.target,a=new Rn(c);return d&&(a.target=d,a.srcElement=d,a.currentTarget=d),a}function ae(i){var c=i.type,d=i.origin,a=i.data,m=i.target,f=new xn(c,{data:a,origin:d});return m&&(f.target=m,f.srcElement=m,f.currentTarget=m),f}function V(i){var c=i.code,d=i.reason,a=i.type,m=i.target,f=i.wasClean;f||(f=c===U.CLOSE_NORMAL||c===U.CLOSE_NO_STATUS);var g=new On(a,{code:c,reason:d,wasClean:f});return m&&(g.target=m,g.srcElement=m,g.currentTarget=m),g}function ft(i,c,d){i.readyState=L.CLOSING;var a=C.serverLookup(i.url),m=V({type:"close",target:i.target,code:c,reason:d});oe(function(){C.removeWebSocket(i,i.url),i.readyState=L.CLOSED,i.dispatchEvent(m),a&&a.dispatchEvent(m,a)},i)}function Sn(i,c,d){i.readyState=L.CLOSING;var a=C.serverLookup(i.url),m=V({type:"close",target:i.target,code:c,reason:d,wasClean:!1}),f=q({type:"error",target:i.target});oe(function(){C.removeWebSocket(i,i.url),i.readyState=L.CLOSED,i.dispatchEvent(f),i.dispatchEvent(m),a&&a.dispatchEvent(m,a)},i)}function fe(i){return Object.prototype.toString.call(i)!=="[object Blob]"&&!(i instanceof ArrayBuffer)&&(i=String(i)),i}var Ue=new WeakMap;function ht(i){if(Ue.has(i))return Ue.get(i);var c=new Proxy(i,{get:function(d,a){if(a==="close")return function(f){f===void 0&&(f={});var g=f.code||U.CLOSE_NORMAL,w=f.reason||"";ft(c,g,w)};if(a==="send")return function(f){f=fe(f),i.dispatchEvent(ae({type:"message",data:f,origin:this.url,target:i}))};var m=function(f){return f==="message"?"server::"+f:f};return a==="on"?function(f,g){i.addEventListener(m(f),g)}:a==="off"?function(f,g){i.removeEventListener(m(f),g)}:a==="target"?i:d[a]}});return Ue.set(i,c),c}function Nn(i){var c=encodeURIComponent(i).match(/%[89ABab]/g);return i.length+(c?c.length:0)}function In(i){var c=new Fe(i),d=c.pathname,a=c.protocol,m=c.hash;if(!i)throw new TypeError(F.CONSTRUCTOR_ERROR+" 1 argument required, but only 0 present.");if(d||(c.pathname="/"),a==="")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The URL '"+c.toString()+"' is invalid.");if(a!=="ws:"&&a!=="wss:")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The URL's scheme must be either 'ws' or 'wss'. '"+a+"' is not allowed.");if(m!=="")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The URL contains a fragment identifier ('"+m+"'). Fragment identifiers are not allowed in WebSocket URLs.");return c.toString()}function Cn(i){if(i===void 0&&(i=[]),!Array.isArray(i)&&typeof i!="string")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The subprotocol '"+i.toString()+"' is invalid.");typeof i=="string"&&(i=[i]);var c=i.map(function(a){return{count:1,protocol:a}}).reduce(function(a,m){return a[m.protocol]=(a[m.protocol]||0)+m.count,a},{}),d=Object.keys(c).filter(function(a){return c[a]>1});if(d.length>0)throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The subprotocol '"+d[0]+"' is duplicated.");return i}var L=function(i){function c(a,m){i.call(this),this._onopen=null,this._onmessage=null,this._onerror=null,this._onclose=null,this.url=In(a),m=Cn(m),this.protocol=m[0]||"",this.binaryType="blob",this.readyState=c.CONNECTING;var f=ht(this),g=C.attachWebSocket(f,this.url);oe(function(){if(this.readyState===c.CONNECTING)if(g)if(g.options.verifyClient&&typeof g.options.verifyClient=="function"&&!g.options.verifyClient())this.readyState=c.CLOSED,me("error","WebSocket connection to '"+this.url+"' failed: HTTP Authentication failed; no valid credentials available"),C.removeWebSocket(f,this.url),this.dispatchEvent(q({type:"error",target:this})),this.dispatchEvent(V({type:"close",target:this,code:U.CLOSE_NORMAL}));else{if(g.options.selectProtocol&&typeof g.options.selectProtocol=="function"){var w=g.options.selectProtocol(m),b=w!=="",A=m.indexOf(w)!==-1;if(b&&!A){this.readyState=c.CLOSED,me("error","WebSocket connection to '"+this.url+"' failed: Invalid Sub-Protocol"),C.removeWebSocket(f,this.url),this.dispatchEvent(q({type:"error",target:this})),this.dispatchEvent(V({type:"close",target:this,code:U.CLOSE_NORMAL}));return}this.protocol=w}this.readyState=c.OPEN,this.dispatchEvent(q({type:"open",target:this})),g.dispatchEvent(q({type:"connection"}),f)}else this.readyState=c.CLOSED,this.dispatchEvent(q({type:"error",target:this})),this.dispatchEvent(V({type:"close",target:this,code:U.CLOSE_NORMAL})),me("error","WebSocket connection to '"+this.url+"' failed")},this)}i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c;var d={onopen:{},onmessage:{},onclose:{},onerror:{}};return d.onopen.get=function(){return this._onopen},d.onmessage.get=function(){return this._onmessage},d.onclose.get=function(){return this._onclose},d.onerror.get=function(){return this._onerror},d.onopen.set=function(a){this.removeEventListener("open",this._onopen),this._onopen=a,this.addEventListener("open",a)},d.onmessage.set=function(a){this.removeEventListener("message",this._onmessage),this._onmessage=a,this.addEventListener("message",a)},d.onclose.set=function(a){this.removeEventListener("close",this._onclose),this._onclose=a,this.addEventListener("close",a)},d.onerror.set=function(a){this.removeEventListener("error",this._onerror),this._onerror=a,this.addEventListener("error",a)},c.prototype.send=function(a){var m=this;if(this.readyState===c.CONNECTING)throw new Error("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state");var f=ae({type:"server::message",origin:this.url,data:fe(a)}),g=C.serverLookup(this.url);g&&oe(function(){m.dispatchEvent(f,a)},g)},c.prototype.close=function(a,m){if(a!==void 0&&(typeof a!="number"||a!==1e3&&(a<3e3||a>4999)))throw new TypeError(F.CLOSE_ERROR+" The code must be either 1000, or between 3000 and 4999. "+a+" is neither.");if(m!==void 0){var f=Nn(m);if(f>123)throw new SyntaxError(F.CLOSE_ERROR+" The message must not be greater than 123 bytes.")}if(!(this.readyState===c.CLOSING||this.readyState===c.CLOSED)){var g=ht(this);this.readyState===c.CONNECTING?Sn(g,a||U.CLOSE_ABNORMAL,m):ft(g,a||U.CLOSE_NO_STATUS,m)}},Object.defineProperties(c.prototype,d),c}(H);L.CONNECTING=0,L.prototype.CONNECTING=L.CONNECTING,L.OPEN=1,L.prototype.OPEN=L.OPEN,L.CLOSING=2,L.prototype.CLOSING=L.CLOSING,L.CLOSED=3,L.prototype.CLOSED=L.CLOSED;var ee=function(i){function c(a,m){var f=this;a===void 0&&(a="socket.io"),m===void 0&&(m=""),i.call(this),this.binaryType="blob";var g=new Fe(a);g.pathname||(g.pathname="/"),this.url=g.toString(),this.readyState=c.CONNECTING,this.protocol="",this.target=this,typeof m=="string"||typeof m=="object"&&m!==null?this.protocol=m:Array.isArray(m)&&m.length>0&&(this.protocol=m[0]);var w=C.attachWebSocket(this,this.url);oe(function(){w?(this.readyState=c.OPEN,w.dispatchEvent(q({type:"connection"}),w,this),w.dispatchEvent(q({type:"connect"}),w,this),this.dispatchEvent(q({type:"connect",target:this}))):(this.readyState=c.CLOSED,this.dispatchEvent(q({type:"error",target:this})),this.dispatchEvent(V({type:"close",target:this,code:U.CLOSE_NORMAL})),me("error","Socket.io connection to '"+this.url+"' failed"))},this),this.addEventListener("close",function(b){f.dispatchEvent(V({type:"disconnect",target:b.target,code:b.code}))})}i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c;var d={broadcast:{}};return c.prototype.close=function(){if(this.readyState===c.OPEN){var a=C.serverLookup(this.url);return C.removeWebSocket(this,this.url),this.readyState=c.CLOSED,this.dispatchEvent(V({type:"close",target:this,code:U.CLOSE_NORMAL})),a&&a.dispatchEvent(V({type:"disconnect",target:this,code:U.CLOSE_NORMAL}),a),this}},c.prototype.disconnect=function(){return this.close()},c.prototype.emit=function(a){for(var m=[],f=arguments.length-1;f-- >0;)m[f]=arguments[f+1];if(this.readyState!==c.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var g=ae({type:a,origin:this.url,data:m}),w=C.serverLookup(this.url);return w&&w.dispatchEvent.apply(w,[g].concat(m)),this},c.prototype.send=function(a){return this.emit("message",a),this},d.broadcast.get=function(){if(this.readyState!==c.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var a=this,m=C.serverLookup(this.url);if(!m)throw new Error("SocketIO can not find a server at the specified URL ("+this.url+")");return{emit:function(f,g){return m.emit(f,g,{websockets:C.websocketsLookup(a.url,null,a)}),a},to:function(f){return m.to(f,a)},in:function(f){return m.in(f,a)}}},c.prototype.on=function(a,m){return this.addEventListener(a,m),this},c.prototype.off=function(a,m){this.removeEventListener(a,m)},c.prototype.hasListeners=function(a){var m=this.listeners[a];return Array.isArray(m)?!!m.length:!1},c.prototype.join=function(a){C.addMembershipToRoom(this,a)},c.prototype.leave=function(a){C.removeMembershipFromRoom(this,a)},c.prototype.to=function(a){return this.broadcast.to(a)},c.prototype.in=function(){return this.to.apply(null,arguments)},c.prototype.dispatchEvent=function(a){for(var m=this,f=[],g=arguments.length-1;g-- >0;)f[g]=arguments[g+1];var w=a.type,b=this.listeners[w];if(!Array.isArray(b))return!1;b.forEach(function(A){f.length>0?A.apply(m,f):A.call(m,a.data?a.data:a)})},Object.defineProperties(c.prototype,d),c}(H);ee.CONNECTING=0,ee.OPEN=1,ee.CLOSING=2,ee.CLOSED=3;var qe=function(i,c){return new ee(i,c)};qe.connect=function(i,c){return qe(i,c)};var Pn=function(i){return i.reduce(function(c,d){return c.indexOf(d)>-1?c:c.concat(d)},[])};function kt(){return typeof window!="undefined"?window:typeof process=="object"&&typeof xs=="function"&&typeof ie=="object"?ie:this}var gt={mock:!0,verifyClient:null,selectProtocol:null},Ve=function(i){function c(d,a){a===void 0&&(a=gt),i.call(this);var m=new Fe(d);m.pathname||(m.pathname="/"),this.url=m.toString(),this.originalWebSocket=null;var f=C.attachServer(this,this.url);if(!f)throw this.dispatchEvent(q({type:"error"})),new Error("A mock server is already listening on this url");this.options=Object.assign({},gt,a),this.options.mock&&this.mockWebsocket()}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c.prototype.mockWebsocket=function(){var d=kt();this.originalWebSocket=d.WebSocket,d.WebSocket=L},c.prototype.restoreWebsocket=function(){var d=kt();this.originalWebSocket!==null&&(d.WebSocket=this.originalWebSocket),this.originalWebSocket=null},c.prototype.stop=function(d){d===void 0&&(d=function(){}),this.options.mock&&this.restoreWebsocket(),C.removeServer(this.url),typeof d=="function"&&d()},c.prototype.on=function(d,a){this.addEventListener(d,a)},c.prototype.off=function(d,a){this.removeEventListener(d,a)},c.prototype.close=function(d){d===void 0&&(d={});var a=d.code,m=d.reason,f=d.wasClean,g=C.websocketsLookup(this.url);C.removeServer(this.url),g.forEach(function(w){w.readyState=L.CLOSED,w.dispatchEvent(V({type:"close",target:w.target,code:a||U.CLOSE_NORMAL,reason:m||"",wasClean:f}))}),this.dispatchEvent(V({type:"close"}),this)},c.prototype.emit=function(d,a,m){var f=this;m===void 0&&(m={});var g=m.websockets;g||(g=C.websocketsLookup(this.url));var w;typeof m!="object"||arguments.length>3?(a=Array.prototype.slice.call(arguments,1,arguments.length),w=a.map(function(b){return fe(b)})):w=fe(a),g.forEach(function(b){var A=b instanceof ee?a:w;Array.isArray(A)?b.dispatchEvent.apply(b,[ae({type:d,data:A,origin:f.url,target:b.target})].concat(A)):b.dispatchEvent(ae({type:d,data:A,origin:f.url,target:b.target}))})},c.prototype.clients=function(){return C.websocketsLookup(this.url)},c.prototype.to=function(d,a,m){var f=this;m===void 0&&(m=[]);var g=this,w=Pn(m.concat(C.websocketsLookup(this.url,d,a)));return{to:function(b,A){return f.to.call(f,b,A,w)},emit:function(b,A){g.emit(b,A,{websockets:w})}}},c.prototype.in=function(){for(var d=[],a=arguments.length;a--;)d[a]=arguments[a];return this.to.apply(null,d)},c.prototype.simulate=function(d){var a=C.websocketsLookup(this.url);d==="error"&&a.forEach(function(m){m.readyState=L.CLOSED,m.dispatchEvent(q({type:"error",target:m.target}))})},c}(H);Ve.of=function(i){return new Ve(i)};var Ln=Ve,An=L,Bn=qe;n.Server=Ln,n.WebSocket=An,n.SocketIO=Bn,Object.defineProperty(n,"__esModule",{value:!0})})})(Os,le);var ze={},Ss={get exports(){return ze},set exports(e){ze=e}},ne=typeof Reflect=="object"?Reflect:null,Pt=ne&&typeof ne.apply=="function"?ne.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},be;ne&&typeof ne.ownKeys=="function"?be=ne.ownKeys:Object.getOwnPropertySymbols?be=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:be=function(e){return Object.getOwnPropertyNames(e)};function Ns(e){console&&console.warn&&console.warn(e)}var tn=Number.isNaN||function(e){return e!==e};function O(){O.init.call(this)}Ss.exports=O;ze.once=Ls;O.EventEmitter=O;O.prototype._events=void 0;O.prototype._eventsCount=0;O.prototype._maxListeners=void 0;var Lt=10;function Pe(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(O,"defaultMaxListeners",{enumerable:!0,get:function(){return Lt},set:function(e){if(typeof e!="number"||e<0||tn(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Lt=e}});O.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};O.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||tn(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function nn(e){return e._maxListeners===void 0?O.defaultMaxListeners:e._maxListeners}O.prototype.getMaxListeners=function(){return nn(this)};O.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var s=e==="error",r=this._events;if(r!==void 0)s=s&&r.error===void 0;else if(!s)return!1;if(s){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var p=r[e];if(p===void 0)return!1;if(typeof p=="function")Pt(p,this,t);else for(var h=p.length,T=cn(p,h),n=0;n<h;++n)Pt(T[n],this,t);return!0};function sn(e,t,n,s){var r,o,l;if(Pe(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),l=o[t]),l===void 0)l=o[t]=n,++e._eventsCount;else if(typeof l=="function"?l=o[t]=s?[n,l]:[l,n]:s?l.unshift(n):l.push(n),r=nn(e),r>0&&l.length>r&&!l.warned){l.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=e,p.type=t,p.count=l.length,Ns(p)}return e}O.prototype.addListener=function(e,t){return sn(this,e,t,!1)};O.prototype.on=O.prototype.addListener;O.prototype.prependListener=function(e,t){return sn(this,e,t,!0)};function Is(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function rn(e,t,n){var s={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=Is.bind(s);return r.listener=n,s.wrapFn=r,r}O.prototype.once=function(e,t){return Pe(t),this.on(e,rn(this,e,t)),this};O.prototype.prependOnceListener=function(e,t){return Pe(t),this.prependListener(e,rn(this,e,t)),this};O.prototype.removeListener=function(e,t){var n,s,r,o,l;if(Pe(t),s=this._events,s===void 0)return this;if(n=s[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){l=n[o].listener,r=o;break}if(r<0)return this;r===0?n.shift():Cs(n,r),n.length===1&&(s[e]=n[0]),s.removeListener!==void 0&&this.emit("removeListener",e,l||t)}return this};O.prototype.off=O.prototype.removeListener;O.prototype.removeAllListeners=function(e){var t,n,s;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var r=Object.keys(n),o;for(s=0;s<r.length;++s)o=r[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(s=t.length-1;s>=0;s--)this.removeListener(e,t[s]);return this};function on(e,t,n){var s=e._events;if(s===void 0)return[];var r=s[t];return r===void 0?[]:typeof r=="function"?n?[r.listener||r]:[r]:n?Ps(r):cn(r,r.length)}O.prototype.listeners=function(e){return on(this,e,!0)};O.prototype.rawListeners=function(e){return on(this,e,!1)};O.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):an.call(e,t)};O.prototype.listenerCount=an;function an(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}O.prototype.eventNames=function(){return this._eventsCount>0?be(this._events):[]};function cn(e,t){for(var n=new Array(t),s=0;s<t;++s)n[s]=e[s];return n}function Cs(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Ps(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function Ls(e,t){return new Promise(function(n,s){function r(l){e.removeListener(t,o),s(l)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",r),n([].slice.call(arguments))}un(e,t,o,{once:!0}),t!=="error"&&As(e,r,{once:!0})})}function As(e,t,n){typeof e.on=="function"&&un(e,"error",t,n)}function un(e,t,n,s){if(typeof e.on=="function")s.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function r(o){s.once&&e.removeEventListener(t,r),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}class Bs extends u{constructor(){super("message.v1.SocketMessage",[{no:1,name:"event",kind:"scalar",T:13},{no:2,name:"id",kind:"scalar",opt:!0,T:9},{no:3,name:"payload",kind:"scalar",opt:!0,T:12},{no:4,name:"metadata",kind:"scalar",opt:!0,T:12}])}}const At=new Bs;var Oe;(function(e){e[e.PUBLISHER=0]="PUBLISHER",e[e.SUBSCRIBER=1]="SUBSCRIBER"})(Oe||(Oe={}));var He;(function(e){e[e.AUDIO=0]="AUDIO",e[e.VIDEO=1]="VIDEO"})(He||(He={}));class Ds extends u{constructor(){super("media.Codec",[{no:1,name:"channels",kind:"scalar",opt:!0,T:5},{no:2,name:"clock_rate",kind:"scalar",T:5},{no:3,name:"mime_type",kind:"scalar",T:9},{no:4,name:"sdp_fmtp_line",kind:"scalar",opt:!0,T:9}])}}const Fs=new Ds;class Ms extends u{constructor(){super("media.HeaderExtension",[{no:1,name:"direction",kind:"scalar",opt:!0,T:9},{no:2,name:"uri",kind:"scalar",T:9}])}}const Us=new Ms;class qs extends u{constructor(){super("media.Fingerprint",[{no:1,name:"algorithm",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:9}])}}new qs;class Vs extends u{constructor(){super("media.SessionDescription",[{no:1,name:"target",kind:"enum",T:()=>["media.Target",Oe]},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"sdp",kind:"scalar",T:9}])}}const j=new Vs;class Gs extends u{constructor(){super("media.ProducerPayload",[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8},{no:4,name:"msid",kind:"scalar",T:9},{no:5,name:"app_data",kind:"scalar",opt:!0,T:9},{no:6,name:"mime_type",kind:"scalar",opt:!0,T:9}])}}const js=new Gs;class Ws extends u{constructor(){super("media.CreateTransportRequest",[{no:1,name:"consuming",kind:"scalar",T:8},{no:2,name:"force_tcp",kind:"scalar",opt:!0,T:8},{no:3,name:"description",kind:"message",T:()=>j},{no:4,name:"private_ice",kind:"scalar",opt:!0,T:8},{no:5,name:"producers",kind:"message",repeat:1,T:()=>js}])}}new Ws;class Ks extends u{constructor(){super("media.AudioActivityRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"energy",kind:"scalar",T:5},{no:3,name:"silent",kind:"scalar",T:8}])}}new Ks;class Js extends u{constructor(){super("media.CreateTransportResponse",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>j},{no:3,name:"transcription_enabled",kind:"scalar",opt:!0,T:8},{no:4,name:"producer_ids",kind:"scalar",repeat:2,T:9}])}}const ln=new Js;class Zs extends u{constructor(){super("media.RenegotiateRequest",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>j}])}}new Zs;class Xs extends u{constructor(){super("media.RenegotiateResponse",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>j}])}}new Xs;class $s extends u{constructor(){super("media.NestedScore",[{no:1,name:"encoding_idx",kind:"scalar",T:5},{no:2,name:"rid",kind:"scalar",T:9},{no:3,name:"score",kind:"scalar",T:5},{no:4,name:"ssrc",kind:"scalar",T:3,L:0}])}}const Ys=new $s;class zs extends u{constructor(){super("media.ProducerTrack",[{no:1,name:"track_id",kind:"scalar",T:9},{no:2,name:"producer_id",kind:"scalar",T:9},{no:3,name:"stream_id",kind:"scalar",T:9}])}}const Hs=new zs;class Qs extends u{constructor(){super("media.ProducerEntry",[{no:1,name:"producing_transport_id",kind:"scalar",T:9},{no:2,name:"producer_id",kind:"scalar",T:9}])}}new Qs;class er extends u{constructor(){super("media.ConsumerEntry",[{no:1,name:"consuming_transport_id",kind:"scalar",T:9},{no:2,name:"consumer_id",kind:"scalar",T:9}])}}new er;class tr extends u{constructor(){super("media.ProducerState",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"kind",kind:"enum",T:()=>["media.ProducerKind",He]},{no:3,name:"pause",kind:"scalar",T:8},{no:4,name:"screen_share",kind:"scalar",T:8},{no:5,name:"app_data",kind:"scalar",opt:!0,T:9},{no:6,name:"producing_transport_id",kind:"scalar",opt:!0,T:9},{no:7,name:"mime_type",kind:"scalar",opt:!0,T:9}])}}const pe=new tr;class nr extends u{constructor(){super("media.ConsumerState",[{no:1,name:"consumer_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>pe},{no:3,name:"producer_track",kind:"message",T:()=>Hs}])}}const sr=new nr;class rr extends u{constructor(){super("media.ProducerIdToConsumerMap",[{no:1,name:"map",kind:"map",K:9,V:{kind:"message",T:()=>sr}}])}}const dn=new rr;class or extends u{constructor(){super("media.PeerRtpCapabilitites",[{no:1,name:"sender",kind:"message",T:()=>Dt},{no:2,name:"receiver",kind:"message",T:()=>Dt}])}}const pn=new or;class ar extends u{constructor(){super("media.RtpCapability",[{no:1,name:"codecs",kind:"message",repeat:1,T:()=>Fs},{no:2,name:"header_extensions",kind:"message",repeat:1,T:()=>Us}])}}const Bt=new ar;class ir extends u{constructor(){super("media.RtpCapabilitites",[{no:1,name:"audio",kind:"message",T:()=>Bt},{no:2,name:"video",kind:"message",T:()=>Bt}])}}const Dt=new ir;class cr extends u{constructor(){super("media.PreferredCodec",[{no:1,name:"audio",kind:"scalar",opt:!0,T:9},{no:2,name:"video",kind:"scalar",opt:!0,T:9}])}}const ur=new cr;class lr extends u{constructor(){super("media.edge.GeoLocation",[{no:1,name:"latitude",kind:"scalar",T:2},{no:2,name:"longitude",kind:"scalar",T:2},{no:3,name:"region",kind:"scalar",opt:!0,T:9}])}}const dr=new lr;class pr extends u{constructor(){super("media.edge.PeerJoinRequest",[{no:1,name:"display_name",kind:"scalar",opt:!0,T:9},{no:2,name:"prejoined",kind:"scalar",T:8},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:5,name:"preset",kind:"scalar",opt:!0,T:12},{no:6,name:"user_id",kind:"scalar",opt:!0,T:9},{no:7,name:"organization_id",kind:"scalar",opt:!0,T:9},{no:8,name:"location",kind:"message",T:()=>dr},{no:9,name:"capabilities",kind:"message",T:()=>pn}])}}new pr;class mr extends u{constructor(){super("media.edge.PeerJoinCompleteRequest",[])}}new mr;class fr extends u{constructor(){super("media.edge.PeerLeaveRequest",[{no:1,name:"close_room",kind:"scalar",T:8}])}}new fr;class hr extends u{constructor(){super("media.edge.ConsumeMultipleProducerRequest",[{no:1,name:"producer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"paused",kind:"scalar",opt:!0,T:8}])}}new hr;class kr extends u{constructor(){super("media.edge.ConsumePeerRequest",[{no:1,name:"producing_peer_id",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",opt:!0,T:8},{no:3,name:"producer_id",kind:"scalar",opt:!0,T:9},{no:4,name:"preferred_codec",kind:"message",T:()=>ur},{no:5,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}const gr=new kr;class Tr extends u{constructor(){super("media.edge.ConsumePeersRequest",[{no:1,name:"requests",kind:"message",repeat:1,T:()=>gr},{no:2,name:"consuming_transport_id",kind:"scalar",opt:!0,T:9}])}}new Tr;class wr extends u{constructor(){super("media.edge.ProducerCreateRequest",[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8},{no:4,name:"description",kind:"message",T:()=>j},{no:5,name:"msid",kind:"scalar",T:9},{no:6,name:"app_data",kind:"scalar",opt:!0,T:9},{no:7,name:"mime_type",kind:"scalar",opt:!0,T:9},{no:8,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}new wr;class yr extends u{constructor(){super("media.edge.SelectedPeersRequest",[])}}new yr;class br extends u{constructor(){super("media.edge.GlobalPeerPinningRequest",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new br;class _r extends u{constructor(){super("media.edge.ProducerToggleRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"pause",kind:"scalar",T:8}])}}new _r;class vr extends u{constructor(){super("media.edge.ConsumerToggleRequest",[{no:1,name:"consumer_id",kind:"scalar",T:9},{no:2,name:"pause",kind:"scalar",T:8}])}}new vr;class Er extends u{constructor(){super("media.edge.ProducerCloseRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>j},{no:3,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}new Er;class Rr extends u{constructor(){super("media.edge.ConsumerCloseRequest",[{no:1,name:"consumer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"description",kind:"message",T:()=>j},{no:3,name:"consuming_transport_id",kind:"scalar",opt:!0,T:9}])}}new Rr;class xr extends u{constructor(){super("media.edge.KickPeerRequest",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new xr;class Or extends u{constructor(){super("media.edge.KickAllPeersRequest",[{no:1,name:"propagate_kick_across_rooms",kind:"scalar",T:8}])}}new Or;class Sr extends u{constructor(){super("media.edge.PeerDisplayNameEditRequest",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9}])}}new Sr;class Nr extends u{constructor(){super("media.edge.HostMediaControlForPeerRequest",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"audio",kind:"scalar",T:8},{no:3,name:"video",kind:"scalar",T:8},{no:4,name:"scree_share",kind:"scalar",T:8}])}}new Nr;class Ir extends u{constructor(){super("media.edge.HostMediaControlForAllPeerRequest",[{no:1,name:"audio",kind:"scalar",T:8},{no:2,name:"video",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8}])}}new Ir;class Cr extends u{constructor(){super("media.edge.GetRoomStateResponse",[{no:1,name:"display_title",kind:"scalar",T:9},{no:2,name:"locked_mode",kind:"scalar",T:8},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"room_name",kind:"scalar",T:9},{no:5,name:"current_peer_id",kind:"scalar",T:9},{no:6,name:"is_recording",kind:"scalar",opt:!0,T:8},{no:7,name:"recorder_participant_id",kind:"scalar",opt:!0,T:9},{no:8,name:"pinned_peer_ids",kind:"scalar",repeat:2,T:9}])}}const Pr=new Cr;class Lr extends u{constructor(){super("media.edge.ErrorResponse",[{no:1,name:"error_message",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:5}])}}new Lr;class Ar extends u{constructor(){super("media.edge.EmptyResponse",[])}}new Ar;class Br extends u{constructor(){super("media.edge.RoomParticipants",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"producer_states",kind:"message",repeat:1,T:()=>pe},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"user_id",kind:"scalar",opt:!0,T:9},{no:5,name:"capabilities",kind:"message",T:()=>pn}])}}const mn=new Br;class Dr extends u{constructor(){super("media.edge.SelectedPeersResponse",[{no:1,name:"audio_peers",kind:"scalar",repeat:2,T:9},{no:2,name:"compulsory_peers",kind:"scalar",repeat:2,T:9}])}}const Fr=new Dr;class Mr extends u{constructor(){super("media.edge.SelectedPeersDiffEntry",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"priority",kind:"scalar",T:5}])}}const Ur=new Mr;class qr extends u{constructor(){super("media.edge.SelectedPeersDiffResponse",[{no:1,name:"entries",kind:"message",repeat:1,T:()=>Ur}])}}new qr;class Vr extends u{constructor(){super("media.edge.PeerJoinResponse",[])}}new Vr;class Gr extends u{constructor(){super("media.edge.PeerJoinCompleteResponse",[{no:1,name:"room_state",kind:"message",T:()=>Pr},{no:2,name:"participants",kind:"message",repeat:1,T:()=>mn},{no:3,name:"selected_peers",kind:"message",T:()=>Fr},{no:4,name:"max_preferred_streams",kind:"scalar",T:5}])}}const jr=new Gr;class Wr extends u{constructor(){super("media.edge.PeerLeaveResponse",[{no:1,name:"closed",kind:"scalar",T:8}])}}new Wr;class Kr extends u{constructor(){super("media.edge.ConsumeMultipleProducerResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"consumer_ids_map",kind:"message",T:()=>dn}])}}new Kr;class Jr extends u{constructor(){super("media.edge.ConsumePeerResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"consumer_ids_map",kind:"message",T:()=>dn},{no:3,name:"description",kind:"message",T:()=>j}])}}new Jr;class Zr extends u{constructor(){super("media.edge.ProducerCreateResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"producer_id",kind:"scalar",T:9},{no:4,name:"description",kind:"message",T:()=>j}])}}const Xr=new Zr;class $r extends u{constructor(){super("media.edge.ProducerScoreResponse",[{no:1,name:"responseid",kind:"scalar",T:9},{no:2,name:"score",kind:"message",T:()=>Ys}])}}new $r;class Yr extends u{constructor(){super("media.edge.ActiveSpeakerResponse",[{no:1,name:"responsepeer_id",kind:"scalar",T:9},{no:2,name:"volume",kind:"scalar",T:5}])}}new Yr;class zr extends u{constructor(){super("media.edge.NoActiveSpeakerResponse",[])}}new zr;class Hr extends u{constructor(){super("media.edge.ProducerToggleResponse",[])}}new Hr;class Qr extends u{constructor(){super("media.edge.ConsumerToggleResponse",[])}}new Qr;class eo extends u{constructor(){super("media.edge.ProducerClosingResponse",[{no:1,name:"description",kind:"message",T:()=>j}])}}new eo;class to extends u{constructor(){super("media.edge.ConsumerClosingResponse",[{no:1,name:"description",kind:"message",T:()=>j}])}}new to;class no extends u{constructor(){super("media.edge.GlobalPeerPinningResponse",[])}}new no;class so extends u{constructor(){super("media.edge.KickPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new so;class ro extends u{constructor(){super("media.edge.KickAllPeersResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new ro;class oo extends u{constructor(){super("media.edge.HostMediaControlForPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new oo;class ao extends u{constructor(){super("media.edge.HostMediaControlForAllPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new ao;class io extends u{constructor(){super("media.edge.PeerDisplayNameEditResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new io;class co extends u{constructor(){super("media.edge.PeerJoinBroadcastResponse",[{no:1,name:"participant",kind:"message",T:()=>mn}])}}new co;class uo extends u{constructor(){super("media.edge.TrackSubscriptionKind",[{no:1,name:"audio",kind:"scalar",T:8},{no:2,name:"video",kind:"scalar",T:8}])}}const Ft=new uo;class lo extends u{constructor(){super("media.edge.TrackSubscription",[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"webcam",kind:"message",T:()=>Ft},{no:3,name:"screenshare",kind:"message",T:()=>Ft}])}}const po=new lo;class mo extends u{constructor(){super("media.edge.PeerProducingTransportCreateBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"transport_details",kind:"message",T:()=>ln},{no:3,name:"track_subscriptions",kind:"message",repeat:1,T:()=>po}])}}new mo;class fo extends u{constructor(){super("media.edge.PeerProducerCreateBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>pe}])}}new fo;class ho extends u{constructor(){super("media.edge.PeerProducerToggleBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>pe},{no:3,name:"initiator_participant_id",kind:"scalar",opt:!0,T:9}])}}new ho;class ko extends u{constructor(){super("media.edge.PeerProducerCloseBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>pe}])}}new ko;class go extends u{constructor(){super("media.edge.PeerLeaveBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new go;class To extends u{constructor(){super("media.edge.GlobalPeerPinningBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new To;class wo extends u{constructor(){super("media.edge.GlobalPeerUnPinningBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new wo;class yo extends u{constructor(){super("media.edge.RecordingStartedBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new yo;class bo extends u{constructor(){super("media.edge.RecordingStoppedBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new bo;class _o extends u{constructor(){super("media.edge.PeerDisplayNameEditBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9}])}}new _o;class vo extends u{constructor(){super("media.edge.PeerPingRequestBroadcastResponse",[{no:1,name:"password",kind:"scalar",T:9}])}}new vo;class Eo extends u{constructor(){super("media.edge.MediaRoomTerminationBroadcastResponse",[{no:1,name:"reason",kind:"scalar",T:9}])}}new Eo;class Ro extends u{constructor(){super("socket.ai.MeetingTranscript",[{no:1,name:"meeting_id",kind:"scalar",T:9},{no:2,name:"transcript",kind:"scalar",T:9},{no:3,name:"is_partial",kind:"scalar",T:8}])}}new Ro;class xo extends u{constructor(){super("socket.api.BaseSocketHubMessage",[{no:1,name:"event",kind:"scalar",T:5},{no:2,name:"id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9},{no:4,name:"room_id",kind:"scalar",T:9},{no:5,name:"user_id",kind:"scalar",T:9},{no:6,name:"payload",kind:"scalar",T:12},{no:7,name:"error",kind:"scalar",opt:!0,T:8},{no:8,name:"sid",kind:"scalar",opt:!0,T:9}])}}new xo;class Oo extends u{constructor(){super("socket.api.ErrorMessage",[{no:1,name:"code",kind:"scalar",opt:!0,T:5},{no:2,name:"message",kind:"scalar",T:9}])}}new Oo;var Se;(function(e){e[e.BROWSER=0]="BROWSER",e[e.TRACK=1]="TRACK",e[e.COMPOSITE=2]="COMPOSITE"})(Se||(Se={}));var de;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ON_STAGE=1]="ON_STAGE",e[e.APPROVED_STAGE=2]="APPROVED_STAGE",e[e.REQUESTED_STAGE=3]="REQUESTED_STAGE",e[e.OFF_STAGE=4]="OFF_STAGE"})(de||(de={}));var Qe;(function(e){e[e.NONE=0]="NONE",e[e.RECORDER=1]="RECORDER",e[e.LIVESTREAMER=2]="LIVESTREAMER"})(Qe||(Qe={}));var et;(function(e){e[e.PEERS=0]="PEERS",e[e.ROOMS=1]="ROOMS"})(et||(et={}));var tt;(function(e){e[e.HIVE=0]="HIVE",e[e.CHAT=1]="CHAT",e[e.PING=2]="PING"})(tt||(tt={}));class So extends u{constructor(){super("socket.room.PeerFlags",[{no:1,name:"preset_name",kind:"scalar",T:9},{no:2,name:"recorder_type",kind:"scalar",T:9},{no:3,name:"hidden_participant",kind:"scalar",T:8}])}}const No=new So;class Io extends u{constructor(){super("socket.room.Peer",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"stage_type",kind:"enum",opt:!0,T:()=>["socket.room.StageType",de,"STAGE_TYPE_"]},{no:5,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:6,name:"preset_id",kind:"scalar",opt:!0,T:9},{no:7,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:8,name:"waitlisted",kind:"scalar",T:8},{no:9,name:"flags",kind:"message",T:()=>No}])}}const Le=new Io;class Co extends u{constructor(){super("socket.room.PeerInfoResponse",[{no:1,name:"peer",kind:"message",T:()=>Le}])}}const Mt=new Co;class Po extends u{constructor(){super("socket.room.PeerStatusUpdate",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"stage_type",kind:"enum",opt:!0,T:()=>["socket.room.StageType",de,"STAGE_TYPE_"]}])}}new Po;class Lo extends u{constructor(){super("socket.room.RoomPeersInfoRequest",[{no:1,name:"seach_query",kind:"scalar",T:9},{no:2,name:"limit",kind:"scalar",T:5},{no:3,name:"offset",kind:"scalar",T:5}])}}new Lo;class Ao extends u{constructor(){super("socket.room.RoomPeersInfoResponse",[{no:1,name:"peers",kind:"message",repeat:1,T:()=>Le}])}}const Bo=new Ao;class Do extends u{constructor(){super("socket.room.RoomPeerCountResponse",[{no:1,name:"count",kind:"scalar",T:4,L:2}])}}new Do;class Fo extends u{constructor(){super("socket.room.Room",[{no:1,name:"room_id",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",T:9},{no:4,name:"created_at",kind:"scalar",T:4,L:2},{no:5,name:"active_recordings",kind:"message",repeat:1,T:()=>Uo},{no:6,name:"room_uuid",kind:"scalar",opt:!0,T:9}])}}const fn=new Fo;class Mo extends u{constructor(){super("socket.room.ActiveRecording",[{no:1,name:"recording_id",kind:"scalar",T:9},{no:2,name:"recording_type",kind:"enum",T:()=>["common.RecordingType",Se]},{no:3,name:"recording_status",kind:"scalar",T:9}])}}const Uo=new Mo;class qo extends u{constructor(){super("socket.room.RoomInfoResponse",[{no:1,name:"room",kind:"message",T:()=>fn}])}}const Vo=new qo;class Go extends u{constructor(){super("socket.room.GetPeerInfoRequest",[{no:1,name:"peer_id",kind:"scalar",T:9}])}}new Go;class jo extends u{constructor(){super("socket.room.UpdatePeerInfoRequest",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9}])}}new jo;class Wo extends u{constructor(){super("socket.room.JoinRoomRequest",[{no:1,name:"peer",kind:"message",T:()=>Le},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"organization_id",kind:"scalar",opt:!0,T:9},{no:5,name:"use_hive",kind:"scalar",opt:!0,T:8},{no:6,name:"preset",kind:"scalar",opt:!0,T:12},{no:7,name:"capabilities",kind:"enum",repeat:1,T:()=>["socket.room.Capabilities",tt,"CAPABILITIES_"]},{no:8,name:"timestamp",kind:"scalar",opt:!0,T:4,L:2}])}}new Wo;class Ko extends u{constructor(){super("socket.room.LeaveRoomRequest",[{no:1,name:"peer",kind:"message",T:()=>Le},{no:2,name:"timestamp",kind:"scalar",opt:!0,T:4,L:2}])}}new Ko;class Jo extends u{constructor(){super("socket.room.UpdateRoomInfoRequest",[{no:1,name:"room",kind:"message",T:()=>fn}])}}new Jo;class Zo extends u{constructor(){super("socket.room.GetConnectedRoomsDumpRequest",[])}}new Zo;class Xo extends u{constructor(){super("socket.room.ServiceError",[{no:1,name:"message",kind:"scalar",opt:!0,T:9},{no:2,name:"code",kind:"scalar",opt:!0,T:9}])}}const ct=new Xo;class $o extends u{constructor(){super("socket.room.ConnectedMeetingPeer",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9},{no:3,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:4,name:"preset_id",kind:"scalar",opt:!0,T:9},{no:5,name:"display_picture_url",kind:"scalar",opt:!0,T:9}])}}const Yo=new $o;class zo extends u{constructor(){super("socket.room.ConnectedMeetingDump",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9},{no:3,name:"participants",kind:"message",repeat:1,T:()=>Yo}])}}const Ut=new zo;class Ho extends u{constructor(){super("socket.room.GetConnectedRoomsDumpResponse",[{no:1,name:"parent_meeting",kind:"message",T:()=>Ut},{no:2,name:"meetings",kind:"message",repeat:1,T:()=>Ut}])}}const Qo=new Ho;class ea extends u{constructor(){super("socket.room.CreateRoomRequestPayload",[{no:1,name:"title",kind:"scalar",opt:!0,T:9}])}}const ta=new ea;class na extends u{constructor(){super("socket.room.CreateConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>ta}])}}new na;class sa extends u{constructor(){super("socket.room.CreateRoomResponsePayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9},{no:3,name:"error",kind:"message",T:()=>ct}])}}const ra=new sa;class oa extends u{constructor(){super("socket.room.CreateConnectedRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>ra}])}}new oa;class aa extends u{constructor(){super("socket.room.UpdateRoomRequestPayload",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9}])}}const ia=new aa;class ca extends u{constructor(){super("socket.room.UpdateConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>ia}])}}new ca;class ua extends u{constructor(){super("socket.room.DisableRoomPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9}])}}const la=new ua;class da extends u{constructor(){super("socket.room.DisableConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>la}])}}new da;class pa extends u{constructor(){super("socket.room.DisableConnectedRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>fa}])}}new pa;class ma extends u{constructor(){super("socket.room.DisableConnectedRoomPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"status",kind:"scalar",opt:!0,T:9},{no:3,name:"title",kind:"scalar",opt:!0,T:9},{no:4,name:"error",kind:"message",T:()=>ct}])}}const fa=new ma;class ha extends u{constructor(){super("socket.room.MovePeerPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"preset_id",kind:"scalar",opt:!0,T:9}])}}const ka=new ha;class ga extends u{constructor(){super("socket.room.MovePeersBetweenRoomsRequest",[{no:1,name:"source_meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"destination_meeting_id",kind:"scalar",opt:!0,T:9},{no:3,name:"participants",kind:"message",repeat:1,T:()=>ka}])}}new ga;class Ta extends u{constructor(){super("socket.room.MovedPeer",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:3,name:"error",kind:"message",T:()=>ct}])}}const wa=new Ta;class ya extends u{constructor(){super("socket.room.MovePeersBetweenRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>wa}])}}new ya;class ba extends u{constructor(){super("socket.room.TransferPeer",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"auth_token",kind:"scalar",opt:!0,T:9}])}}new ba;class _a extends u{constructor(){super("socket.room.GetAllAddedParticipantsResponse",[{no:1,name:"participants",kind:"message",repeat:1,T:()=>Ea}])}}new _a;class va extends u{constructor(){super("socket.room.AddedParticipant",[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"picture",kind:"scalar",opt:!0,T:9},{no:4,name:"custom_participant_id",kind:"scalar",T:9}])}}const Ea=new va;class Ra extends u{constructor(){super("socket.room.RemoveParticipantsRequest",[{no:1,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new Ra;class xa extends u{constructor(){super("socket.room.BroadcastMessage",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"timestamp",kind:"scalar",T:4,L:2},{no:4,name:"ids",kind:"scalar",repeat:2,T:9},{no:5,name:"broadcast_type",kind:"enum",opt:!0,T:()=>["socket.room.BroadcastType",et,"BROADCAST_TYPE_"]}])}}new xa;class Oa extends u{constructor(){super("socket.room.AcceptWaitingRoomRequests",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Oa;class Sa extends u{constructor(){super("socket.room.DenyWaitingRoomRequests",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Sa;class Na extends u{constructor(){super("socket.room.WaitingRoomRequest",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"picture",kind:"scalar",opt:!0,T:9},{no:5,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:6,name:"preset_name",kind:"scalar",opt:!0,T:9}])}}const Ia=new Na;class Ca extends u{constructor(){super("socket.room.GetWaitingRoomRequests",[{no:1,name:"requests",kind:"message",repeat:1,T:()=>Ia}])}}new Ca;class Pa extends u{constructor(){super("socket.room.GetRoomStageStateResponse",[{no:1,name:"on_stage_peers",kind:"scalar",repeat:2,T:9},{no:2,name:"approved_stage_peers",kind:"scalar",repeat:2,T:9},{no:3,name:"requested_stage_peers",kind:"scalar",repeat:2,T:9}])}}new Pa;var nt;(function(e){e[e.NONE=0]="NONE",e[e.SKIP=1]="SKIP",e[e.ON_PRIVILEGED_USER_ENTRY=2]="ON_PRIVILEGED_USER_ENTRY",e[e.SKIP_ON_ACCEPT=3]="SKIP_ON_ACCEPT"})(nt||(nt={}));var Ne;(function(e){e[e.NONE=0]="NONE",e[e.ALLOWED=1]="ALLOWED",e[e.NOT_ALLOWED=2]="NOT_ALLOWED",e[e.CAN_REQUEST=3]="CAN_REQUEST"})(Ne||(Ne={}));class La extends u{constructor(){super("socket.preset.PollsPermissionUpdate",[{no:1,name:"can_create",kind:"scalar",opt:!0,T:8},{no:2,name:"can_vote",kind:"scalar",opt:!0,T:8},{no:3,name:"can_view",kind:"scalar",opt:!0,T:8}])}}const Aa=new La;class Ba extends u{constructor(){super("socket.preset.PluginsPermissionsUpdate",[{no:1,name:"can_close",kind:"scalar",opt:!0,T:8},{no:2,name:"can_start",kind:"scalar",opt:!0,T:8}])}}const Da=new Ba;class Fa extends u{constructor(){super("socket.preset.PublicChatPermission",[{no:1,name:"can_send",kind:"scalar",opt:!0,T:8},{no:2,name:"text",kind:"scalar",opt:!0,T:8},{no:3,name:"files",kind:"scalar",opt:!0,T:8}])}}const Ma=new Fa;class Ua extends u{constructor(){super("socket.preset.PrivateChatPermission",[{no:1,name:"can_send",kind:"scalar",opt:!0,T:8},{no:2,name:"can_receive",kind:"scalar",opt:!0,T:8},{no:3,name:"text",kind:"scalar",opt:!0,T:8},{no:4,name:"files",kind:"scalar",opt:!0,T:8}])}}const qa=new Ua;class Va extends u{constructor(){super("socket.preset.ChatPermissionUpdate",[{no:1,name:"public",kind:"message",T:()=>Ma},{no:2,name:"private",kind:"message",T:()=>qa}])}}const Ga=new Va;class ja extends u{constructor(){super("socket.preset.ConnectedMeetingPermissionUpdate",[{no:1,name:"can_alter_connected_meetings",kind:"scalar",opt:!0,T:8},{no:2,name:"can_switch_to_parent_meeting",kind:"scalar",opt:!0,T:8},{no:3,name:"can_switch_connected_meetings",kind:"scalar",opt:!0,T:8}])}}const Wa=new ja;class Ka extends u{constructor(){super("socket.preset.StreamPermission",[{no:1,name:"can_produce",kind:"enum",opt:!0,T:()=>["socket.preset.StreamPermissionType",Ne,"STREAM_PERMISSION_TYPE_"]},{no:2,name:"can_consume",kind:"enum",opt:!0,T:()=>["socket.preset.StreamPermissionType",Ne,"STREAM_PERMISSION_TYPE_"]}])}}const Je=new Ka;class Ja extends u{constructor(){super("socket.preset.MediaPermissionUpdate",[{no:1,name:"video",kind:"message",T:()=>Je},{no:2,name:"audio",kind:"message",T:()=>Je},{no:3,name:"screenshare",kind:"message",T:()=>Je}])}}const Za=new Ja;class Xa extends u{constructor(){super("socket.preset.PresetUpdates",[{no:1,name:"polls",kind:"message",T:()=>Aa},{no:2,name:"plugins",kind:"message",T:()=>Da},{no:3,name:"chat",kind:"message",T:()=>Ga},{no:4,name:"accept_waiting_requests",kind:"scalar",opt:!0,T:8},{no:5,name:"can_accept_production_requests",kind:"scalar",opt:!0,T:8},{no:6,name:"can_edit_display_name",kind:"scalar",opt:!0,T:8},{no:7,name:"can_record",kind:"scalar",opt:!0,T:8},{no:8,name:"can_livestream",kind:"scalar",opt:!0,T:8},{no:9,name:"can_spotlight",kind:"scalar",opt:!0,T:8},{no:10,name:"disable_participant_audio",kind:"scalar",opt:!0,T:8},{no:11,name:"disable_participant_screensharing",kind:"scalar",opt:!0,T:8},{no:12,name:"disable_participant_video",kind:"scalar",opt:!0,T:8},{no:13,name:"kick_participant",kind:"scalar",opt:!0,T:8},{no:14,name:"pin_participant",kind:"scalar",opt:!0,T:8},{no:15,name:"transcription_enabled",kind:"scalar",opt:!0,T:8},{no:16,name:"waiting_room_type",kind:"enum",opt:!0,T:()=>["socket.preset.WaitingRoomType",nt,"WAITING_ROOM_TYPE_"]},{no:17,name:"is_recorder",kind:"scalar",opt:!0,T:8},{no:18,name:"recorder_type",kind:"enum",opt:!0,T:()=>["socket.room.RecorderType",Qe,"RECORDER_TYPE_"]},{no:19,name:"hidden_participant",kind:"scalar",opt:!0,T:8},{no:20,name:"show_participant_list",kind:"scalar",opt:!0,T:8},{no:21,name:"can_change_participant_permissions",kind:"scalar",opt:!0,T:8},{no:22,name:"connected_meetings",kind:"message",T:()=>Wa},{no:23,name:"media",kind:"message",T:()=>Za}])}}const ut=new Xa;class $a extends u{constructor(){super("socket.preset.ReadPeersPresetRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new $a;class Ya extends u{constructor(){super("socket.preset.PeerPreset",[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"preset",kind:"scalar",T:12}])}}const za=new Ya;class Ha extends u{constructor(){super("socket.preset.ReadPeersPresetResponse",[{no:1,name:"peer_presets",kind:"message",repeat:1,T:()=>za}])}}new Ha;class Qa extends u{constructor(){super("socket.preset.UpdatePeerPreset",[{no:1,name:"user_ids",kind:"scalar",T:9},{no:2,name:"patch",kind:"message",T:()=>ut}])}}const hn=new Qa;class ei extends u{constructor(){super("socket.preset.UpdatePeersPresetRequest",[{no:1,name:"update_peers_presets",kind:"message",repeat:1,T:()=>hn}])}}new ei;class ti extends u{constructor(){super("socket.preset.UpdatePeersPresetResponse",[{no:1,name:"update_peers_presets",kind:"message",repeat:1,T:()=>hn}])}}new ti;class ni extends u{constructor(){super("socket.preset.PeerUserIDMap",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9}])}}const si=new ni;class ri extends u{constructor(){super("socket.preset.BulkUpdatePeerPresetRequest",[{no:1,name:"peers",kind:"message",repeat:1,T:()=>si},{no:2,name:"patch",kind:"message",T:()=>ut}])}}new ri;class oi extends u{constructor(){super("socket.preset.BulkUpdatePeerPresetResponse",[{no:2,name:"patch",kind:"message",T:()=>ut}])}}new oi;class ai extends u{constructor(){super("socket.chat.ChatMessage",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"user_id",kind:"scalar",T:9},{no:4,name:"display_name",kind:"scalar",T:9},{no:5,name:"pinned",kind:"scalar",T:8},{no:6,name:"is_edited",kind:"scalar",T:8},{no:7,name:"payload_type",kind:"scalar",T:5},{no:8,name:"payload",kind:"scalar",T:9},{no:10,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:11,name:"created_at",kind:"scalar",T:4,L:2},{no:12,name:"created_at_ms",kind:"scalar",opt:!0,T:4,L:2},{no:13,name:"channel_id",kind:"scalar",opt:!0,T:9},{no:14,name:"channel_index",kind:"scalar",opt:!0,T:9}])}}const Y=new ai;class ii extends u{constructor(){super("socket.chat.GetPaginatedChatMessageRoomRequest",[{no:1,name:"time_stamp",kind:"scalar",T:4,L:2},{no:2,name:"size",kind:"scalar",T:5},{no:3,name:"from",kind:"scalar",T:5},{no:4,name:"reversed",kind:"scalar",T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new ii;class ci extends u{constructor(){super("socket.chat.GetPaginatedChatMessageRoomResponse",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>Y},{no:2,name:"next",kind:"scalar",T:8}])}}new ci;class ui extends u{constructor(){super("socket.chat.GetChatMessagesResponse",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>Y}])}}new ui;class li extends u{constructor(){super("socket.chat.SendChatMessageToRoomRequest",[{no:1,name:"payload_type",kind:"scalar",T:5},{no:2,name:"payload",kind:"scalar",T:9}])}}new li;class di extends u{constructor(){super("socket.chat.SendChatMessageToRoomResponse",[{no:1,name:"message",kind:"message",T:()=>Y}])}}new di;class pi extends u{constructor(){super("socket.chat.SendChatMessageToPeersRequest",[{no:1,name:"peer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"payload_type",kind:"scalar",T:5},{no:3,name:"payload",kind:"scalar",T:9}])}}new pi;class mi extends u{constructor(){super("socket.chat.SendChatMessageToPeersResponse",[{no:1,name:"message",kind:"message",T:()=>Y}])}}new mi;class fi extends u{constructor(){super("socket.chat.SendChatMessageToChannelRequest",[{no:1,name:"channel_id",kind:"scalar",T:9},{no:2,name:"payload_type",kind:"scalar",T:5},{no:3,name:"payload",kind:"scalar",T:9}])}}new fi;class hi extends u{constructor(){super("socket.chat.SendChatMessageToChannelResponse",[{no:1,name:"message",kind:"message",T:()=>Y}])}}new hi;class ki extends u{constructor(){super("socket.chat.EditChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"payload_type",kind:"scalar",opt:!0,T:5},{no:3,name:"payload",kind:"scalar",opt:!0,T:9},{no:4,name:"pinned",kind:"scalar",opt:!0,T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new ki;class gi extends u{constructor(){super("socket.chat.PinChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"pinned",kind:"scalar",T:8},{no:3,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new gi;class Ti extends u{constructor(){super("socket.chat.PinChatMessageResponse",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"pinned",kind:"scalar",T:8},{no:3,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Ti;class wi extends u{constructor(){super("socket.chat.EditChatMessageResponse",[{no:1,name:"message",kind:"message",T:()=>Y}])}}new wi;class yi extends u{constructor(){super("socket.chat.DeleteChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new yi;class bi extends u{constructor(){super("socket.chat.DeleteChatMessageResponse",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new bi;class _i extends u{constructor(){super("socket.chat.SearchChatMessagesRequest",[{no:1,name:"time_stamp",kind:"scalar",T:4,L:2},{no:2,name:"size",kind:"scalar",T:5},{no:3,name:"from",kind:"scalar",T:5},{no:4,name:"reversed",kind:"scalar",T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9},{no:6,name:"search_term",kind:"scalar",T:9}])}}new _i;class vi extends u{constructor(){super("socket.chat.MarkChannelIndexAsReadRequest",[{no:1,name:"channel_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"channel_index",kind:"scalar",T:9}])}}new vi;class Ei extends u{constructor(){super("socket.chat.MarkChannelIndexAsReadResponse",[{no:1,name:"channel_index",kind:"scalar",T:9}])}}new Ei;class Ri extends u{constructor(){super("socket.chat.CreateChatChannelRequest",[{no:1,name:"display_name",kind:"scalar",T:9},{no:2,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:3,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:4,name:"visibility",kind:"scalar",T:9},{no:5,name:"is_direct_message",kind:"scalar",T:8}])}}new Ri;class xi extends u{constructor(){super("socket.chat.UpdateChatChannelRequest",[{no:1,name:"chat_channel_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9},{no:3,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:4,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:5,name:"visibility",kind:"scalar",opt:!0,T:9},{no:6,name:"is_direct_message",kind:"scalar",opt:!0,T:8}])}}new xi;class Oi extends u{constructor(){super("socket.chat.CreateChatChannelResponse",[{no:1,name:"chat_channel_id",kind:"scalar",T:9}])}}new Oi;class Si extends u{constructor(){super("socket.chat.GetChatChannelRequest",[{no:1,name:"chat_channel_id",kind:"scalar",T:9}])}}new Si;class Ni extends u{constructor(){super("socket.chat.LatestMessageAndUnreadCount",[{no:1,name:"message",kind:"message",T:()=>Y},{no:2,name:"unread_count",kind:"scalar",T:4,L:2}])}}const Ii=new Ni;class Ci extends u{constructor(){super("socket.chat.ChatChannel",[{no:1,name:"chat_channel_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9},{no:3,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:4,name:"visibility",kind:"scalar",T:9},{no:5,name:"is_direct_message",kind:"scalar",T:8},{no:6,name:"latest_message_and_unread_count",kind:"message",T:()=>Ii},{no:7,name:"target_user_ids",kind:"scalar",repeat:2,T:9}])}}const Pi=new Ci;class Li extends u{constructor(){super("socket.chat.GetChatChannelResponse",[{no:1,name:"chat_channels",kind:"message",repeat:1,T:()=>Pi}])}}new Li;class Ai extends u{constructor(){super("socket.chat.ChannelMember",[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"picture",kind:"scalar",opt:!0,T:9},{no:4,name:"custom_participant_id",kind:"scalar",T:9}])}}const Bi=new Ai;class Di extends u{constructor(){super("socket.chat.GetChatChannelMembersResponse",[{no:1,name:"channel_members",kind:"message",repeat:1,T:()=>Bi}])}}new Di;class Fi extends u{constructor(){super("socket.plugin.AddPluginRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"staggered",kind:"scalar",T:8}])}}new Fi;class Mi extends u{constructor(){super("socket.plugin.RemovePluginRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"staggered",kind:"scalar",T:8}])}}new Mi;class Ui extends u{constructor(){super("socket.plugin.EnablePluginForRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9}])}}new Ui;class qi extends u{constructor(){super("socket.plugin.DisablePluginForRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9}])}}new qi;class Vi extends u{constructor(){super("socket.plugin.EnablePluginForPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new Vi;class Gi extends u{constructor(){super("socket.plugin.DisablePluginForPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new Gi;class ji extends u{constructor(){super("socket.plugin.PluginEventToRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"plugin_data",kind:"scalar",T:12}])}}new ji;class Wi extends u{constructor(){super("socket.plugin.PluginEventToPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9},{no:3,name:"plugin_data",kind:"scalar",T:12}])}}new Wi;class Ki extends u{constructor(){super("socket.plugin.StoreKeys",[{no:1,name:"store_key",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",opt:!0,T:12}])}}const lt=new Ki;class Ji extends u{constructor(){super("socket.plugin.PluginStoreInsertKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"insert_keys",kind:"message",repeat:1,T:()=>lt}])}}new Ji;class Zi extends u{constructor(){super("socket.plugin.PluginStoreGetKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"get_keys",kind:"message",repeat:1,T:()=>lt}])}}new Zi;class Xi extends u{constructor(){super("socket.plugin.PluginStoreDeleteKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"delete_keys",kind:"message",repeat:1,T:()=>lt}])}}new Xi;class $i extends u{constructor(){super("socket.plugin.PluginStoreDeleteRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9}])}}new $i;class Yi extends u{constructor(){super("socket.plugin.EnablePluginResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"enabled_by",kind:"scalar",T:9}])}}const zi=new Yi;class Hi extends u{constructor(){super("socket.plugin.EnablePluginsResponse",[{no:1,name:"plugins",kind:"message",repeat:1,T:()=>zi}])}}new Hi;class Qi extends u{constructor(){super("socket.plugin.DisablePluginResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"disabled_by",kind:"scalar",T:9}])}}new Qi;class ec extends u{constructor(){super("socket.plugin.PluginStoreItem",[{no:1,name:"timestamp",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"store_key",kind:"scalar",T:9},{no:4,name:"payload",kind:"scalar",T:12}])}}const tc=new ec;class nc extends u{constructor(){super("socket.plugin.PluginStoreResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"store_items",kind:"message",repeat:1,T:()=>tc}])}}new nc;class sc extends u{constructor(){super("socket.plugin.PluginEventResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"plugin_data",kind:"scalar",T:12}])}}new sc;class rc extends u{constructor(){super("socket.livestreaming.LiveStreamingEvent",[{no:1,name:"livestream_id",kind:"scalar",T:9},{no:2,name:"err_message",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"meeting_id",kind:"scalar",T:9},{no:5,name:"playback_url",kind:"scalar",T:9},{no:6,name:"org_id",kind:"scalar",T:9},{no:7,name:"room_name",kind:"scalar",T:9},{no:8,name:"room_uuid",kind:"scalar",T:9},{no:9,name:"status",kind:"scalar",T:9},{no:10,name:"manual_ingest",kind:"scalar",opt:!0,T:8}])}}new rc;class oc extends u{constructor(){super("socket.livestreaming.GetStagePeersResponse",[{no:1,name:"stage_peers",kind:"scalar",repeat:2,T:9}])}}new oc;class ac extends u{constructor(){super("socket.livestreaming.StageRequest",[{no:1,name:"display_name",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9}])}}const ic=new ac;class cc extends u{constructor(){super("socket.livestreaming.GetStageRequestsResponse",[{no:1,name:"stage_requests",kind:"message",repeat:1,T:()=>ic}])}}new cc;class uc extends u{constructor(){super("socket.livestreaming.GrantStageAccessRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new uc;class lc extends u{constructor(){super("socket.livestreaming.DenyStageAccessRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new lc;class dc extends u{constructor(){super("socket.livestreaming.LeaveStageRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new dc;class pc extends u{constructor(){super("socket.polls.Poll",[{no:1,name:"poll_id",kind:"scalar",T:9},{no:2,name:"created_by",kind:"scalar",T:9},{no:3,name:"created_by_user_id",kind:"scalar",T:9},{no:4,name:"question",kind:"scalar",T:9},{no:5,name:"options",kind:"message",repeat:1,T:()=>fc},{no:6,name:"hide_votes",kind:"scalar",T:8},{no:7,name:"anonymous",kind:"scalar",T:8},{no:8,name:"votes",kind:"scalar",repeat:2,T:9}])}}const kn=new pc;class mc extends u{constructor(){super("socket.polls.PollOption",[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"count",kind:"scalar",opt:!0,T:4,L:2},{no:3,name:"votes",kind:"message",repeat:1,T:()=>kc}])}}const fc=new mc;class hc extends u{constructor(){super("socket.polls.PollVote",[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}])}}const kc=new hc;class gc extends u{constructor(){super("socket.polls.NewPollRequest",[{no:1,name:"question",kind:"scalar",T:9},{no:2,name:"options",kind:"scalar",repeat:2,T:9},{no:3,name:"anonymous",kind:"scalar",T:8},{no:4,name:"hide_votes",kind:"scalar",T:8},{no:5,name:"created_by",kind:"scalar",opt:!0,T:9},{no:6,name:"created_by_user_id",kind:"scalar",opt:!0,T:9}])}}new gc;class Tc extends u{constructor(){super("socket.polls.VotePollRequest",[{no:1,name:"poll_id",kind:"scalar",T:9},{no:2,name:"index",kind:"scalar",T:4,L:2}])}}new Tc;class wc extends u{constructor(){super("socket.polls.UpdatePollResponse",[{no:1,name:"poll",kind:"message",T:()=>kn}])}}new wc;class yc extends u{constructor(){super("socket.polls.GetPollsResponse",[{no:1,name:"polls",kind:"message",repeat:1,T:()=>kn}])}}new yc;class bc extends u{constructor(){super("socket.recording.RecordingEvent",[{no:1,name:"recording_id",kind:"scalar",T:9},{no:2,name:"err_message",kind:"scalar",T:9},{no:3,name:"recording_type",kind:"enum",T:()=>["common.RecordingType",Se]}])}}new bc;class _c extends u{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const t=this.create(),n=Date.now();return t.seconds=N.from(Math.floor(n/1e3)).toBigInt(),t.nanos=n%1e3*1e6,t}toDate(t){return new Date(N.from(t.seconds).toNumber()*1e3+Math.ceil(t.nanos/1e6))}fromDate(t){const n=this.create(),s=t.getTime();return n.seconds=N.from(Math.floor(s/1e3)).toBigInt(),n.nanos=s%1e3*1e6,n}internalJsonWrite(t,n){let s=N.from(t.seconds).toNumber()*1e3;if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(t.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let r="Z";if(t.nanos>0){let o=(t.nanos+1e9).toString().substring(1);o.substring(3)==="000000"?r="."+o.substring(0,3)+"Z":o.substring(6)==="000"?r="."+o.substring(0,6)+"Z":r="."+o+"Z"}return new Date(s).toISOString().replace(".000Z",r)}internalJsonRead(t,n,s){if(typeof t!="string")throw new Error("Unable to parse Timestamp from JSON "+at(t)+".");let r=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let o=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(o))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(o<Date.parse("0001-01-01T00:00:00Z")||o>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return s||(s=this.create()),s.seconds=N.from(o/1e3).toBigInt(),s.nanos=0,r[7]&&(s.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),s}}new _c;class vc extends u{constructor(){super("common.BaseHubMessage",[{no:1,name:"event",kind:"scalar",T:5},{no:2,name:"id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9},{no:4,name:"room_id",kind:"scalar",T:9},{no:5,name:"user_id",kind:"scalar",T:9},{no:6,name:"payload",kind:"scalar",T:12},{no:7,name:"error",kind:"scalar",opt:!0,T:8},{no:8,name:"sid",kind:"scalar",opt:!0,T:9},{no:9,name:"room_object_id",kind:"scalar",opt:!0,T:9},{no:10,name:"preset",kind:"scalar",opt:!0,T:9}])}}const st=new vc;class Ec extends u{constructor(){super("common.BulkedHubMessage",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>st}])}}new Ec;class Rc extends u{constructor(){super("common.CFWorkersResponse",[{no:1,name:"response",kind:"message",T:()=>st},{no:2,name:"broadcast_responses",kind:"message",repeat:1,T:()=>st}])}}new Rc;const xc=0,Oc=1,Sc=2,Nc=3,Ic=4,Cc=5,Pc={getPeerInfo:0,updatePeerInfo:1,getRoomPeersInfo:2,joinRoom:3,leaveRoom:4,getRoomInfo:5,updateRoomInfo:6,closeRoom:7,startedLivestream:8,stoppedLivestream:9,erroredLivestream:10,getStagePeers:11,getStageRequests:12,requestStageAccess:13,cancelStageRequest:14,grantStageAccess:15,denyStageAccess:16,roomPeerCount:17,joinStage:18,leaveStage:19,getConnectedRoomsDump:20,createConnectedRooms:21,deleteConnectedRooms:22,movePeers:23,transferPeer:24,movedPeer:25,connectedRoomsUpdated:26,connectedRoomsDeleted:27,getAllAddedParticipants:28,broadcastMessage:29,kick:30,kickAll:31,transcript:32,getWaitingRoomRequests:33,acceptWaitingRoomRequests:34,waitingRoomRequestAccepted:35,denyWaitingRoomRequests:36,waitingRoomRequestDenied:37,peerStageStatusUpdate:38,broadcastToEntity:39,recordingStarted:40,recordingStopped:41,recordingPaused:42,getRoomStageState:43,livestreamingInvoked:44},Lc={getMessages:0,sendMessageToRoom:1,sendMessageToPeers:2,editMessage:3,deleteMessage:4,getPaginatedMessages:5,sendMessageToChannel:6,searchChannelMessages:7,getAllChatChannels:8,markChannelIndexAsRead:9,pinMessage:10},Ac={getPlugins:0,addPlugin:1,enablePluginForRoom:2,disablePluginForPeers:3,enablePluginForPeers:4,disablePluginForRoom:5,removePlugin:6,customPluginEventToRoom:7,customPluginEventToPeers:8,storeInsertKeys:9,storeGetKeys:10,storeDeleteKeys:11,storeDelete:12},Bc={createPoll:0,getPolls:1,votePoll:2,updatePoll:3},gn={unknown:0,createWebRTCTransport:1,produce:2,consume:3,toggleProducer:4,toggleConsumer:5,closeProducer:6,closeConsumer:7,joinRoom:16,leaveRoom:17,selectedPeer:18,globalPinPeer:19,selfJoinComplete:20,peerJoinedBroadcast:25,peerLeaveBroadcast:26,peerProducerCreateBroadcast:27,peerProducerToggleBroadcast:28,peerProducerCloseBroadcast:29,globalPeerPinBroadcast:30,recordingStartedBroadcast:31,recordingStoppedBroadcast:32,peerDisplayNameEditBroadcast:33,mediaRoomTerminationBroadcastResponse:36,selectedPeerDiff:40,renegotiateSessionDescription:50,errorResponse:60,kickPeer:90,kickAll:91,changeDisplayName:92,hostControlPeer:93,hostControlAllPeers:94,audioActivity:100},Dc={createChatChannel:0,getChatChannel:1,deprecatedGetAllChatChannels:2,getChannelMembers:3,updateChatChannel:4},Fc={getUserPresets:0,updateUserPreset:1};function se(e,t){return Object.keys(t).reduce((n,s)=>(n[s]=(e<<16)+t[s],n),{})}function Tn(e,t){return Object.keys(e).reduce((n,s)=>(n[s]=t|e[s],n),{})}const Te=se(xc,Pc);se(Oc,Lc);se(Sc,Ac);se(Nc,Bc);se(Ic,Dc);const Ze=Tn(gn,16777216);Tn(gn,50331648);se(Cc,Fc);const wn="ws://localhost:8080/ws";class Mc extends le.WebSocket{constructor(t,n){super(wn,n)}}var ce,rt,ot;class Uc{constructor(){Ke(this,ce,void 0),Ke(this,rt,[]),Ke(this,ot,15e3),R(this,"roomId","roomId"),R(this,"roomUuid","roomUuid"),R(this,"cleanBuffer",t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength))}init(t){window.WebSocket=Mc,hs(this,ce,t),new le.Server(wn,{mock:!1}).on("connection",n=>{ge(this,rt).push(n),this.addConnectionListeners(n)})}addConnectionListeners(t){t.on("message",n=>{if(n==="3")return;const s=At.fromBinary(n);let r;switch(s.event){case Te.joinRoom:{r=Mt.toBinary(Mt.fromJson({peer:{peerId:"self-peerId",userId:"self-userId",displayName:"name",waitlisted:!1,stageType:de.ON_STAGE}}));break}case Te.getRoomPeersInfo:{r=Bo.toBinary({peers:ge(this,ce).map(h=>fs(St({},h),{userId:h.peerId,waitlisted:!1,stageType:1}))});break}case Te.getRoomInfo:{r=Vo.toBinary({room:{roomId:this.roomId,title:"title",createdAt:Date.now(),activeRecordings:[],roomUuid:this.roomUuid}});break}case Ze.createWebRTCTransport:{r=ln.toBinary({transportId:"transportId",description:{type:"answer",sdp:"sdp",target:Oe.PUBLISHER},producerIds:[]});break}case Ze.selfJoinComplete:{const h=ge(this,ce).map(T=>St({producerStates:[]},T));r=jr.toBinary({maxPreferredStreams:6,participants:h,selectedPeers:{audioPeers:[],compulsoryPeers:[]},roomState:{displayTitle:"title",lockedMode:!1,roomUuid:this.roomUuid,roomName:this.roomUuid,currentPeerId:"self-peerid",pinnedPeerIds:[]}});break}case Te.getConnectedRoomsDump:{r=Qo.toBinary({parentMeeting:{participants:[]},meetings:[]});break}case Ze.produce:{r=Xr.toBinary({status:!0,producerId:"producer-id"});break}}const o={event:s.event,id:s.id,payload:r},l=At.toBinary(o),p=this.cleanBuffer(l);t.send(p)}),setInterval(()=>{t.send("2")},ge(this,ot))}}ce=new WeakMap,rt=new WeakMap,ot=new WeakMap;function qc(e){new Uc().init(e),window.RTCPeerConnection=Rs,window.fetch=()=>ks(this,null,function*(){const t=new window.Response(JSON.stringify({}),{status:200,headers:{"Content-type":"application/json"}});return Promise.resolve(t)})}exports.setupStubs=qc;