obi-sdk 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/obi-sdk.es.js +1 -1
- package/dist/obi-sdk.umd.js +1 -1
- package/package.json +1 -1
package/dist/obi-sdk.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css as _A, LitElement as HA, html as se, svg as ni, nothing as Zr } from "lit";
|
|
2
|
-
const Ws =
|
|
2
|
+
const Ws = {}.VITE_API_BASE_URL;
|
|
3
3
|
function Af(t) {
|
|
4
4
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
5
5
|
}
|
package/dist/obi-sdk.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ft,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("lit")):typeof define=="function"&&define.amd?define(["exports","lit"],_):(ft=typeof globalThis<"u"?globalThis:ft||self,_(ft.ObiSDK={},ft.lit))})(this,function(ft,_){"use strict";const qr="https://obi.getcor.io/api";function zh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ra={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,A="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(A=!1));function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function r(a,c,l,u,d){if(typeof l!="function")throw new TypeError("The listener must be a function");var h=new i(l,u||a,d),g=A?A+c:c;return a._events[g]?a._events[g].fn?a._events[g]=[a._events[g],h]:a._events[g].push(h):(a._events[g]=h,a._eventsCount++),a}function s(a,c){--a._eventsCount===0?a._events=new n:delete a._events[c]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],l,u;if(this._eventsCount===0)return c;for(u in l=this._events)e.call(l,u)&&c.push(A?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(l)):c},o.prototype.listeners=function(c){var l=A?A+c:c,u=this._events[l];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,h=u.length,g=new Array(h);d<h;d++)g[d]=u[d].fn;return g},o.prototype.listenerCount=function(c){var l=A?A+c:c,u=this._events[l];return u?u.fn?1:u.length:0},o.prototype.emit=function(c,l,u,d,h,g){var f=A?A+c:c;if(!this._events[f])return!1;var p=this._events[f],B=arguments.length,y,b;if(p.fn){switch(p.once&&this.removeListener(c,p.fn,void 0,!0),B){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,l),!0;case 3:return p.fn.call(p.context,l,u),!0;case 4:return p.fn.call(p.context,l,u,d),!0;case 5:return p.fn.call(p.context,l,u,d,h),!0;case 6:return p.fn.call(p.context,l,u,d,h,g),!0}for(b=1,y=new Array(B-1);b<B;b++)y[b-1]=arguments[b];p.fn.apply(p.context,y)}else{var v=p.length,C;for(b=0;b<v;b++)switch(p[b].once&&this.removeListener(c,p[b].fn,void 0,!0),B){case 1:p[b].fn.call(p[b].context);break;case 2:p[b].fn.call(p[b].context,l);break;case 3:p[b].fn.call(p[b].context,l,u);break;case 4:p[b].fn.call(p[b].context,l,u,d);break;default:if(!y)for(C=1,y=new Array(B-1);C<B;C++)y[C-1]=arguments[C];p[b].fn.apply(p[b].context,y)}}return!0},o.prototype.on=function(c,l,u){return r(this,c,l,u,!1)},o.prototype.once=function(c,l,u){return r(this,c,l,u,!0)},o.prototype.removeListener=function(c,l,u,d){var h=A?A+c:c;if(!this._events[h])return this;if(!l)return s(this,h),this;var g=this._events[h];if(g.fn)g.fn===l&&(!d||g.once)&&(!u||g.context===u)&&s(this,h);else{for(var f=0,p=[],B=g.length;f<B;f++)(g[f].fn!==l||d&&!g[f].once||u&&g[f].context!==u)&&p.push(g[f]);p.length?this._events[h]=p.length===1?p[0]:p:s(this,h)}return this},o.prototype.removeAllListeners=function(c){var l;return c?(l=A?A+c:c,this._events[l]&&s(this,l)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=A,o.EventEmitter=o,t.exports=o})(Ra);var Zh=Ra.exports;const ef=zh(Zh);function Af(t,e){return e.forEach(function(A){A&&typeof A!="string"&&!Array.isArray(A)&&Object.keys(A).forEach(function(n){if(n!=="default"&&!(n in t)){var i=Object.getOwnPropertyDescriptor(A,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return A[n]}})}})}),Object.freeze(t)}var tf=Object.defineProperty,nf=(t,e,A)=>e in t?tf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:A}):t[e]=A,xa=(t,e,A)=>nf(t,typeof e!="symbol"?e+"":e,A);let De=class{constructor(){xa(this,"_locking"),xa(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let e;const A=new Promise(i=>e=()=>{this._locks-=1,i()}),n=this._locking.then(()=>e);return this._locking=this._locking.then(()=>A),n}};function ae(t,e){if(!t)throw new Error(e)}const rf=34028234663852886e22,sf=-34028234663852886e22,of=4294967295,af=2147483647,cf=-2147483648;function ri(t){if(typeof t!="number")throw new Error("invalid int 32: "+typeof t);if(!Number.isInteger(t)||t>af||t<cf)throw new Error("invalid int 32: "+t)}function zr(t){if(typeof t!="number")throw new Error("invalid uint 32: "+typeof t);if(!Number.isInteger(t)||t>of||t<0)throw new Error("invalid uint 32: "+t)}function Pa(t){if(typeof t!="number")throw new Error("invalid float 32: "+typeof t);if(Number.isFinite(t)&&(t>rf||t<sf))throw new Error("invalid float 32: "+t)}const La=Symbol("@bufbuild/protobuf/enum-type");function lf(t){const e=t[La];return ae(e,"missing enum type on enum object"),e}function Da(t,e,A,n){t[La]=_a(e,A.map(i=>({no:i.no,name:i.name,localName:t[i.no]})))}function _a(t,e,A){const n=Object.create(null),i=Object.create(null),r=[];for(const s of e){const o=Ha(s);r.push(o),n[s.name]=o,i[s.no]=o}return{typeName:t,values:r,findName(s){return n[s]},findNumber(s){return i[s]}}}function uf(t,e,A){const n={};for(const i of e){const r=Ha(i);n[r.localName]=r.no,n[r.no]=r.localName}return Da(n,t,e),n}function Ha(t){return"localName"in t?t:Object.assign(Object.assign({},t),{localName:t.name})}class Zr{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,A){const n=this.getType(),i=n.runtime.bin,r=i.makeReadOptions(A);return i.readMessage(this,r.readerFactory(e),e.byteLength,r),this}fromJson(e,A){const n=this.getType(),i=n.runtime.json,r=i.makeReadOptions(A);return i.readMessage(n,e,r,this),this}fromJsonString(e,A){let n;try{n=JSON.parse(e)}catch(i){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(i instanceof Error?i.message:String(i)))}return this.fromJson(n,A)}toBinary(e){const A=this.getType(),n=A.runtime.bin,i=n.makeWriteOptions(e),r=i.writerFactory();return n.writeMessage(this,r,i),r.finish()}toJson(e){const A=this.getType(),n=A.runtime.json,i=n.makeWriteOptions(e);return n.writeMessage(this,i)}toJsonString(e){var A;const n=this.toJson(e);return JSON.stringify(n,null,(A=e==null?void 0:e.prettySpaces)!==null&&A!==void 0?A:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function df(t,e,A,n){var i;const r=(i=n==null?void 0:n.localName)!==null&&i!==void 0?i:e.substring(e.lastIndexOf(".")+1),s={[r]:function(o){t.util.initFields(this),t.util.initPartial(o,this)}}[r];return Object.setPrototypeOf(s.prototype,new Zr),Object.assign(s,{runtime:t,typeName:e,fields:t.util.newFieldList(A),fromBinary(o,a){return new s().fromBinary(o,a)},fromJson(o,a){return new s().fromJson(o,a)},fromJsonString(o,a){return new s().fromJsonString(o,a)},equals(o,a){return t.util.equals(s,o,a)}}),s}function hf(){let t=0,e=0;for(let n=0;n<28;n+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<n,!(i&128))return this.assertBounds(),[t,e]}let A=this.buf[this.pos++];if(t|=(A&15)<<28,e=(A&112)>>4,!(A&128))return this.assertBounds(),[t,e];for(let n=3;n<=31;n+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<n,!(i&128))return this.assertBounds(),[t,e]}throw new Error("invalid varint")}function es(t,e,A){for(let r=0;r<28;r=r+7){const s=t>>>r,o=!(!(s>>>7)&&e==0),a=(o?s|128:s)&255;if(A.push(a),!o)return}const n=t>>>28&15|(e&7)<<4,i=!!(e>>3);if(A.push((i?n|128:n)&255),!!i){for(let r=3;r<31;r=r+7){const s=e>>>r,o=!!(s>>>7),a=(o?s|128:s)&255;if(A.push(a),!o)return}A.push(e>>>31&1)}}const si=4294967296;function Oa(t){const e=t[0]==="-";e&&(t=t.slice(1));const A=1e6;let n=0,i=0;function r(s,o){const a=Number(t.slice(s,o));i*=A,n=n*A+a,n>=si&&(i=i+(n/si|0),n=n%si)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),e?Na(n,i):As(n,i)}function ff(t,e){let A=As(t,e);const n=A.hi&2147483648;n&&(A=Na(A.lo,A.hi));const i=Ma(A.lo,A.hi);return n?"-"+i:i}function Ma(t,e){if({lo:t,hi:e}=gf(t,e),e<=2097151)return String(si*e+t);const A=t&16777215,n=(t>>>24|e<<8)&16777215,i=e>>16&65535;let r=A+n*6777216+i*6710656,s=n+i*8147497,o=i*2;const a=1e7;return r>=a&&(s+=Math.floor(r/a),r%=a),s>=a&&(o+=Math.floor(s/a),s%=a),o.toString()+Ka(s)+Ka(r)}function gf(t,e){return{lo:t>>>0,hi:e>>>0}}function As(t,e){return{lo:t|0,hi:e|0}}function Na(t,e){return e=~e,t?t=~t+1:e+=1,As(t,e)}const Ka=t=>{const e=String(t);return"0000000".slice(e.length)+e};function Va(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let A=0;A<9;A++)e.push(t&127|128),t=t>>7;e.push(1)}}function pf(){let t=this.buf[this.pos++],e=t&127;if(!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,!(t&128))return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let A=5;t&128&&A<10;A++)t=this.buf[this.pos++];if(t&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function mf(){const t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const i=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),s=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){const c=typeof a=="bigint"?a:BigInt(a);if(c>r||c<i)throw new Error("int64 invalid: ".concat(a));return c},uParse(a){const c=typeof a=="bigint"?a:BigInt(a);if(c>o||c<s)throw new Error("uint64 invalid: ".concat(a));return c},enc(a){return t.setBigInt64(0,this.parse(a),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},uEnc(a){return t.setBigInt64(0,this.uParse(a),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},dec(a,c){return t.setInt32(0,a,!0),t.setInt32(4,c,!0),t.getBigInt64(0,!0)},uDec(a,c){return t.setInt32(0,a,!0),t.setInt32(4,c,!0),t.getBigUint64(0,!0)}}}const A=i=>ae(/^-?[0-9]+$/.test(i),"int64 invalid: ".concat(i)),n=i=>ae(/^[0-9]+$/.test(i),"uint64 invalid: ".concat(i));return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),A(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),n(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),A(i),Oa(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),n(i),Oa(i)},dec(i,r){return ff(i,r)},uDec(i,r){return Ma(i,r)}}}const re=mf();var S;(function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"})(S||(S={}));var OA;(function(t){t[t.BIGINT=0]="BIGINT",t[t.STRING=1]="STRING"})(OA||(OA={}));function MA(t,e,A){if(e===A)return!0;if(t==S.BYTES){if(!(e instanceof Uint8Array)||!(A instanceof Uint8Array)||e.length!==A.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==A[n])return!1;return!0}switch(t){case S.UINT64:case S.FIXED64:case S.INT64:case S.SFIXED64:case S.SINT64:return e==A}return!1}function Dt(t,e){switch(t){case S.BOOL:return!1;case S.UINT64:case S.FIXED64:case S.INT64:case S.SFIXED64:case S.SINT64:return e==0?re.zero:"0";case S.DOUBLE:case S.FLOAT:return 0;case S.BYTES:return new Uint8Array(0);case S.STRING:return"";default:return 0}}function Ga(t,e){switch(t){case S.BOOL:return e===!1;case S.STRING:return e==="";case S.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var de;(function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"})(de||(de={}));class Bf{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let A=new Uint8Array(e),n=0;for(let i=0;i<this.chunks.length;i++)A.set(this.chunks[i],n),n+=this.chunks[i].length;return this.chunks=[],A}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),A=this.stack.pop();if(!A)throw new Error("invalid state, fork stack empty");return this.chunks=A.chunks,this.buf=A.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,A){return this.uint32((e<<3|A)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(zr(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return ri(e),Va(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let A=this.textEncoder.encode(e);return this.uint32(A.byteLength),this.raw(A)}float(e){Pa(e);let A=new Uint8Array(4);return new DataView(A.buffer).setFloat32(0,e,!0),this.raw(A)}double(e){let A=new Uint8Array(8);return new DataView(A.buffer).setFloat64(0,e,!0),this.raw(A)}fixed32(e){zr(e);let A=new Uint8Array(4);return new DataView(A.buffer).setUint32(0,e,!0),this.raw(A)}sfixed32(e){ri(e);let A=new Uint8Array(4);return new DataView(A.buffer).setInt32(0,e,!0),this.raw(A)}sint32(e){return ri(e),e=(e<<1^e>>31)>>>0,Va(e,this.buf),this}sfixed64(e){let A=new Uint8Array(8),n=new DataView(A.buffer),i=re.enc(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(A)}fixed64(e){let A=new Uint8Array(8),n=new DataView(A.buffer),i=re.uEnc(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(A)}int64(e){let A=re.enc(e);return es(A.lo,A.hi,this.buf),this}sint64(e){let A=re.enc(e),n=A.hi>>31,i=A.lo<<1^n,r=(A.hi<<1|A.lo>>>31)^n;return es(i,r,this.buf),this}uint64(e){let A=re.uEnc(e);return es(A.lo,A.hi,this.buf),this}}class vf{constructor(e,A){this.varint64=hf,this.uint32=pf,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=A??new TextDecoder}tag(){let e=this.uint32(),A=e>>>3,n=e&7;if(A<=0||n<0||n>5)throw new Error("illegal tag: field no "+A+" wire type "+n);return[A,n]}skip(e,A){let n=this.pos;switch(e){case de.Varint:for(;this.buf[this.pos++]&128;);break;case de.Bit64:this.pos+=4;case de.Bit32:this.pos+=4;break;case de.LengthDelimited:let i=this.uint32();this.pos+=i;break;case de.StartGroup:for(;;){const[r,s]=this.tag();if(s===de.EndGroup){if(A!==void 0&&r!==A)throw new Error("invalid end group tag");break}this.skip(s,r)}break;default:throw new Error("cant skip wire type "+e)}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 e=this.uint32();return e>>>1^-(e&1)}int64(){return re.dec(...this.varint64())}uint64(){return re.uDec(...this.varint64())}sint64(){let[e,A]=this.varint64(),n=-(e&1);return e=(e>>>1|(A&1)<<31)^n,A=A>>>1^n,re.dec(e,A)}bool(){let[e,A]=this.varint64();return e!==0||A!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return re.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return re.dec(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 e=this.uint32(),A=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(A,A+e)}string(){return this.textDecoder.decode(this.bytes())}}function Cf(t,e,A,n){let i;return{typeName:e,extendee:A,get field(){if(!i){const r=typeof n=="function"?n():n;r.name=e.split(".").pop(),r.jsonName="[".concat(e,"]"),i=t.util.newFieldList([r]).list()[0]}return i},runtime:t}}function ja(t){const e=t.field.localName,A=Object.create(null);return A[e]=wf(t),[A,()=>A[e]]}function wf(t){const e=t.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return Dt(e.T,e.L);case"message":const A=e.T,n=new A;return A.fieldWrapper?A.fieldWrapper.unwrapField(n):n;case"map":throw"map fields are not allowed to be extensions"}}function yf(t,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let A=t.length-1;A>=0;--A)if(t[A].no==e.no)return[t[A]];return[]}return t.filter(A=>A.no===e.no)}let SA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),oi=[];for(let t=0;t<SA.length;t++)oi[SA[t].charCodeAt(0)]=t;oi["-".charCodeAt(0)]=SA.indexOf("+"),oi["_".charCodeAt(0)]=SA.indexOf("/");const Wa={dec(t){let e=t.length*3/4;t[t.length-2]=="="?e-=2:t[t.length-1]=="="&&(e-=1);let A=new Uint8Array(e),n=0,i=0,r,s=0;for(let o=0;o<t.length;o++){if(r=oi[t.charCodeAt(o)],r===void 0)switch(t[o]){case"=":i=0;case`
|
|
1
|
+
(function(ft,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("lit")):typeof define=="function"&&define.amd?define(["exports","lit"],_):(ft=typeof globalThis<"u"?globalThis:ft||self,_(ft.ObiSDK={},ft.lit))})(this,function(ft,_){"use strict";const qr={}.VITE_API_BASE_URL;function zh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ra={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,A="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(A=!1));function i(a,c,l){this.fn=a,this.context=c,this.once=l||!1}function r(a,c,l,u,d){if(typeof l!="function")throw new TypeError("The listener must be a function");var h=new i(l,u||a,d),g=A?A+c:c;return a._events[g]?a._events[g].fn?a._events[g]=[a._events[g],h]:a._events[g].push(h):(a._events[g]=h,a._eventsCount++),a}function s(a,c){--a._eventsCount===0?a._events=new n:delete a._events[c]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],l,u;if(this._eventsCount===0)return c;for(u in l=this._events)e.call(l,u)&&c.push(A?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(l)):c},o.prototype.listeners=function(c){var l=A?A+c:c,u=this._events[l];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,h=u.length,g=new Array(h);d<h;d++)g[d]=u[d].fn;return g},o.prototype.listenerCount=function(c){var l=A?A+c:c,u=this._events[l];return u?u.fn?1:u.length:0},o.prototype.emit=function(c,l,u,d,h,g){var f=A?A+c:c;if(!this._events[f])return!1;var p=this._events[f],B=arguments.length,y,b;if(p.fn){switch(p.once&&this.removeListener(c,p.fn,void 0,!0),B){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,l),!0;case 3:return p.fn.call(p.context,l,u),!0;case 4:return p.fn.call(p.context,l,u,d),!0;case 5:return p.fn.call(p.context,l,u,d,h),!0;case 6:return p.fn.call(p.context,l,u,d,h,g),!0}for(b=1,y=new Array(B-1);b<B;b++)y[b-1]=arguments[b];p.fn.apply(p.context,y)}else{var v=p.length,C;for(b=0;b<v;b++)switch(p[b].once&&this.removeListener(c,p[b].fn,void 0,!0),B){case 1:p[b].fn.call(p[b].context);break;case 2:p[b].fn.call(p[b].context,l);break;case 3:p[b].fn.call(p[b].context,l,u);break;case 4:p[b].fn.call(p[b].context,l,u,d);break;default:if(!y)for(C=1,y=new Array(B-1);C<B;C++)y[C-1]=arguments[C];p[b].fn.apply(p[b].context,y)}}return!0},o.prototype.on=function(c,l,u){return r(this,c,l,u,!1)},o.prototype.once=function(c,l,u){return r(this,c,l,u,!0)},o.prototype.removeListener=function(c,l,u,d){var h=A?A+c:c;if(!this._events[h])return this;if(!l)return s(this,h),this;var g=this._events[h];if(g.fn)g.fn===l&&(!d||g.once)&&(!u||g.context===u)&&s(this,h);else{for(var f=0,p=[],B=g.length;f<B;f++)(g[f].fn!==l||d&&!g[f].once||u&&g[f].context!==u)&&p.push(g[f]);p.length?this._events[h]=p.length===1?p[0]:p:s(this,h)}return this},o.prototype.removeAllListeners=function(c){var l;return c?(l=A?A+c:c,this._events[l]&&s(this,l)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=A,o.EventEmitter=o,t.exports=o})(Ra);var Zh=Ra.exports;const ef=zh(Zh);function Af(t,e){return e.forEach(function(A){A&&typeof A!="string"&&!Array.isArray(A)&&Object.keys(A).forEach(function(n){if(n!=="default"&&!(n in t)){var i=Object.getOwnPropertyDescriptor(A,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return A[n]}})}})}),Object.freeze(t)}var tf=Object.defineProperty,nf=(t,e,A)=>e in t?tf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:A}):t[e]=A,xa=(t,e,A)=>nf(t,typeof e!="symbol"?e+"":e,A);let De=class{constructor(){xa(this,"_locking"),xa(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let e;const A=new Promise(i=>e=()=>{this._locks-=1,i()}),n=this._locking.then(()=>e);return this._locking=this._locking.then(()=>A),n}};function ae(t,e){if(!t)throw new Error(e)}const rf=34028234663852886e22,sf=-34028234663852886e22,of=4294967295,af=2147483647,cf=-2147483648;function ri(t){if(typeof t!="number")throw new Error("invalid int 32: "+typeof t);if(!Number.isInteger(t)||t>af||t<cf)throw new Error("invalid int 32: "+t)}function zr(t){if(typeof t!="number")throw new Error("invalid uint 32: "+typeof t);if(!Number.isInteger(t)||t>of||t<0)throw new Error("invalid uint 32: "+t)}function Pa(t){if(typeof t!="number")throw new Error("invalid float 32: "+typeof t);if(Number.isFinite(t)&&(t>rf||t<sf))throw new Error("invalid float 32: "+t)}const La=Symbol("@bufbuild/protobuf/enum-type");function lf(t){const e=t[La];return ae(e,"missing enum type on enum object"),e}function Da(t,e,A,n){t[La]=_a(e,A.map(i=>({no:i.no,name:i.name,localName:t[i.no]})))}function _a(t,e,A){const n=Object.create(null),i=Object.create(null),r=[];for(const s of e){const o=Ha(s);r.push(o),n[s.name]=o,i[s.no]=o}return{typeName:t,values:r,findName(s){return n[s]},findNumber(s){return i[s]}}}function uf(t,e,A){const n={};for(const i of e){const r=Ha(i);n[r.localName]=r.no,n[r.no]=r.localName}return Da(n,t,e),n}function Ha(t){return"localName"in t?t:Object.assign(Object.assign({},t),{localName:t.name})}class Zr{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,A){const n=this.getType(),i=n.runtime.bin,r=i.makeReadOptions(A);return i.readMessage(this,r.readerFactory(e),e.byteLength,r),this}fromJson(e,A){const n=this.getType(),i=n.runtime.json,r=i.makeReadOptions(A);return i.readMessage(n,e,r,this),this}fromJsonString(e,A){let n;try{n=JSON.parse(e)}catch(i){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(i instanceof Error?i.message:String(i)))}return this.fromJson(n,A)}toBinary(e){const A=this.getType(),n=A.runtime.bin,i=n.makeWriteOptions(e),r=i.writerFactory();return n.writeMessage(this,r,i),r.finish()}toJson(e){const A=this.getType(),n=A.runtime.json,i=n.makeWriteOptions(e);return n.writeMessage(this,i)}toJsonString(e){var A;const n=this.toJson(e);return JSON.stringify(n,null,(A=e==null?void 0:e.prettySpaces)!==null&&A!==void 0?A:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function df(t,e,A,n){var i;const r=(i=n==null?void 0:n.localName)!==null&&i!==void 0?i:e.substring(e.lastIndexOf(".")+1),s={[r]:function(o){t.util.initFields(this),t.util.initPartial(o,this)}}[r];return Object.setPrototypeOf(s.prototype,new Zr),Object.assign(s,{runtime:t,typeName:e,fields:t.util.newFieldList(A),fromBinary(o,a){return new s().fromBinary(o,a)},fromJson(o,a){return new s().fromJson(o,a)},fromJsonString(o,a){return new s().fromJsonString(o,a)},equals(o,a){return t.util.equals(s,o,a)}}),s}function hf(){let t=0,e=0;for(let n=0;n<28;n+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<n,!(i&128))return this.assertBounds(),[t,e]}let A=this.buf[this.pos++];if(t|=(A&15)<<28,e=(A&112)>>4,!(A&128))return this.assertBounds(),[t,e];for(let n=3;n<=31;n+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<n,!(i&128))return this.assertBounds(),[t,e]}throw new Error("invalid varint")}function es(t,e,A){for(let r=0;r<28;r=r+7){const s=t>>>r,o=!(!(s>>>7)&&e==0),a=(o?s|128:s)&255;if(A.push(a),!o)return}const n=t>>>28&15|(e&7)<<4,i=!!(e>>3);if(A.push((i?n|128:n)&255),!!i){for(let r=3;r<31;r=r+7){const s=e>>>r,o=!!(s>>>7),a=(o?s|128:s)&255;if(A.push(a),!o)return}A.push(e>>>31&1)}}const si=4294967296;function Oa(t){const e=t[0]==="-";e&&(t=t.slice(1));const A=1e6;let n=0,i=0;function r(s,o){const a=Number(t.slice(s,o));i*=A,n=n*A+a,n>=si&&(i=i+(n/si|0),n=n%si)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),e?Na(n,i):As(n,i)}function ff(t,e){let A=As(t,e);const n=A.hi&2147483648;n&&(A=Na(A.lo,A.hi));const i=Ma(A.lo,A.hi);return n?"-"+i:i}function Ma(t,e){if({lo:t,hi:e}=gf(t,e),e<=2097151)return String(si*e+t);const A=t&16777215,n=(t>>>24|e<<8)&16777215,i=e>>16&65535;let r=A+n*6777216+i*6710656,s=n+i*8147497,o=i*2;const a=1e7;return r>=a&&(s+=Math.floor(r/a),r%=a),s>=a&&(o+=Math.floor(s/a),s%=a),o.toString()+Ka(s)+Ka(r)}function gf(t,e){return{lo:t>>>0,hi:e>>>0}}function As(t,e){return{lo:t|0,hi:e|0}}function Na(t,e){return e=~e,t?t=~t+1:e+=1,As(t,e)}const Ka=t=>{const e=String(t);return"0000000".slice(e.length)+e};function Va(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let A=0;A<9;A++)e.push(t&127|128),t=t>>7;e.push(1)}}function pf(){let t=this.buf[this.pos++],e=t&127;if(!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,!(t&128))return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let A=5;t&128&&A<10;A++)t=this.buf[this.pos++];if(t&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function mf(){const t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(typeof process!="object"||typeof process.env!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){const i=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),s=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){const c=typeof a=="bigint"?a:BigInt(a);if(c>r||c<i)throw new Error("int64 invalid: ".concat(a));return c},uParse(a){const c=typeof a=="bigint"?a:BigInt(a);if(c>o||c<s)throw new Error("uint64 invalid: ".concat(a));return c},enc(a){return t.setBigInt64(0,this.parse(a),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},uEnc(a){return t.setBigInt64(0,this.uParse(a),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},dec(a,c){return t.setInt32(0,a,!0),t.setInt32(4,c,!0),t.getBigInt64(0,!0)},uDec(a,c){return t.setInt32(0,a,!0),t.setInt32(4,c,!0),t.getBigUint64(0,!0)}}}const A=i=>ae(/^-?[0-9]+$/.test(i),"int64 invalid: ".concat(i)),n=i=>ae(/^[0-9]+$/.test(i),"uint64 invalid: ".concat(i));return{zero:"0",supported:!1,parse(i){return typeof i!="string"&&(i=i.toString()),A(i),i},uParse(i){return typeof i!="string"&&(i=i.toString()),n(i),i},enc(i){return typeof i!="string"&&(i=i.toString()),A(i),Oa(i)},uEnc(i){return typeof i!="string"&&(i=i.toString()),n(i),Oa(i)},dec(i,r){return ff(i,r)},uDec(i,r){return Ma(i,r)}}}const re=mf();var S;(function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"})(S||(S={}));var OA;(function(t){t[t.BIGINT=0]="BIGINT",t[t.STRING=1]="STRING"})(OA||(OA={}));function MA(t,e,A){if(e===A)return!0;if(t==S.BYTES){if(!(e instanceof Uint8Array)||!(A instanceof Uint8Array)||e.length!==A.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==A[n])return!1;return!0}switch(t){case S.UINT64:case S.FIXED64:case S.INT64:case S.SFIXED64:case S.SINT64:return e==A}return!1}function Dt(t,e){switch(t){case S.BOOL:return!1;case S.UINT64:case S.FIXED64:case S.INT64:case S.SFIXED64:case S.SINT64:return e==0?re.zero:"0";case S.DOUBLE:case S.FLOAT:return 0;case S.BYTES:return new Uint8Array(0);case S.STRING:return"";default:return 0}}function Ga(t,e){switch(t){case S.BOOL:return e===!1;case S.STRING:return e==="";case S.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var de;(function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"})(de||(de={}));class Bf{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let A=new Uint8Array(e),n=0;for(let i=0;i<this.chunks.length;i++)A.set(this.chunks[i],n),n+=this.chunks[i].length;return this.chunks=[],A}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),A=this.stack.pop();if(!A)throw new Error("invalid state, fork stack empty");return this.chunks=A.chunks,this.buf=A.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,A){return this.uint32((e<<3|A)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(zr(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return ri(e),Va(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let A=this.textEncoder.encode(e);return this.uint32(A.byteLength),this.raw(A)}float(e){Pa(e);let A=new Uint8Array(4);return new DataView(A.buffer).setFloat32(0,e,!0),this.raw(A)}double(e){let A=new Uint8Array(8);return new DataView(A.buffer).setFloat64(0,e,!0),this.raw(A)}fixed32(e){zr(e);let A=new Uint8Array(4);return new DataView(A.buffer).setUint32(0,e,!0),this.raw(A)}sfixed32(e){ri(e);let A=new Uint8Array(4);return new DataView(A.buffer).setInt32(0,e,!0),this.raw(A)}sint32(e){return ri(e),e=(e<<1^e>>31)>>>0,Va(e,this.buf),this}sfixed64(e){let A=new Uint8Array(8),n=new DataView(A.buffer),i=re.enc(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(A)}fixed64(e){let A=new Uint8Array(8),n=new DataView(A.buffer),i=re.uEnc(e);return n.setInt32(0,i.lo,!0),n.setInt32(4,i.hi,!0),this.raw(A)}int64(e){let A=re.enc(e);return es(A.lo,A.hi,this.buf),this}sint64(e){let A=re.enc(e),n=A.hi>>31,i=A.lo<<1^n,r=(A.hi<<1|A.lo>>>31)^n;return es(i,r,this.buf),this}uint64(e){let A=re.uEnc(e);return es(A.lo,A.hi,this.buf),this}}class vf{constructor(e,A){this.varint64=hf,this.uint32=pf,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=A??new TextDecoder}tag(){let e=this.uint32(),A=e>>>3,n=e&7;if(A<=0||n<0||n>5)throw new Error("illegal tag: field no "+A+" wire type "+n);return[A,n]}skip(e,A){let n=this.pos;switch(e){case de.Varint:for(;this.buf[this.pos++]&128;);break;case de.Bit64:this.pos+=4;case de.Bit32:this.pos+=4;break;case de.LengthDelimited:let i=this.uint32();this.pos+=i;break;case de.StartGroup:for(;;){const[r,s]=this.tag();if(s===de.EndGroup){if(A!==void 0&&r!==A)throw new Error("invalid end group tag");break}this.skip(s,r)}break;default:throw new Error("cant skip wire type "+e)}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 e=this.uint32();return e>>>1^-(e&1)}int64(){return re.dec(...this.varint64())}uint64(){return re.uDec(...this.varint64())}sint64(){let[e,A]=this.varint64(),n=-(e&1);return e=(e>>>1|(A&1)<<31)^n,A=A>>>1^n,re.dec(e,A)}bool(){let[e,A]=this.varint64();return e!==0||A!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return re.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return re.dec(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 e=this.uint32(),A=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(A,A+e)}string(){return this.textDecoder.decode(this.bytes())}}function Cf(t,e,A,n){let i;return{typeName:e,extendee:A,get field(){if(!i){const r=typeof n=="function"?n():n;r.name=e.split(".").pop(),r.jsonName="[".concat(e,"]"),i=t.util.newFieldList([r]).list()[0]}return i},runtime:t}}function ja(t){const e=t.field.localName,A=Object.create(null);return A[e]=wf(t),[A,()=>A[e]]}function wf(t){const e=t.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return Dt(e.T,e.L);case"message":const A=e.T,n=new A;return A.fieldWrapper?A.fieldWrapper.unwrapField(n):n;case"map":throw"map fields are not allowed to be extensions"}}function yf(t,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let A=t.length-1;A>=0;--A)if(t[A].no==e.no)return[t[A]];return[]}return t.filter(A=>A.no===e.no)}let SA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),oi=[];for(let t=0;t<SA.length;t++)oi[SA[t].charCodeAt(0)]=t;oi["-".charCodeAt(0)]=SA.indexOf("+"),oi["_".charCodeAt(0)]=SA.indexOf("/");const Wa={dec(t){let e=t.length*3/4;t[t.length-2]=="="?e-=2:t[t.length-1]=="="&&(e-=1);let A=new Uint8Array(e),n=0,i=0,r,s=0;for(let o=0;o<t.length;o++){if(r=oi[t.charCodeAt(o)],r===void 0)switch(t[o]){case"=":i=0;case`
|
|
2
2
|
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:s=r,i=1;break;case 1:A[n++]=s<<2|(r&48)>>4,s=r,i=2;break;case 2:A[n++]=(s&15)<<4|(r&60)>>2,s=r,i=3;break;case 3:A[n++]=(s&3)<<6|r,i=0;break}}if(i==1)throw Error("invalid base64 string.");return A.subarray(0,n)},enc(t){let e="",A=0,n,i=0;for(let r=0;r<t.length;r++)switch(n=t[r],A){case 0:e+=SA[n>>2],i=(n&3)<<4,A=1;break;case 1:e+=SA[i|n>>4],i=(n&15)<<2,A=2;break;case 2:e+=SA[i|n>>6],e+=SA[n&63],A=0;break}return A&&(e+=SA[i],e+="=",A==1&&(e+="=")),e}};function bf(t,e,A){Xa(e,t);const n=e.runtime.bin.makeReadOptions(A),i=yf(t.getType().runtime.bin.listUnknownFields(t),e.field),[r,s]=ja(e);for(const o of i)e.runtime.bin.readField(r,n.readerFactory(o.data),e.field,o.wireType,n);return s()}function Uf(t,e,A,n){Xa(e,t);const i=e.runtime.bin.makeReadOptions(n),r=e.runtime.bin.makeWriteOptions(n);if(Ja(t,e)){const c=t.getType().runtime.bin.listUnknownFields(t).filter(l=>l.no!=e.field.no);t.getType().runtime.bin.discardUnknownFields(t);for(const l of c)t.getType().runtime.bin.onUnknownField(t,l.no,l.wireType,l.data)}const s=r.writerFactory();let o=e.field;!o.opt&&!o.repeated&&(o.kind=="enum"||o.kind=="scalar")&&(o=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(o,A,s,r);const a=i.readerFactory(s.finish());for(;a.pos<a.len;){const[c,l]=a.tag(),u=a.skip(l,c);t.getType().runtime.bin.onUnknownField(t,c,l,u)}}function Ja(t,e){const A=t.getType();return e.extendee.typeName===A.typeName&&!!A.runtime.bin.listUnknownFields(t).find(n=>n.no==e.field.no)}function Xa(t,e){ae(t.extendee.typeName==e.getType().typeName,"extension ".concat(t.typeName," can only be applied to message ").concat(t.extendee.typeName))}function $a(t,e){const A=t.localName;if(t.repeated)return e[A].length>0;if(t.oneof)return e[t.oneof.localName].case===A;switch(t.kind){case"enum":case"scalar":return t.opt||t.req?e[A]!==void 0:t.kind=="enum"?e[A]!==t.T.values[0].no:!Ga(t.T,e[A]);case"message":return e[A]!==void 0;case"map":return Object.keys(e[A]).length>0}}function Ya(t,e){const A=t.localName,n=!t.opt&&!t.req;if(t.repeated)e[A]=[];else if(t.oneof)e[t.oneof.localName]={case:void 0};else switch(t.kind){case"map":e[A]={};break;case"enum":e[A]=n?t.T.values[0].no:void 0;break;case"scalar":e[A]=n?Dt(t.T,t.L):void 0;break;case"message":e[A]=void 0;break}}function gt(t,e){if(t===null||typeof t!="object"||!Object.getOwnPropertyNames(Zr.prototype).every(n=>n in t&&typeof t[n]=="function"))return!1;const A=t.getType();return A===null||typeof A!="function"||!("typeName"in A)||typeof A.typeName!="string"?!1:e===void 0?!0:A.typeName==e.typeName}function qa(t,e){return gt(e)||!t.fieldWrapper?e:t.fieldWrapper.wrapField(e)}S.DOUBLE,S.FLOAT,S.INT64,S.UINT64,S.INT32,S.UINT32,S.BOOL,S.STRING,S.BYTES;const za={ignoreUnknownFields:!1},Za={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function Qf(t){return t?Object.assign(Object.assign({},za),t):za}function Ef(t){return t?Object.assign(Object.assign({},Za),t):Za}const ai=Symbol(),ci=Symbol();function Sf(){return{makeReadOptions:Qf,makeWriteOptions:Ef,readMessage(t,e,A,n){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error("cannot decode message ".concat(t.typeName," from JSON: ").concat(gA(e)));n=n??new t;const i=new Map,r=A.typeRegistry;for(const[s,o]of Object.entries(e)){const a=t.fields.findJsonName(s);if(a){if(a.oneof){if(o===null&&a.kind=="scalar")continue;const c=i.get(a.oneof);if(c!==void 0)throw new Error("cannot decode message ".concat(t.typeName,' from JSON: multiple keys for oneof "').concat(a.oneof.name,'" present: "').concat(c,'", "').concat(s,'"'));i.set(a.oneof,s)}ec(n,o,a,A,t)}else{let c=!1;if(r!=null&&r.findExtension&&s.startsWith("[")&&s.endsWith("]")){const l=r.findExtension(s.substring(1,s.length-1));if(l&&l.extendee.typeName==t.typeName){c=!0;const[u,d]=ja(l);ec(u,o,l.field,A,l),Uf(n,l,d(),A)}}if(!c&&!A.ignoreUnknownFields)throw new Error("cannot decode message ".concat(t.typeName,' from JSON: key "').concat(s,'" is unknown'))}}return n},writeMessage(t,e){const A=t.getType(),n={};let i;try{for(i of A.fields.byNumber()){if(!$a(i,t)){if(i.req)throw"required field not set";if(!e.emitDefaultValues||!Ff(i))continue}const s=i.oneof?t[i.oneof.localName].value:t[i.localName],o=Ac(i,s,e);o!==void 0&&(n[e.useProtoFieldName?i.name:i.jsonName]=o)}const r=e.typeRegistry;if(r!=null&&r.findExtensionFor)for(const s of A.runtime.bin.listUnknownFields(t)){const o=r.findExtensionFor(A.typeName,s.no);if(o&&Ja(t,o)){const a=bf(t,o,e),c=Ac(o.field,a,e);c!==void 0&&(n[o.field.jsonName]=c)}}}catch(r){const s=i?"cannot encode field ".concat(A.typeName,".").concat(i.name," to JSON"):"cannot encode message ".concat(A.typeName," to JSON"),o=r instanceof Error?r.message:String(r);throw new Error(s+(o.length>0?": ".concat(o):""))}return n},readScalar(t,e,A){return gn(t,e,A??OA.BIGINT,!0)},writeScalar(t,e,A){if(e!==void 0&&(A||Ga(t,e)))return li(t,e)},debug:gA}}function gA(t){if(t===null)return"null";switch(typeof t){case"object":return Array.isArray(t)?"array":"object";case"string":return t.length>100?"string":'"'.concat(t.split('"').join('\\"'),'"');default:return String(t)}}function ec(t,e,A,n,i){let r=A.localName;if(A.repeated){if(ae(A.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(e)));const s=t[r];for(const o of e){if(o===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(o)));switch(A.kind){case"message":s.push(A.T.fromJson(o,n));break;case"enum":const a=ts(A.T,o,n.ignoreUnknownFields,!0);a!==ci&&s.push(a);break;case"scalar":try{s.push(gn(A.T,o,A.L,!0))}catch(c){let l="cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(o));throw c instanceof Error&&c.message.length>0&&(l+=": ".concat(c.message)),new Error(l)}break}}}else if(A.kind=="map"){if(e===null)return;if(typeof e!="object"||Array.isArray(e))throw new Error("cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(e)));const s=t[r];for(const[o,a]of Object.entries(e)){if(a===null)throw new Error("cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: map value null"));let c;try{c=Tf(A.K,o)}catch(l){let u="cannot decode map key for field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(e));throw l instanceof Error&&l.message.length>0&&(u+=": ".concat(l.message)),new Error(u)}switch(A.V.kind){case"message":s[c]=A.V.T.fromJson(a,n);break;case"enum":const l=ts(A.V.T,a,n.ignoreUnknownFields,!0);l!==ci&&(s[c]=l);break;case"scalar":try{s[c]=gn(A.V.T,a,OA.BIGINT,!0)}catch(u){let d="cannot decode map value for field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(e));throw u instanceof Error&&u.message.length>0&&(d+=": ".concat(u.message)),new Error(d)}break}}}else switch(A.oneof&&(t=t[A.oneof.localName]={case:r},r="value"),A.kind){case"message":const s=A.T;if(e===null&&s.typeName!="google.protobuf.Value")return;let o=t[r];gt(o)?o.fromJson(e,n):(t[r]=o=s.fromJson(e,n),s.fieldWrapper&&!A.oneof&&(t[r]=s.fieldWrapper.unwrapField(o)));break;case"enum":const a=ts(A.T,e,n.ignoreUnknownFields,!1);switch(a){case ai:Ya(A,t);break;case ci:break;default:t[r]=a;break}break;case"scalar":try{const c=gn(A.T,e,A.L,!1);switch(c){case ai:Ya(A,t);break;default:t[r]=c;break}}catch(c){let l="cannot decode field ".concat(i.typeName,".").concat(A.name," from JSON: ").concat(gA(e));throw c instanceof Error&&c.message.length>0&&(l+=": ".concat(c.message)),new Error(l)}break}}function Tf(t,e){if(t===S.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return gn(t,e,OA.BIGINT,!0).toString()}function gn(t,e,A,n){if(e===null)return n?Dt(t,A):ai;switch(t){case S.DOUBLE:case S.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;const i=Number(e);if(Number.isNaN(i)||!Number.isFinite(i))break;return t==S.FLOAT&&Pa(i),i;case S.INT32:case S.FIXED32:case S.SFIXED32:case S.SINT32:case S.UINT32:let r;if(typeof e=="number"?r=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(r=Number(e)),r===void 0)break;return t==S.UINT32||t==S.FIXED32?zr(r):ri(r),r;case S.INT64:case S.SFIXED64:case S.SINT64:if(typeof e!="number"&&typeof e!="string")break;const s=re.parse(e);return A?s.toString():s;case S.FIXED64:case S.UINT64:if(typeof e!="number"&&typeof e!="string")break;const o=re.uParse(e);return A?o.toString():o;case S.BOOL:if(typeof e!="boolean")break;return e;case S.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case S.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return Wa.dec(e)}throw new Error}function ts(t,e,A,n){if(e===null)return t.typeName=="google.protobuf.NullValue"?0:n?t.values[0].no:ai;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const i=t.findName(e);if(i!==void 0)return i.no;if(A)return ci;break}throw new Error("cannot decode enum ".concat(t.typeName," from JSON: ").concat(gA(e)))}function Ff(t){return t.repeated||t.kind=="map"?!0:!(t.oneof||t.kind=="message"||t.opt||t.req)}function Ac(t,e,A){if(t.kind=="map"){ae(typeof e=="object"&&e!=null);const n={},i=Object.entries(e);switch(t.V.kind){case"scalar":for(const[s,o]of i)n[s.toString()]=li(t.V.T,o);break;case"message":for(const[s,o]of i)n[s.toString()]=o.toJson(A);break;case"enum":const r=t.V.T;for(const[s,o]of i)n[s.toString()]=ns(r,o,A.enumAsInteger);break}return A.emitDefaultValues||i.length>0?n:void 0}if(t.repeated){ae(Array.isArray(e));const n=[];switch(t.kind){case"scalar":for(let i=0;i<e.length;i++)n.push(li(t.T,e[i]));break;case"enum":for(let i=0;i<e.length;i++)n.push(ns(t.T,e[i],A.enumAsInteger));break;case"message":for(let i=0;i<e.length;i++)n.push(e[i].toJson(A));break}return A.emitDefaultValues||n.length>0?n:void 0}switch(t.kind){case"scalar":return li(t.T,e);case"enum":return ns(t.T,e,A.enumAsInteger);case"message":return qa(t.T,e).toJson(A)}}function ns(t,e,A){var n;if(ae(typeof e=="number"),t.typeName=="google.protobuf.NullValue")return null;if(A)return e;const i=t.findNumber(e);return(n=i==null?void 0:i.name)!==null&&n!==void 0?n:e}function li(t,e){switch(t){case S.INT32:case S.SFIXED32:case S.SINT32:case S.FIXED32:case S.UINT32:return ae(typeof e=="number"),e;case S.FLOAT:case S.DOUBLE:return ae(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case S.STRING:return ae(typeof e=="string"),e;case S.BOOL:return ae(typeof e=="boolean"),e;case S.UINT64:case S.FIXED64:case S.INT64:case S.SFIXED64:case S.SINT64:return ae(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case S.BYTES:return ae(e instanceof Uint8Array),Wa.enc(e)}}const _t=Symbol("@bufbuild/protobuf/unknown-fields"),tc={readUnknownFields:!0,readerFactory:t=>new vf(t)},nc={writeUnknownFields:!0,writerFactory:()=>new Bf};function kf(t){return t?Object.assign(Object.assign({},tc),t):tc}function If(t){return t?Object.assign(Object.assign({},nc),t):nc}function Rf(){return{makeReadOptions:kf,makeWriteOptions:If,listUnknownFields(t){var e;return(e=t[_t])!==null&&e!==void 0?e:[]},discardUnknownFields(t){delete t[_t]},writeUnknownFields(t,e){const n=t[_t];if(n)for(const i of n)e.tag(i.no,i.wireType).raw(i.data)},onUnknownField(t,e,A,n){const i=t;Array.isArray(i[_t])||(i[_t]=[]),i[_t].push({no:e,wireType:A,data:n})},readMessage(t,e,A,n,i){const r=t.getType(),s=i?e.len:e.pos+A;let o,a;for(;e.pos<s&&([o,a]=e.tag(),!(i===!0&&a==de.EndGroup));){const c=r.fields.find(o);if(!c){const l=e.skip(a,o);n.readUnknownFields&&this.onUnknownField(t,o,a,l);continue}ic(t,e,c,a,n)}if(i&&(a!=de.EndGroup||o!==A))throw new Error("invalid end group tag")},readField:ic,writeMessage(t,e,A){const n=t.getType();for(const i of n.fields.byNumber()){if(!$a(i,t)){if(i.req)throw new Error("cannot encode field ".concat(n.typeName,".").concat(i.name," to binary: required field not set"));continue}const r=i.oneof?t[i.oneof.localName].value:t[i.localName];rc(i,r,e,A)}return A.writeUnknownFields&&this.writeUnknownFields(t,e),e},writeField(t,e,A,n){e!==void 0&&rc(t,e,A,n)}}}function ic(t,e,A,n,i){let{repeated:r,localName:s}=A;switch(A.oneof&&(t=t[A.oneof.localName],t.case!=s&&delete t.value,t.case=s,s="value"),A.kind){case"scalar":case"enum":const o=A.kind=="enum"?S.INT32:A.T;let a=di;if(A.kind=="scalar"&&A.L>0&&(a=Pf),r){let d=t[s];if(n==de.LengthDelimited&&o!=S.STRING&&o!=S.BYTES){let g=e.uint32()+e.pos;for(;e.pos<g;)d.push(a(e,o))}else d.push(a(e,o))}else t[s]=a(e,o);break;case"message":const c=A.T;r?t[s].push(ui(e,new c,i,A)):gt(t[s])?ui(e,t[s],i,A):(t[s]=ui(e,new c,i,A),c.fieldWrapper&&!A.oneof&&!A.repeated&&(t[s]=c.fieldWrapper.unwrapField(t[s])));break;case"map":let[l,u]=xf(A,e,i);t[s][l]=u;break}}function ui(t,e,A,n){const i=e.getType().runtime.bin,r=n==null?void 0:n.delimited;return i.readMessage(e,t,r?n.no:t.uint32(),A,r),e}function xf(t,e,A){const n=e.uint32(),i=e.pos+n;let r,s;for(;e.pos<i;){const[o]=e.tag();switch(o){case 1:r=di(e,t.K);break;case 2:switch(t.V.kind){case"scalar":s=di(e,t.V.T);break;case"enum":s=e.int32();break;case"message":s=ui(e,new t.V.T,A,void 0);break}break}}if(r===void 0&&(r=Dt(t.K,OA.BIGINT)),typeof r!="string"&&typeof r!="number"&&(r=r.toString()),s===void 0)switch(t.V.kind){case"scalar":s=Dt(t.V.T,OA.BIGINT);break;case"enum":s=t.V.T.values[0].no;break;case"message":s=new t.V.T;break}return[r,s]}function Pf(t,e){const A=di(t,e);return typeof A=="bigint"?A.toString():A}function di(t,e){switch(e){case S.STRING:return t.string();case S.BOOL:return t.bool();case S.DOUBLE:return t.double();case S.FLOAT:return t.float();case S.INT32:return t.int32();case S.INT64:return t.int64();case S.UINT64:return t.uint64();case S.FIXED64:return t.fixed64();case S.BYTES:return t.bytes();case S.FIXED32:return t.fixed32();case S.SFIXED32:return t.sfixed32();case S.SFIXED64:return t.sfixed64();case S.SINT64:return t.sint64();case S.UINT32:return t.uint32();case S.SINT32:return t.sint32()}}function rc(t,e,A,n){ae(e!==void 0);const i=t.repeated;switch(t.kind){case"scalar":case"enum":let r=t.kind=="enum"?S.INT32:t.T;if(i)if(ae(Array.isArray(e)),t.packed)Df(A,r,t.no,e);else for(const s of e)pn(A,r,t.no,s);else pn(A,r,t.no,e);break;case"message":if(i){ae(Array.isArray(e));for(const s of e)sc(A,n,t,s)}else sc(A,n,t,e);break;case"map":ae(typeof e=="object"&&e!=null);for(const[s,o]of Object.entries(e))Lf(A,n,t,s,o);break}}function Lf(t,e,A,n,i){t.tag(A.no,de.LengthDelimited),t.fork();let r=n;switch(A.K){case S.INT32:case S.FIXED32:case S.UINT32:case S.SFIXED32:case S.SINT32:r=Number.parseInt(n);break;case S.BOOL:ae(n=="true"||n=="false"),r=n=="true";break}switch(pn(t,A.K,1,r),A.V.kind){case"scalar":pn(t,A.V.T,2,i);break;case"enum":pn(t,S.INT32,2,i);break;case"message":ae(i!==void 0),t.tag(2,de.LengthDelimited).bytes(i.toBinary(e));break}t.join()}function sc(t,e,A,n){const i=qa(A.T,n);A.delimited?t.tag(A.no,de.StartGroup).raw(i.toBinary(e)).tag(A.no,de.EndGroup):t.tag(A.no,de.LengthDelimited).bytes(i.toBinary(e))}function pn(t,e,A,n){ae(n!==void 0);let[i,r]=oc(e);t.tag(A,i)[r](n)}function Df(t,e,A,n){if(!n.length)return;t.tag(A,de.LengthDelimited).fork();let[,i]=oc(e);for(let r=0;r<n.length;r++)t[i](n[r]);t.join()}function oc(t){let e=de.Varint;switch(t){case S.BYTES:case S.STRING:e=de.LengthDelimited;break;case S.DOUBLE:case S.FIXED64:case S.SFIXED64:e=de.Bit64;break;case S.FIXED32:case S.SFIXED32:case S.FLOAT:e=de.Bit32;break}const A=S[t].toLowerCase();return[e,A]}function _f(){return{setEnumType:Da,initPartial(t,e){if(t===void 0)return;const A=e.getType();for(const n of A.fields.byMember()){const i=n.localName,r=e,s=t;if(s[i]!=null)switch(n.kind){case"oneof":const o=s[i].case;if(o===void 0)continue;const a=n.findField(o);let c=s[i].value;a&&a.kind=="message"&&!gt(c,a.T)?c=new a.T(c):a&&a.kind==="scalar"&&a.T===S.BYTES&&(c=mn(c)),r[i]={case:o,value:c};break;case"scalar":case"enum":let l=s[i];n.T===S.BYTES&&(l=n.repeated?l.map(mn):mn(l)),r[i]=l;break;case"map":switch(n.V.kind){case"scalar":case"enum":if(n.V.T===S.BYTES)for(const[h,g]of Object.entries(s[i]))r[i][h]=mn(g);else Object.assign(r[i],s[i]);break;case"message":const d=n.V.T;for(const h of Object.keys(s[i])){let g=s[i][h];d.fieldWrapper||(g=new d(g)),r[i][h]=g}break}break;case"message":const u=n.T;if(n.repeated)r[i]=s[i].map(d=>gt(d,u)?d:new u(d));else{const d=s[i];u.fieldWrapper?u.typeName==="google.protobuf.BytesValue"?r[i]=mn(d):r[i]=d:r[i]=gt(d,u)?d:new u(d)}break}}},equals(t,e,A){return e===A?!0:!e||!A?!1:t.fields.byMember().every(n=>{const i=e[n.localName],r=A[n.localName];if(n.repeated){if(i.length!==r.length)return!1;switch(n.kind){case"message":return i.every((s,o)=>n.T.equals(s,r[o]));case"scalar":return i.every((s,o)=>MA(n.T,s,r[o]));case"enum":return i.every((s,o)=>MA(S.INT32,s,r[o]))}throw new Error("repeated cannot contain ".concat(n.kind))}switch(n.kind){case"message":return n.T.equals(i,r);case"enum":return MA(S.INT32,i,r);case"scalar":return MA(n.T,i,r);case"oneof":if(i.case!==r.case)return!1;const s=n.findField(i.case);if(s===void 0)return!0;switch(s.kind){case"message":return s.T.equals(i.value,r.value);case"enum":return MA(S.INT32,i.value,r.value);case"scalar":return MA(s.T,i.value,r.value)}throw new Error("oneof cannot contain ".concat(s.kind));case"map":const o=Object.keys(i).concat(Object.keys(r));switch(n.V.kind){case"message":const a=n.V.T;return o.every(l=>a.equals(i[l],r[l]));case"enum":return o.every(l=>MA(S.INT32,i[l],r[l]));case"scalar":const c=n.V.T;return o.every(l=>MA(c,i[l],r[l]))}break}})},clone(t){const e=t.getType(),A=new e,n=A;for(const i of e.fields.byMember()){const r=t[i.localName];let s;if(i.repeated)s=r.map(hi);else if(i.kind=="map"){s=n[i.localName];for(const[o,a]of Object.entries(r))s[o]=hi(a)}else i.kind=="oneof"?s=i.findField(r.case)?{case:r.case,value:hi(r.value)}:{case:void 0}:s=hi(r);n[i.localName]=s}for(const i of e.runtime.bin.listUnknownFields(t))e.runtime.bin.onUnknownField(n,i.no,i.wireType,i.data);return A}}}function hi(t){if(t===void 0)return t;if(gt(t))return t.clone();if(t instanceof Uint8Array){const e=new Uint8Array(t.byteLength);return e.set(t),e}return t}function mn(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function Hf(t,e,A){return{syntax:t,json:Sf(),bin:Rf(),util:Object.assign(Object.assign({},_f()),{newFieldList:e,initFields:A}),makeMessageType(n,i,r){return df(this,n,i,r)},makeEnum:uf,makeEnumType:_a,getEnumType:lf,makeExtension(n,i,r){return Cf(this,n,i,r)}}}class Of{constructor(e,A){this._fields=e,this._normalizer=A}findJsonName(e){if(!this.jsonNames){const A={};for(const n of this.list())A[n.jsonName]=A[n.name]=n;this.jsonNames=A}return this.jsonNames[e]}find(e){if(!this.numbers){const A={};for(const n of this.list())A[n.no]=n;this.numbers=A}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,A)=>e.no-A.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let A;for(const n of this.list())n.oneof?n.oneof!==A&&(A=n.oneof,e.push(A)):e.push(n)}return this.members}}function ac(t,e){const A=cc(t);return e?A:jf(Gf(A))}function Mf(t){return ac(t,!1)}const Nf=cc;function cc(t){let e=!1;const A=[];for(let n=0;n<t.length;n++){let i=t.charAt(n);switch(i){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":A.push(i),e=!1;break;default:e&&(e=!1,i=i.toUpperCase()),A.push(i);break}}return A.join("")}const Kf=new Set(["constructor","toString","toJSON","valueOf"]),Vf=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),lc=t=>"".concat(t,"$"),Gf=t=>Vf.has(t)?lc(t):t,jf=t=>Kf.has(t)?lc(t):t;class Wf{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=Mf(e)}addField(e){ae(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let A=0;A<this.fields.length;A++)this._lookup[this.fields[A].localName]=this.fields[A]}return this._lookup[e]}}function Jf(t,e){var A,n,i,r,s,o;const a=[];let c;for(const l of typeof t=="function"?t():t){const u=l;if(u.localName=ac(l.name,l.oneof!==void 0),u.jsonName=(A=l.jsonName)!==null&&A!==void 0?A:Nf(l.name),u.repeated=(n=l.repeated)!==null&&n!==void 0?n:!1,l.kind=="scalar"&&(u.L=(i=l.L)!==null&&i!==void 0?i:OA.BIGINT),u.delimited=(r=l.delimited)!==null&&r!==void 0?r:!1,u.req=(s=l.req)!==null&&s!==void 0?s:!1,u.opt=(o=l.opt)!==null&&o!==void 0?o:!1,l.packed===void 0&&(u.packed=l.kind=="enum"||l.kind=="scalar"&&l.T!=S.BYTES&&l.T!=S.STRING),l.oneof!==void 0){const d=typeof l.oneof=="string"?l.oneof:l.oneof.name;(!c||c.name!=d)&&(c=new Wf(d)),u.oneof=c,c.addField(u)}a.push(u)}return a}const U=Hf("proto3",t=>new Of(t,e=>Jf(e)),t=>{for(const e of t.getType().fields.byMember()){if(e.opt)continue;const A=e.localName,n=t;if(e.repeated){n[A]=[];continue}switch(e.kind){case"oneof":n[A]={case:void 0};break;case"enum":n[A]=0;break;case"map":n[A]={};break;case"scalar":n[A]=Dt(e.T,e.L);break}}});class _e extends Zr{constructor(e){super(),this.seconds=re.zero,this.nanos=0,U.util.initPartial(e,this)}fromJson(e,A){if(typeof e!="string")throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(U.json.debug(e)));const n=e.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(!n)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const i=Date.parse(n[1]+"-"+n[2]+"-"+n[3]+"T"+n[4]+":"+n[5]+":"+n[6]+(n[8]?n[8]:"Z"));if(Number.isNaN(i))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=re.parse(i/1e3),this.nanos=0,n[7]&&(this.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9),this}toJson(e){const A=Number(this.seconds)*1e3;if(A<Date.parse("0001-01-01T00:00:00Z")||A>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let n="Z";if(this.nanos>0){const i=(this.nanos+1e9).toString().substring(1);i.substring(3)==="000000"?n="."+i.substring(0,3)+"Z":i.substring(6)==="000"?n="."+i.substring(0,6)+"Z":n="."+i+"Z"}return new Date(A).toISOString().replace(".000Z",n)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return _e.fromDate(new Date)}static fromDate(e){const A=e.getTime();return new _e({seconds:re.parse(Math.floor(A/1e3)),nanos:A%1e3*1e6})}static fromBinary(e,A){return new _e().fromBinary(e,A)}static fromJson(e,A){return new _e().fromJson(e,A)}static fromJsonString(e,A){return new _e().fromJsonString(e,A)}static equals(e,A){return U.util.equals(_e,e,A)}}_e.runtime=U,_e.typeName="google.protobuf.Timestamp",_e.fields=U.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);const Xf=U.makeMessageType("livekit.MetricsBatch",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:_e},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:$f,repeated:!0},{no:5,name:"events",kind:"message",T:qf,repeated:!0}]),$f=U.makeMessageType("livekit.TimeSeriesMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:Yf,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]),Yf=U.makeMessageType("livekit.MetricSample",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:_e},{no:3,name:"value",kind:"scalar",T:2}]),qf=U.makeMessageType("livekit.EventMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:_e},{no:7,name:"normalized_end_timestamp",kind:"message",T:_e,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]),uc=U.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),tA=U.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),ge=U.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),Ht=U.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),Bn=U.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),vn=U.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),nA=U.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"},{no:13,name:"SIP_TRUNK_FAILURE"},{no:14,name:"CONNECTION_TIMEOUT"}]),Ot=U.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),zf=U.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),iA=U.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"},{no:6,name:"TF_PRECONNECT_BUFFER"}]),fi=U.makeMessageType("livekit.Room",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:15,name:"creation_time_ms",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:gi,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:Uc}]),gi=U.makeMessageType("livekit.Codec",()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]),Zf=U.makeMessageType("livekit.ParticipantPermission",()=>[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:U.getEnumType(ge),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8}]),pt=U.makeMessageType("livekit.ParticipantInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:U.getEnumType(Mt)},{no:4,name:"tracks",kind:"message",T:Nt,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:17,name:"joined_at_ms",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:Zf},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:U.getEnumType(pi)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:U.getEnumType(nA)},{no:18,name:"kind_details",kind:"enum",T:U.getEnumType(eg),repeated:!0}]),Mt=U.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),pi=U.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),eg=U.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"}]),je=U.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),Ag=U.makeMessageType("livekit.SimulcastCodecInfo",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:mt,repeated:!0}]),Nt=U.makeMessageType("livekit.TrackInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:U.getEnumType(tA)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:U.getEnumType(ge)},{no:10,name:"layers",kind:"message",T:mt,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:Ag,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:U.getEnumType(je)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:Uc},{no:19,name:"audio_features",kind:"enum",T:U.getEnumType(iA),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:U.getEnumType(uc)}]),mt=U.makeMessageType("livekit.VideoLayer",()=>[{no:1,name:"quality",kind:"enum",T:U.getEnumType(Ht)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13}]),He=U.makeMessageType("livekit.DataPacket",()=>[{no:1,name:"kind",kind:"enum",T:U.getEnumType(W)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:hc,oneof:"value"},{no:3,name:"speaker",kind:"message",T:tg,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:fc,oneof:"value"},{no:7,name:"transcription",kind:"message",T:ng,oneof:"value"},{no:8,name:"metrics",kind:"message",T:Xf,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:is,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:gc,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:pc,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:mc,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:ss,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:os,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:as,oneof:"value"}]),W=U.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),tg=U.makeMessageType("livekit.ActiveSpeakerUpdate",()=>[{no:1,name:"speakers",kind:"message",T:dc,repeated:!0}]),dc=U.makeMessageType("livekit.SpeakerInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]),hc=U.makeMessageType("livekit.UserPacket",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0},{no:11,name:"nonce",kind:"scalar",T:12}]),fc=U.makeMessageType("livekit.SipDTMF",()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]),ng=U.makeMessageType("livekit.Transcription",()=>[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:ig,repeated:!0}]),ig=U.makeMessageType("livekit.TranscriptionSegment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]),is=U.makeMessageType("livekit.ChatMessage",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]),gc=U.makeMessageType("livekit.RpcRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13}]),pc=U.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),mc=U.makeMessageType("livekit.RpcResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:Bc,oneof:"value"}]),Bc=U.makeMessageType("livekit.RpcError",()=>[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]),vc=U.makeMessageType("livekit.ParticipantTracks",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]),rg=U.makeMessageType("livekit.ServerInfo",()=>[{no:1,name:"edition",kind:"enum",T:U.getEnumType(Cc)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]),Cc=U.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),sg=U.makeMessageType("livekit.ClientInfo",()=>[{no:1,name:"sdk",kind:"enum",T:U.getEnumType(wc)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9}]),wc=U.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"},{no:13,name:"UNREAL"}]),yc=U.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:bc},{no:2,name:"screen",kind:"message",T:bc},{no:3,name:"resume_connection",kind:"enum",T:U.getEnumType(vn)},{no:4,name:"disabled_codecs",kind:"message",T:og},{no:5,name:"force_relay",kind:"enum",T:U.getEnumType(vn)}]),bc=U.makeMessageType("livekit.VideoConfiguration",()=>[{no:1,name:"hardware_encoder",kind:"enum",T:U.getEnumType(vn)}]),og=U.makeMessageType("livekit.DisabledCodecs",()=>[{no:1,name:"codecs",kind:"message",T:gi,repeated:!0},{no:2,name:"publish",kind:"message",T:gi,repeated:!0}]),Uc=U.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),rs=U.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),Qc=U.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:U.getEnumType(rs)},{no:2,name:"version",kind:"scalar",T:5},{no:3,name:"reply_to_stream_id",kind:"scalar",T:9},{no:4,name:"attached_stream_ids",kind:"scalar",T:9,repeated:!0},{no:5,name:"generated",kind:"scalar",T:8}],{localName:"DataStream_TextHeader"}),Ec=U.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),ss=U.makeMessageType("livekit.DataStream.Header",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"topic",kind:"scalar",T:9},{no:4,name:"mime_type",kind:"scalar",T:9},{no:5,name:"total_length",kind:"scalar",T:4,opt:!0},{no:7,name:"encryption_type",kind:"enum",T:U.getEnumType(je)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:Qc,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:Ec,oneof:"content_header"}],{localName:"DataStream_Header"}),os=U.makeMessageType("livekit.DataStream.Chunk",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"chunk_index",kind:"scalar",T:4},{no:3,name:"content",kind:"scalar",T:12},{no:4,name:"version",kind:"scalar",T:5},{no:5,name:"iv",kind:"scalar",T:12,opt:!0}],{localName:"DataStream_Chunk"}),as=U.makeMessageType("livekit.DataStream.Trailer",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"reason",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}}],{localName:"DataStream_Trailer"}),rA=U.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),cs=U.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),ag=U.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),cg=U.makeMessageType("livekit.SignalRequest",()=>[{no:1,name:"offer",kind:"message",T:Bt,oneof:"message"},{no:2,name:"answer",kind:"message",T:Bt,oneof:"message"},{no:3,name:"trickle",kind:"message",T:ds,oneof:"message"},{no:4,name:"add_track",kind:"message",T:us,oneof:"message"},{no:5,name:"mute",kind:"message",T:hs,oneof:"message"},{no:6,name:"subscription",kind:"message",T:mi,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:Tc,oneof:"message"},{no:8,name:"leave",kind:"message",T:Bi,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:kc,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:Pc,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:Lc,oneof:"message"},{no:13,name:"simulate",kind:"message",T:pA,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:Ic,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:_c,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:Fc,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:fg,oneof:"message"}]),Sc=U.makeMessageType("livekit.SignalResponse",()=>[{no:1,name:"join",kind:"message",T:lg,oneof:"message"},{no:2,name:"answer",kind:"message",T:Bt,oneof:"message"},{no:3,name:"offer",kind:"message",T:Bt,oneof:"message"},{no:4,name:"trickle",kind:"message",T:ds,oneof:"message"},{no:5,name:"update",kind:"message",T:hg,oneof:"message"},{no:6,name:"track_published",kind:"message",T:fs,oneof:"message"},{no:8,name:"leave",kind:"message",T:Bi,oneof:"message"},{no:9,name:"mute",kind:"message",T:hs,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:gg,oneof:"message"},{no:11,name:"room_update",kind:"message",T:pg,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:Bg,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:Cg,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:yg,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:bg,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:dg,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:ug,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:Qg,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:Tg,oneof:"message"},{no:22,name:"request_response",kind:"message",T:Fg,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:kg,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:Ug,oneof:"message"}]),ls=U.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}]),us=U.makeMessageType("livekit.AddTrackRequest",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:U.getEnumType(tA)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:U.getEnumType(ge)},{no:9,name:"layers",kind:"message",T:mt,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:ls,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:U.getEnumType(je)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:U.getEnumType(uc)},{no:17,name:"audio_features",kind:"enum",T:U.getEnumType(iA),repeated:!0}]),ds=U.makeMessageType("livekit.TrickleRequest",()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:U.getEnumType(rA)},{no:3,name:"final",kind:"scalar",T:8}]),hs=U.makeMessageType("livekit.MuteTrackRequest",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]),lg=U.makeMessageType("livekit.JoinResponse",()=>[{no:1,name:"room",kind:"message",T:fi},{no:2,name:"participant",kind:"message",T:pt},{no:3,name:"other_participants",kind:"message",T:pt,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:Rc,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:yc},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:rg},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:gi,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]),ug=U.makeMessageType("livekit.ReconnectResponse",()=>[{no:1,name:"ice_servers",kind:"message",T:Rc,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:yc}]),fs=U.makeMessageType("livekit.TrackPublishedResponse",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:Nt}]),dg=U.makeMessageType("livekit.TrackUnpublishedResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),Bt=U.makeMessageType("livekit.SessionDescription",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9}]),hg=U.makeMessageType("livekit.ParticipantUpdate",()=>[{no:1,name:"participants",kind:"message",T:pt,repeated:!0}]),mi=U.makeMessageType("livekit.UpdateSubscription",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:vc,repeated:!0}]),Tc=U.makeMessageType("livekit.UpdateTrackSettings",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:U.getEnumType(Ht)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]),Fc=U.makeMessageType("livekit.UpdateLocalAudioTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:U.getEnumType(iA),repeated:!0}]),fg=U.makeMessageType("livekit.UpdateLocalVideoTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]),Bi=U.makeMessageType("livekit.LeaveRequest",()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:U.getEnumType(nA)},{no:3,name:"action",kind:"enum",T:U.getEnumType(Kt)},{no:4,name:"regions",kind:"message",T:Eg}]),Kt=U.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),kc=U.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:mt,repeated:!0}]),Ic=U.makeMessageType("livekit.UpdateParticipantMetadata",()=>[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]),Rc=U.makeMessageType("livekit.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),gg=U.makeMessageType("livekit.SpeakersChanged",()=>[{no:1,name:"speakers",kind:"message",T:dc,repeated:!0}]),pg=U.makeMessageType("livekit.RoomUpdate",()=>[{no:1,name:"room",kind:"message",T:fi}]),mg=U.makeMessageType("livekit.ConnectionQualityInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:U.getEnumType(Bn)},{no:3,name:"score",kind:"scalar",T:2}]),Bg=U.makeMessageType("livekit.ConnectionQualityUpdate",()=>[{no:1,name:"updates",kind:"message",T:mg,repeated:!0}]),vg=U.makeMessageType("livekit.StreamStateInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:U.getEnumType(cs)}]),Cg=U.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:vg,repeated:!0}]),gs=U.makeMessageType("livekit.SubscribedQuality",()=>[{no:1,name:"quality",kind:"enum",T:U.getEnumType(Ht)},{no:2,name:"enabled",kind:"scalar",T:8}]),wg=U.makeMessageType("livekit.SubscribedCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:gs,repeated:!0}]),yg=U.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:gs,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:wg,repeated:!0}]),xc=U.makeMessageType("livekit.TrackPermission",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]),Pc=U.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:xc,repeated:!0}]),bg=U.makeMessageType("livekit.SubscriptionPermissionUpdate",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]),Ug=U.makeMessageType("livekit.RoomMovedResponse",()=>[{no:1,name:"room",kind:"message",T:fi},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:pt},{no:4,name:"other_participants",kind:"message",T:pt,repeated:!0}]),Lc=U.makeMessageType("livekit.SyncState",()=>[{no:1,name:"answer",kind:"message",T:Bt},{no:2,name:"subscription",kind:"message",T:mi},{no:3,name:"publish_tracks",kind:"message",T:fs,repeated:!0},{no:4,name:"data_channels",kind:"message",T:Dc,repeated:!0},{no:5,name:"offer",kind:"message",T:Bt},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}]),Dc=U.makeMessageType("livekit.DataChannelInfo",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:U.getEnumType(rA)}]),pA=U.makeMessageType("livekit.SimulateScenario",()=>[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:U.getEnumType(ag),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]),_c=U.makeMessageType("livekit.Ping",()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]),Qg=U.makeMessageType("livekit.Pong",()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]),Eg=U.makeMessageType("livekit.RegionSettings",()=>[{no:1,name:"regions",kind:"message",T:Sg,repeated:!0}]),Sg=U.makeMessageType("livekit.RegionInfo",()=>[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]),Tg=U.makeMessageType("livekit.SubscriptionResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:U.getEnumType(zf)}]),Fg=U.makeMessageType("livekit.RequestResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:U.getEnumType(ps)},{no:3,name:"message",kind:"scalar",T:9}]),ps=U.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),kg=U.makeMessageType("livekit.TrackSubscribed",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]);function Ig(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vi={exports:{}},Rg=vi.exports,Hc;function xg(){return Hc||(Hc=1,function(t){(function(e,A){t.exports?t.exports=A():e.log=A()})(Rg,function(){var e=function(){},A="undefined",n=typeof window!==A&&typeof window.navigator!==A&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],r={},s=null;function o(f,p){var B=f[p];if(typeof B.bind=="function")return B.bind(f);try{return Function.prototype.bind.call(B,f)}catch{return function(){return Function.prototype.apply.apply(B,[f,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(f){return f==="debug"&&(f="log"),typeof console===A?!1:f==="trace"&&n?a:console[f]!==void 0?o(console,f):console.log!==void 0?o(console,"log"):e}function l(){for(var f=this.getLevel(),p=0;p<i.length;p++){var B=i[p];this[B]=p<f?e:this.methodFactory(B,f,this.name)}if(this.log=this.debug,typeof console===A&&f<this.levels.SILENT)return"No console available for logging"}function u(f){return function(){typeof console!==A&&(l.call(this),this[f].apply(this,arguments))}}function d(f,p,B){return c(f)||u.apply(this,arguments)}function h(f,p){var B=this,y,b,v,C="loglevel";typeof f=="string"?C+=":"+f:typeof f=="symbol"&&(C=void 0);function w(H){var M=(i[H]||"silent").toUpperCase();if(!(typeof window===A||!C)){try{window.localStorage[C]=M;return}catch{}try{window.document.cookie=encodeURIComponent(C)+"="+M+";"}catch{}}}function Q(){var H;if(!(typeof window===A||!C)){try{H=window.localStorage[C]}catch{}if(typeof H===A)try{var M=window.document.cookie,ee=encodeURIComponent(C),Xe=M.indexOf(ee+"=");Xe!==-1&&(H=/^([^;]+)/.exec(M.slice(Xe+ee.length+1))[1])}catch{}return B.levels[H]===void 0&&(H=void 0),H}}function F(){if(!(typeof window===A||!C)){try{window.localStorage.removeItem(C)}catch{}try{window.document.cookie=encodeURIComponent(C)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function R(H){var M=H;if(typeof M=="string"&&B.levels[M.toUpperCase()]!==void 0&&(M=B.levels[M.toUpperCase()]),typeof M=="number"&&M>=0&&M<=B.levels.SILENT)return M;throw new TypeError("log.setLevel() called with invalid level: "+H)}B.name=f,B.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},B.methodFactory=p||d,B.getLevel=function(){return v??b??y},B.setLevel=function(H,M){return v=R(H),M!==!1&&w(v),l.call(B)},B.setDefaultLevel=function(H){b=R(H),Q()||B.setLevel(H,!1)},B.resetLevel=function(){v=null,F(),l.call(B)},B.enableAll=function(H){B.setLevel(B.levels.TRACE,H)},B.disableAll=function(H){B.setLevel(B.levels.SILENT,H)},B.rebuild=function(){if(s!==B&&(y=R(s.getLevel())),l.call(B),s===B)for(var H in r)r[H].rebuild()},y=R(s?s.getLevel():"WARN");var D=Q();D!=null&&(v=R(D)),l.call(B)}s=new h,s.getLogger=function(p){if(typeof p!="symbol"&&typeof p!="string"||p==="")throw new TypeError("You must supply a name when creating a logger.");var B=r[p];return B||(B=r[p]=new h(p,s.methodFactory)),B};var g=typeof window!==A?window.log:void 0;return s.noConflict=function(){return typeof window!==A&&window.log===s&&(window.log=g),s},s.getLoggers=function(){return r},s.default=s,s})}(vi)),vi.exports}var Ci=xg(),ms;(function(t){t[t.trace=0]="trace",t[t.debug=1]="debug",t[t.info=2]="info",t[t.warn=3]="warn",t[t.error=4]="error",t[t.silent=5]="silent"})(ms||(ms={}));var sA;(function(t){t.Default="livekit",t.Room="livekit-room",t.Participant="livekit-participant",t.Track="livekit-track",t.Publication="livekit-track-publication",t.Engine="livekit-engine",t.Signal="livekit-signal",t.PCManager="livekit-pc-manager",t.PCTransport="livekit-pc-transport",t.E2EE="lk-e2ee"})(sA||(sA={}));let K=Ci.getLogger("livekit");Object.values(sA).map(t=>Ci.getLogger(t)),K.setDefaultLevel(ms.info);function TA(t){const e=Ci.getLogger(t);return e.setDefaultLevel(K.getLevel()),e}const Pg=Ci.getLogger("lk-e2ee"),Cn=7e3,Lg=[0,300,2*2*300,3*3*300,4*4*300,Cn,Cn,Cn,Cn,Cn];class Dg{constructor(e){this._retryDelays=e!==void 0?[...e]:Lg}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const A=this._retryDelays[e.retryCount];return e.retryCount<=1?A:A+Math.random()*1e3}}function _g(t,e){var A={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(A[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(A[n[i]]=t[n[i]]);return A}function m(t,e,A,n){function i(r){return r instanceof A?r:new A(function(s){s(r)})}return new(A||(A=Promise))(function(r,s){function o(l){try{c(n.next(l))}catch(u){s(u)}}function a(l){try{c(n.throw(l))}catch(u){s(u)}}function c(l){l.done?r(l.value):i(l.value).then(o,a)}c((n=n.apply(t,e||[])).next())})}function Oc(t){var e=typeof Symbol=="function"&&Symbol.iterator,A=e&&t[e],n=0;if(A)return A.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function NA(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],A;return e?e.call(t):(t=typeof Oc=="function"?Oc(t):t[Symbol.iterator](),A={},n("next"),n("throw"),n("return"),A[Symbol.asyncIterator]=function(){return this},A);function n(r){A[r]=t[r]&&function(s){return new Promise(function(o,a){s=t[r](s),i(o,a,s.done,s.value)})}}function i(r,s,o,a){Promise.resolve(a).then(function(c){r({value:c,done:o})},s)}}typeof SuppressedError=="function"&&SuppressedError;var wi={exports:{}},Mc;function Hg(){if(Mc)return wi.exports;Mc=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(C,w,Q){return Function.prototype.apply.call(C,w,Q)},A;t&&typeof t.ownKeys=="function"?A=t.ownKeys:Object.getOwnPropertySymbols?A=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:A=function(C){return Object.getOwnPropertyNames(C)};function n(v){console&&console.warn&&console.warn(v)}var i=Number.isNaN||function(C){return C!==C};function r(){r.init.call(this)}wi.exports=r,wi.exports.once=B,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var s=10;function o(v){if(typeof v!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(v){if(typeof v!="number"||v<0||i(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");s=v}}),r.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},r.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function a(v){return v._maxListeners===void 0?r.defaultMaxListeners:v._maxListeners}r.prototype.getMaxListeners=function(){return a(this)},r.prototype.emit=function(C){for(var w=[],Q=1;Q<arguments.length;Q++)w.push(arguments[Q]);var F=C==="error",R=this._events;if(R!==void 0)F=F&&R.error===void 0;else if(!F)return!1;if(F){var D;if(w.length>0&&(D=w[0]),D instanceof Error)throw D;var H=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw H.context=D,H}var M=R[C];if(M===void 0)return!1;if(typeof M=="function")e(M,this,w);else for(var ee=M.length,Xe=g(M,ee),Q=0;Q<ee;++Q)e(Xe[Q],this,w);return!0};function c(v,C,w,Q){var F,R,D;if(o(w),R=v._events,R===void 0?(R=v._events=Object.create(null),v._eventsCount=0):(R.newListener!==void 0&&(v.emit("newListener",C,w.listener?w.listener:w),R=v._events),D=R[C]),D===void 0)D=R[C]=w,++v._eventsCount;else if(typeof D=="function"?D=R[C]=Q?[w,D]:[D,w]:Q?D.unshift(w):D.push(w),F=a(v),F>0&&D.length>F&&!D.warned){D.warned=!0;var H=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");H.name="MaxListenersExceededWarning",H.emitter=v,H.type=C,H.count=D.length,n(H)}return v}r.prototype.addListener=function(C,w){return c(this,C,w,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(C,w){return c(this,C,w,!0)};function l(){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 u(v,C,w){var Q={fired:!1,wrapFn:void 0,target:v,type:C,listener:w},F=l.bind(Q);return F.listener=w,Q.wrapFn=F,F}r.prototype.once=function(C,w){return o(w),this.on(C,u(this,C,w)),this},r.prototype.prependOnceListener=function(C,w){return o(w),this.prependListener(C,u(this,C,w)),this},r.prototype.removeListener=function(C,w){var Q,F,R,D,H;if(o(w),F=this._events,F===void 0)return this;if(Q=F[C],Q===void 0)return this;if(Q===w||Q.listener===w)--this._eventsCount===0?this._events=Object.create(null):(delete F[C],F.removeListener&&this.emit("removeListener",C,Q.listener||w));else if(typeof Q!="function"){for(R=-1,D=Q.length-1;D>=0;D--)if(Q[D]===w||Q[D].listener===w){H=Q[D].listener,R=D;break}if(R<0)return this;R===0?Q.shift():f(Q,R),Q.length===1&&(F[C]=Q[0]),F.removeListener!==void 0&&this.emit("removeListener",C,H||w)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(C){var w,Q,F;if(Q=this._events,Q===void 0)return this;if(Q.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Q[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete Q[C]),this;if(arguments.length===0){var R=Object.keys(Q),D;for(F=0;F<R.length;++F)D=R[F],D!=="removeListener"&&this.removeAllListeners(D);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(w=Q[C],typeof w=="function")this.removeListener(C,w);else if(w!==void 0)for(F=w.length-1;F>=0;F--)this.removeListener(C,w[F]);return this};function d(v,C,w){var Q=v._events;if(Q===void 0)return[];var F=Q[C];return F===void 0?[]:typeof F=="function"?w?[F.listener||F]:[F]:w?p(F):g(F,F.length)}r.prototype.listeners=function(C){return d(this,C,!0)},r.prototype.rawListeners=function(C){return d(this,C,!1)},r.listenerCount=function(v,C){return typeof v.listenerCount=="function"?v.listenerCount(C):h.call(v,C)},r.prototype.listenerCount=h;function h(v){var C=this._events;if(C!==void 0){var w=C[v];if(typeof w=="function")return 1;if(w!==void 0)return w.length}return 0}r.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function g(v,C){for(var w=new Array(C),Q=0;Q<C;++Q)w[Q]=v[Q];return w}function f(v,C){for(;C+1<v.length;C++)v[C]=v[C+1];v.pop()}function p(v){for(var C=new Array(v.length),w=0;w<C.length;++w)C[w]=v[w].listener||v[w];return C}function B(v,C){return new Promise(function(w,Q){function F(D){v.removeListener(C,R),Q(D)}function R(){typeof v.removeListener=="function"&&v.removeListener("error",F),w([].slice.call(arguments))}b(v,C,R,{once:!0}),C!=="error"&&y(v,F,{once:!0})})}function y(v,C,w){typeof v.on=="function"&&b(v,"error",C,w)}function b(v,C,w,Q){if(typeof v.on=="function")Q.once?v.once(C,w):v.on(C,w);else if(typeof v.addEventListener=="function")v.addEventListener(C,function F(R){Q.once&&v.removeEventListener(C,F),w(R)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof v)}return wi.exports}var mA=Hg();let Nc=!0,Kc=!0;function yi(t,e,A){const n=t.match(e);return n&&n.length>=A&&parseInt(n[A],10)}function vt(t,e,A){if(!t.RTCPeerConnection)return;const n=t.RTCPeerConnection.prototype,i=n.addEventListener;n.addEventListener=function(s,o){if(s!==e)return i.apply(this,arguments);const a=c=>{const l=A(c);l&&(o.handleEvent?o.handleEvent(l):o(l))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(o,a),i.apply(this,[s,a])};const r=n.removeEventListener;n.removeEventListener=function(s,o){if(s!==e||!this._eventMap||!this._eventMap[e])return r.apply(this,arguments);if(!this._eventMap[e].has(o))return r.apply(this,arguments);const a=this._eventMap[e].get(o);return this._eventMap[e].delete(o),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,r.apply(this,[s,a])},Object.defineProperty(n,"on"+e,{get(){return this["_on"+e]},set(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}function Og(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(Nc=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function Mg(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(Kc=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function Vc(){if(typeof window=="object"){if(Nc)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Bs(t,e){Kc&&console.warn(t+" is deprecated, please use "+e+" instead.")}function Ng(t){const e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:A}=t;if(A.userAgentData&&A.userAgentData.brands){const n=A.userAgentData.brands.find(i=>i.brand==="Chromium");if(n)return{browser:"chrome",version:parseInt(n.version,10)}}if(A.mozGetUserMedia)e.browser="firefox",e.version=yi(A.userAgent,/Firefox\/(\d+)\./,1);else if(A.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=yi(A.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&A.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=yi(A.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function Gc(t){return Object.prototype.toString.call(t)==="[object Object]"}function jc(t){return Gc(t)?Object.keys(t).reduce(function(e,A){const n=Gc(t[A]),i=n?jc(t[A]):t[A],r=n&&!Object.keys(i).length;return i===void 0||r?e:Object.assign(e,{[A]:i})},{}):t}function vs(t,e,A){!e||A.has(e.id)||(A.set(e.id,e),Object.keys(e).forEach(n=>{n.endsWith("Id")?vs(t,t.get(e[n]),A):n.endsWith("Ids")&&e[n].forEach(i=>{vs(t,t.get(i),A)})}))}function Wc(t,e,A){const n=A?"outbound-rtp":"inbound-rtp",i=new Map;if(e===null)return i;const r=[];return t.forEach(s=>{s.type==="track"&&s.trackIdentifier===e.id&&r.push(s)}),r.forEach(s=>{t.forEach(o=>{o.type===n&&o.trackId===s.id&&vs(t,o,i)})}),i}const Jc=Vc;function Xc(t,e){const A=t&&t.navigator;if(!A.mediaDevices)return;const n=function(o){if(typeof o!="object"||o.mandatory||o.optional)return o;const a={};return Object.keys(o).forEach(c=>{if(c==="require"||c==="advanced"||c==="mediaSource")return;const l=typeof o[c]=="object"?o[c]:{ideal:o[c]};l.exact!==void 0&&typeof l.exact=="number"&&(l.min=l.max=l.exact);const u=function(d,h){return d?d+h.charAt(0).toUpperCase()+h.slice(1):h==="deviceId"?"sourceId":h};if(l.ideal!==void 0){a.optional=a.optional||[];let d={};typeof l.ideal=="number"?(d[u("min",c)]=l.ideal,a.optional.push(d),d={},d[u("max",c)]=l.ideal,a.optional.push(d)):(d[u("",c)]=l.ideal,a.optional.push(d))}l.exact!==void 0&&typeof l.exact!="number"?(a.mandatory=a.mandatory||{},a.mandatory[u("",c)]=l.exact):["min","max"].forEach(d=>{l[d]!==void 0&&(a.mandatory=a.mandatory||{},a.mandatory[u(d,c)]=l[d])})}),o.advanced&&(a.optional=(a.optional||[]).concat(o.advanced)),a},i=function(o,a){if(e.version>=61)return a(o);if(o=JSON.parse(JSON.stringify(o)),o&&typeof o.audio=="object"){const c=function(l,u,d){u in l&&!(d in l)&&(l[d]=l[u],delete l[u])};o=JSON.parse(JSON.stringify(o)),c(o.audio,"autoGainControl","googAutoGainControl"),c(o.audio,"noiseSuppression","googNoiseSuppression"),o.audio=n(o.audio)}if(o&&typeof o.video=="object"){let c=o.video.facingMode;c=c&&(typeof c=="object"?c:{ideal:c});const l=e.version<66;if(c&&(c.exact==="user"||c.exact==="environment"||c.ideal==="user"||c.ideal==="environment")&&!(A.mediaDevices.getSupportedConstraints&&A.mediaDevices.getSupportedConstraints().facingMode&&!l)){delete o.video.facingMode;let u;if(c.exact==="environment"||c.ideal==="environment"?u=["back","rear"]:(c.exact==="user"||c.ideal==="user")&&(u=["front"]),u)return A.mediaDevices.enumerateDevices().then(d=>{d=d.filter(g=>g.kind==="videoinput");let h=d.find(g=>u.some(f=>g.label.toLowerCase().includes(f)));return!h&&d.length&&u.includes("back")&&(h=d[d.length-1]),h&&(o.video.deviceId=c.exact?{exact:h.deviceId}:{ideal:h.deviceId}),o.video=n(o.video),Jc("chrome: "+JSON.stringify(o)),a(o)})}o.video=n(o.video)}return Jc("chrome: "+JSON.stringify(o)),a(o)},r=function(o){return e.version>=64?o:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[o.name]||o.name,message:o.message,constraint:o.constraint||o.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},s=function(o,a,c){i(o,l=>{A.webkitGetUserMedia(l,a,u=>{c&&c(r(u))})})};if(A.getUserMedia=s.bind(A),A.mediaDevices.getUserMedia){const o=A.mediaDevices.getUserMedia.bind(A.mediaDevices);A.mediaDevices.getUserMedia=function(a){return i(a,c=>o(c).then(l=>{if(c.audio&&!l.getAudioTracks().length||c.video&&!l.getVideoTracks().length)throw l.getTracks().forEach(u=>{u.stop()}),new DOMException("","NotFoundError");return l},l=>Promise.reject(r(l))))}}}function $c(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function Yc(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(A){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=A)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=n=>{n.stream.addEventListener("addtrack",i=>{let r;t.RTCPeerConnection.prototype.getReceivers?r=this.getReceivers().find(o=>o.track&&o.track.id===i.track.id):r={track:i.track};const s=new Event("track");s.track=i.track,s.receiver=r,s.transceiver={receiver:r},s.streams=[n.stream],this.dispatchEvent(s)}),n.stream.getTracks().forEach(i=>{let r;t.RTCPeerConnection.prototype.getReceivers?r=this.getReceivers().find(o=>o.track&&o.track.id===i.id):r={track:i};const s=new Event("track");s.track=i,s.receiver=r,s.transceiver={receiver:r},s.streams=[n.stream],this.dispatchEvent(s)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else vt(t,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function qc(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(i,r){return{track:r,get dtmf(){return this._dtmf===void 0&&(r.kind==="audio"?this._dtmf=i.createDTMFSender(r):this._dtmf=null),this._dtmf},_pc:i}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const i=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(o,a){let c=i.apply(this,arguments);return c||(c=e(this,o),this._senders.push(c)),c};const r=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(o){r.apply(this,arguments);const a=this._senders.indexOf(o);a!==-1&&this._senders.splice(a,1)}}const A=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(r){this._senders=this._senders||[],A.apply(this,[r]),r.getTracks().forEach(s=>{this._senders.push(e(this,s))})};const n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(r){this._senders=this._senders||[],n.apply(this,[r]),r.getTracks().forEach(s=>{const o=this._senders.find(a=>a.track===s);o&&this._senders.splice(this._senders.indexOf(o),1)})}}else if(typeof t=="object"&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const n=e.apply(this,[]);return n.forEach(i=>i._pc=this),n},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function zc(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const A=t.RTCPeerConnection.prototype.getSenders;A&&(t.RTCPeerConnection.prototype.getSenders=function(){const r=A.apply(this,[]);return r.forEach(s=>s._pc=this),r});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const r=n.apply(this,arguments);return r._pc=this,r}),t.RTCRtpSender.prototype.getStats=function(){const r=this;return this._pc.getStats().then(s=>Wc(s,r.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const A=t.RTCPeerConnection.prototype.getReceivers;A&&(t.RTCPeerConnection.prototype.getReceivers=function(){const i=A.apply(this,[]);return i.forEach(r=>r._pc=this),i}),vt(t,"track",n=>(n.receiver._pc=n.srcElement,n)),t.RTCRtpReceiver.prototype.getStats=function(){const i=this;return this._pc.getStats().then(r=>Wc(r,i.track,!1))}}if(!("getStats"in t.RTCRtpSender.prototype&&"getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const n=arguments[0];let i,r,s;return this.getSenders().forEach(o=>{o.track===n&&(i?s=!0:i=o)}),this.getReceivers().forEach(o=>(o.track===n&&(r?s=!0:r=o),o.track===n)),s||i&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):i?i.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function Zc(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(s=>this._shimmedLocalStreams[s][0])};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(s,o){if(!o)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const a=e.apply(this,arguments);return this._shimmedLocalStreams[o.id]?this._shimmedLocalStreams[o.id].indexOf(a)===-1&&this._shimmedLocalStreams[o.id].push(a):this._shimmedLocalStreams[o.id]=[o,a],a};const A=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(s){this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(c=>{if(this.getSenders().find(u=>u.track===c))throw new DOMException("Track already exists.","InvalidAccessError")});const o=this.getSenders();A.apply(this,arguments);const a=this.getSenders().filter(c=>o.indexOf(c)===-1);this._shimmedLocalStreams[s.id]=[s].concat(a)};const n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],n.apply(this,arguments)};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(o=>{const a=this._shimmedLocalStreams[o].indexOf(s);a!==-1&&this._shimmedLocalStreams[o].splice(a,1),this._shimmedLocalStreams[o].length===1&&delete this._shimmedLocalStreams[o]}),i.apply(this,arguments)}}function el(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return Zc(t);const A=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const l=A.apply(this);return this._reverseStreams=this._reverseStreams||{},l.map(u=>this._reverseStreams[u.id])};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(l){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},l.getTracks().forEach(u=>{if(this.getSenders().find(h=>h.track===u))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[l.id]){const u=new t.MediaStream(l.getTracks());this._streams[l.id]=u,this._reverseStreams[u.id]=l,l=u}n.apply(this,[l])};const i=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(l){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[l.id]||l]),delete this._reverseStreams[this._streams[l.id]?this._streams[l.id].id:l.id],delete this._streams[l.id]},t.RTCPeerConnection.prototype.addTrack=function(l,u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const d=[].slice.call(arguments,1);if(d.length!==1||!d[0].getTracks().find(f=>f===l))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(f=>f.track===l))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const g=this._streams[u.id];if(g)g.addTrack(l),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const f=new t.MediaStream([l]);this._streams[u.id]=f,this._reverseStreams[f.id]=u,this.addStream(f)}return this.getSenders().find(f=>f.track===l)};function r(c,l){let u=l.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const h=c._reverseStreams[d],g=c._streams[h.id];u=u.replace(new RegExp(g.id,"g"),h.id)}),new RTCSessionDescription({type:l.type,sdp:u})}function s(c,l){let u=l.sdp;return Object.keys(c._reverseStreams||[]).forEach(d=>{const h=c._reverseStreams[d],g=c._streams[h.id];u=u.replace(new RegExp(h.id,"g"),g.id)}),new RTCSessionDescription({type:l.type,sdp:u})}["createOffer","createAnswer"].forEach(function(c){const l=t.RTCPeerConnection.prototype[c],u={[c](){const d=arguments;return arguments.length&&typeof arguments[0]=="function"?l.apply(this,[g=>{const f=r(this,g);d[0].apply(null,[f])},g=>{d[1]&&d[1].apply(null,g)},arguments[2]]):l.apply(this,arguments).then(g=>r(this,g))}};t.RTCPeerConnection.prototype[c]=u[c]});const o=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?o.apply(this,arguments):(arguments[0]=s(this,arguments[0]),o.apply(this,arguments))};const a=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const c=a.get.apply(this);return c.type===""?c:r(this,c)}}),t.RTCPeerConnection.prototype.removeTrack=function(l){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!l._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(l._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let d;Object.keys(this._streams).forEach(h=>{this._streams[h].getTracks().find(f=>l.track===f)&&(d=this._streams[h])}),d&&(d.getTracks().length===1?this.removeStream(this._reverseStreams[d.id]):d.removeTrack(l.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Cs(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(A){const n=t.RTCPeerConnection.prototype[A],i={[A](){return arguments[0]=new(A==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[A]=i[A]})}function Al(t,e){vt(t,"negotiationneeded",A=>{const n=A.target;if(!((e.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics==="plan-b")&&n.signalingState!=="stable"))return A})}var tl=Object.freeze({__proto__:null,fixNegotiationNeeded:Al,shimAddTrackRemoveTrack:el,shimAddTrackRemoveTrackWithNative:Zc,shimGetSendersWithDtmf:qc,shimGetUserMedia:Xc,shimMediaStream:$c,shimOnTrack:Yc,shimPeerConnection:Cs,shimSenderReceiverGetStats:zc});function nl(t,e){const A=t&&t.navigator,n=t&&t.MediaStreamTrack;if(A.getUserMedia=function(i,r,s){Bs("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),A.mediaDevices.getUserMedia(i).then(r,s)},!(e.version>55&&"autoGainControl"in A.mediaDevices.getSupportedConstraints())){const i=function(s,o,a){o in s&&!(a in s)&&(s[a]=s[o],delete s[o])},r=A.mediaDevices.getUserMedia.bind(A.mediaDevices);if(A.mediaDevices.getUserMedia=function(s){return typeof s=="object"&&typeof s.audio=="object"&&(s=JSON.parse(JSON.stringify(s)),i(s.audio,"autoGainControl","mozAutoGainControl"),i(s.audio,"noiseSuppression","mozNoiseSuppression")),r(s)},n&&n.prototype.getSettings){const s=n.prototype.getSettings;n.prototype.getSettings=function(){const o=s.apply(this,arguments);return i(o,"mozAutoGainControl","autoGainControl"),i(o,"mozNoiseSuppression","noiseSuppression"),o}}if(n&&n.prototype.applyConstraints){const s=n.prototype.applyConstraints;n.prototype.applyConstraints=function(o){return this.kind==="audio"&&typeof o=="object"&&(o=JSON.parse(JSON.stringify(o)),i(o,"autoGainControl","mozAutoGainControl"),i(o,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[o])}}}}function Kg(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(n){if(!(n&&n.video)){const i=new DOMException("getDisplayMedia without video constraints is undefined");return i.name="NotFoundError",i.code=8,Promise.reject(i)}return n.video===!0?n.video={mediaSource:e}:n.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(n)})}function il(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function ws(t,e){if(typeof t!="object"||!(t.RTCPeerConnection||t.mozRTCPeerConnection))return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(i){const r=t.RTCPeerConnection.prototype[i],s={[i](){return arguments[0]=new(i==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}};t.RTCPeerConnection.prototype[i]=s[i]});const A={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[r,s,o]=arguments;return n.apply(this,[r||null]).then(a=>{if(e.version<53&&!s)try{a.forEach(c=>{c.type=A[c.type]||c.type})}catch(c){if(c.name!=="TypeError")throw c;a.forEach((l,u)=>{a.set(u,Object.assign({},l,{type:A[l.type]||l.type}))})}return a}).then(s,o)}}function rl(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(r=>r._pc=this),i});const A=t.RTCPeerConnection.prototype.addTrack;A&&(t.RTCPeerConnection.prototype.addTrack=function(){const i=A.apply(this,arguments);return i._pc=this,i}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function sl(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const n=e.apply(this,[]);return n.forEach(i=>i._pc=this),n}),vt(t,"track",A=>(A.receiver._pc=A.srcElement,A)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function ol(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(A){Bs("removeStream","removeTrack"),this.getSenders().forEach(n=>{n.track&&A.getTracks().includes(n.track)&&this.removeTrack(n)})})}function al(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function cl(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let n=arguments[1]&&arguments[1].sendEncodings;n===void 0&&(n=[]),n=[...n];const i=n.length>0;i&&n.forEach(s=>{if("rid"in s&&!/^[a-z0-9]{0,16}$/i.test(s.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in s&&!(parseFloat(s.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in s&&!(parseFloat(s.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const r=e.apply(this,arguments);if(i){const{sender:s}=r,o=s.getParameters();(!("encodings"in o)||o.encodings.length===1&&Object.keys(o.encodings[0]).length===0)&&(o.encodings=n,s.sendEncodings=n,this.setParametersPromises.push(s.setParameters(o).then(()=>{delete s.sendEncodings}).catch(()=>{delete s.sendEncodings})))}return r})}function ll(t){if(!(typeof t=="object"&&t.RTCRtpSender))return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const n=e.apply(this,arguments);return"encodings"in n||(n.encodings=[].concat(this.sendEncodings||[{}])),n})}function ul(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function dl(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}var hl=Object.freeze({__proto__:null,shimAddTransceiver:cl,shimCreateAnswer:dl,shimCreateOffer:ul,shimGetDisplayMedia:Kg,shimGetParameters:ll,shimGetUserMedia:nl,shimOnTrack:il,shimPeerConnection:ws,shimRTCDataChannel:al,shimReceiverGetStats:sl,shimRemoveStream:ol,shimSenderGetStats:rl});function fl(t){if(!(typeof t!="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(n){this._localStreams||(this._localStreams=[]),this._localStreams.includes(n)||this._localStreams.push(n),n.getAudioTracks().forEach(i=>e.call(this,i,n)),n.getVideoTracks().forEach(i=>e.call(this,i,n))},t.RTCPeerConnection.prototype.addTrack=function(n){for(var i=arguments.length,r=new Array(i>1?i-1:0),s=1;s<i;s++)r[s-1]=arguments[s];return r&&r.forEach(o=>{this._localStreams?this._localStreams.includes(o)||this._localStreams.push(o):this._localStreams=[o]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(A){this._localStreams||(this._localStreams=[]);const n=this._localStreams.indexOf(A);if(n===-1)return;this._localStreams.splice(n,1);const i=A.getTracks();this.getSenders().forEach(r=>{i.includes(r.track)&&this.removeTrack(r)})})}}function gl(t){if(!(typeof t!="object"||!t.RTCPeerConnection)&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(A){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=A),this.addEventListener("track",this._onaddstreampoly=n=>{n.streams.forEach(i=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(i))return;this._remoteStreams.push(i);const r=new Event("addstream");r.stream=i,this.dispatchEvent(r)})})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const n=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(r=>{if(n._remoteStreams||(n._remoteStreams=[]),n._remoteStreams.indexOf(r)>=0)return;n._remoteStreams.push(r);const s=new Event("addstream");s.stream=r,n.dispatchEvent(s)})}),e.apply(n,arguments)}}}function pl(t){if(typeof t!="object"||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,A=e.createOffer,n=e.createAnswer,i=e.setLocalDescription,r=e.setRemoteDescription,s=e.addIceCandidate;e.createOffer=function(c,l){const u=arguments.length>=2?arguments[2]:arguments[0],d=A.apply(this,[u]);return l?(d.then(c,l),Promise.resolve()):d},e.createAnswer=function(c,l){const u=arguments.length>=2?arguments[2]:arguments[0],d=n.apply(this,[u]);return l?(d.then(c,l),Promise.resolve()):d};let o=function(a,c,l){const u=i.apply(this,[a]);return l?(u.then(c,l),Promise.resolve()):u};e.setLocalDescription=o,o=function(a,c,l){const u=r.apply(this,[a]);return l?(u.then(c,l),Promise.resolve()):u},e.setRemoteDescription=o,o=function(a,c,l){const u=s.apply(this,[a]);return l?(u.then(c,l),Promise.resolve()):u},e.addIceCandidate=o}function ml(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const A=e.mediaDevices,n=A.getUserMedia.bind(A);e.mediaDevices.getUserMedia=i=>n(Bl(i))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(n,i,r){e.mediaDevices.getUserMedia(n).then(i,r)}).bind(e))}function Bl(t){return t&&t.video!==void 0?Object.assign({},t,{video:jc(t.video)}):t}function vl(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(n,i){if(n&&n.iceServers){const r=[];for(let s=0;s<n.iceServers.length;s++){let o=n.iceServers[s];o.urls===void 0&&o.url?(Bs("RTCIceServer.url","RTCIceServer.urls"),o=JSON.parse(JSON.stringify(o)),o.urls=o.url,delete o.url,r.push(o)):r.push(n.iceServers[s])}n.iceServers=r}return new e(n,i)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function Cl(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function wl(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(n){if(n){typeof n.offerToReceiveAudio<"u"&&(n.offerToReceiveAudio=!!n.offerToReceiveAudio);const i=this.getTransceivers().find(s=>s.receiver.track.kind==="audio");n.offerToReceiveAudio===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):n.offerToReceiveAudio===!0&&!i&&this.addTransceiver("audio",{direction:"recvonly"}),typeof n.offerToReceiveVideo<"u"&&(n.offerToReceiveVideo=!!n.offerToReceiveVideo);const r=this.getTransceivers().find(s=>s.receiver.track.kind==="video");n.offerToReceiveVideo===!1&&r?r.direction==="sendrecv"?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":r.direction==="recvonly"&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):n.offerToReceiveVideo===!0&&!r&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function yl(t){typeof t!="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var bl=Object.freeze({__proto__:null,shimAudioContext:yl,shimCallbacksAPI:pl,shimConstraints:Bl,shimCreateOfferLegacy:wl,shimGetUserMedia:ml,shimLocalStreamsAPI:fl,shimRTCIceServerUrls:vl,shimRemoteStreamsAPI:gl,shimTrackEventTransceiver:Cl}),ys={exports:{}},Ul;function Vg(){return Ul||(Ul=1,function(t){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(A){return A.trim().split(`
|
|
3
3
|
`).map(n=>n.trim())},e.splitSections=function(A){return A.split(`
|
|
4
4
|
m=`).map((i,r)=>(r>0?"m="+i:i).trim()+`\r
|