vendor: 4,183 bytes, line 1
1import{c as zn,a as Xn,g as Yn}from"./module-DoWOc2fJ.js";const Mt=new Set,Hn=zn({deregister:({call:e})=>t=>e("deregister",{port:t},[t]),encode:({call:e})=>async(t,n)=>{const r=await e("encode",{encoderId:t,timeslice:n});return Mt.delete(t),r},instantiate:({call:e})=>async(t,n)=>{const r=Xn(Mt),o=await e("instantiate",{encoderId:r,mimeType:t,sampleRate:n});return{encoderId:r,port:o}},register:({call:e})=>t=>e("register",{port:t},[t])}),Zn=e=>{const t=new Worker(e);return Hn(t)},Kn=`(()=>{var e={455:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<s?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*s);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,c=r(i),l=a(c,i),d=t(l);e.addUniqueNumber=d,e.generateUniqueNumber=l}(t)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{"use strict";var e=r(455);const t=new WeakMap,n=new WeakMap,o=(r=>{const o=(s=r,{...s,connect:e=>{let{call:r}=e;return async()=>{const{port1:e,port2:n}=new MessageChannel,o=await r("connect",{port:e},[e]);return t.set(n,o),n}},disconnect:e=>{let{call:r}=e;return async e=>{const n=t.get(e);if(void 0===n)throw new Error("The given port is not connected.");await r("disconnect",{portId:n})}},isSupported:e=>{let{call:t}=e;return()=>t("isSupported")}});var s;return t=>{const r=(e=>{if(n.has(e))return n.get(e);const t=new Map;return n.set(e,t),t})(t);t.addEventListener("message",(e=>{let{data:t}=e;const{id:n}=t;if(null!==n&&r.has(n)){const{reject:e,resolve:o}=r.get(n);r.delete(n),void 0===t.error?o(t.result):e(new Error(t.error.message))}})),(e=>"function"==typeof e.start)(t)&&t.start();const s=function(n){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return new Promise(((a,i)=>{const c=(0,e.generateUniqueNumber)(r);r.set(c,{reject:i,resolve:a}),null===o?t.postMessage({id:c,method:n},s):t.postMessage({id:c,method:n,params:o},s)}))},a=function(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];t.postMessage({id:null,method:e,params:r},n)};let i={};for(const[e,t]of Object.entries(o))i={...i,[e]:t({call:s,notify:a})};return{...i}}})({characterize:e=>{let{call:t}=e;return()=>t("characterize")},encode:e=>{let{call:t}=e;return(e,r)=>t("encode",{recordingId:e,timeslice:r})},record:e=>{let{call:t}=e;return async(e,r,n)=>{await t("record",{recordingId:e,sampleRate:r,typedArrays:n},n.map((e=>{let{buffer:t}=e;return t})))}}}),s=-32603,a=-32602,i=-32601,c=(e,t)=>Object.assign(new Error(e),{status:t}),l=e=>c('The handler of the method called "'.concat(e,'" returned an unexpected result.'),s),d=(e,t)=>async r=>{let{data:{id:n,method:o,params:a}}=r;const d=t[o];try{if(void 0===d)throw(e=>c('The requested method called "'.concat(e,'" is not supported.'),i))(o);const t=void 0===a?d():d(a);if(void 0===t)throw(e=>c('The handler of the method called "'.concat(e,'" returned no required result.'),s))(o);const r=t instanceof Promise?await t:t;if(null===n){if(void 0!==r.result)throw l(o)}else{if(void 0===r.result)throw l(o);const{result:t,transferables:s=[]}=r;e.postMessage({id:n,result:t},s)}}catch(t){const{message:r,status:o=-32603}=t;e.postMessage({error:{code:o,message:r},id:n})}},u=new Map,h=(t,r,n)=>({...r,connect:n=>{let{port:o}=n;o.start();const s=t(o,r),a=(0,e.generateUniqueNumber)(u);return u.set(a,(()=>{s(),o.close(),u.delete(a)})),{result:a}},disconnect:e=>{let{portId:t}=e;const r=u.get(t);if(void 0===r)throw(e=>c('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),a))(t);return r(),{result:null}},isSupported:async()=>
1{if(await new Promise((e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=t=>{let{data:r}=t;return e(null!==r)},n.postMessage(t,[t])}))){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),f=function(e,t){const r=h(f,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>!0),n=d(e,r);return e.addEventListener("message",n),()=>e.removeEventListener("message",n)},p=e=>{e.onmessage=null,e.close()},w=new Map,m=new WeakMap,g=((e,t)=>r=>{const n=t.get(r);if(void 0===n)throw new Error("There is no encoder stored which wraps this port.");e.delete(n),t.delete(r)})(w,m),v=new Map,y=(e=>t=>{const r=e.get(t);if(void 0===r)throw new Error("There was no instance of an encoder stored with the given id.");return r})(v),M=((e,t)=>r=>{const n=t(r);return e.delete(r),n})(v,y),E=((e,t)=>r=>{const[n,o,s,a]=t(r);return s?new Promise((t=>{o.onmessage=s=>{let{data:i}=s;0===i.length?(e(o),t(n.encode(r,null))):n.record(r,a,i)}})):n.encode(r,null)})(p,M),b=(e=>t=>{for(const[r,n]of Array.from(e.values()))if(r.test(t))return n;throw new Error("There is no encoder registered which could handle the given mimeType.")})(w),T=((e,t,r)=>(n,o,s)=>{if(t.has(n))throw new Error('There is already an encoder registered with an id called "'.concat(n,'".'));const a=r(o),{port1:i,port2:c}=new MessageChannel,l=[a,i,!0,s];return t.set(n,l),i.onmessage=t=>{let{data:r}=t;0===r.length?(e(i),l[2]=!1):a.record(n,s,r.map((e=>"number"==typeof e?new Float32Array(e):e)))},c})(p,v,b),I=((e,t,r)=>async n=>{const o=r(n),s=await o.characterize(),a=s.toString();if(e.has(a)||t.has(n))throw new Error("There is already an encoder stored which handles exactly the same mime types.");return e.set(a,[s,o]),t.set(n,a),s})(w,m,o),A=(e=>(t,r)=>{const[n]=e(t);return n.encode(t,r)})(y);f(self,{deregister:async e=>{let{port:t}=e;return{result:g(t)}},encode:async e=>{let{encoderId:t,timeslice:r}=e;const n=null===r?await E(t):await A(t,r);return{result:n,transferables:n}},instantiate:e=>{let{encoderId:t,mimeType:r,sampleRate:n}=e;const o=T(t,r,n);return{result:o,transferables:[o]}},register:async e=>{let{port:t}=e;return{result:await I(t)}}})})()})();`,Qn=new Blob([Kn],{type:"application/javascript; charset=utf-8"}),zt=URL.createObjectURL(Qn),it=Zn(zt),Se=it.encode,Xt=it.instantiate,Jn=it.register;URL.revokeObjectURL(zt);const er=e=>(t,n)=>{if(e===null)throw new Error("A native BlobEvent could not be created.");return new e(t,n)},tr=(e,t)=>(n,r,o)=>{const s=[];let a=r,c=0;for(;c<n.byteLength;)if(a===null){const i=t(n,c);if(i===null)break;const{length:u,type:d}=i;a=d,c+=u}else{const i=e(n,c,a,o);if(i===null)break;const{content:u,length:d}=i;a=null,c+=d,u!==null&&s.push(u)}return{contents:s,currentElementType:a,offset:c}},nr=(e,t)=>class{constructor(r=null){this._listeners=new WeakMap,this._nativeEventTarget=r===null?e():r}addEventListener(r,o,s){if(o!==null){let a=this._listeners.get(o);a===void 0&&(a=t(this,o),typeof o=="function"&&this._listeners.set(o,a)),this._nativeEventTarget.addEventListener(r,a,s)}}dispatchEvent(r){return this._nativeEventTarget.dispatchEvent(r)}removeEventListener(r,o,s){const a=o===null?void 0:this._listeners.get(o);this._nativeEventTarget.removeEventListener(r,a===void 0?null:a,s)}},rr=e=>()=>{if(e===null)throw new Error("A native EventTarget could not be created.");return e.document.createElement("p")},or=(e="")=>{try{return new DOMException(e,"InvalidModificationError")}catch(t){return t.code=13,t.message=e,t.name="InvalidModificationError",t}},sr=()=>{try{return new DOMException("","InvalidStateError")}catch(e){return e.code=11,e.name="InvalidStateError",e}},ar=(e,t,n,r,o,s,a)=>class extends s{constructor(i,u={}){const{mimeType:d}=u;if(a!==null&&(d===void 0||a.isTypeSupported!==void 0&&a.isTypeSupported(d))){const l=e(a,i,u);super(l),this._internalMediaRecorder=l}else if(d!==void 0&&o.some(l=>l.test(d)))super(),a!==null&&a.isTypeSupported!==void 0&&a.isTypeSupported("audio/webm;codecs=pcm")?this._internalMediaRecorder=r(this,a,i,d):this._internalMediaRecorder=n(this,i,d);else throw a!==null&&e(a,i,u),t();this._ondataavailable=null,this._onerror=null,this._onpause=null,this._onresume=null,this._onstart=null,this._onstop=null}get mimeType(){return this._internalMediaRecorder.mimeType}get ondataavailable(){return this._ondataavailable===null?this._ondataavailable:this._ondataavailable[0]}set ondataavailable(i){if(this._ondataavailable!==null&&this.removeEventListener("dataavailable",this._ondataavailable[1]),typeof i=="function"){const u=i.bind(this);this.addEventListener("dataavailable",u),this._ondataavailable=[i,u]}else this._ondataavailable=null}
vendor: 7,306 bytes, line 1
1get onerror(){return this._onerror===null?this._onerror:this._onerror[0]}set onerror(i){if(this._onerror!==null&&this.removeEventListener("error",this._onerror[1]),typeof i=="function"){const u=i.bind(this);this.addEventListener("error",u),this._onerror=[i,u]}else this._onerror=null}get onpause(){return this._onpause===null?this._onpause:this._onpause[0]}set onpause(i){if(this._onpause!==null&&this.removeEventListener("pause",this._onpause[1]),typeof i=="function"){const u=i.bind(this);this.addEventListener("pause",u),this._onpause=[i,u]}else this._onpause=null}get onresume(){return this._onresume===null?this._onresume:this._onresume[0]}set onresume(i){if(this._onresume!==null&&this.removeEventListener("resume",this._onresume[1]),typeof i=="function"){const u=i.bind(this);this.addEventListener("resume",u),this._onresume=[i,u]}else this._onresume=null}get onstart(){return this._onstart===null?this._onstart:this._onstart[0]}set onstart(i){if(this._onstart!==null&&this.removeEventListener("start",this._onstart[1]),typeof i=="function"){const u=i.bind(this);this.addEventListener("start",u),this._onstart=[i,u]}else this._onstart=null}get onstop(){return this._onstop===null?this._onstop:this._onstop[0]}set onstop(i){if(this._onstop!==null&&this.removeEventListener("stop",this._onstop[1]),typeof i=="function"){const u=i.bind(this);this.addEventListener("stop",u),this._onstop=[i,u]}else this._onstop=null}get state(){return this._internalMediaRecorder.state}pause(){return this._internalMediaRecorder.pause()}resume(){return this._internalMediaRecorder.resume()}start(i){return this._internalMediaRecorder.start(i)}stop(){return this._internalMediaRecorder.stop()}static isTypeSupported(i){return a!==null&&a.isTypeSupported!==void 0&&a.isTypeSupported(i)||o.some(u=>u.test(i))}},ir=e=>e!==null&&e.BlobEvent!==void 0?e.BlobEvent:null,cr=(e,t,n)=>{const r=new Map,o=new WeakMap,s=new WeakMap,a=new e(t,n),c=new WeakMap;let i=!1;return a.addEventListener=(u=>(d,l,w)=>{let m=l;if(typeof l=="function")if(d==="dataavailable"){const h=[];m=f=>{i&&a.state==="inactive"?h.push(f):l.call(a,f)},r.set(l,h),o.set(l,m)}else d==="error"?(m=h=>{h instanceof ErrorEvent?l.call(a,h):l.call(a,new ErrorEvent("error",{error:h.error}))},s.set(l,m)):d==="stop"&&(m=h=>{for(const[f,g]of r.entries())if(g.length>0){const[p]=g;g.length>1&&Object.defineProperty(p,"data",{value:new Blob(g.map(({data:A})=>A),{type:p.data.type})}),g.length=0,f.call(a,p)}i=!1,l.call(a,h)},c.set(l,m));return u.call(a,d,m,w)})(a.addEventListener),a.removeEventListener=(u=>(d,l,w)=>{let m=l;if(typeof l=="function"){if(d==="dataavailable"){r.delete(l);const h=o.get(l);h!==void 0&&(m=h)}else if(d==="error"){const h=s.get(l);h!==void 0&&(m=h)}else if(d==="stop"){const h=c.get(l);h!==void 0&&(m=h)}}return u.call(a,d,m,w)})(a.removeEventListener),a.start=(u=>d=>(i=d!==void 0,d===void 0?u.call(a):u.call(a,d)))(a.start),a},ur=e=>e===null||e.MediaRecorder===void 0?null:e.MediaRecorder,Yt=()=>{try{return new DOMException("","NotSupportedError")}catch(e){return e.code=9,e.name="NotSupportedError",e}},lr=e=>(t,n,r,o=2)=>{const s=e(t,n);if(s===null)return s;const{length:a,value:c}=s;if(r==="master")return{content:null,length:a};if(n+a+c>t.byteLength)return null;if(r==="binary"){const i=(c/Float32Array.BYTES_PER_ELEMENT-1)/o,u=Array.from({length:o},()=>new Float32Array(i));for(let d=0;d<i;d+=1){const l=d*o+1;for(let w=0;w<o;w+=1)u[w][d]=t.getFloat32(n+a+(l+w)*Float32Array.BYTES_PER_ELEMENT,!0)}return{content:u,length:a+c}}return{content:null,length:a+c}},dr=e=>(t,n)=>{const r=e(t,n);if(r===null)return r;const{length:o,value:s}=r;return s===35?{length:o,type:"binary"}:s===46||s===97||s===88713574||s===106212971||s===139690087||s===172351395||s===256095861?{length:o,type:"master"}:{length:o,type:"unknown"}},fr=e=>(t,n)=>{const r=e(t,n);if(r===null)return r;const o=n+Math.floor((r-1)/8);if(o+r>t.byteLength)return null;let a=t.getUint8(o)&(1<<8-r%8)-1;for(let c=1;c<r;c+=1)a=(a<<8)+t.getUint8(o+c);return{length:r,value:a}},Nt=Symbol.observable||"@@observable";function hr(e){return Symbol.observable||(typeof e=="function"&&e.prototype&&e.prototype[Symbol.observable]?(e.prototype[Nt]=e.prototype[Symbol.observable],delete e.prototype[Symbol.observable]):(e[Nt]=e[Symbol.observable],delete e[Symbol.observable])),e}const Ne=()=>{},Ot=e=>{throw e};function pr(e){return e?e.next&&e.error&&e.complete?e:{complete:(e.complete??Ne).bind(e),error:(e.error??Ot).bind(e),next:(e.next??Ne).bind(e)}:{complete:Ne,error:Ot,next:Ne}}const mr=e=>(t,n,r)=>e(o=>{const s=a=>o.next(a);return t.addEventListener(n,s,r),()=>t.removeEventListener(n,s,r)}),gr=(e,t)=>{const n=()=>{},r=o=>typeof o[0]=="function";return o=>{const s=((...a)=>{const c=o(r(a)?t({next:a[0]}):t(...a));return c!==void 0?c:n});return s[Symbol.observable]=()=>({subscribe:(...a)=>({unsubscribe:s(...a)})}),e(s)}},wr=gr(hr,pr),Ht=mr(wr),vr=(e,t,n)=>async r=>{const o=new e([n],{type:"application/javascript; charset=utf-8"}),s=t.createObjectURL(o);try{await r(s)}finally{t.revokeObjectURL(s)}},_r=e=>({data:t})=>{const{id:n}=t;if(n!==null){const r=e.get(n);if(r!==void 0){const{reject:o,resolve:s}=r;e.delete(n),t.error===void 0?s(t.result):o(new Error(t.error.message))}}},yr=e=>(t,n)=>(r,o=[])=>new Promise((s,a)=>{const c=e(t);t.set(c,{reject:a,resolve:s}),n.postMessage({id:c,...r},o)}),Er=(e,t,n,r)=>(o,s,a={})=>{const c={channelCountMode:"explicit",numberOfInputs:1,numberOfOutputs:0},i=new o(s,"recorder-audio-worklet-processor",{...a,...c}),u=new Map,d=t(u,i.port),l=n(i.port,"message")(e(u));i.port.start();let w="inactive";return Object.defineProperties(i,{pause:{get(){return async()=>(r(["recording"],w),w="paused",d({method:"pause"}))}},port:{get(){throw new Error("The port of a RecorderAudioWorkletNode can't be accessed.")}},record:{get(){return async m=>(r(["inactive"],w),w="recording",d({method:"record",params:{encoderPort:m}},[m]))}},resume:{get(){return async()=>(r(["paused"],w),w="recording",d({method:"resume"}))}},stop:{get(){return async()=>{r(["paused","recording"],w),w="stopped";try{await d({method:"stop"})}finally{l()}}}}}),i},br=(e,t)=>{if(!e.includes(t))throw new Error(`Expected the state to be ${e.map(n=>`"${n}"`).join(" or ")} but it was "${t}".`)},Ar='(()=>{"use strict";class e extends AudioWorkletProcessor{constructor(){super(),this._encoderPort=null,this._numberOfChannels=0,this._state="inactive",this.port.onmessage=({data:e})=>{"pause"===e.method?"active"===this._state||"recording"===this._state?(this._state="paused",this._sendAcknowledgement(e.id)):this._sendUnexpectedStateError(e.id):"record"===e.method?"inactive"===this._state?(this._encoderPort=e.params.encoderPort,this._state="active",this._sendAcknowledgement(e.id)):this._sendUnexpectedStateError(e.id):"resume"===e.method?"paused"===this._state?(this._state="active",this._sendAcknowledgement(e.id)):this._sendUnexpectedStateError(e.id):"stop"===e.method?"active"!==this._state&&"paused"!==this._state&&"recording"!==this._state||null===this._encoderPort?this._sendUnexpectedStateError(e.id):(this._stop(this._encoderPort),this._sendAcknowledgement(e.id)):"number"==typeof e.id&&this.port.postMessage({error:{code:-32601,message:"The requested method is not supported."},id:e.id})}}process([e]){if("inactive"===this._state||"paused"===this._state)return!0;
1if("active"===this._state){if(void 0===e)throw new Error("No channelData was received for the first input.");if(0===e.length)return!0;this._state="recording"}if("recording"===this._state&&null!==this._encoderPort){if(void 0===e)throw new Error("No channelData was received for the first input.");return 0===e.length?this._encoderPort.postMessage(Array.from({length:this._numberOfChannels},()=>128)):(this._encoderPort.postMessage(e,e.map(({buffer:e})=>e)),this._numberOfChannels=e.length),!0}return!1}_sendAcknowledgement(e){this.port.postMessage({id:e,result:null})}_sendUnexpectedStateError(e){this.port.postMessage({error:{code:-32603,message:"The internal state does not allow to process the given message."},id:e})}_stop(e){e.postMessage([]),e.close(),this._encoderPort=null,this._state="stopped"}}e.parameterDescriptors=[],registerProcessor("recorder-audio-worklet-processor",e)})();',Cr=vr(Blob,URL,Ar),Tr=Er(_r,yr(Yn),Ht,br),kt=(e,t,n)=>({endTime:t,insertTime:n,type:"exponentialRampToValue",value:e}),It=(e,t,n)=>({endTime:t,insertTime:n,type:"linearRampToValue",value:e}),Ke=(e,t)=>({startTime:t,type:"setValue",value:e}),Zt=(e,t,n)=>({duration:n,startTime:t,type:"setValueCurve",values:e}),Kt=(e,t,{startTime:n,target:r,timeConstant:o})=>r+(t-r)*Math.exp((n-e)/o),me=e=>e.type==="exponentialRampToValue",Re=e=>e.type==="linearRampToValue",re=e=>me(e)||Re(e),ct=e=>e.type==="setValue",J=e=>e.type==="setValueCurve",Le=(e,t,n,r)=>{const o=e[t];return o===void 0?r:re(o)||ct(o)?o.value:J(o)?o.values[o.values.length-1]:Kt(n,Le(e,t-1,o.startTime,r),o)},St=(e,t,n,r,o)=>n===void 0?[r.insertTime,o]:re(n)?[n.endTime,n.value]:ct(n)?[n.startTime,n.value]:J(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,Le(e,t-1,n.startTime,o)],Qe=e=>e.type==="cancelAndHold",Je=e=>e.type==="cancelScheduledValues",ne=e=>Qe(e)||Je(e)?e.cancelTime:me(e)||Re(e)?e.endTime:e.startTime,Rt=(e,t,n,{endTime:r,value:o})=>n===o?o:0<n&&0<o||n<0&&o<0?n*(o/n)**((e-t)/(r-t)):0,Lt=(e,t,n,{endTime:r,value:o})=>n+(e-t)/(r-t)*(o-n),Mr=(e,t)=>{const n=Math.floor(t),r=Math.ceil(t);return n===r?e[n]:(1-(t-n))*e[n]+(1-(r-t))*e[r]},Nr=(e,{duration:t,startTime:n,values:r})=>{const o=(e-n)/t*(r.length-1);return Mr(r,o)},Oe=e=>e.type==="setTarget";class Or{constructor(t){this._automationEvents=[],this._currenTime=0,this._defaultValue=t}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(t){const n=ne(t);if(Qe(t)||Je(t)){const r=this._automationEvents.findIndex(s=>Je(t)&&J(s)?s.startTime+s.duration>=n:ne(s)>=n),o=this._automationEvents[r];if(r!==-1&&(this._automationEvents=this._automationEvents.slice(0,r)),Qe(t)){const s=this._automationEvents[this._automationEvents.length-1];if(o!==void 0&&re(o)){if(s!==void 0&&Oe(s))throw new Error("The internal list is malformed.");const a=s===void 0?o.insertTime:J(s)?s.startTime+s.duration:ne(s),c=s===void 0?this._defaultValue:J(s)?s.values[s.values.length-1]:s.value,i=me(o)?Rt(n,a,c,o):Lt(n,a,c,o),u=me(o)?kt(i,n,this._currenTime):It(i,n,this._currenTime);this._automationEvents.push(u)}if(s!==void 0&&Oe(s)&&this._automationEvents.push(Ke(this.getValue(n),n)),s!==void 0&&J(s)&&s.startTime+s.duration>n){const a=n-s.startTime,c=(s.values.length-1)/s.duration,i=Math.max(2,1+Math.ceil(a*c)),u=a/(i-1)*c,d=s.values.slice(0,i);if(u<1)for(let l=1;l<i;l+=1){const w=u*l%1;d[l]=s.values[l-1]*(1-w)+s.values[l]*w}this._automationEvents[this._automationEvents.length-1]=Zt(d,s.startTime,a)}}}else{const r=this._automationEvents.findIndex(a=>ne(a)>n),o=r===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[r-1];if(o!==void 0&&J(o)&&ne(o)+o.duration>n)return!1;const s=me(t)?kt(t.value,t.endTime,this._currenTime):Re(t)?It(t.value,n,this._currenTime):t;if(r===-1)this._automationEvents.push(s);else{if(J(t)&&n+t.duration>ne(this._automationEvents[r]))return!1;this._automationEvents.splice(r,0,s)}}return!0}flush(t){const n=this._automationEvents.findIndex(r=>ne(r)>t);if(n>1){const r=this._automationEvents.slice(n-1),o=r[0];Oe(o)&&r.unshift(Ke(Le(this._automationEvents,n-2,o.startTime,this._defaultValue),o.startTime)),this._automationEvents=r}}getValue(t){if(this._automationEvents.length===0)return this._defaultValue;const n=this._automationEvents.findIndex(a=>ne(a)>t),r=this._automationEvents[n],o=(n===-1?this._automationEvents.length:n)-1,s=this._automationEvents[o];if(s!==void 0&&Oe(s)&&(r===void 0||!re(r)||r.insertTime>t))return Kt(t,Le(this._automationEvents,o-1,s.startTime,this._defaultValue),s);if(s!==void 0&&ct(s)&&(r===void 0||!re(r)))return s.value;if(s!==void 0&&J(s)&&(r===void 0||!re(r)||s.startTime+s.duration>t))return t<s.startTime+s.duration?Nr(t,s):s.values[s.values.length-1];if(s!==void 0&&re(s)&&(r===void 0||!re(r)))return s.value;if(r!==void 0&&me(r)){const[a,c]=St(this._automationEvents,o,s,r,this._defaultValue);return Rt(t,a,c,r)}if(r!==void 0&&Re(r)){const[a,c]=St(this._automationEvents,o,s,r,this._defaultValue);return Lt(t,a,c,r)}return this._defaultValue}}const kr=e=>({cancelTime:e,type:"cancelAndHold"}),Ir=e=>({cancelTime:e,type:"cancelScheduledValues"}),Sr=(e,t)=>
vendor: 62,993 bytes, lines 1-3
1({endTime:t,type:"exponentialRampToValue",value:e}),Rr=(e,t)=>({endTime:t,type:"linearRampToValue",value:e}),Lr=(e,t,n)=>({startTime:t,target:e,timeConstant:n,type:"setTarget"}),Pr=()=>new DOMException("","AbortError"),Br=e=>(t,n,[r,o,s],a)=>{e(t[o],[n,r,s],c=>c[0]===n&&c[1]===r,a)},Ur=e=>(t,n,r)=>{const o=[];for(let s=0;s<r.numberOfInputs;s+=1)o.push(new Set);e.set(t,{activeInputs:o,outputs:new Set,passiveInputs:new WeakMap,renderer:n})},Dr=e=>(t,n)=>{e.set(t,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:n})},ge=new WeakSet,Qt=new WeakMap,Jt=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakMap,rn=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap,on={construct(){return on}},Wr=e=>{try{const t=new Proxy(e,on);new t}catch{return!1}return!0},Pt=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,Bt=(e,t)=>{const n=[];let r=e.replace(/^[\s]+/,""),o=r.match(Pt);for(;o!==null;){const s=o[1].slice(1,-1),a=o[0].replace(/([\s]+)?;?$/,"").replace(s,new URL(s,t).toString());n.push(a),r=r.slice(o[0].length).replace(/^[\s]+/,""),o=r.match(Pt)}return[n.join(";"),r]},Ut=e=>{if(e!==void 0&&!Array.isArray(e))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},Dt=e=>{if(!Wr(e))throw new TypeError("The given value for processorCtor should be a constructor.");if(e.prototype===null||typeof e.prototype!="object")throw new TypeError("The given value for processorCtor should have a prototype.")},Vr=(e,t,n,r,o,s,a,c,i,u,d,l,w)=>{let m=0;return(h,f,g={credentials:"omit"})=>{const p=d.get(h);if(p!==void 0&&p.has(f))return Promise.resolve();const A=u.get(h);if(A!==void 0){const E=A.get(f);if(E!==void 0)return E}const _=s(h),T=_.audioWorklet===void 0?o(f).then(([E,b])=>{const[y,v]=Bt(E,b),N=`${y};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${v} 2})})(window,'_AWGS')`;return n(N)}).then(()=>{const E=w._AWGS.pop();if(E===void 0)throw new SyntaxError;r(_.currentTime,_.sampleRate,()=>E(class{},void 0,(b,y)=>{if(b.trim()==="")throw t();const v=tt.get(_);if(v!==void 0){if(v.has(b))throw t();Dt(y),Ut(y.parameterDescriptors),v.set(b,y)}else Dt(y),Ut(y.parameterDescriptors),tt.set(_,new Map([[b,y]]))},_.sampleRate,void 0,void 0))}):Promise.all([o(f),Promise.resolve(e(l,l))]).then(([[E,b],y])=>{const v=m+1;m=v;const[N,I]=Bt(E,b),W=`${N};((AudioWorkletProcessor,registerProcessor)=>{${I} 3})(${y?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${y?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${y?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${v}',class extends AudioWorkletProcessor{process(){return !1}})`,B=new Blob([W],{type:"application/javascript; charset=utf-8"}),S=URL.createObjectURL(B);return _.audioWorklet.addModule(S,g).then(()=>{if(c(_))return _;const L=a(_);return L.audioWorklet.addModule(S,g).then(()=>L)}).then(L=>{if(i===null)throw new SyntaxError;try{new i(L,`__sac${v}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(S))});return A===void 0?u.set(h,new Map([[f,T]])):A.set(f,T),T.then(()=>{const E=d.get(h);E===void 0?d.set(h,new Set([f])):E.add(f)}).finally(()=>{const E=u.get(h);E!==void 0&&E.delete(f)}),T}},K=(e,t)=>{const n=e.get(t);if(n===void 0)throw new Error("A value with the given key could not be found.");return n},Ve=(e,t)=>{const n=Array.from(e).filter(t);if(n.length>1)throw Error("More than one element was found.");if(n.length===0)throw Error("No element was found.");const[r]=n;return e.delete(r),r},sn=(e,t,n,r)=>{const o=K(e,t),s=Ve(o,a=>a[0]===n&&a[1]===r);return o.size===0&&e.delete(t),s},be=e=>K(rn,e),Pe=e=>{if(ge.has(e))throw new Error("The AudioNode is already stored.");ge.add(e),be(e).forEach(t=>t(!0))},an=e=>"port"in e,ut=e=>{if(!ge.has(e))throw new Error("The AudioNode is not stored.");ge.delete(e),be(e).forEach(t=>t(!1))},rt=(e,t)=>{!an(e)&&t.every(n=>n.size===0)&&ut(e)},xr=(e,t,n,r,o,s,a,c,i,u,d,l,w)=>{const m=new WeakMap;return(h,f,g,p,A)=>{const{activeInputs:_,passiveInputs:T}=s(f),{outputs:E}=s(h),b=c(h),y=v=>{const N=i(f),I=i(h);if(v){const M=sn(T,h,g,p);e(_,h,M,!1),!A&&!l(h)&&n(I,N,g,p),w(f)&&Pe(f)}else{const M=r(_,h,g,p);t(T,p,M,!1),!A&&!l(h)&&o(I,N,g,p);const U=a(f);if(U===0)d(f)&&rt(f,_);else{const R=m.get(f);R!==void 0&&clearTimeout(R),m.set(f,setTimeout(()=>{d(f)&&rt(f,_)},U*1e3))}}};return u(E,[f,g,p],v=>v[0]===f&&v[1]===g&&v[2]===p,!0)?(b.add(y),d(h)?e(_,h,[g,p,y],!0):t(T,p,[h,g,y],!0),!0):!1}},Fr=e=>(t,n,[r,o,s],a)=>{const c=t.get(r);c===void 0?t.set(r,new Set([[o,n,s]])):e(c,[o,n,s],i=>i[0]===o&&i[1]===n,a)},jr=e=>(t,n)=>{const r=e(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.connect(r).connect(t.destination);const o=()=>{n.removeEventListener("ended",o),n.disconnect(r),r.disconnect()};n.addEventListener("ended",o)},Gr=e=>(t,n)=>{e(t).add(n)},cn=(e,t)=>e.context===t,Wt=e=>{try{e.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},ue=()=>new DOMException("","IndexSizeError"),$r=e=>{e.getChannelData=(t=>n=>{try{return t.call(e,n)}catch(r){throw r.code===12?ue():r}})(e.getChannelData)},qr={numberOfChannels:1},zr=(e,t,n,r,o,s,a,c)=>{let i=null;return class un{constructor(d){if(o===null)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:l,numberOfChannels:w,sampleRate:m}={...qr,...d};i===null&&(i=new o(1,1,44100));const h=r!==null&&t(s,s)?new r({length:l,numberOfChannels:w,sampleRate:m}):i.createBuffer(w,l,m);if(h.numberOfChannels===0)throw n();return typeof h.copyFromChannel!="function"?(a(h),$r(h)):t(Wt,()=>Wt(h))||c(h),e.add(h),h}static[Symbol.hasInstance](d){return d!==null&&typeof d=="object"&&Object.getPrototypeOf(d)===un.prototype||e.has(d)}}},xe=-34028234663852886e22,lt=-xe,ae=e=>ge.has(e),Xr={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},Yr=(e,t,n,r,o,s,a,c)=>class extends e{constructor(u,d){const l=s(u),w={...Xr,...d},m=o(l,w),h=a(l),f=h?t():null;super(u,!1,m,f),this._audioBufferSourceNodeRenderer=f,this._isBufferNullified=!1,this._isBufferSet=w.buffer!==null,this._nativeAudioBufferSourceNode=m,this._onended=null,this._playbackRate=n(this,h,m.playbackRate,lt,xe)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(u){if(this._nativeAudioBufferSourceNode.buffer=u,u!==null){if(this._isBufferSet)throw r();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(u){this._nativeAudioBufferSourceNode.loop=u}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(u){this._nativeAudioBufferSourceNode.loopEnd=u}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(u){this._nativeAudioBufferSourceNode.loopStart=u}get onended(){return this._onended}set onended(u){const d=typeof u=="function"?c(this,u):null;this._nativeAudioBufferSourceNode.onended=d;const l=this._nativeAudioBufferSourceNode.onended;this._onended=l!==null&&l===d?u:l}get playbackRate(){return this._playbackRate}start(u=0,d=0,l){if(this._nativeAudioBufferSourceNode.start(u,d,l),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.start=l===void 0?[u,d]:[u,d,l]),this.context.state!=="closed"){Pe(this);const w=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",w),ae(this)&&ut(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",w)}}stop(u=0){this._nativeAudioBufferSourceNode.stop(u),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=u)}},Hr=(e,t,n,r,o)=>()=>{const s=new WeakMap;let a=null,c=null;const i=async(u,d)=>{let l=n(u);const w=cn(l,d);if(!w){const m={buffer:l.buffer,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,loop:l.loop,loopEnd:l.loopEnd,loopStart:l.loopStart,playbackRate:l.playbackRate.value};l=t(d,m),a!==null&&l.start(...a),c!==null&&l.stop(c)}return s.set(d,l),w?await e(d,u.playbackRate,l.playbackRate):await r(d,u.playbackRate,l.playbackRate),await o(u,d,l),l};return{set start(u){a=u},set stop(u){c=u},render(u,d){const l=s.get(d);return l!==void 0?Promise.resolve(l):i(u,d)}}},Zr=e=>"playbackRate"in e,Kr=e=>"frequency"in e&&"gain"in e,Qr=e=>"offset"in e,Jr=e=>!("frequency"in e)&&"gain"in e,eo=e=>"detune"in e&&"frequency"in e&&!("gain"in e),to=e=>"pan"in e,z=e=>K(Qt,e),Ae=e=>K(en,e),ot=(e,t)=>{const{activeInputs:n}=z(e);n.forEach(o=>o.forEach(([s])=>{t.includes(e)||ot(s,[...t,e])}));const r=Zr(e)?[e.playbackRate]:an(e)?Array.from(e.parameters.values()):Kr(e)?[e.Q,e.detune,e.frequency,e.gain]:Qr(e)?[e.offset]:Jr(e)?[e.gain]:eo(e)?[e.detune,e.frequency]:to(e)?[e.pan]:[];for(const o of r){const s=Ae(o);s!==void 0&&s.activeInputs.forEach(([a])=>ot(a,t))}ae(e)&&ut(e)},no=e=>{ot(e.destination,[])},ro=e=>e===void 0||typeof e=="number"||typeof e=="string"&&(e==="balanced"||e==="interactive"||e==="playback"),oo=(e,t,n,r,o,s,a,c)=>class extends e{constructor(u,d){const l=s(u),w=a(l),m=o(l,d,w),h=w?t(c):null;super(u,!1,m,h),this._isNodeOfNativeOfflineAudioContext=w,this._nativeAudioDestinationNode=m}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(u){if(this._isNodeOfNativeOfflineAudioContext)throw r();if(u>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=u}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(u){if(this._isNodeOfNativeOfflineAudioContext)throw r();this._nativeAudioDestinationNode.channelCountMode=u}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}},so=e=>{const t=new WeakMap,n=async(r,o)=>{const s=o.destination;return t.set(o,s),await e(r,o,s),s};return{render(r,o){const s=t.get(o);return s!==void 0?Promise.resolve(s):n(r,o)}}},ao=(e,t,n,r,o,s,a,c)=>(i,u)=>{const d=u.listener,l=()=>{const E=new Float32Array(1),b=t(u,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),y=a(u);let v=!1,N=[0,0,-1,0,1,0],I=[0,0,0];const M=()=>{if(v)return;v=!0;const B=r(u,256,9,0);B.onaudioprocess=({inputBuffer:S})=>{const L=[s(S,E,0),s(S,E,1),s(S,E,2),s(S,E,3),s(S,E,4),s(S,E,5)];L.some((O,P)=>O!==N[P])&&(d.setOrientation(...L),N=L);const D=[s(S,E,6),s(S,E,7),s(S,E,8)];D.some((O,P)=>O!==I[P])&&(d.setPosition(...D),I=D)},b.connect(B)},U=B=>S=>{S!==N[B]&&(N[B]=S,d.setOrientation(...N))},R=B=>S=>{S!==I[B]&&(I[B]=S,d.setPosition(...I))},W=(B,S,L)=>{const D=n(u,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:S});D.connect(b,0,B),D.start(),Object.defineProperty(D.offset,"defaultValue",{get(){return S}});const O=e({context:i},y,D.offset,lt,xe);return c(O,"value",P=>()=>P.call(O),P=>x=>{try{P.call(O,x)}catch($){if($.code!==9)throw $}M(),y&&L(x)}),O.cancelAndHoldAtTime=(P=>y?()=>{throw o()}:(...x)=>{const $=P.apply(O,x);return M(),$})(O.cancelAndHoldAtTime),O.cancelScheduledValues=(P=>y?()=>{throw o()}:(...x)=>{const $=P.apply(O,x);return M(),$})(O.cancelScheduledValues),O.exponentialRampToValueAtTime=(P=>y?()=>{throw o()}:(...x)=>{const $=P.apply(O,x);return M(),$})(O.exponentialRampToValueAtTime),O.linearRampToValueAtTime=(P=>y?()=>{throw o()}:(...x)=>{const $=P.apply(O,x);return M(),$})(O.linearRampToValueAtTime),O.setTargetAtTime=(P=>y?()=>{throw o()}:(...x)=>{const $=P.apply(O,x);return M(),$})(O.setTargetAtTime),O.setValueAtTime=(P=>y?()=>{throw o()}:(...x)=>{const $=P.apply(O,x);return M(),$})(O.setValueAtTime),O.setValueCurveAtTime=(P=>y?()=>{throw o()}:(...x)=>{const $=P.apply(O,x);return M(),$})(O.setValueCurveAtTime),O};return{forwardX:W(0,0,U(0)),forwardY:W(1,0,U(1)),forwardZ:W(2,-1,U(2)),positionX:W(6,0,R(0)),positionY:W(7,0,R(1)),positionZ:W(8,0,R(2)),upX:W(3,0,U(3)),upY:W(4,1,U(4)),upZ:W(5,0,U(5))}},{forwardX:w,forwardY:m,forwardZ:h,positionX:f,positionY:g,positionZ:p,upX:A,upY:_,upZ:T}=d.forwardX===void 0?l():d;return{get forwardX(){return w},get forwardY(){return m},get forwardZ(){return h},get positionX(){return f},get positionY(){return g},get positionZ(){return p},get upX(){return A},get upY(){return _},get upZ(){return T}}},Be=e=>"context"in e,Ce=e=>Be(e[0]),le=(e,t,n,r)=>{for(const o of e)if(n(o)){if(r)return!1;throw Error("The set contains at least one similar element.")}return e.add(t),!0},Vt=(e,t,[n,r],o)=>{le(e,[t,n,r],s=>s[0]===t&&s[1]===n,o)},xt=(e,[t,n,r],o)=>{const s=e.get(t);s===void 0?e.set(t,new Set([[n,r]])):le(s,[n,r],a=>a[0]===n,o)},ln=e=>"inputs"in e,st=(e,t,n,r)=>{if(ln(t)){const o=t.inputs[r];return e.connect(o,n,0),[o,n,0]}return e.connect(t,n,r),[t,n,r]},dn=(e,t,n)=>{for(const r of e)if(r[0]===t&&r[1]===n)return e.delete(r),r;return null},io=(e,t,n)=>Ve(e,r=>r[0]===t&&r[1]===n),fn=(e,t)=>{if(!be(e).delete(t))throw new Error("Missing the expected event listener.")},hn=(e,t,n)=>{const r=K(e,t),o=Ve(r,s=>s[0]===n);return r.size===0&&e.delete(t),o},at=(e,t,n,r)=>{ln(t)?e.disconnect(t.inputs[r],n,0):e.disconnect(t,n,r)},H=e=>K(Jt,e),ye=e=>K(tn,e),ie=e=>et.has(e),Ie=e=>!ge.has(e),Ft=(e,t)=>new Promise(n=>{if(t!==null)n(!0);else{const r=e.createScriptProcessor(256,1,1),o=e.createGain(),s=e.createBuffer(1,2,44100),a=s.getChannelData(0);a[0]=1,a[1]=1;const c=e.createBufferSource();c.buffer=s,c.loop=!0,c.connect(r).connect(e.destination),c.connect(o),c.disconnect(o),r.onaudioprocess=i=>{const u=i.inputBuffer.getChannelData(0);Array.prototype.some.call(u,d=>d===1)?n(!0):n(!1),c.stop(),r.onaudioprocess=null,c.disconnect(r),r.disconnect(e.destination)},c.start()}}),He=(e,t)=>{const n=new Map;for(const r of e)for(const o of r){const s=n.get(o);n.set(o,s===void 0?1:s+1)}n.forEach((r,o)=>t(o,r))},Ue=e=>"context"in e,co=e=>{const t=new Map;e.connect=(n=>(r,o=0,s=0)=>{const a=Ue(r)?n(r,o,s):n(r,o),c=t.get(r);return c===void 0?t.set(r,[{input:s,output:o}]):c.every(i=>i.input!==s||i.output!==o)&&c.push({input:s,output:o}),a})(e.connect.bind(e)),e.disconnect=(n=>(r,o,s)=>{if(n.apply(e),r===void 0)t.clear();else if(typeof r=="number")for(const[a,c]of t){const i=c.filter(u=>u.output!==r);i.length===0?t.delete(a):t.set(a,i)}else if(t.has(r))if(o===void 0)t.delete(r);else{const a=t.get(r);if(a!==void 0){const c=a.filter(i=>i.output!==o&&(i.input!==s||s===void 0));c.length===0?t.delete(r):t.set(r,c)}}for(const[a,c]of t)c.forEach(i=>{Ue(a)?e.connect(a,i.output,i.input):e.connect(a,i.output)})})(e.disconnect)},uo=(e,t,n,r)=>{const{activeInputs:o,passiveInputs:s}=Ae(t),{outputs:a}=z(e),c=be(e),i=u=>{const d=H(e),l=ye(t);if(u){const w=hn(s,e,n);Vt(o,e,w,!1),!r&&!ie(e)&&d.connect(l,n)}else{const w=io(o,e,n);xt(s,w,!1),!r&&!ie(e)&&d.disconnect(l,n)}};return le(a,[t,n],u=>u[0]===t&&u[1]===n,!0)?(c.add(i),ae(e)?Vt(o,e,[n,i],!0):xt(s,[e,n,i],!0),!0):!1},lo=(e,t,n,r)=>{const{activeInputs:o,passiveInputs:s}=z(t),a=dn(o[r],e,n);return a===null?[sn(s,e,n,r)[2],!1]:[a[2],!0]},fo=(e,t,n)=>{const{activeInputs:r,passiveInputs:o}=Ae(t),s=dn(r,e,n);return s===null?[hn(o,e,n)[1],!1]:[s[2],!0]},dt=(e,t,n,r,o)=>{const[s,a]=lo(e,n,r,o);if(s!==null&&(fn(e,s),a&&!t&&!ie(e)&&at(H(e),H(n),r,o)),ae(n)){const{activeInputs:c}=z(n);rt(n,c)}},ft=(e,t,n,r)=>{const[o,s]=fo(e,n,r);o!==null&&(fn(e,o),s&&!t&&!ie(e)&&H(e).disconnect(ye(n),r))},ho=(e,t)=>{const n=z(e),r=[];for(const o of n.outputs)Ce(o)?dt(e,t,...o):ft(e,t,...o),r.push(o[0]);return n.outputs.clear(),r},po=(e,t,n)=>{const r=z(e),o=[];for(const s of r.outputs)s[1]===n&&(Ce(s)?dt(e,t,...s):ft(e,t,...s),o.push(s[0]),r.outputs.delete(s));return o},mo=(e,t,n,r,o)=>{const s=z(e);return Array.from(s.outputs).filter(a=>a[0]===n&&(r===void 0||a[1]===r)&&(o===void 0||a[2]===o)).map(a=>(Ce(a)?dt(e,t,...a):ft(e,t,...a),s.outputs.delete(a),a[0]))},go=(e,t,n,r,o,s,a,c,i,u,d,l,w,m,h,f)=>class extends u{constructor(p,A,_,T){super(_),this._context=p,this._nativeAudioNode=_;const E=d(p);l(E)&&n(Ft,()=>Ft(E,f))!==!0&&co(_),Jt.set(this,_),rn.set(this,new Set),p.state!=="closed"&&A&&Pe(this),e(this,T,_)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(p){this._nativeAudioNode.channelCount=p}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(p){this._nativeAudioNode.channelCountMode=p}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(p){this._nativeAudioNode.channelInterpretation=p}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(p,A=0,_=0){if(A<0||A>=this._nativeAudioNode.numberOfOutputs)throw o();const T=d(this._context),E=h(T);if(w(p)||m(p))throw s();if(Be(p)){const v=H(p);try{const I=st(this._nativeAudioNode,v,A,_),M=Ie(this);(E||M)&&this._nativeAudioNode.disconnect(...I),this.context.state!=="closed"&&!M&&Ie(p)&&Pe(p)}catch(I){throw I.code===12?s():I}if(t(this,p,A,_,E)){const I=i([this],p);He(I,r(E))}return p}const b=ye(p);if(b.name==="playbackRate"&&b.maxValue===1024)throw a();try{this._nativeAudioNode.connect(b,A),(E||Ie(this))&&this._nativeAudioNode.disconnect(b,A)}catch(v){throw v.code===12?s():v}if(uo(this,p,A,E)){const v=i([this],p);He(v,r(E))}}disconnect(p,A,_){let T;const E=d(this._context),b=h(E);if(p===void 0)T=ho(this,b);else if(typeof p=="number"){if(p<0||p>=this.numberOfOutputs)throw o();T=po(this,b,p)}else{if(A!==void 0&&(A<0||A>=this.numberOfOutputs)||Be(p)&&_!==void 0&&(_<0||_>=p.numberOfInputs))throw o();if(T=mo(this,b,p,A,_),T.length===0)throw s()}for(const y of T){const v=i([this],y);He(v,c)}}},wo=(e,t,n,r,o,s,a,c,i,u,d,l,w)=>(m,h,f,g=null,p=null)=>{const A=f.value,_=new Or(A),T=h?r(_):null,E={get defaultValue(){return A},get maxValue(){return g===null?f.maxValue:g},get minValue(){return p===null?f.minValue:p},get value(){return f.value},set value(b){f.value=b,E.setValueAtTime(b,m.context.currentTime)},cancelAndHoldAtTime(b){if(typeof f.cancelAndHoldAtTime=="function")T===null&&_.flush(m.context.currentTime),_.add(o(b)),f.cancelAndHoldAtTime(b);else{const y=Array.from(_).pop();T===null&&_.flush(m.context.currentTime),_.add(o(b));const v=Array.from(_).pop();f.cancelScheduledValues(b),y!==v&&v!==void 0&&(v.type==="exponentialRampToValue"?f.exponentialRampToValueAtTime(v.value,v.endTime):v.type==="linearRampToValue"?f.linearRampToValueAtTime(v.value,v.endTime):v.type==="setValue"?f.setValueAtTime(v.value,v.startTime):v.type==="setValueCurve"&&f.setValueCurveAtTime(v.values,v.startTime,v.duration))}return E},cancelScheduledValues(b){return T===null&&_.flush(m.context.currentTime),_.add(s(b)),f.cancelScheduledValues(b),E},exponentialRampToValueAtTime(b,y){if(b===0)throw new RangeError;if(!Number.isFinite(y)||y<0)throw new RangeError;const v=m.context.currentTime;return T===null&&_.flush(v),Array.from(_).length===0&&(_.add(u(A,v)),f.setValueAtTime(A,v)),_.add(a(b,y)),f.exponentialRampToValueAtTime(b,y),E},linearRampToValueAtTime(b,y){const v=m.context.currentTime;return T===null&&_.flush(v),Array.from(_).length===0&&(_.add(u(A,v)),f.setValueAtTime(A,v)),_.add(c(b,y)),f.linearRampToValueAtTime(b,y),E},setTargetAtTime(b,y,v){return T===null&&_.flush(m.context.currentTime),_.add(i(b,y,v)),f.setTargetAtTime(b,y,v),E},setValueAtTime(b,y){return T===null&&_.flush(m.context.currentTime),_.add(u(b,y)),f.setValueAtTime(b,y),E},setValueCurveAtTime(b,y,v){const N=b instanceof Float32Array?b:new Float32Array(b);if(l!==null&&l.name==="webkitAudioContext"){const I=y+v,M=m.context.sampleRate,U=Math.ceil(y*M),R=Math.floor(I*M),W=R-U,B=new Float32Array(W);for(let L=0;L<W;L+=1){const D=(N.length-1)/v*((U+L)/M-y),O=Math.floor(D),P=Math.ceil(D);B[L]=O===P?N[O]:(1-(D-O))*N[O]+(1-(P-D))*N[P]}T===null&&_.flush(m.context.currentTime),_.add(d(B,y,v)),f.setValueCurveAtTime(B,y,v);const S=R/M;S<I&&w(E,B[B.length-1],S),w(E,N[N.length-1],I)}else T===null&&_.flush(m.context.currentTime),_.add(d(N,y,v)),f.setValueCurveAtTime(N,y,v);return E}};return n.set(E,f),t.set(E,m),e(E,T),E},vo=e=>({replay(t){for(const n of e)if(n.type==="exponentialRampToValue"){const{endTime:r,value:o}=n;t.exponentialRampToValueAtTime(o,r)}else if(n.type==="linearRampToValue"){const{endTime:r,value:o}=n;t.linearRampToValueAtTime(o,r)}else if(n.type==="setTarget"){const{startTime:r,target:o,timeConstant:s}=n;t.setTargetAtTime(o,r,s)}else if(n.type==="setValue"){const{startTime:r,value:o}=n;t.setValueAtTime(o,r)}else if(n.type==="setValueCurve"){const{duration:r,startTime:o,values:s}=n;t.setValueCurveAtTime(s,o,r)}else throw new Error("Can't apply an unknown automation.")}});class pn{constructor(t){this._map=new Map(t)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(t,n=null){return this._map.forEach((r,o)=>t.call(n,r,o,this))}get(t){return this._map.get(t)}has(t){return this._map.has(t)}keys(){return this._map.keys()}values(){return this._map.values()}}const _o={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},yo=(e,t,n,r,o,s,a,c,i,u,d,l,w,m)=>class extends t{constructor(f,g,p){var A;const _=c(f),T=i(_),E=d({..._o,...p});w(E);const b=tt.get(_),y=b?.get(g),v=T||_.state!=="closed"?_:(A=a(_))!==null&&A!==void 0?A:_,N=o(v,T?null:f.baseLatency,u,g,y,E),I=T?r(g,E,y):null;super(f,!0,N,I);const M=[];N.parameters.forEach((R,W)=>{const B=n(this,T,R);M.push([W,B])}),this._nativeAudioWorkletNode=N,this._onprocessorerror=null,this._parameters=new pn(M),T&&e(_,this);const{activeInputs:U}=s(this);l(N,U)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(f){const g=typeof f=="function"?m(this,f):null;this._nativeAudioWorkletNode.onprocessorerror=g;const p=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=p!==null&&p===g?f:p}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function De(e,t,n,r,o){if(typeof e.copyFromChannel=="function")t[n].byteLength===0&&(t[n]=new Float32Array(128)),e.copyFromChannel(t[n],r,o);else{const s=e.getChannelData(r);if(t[n].byteLength===0)t[n]=s.slice(o,o+128);else{const a=new Float32Array(s.buffer,o*Float32Array.BYTES_PER_ELEMENT,128);t[n].set(a)}}}const mn=(e,t,n,r,o)=>{typeof e.copyToChannel=="function"?t[n].byteLength!==0&&e.copyToChannel(t[n],r,o):t[n].byteLength!==0&&e.getChannelData(r).set(t[n],o)},We=(e,t)=>{const n=[];for(let r=0;r<e;r+=1){const o=[],s=typeof t=="number"?t:t[r];for(let a=0;a<s;a+=1)o.push(new Float32Array(128));n.push(o)}return n},Eo=(e,t)=>{const n=K(nt,e),r=H(t);return K(n,r)},bo=async(e,t,n,r,o,s,a)=>{const c=t===null?Math.ceil(e.context.length/128)*128:t.length,i=r.channelCount*r.numberOfInputs,u=o.reduce((g,p)=>g+p,0),d=u===0?null:n.createBuffer(u,c,n.sampleRate);if(s===void 0)throw new Error("Missing the processor constructor.");const l=z(e),w=await Eo(n,e),m=We(r.numberOfInputs,r.channelCount),h=We(r.numberOfOutputs,o),f=Array.from(e.parameters.keys()).reduce((g,p)=>({...g,[p]:new Float32Array(128)}),{});for(let g=0;g<c;g+=128){if(r.numberOfInputs>0&&t!==null)for(let p=0;p<r.numberOfInputs;p+=1)for(let A=0;A<r.channelCount;A+=1)De(t,m[p],A,A,g);s.parameterDescriptors!==void 0&&t!==null&&s.parameterDescriptors.forEach(({name:p},A)=>{De(t,f,p,i+A,g)});for(let p=0;p<r.numberOfInputs;p+=1)for(let A=0;A<o[p];A+=1)h[p][A].byteLength===0&&(h[p][A]=new Float32Array(128));try{const p=m.map((_,T)=>l.activeInputs[T].size===0?[]:_),A=a(g/n.sampleRate,n.sampleRate,()=>w.process(p,h,f));if(d!==null)for(let _=0,T=0;_<r.numberOfOutputs;_+=1){for(let E=0;E<o[_];E+=1)mn(d,h[_],E,T+E,g);T+=o[_]}if(!A)break}catch(p){e.dispatchEvent(new ErrorEvent("processorerror",{colno:p.colno,filename:p.filename,lineno:p.lineno,message:p.message}));break}}return d},Ao=(e,t,n,r,o,s,a,c,i,u,d,l,w,m,h,f)=>(g,p,A)=>{const _=new WeakMap;let T=null;const E=async(b,y)=>{let v=d(b),N=null;const I=cn(v,y),M=Array.isArray(p.outputChannelCount)?p.outputChannelCount:Array.from(p.outputChannelCount);if(l===null){const U=M.reduce((S,L)=>S+L,0),R=o(y,{channelCount:Math.max(1,U),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,U)}),W=[];for(let S=0;S<b.numberOfOutputs;S+=1)W.push(r(y,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:M[S]}));const B=a(y,{channelCount:p.channelCount,channelCountMode:p.channelCountMode,channelInterpretation:p.channelInterpretation,gain:1});B.connect=t.bind(null,W),B.disconnect=i.bind(null,W),N=[R,W,B]}else I||(v=new l(y,g));if(_.set(y,N===null?v:N[2]),N!==null){if(T===null){if(A===void 0)throw new Error("Missing the processor constructor.");if(w===null)throw new Error("Missing the native OfflineAudioContext constructor.");const L=b.channelCount*b.numberOfInputs,D=A.parameterDescriptors===void 0?0:A.parameterDescriptors.length,O=L+D;T=bo(b,O===0?null:await(async()=>{const x=new w(O,Math.ceil(b.context.length/128)*128,y.sampleRate),$=[],fe=[];for(let j=0;j<p.numberOfInputs;j+=1)$.push(a(x,{channelCount:p.channelCount,channelCountMode:p.channelCountMode,channelInterpretation:p.channelInterpretation,gain:1})),fe.push(o(x,{channelCount:p.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:p.channelCount}));const he=await Promise.all(Array.from(b.parameters.values()).map(async j=>{const X=s(x,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:j.value});return await m(x,j,X.offset),X})),pe=r(x,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,L+D)});for(let j=0;j<p.numberOfInputs;j+=1){$[j].connect(fe[j]);for(let X=0;X<p.channelCount;X+=1)fe[j].connect(pe,X,j*p.channelCount+X)}for(const[j,X]of he.entries())X.connect(pe,0,L+j),X.start(0);return pe.connect(x.destination),await Promise.all($.map(j=>h(b,x,j))),f(x)})(),y,p,M,A,u)}const U=await T,R=n(y,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[W,B,S]=N;U!==null&&(R.buffer=U,R.start(0)),R.connect(W);for(let L=0,D=0;L<b.numberOfOutputs;L+=1){const O=B[L];for(let P=0;P<M[L];P+=1)W.connect(O,D+P,P);D+=M[L]}return S}if(I)for(const[U,R]of b.parameters.entries())await e(y,R,v.parameters.get(U));else for(const[U,R]of b.parameters.entries())await m(y,R,v.parameters.get(U));return await h(b,y,v),v};return{render(b,y){c(y,b);const v=_.get(y);return v!==void 0?Promise.resolve(v):E(b,y)}}},Co=(e,t)=>(n,r)=>{const o=t.get(n);if(o!==void 0)return o;const s=e.get(n);if(s!==void 0)return s;try{const a=r();return a instanceof Promise?(e.set(n,a),a.catch(()=>!1).then(c=>(e.delete(n),t.set(n,c),c))):(t.set(n,a),a)}catch{return t.set(n,!1),!1}},To=e=>(t,n,r)=>e(n,t,r),Mo=e=>(t,n,r=0,o=0)=>{const s=t[r];if(s===void 0)throw e();return Ue(n)?s.connect(n,0,o):s.connect(n,0)},No=e=>t=>(e[0]=t,e[0]),Oo=(e,t,n,r,o,s,a,c)=>(i,u)=>{const d=t.get(i);if(d===void 0)throw new Error("Missing the expected cycle count.");const l=s(i.context),w=c(l);if(d===u){if(t.delete(i),!w&&a(i)){const m=r(i),{outputs:h}=n(i);for(const f of h)if(Ce(f)){const g=r(f[0]);e(m,g,f[1],f[2])}else{const g=o(f[0]);m.connect(g,f[1])}}}else t.set(i,d-u)},ko=e=>(t,n,r,o)=>e(t[o],s=>s[0]===n&&s[1]===r),Io=e=>(t,n)=>{e(t).delete(n)},So=e=>"delayTime"in e,Ro=(e,t,n)=>function r(o,s){const a=Be(s)?s:n(e,s);if(So(a))return[];if(o[0]===a)return[o];if(o.includes(a))return[];const{outputs:c}=t(a);return Array.from(c).map(i=>r([...o,a],i[0])).reduce((i,u)=>i.concat(u),[])},ke=(e,t,n)=>{const r=t[n];if(r===void 0)throw e();return r},Lo=e=>(t,n=void 0,r=void 0,o=0)=>n===void 0?t.forEach(s=>s.disconnect()):typeof n=="number"?ke(e,t,n).disconnect():Ue(n)?r===void 0?t.forEach(s=>s.disconnect(n)):o===void 0?ke(e,t,r).disconnect(n,0):ke(e,t,r).disconnect(n,0,o):r===void 0?t.forEach(s=>s.disconnect(n)):ke(e,t,r).disconnect(n,0),Po=e=>t=>new Promise((n,r)=>{if(e===null){r(new SyntaxError);return}const o=e.document.head;if(o===null)r(new SyntaxError);else{const s=e.document.createElement("script"),a=new Blob([t],{type:"application/javascript"}),c=URL.createObjectURL(a),i=e.onerror,u=()=>{e.onerror=i,URL.revokeObjectURL(c)};e.onerror=(d,l,w,m,h)=>{if(l===c||l===e.location.href&&w===1&&m===1)return u(),r(h),!1;if(i!==null)return i(d,l,w,m,h)},s.onerror=()=>{u(),r(new SyntaxError)},s.onload=()=>{u(),n()},s.src=c,s.type="module",o.appendChild(s)}}),Bo=e=>class{constructor(n){this._nativeEventTarget=n,this._listeners=new WeakMap}addEventListener(n,r,o){if(r!==null){let s=this._listeners.get(r);s===void 0&&(s=e(this,r),typeof r=="function"&&this._listeners.set(r,s)),this._nativeEventTarget.addEventListener(n,s,o)}}dispatchEvent(n){return this._nativeEventTarget.dispatchEvent(n)}removeEventListener(n,r,o){const s=r===null?void 0:this._listeners.get(r);this._nativeEventTarget.removeEventListener(n,s===void 0?null:s,o)}},Uo=e=>(t,n,r)=>{Object.defineProperties(e,{currentFrame:{configurable:!0,get(){return Math.round(t*n)}},currentTime:{configurable:!0,get(){return t}}});try{return r()}finally{e!==null&&(delete e.currentFrame,delete e.currentTime)}},Do=e=>async t=>{try{const n=await fetch(t);if(n.ok)return[await n.text(),n.url]}catch{}throw e()},Wo=(e,t)=>n=>t(e,n),Vo=e=>t=>{const n=e(t);if(n.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return n.renderer},xo=e=>t=>{var n;return(n=e.get(t))!==null&&n!==void 0?n:0},Fo=e=>t=>{const n=e(t);if(n.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer},jo=e=>t=>e.get(t),Z=()=>new DOMException("","InvalidStateError"),Go=e=>t=>{const n=e.get(t);if(n===void 0)throw Z();return n},$o=(e,t)=>n=>{let r=e.get(n);if(r!==void 0)return r;if(t===null)throw new Error("Missing the native OfflineAudioContext constructor.");return r=new t(1,1,44100),e.set(n,r),r},qo=e=>t=>{const n=e.get(t);if(n===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return n},zo=()=>new DOMException("","InvalidAccessError"),Xo=(e,t,n,r,o,s)=>a=>(c,i)=>{const u=e.get(c);if(u===void 0){if(!a&&s(c)){const d=r(c),{outputs:l}=n(c);for(const w of l)if(Ce(w)){const m=r(w[0]);t(d,m,w[1],w[2])}else{const m=o(w[0]);d.disconnect(m,w[1])}}e.set(c,i)}else e.set(c,u+i)},Yo=e=>t=>e!==null&&t instanceof e,Ho=e=>t=>e!==null&&typeof e.AudioNode=="function"&&t instanceof e.AudioNode,Zo=e=>t=>e!==null&&typeof e.AudioParam=="function"&&t instanceof e.AudioParam,Ko=e=>t=>e!==null&&t instanceof e,Qo=e=>e!==null&&e.isSecureContext,Jo=(e,t,n,r)=>class extends e{constructor(s,a){const c=n(s),i=t(c,a);if(r(c))throw new TypeError;super(s,!0,i,null),this._nativeMediaStreamAudioSourceNode=i}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},es=(e,t,n,r,o)=>class extends r{constructor(a={}){if(o===null)throw new Error("Missing the native AudioContext constructor.");let c;try{c=new o(a)}catch(d){throw d.code===12&&d.message==="sampleRate is not in range"?t():d}if(c===null)throw n();if(!ro(a.latencyHint))throw new TypeError(`The provided value '${a.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(a.sampleRate!==void 0&&c.sampleRate!==a.sampleRate)throw t();super(c,2);const{latencyHint:i}=a,{sampleRate:u}=c;if(this._baseLatency=typeof c.baseLatency=="number"?c.baseLatency:i==="balanced"?512/u:i==="interactive"||i===void 0?256/u:i==="playback"?1024/u:Math.max(2,Math.min(128,Math.round(i*u/128)))*128/u,this._nativeAudioContext=c,o.name==="webkitAudioContext"?(this._nativeGainNode=c.createGain(),this._nativeOscillatorNode=c.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(c.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,c.state==="running"){this._state="suspended";const d=()=>{this._state==="suspended"&&(this._state=null),c.removeEventListener("statechange",d)};c.addEventListener("statechange",d)}}get baseLatency(){return this._baseLatency}get state(){return this._state!==null?this._state:this._nativeAudioContext.state}close(){return this.state==="closed"?this._nativeAudioContext.close().then(()=>{throw e()}):(this._state==="suspended"&&(this._state=null),this._nativeAudioContext.close().then(()=>{this._nativeGainNode!==null&&this._nativeOscillatorNode!==null&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),no(this)}))}resume(){return this._state==="suspended"?new Promise((a,c)=>{const i=()=>{this._nativeAudioContext.removeEventListener("statechange",i),this._nativeAudioContext.state==="running"?a():this.resume().then(a,c)};this._nativeAudioContext.addEventListener("statechange",i)}):this._nativeAudioContext.resume().catch(a=>{throw a===void 0||a.code===15?e():a})}suspend(){return this._nativeAudioContext.suspend().catch(a=>{throw a===void 0?e():a})}},ts=(e,t,n,r,o,s)=>class extends n{constructor(c,i){super(c),this._nativeContext=c,nn.set(this,c),r(c)&&o.set(c,new Set),this._destination=new e(this,i),this._listener=t(this,c),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(c){const i=typeof c=="function"?s(this,c):null;this._nativeContext.onstatechange=i;const u=this._nativeContext.onstatechange;this._onstatechange=u!==null&&u===i?c:u}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}},jt=e=>{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const n=e.decodeAudioData(t.buffer,()=>{});return n===void 0?!1:(n.catch(()=>{}),!0)}catch{}return!1},ns=(e,t)=>(n,r,o)=>{const s=new Set;return n.connect=(a=>(c,i=0,u=0)=>{const d=s.size===0;if(t(c))return a.call(n,c,i,u),e(s,[c,i,u],l=>l[0]===c&&l[1]===i&&l[2]===u,!0),d&&r(),c;a.call(n,c,i),e(s,[c,i],l=>l[0]===c&&l[1]===i,!0),d&&r()})(n.connect),n.disconnect=(a=>(c,i,u)=>{const d=s.size>0;if(c===void 0)a.apply(n),s.clear();else if(typeof c=="number"){a.call(n,c);for(const w of s)w[1]===c&&s.delete(w)}else{t(c)?a.call(n,c,i,u):a.call(n,c,i);for(const w of s)w[0]===c&&(i===void 0||w[1]===i)&&(u===void 0||w[2]===u)&&s.delete(w)}const l=s.size===0;d&&l&&o()})(n.disconnect),n},se=(e,t,n)=>{const r=t[n];r!==void 0&&r!==e[n]&&(e[n]=r)},Te=(e,t)=>{se(e,t,"channelCount"),se(e,t,"channelCountMode"),se(e,t,"channelInterpretation")},rs=e=>e===null?null:e.hasOwnProperty("AudioBuffer")?e.AudioBuffer:null,ht=(e,t,n)=>{const r=t[n];r!==void 0&&r!==e[n].value&&(e[n].value=r)},os=e=>{e.start=(t=>{let n=!1;return(r=0,o=0,s)=>{if(n)throw Z();t.call(e,r,o,s),n=!0}})(e.start)},gn=e=>{e.start=(t=>(n=0,r=0,o)=>{if(typeof o=="number"&&o<0||r<0||n<0)throw new RangeError("The parameters can't be negative.");t.call(e,n,r,o)})(e.start)},wn=e=>{e.stop=(t=>(n=0)=>{if(n<0)throw new RangeError("The parameter can't be negative.");t.call(e,n)})(e.stop)},ss=(e,t,n,r,o,s,a,c,i,u,d)=>(l,w)=>{const m=l.createBufferSource();return Te(m,w),ht(m,w,"playbackRate"),se(m,w,"buffer"),se(m,w,"loop"),se(m,w,"loopEnd"),se(m,w,"loopStart"),t(n,()=>n(l))||os(m),t(r,()=>r(l))||i(m),t(o,()=>o(l))||u(m,l),t(s,()=>s(l))||gn(m),t(a,()=>a(l))||d(m,l),t(c,()=>c(l))||wn(m),e(l,m),m},as=e=>e===null?null:e.hasOwnProperty("AudioContext")?e.AudioContext:e.hasOwnProperty("webkitAudioContext")?e.webkitAudioContext:null,is=(e,t)=>(n,r,o)=>{const s=n.destination;if(s.channelCount!==r)try{s.channelCount=r}catch{}o&&s.channelCountMode!=="explicit"&&(s.channelCountMode="explicit"),s.maxChannelCount===0&&Object.defineProperty(s,"maxChannelCount",{value:r});const a=e(n,{channelCount:r,channelCountMode:s.channelCountMode,channelInterpretation:s.channelInterpretation,gain:1});return t(a,"channelCount",c=>()=>c.call(a),c=>i=>{c.call(a,i);try{s.channelCount=i}catch(u){if(i>s.maxChannelCount)throw u}}),t(a,"channelCountMode",c=>()=>c.call(a),c=>i=>{c.call(a,i),s.channelCountMode=i}),t(a,"channelInterpretation",c=>()=>c.call(a),c=>i=>{c.call(a,i),s.channelInterpretation=i}),Object.defineProperty(a,"maxChannelCount",{get:()=>s.maxChannelCount}),a.connect(s),a},cs=e=>e===null?null:e.hasOwnProperty("AudioWorkletNode")?e.AudioWorkletNode:null,us=e=>{const{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}},ls=(e,t,n,r,o)=>(s,a,c,i,u,d)=>{if(c!==null)try{const l=new c(s,i,d),w=new Map;let m=null;if(Object.defineProperties(l,{channelCount:{get:()=>d.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>"explicit",set:()=>{throw e()}},onprocessorerror:{get:()=>m,set:h=>{typeof m=="function"&&l.removeEventListener("processorerror",m),m=typeof h=="function"?h:null,typeof m=="function"&&l.addEventListener("processorerror",m)}}}),l.addEventListener=(h=>(...f)=>{if(f[0]==="processorerror"){const g=typeof f[1]=="function"?f[1]:typeof f[1]=="object"&&f[1]!==null&&typeof f[1].handleEvent=="function"?f[1].handleEvent:null;if(g!==null){const p=w.get(f[1]);p!==void 0?f[1]=p:(f[1]=A=>{A.type==="error"?(Object.defineProperties(A,{type:{value:"processorerror"}}),g(A)):g(new ErrorEvent(f[0],{...A}))},w.set(g,f[1]))}}return h.call(l,"error",f[1],f[2]),h.call(l,...f)})(l.addEventListener),l.removeEventListener=(h=>(...f)=>{if(f[0]==="processorerror"){const g=w.get(f[1]);g!==void 0&&(w.delete(f[1]),f[1]=g)}return h.call(l,"error",f[1],f[2]),h.call(l,f[0],f[1],f[2])})(l.removeEventListener),d.numberOfOutputs!==0){const h=n(s,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return l.connect(h).connect(s.destination),o(l,()=>h.disconnect(),()=>h.connect(s.destination))}return l}catch(l){throw l.code===11?r():l}if(u===void 0)throw r();return us(d),t(s,a,u,d)},ds=(e,t)=>e===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(e*t))))),fs=e=>new Promise((t,n)=>{const{port1:r,port2:o}=new MessageChannel;r.onmessage=({data:s})=>{r.close(),o.close(),t(s)},r.onmessageerror=({data:s})=>{r.close(),o.close(),n(s)},o.postMessage(e)}),hs=async(e,t)=>{const n=await fs(t);return new e(n)},ps=(e,t,n,r)=>{let o=nt.get(e);o===void 0&&(o=new WeakMap,nt.set(e,o));const s=hs(n,r);return o.set(t,s),s},ms=(e,t,n,r,o,s,a,c,i,u,d,l,w)=>(m,h,f,g)=>{if(g.numberOfInputs===0&&g.numberOfOutputs===0)throw i();const p=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(p.some(C=>C<1))throw i();if(p.length!==g.numberOfOutputs)throw t();if(g.channelCountMode!=="explicit")throw i();const A=g.channelCount*g.numberOfInputs,_=p.reduce((C,k)=>C+k,0),T=f.parameterDescriptors===void 0?0:f.parameterDescriptors.length;if(A+T>6||_>6)throw i();const E=new MessageChannel,b=[],y=[];for(let C=0;C<g.numberOfInputs;C+=1)b.push(a(m,{channelCount:g.channelCount,channelCountMode:g.channelCountMode,channelInterpretation:g.channelInterpretation,gain:1})),y.push(o(m,{channelCount:g.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:g.channelCount}));const v=[];if(f.parameterDescriptors!==void 0)for(const{defaultValue:C,maxValue:k,minValue:q,name:F}of f.parameterDescriptors){const V=s(m,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:g.parameterData[F]!==void 0?g.parameterData[F]:C===void 0?0:C});Object.defineProperties(V.offset,{defaultValue:{get:()=>C===void 0?0:C},maxValue:{get:()=>k===void 0?lt:k},minValue:{get:()=>q===void 0?xe:q}}),v.push(V)}const N=r(m,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,A+T)}),I=ds(h,m.sampleRate),M=c(m,I,A+T,Math.max(1,_)),U=o(m,{channelCount:Math.max(1,_),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,_)}),R=[];for(let C=0;C<g.numberOfOutputs;C+=1)R.push(r(m,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:p[C]}));for(let C=0;C<g.numberOfInputs;C+=1){b[C].connect(y[C]);for(let k=0;k<g.channelCount;k+=1)y[C].connect(N,k,C*g.channelCount+k)}const W=new pn(f.parameterDescriptors===void 0?[]:f.parameterDescriptors.map(({name:C},k)=>{const q=v[k];return q.connect(N,0,A+k),q.start(0),[C,q.offset]}));N.connect(M);let B=g.channelInterpretation,S=null;const L=g.numberOfOutputs===0?[M]:R,D={get bufferSize(){return I},get channelCount(){return g.channelCount},set channelCount(C){throw n()},get channelCountMode(){return g.channelCountMode},set channelCountMode(C){throw n()},get channelInterpretation(){return B},set channelInterpretation(C){for(const k of b)k.channelInterpretation=C;B=C},get context(){return M.context},get inputs(){return b},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return S},set onprocessorerror(C){typeof S=="function"&&D.removeEventListener("processorerror",S),S=typeof C=="function"?C:null,typeof S=="function"&&D.addEventListener("processorerror",S)},get parameters(){return W},get port(){return E.port2},addEventListener(...C){return M.addEventListener(C[0],C[1],C[2])},connect:e.bind(null,L),disconnect:u.bind(null,L),dispatchEvent(...C){return M.dispatchEvent(C[0])},removeEventListener(...C){return M.removeEventListener(C[0],C[1],C[2])}},O=new Map;E.port1.addEventListener=(C=>(...k)=>{if(k[0]==="message"){const q=typeof k[1]=="function"?k[1]:typeof k[1]=="object"&&k[1]!==null&&typeof k[1].handleEvent=="function"?k[1].handleEvent:null;if(q!==null){const F=O.get(k[1]);F!==void 0?k[1]=F:(k[1]=V=>{d(m.currentTime,m.sampleRate,()=>q(V))},O.set(q,k[1]))}}return C.call(E.port1,k[0],k[1],k[2])})(E.port1.addEventListener),E.port1.removeEventListener=(C=>(...k)=>{if(k[0]==="message"){const q=O.get(k[1]);q!==void 0&&(O.delete(k[1]),k[1]=q)}return C.call(E.port1,k[0],k[1],k[2])})(E.port1.removeEventListener);let P=null;Object.defineProperty(E.port1,"onmessage",{get:()=>P,set:C=>{typeof P=="function"&&E.port1.removeEventListener("message",P),P=typeof C=="function"?C:null,typeof P=="function"&&(E.port1.addEventListener("message",P),E.port1.start())}}),f.prototype.port=E.port1;let x=null;ps(m,D,f,g).then(C=>x=C);const fe=We(g.numberOfInputs,g.channelCount),he=We(g.numberOfOutputs,p),pe=f.parameterDescriptors===void 0?[]:f.parameterDescriptors.reduce((C,{name:k})=>({...C,[k]:new Float32Array(128)}),{});let j=!0;const X=()=>{g.numberOfOutputs>0&&M.disconnect(U);for(let C=0,k=0;C<g.numberOfOutputs;C+=1){const q=R[C];for(let F=0;F<p[C];F+=1)U.disconnect(q,k+F,F);k+=p[C]}},Me=new Map;M.onaudioprocess=({inputBuffer:C,outputBuffer:k})=>{if(x!==null){const q=l(D);for(let F=0;F<I;F+=128){for(let V=0;V<g.numberOfInputs;V+=1)for(let G=0;G<g.channelCount;G+=1)De(C,fe[V],G,G,F);f.parameterDescriptors!==void 0&&f.parameterDescriptors.forEach(({name:V},G)=>{De(C,pe,V,A+G,F)});for(let V=0;V<g.numberOfInputs;V+=1)for(let G=0;G<p[V];G+=1)he[V][G].byteLength===0&&(he[V][G]=new Float32Array(128));try{const V=fe.map((Y,te)=>{if(q[te].size>0)return Me.set(te,I/128),Y;const Ye=Me.get(te);return Ye===void 0?[]:(Y.every($n=>$n.every(qn=>qn===0))&&(Ye===1?Me.delete(te):Me.set(te,Ye-1)),Y)});j=d(m.currentTime+F/m.sampleRate,m.sampleRate,()=>x.process(V,he,pe));for(let Y=0,te=0;Y<g.numberOfOutputs;Y+=1){for(let _e=0;_e<p[Y];_e+=1)mn(k,he[Y],_e,te+_e,F);te+=p[Y]}}catch(V){j=!1,D.dispatchEvent(new ErrorEvent("processorerror",{colno:V.colno,filename:V.filename,lineno:V.lineno,message:V.message}))}if(!j){for(let V=0;V<g.numberOfInputs;V+=1){b[V].disconnect(y[V]);for(let G=0;G<g.channelCount;G+=1)y[F].disconnect(N,G,V*g.channelCount+G)}if(f.parameterDescriptors!==void 0){const V=f.parameterDescriptors.length;for(let G=0;G<V;G+=1){const Y=v[G];Y.disconnect(N,0,A+G),Y.stop()}}N.disconnect(M),M.onaudioprocess=null,ze?X():Tt();break}}}};let ze=!1;const Xe=a(m,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0}),Ct=()=>M.connect(Xe).connect(m.destination),Tt=()=>{M.disconnect(Xe),Xe.disconnect()},jn=()=>{if(j){Tt(),g.numberOfOutputs>0&&M.connect(U);for(let C=0,k=0;C<g.numberOfOutputs;C+=1){const q=R[C];for(let F=0;F<p[C];F+=1)U.connect(q,k+F,F);k+=p[C]}}ze=!0},Gn=()=>{j&&(Ct(),X()),ze=!1};return Ct(),w(D,jn,Gn)},gs=(e,t)=>(n,r)=>{const o=n.createChannelMerger(r.numberOfInputs);return e!==null&&e.name==="webkitAudioContext"&&t(n,o),Te(o,r),o},ws=e=>{const t=e.numberOfOutputs;Object.defineProperty(e,"channelCount",{get:()=>t,set:n=>{if(n!==t)throw Z()}}),Object.defineProperty(e,"channelCountMode",{get:()=>"explicit",set:n=>{if(n!=="explicit")throw Z()}}),Object.defineProperty(e,"channelInterpretation",{get:()=>"discrete",set:n=>{if(n!=="discrete")throw Z()}})},vn=(e,t)=>{const n=e.createChannelSplitter(t.numberOfOutputs);return Te(n,t),ws(n),n},vs=(e,t,n,r,o)=>(s,a)=>{if(s.createConstantSource===void 0)return n(s,a);const c=s.createConstantSource();return Te(c,a),ht(c,a,"offset"),t(r,()=>r(s))||gn(c),t(o,()=>o(s))||wn(c),e(s,c),c},_n=(e,t)=>(e.connect=t.connect.bind(t),e.disconnect=t.disconnect.bind(t),e),_s=(e,t,n,r)=>(o,{offset:s,...a})=>{const c=o.createBuffer(1,2,44100),i=t(o,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),u=n(o,{...a,gain:s}),d=c.getChannelData(0);d[0]=1,d[1]=1,i.buffer=c,i.loop=!0;const l={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(h){u.channelCount=h},get channelCountMode(){return u.channelCountMode},set channelCountMode(h){u.channelCountMode=h},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(h){u.channelInterpretation=h},get context(){return u.context},get inputs(){return[]},get numberOfInputs(){return i.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get offset(){return u.gain},get onended(){return i.onended},set onended(h){i.onended=h},addEventListener(...h){return i.addEventListener(h[0],h[1],h[2])},dispatchEvent(...h){return i.dispatchEvent(h[0])},removeEventListener(...h){return i.removeEventListener(h[0],h[1],h[2])},start(h=0){i.start.call(i,h)},stop(h=0){i.stop.call(i,h)}},w=()=>i.connect(u),m=()=>i.disconnect(u);return e(o,i),r(_n(l,u),w,m)},oe=(e,t)=>{const n=e.createGain();return Te(n,t),ht(n,t,"gain"),n},ys=(e,{mediaStream:t})=>{const n=t.getAudioTracks();n.sort((s,a)=>s.id<a.id?-1:s.id>a.id?1:0);const r=n.slice(0,1),o=e.createMediaStreamSource(new MediaStream(r));return Object.defineProperty(o,"mediaStream",{value:t}),o},Es=e=>e===null?null:e.hasOwnProperty("OfflineAudioContext")?e.OfflineAudioContext:e.hasOwnProperty("webkitOfflineAudioContext")?e.webkitOfflineAudioContext:null,pt=(e,t,n,r)=>e.createScriptProcessor(t,n,r),de=()=>new DOMException("","NotSupportedError"),bs=(e,t)=>(n,r,o)=>(e(r).replay(o),t(r,n,o)),As=(e,t,n)=>async(r,o,s)=>{const a=e(r);await Promise.all(a.activeInputs.map((c,i)=>Array.from(c).map(async([u,d])=>{const w=await t(u).render(u,o),m=r.context.destination;!n(u)&&(r!==m||!n(r))&&w.connect(s,d,i)})).reduce((c,i)=>[...c,...i],[]))},Cs=(e,t,n)=>async(r,o,s)=>{const a=t(r);await Promise.all(Array.from(a.activeInputs).map(async([c,i])=>{const d=await e(c).render(c,o);n(c)||d.connect(s,i)}))},Ts=(e,t,n,r)=>o=>e(jt,()=>jt(o))?Promise.resolve(e(r,r)).then(s=>{if(!s){const a=n(o,512,0,1);o.oncomplete=()=>{a.onaudioprocess=null,a.disconnect()},a.onaudioprocess=()=>o.currentTime,a.connect(o.destination)}return o.startRendering()}):new Promise(s=>{const a=t(o,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});o.oncomplete=c=>{a.disconnect(),s(c.renderedBuffer)},a.connect(o.destination),o.startRendering()}),Ms=e=>(t,n)=>{e.set(t,n)},Ns=e=>()=>{if(e===null)return!1;try{new e({length:1,sampleRate:44100})}catch{return!1}return!0},Os=(e,t)=>async()=>{if(e===null)return!0;if(t===null)return!1;const n=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),r=new t(1,128,44100),o=URL.createObjectURL(n);let s=!1,a=!1;try{await r.audioWorklet.addModule(o);const c=new e(r,"a",{numberOfOutputs:0}),i=r.createOscillator();c.port.onmessage=()=>s=!0,c.onprocessorerror=()=>a=!0,i.connect(c),i.start(0),await r.startRendering(),await new Promise(u=>setTimeout(u))}catch{}finally{URL.revokeObjectURL(o)}return s&&!a},ks=(e,t)=>()=>{if(t===null)return Promise.resolve(!1);const n=new t(1,1,44100),r=e(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(o=>{n.oncomplete=()=>{r.disconnect(),o(n.currentTime!==0)},n.startRendering()})},Is=()=>new DOMException("","UnknownError"),Ss=()=>typeof window>"u"?null:window,Rs=(e,t)=>n=>{n.copyFromChannel=(r,o,s=0)=>{const a=e(s),c=e(o);if(c>=n.numberOfChannels)throw t();const i=n.length,u=n.getChannelData(c),d=r.length;for(let l=a<0?-a:0;l+a<i&&l<d;l+=1)r[l]=u[l+a]},n.copyToChannel=(r,o,s=0)=>{const a=e(s),c=e(o);if(c>=n.numberOfChannels)throw t();const i=n.length,u=n.getChannelData(c),d=r.length;for(let l=a<0?-a:0;l+a<i&&l<d;l+=1)u[l+a]=r[l]}},Ls=e=>t=>{t.copyFromChannel=(n=>(r,o,s=0)=>{const a=e(s),c=e(o);if(a<t.length)return n.call(t,r,c,a)})(t.copyFromChannel),t.copyToChannel=(n=>(r,o,s=0)=>{const a=e(s),c=e(o);if(a<t.length)return n.call(t,r,c,a)})(t.copyToChannel)},Ps=e=>(t,n)=>{const r=n.createBuffer(1,1,44100);t.buffer===null&&(t.buffer=r),e(t,"buffer",o=>()=>{const s=o.call(t);return s===r?null:s},o=>s=>o.call(t,s===null?r:s))},Bs=(e,t)=>(n,r)=>{r.channelCount=1,r.channelCountMode="explicit",Object.defineProperty(r,"channelCount",{get:()=>1,set:()=>{throw e()}}),Object.defineProperty(r,"channelCountMode",{get:()=>"explicit",set:()=>{throw e()}});const o=n.createBufferSource();t(r,()=>{const c=r.numberOfInputs;for(let i=0;i<c;i+=1)o.connect(r,0,i)},()=>o.disconnect(r))},Us=(e,t,n)=>e.copyFromChannel===void 0?e.getChannelData(n)[0]:(e.copyFromChannel(t,n),t[0]),mt=(e,t,n,r)=>{let o=e;for(;!o.hasOwnProperty(t);)o=Object.getPrototypeOf(o);const{get:s,set:a}=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,{get:n(s),set:r(a)})},Ds=e=>({...e,outputChannelCount:e.outputChannelCount!==void 0?e.outputChannelCount:e.numberOfInputs===1&&e.numberOfOutputs===1?[e.channelCount]:Array.from({length:e.numberOfOutputs},()=>1)}),yn=(e,t,n)=>{try{e.setValueAtTime(t,n)}catch(r){if(r.code!==9)throw r;yn(e,t,n+1e-7)}},Ws=e=>{const t=e.createBufferSource();t.start();try{t.start()}catch{return!0}return!1},Vs=e=>{const t=e.createBufferSource(),n=e.createBuffer(1,1,44100);t.buffer=n;try{t.start(0,1)}catch{return!1}return!0},xs=e=>{const t=e.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0},En=e=>{const t=e.createOscillator();try{t.start(-1)}catch(n){return n instanceof RangeError}return!1},Fs=e=>{const t=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=t,n.start(),n.stop();try{return n.stop(),!0}catch{return!1}},bn=e=>{const t=e.createOscillator();try{t.stop(-1)}catch(n){return n instanceof RangeError}return!1},js=e=>{const{port1:t,port2:n}=new MessageChannel;try{t.postMessage(e)}finally{t.close(),n.close()}},Gs=e=>{e.start=(t=>(n=0,r=0,o)=>{const s=e.buffer,a=s===null?r:Math.min(s.duration,r);s!==null&&a>s.duration-.5/e.context.sampleRate?t.call(e,n,0,0):t.call(e,n,a,o)})(e.start)},$s=(e,t)=>{const n=t.createGain();e.connect(n);const r=(o=>()=>{o.call(e,n),e.removeEventListener("ended",r)})(e.disconnect);e.addEventListener("ended",r),_n(e,n),e.stop=(o=>{let s=!1;return(a=0)=>{if(s)try{o.call(e,a)}catch{n.gain.setValueAtTime(0,a)}else o.call(e,a),s=!0}})(e.stop)},Fe=(e,t)=>n=>{const r={value:e};return Object.defineProperties(n,{currentTarget:r,target:r}),typeof t=="function"?t.call(e,n):t.handleEvent.call(e,n)},qs=Br(le),zs=Fr(le),Xs=ko(Ve),Ys=new WeakMap,Hs=xo(Ys),we=Co(new Map,new WeakMap),Q=Ss(),An=Vo(z),gt=As(z,An,ie),ce=Go(nn),ve=Es(Q),ee=Ko(ve),Cn=new WeakMap,Tn=Bo(Fe),je=as(Q),Zs=Yo(je),Mn=Ho(Q),Ks=Zo(Q),Ee=cs(Q),Ge=go(Ur(Qt),xr(qs,zs,st,Xs,at,z,Hs,be,H,le,ae,ie,Ie),we,Xo(et,at,z,H,ye,ae),ue,zo,de,Oo(st,et,z,H,ye,ce,ae,ee),Ro(Cn,z,K),Tn,ce,Zs,Mn,Ks,ee,Ee),Qs=new WeakSet,Gt=rs(Q),Nn=No(new Uint32Array(1)),Js=Rs(Nn,ue),ea=Ls(Nn),ta=zr(Qs,we,de,Gt,ve,Ns(Gt),Js,ea),wt=jr(oe),On=Cs(An,Ae,ie),kn=To(On),$e=ss(wt,we,Ws,Vs,xs,En,Fs,bn,Gs,Ps(mt),$s),In=bs(Fo(Ae),On),na=Hr(kn,$e,H,In,gt),vt=wo(Dr(en),Cn,tn,vo,kr,Ir,Sr,Rr,Lr,Ke,Zt,je,yn),ra=Yr(Ge,na,vt,Z,$e,ce,ee,Fe),oa=oo(Ge,so,ue,Z,is(oe,mt),ce,ee,gt),qe=ns(le,Mn),sa=Bs(Z,qe),_t=gs(je,sa),aa=_s(wt,$e,oe,qe),yt=vs(wt,we,aa,En,bn),ia=Ts(we,oe,pt,ks(oe,ve)),ca=ao(vt,_t,yt,pt,de,Us,ee,mt),Sn=new WeakMap,ua=ts(oa,ca,Tn,ee,Sn,Fe),Rn=Qo(Q),Et=Uo(Q),Ln=new WeakMap,la=$o(Ln,ve),$t=Rn?Vr(we,de,Po(Q),Et,Do(Pr),ce,la,ee,Ee,new WeakMap,new WeakMap,Os(Ee,ve),Q):void 0,da=Jo(Ge,ys,ce,ee),Pn=qo(Sn),fa=Gr(Pn),Bn=Mo(ue),ha=Io(Pn),Un=Lo(ue),Dn=new WeakMap,pa=Wo(Dn,K),ma=ms(Bn,ue,Z,_t,vn,yt,oe,pt,de,Un,Et,pa,qe),ga=ls(Z,ma,oe,de,qe),wa=Ao(kn,Bn,$e,_t,vn,yt,oe,ha,Un,Et,H,Ee,ve,In,gt,ia),va=jo(Ln),_a=Ms(Dn),qt=Rn?yo(fa,Ge,vt,wa,ga,z,va,ce,ee,Ee,Ds,_a,js,Fe):void 0,ya=es(Z,de,Is,ua,je),Wn="Missing AudioWorklet support. Maybe this is not running in a secure context.",Ea=async(e,t,n,r,o)=>{const{encoderId:s,port:a}=await Xt(o,t.sampleRate);if(qt===void 0)throw new Error(Wn);const c=new ra(t,{buffer:e}),i=new da(t,{mediaStream:r}),u=Tr(qt,t,{channelCount:n});return{audioBufferSourceNode:c,encoderId:s,mediaStreamAudioSourceNode:i,port:a,recorderAudioWorkletNode:u}},ba=(e,t,n,r)=>(o,s,a)=>{var c;const i=(c=s.getAudioTracks()[0])===null||c===void 0?void 0:c.getSettings().sampleRate,u=new ya({latencyHint:"playback",sampleRate:i}),d=Math.max(1024,Math.ceil(u.baseLatency*u.sampleRate)),l=new ta({length:d,sampleRate:u.sampleRate}),w=[],m=Cr(v=>{if($t===void 0)throw new Error(Wn);return $t(u,v)});let h=null,f=null,g=null,p=null,A=!0;const _=v=>{o.dispatchEvent(e("dataavailable",{data:new Blob(v,{type:a})}))},T=async(v,N)=>{const I=await Se(v,N);g===null?w.push(...I):(_(I),p=T(v,N))},E=()=>(A=!0,u.resume()),b=()=>{g!==null&&(h!==null&&(s.removeEventListener("addtrack",h),s.removeEventListener("removetrack",h)),f!==null&&clearTimeout(f),g.then(async({encoderId:v,mediaStreamAudioSourceNode:N,recorderAudioWorkletNode:I})=>{p!==null&&(p.catch(()=>{}),p=null),await I.stop(),N.disconnect(I);const M=await Se(v,null);g===null&&await y(),_([...w,...M]),w.length=0,o.dispatchEvent(new Event("stop"))}),g=null)},y=()=>(A=!1,u.suspend());return y(),{get mimeType(){return a},get state(){return g===null?"inactive":A?"recording":"paused"},pause(){if(g===null)throw n();A&&(y(),o.dispatchEvent(new Event("pause")))},resume(){if(g===null)throw n();A||(E(),o.dispatchEvent(new Event("resume")))},start(v){var N;if(g!==null)throw n();if(s.getVideoTracks().length>0)throw r();o.dispatchEvent(new Event("start"));const I=s.getAudioTracks(),M=I.length===0?2:(N=I[0].getSettings().channelCount)!==null&&N!==void 0?N:2;g=Promise.all([E(),m.then(()=>Ea(l,u,M,s,a))]).then(async([,{audioBufferSourceNode:R,encoderId:W,mediaStreamAudioSourceNode:B,port:S,recorderAudioWorkletNode:L}])=>(B.connect(L),await new Promise(D=>{R.onended=D,R.connect(L),R.start(u.currentTime+d/u.sampleRate)}),R.disconnect(L),await L.record(S),v!==void 0&&(p=T(W,v)),{encoderId:W,mediaStreamAudioSourceNode:B,recorderAudioWorkletNode:L}));const U=s.getTracks();h=()=>{b(),o.dispatchEvent(new ErrorEvent("error",{error:t()}))},s.addEventListener("addtrack",h),s.addEventListener("removetrack",h),f=setInterval(()=>{const R=s.getTracks();(R.length!==U.length||R.some((W,B)=>W!==U[B]))&&h!==null&&h()},1e3)},stop:b}};class Ze{constructor(t,n=0,r){if(n<0||r!==void 0&&r<0)throw new RangeError;const o=t.reduce((d,l)=>d+l.byteLength,0);if(n>o||r!==void 0&&n+r>o)throw new RangeError;const s=[],a=r===void 0?o-n:r,c=[];let i=0,u=n;for(const d of t)if(c.length===0)if(d.byteLength>u){i=d.byteLength-u;const l=i>a?a:i;s.push(new DataView(d,u,l)),c.push(d)}else u-=d.byteLength;else if(i<a){i+=d.byteLength;const l=i>a?d.byteLength-i+a:d.byteLength;s.push(new DataView(d,0,l)),c.push(d)}this._buffers=c,this._byteLength=a,this._byteOffset=u,this._dataViews=s,this._internalBuffer=new DataView(new ArrayBuffer(8))}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get byteOffset(){return this._byteOffset}getFloat32(t,n){return this._internalBuffer.setUint8(0,this.getUint8(t+0)),this._internalBuffer.setUint8(1,this.getUint8(t+1)),this._internalBuffer.setUint8(2,this.getUint8(t+2)),this._internalBuffer.setUint8(3,this.getUint8(t+3)),this._internalBuffer.getFloat32(0,n)}getFloat64(t,n){return this._internalBuffer.setUint8(0,this.getUint8(t+0)),this._internalBuffer.setUint8(1,this.getUint8(t+1)),this._internalBuffer.setUint8(2,this.getUint8(t+2)),this._internalBuffer.setUint8(3,this.getUint8(t+3)),this._internalBuffer.setUint8(4,this.getUint8(t+4)),this._internalBuffer.setUint8(5,this.getUint8(t+5)),this._internalBuffer.setUint8(6,this.getUint8(t+6)),this._internalBuffer.setUint8(7,this.getUint8(t+7)),this._internalBuffer.getFloat64(0,n)}getInt16(t,n){return this._internalBuffer.setUint8(0,this.getUint8(t+0)),this._internalBuffer.setUint8(1,this.getUint8(t+1)),this._internalBuffer.getInt16(0,n)}getInt32(t,n){return this._internalBuffer.setUint8(0,this.getUint8(t+0)),this._internalBuffer.setUint8(1,this.getUint8(t+1)),this._internalBuffer.setUint8(2,this.getUint8(t+2)),this._internalBuffer.setUint8(3,this.getUint8(t+3)),this._internalBuffer.getInt32(0,n)}getInt8(t){const[n,r]=this._findDataViewWithOffset(t);return n.getInt8(t-r)}getUint16(t,n){return this._internalBuffer.setUint8(0,this.getUint8(t+0)),this._internalBuffer.setUint8(1,this.getUint8(t+1)),this._internalBuffer.getUint16(0,n)}getUint32(t,n){return this._internalBuffer.setUint8(0,this.getUint8(t+0)),this._internalBuffer.setUint8(1,this.getUint8(t+1)),this._internalBuffer.setUint8(2,this.getUint8(t+2)),this._internalBuffer.setUint8(3,this.getUint8(t+3)),this._internalBuffer.getUint32(0,n)}getUint8(t){const[n,r]=this._findDataViewWithOffset(t);return n.getUint8(t-r)}setFloat32(t,n,r){this._internalBuffer.setFloat32(0,n,r),this.setUint8(t,this._internalBuffer.getUint8(0)),this.setUint8(t+1,this._internalBuffer.getUint8(1)),this.setUint8(t+2,this._internalBuffer.getUint8(2)),this.setUint8(t+3,this._internalBuffer.getUint8(3))}setFloat64(t,n,r){this._internalBuffer.setFloat64(0,n,r),this.setUint8(t,this._internalBuffer.getUint8(0)),this.setUint8(t+1,this._internalBuffer.getUint8(1)),this.setUint8(t+2,this._internalBuffer.getUint8(2)),this.setUint8(t+3,this._internalBuffer.getUint8(3)),this.setUint8(t+4,this._internalBuffer.getUint8(4)),this.setUint8(t+5,this._internalBuffer.getUint8(5)),this.setUint8(t+6,this._internalBuffer.getUint8(6)),this.setUint8(t+7,this._internalBuffer.getUint8(7))}setInt16(t,n,r){this._internalBuffer.setInt16(0,n,r),this.setUint8(t,this._internalBuffer.getUint8(0)),this.setUint8(t+1,this._internalBuffer.getUint8(1))}setInt32(t,n,r){this._internalBuffer.setInt32(0,n,r),this.setUint8(t,this._internalBuffer.getUint8(0)),this.setUint8(t+1,this._internalBuffer.getUint8(1)),this.setUint8(t+2,this._internalBuffer.getUint8(2)),this.setUint8(t+3,this._internalBuffer.getUint8(3))}setInt8(t,n){const[r,o]=this._findDataViewWithOffset(t);r.setInt8(t-o,n)}setUint16(t,n,r){this._internalBuffer.setUint16(0,n,r),this.setUint8(t,this._internalBuffer.getUint8(0)),this.setUint8(t+1,this._internalBuffer.getUint8(1))}setUint32(t,n,r){this._internalBuffer.setUint32(0,n,r),this.setUint8(t,this._internalBuffer.getUint8(0)),this.setUint8(t+1,this._internalBuffer.getUint8(1)),this.setUint8(t+2,this._internalBuffer.getUint8(2)),this.setUint8(t+3,this._internalBuffer.getUint8(3))}setUint8(t,n){const[r,o]=this._findDataViewWithOffset(t);r.setUint8(t-o,n)}_findDataViewWithOffset(t){let n=0;for(const r of this._dataViews){const o=n+r.byteLength;if(t>=n&&t<o)return[r,n];n=o}throw new RangeError}}const Aa=(e,t,n)=>(r,o,s,a)=>{const c=[],i=new o(s,{mimeType:"audio/webm;codecs=pcm"});let u=null,d=()=>{};const l=h=>{r.dispatchEvent(e("dataavailable",{data:new Blob(h,{type:a})}))},w=async(h,f)=>{const g=await Se(h,f);i.state==="inactive"?c.push(...g):(l(g),u=w(h,f))},m=()=>{i.state!=="inactive"&&(u!==null&&(u.catch(()=>{}),u=null),d(),d=()=>{},i.stop())};return i.addEventListener("error",h=>{m(),r.dispatchEvent(new ErrorEvent("error",{error:h.error}))}),i.addEventListener("pause",()=>r.dispatchEvent(new Event("pause"))),i.addEventListener("resume",()=>r.dispatchEvent(new Event("resume"))),i.addEventListener("start",()=>r.dispatchEvent(new Event("start"))),{get mimeType(){return a},get state(){return i.state},pause(){return i.pause()},resume(){return i.resume()},start(h){const[f]=s.getAudioTracks();if(f!==void 0&&i.state==="inactive"){const{channelCount:g,sampleRate:p}=f.getSettings();if(g===void 0)throw new Error("The channelCount is not defined.");if(p===void 0)throw new Error("The sampleRate is not defined.");let A=!1,_=!1,T=0,E=Xt(a,p);d=()=>{_=!0};const b=Ht(i,"dataavailable")(({data:y})=>{T+=1,E=E.then(async({dataView:v=null,elementType:N=null,encoderId:I,port:M})=>{const U=await y.arrayBuffer();T-=1;const R=v===null?new Ze([U]):new Ze([...v.buffers,U],v.byteOffset);if(!A&&i.state==="recording"&&!_){const D=n(R,0);if(D===null)return{dataView:R,elementType:N,encoderId:I,port:M};const{value:O}=D;if(O!==172351395)return{dataView:v,elementType:N,encoderId:I,port:M};A=!0}const{currentElementType:W,offset:B,contents:S}=t(R,N,g),L=B<R.byteLength?new Ze(R.buffers,R.byteOffset+B):null;return S.forEach(D=>M.postMessage(D,D.map(({buffer:O})=>O))),T===0&&(i.state==="inactive"||_)&&(Se(I,null).then(D=>{l([...c,...D]),c.length=0,r.dispatchEvent(new Event("stop"))}),M.postMessage([]),M.close(),b()),{dataView:L,elementType:W,encoderId:I,port:M}})});h!==void 0&&E.then(({encoderId:y})=>u=w(y,h))}i.start(100)},stop:m}},Ca=()=>typeof window>"u"?null:window,Vn=(e,t)=>{if(t>=e.byteLength)return null;const n=e.getUint8(t);if(n>127)return 1;if(n>63)return 2;if(n>31)return 3;if(n>15)return 4;if(n>7)return 5;if(n>3)return 6;if(n>1)return 7;if(n>0)return 8;const r=Vn(e,t+1);return r===null?null:r+8},Ta=(e,t)=>n=>{const r={value:e};return Object.defineProperties(n,{currentTarget:r,target:r}),typeof t=="function"?t.call(e,n):t.handleEvent.call(e,n)},xn=[],bt=Ca(),Ma=ir(bt),Fn=er(Ma),Na=ba(Fn,or,sr,Yt),At=fr(Vn),Oa=lr(At),ka=dr(At),Ia=tr(Oa,ka),Sa=Aa(Fn,Ia,At),Ra=rr(bt),La=ur(bt),za=ar(cr,Yt,Na,Sa,xn,nr(Ra,Ta),La),Xa=async e=>{xn.push(await Jn(e))};export{za as MediaRecorder,Xa as register};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.