@4players/odin-plugin-web 1.17.0 → 1.18.0
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.
|
@@ -3377,4 +3377,4 @@ stackRestore(sp);
|
|
|
3377
3377
|
return ret;
|
|
3378
3378
|
\`),p+=\`}
|
|
3379
3379
|
\`,new Function(I,p)}function jr(r,j,n,l,o,a){var k=j.length;k<2&&G("argTypes array size mismatch! Must at least get return value and receiver (this) types!");var u=j[1]!==null&&n!==null,c=nj(j),q=sj(j),f=q&&!a&&!c;q&&!f&&(c=!0);var p=!j[0].isVoid,v=j[0],I=j[1],F=[r,G,l,o,ej,v.fromWireType.bind(v),I?.toWireType.bind(I)];f&&F.push(wr,WA);for(var h=2;h<k;++h){var b=j[h];F.push(b.toWireType.bind(b))}if(!c)for(var h=u?1:2;h<j.length;++h)j[h].destructorFunction!==null&&F.push(j[h].destructorFunction);var Q=me(j,u,p,a)(...F);return Zr(r,Q)}var he=(r,j,n,l,o,a)=>{var k=rr(j,n);o=P(l,o),M([],[r],u=>{u=u[0];var c=\`constructor \${u.name}\`;if(u.registeredClass.constructor_body===void 0&&(u.registeredClass.constructor_body=[]),u.registeredClass.constructor_body[j-1]!==void 0)throw new lA(\`Cannot register multiple constructors with identical number of parameters (\${j-1}) for class '\${u.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!\`);return u.registeredClass.constructor_body[j-1]=()=>{AA(\`Cannot construct \${u.name} due to unbound types\`,k)},M([],k,q=>(q.splice(1,0,null),u.registeredClass.constructor_body[j-1]=jr(c,q,null,o,a),[])),[]})},ij=r=>{r=r.trim();let j=r.indexOf("(");return j===-1?r:r.slice(0,j)},$e=(r,j,n,l,o,a,k,u,c,q)=>{var f=rr(n,l);j=H(j),j=ij(j),a=P(o,a,c),M([],[r],p=>{p=p[0];var v=\`\${p.name}.\${j}\`;j.startsWith("@@")&&(j=Symbol[j.substring(2)]),u&&p.registeredClass.pureVirtualFunctions.push(j);function I(){AA(\`Cannot call \${v} due to unbound types\`,f)}var F=p.registeredClass.instancePrototype,h=F[j];return h===void 0||h.overloadTable===void 0&&h.className!==p.name&&h.argCount===n-2?(I.argCount=n-2,I.className=p.name,F[j]=I):(Aj(F,j,v),F[j].overloadTable[n-2]=I),M([],f,b=>{var y=jr(v,b,p,a,k,c);return F[j].overloadTable===void 0?(y.argCount=n-2,F[j]=y):F[j].overloadTable[n-2]=y,[]}),[]})},lj=(r,j,n)=>(r instanceof Object||G(\`\${n} with invalid "this": \${r}\`),r instanceof j.registeredClass.constructor||G(\`\${n} incompatible with "this" of type \${r.constructor.name}\`),r.$$.ptr||G(\`cannot call emscripten binding method \${n} on deleted object\`),IA(r.$$.ptr,r.$$.ptrType.registeredClass,j.registeredClass)),Fe=(r,j,n,l,o,a,k,u,c,q)=>{j=H(j),o=P(l,o),M([],[r],f=>{f=f[0];var p=\`\${f.name}.\${j}\`,v={get(){AA(\`Cannot access \${p} due to unbound types\`,[n,k])},enumerable:!0,configurable:!0};return c?v.set=()=>AA(\`Cannot access \${p} due to unbound types\`,[n,k]):v.set=I=>G(p+" is a read-only property"),Object.defineProperty(f.registeredClass.instancePrototype,j,v),M([],c?[n,k]:[n],I=>{var F=I[0],h={get(){var y=lj(this,f,p+" getter");return F.fromWireType(o(a,y))},enumerable:!0};if(c){c=P(u,c);var b=I[1];h.set=function(y){var Q=lj(this,f,p+" setter"),g=[];c(q,Q,b.toWireType(g,y)),ej(g)}}return Object.defineProperty(f.registeredClass.instancePrototype,j,h),[]}),[]})},oj=[],V=[0,1,,1,null,1,!0,1,!1,1],ve=r=>{if(r>9&&--V[r+1]===0){var j=V[r];V[r]=void 0,oj.push(r)}},tr={toValue:r=>(r||G(\`Cannot use deleted val. handle = \${r}\`),V[r]),toHandle:r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let j=oj.pop()||V.length;return V[j]=r,V[j+1]=1,j}}}},Ie={name:"emscripten::val",fromWireType:r=>{var j=tr.toValue(r);return ve(r),j},toWireType:(r,j)=>tr.toHandle(j),readValueFromPointer:_A,destructorFunction:null},_e=r=>N(r,Ie),aj,He=(r,j)=>{switch(j){case 4:return function(n){return this.fromWireType(aj[n>>2])};case 8:return function(n){return this.fromWireType(mA[n>>3])};default:throw new TypeError(\`invalid float width (\${j}): \${r}\`)}},Le=(r,j,n)=>{j=H(j),N(r,{name:j,fromWireType:l=>l,toWireType:(l,o)=>o,readValueFromPointer:He(j,n),destructorFunction:null})},ye=(r,j,n,l,o,a,k,u)=>{var c=rr(j,n);r=H(r),r=ij(r),o=P(l,o,k),rj(r,function(){AA(\`Cannot call \${r} due to unbound types\`,c)},j-1),M([],c,q=>{var f=[q[0],null].concat(q.slice(1));return tj(r,jr(r,f,null,o,a,k),j-1),[]})},ge=(r,j,n,l,o)=>{j=H(j);let a=l===0,k=c=>c;if(a){var u=32-8*n;k=c=>c<<u>>>u,o=k(o)}N(r,{name:j,fromWireType:k,toWireType:(c,q)=>q,readValueFromPointer:Qr(j,n,l!==0),destructorFunction:null})},xe=(r,j,n)=>{var l=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array],o=l[j];function a(k){var u=$[k>>2],c=$[k+4>>2];return new o(R.buffer,c,u)}n=H(n),N(r,{name:n,fromWireType:a,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},De=(r,j,n,l)=>{if(!(l>0))return 0;for(var o=n,a=n+l-1,k=0;k<r.length;++k){var u=r.codePointAt(k);if(u<=127){if(n>=a)break;j[n++]=u}else if(u<=2047){if(n+1>=a)break;j[n++]=192|u>>6,j[n++]=128|u&63}else if(u<=65535){if(n+2>=a)break;j[n++]=224|u>>12,j[n++]=128|u>>6&63,j[n++]=128|u&63}else{if(n+3>=a)break;j[n++]=240|u>>18,j[n++]=128|u>>12&63,j[n++]=128|u>>6&63,j[n++]=128|u&63,k++}}return j[n]=0,n-o},Be=(r,j,n)=>De(r,D,j,n),Ne=r=>{for(var j=0,n=0;n<r.length;++n){var l=r.charCodeAt(n);l<=127?j++:l<=2047?j+=2:l>=55296&&l<=57343?(j+=4,++n):j+=3}return j},kj=globalThis.TextDecoder&&new TextDecoder,uj=(r,j,n,l)=>{var o=j+n;if(l)return o;for(;r[j]&&!(j>=o);)++j;return j},cj=(r,j=0,n,l)=>{var o=uj(r,j,n,l);if(o-j>16&&r.buffer&&kj)return kj.decode(r.buffer instanceof ArrayBuffer?r.subarray(j,o):r.slice(j,o));for(var a="";j<o;){var k=r[j++];if(!(k&128)){a+=String.fromCharCode(k);continue}var u=r[j++]&63;if((k&224)==192){a+=String.fromCharCode((k&31)<<6|u);continue}var c=r[j++]&63;if((k&240)==224?k=(k&15)<<12|u<<6|c:k=(k&7)<<18|u<<12|c<<6|r[j++]&63,k<65536)a+=String.fromCharCode(k);else{var q=k-65536;a+=String.fromCharCode(55296|q>>10,56320|q&1023)}}return a},be=(r,j,n)=>r?cj(D,r,j,n):"",Oe=(r,j)=>{j=H(j);var n=!0;N(r,{name:j,fromWireType(l){var o=$[l>>2],a=l+4,k;if(n)k=be(a,o,!0);else{k="";for(var u=0;u<o;++u)k+=String.fromCharCode(D[a+u])}return w(l),k},toWireType(l,o){o instanceof ArrayBuffer&&(o=new Uint8Array(o));var a,k=typeof o=="string";k||ArrayBuffer.isView(o)&&o.BYTES_PER_ELEMENT==1||G("Cannot pass non-string to std::string"),n&&k?a=Ne(o):a=o.length;var u=sr(4+a+1),c=u+4;if($[u>>2]=a,k)if(n)Be(o,c,a+1);else for(var q=0;q<a;++q){var f=o.charCodeAt(q);f>255&&(w(u),G("String has UTF-16 code units that do not fit in 8 bits")),D[c+q]=f}else D.set(o,c);return l!==null&&l.push(w,u),u},readValueFromPointer:_A,destructorFunction(l){w(l)}})},dj=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,Je=(r,j,n)=>{var l=r>>1,o=uj(oA,l,j/2,n);if(o-l>16&&dj)return dj.decode(oA.slice(l,o));for(var a="",k=l;k<o;++k){var u=oA[k];a+=String.fromCharCode(u)}return a},Pe=(r,j,n=2147483647)=>{if(n<2)return 0;n-=2;for(var l=j,o=n<r.length*2?n/2:r.length,a=0;a<o;++a){var k=r.charCodeAt(a);$A[j>>1]=k,j+=2}return $A[j>>1]=0,j-l},we=r=>r.length*2,Te=(r,j,n)=>{for(var l="",o=r>>2,a=0;!(a>=j/4);a++){var k=$[o+a];if(!k&&!n)break;l+=String.fromCodePoint(k)}return l},Se=(r,j,n=2147483647)=>{if(n<4)return 0;for(var l=j,o=l+n-4,a=0;a<r.length;++a){var k=r.codePointAt(a);if(k>65535&&a++,S[j>>2]=k,j+=4,j+4>o)break}return S[j>>2]=0,j-l},Me=r=>{for(var j=0,n=0;n<r.length;++n){var l=r.codePointAt(n);l>65535&&n++,j+=4}return j},Ue=(r,j,n)=>{n=H(n);var l,o,a;j===2?(l=Je,o=Pe,a=we):(l=Te,o=Se,a=Me),N(r,{name:n,fromWireType:k=>{var u=$[k>>2],c=l(k+4,u*j,!0);return w(k),c},toWireType:(k,u)=>{typeof u!="string"&&G(\`Cannot pass non-string to C++ string type \${n}\`);var c=a(u),q=sr(4+c+j);return $[q>>2]=c/j,o(u,q+4,c+j),k!==null&&k.push(w,q),q},readValueFromPointer:_A,destructorFunction(k){w(k)}})},Ke=(r,j)=>{j=H(j),N(r,{isVoid:!0,name:j,fromWireType:()=>{},toWireType:(n,l)=>{}})},Re=r=>{var j=!s;try{Atomics.wait(S,0,0,0),j=!0}catch{}ir(r,!i,1,j,65536,!1),m.threadInitTLS()},Cj=r=>{if(r instanceof Nr||r=="unwind")return z;x(1,r)},Ve=()=>{if(!QA())try{if(C){kA()&&lr(z);return}XA(z)}catch(r){Cj(r)}},fj=r=>{if(!pA)try{return r()}catch(j){Cj(j)}finally{Ve()}},er=r=>{if(!Mr){var j=Atomics.waitAsync(S,r>>2,r);j.value.then(gA);var n=r+112;Atomics.store(S,n>>2,1)}},gA=()=>{var r=kA();r&&fj(()=>{er(r),_j()})},Qe=(r,j)=>{if(r==j)setTimeout(gA);else if(C)postMessage({targetThread:r,cmd:4});else{var n=m.pthreads[r];if(!n)return;n.postMessage({cmd:4})}},nr=[],We=(r,j,n,l,o,a,k)=>{nr.length=0;for(var u=o>>3,c=o+l>>3;u<c;){var q;K[u++]?q=K[u++]:q=mA[u++],nr.push(q)}var f=an[r];m.currentProxiedOperationCallerThread=n;var p=f(...nr);if(m.currentProxiedOperationCallerThread=0,a){Promise.resolve(p).then(v=>Fj(a,k,v));return}return p},Xe=r=>{C?postMessage({cmd:6,thread:r}):Or(r)},ze=r=>{},Ze=()=>performance.timeOrigin+performance.now(),Ye=9007199254740992,An=-9007199254740992,rn=r=>r<An||r>Ye?NaN:Number(r),jn=()=>{},tn=()=>{VA+=1},en=()=>{throw tn(),"unwind"},nn=r=>{EA("OOM")},sn=r=>{var j=D.length;r>>>=0,nn(r)};function qj(r){return C?sA(2,0,1,r):52}function Gj(r,j,n,l){return C?sA(3,0,1,r,j,n,l):(j=rn(j),70)}var ln=[null,[],[]],on=(r,j)=>{var n=ln[r];!j||j===10?((r===1?KA:J)(cj(n)),n.length=0):n.push(j)};function pj(r,j,n,l){if(C)return sA(4,0,1,r,j,n,l);for(var o=0,a=0;a<n;a++){var k=$[j>>2],u=$[j+4>>2];j+=8;for(var c=0;c<u;c++)on(r,D[k+c]);o+=u}return $[l>>2]=o,0}m.init(),ee(),qe();{Bt(),t.noExitRuntime&&(zA=t.noExitRuntime),t.print&&(KA=t.print),t.printErr&&(J=t.printErr),t.arguments&&(E=t.arguments),t.thisProgram&&(_=t.thisProgram);var rA=t.preInit;if(rA)for(typeof rA=="function"&&(t.preInit=rA=[rA]);rA.length>0;)rA.shift()()}var an=[Tr,Sr,qj,Gj,pj],Ej,mj,kA,sr,w,kn,ir,hj,$j,Fj,vj,Ij,lr,_j,Hj,Lj,yj,gj,un,xj;function cn(r){Ej=r.G,mj=r.H,kA=r.J,sr=t._malloc=r.K,w=t._free=r.L,kn=r.M,ir=r.N,hj=r.O,$j=r.P,Fj=r.Q,vj=r.R,Ij=r.S,lr=r.T,_j=r.U,Hj=r.V,Lj=r.W,yj=r.X,gj=r.Y,un=xj=r.I}var Dj;function dn(){Dj={l:Xt,C:zt,h:Yt,o:Ae,n:Ee,m:he,e:$e,b:Fe,D:_e,g:Le,q:ye,d:ge,c:xe,E:Oe,f:Ue,p:Ke,z:Re,u:Qe,j:We,s:Xe,y:er,B:ze,x:jn,A:en,k:Ze,t:sn,r:XA,w:qj,v:Gj,i:pj,a:iA}}async function Bj(){if(C){gr();return}Nt();var r=t.setStatus;r&&(r("Running..."),await new Promise(j=>setTimeout(j,1)),setTimeout(r,1,"")),!pA&&(gr(),t.onRuntimeInitialized?.(),bt())}var jA;return C||(jA=await Br(),await Bj()),t}})();typeof Ft=="object"&&typeof MA=="object"?(MA.exports=SA,MA.exports.default=SA):typeof define=="function"&&define.amd&&define([],()=>SA);var xs=globalThis.name=="em-pthread";xs&&SA()});var O={};hn(O,{AdditionalCaptureBlocks:()=>In,AdditionalPlaybackBlocks:()=>vn,ClockJumpCheckInterval:()=>Dn,ClockJumpThreshold:()=>Bn,ConnectInterval:()=>Kn,ConnectTimeout:()=>Sn,DefaultRefreshRate:()=>Hn,DefaultVideoCodec:()=>Vn,HealthCheckTimeout:()=>xn,MainConnectionPingInterval:()=>Nn,MaxNumberOfDecoders:()=>yn,MaxReconnectDuration:()=>Rn,MinDBFs:()=>Jj,MinTokenLifetime:()=>Mn,MinTokenRefreshInterval:()=>Un,PlaybackPreload:()=>_n,RenderQuantumSize:()=>gn,VadPreload:()=>Ln,WebRtcAnswerTimeout:()=>Pn,WebRtcIceTimeout:()=>On,WebRtcMaxNegotiationAttempts:()=>wn,WebRtcRecoveryDelays:()=>Tn,WebRtcStatsSnapshotInterval:()=>bn,WebRtcTimeout:()=>Jn});var vn=3,In=3,_n=3,Hn=250,Ln=3,yn=512,gn=128,Jj=-758.596,xn=1e4,Dn=1e3,Bn=1e4,Nn=3e3,bn=1e3,On=3e3,Jn=1e4,Pn=1e4,wn=3,Tn=[0,2e3,5e3],Sn=5e3,Mn=6e4,Un=5e3,Kn=[0,100,200,200,500],Rn=12e4,Vn="H264";function uA(e,A,t){return e.postMessage(A,t)}function kr(e){return e.sampleRate*.02*(e.stereo?2:1)}function ur(e,A){let t=kr(e),s=t*A,i=s+t;return e.samples.subarray(s,i)}function cr(e,A,t){e.headers[A]=t.id}function Pj(e){return[e.values[0],e.values[1]]}function wj(e,A){e.values[0]=A[0],e.values[1]=A[1]}function Tj(e,A){return e.values[2+A*5]}function Sj(e,A,t){e.values[2+A*5]=t}function Mj(e,A){let t=2+A*5+1;return[e.values[t+0],e.values[t+1]]}function Uj(e,A,t){let s=2+A*5+1;e.values[s+0]=t[0],e.values[s+1]=t[1]}function Kj(e,A){return e.values[2+A*5+3]}function Rj(e,A,t){e.values[2+A*5+3]=t}function Vj(e,A){return e.values[2+A*5+4]}function Qj(e,A,t){e.values[2+A*5+4]=t}function Wj(e){return e.values[0]!==0}function Xj(e){return e.values[1]}function zj(e){return e.values[2]}function Zj(e){return e.values[3]}function Yj(e,A){return e.values[3]=A}function At(e){return e?Array.from(e).map(A=>A.toString(16).padStart(2,"0")).join(""):null}var Qn;(e=>{let A;(t=>(t[t.InvalidPassword=-1]="InvalidPassword",t[t.Unknown=0]="Unknown",t[t.Unencrypted=1]="Unencrypted",t[t.Encrypted=2]="Encrypted"))(A=e.PeerCipherStatus||={})})(Qn||={});function nt(e){return{type:"Success",value:e}}function B(e){return{type:"Failure",reason:e}}var{Deno:rt}=globalThis,Wn=typeof rt?.noColor=="boolean"?rt.noColor:!1,Xn=!Wn;function Cr(e,A){return{open:\`\\x1B[\${e.join(";")}m\`,close:\`\\x1B[\${A}m\`,regexp:new RegExp(\`\\\\x1b\\\\[\${A}m\`,"g")}}function fr(e,A){return Xn?\`\${A.open}\${e.replace(A.regexp,A.open)}\${A.close}\`:e}function dr(e){return fr(e,Cr([0],0))}function jt(e){return fr(e,Cr([1],22))}function zn(e){return fr(e,Cr([2],22))}var Vs=new RegExp(["[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)","(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TXZcf-nq-uy=><~]))"].join("|"),"g"),Zn=new Date,xA=(e=>(e[e.CRITICAL=0]="CRITICAL",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(xA||{}),st={0:"\\u{1F4A5}",1:"\\u{1F534}",2:"\\u{1F7E1}",3:"\\u{1F535}",4:"\\u{1F7E3}"},Yn={4:zn,3:dr,2:dr,1:jt,0:jt};function As({message:e}){return String(e)}function tt(e){return JSON.stringify({timestamp:e.date.toISOString(),level:xA[e.level],message:e.message,extra:e.extra})}function et(e){function A(C,E){return[Math.floor(C/E),C%E]}function t(){let C,E=e.date.valueOf()-Zn.valueOf();[E,C]=A(E,1e3);let[_,x]=A(E,60);return\`\${_.toString().padStart(4,"0")}:\${x.toString().padStart(2,"0")}.\${C.toString().padStart(3,"0")}\`}function s(){return e.extra===void 0?"":typeof Deno=="object"?" "+Deno.inspect(e.extra,{compact:!1,colors:!0,trailingComma:!0}).trimStart():" "+JSON.stringify(e.extra)}let i=st[e.level],d=e.logger.name!==void 0?\`@\${e.logger.name}\`:"";return\`\${dr(t())}\${d} \${i} \${Yn[e.level](String(e.message))}\${s()}\`}function rs(e){let A=\`[\${e.date.toISOString()}]\`,t=\`[\${xA[e.level]}]\`,s=e.logger.name!==void 0?\`[\${e.logger.name}] \`:"",i=st[e.level];return\`\${A} \${i} \${t.padEnd(7," ")} \${s}\${e.message}\`}function js(){return typeof Deno=="object"&&Deno.stdout.isTerminal()}var it=class{static sparse=As;static json=tt;static pretty=et;static structured=rs;static default=js()?et:tt;constructor(){}};var ts=class{formatter;consoleObject;filter;constructor(e=it.default,A=4,t=console){this.filter=A,this.formatter=e,this.consoleObject=t}handle(e){let A=this.formatter(e);switch(e.level){case 0:case 1:this.consoleObject.error(A);break;case 2:this.consoleObject.warn(A);break;case 3:this.consoleObject.info(A);break;case 4:this.consoleObject.debug(A);break}}};var W=class{#A;sinks;filter;parent;get name(){return this.#A}constructor(e,A=void 0,t=[],s=void 0){this.#A=A,this.sinks=t,this.filter=e,this.parent=s}log(e,A,t=void 0){let s={date:new Date,level:e,logger:this,message:A,extra:t};this.filter<e||this.insert(s)}insert(e){if(!(this.filter<e.level)){for(let A of this.sinks)A.filter>=e.level&&A.handle(e);this.parent!==void 0&&this.parent.insert(e)}}error=this.log.bind(this,1);warn=this.log.bind(this,2);info=this.log.bind(this,3);debug=this.log.bind(this,4)},cA=globalThis[Symbol.for("odin-global-logger")]??=new W(3,void 0,[new ts]),es=W.prototype.log.bind(cA,1),ns=W.prototype.log.bind(cA,2),lt=W.prototype.log.bind(cA,3),ss=W.prototype.log.bind(cA,4),Qs=W.prototype.log.bind(cA);var ot;function at(e,...A){let t=is(A);ot?ot?.info(e,t):lt(e,t)}function is(...e){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null)return{...e[0]};if(e.length>0)return{args:e}}function DA(e){return e.connectionId*4294967296+e.mediaId}function kt(e){return{mediaId:e%4294967296,connectionId:Math.floor(e/4294967296)}}function U(e,A,t){let s;switch(A){case"f32":s=e.HEAPF32;break;case"u32":s=e.HEAPU32;break;case"i32":s=e.HEAP32;break;case"u8":s=e.HEAPU8;break;default:throw new Error(\`allocating \${A} is not supported\`)}let i=e._malloc(t*s.BYTES_PER_ELEMENT);if(i===0||i%s.BYTES_PER_ELEMENT!==0)throw new Error(\`failed allocating a \${t} \${A} array\`);let d=i/s.BYTES_PER_ELEMENT;return s.subarray(d,d+t)}function tA(e,A){e._free(A.byteOffset)}function qr(e,A,t,s){return{headers:U(e,"i32",t),samples:U(e,"f32",t*kr({sampleRate:A,stereo:s})),length:t,sampleRate:A,stereo:s}}function Gr(e,A){tA(e,A.headers),tA(e,A.samples)}function ut(e,A){return{values:U(e,"f32",2+A*5),length:A}}function ct(e,A){tA(e,A.values)}function dt(e){return{values:U(e,"f32",4)}}function Ct(e,A){tA(e,A.values)}function ft(e){let A=e.length,t=0,s=0;for(;s<A;){let i=e.charCodeAt(s++);if((i&4294967168)===0){t++;continue}else if((i&4294965248)===0)t+=2;else{if(i>=55296&&i<=56319&&s<A){let d=e.charCodeAt(s);(d&64512)===56320&&(++s,i=((i&1023)<<10)+(d&1023)+65536)}(i&4294901760)===0?t+=3:t+=4}}return t}function ls(e,A,t){let s=e.length,i=t,d=0;for(;d<s;){let C=e.charCodeAt(d++);if((C&4294967168)===0){A[i++]=C;continue}else if((C&4294965248)===0)A[i++]=C>>6&31|192;else{if(C>=55296&&C<=56319&&d<s){let E=e.charCodeAt(d);(E&64512)===56320&&(++d,C=((C&1023)<<10)+(E&1023)+65536)}(C&4294901760)===0?(A[i++]=C>>12&15|224,A[i++]=C>>6&63|128):(A[i++]=C>>18&7|240,A[i++]=C>>12&63|128,A[i++]=C>>6&63|128)}A[i++]=C&63|128}}var os=new TextEncoder,as=50;function ks(e,A,t){os.encodeInto(e,A.subarray(t))}function qt(e,A,t){e.length>as?ks(e,A,t):ls(e,A,t)}var us=4096;function pr(e,A,t){let s=A,i=s+t,d=[],C="";for(;s<i;){let E=e[s++];if((E&128)===0)d.push(E);else if((E&224)===192){let _=e[s++]&63;d.push((E&31)<<6|_)}else if((E&240)===224){let _=e[s++]&63,x=e[s++]&63;d.push((E&31)<<12|_<<6|x)}else if((E&248)===240){let _=e[s++]&63,x=e[s++]&63,UA=e[s++]&63,T=(E&7)<<18|_<<12|x<<6|UA;T>65535&&(T-=65536,d.push(T>>>10&1023|55296),T=56320|T&1023),d.push(T)}else d.push(E);d.length>=us&&(C+=String.fromCharCode(...d),d.length=0)}return d.length>0&&(C+=String.fromCharCode(...d)),C}var cs=new TextDecoder,ds=200;function Cs(e,A,t){let s=e.subarray(A,A+t);return cs.decode(s)}function Gt(e,A,t){return t>ds?Cs(e,A,t):pr(e,A,t)}var X=class{type;data;constructor(A,t){this.type=A,this.data=t}};var L=class e extends Error{constructor(A){super(A);let t=Object.create(e.prototype);Object.setPrototypeOf(this,t),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:e.name})}};function pt(e,A,t){let s=t/4294967296,i=t;e.setUint32(A,s),e.setUint32(A+4,i)}function BA(e,A,t){let s=Math.floor(t/4294967296),i=t;e.setUint32(A,s),e.setUint32(A+4,i)}function NA(e,A){let t=e.getInt32(A),s=e.getUint32(A+4);return t*4294967296+s}function Et(e,A){let t=e.getUint32(A),s=e.getUint32(A+4);return t*4294967296+s}var fs=-1,qs=4294967296-1,Gs=17179869184-1;function ps({sec:e,nsec:A}){if(e>=0&&A>=0&&e<=Gs)if(A===0&&e<=qs){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),t}else{let t=e/4294967296,s=e&4294967295,i=new Uint8Array(8),d=new DataView(i.buffer);return d.setUint32(0,A<<2|t&3),d.setUint32(4,s),i}else{let t=new Uint8Array(12),s=new DataView(t.buffer);return s.setUint32(0,A),BA(s,4,e),t}}function Es(e){let A=e.getTime(),t=Math.floor(A/1e3),s=(A-t*1e3)*1e6,i=Math.floor(s/1e9);return{sec:t+i,nsec:s-i*1e9}}function ms(e){if(e instanceof Date){let A=Es(e);return ps(A)}else return null}function hs(e){let A=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:A.getUint32(0),nsec:0};case 8:{let t=A.getUint32(0),s=A.getUint32(4),i=(t&3)*4294967296+s,d=t>>>2;return{sec:i,nsec:d}}case 12:{let t=NA(A,4),s=A.getUint32(0);return{sec:t,nsec:s}}default:throw new L(\`Unrecognized data size for timestamp (expected 4, 8, or 12): \${e.length}\`)}}function $s(e){let A=hs(e);return new Date(A.sec*1e3+A.nsec/1e6)}var mt={type:fs,encode:ms,decode:$s};var eA=class e{static defaultCodec=new e;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(mt)}register({type:A,encode:t,decode:s}){if(A>=0)this.encoders[A]=t,this.decoders[A]=s;else{let i=-1-A;this.builtInEncoders[i]=t,this.builtInDecoders[i]=s}}tryToEncode(A,t){for(let s=0;s<this.builtInEncoders.length;s++){let i=this.builtInEncoders[s];if(i!=null){let d=i(A,t);if(d!=null){let C=-1-s;return new X(C,d)}}}for(let s=0;s<this.encoders.length;s++){let i=this.encoders[s];if(i!=null){let d=i(A,t);if(d!=null){let C=s;return new X(C,d)}}}return A instanceof X?A:null}decode(A,t,s){let i=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return i?i(A,t,s):new X(t,A)}};function Fs(e){return e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function dA(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):Fs(e)?new Uint8Array(e):Uint8Array.from(e)}var vs=100,Is=2048,bA=class e{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(A){this.extensionCodec=A?.extensionCodec??eA.defaultCodec,this.context=A?.context,this.useBigInt64=A?.useBigInt64??!1,this.maxDepth=A?.maxDepth??vs,this.initialBufferSize=A?.initialBufferSize??Is,this.sortKeys=A?.sortKeys??!1,this.forceFloat32=A?.forceFloat32??!1,this.ignoreUndefined=A?.ignoreUndefined??!1,this.forceIntegerToFloat=A?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new e({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(A){if(this.entered)return this.clone().encodeSharedRef(A);try{return this.entered=!0,this.reinitializeState(),this.doEncode(A,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(A){if(this.entered)return this.clone().encode(A);try{return this.entered=!0,this.reinitializeState(),this.doEncode(A,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(A,t){if(t>this.maxDepth)throw new Error(\`Too deep objects in depth \${t}\`);A==null?this.encodeNil():typeof A=="boolean"?this.encodeBoolean(A):typeof A=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(A):this.encodeNumber(A):typeof A=="string"?this.encodeString(A):this.useBigInt64&&typeof A=="bigint"?this.encodeBigInt64(A):this.encodeObject(A,t)}ensureBufferSizeToWrite(A){let t=this.pos+A;this.view.byteLength<t&&this.resizeBuffer(t*2)}resizeBuffer(A){let t=new ArrayBuffer(A),s=new Uint8Array(t),i=new DataView(t);s.set(this.bytes),this.view=i,this.bytes=s}encodeNil(){this.writeU8(192)}encodeBoolean(A){A===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(A){!this.forceIntegerToFloat&&Number.isSafeInteger(A)?A>=0?A<128?this.writeU8(A):A<256?(this.writeU8(204),this.writeU8(A)):A<65536?(this.writeU8(205),this.writeU16(A)):A<4294967296?(this.writeU8(206),this.writeU32(A)):this.useBigInt64?this.encodeNumberAsFloat(A):(this.writeU8(207),this.writeU64(A)):A>=-32?this.writeU8(224|A+32):A>=-128?(this.writeU8(208),this.writeI8(A)):A>=-32768?(this.writeU8(209),this.writeI16(A)):A>=-2147483648?(this.writeU8(210),this.writeI32(A)):this.useBigInt64?this.encodeNumberAsFloat(A):(this.writeU8(211),this.writeI64(A)):this.encodeNumberAsFloat(A)}encodeNumberAsFloat(A){this.forceFloat32?(this.writeU8(202),this.writeF32(A)):(this.writeU8(203),this.writeF64(A))}encodeBigInt64(A){A>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(A)):(this.writeU8(211),this.writeBigInt64(A))}writeStringHeader(A){if(A<32)this.writeU8(160+A);else if(A<256)this.writeU8(217),this.writeU8(A);else if(A<65536)this.writeU8(218),this.writeU16(A);else if(A<4294967296)this.writeU8(219),this.writeU32(A);else throw new Error(\`Too long string: \${A} bytes in UTF-8\`)}encodeString(A){let s=ft(A);this.ensureBufferSizeToWrite(5+s),this.writeStringHeader(s),qt(A,this.bytes,this.pos),this.pos+=s}encodeObject(A,t){let s=this.extensionCodec.tryToEncode(A,this.context);if(s!=null)this.encodeExtension(s);else if(Array.isArray(A))this.encodeArray(A,t);else if(ArrayBuffer.isView(A))this.encodeBinary(A);else if(typeof A=="object")this.encodeMap(A,t);else throw new Error(\`Unrecognized object: \${Object.prototype.toString.apply(A)}\`)}encodeBinary(A){let t=A.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<4294967296)this.writeU8(198),this.writeU32(t);else throw new Error(\`Too large binary: \${t}\`);let s=dA(A);this.writeU8a(s)}encodeArray(A,t){let s=A.length;if(s<16)this.writeU8(144+s);else if(s<65536)this.writeU8(220),this.writeU16(s);else if(s<4294967296)this.writeU8(221),this.writeU32(s);else throw new Error(\`Too large array: \${s}\`);for(let i of A)this.doEncode(i,t+1)}countWithoutUndefined(A,t){let s=0;for(let i of t)A[i]!==void 0&&s++;return s}encodeMap(A,t){let s=Object.keys(A);this.sortKeys&&s.sort();let i=this.ignoreUndefined?this.countWithoutUndefined(A,s):s.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(\`Too large map object: \${i}\`);for(let d of s){let C=A[d];this.ignoreUndefined&&C===void 0||(this.encodeString(d),this.doEncode(C,t+1))}}encodeExtension(A){if(typeof A.data=="function"){let s=A.data(this.pos+6),i=s.length;if(i>=4294967296)throw new Error(\`Too large extension object: \${i}\`);this.writeU8(201),this.writeU32(i),this.writeI8(A.type),this.writeU8a(s);return}let t=A.data.length;if(t===1)this.writeU8(212);else if(t===2)this.writeU8(213);else if(t===4)this.writeU8(214);else if(t===8)this.writeU8(215);else if(t===16)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<4294967296)this.writeU8(201),this.writeU32(t);else throw new Error(\`Too large extension object: \${t}\`);this.writeI8(A.type),this.writeU8a(A.data)}writeU8(A){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,A),this.pos++}writeU8a(A){let t=A.length;this.ensureBufferSizeToWrite(t),this.bytes.set(A,this.pos),this.pos+=t}writeI8(A){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,A),this.pos++}writeU16(A){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,A),this.pos+=2}writeI16(A){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,A),this.pos+=2}writeU32(A){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,A),this.pos+=4}writeI32(A){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,A),this.pos+=4}writeF32(A){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,A),this.pos+=4}writeF64(A){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,A),this.pos+=8}writeU64(A){this.ensureBufferSizeToWrite(8),pt(this.view,this.pos,A),this.pos+=8}writeI64(A){this.ensureBufferSizeToWrite(8),BA(this.view,this.pos,A),this.pos+=8}writeBigUint64(A){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,A),this.pos+=8}writeBigInt64(A){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,A),this.pos+=8}};function Er(e,A){return new bA(A).encodeSharedRef(e)}function OA(e){return\`\${e<0?"-":""}0x\${Math.abs(e).toString(16).padStart(2,"0")}\`}var _s=16,Hs=16,JA=class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(A=_s,t=Hs){this.maxKeyLength=A,this.maxLengthPerKey=t,this.caches=[];for(let s=0;s<this.maxKeyLength;s++)this.caches.push([])}canBeCached(A){return A>0&&A<=this.maxKeyLength}find(A,t,s){let i=this.caches[s-1];A:for(let d of i){let C=d.bytes;for(let E=0;E<s;E++)if(C[E]!==A[t+E])continue A;return d.str}return null}store(A,t){let s=this.caches[A.length-1],i={bytes:A,str:t};s.length>=this.maxLengthPerKey?s[Math.random()*s.length|0]=i:s.push(i)}decode(A,t,s){let i=this.find(A,t,s);if(i!=null)return this.hit++,i;this.miss++;let d=pr(A,t,s),C=Uint8Array.prototype.slice.call(A,t,t+s);return this.store(C,d),d}};var mr="array",qA="map_key",$t="map_value",Ls=e=>{if(typeof e=="string"||typeof e=="number")return e;throw new L("The type of key must be string or number but "+typeof e)},hr=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(A){let t=this.getUninitializedStateFromPool();t.type=mr,t.position=0,t.size=A,t.array=new Array(A)}pushMapState(A){let t=this.getUninitializedStateFromPool();t.type=qA,t.readCount=0,t.size=A,t.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let A={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(A)}return this.stack[this.stackHeadPosition]}release(A){if(this.stack[this.stackHeadPosition]!==A)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(A.type===mr){let s=A;s.size=0,s.array=void 0,s.position=0,s.type=void 0}if(A.type===qA||A.type===$t){let s=A;s.size=0,s.map=void 0,s.readCount=0,s.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},fA=-1,$r=new DataView(new ArrayBuffer(0)),ys=new Uint8Array($r.buffer);try{$r.getInt8(0)}catch(e){if(!(e instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var ht=new RangeError("Insufficient data"),gs=new JA,PA=class e{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=$r;bytes=ys;headByte=fA;stack=new hr;entered=!1;constructor(A){this.extensionCodec=A?.extensionCodec??eA.defaultCodec,this.context=A?.context,this.useBigInt64=A?.useBigInt64??!1,this.rawStrings=A?.rawStrings??!1,this.maxStrLength=A?.maxStrLength??4294967295,this.maxBinLength=A?.maxBinLength??4294967295,this.maxArrayLength=A?.maxArrayLength??4294967295,this.maxMapLength=A?.maxMapLength??4294967295,this.maxExtLength=A?.maxExtLength??4294967295,this.keyDecoder=A?.keyDecoder!==void 0?A.keyDecoder:gs,this.mapKeyConverter=A?.mapKeyConverter??Ls}clone(){return new e({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=fA,this.stack.reset()}setBuffer(A){let t=dA(A);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(A){if(this.headByte===fA&&!this.hasRemaining(1))this.setBuffer(A);else{let t=this.bytes.subarray(this.pos),s=dA(A),i=new Uint8Array(t.length+s.length);i.set(t),i.set(s,t.length),this.setBuffer(i)}}hasRemaining(A){return this.view.byteLength-this.pos>=A}createExtraByteError(A){let{view:t,pos:s}=this;return new RangeError(\`Extra \${t.byteLength-s} of \${t.byteLength} byte(s) found at buffer[\${A}]\`)}decode(A){if(this.entered)return this.clone().decode(A);try{this.entered=!0,this.reinitializeState(),this.setBuffer(A);let t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(A){if(this.entered){yield*this.clone().decodeMulti(A);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(A);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(A){if(this.entered)return this.clone().decodeAsync(A);try{this.entered=!0;let t=!1,s;for await(let E of A){if(t)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(E);try{s=this.doDecodeSync(),t=!0}catch(_){if(!(_ instanceof RangeError))throw _}this.totalPos+=this.pos}if(t){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return s}let{headByte:i,pos:d,totalPos:C}=this;throw new RangeError(\`Insufficient data in parsing \${OA(i)} at \${C} (\${d} in the current buffer)\`)}finally{this.entered=!1}}decodeArrayStream(A){return this.decodeMultiAsync(A,!0)}decodeStream(A){return this.decodeMultiAsync(A,!1)}async*decodeMultiAsync(A,t){if(this.entered){yield*this.clone().decodeMultiAsync(A,t);return}try{this.entered=!0;let s=t,i=-1;for await(let d of A){if(t&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(d),s&&(i=this.readArraySize(),s=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(C){if(!(C instanceof RangeError))throw C}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){A:for(;;){let A=this.readHeadByte(),t;if(A>=224)t=A-256;else if(A<192)if(A<128)t=A;else if(A<144){let i=A-128;if(i!==0){this.pushMapState(i),this.complete();continue A}else t={}}else if(A<160){let i=A-144;if(i!==0){this.pushArrayState(i),this.complete();continue A}else t=[]}else{let i=A-160;t=this.decodeString(i,0)}else if(A===192)t=null;else if(A===194)t=!1;else if(A===195)t=!0;else if(A===202)t=this.readF32();else if(A===203)t=this.readF64();else if(A===204)t=this.readU8();else if(A===205)t=this.readU16();else if(A===206)t=this.readU32();else if(A===207)this.useBigInt64?t=this.readU64AsBigInt():t=this.readU64();else if(A===208)t=this.readI8();else if(A===209)t=this.readI16();else if(A===210)t=this.readI32();else if(A===211)this.useBigInt64?t=this.readI64AsBigInt():t=this.readI64();else if(A===217){let i=this.lookU8();t=this.decodeString(i,1)}else if(A===218){let i=this.lookU16();t=this.decodeString(i,2)}else if(A===219){let i=this.lookU32();t=this.decodeString(i,4)}else if(A===220){let i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue A}else t=[]}else if(A===221){let i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue A}else t=[]}else if(A===222){let i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue A}else t={}}else if(A===223){let i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue A}else t={}}else if(A===196){let i=this.lookU8();t=this.decodeBinary(i,1)}else if(A===197){let i=this.lookU16();t=this.decodeBinary(i,2)}else if(A===198){let i=this.lookU32();t=this.decodeBinary(i,4)}else if(A===212)t=this.decodeExtension(1,0);else if(A===213)t=this.decodeExtension(2,0);else if(A===214)t=this.decodeExtension(4,0);else if(A===215)t=this.decodeExtension(8,0);else if(A===216)t=this.decodeExtension(16,0);else if(A===199){let i=this.lookU8();t=this.decodeExtension(i,1)}else if(A===200){let i=this.lookU16();t=this.decodeExtension(i,2)}else if(A===201){let i=this.lookU32();t=this.decodeExtension(i,4)}else throw new L(\`Unrecognized type byte: \${OA(A)}\`);this.complete();let s=this.stack;for(;s.length>0;){let i=s.top();if(i.type===mr)if(i.array[i.position]=t,i.position++,i.position===i.size)t=i.array,s.release(i);else continue A;else if(i.type===qA){if(t==="__proto__")throw new L("The key __proto__ is not allowed");i.key=this.mapKeyConverter(t),i.type=$t;continue A}else if(i.map[i.key]=t,i.readCount++,i.readCount===i.size)t=i.map,s.release(i);else{i.key=null,i.type=qA;continue A}}return t}}readHeadByte(){return this.headByte===fA&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=fA}readArraySize(){let A=this.readHeadByte();switch(A){case 220:return this.readU16();case 221:return this.readU32();default:{if(A<160)return A-144;throw new L(\`Unrecognized array type byte: \${OA(A)}\`)}}}pushMapState(A){if(A>this.maxMapLength)throw new L(\`Max length exceeded: map length (\${A}) > maxMapLengthLength (\${this.maxMapLength})\`);this.stack.pushMapState(A)}pushArrayState(A){if(A>this.maxArrayLength)throw new L(\`Max length exceeded: array length (\${A}) > maxArrayLength (\${this.maxArrayLength})\`);this.stack.pushArrayState(A)}decodeString(A,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(A,t):this.decodeBinary(A,t)}decodeUtf8String(A,t){if(A>this.maxStrLength)throw new L(\`Max length exceeded: UTF-8 byte length (\${A}) > maxStrLength (\${this.maxStrLength})\`);if(this.bytes.byteLength<this.pos+t+A)throw ht;let s=this.pos+t,i;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(A)?i=this.keyDecoder.decode(this.bytes,s,A):i=Gt(this.bytes,s,A),this.pos+=t+A,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===qA:!1}decodeBinary(A,t){if(A>this.maxBinLength)throw new L(\`Max length exceeded: bin length (\${A}) > maxBinLength (\${this.maxBinLength})\`);if(!this.hasRemaining(A+t))throw ht;let s=this.pos+t,i=this.bytes.subarray(s,s+A);return this.pos+=t+A,i}decodeExtension(A,t){if(A>this.maxExtLength)throw new L(\`Max length exceeded: ext length (\${A}) > maxExtLength (\${this.maxExtLength})\`);let s=this.view.getInt8(this.pos+t),i=this.decodeBinary(A,t+1);return this.extensionCodec.decode(i,s,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let A=this.view.getUint8(this.pos);return this.pos++,A}readI8(){let A=this.view.getInt8(this.pos);return this.pos++,A}readU16(){let A=this.view.getUint16(this.pos);return this.pos+=2,A}readI16(){let A=this.view.getInt16(this.pos);return this.pos+=2,A}readU32(){let A=this.view.getUint32(this.pos);return this.pos+=4,A}readI32(){let A=this.view.getInt32(this.pos);return this.pos+=4,A}readU64(){let A=Et(this.view,this.pos);return this.pos+=8,A}readI64(){let A=NA(this.view,this.pos);return this.pos+=8,A}readU64AsBigInt(){let A=this.view.getBigUint64(this.pos);return this.pos+=8,A}readI64AsBigInt(){let A=this.view.getBigInt64(this.pos);return this.pos+=8,A}readF32(){let A=this.view.getFloat32(this.pos);return this.pos+=4,A}readF64(){let A=this.view.getFloat64(this.pos);return this.pos+=8,A}};function Fr(e,A){return new PA(A).decode(e)}var GA=class e{constructor(A,t,s,i,d){this.mediaIds=A;this.sequenceNumber=t;this.timeStamp=s;this.isEndOfSpurt=i;this.payload=d}static parse(A){let t;try{t=Fr(A)}catch{return B("not valid msgpack")}if(!Array.isArray(t))return B("container must be an array");if(t.length<6)return B("missing fields");if(t[0]!==1)return B("unknown type");if(!Array.isArray(t[1]))return B("media ids must be an array");if(!t[1].every(x=>typeof x=="number"))return B("media ids must be numbers");if(typeof t[2]!="number")return B("sequence number must be a number");if(typeof t[3]!="number")return B("timestamp must be a number");if(typeof t[4]!="number")return B("flags must be a number");let s=t[1],i=t[2]>>>0,d=t[3]>>>0,E=(t[4]&1)!==0,_=t[t.length-1];return _ instanceof Uint8Array?nt(new e(s,i,d,E,_)):B("payload must be bytes")}toBytes(){let A=Number(this.isEndOfSpurt),t=[1,this.mediaIds,this.sequenceNumber>>>0,this.timeStamp>>>0,A,this.payload];return new Uint8Array(Er(t,{forceFloat32:!0,ignoreUndefined:!0}))}};var wA=class{constructor(A,t){this.sampleRate=A;this.wasm=t;this.sequenceNumber=Math.random()*Math.pow(2,32)>>0;this.timestamp=Math.random()*Math.pow(2,32)>>0;this.connections=[];this.monitoring=!1;this.active=!1;this.stats={numberPackets:0,numberTicks:0,numberPacketError:0,numberPacketsMediaNotFound:0};this.encoder=new t.Encoder(A,15,!0,O.VadPreload),this.encoder.complexity=navigator.hardwareConcurrency>=4?6:4,this.information=dt(this.wasm),this.outBuffer=U(this.wasm,"u8",1270),Yj(this.information,1)}setVad(A){this.encoder.set_volume_gate(A.volumeGate!==void 0,A.volumeGate?.attackThreshold??0,A.volumeGate?.releaseThreshold??0),this.encoder.set_speech_detection(A.voiceActivity!==void 0,A.voiceActivity?.attackThreshold??0,A.voiceActivity?.releaseThreshold??0)}setMedias(A){this.connections=A.filter(({mediaIds:t})=>t.length>0)}close(){Ct(this.wasm,this.information),tA(this.wasm,this.outBuffer),this.encoder.delete()}encode(A){for(this.encoder.push(A.byteOffset,this.information.values.byteOffset);;){let t=this.encoder.pop(this.connections.length===0?0:this.outBuffer.byteOffset,this.outBuffer.length);if(t===0)break;if(t<0){at(\`failed encoding packet: \${t}\`);return}if(this.timestamp=this.timestamp+1800>>0,t===1)continue;this.sequenceNumber=this.sequenceNumber+1>>0;let s=this.active&&!this.encoder.active;this.active=this.encoder.active,this.monitoring=this.connections.some(i=>i.id===0);for(let i of this.connections){if(this.monitoring&&i.id!==0)continue;let d=new GA(i.mediaIds,this.sequenceNumber,this.timestamp,s,this.outBuffer.subarray(0,t));uA(globalThis,["sendPacket",{connectionId:i.id,packet:d.toBytes()}])}}}onMessage(A){let[t,s]=A;switch(t){case"captureSetVad":this?.setVad(s);break;case"captureSetMedias":this?.setMedias(s.connections);break;case"close":this.close();break;case"dump":s.result.postMessage(this.dump());break}}dump(){return{sequenceNumber:this.sequenceNumber,timestamp:this.timestamp,connections:this.connections.map(A=>\`\${A.id} => \${A.mediaIds.join(",")}\`),active:this.active,monitoring:this.monitoring,information:{active:Wj(this.information),speechProbability:Xj(this.information),rmsDBFS:zj(this.information),volume:Zj(this.information)},encoder:{sample_rate:this.encoder.sample_rate,fec_packet_loss:this.encoder.fec_packet_loss,voip:this.encoder.voip,vad_preload:this.encoder.vad_preload,complexity:this.encoder.complexity,speech_probability:this.encoder.speech_probability,rms_dbfs:this.encoder.rms_dbfs,active:this.encoder.active,speech_detection_enabled:this.encoder.speech_detection_enabled,speech_detection_going_active:this.encoder.speech_detection_going_active,speech_detection_going_inactive:this.encoder.speech_detection_going_inactive,volume_gate_enabled:this.encoder.volume_gate_enabled,volume_gate_going_active:this.encoder.volume_gate_going_active,volume_gate_going_inactive:this.encoder.volume_gate_going_inactive}}}},TA=class{constructor(A){this.wasm=A;this.medias=new Map;this.stats={numberPackets:0,numberTicks:0,numberPacketError:0,numberPacketsMediaNotFound:0,numberTicksWithAudio:0};this.largestIndex=-1;this.decoders=U(this.wasm,"u32",O.MaxNumberOfDecoders),this.information=ut(this.wasm,O.MaxNumberOfDecoders),wj(this.information,[1,1])}close(){ct(this.wasm,this.information);for(let{decoder:A}of this.medias.values())A.delete()}receivePacket(A,t){this.stats.numberPackets++;let s=GA.parse(t);if(s.type==="Failure"){this.stats.numberPacketError++;let i=Array.from(t).map(d=>d.toString(16).padStart(2,"0")).join("");console.error(\`failed decoding audio packet; reason: \${s.reason}, connection: \${A}, dump: \${i}\`);return}for(let i of s.value.mediaIds){let d=this.medias.get(DA({connectionId:A,mediaId:i}));if(d===void 0){this.stats.numberPacketsMediaNotFound++;continue}d.lastPacket=t;let C=U(this.wasm,"u8",s.value.payload.length);C.set(s.value.payload),d.decoder.push(s.value.sequenceNumber,s.value.timeStamp,s.value.isEndOfSpurt,C.byteOffset,C.length)}}insertMedia(A,t,s,i=[1,1]){let d=DA({connectionId:t,mediaId:s}),C=new this.wasm.Decoder;this.medias.set(d,{index:A,decoder:C,lastPacket:void 0}),this.decoders[A]=C.$$.ptr,this.largestIndex=Math.max(this.largestIndex,A),Uj(this.information,A,i),Qj(this.information,A,0),Rj(this.information,A,0)}removeMedia(A,t,s){let i=DA({connectionId:t,mediaId:s}),d=this.medias.get(i);if(!(d===void 0||d.index!==A)&&(this.medias.delete(i),Sj(this.information,A,0),this.decoders[A]=0,d.decoder.delete(),A===this.largestIndex)){for(A=A-1;A>=0&&this.decoders[A]===0;A--);this.largestIndex=A}}decode(A){return{hasAudio:this.wasm.pop_many(this.decoders.byteOffset,this.information.values.byteOffset,this.largestIndex+1,A.byteOffset)}}onMessage(A){let[t,s]=A;switch(t){case"playbackReceivePacket":this.receivePacket(s.connectionId,s.packet);break;case"playbackUpdateMedias":for(let{index:i,connectionId:d,mediaId:C}of s.removed)this.removeMedia(i,d,C);for(let{index:i,connectionId:d,mediaId:C,volume:E}of s.added)this.insertMedia(i,d,C,E);break;case"close":this.close();break;case"dump":s.result.postMessage(this.dump());break}}dump(){let A=[];for(let[t,s]of this.medias){let i=kt(t);A.push({index:s.index,connectionId:i.connectionId,mediaId:i.mediaId,rmsDBFS:Tj(this.information,s.index),volume:Mj(this.information,s.index),voicedBlocks:Vj(this.information,s.index),silentBlocks:Kj(this.information,s.index),time:s.decoder.time,consecutive_silence:s.decoder.consecutive_silence,last_voiced_time_point:s.decoder.last_voiced_time_point,sequence_number:s.decoder.sequence_number,packetsSeen:s.decoder.packets_seen,packetsInvalid:s.decoder.packets_invalid,packetsTooLate:s.decoder.packets_too_late,packetsTooEarly:s.decoder.packets_too_early,packetsRepeated:s.decoder.packets_repeated,packetsProcessed:s.decoder.packets_processed,packetsLost:s.decoder.packets_lost,rewinds:s.decoder.rewinds,cacheLength:s.decoder.cache_length,lastPacket:At(s.lastPacket)})}return{largestIndex:this.largestIndex,globalVolume:Pj(this.information),decoders:A}}};var Lt=Fn(vt()),It=(0,Lt.default)(),_t,Ht;globalThis.addEventListener("message",e=>{vr(e).catch(console.error)});async function vr(e){let A=e.data,[t,s]=A;switch(t){case"captureInit":s.workletPort.onmessage=vr,_t=new Ir(s.sampleRate,await It);break;case"playbackInit":s.workletPort.onmessage=vr,Ht=new _r(await It);break;case"close":globalThis.close();break}_t?.onMessage(A),Ht?.onMessage(A)}var Ir=class extends wA{constructor(t,s){super(t,s);this.id=-1;this.samples=qr(this.wasm,t,2+O.VadPreload+O.AdditionalCaptureBlocks,!1),uA(globalThis,["captureReady",{sampleBuffer:this.samples,informationBuffer:this.information}])}close(){super.close(),Gr(this.wasm,this.samples)}onMessage(t){super.onMessage(t);let[s,i]=t;s==="captureTick"&&this.tick(i.id)}tick(t){for(;this.id<t;this.id+=1)this.encode(ur(this.samples,this.id%this.samples.length))}dump(){return{type:"shared capture worker",id:this.id,sampleRate:this.samples.sampleRate,stereo:this.samples.stereo,length:this.samples.length,...super.dump()}}},_r=class extends TA{constructor(A){super(A);let t=2+O.AdditionalPlaybackBlocks;this.sampleBuffer=qr(A,48e3,t,!0),this.sampleBuffer.samples.fill(0),this.prefill=t-2;for(let s=0;s<this.prefill;s++)cr(this.sampleBuffer,s,{id:s});this.id=this.prefill,uA(globalThis,["playbackReady",{sampleBuffer:this.sampleBuffer,informationBuffer:this.information}])}close(){super.close(),Gr(this.wasm,this.sampleBuffer)}onMessage(A){super.onMessage(A);let[t,s]=A;t==="playbackTick"&&this.tick(s.id)}tick(A){for(this.stats.numberTicks++;this.id<A+this.prefill;this.id++){let t=this.id%this.sampleBuffer.length,{hasAudio:s}=this.decode(ur(this.sampleBuffer,t));s&&(this.stats.numberTicksWithAudio++,cr(this.sampleBuffer,t,{id:this.id}))}}dump(){return{type:"shared playback worker",id:this.id,prefill:this.prefill,sampleRate:this.sampleBuffer.sampleRate,stereo:this.sampleBuffer.stereo,...super.dump()}}};})();
|
|
3380
|
-
`;var p='"use strict";(()=>{var
|
|
3380
|
+
`;var p='"use strict";(()=>{var E=Object.defineProperty;var M=(e,t)=>{for(var r in t)E(e,r,{get:t[r],enumerable:!0})};var l={};M(l,{AdditionalCaptureBlocks:()=>D,AdditionalPlaybackBlocks:()=>C,ClockJumpCheckInterval:()=>j,ClockJumpThreshold:()=>$,ConnectInterval:()=>ee,ConnectTimeout:()=>X,DefaultRefreshRate:()=>V,DefaultVideoCodec:()=>re,HealthCheckTimeout:()=>W,MainConnectionPingInterval:()=>H,MaxNumberOfDecoders:()=>N,MaxReconnectDuration:()=>te,MinDBFs:()=>k,MinTokenLifetime:()=>K,MinTokenRefreshInterval:()=>Y,PlaybackPreload:()=>L,RenderQuantumSize:()=>_,VadPreload:()=>O,WebRtcAnswerTimeout:()=>Z,WebRtcIceTimeout:()=>J,WebRtcMaxNegotiationAttempts:()=>q,WebRtcRecoveryDelays:()=>Q,WebRtcStatsSnapshotInterval:()=>G,WebRtcTimeout:()=>z});var C=3,D=3,L=3,V=250,O=3,N=512,_=128,k=-758.596,W=1e4,j=1e3,$=1e4,H=3e3,G=1e3,J=3e3,z=1e4,Z=1e4,q=3,Q=[0,2e3,5e3],X=5e3,K=6e4,Y=5e3,ee=[0,100,200,200,500],te=12e4,re="H264";function p(e,t,r){return e.postMessage(t,r)}function ne(e){return e.sampleRate*.02*(e.stereo?2:1)}function f(e,t){let r=ne(e),n=r*t,s=n+r;return e.samples.subarray(n,s)}function S(e,t){return{id:e.headers[t]}}function I(e,t,r){e.headers[t]=r.id}var se;(e=>{let t;(r=>(r[r.InvalidPassword=-1]="InvalidPassword",r[r.Unknown=0]="Unknown",r[r.Unencrypted=1]="Unencrypted",r[r.Encrypted=2]="Encrypted"))(t=e.PeerCipherStatus||={})})(se||={});var{Deno:T}=globalThis,oe=typeof T?.noColor=="boolean"?T.noColor:!1,ae=!oe;function h(e,t){return{open:`\\x1B[${e.join(";")}m`,close:`\\x1B[${t}m`,regexp:new RegExp(`\\\\x1b\\\\[${t}m`,"g")}}function b(e,t){return ae?`${t.open}${e.replace(t.regexp,t.open)}${t.close}`:e}function m(e){return b(e,h([0],0))}function U(e){return b(e,h([1],22))}function ie(e){return b(e,h([2],22))}var Ae=new RegExp(["[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)","(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TXZcf-nq-uy=><~]))"].join("|"),"g"),ce=new Date,d=(e=>(e[e.CRITICAL=0]="CRITICAL",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(d||{}),F={0:"\\u{1F4A5}",1:"\\u{1F534}",2:"\\u{1F7E1}",3:"\\u{1F535}",4:"\\u{1F7E3}"},le={4:ie,3:m,2:m,1:U,0:U};function ue({message:e}){return String(e)}function B(e){return JSON.stringify({timestamp:e.date.toISOString(),level:d[e.level],message:e.message,extra:e.extra})}function w(e){function t(c,i){return[Math.floor(c/i),c%i]}function r(){let c,i=e.date.valueOf()-ce.valueOf();[i,c]=t(i,1e3);let[P,R]=t(i,60);return`${P.toString().padStart(4,"0")}:${R.toString().padStart(2,"0")}.${c.toString().padStart(3,"0")}`}function n(){return e.extra===void 0?"":typeof Deno=="object"?" "+Deno.inspect(e.extra,{compact:!1,colors:!0,trailingComma:!0}).trimStart():" "+JSON.stringify(e.extra)}let s=F[e.level],a=e.logger.name!==void 0?`@${e.logger.name}`:"";return`${m(r())}${a} ${s} ${le[e.level](String(e.message))}${n()}`}function fe(e){let t=`[${e.date.toISOString()}]`,r=`[${d[e.level]}]`,n=e.logger.name!==void 0?`[${e.logger.name}] `:"",s=F[e.level];return`${t} ${s} ${r.padEnd(7," ")} ${n}${e.message}`}function de(){return typeof Deno=="object"&&Deno.stdout.isTerminal()}var A=class{static sparse=ue;static json=B;static pretty=w;static structured=fe;static default=de()?w:B;constructor(){}};var pe=class{formatter;consoleObject;filter;constructor(e=A.default,t=4,r=console){this.filter=t,this.formatter=e,this.consoleObject=r}handle(e){let t=this.formatter(e);switch(e.level){case 0:case 1:this.consoleObject.error(t);break;case 2:this.consoleObject.warn(t);break;case 3:this.consoleObject.info(t);break;case 4:this.consoleObject.debug(t);break}}};var o=class{#e;sinks;filter;parent;get name(){return this.#e}constructor(e,t=void 0,r=[],n=void 0){this.#e=t,this.sinks=r,this.filter=e,this.parent=n}log(e,t,r=void 0){let n={date:new Date,level:e,logger:this,message:t,extra:r};this.filter<e||this.insert(n)}insert(e){if(!(this.filter<e.level)){for(let t of this.sinks)t.filter>=e.level&&t.handle(e);this.parent!==void 0&&this.parent.insert(e)}}error=this.log.bind(this,1);warn=this.log.bind(this,2);info=this.log.bind(this,3);debug=this.log.bind(this,4)},u=globalThis[Symbol.for("odin-global-logger")]??=new o(3,void 0,[new pe]),me=o.prototype.log.bind(u,1),he=o.prototype.log.bind(u,2),be=o.prototype.log.bind(u,3),xe=o.prototype.log.bind(u,4),Pe=o.prototype.log.bind(u);var x=class extends AudioWorkletProcessor{constructor(){super();this.alive=!0;this.blocks=0;this.port.onmessage=this.onMessage.bind(this)}async onMessage(r){let[n,s]=r.data;switch(n){case"init":this.state=new g(s.sampleBuffer,s.workerPort,sampleRate*.02);break;case"close":this.alive=!1;break;case"dump":s.result.postMessage(this.dump());break}}process(r,n,s){if(this.state===void 0||r.length<1||r[0].length<1)return this.alive;let a=this.state.fill(0,r[0][0]);return this.state.offset===this.state.length&&(this.blocks+=1,this.state.flush(),this.state.fill(a,r[0][0])),this.alive}dump(){return{type:"shared capture worklet",alive:this.alive,sampleRate,id:this.state?.id||null,offset:this.state?.offset||null,length:this.state?.length||null,blocks:this.blocks}}},y=class extends AudioWorkletProcessor{constructor(){super();this.alive=!0;this.silenceBlocks=0;this.voiceBlocks=0;this.totalBlocks=0;this.port.onmessage=this.onMessage.bind(this)}async onMessage(r){let[n,s]=r.data;switch(n){case"close":this.alive=!1;break;case"init":this.state=new v(s.workerPort,s.sampleBuffer,sampleRate*.02);break;case"dump":s.result.postMessage(this.dump());break}n==="close"&&(this.alive=!1)}process(r,n,s){if(this.state===void 0||n.length<1||n[0].length<2)return this.alive;let a=this.state.fill(0,n[0][0],n[0][1]);return a<l.RenderQuantumSize&&(this.totalBlocks+=1,this.state.next(),this.state.hasVoice?this.voiceBlocks+=1:this.silenceBlocks+=1,this.state.fill(a,n[0][0],n[0][1])),this.alive}dump(){return{type:"shared playback worklet",alive:this.alive,sampleRate,id:this.state?.id||null,offset:this.state?.offset||null,length:this.state?.length||null,hasVoice:this.state?.hasVoice??!1,silenceBlocks:this.silenceBlocks,voiceBlocks:this.voiceBlocks,totalBlocks:this.totalBlocks}}},g=class{constructor(t,r,n){this.samples=t;this.port=r;this.length=n;this.id=0,this.offset=0,this.entry=f(this.samples,0)}fill(t,r){let n=Math.min(r.length-t,this.length-this.offset);return this.entry.set(r.subarray(t,t+n),this.offset),this.offset+=n,t+n}flush(){this.id+=1,p(this.port,["captureTick",{id:this.id}]);let t=this.id%this.samples.length;this.entry=f(this.samples,t),I(this.samples,t,{id:this.id}),this.offset=0}},v=class{constructor(t,r,n){this.port=t;this.samples=r;this.length=n;this.id=-1,this.offset=0,this.entry=void 0,this.next()}get hasVoice(){return this.entry!==void 0}fill(t,r,n){let s=Math.min(l.RenderQuantumSize-t,this.length-this.offset);return this.entry!==void 0&&(r.set(this.entry.subarray(this.offset,this.offset+s),t),n.set(this.entry.subarray(this.offset+this.length,this.offset+this.length+s),t)),this.offset+=s,t+s}next(){this.id+=1;let t=this.id%this.samples.length,{id:r}=S(this.samples,t);this.entry=this.id===r?f(this.samples,t):void 0,this.offset=0,p(this.port,["playbackTick",{id:this.id}])}};registerProcessor("OdinCaptureProcessor",x);registerProcessor("OdinPlaybackProcessor",y);})();\n';var ux=new P.Strand;function dx(x,F,A,D,r=f.DefaultRefreshRate){return ux.enqueue(async()=>{let[j,B]=await q(G,p,x,"OdinCaptureProcessor",{channelCount:1,numberOfInputs:1,numberOfOutputs:0});return m.create(x,F,A,j,B,D)})}async function cx(x,F=f.DefaultRefreshRate){if(x.sampleRate!==48e3)throw new Error("playback sample rate must be 48kHz ");let[A,D]=await q(G,p,x,"OdinPlaybackProcessor",{numberOfInputs:0,numberOfOutputs:1,outputChannelCount:[2]});return h.create(x,A,D)}var h=class x extends l{constructor(A,D,r,j){super(A,D,r);this.information=j}static async create(A,D,r){let{port1:j,port2:B}=new MessageChannel;v(D,["playbackInit",{workletPort:j}],[j]);let{informationBuffer:t,sampleBuffer:s}=await k(D,"playbackReady");return u(t,[1,1]),v(r.port,["init",{sampleBuffer:s,workerPort:B}],[B]),new x(A,r,D,t)}getActivity(A){let D=this.medias.get(C(A));if(D===void 0)return;let r=g(this.information,D.index);return r===0?J:{isSilent:!1,rmsDBFS:r}}getJitterStats(A){}setGlobalVolume(A){u(this.information,A)}setVolume(A,D){let r=this.medias.get(C(A));r!==void 0&&y(this.information,r.index,D)}_GetFreeIndex(){let A=super._GetFreeIndex();if(A!==void 0)return A;if(this.information.length>this.medias.size)return this.medias.size}},m=class x extends n{constructor(A,D,r,j,B,t){super(A,D,r,j,t);this.information=B}static async create(A,D,r,j,B,t){let{port1:s,port2:$}=new MessageChannel;v(j,["captureInit",{sampleRate:A.sampleRate,workletPort:s}],[s]);let{sampleBuffer:w,informationBuffer:T}=await k(j,"captureReady");return v(B.port,["init",{workerPort:$,sampleBuffer:w}],[$]),new x(B,j,D,r,T,t)}get activity(){return{isSilent:!H(this.information),rmsDBFS:N(this.information)}}get speechProbability(){return L(this.information)}setVolume(A){_(this.information,A)}};0&&(module.exports={createCaptureWorker,createPlaybackWorker});
|