speaker-calibration 1.1.2 → 1.2.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.
Files changed (2) hide show
  1. package/dist/main.js +1 -1
  2. package/package.json +2 -1
package/dist/main.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.speakerCalibrator=t():e.speakerCalibrator=t()}(self,(function(){return function(){var e={972:function(e){var t,r=(t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var r,n,o=void 0!==(e=e||{})?e:{};o.ready=new Promise((function(e,t){r=e,n=t})),Object.getOwnPropertyDescriptor(o.ready,"_main")||(Object.defineProperty(o.ready,"_main",{configurable:!0,get:function(){Ve("You are getting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"_main",{configurable:!0,set:function(){Ve("You are setting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___getTypeName")||(Object.defineProperty(o.ready,"___getTypeName",{configurable:!0,get:function(){Ve("You are getting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___getTypeName",{configurable:!0,set:function(){Ve("You are setting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___embind_register_native_and_builtin_types")||(Object.defineProperty(o.ready,"___embind_register_native_and_builtin_types",{configurable:!0,get:function(){Ve("You are getting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___embind_register_native_and_builtin_types",{configurable:!0,set:function(){Ve("You are setting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___stdio_exit")||(Object.defineProperty(o.ready,"___stdio_exit",{configurable:!0,get:function(){Ve("You are getting ___stdio_exit on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___stdio_exit",{configurable:!0,set:function(){Ve("You are setting ___stdio_exit on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"__ZN6__asan9FakeStack17AddrIsInFakeStackEm")||(Object.defineProperty(o.ready,"__ZN6__asan9FakeStack17AddrIsInFakeStackEm",{configurable:!0,get:function(){Ve("You are getting __ZN6__asan9FakeStack17AddrIsInFakeStackEm on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"__ZN6__asan9FakeStack17AddrIsInFakeStackEm",{configurable:!0,set:function(){Ve("You are setting __ZN6__asan9FakeStack17AddrIsInFakeStackEm on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"__ZN6__asan9FakeStack8AllocateEmmm")||(Object.defineProperty(o.ready,"__ZN6__asan9FakeStack8AllocateEmmm",{configurable:!0,get:function(){Ve("You are getting __ZN6__asan9FakeStack8AllocateEmmm on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"__ZN6__asan9FakeStack8AllocateEmmm",{configurable:!0,set:function(){Ve("You are setting __ZN6__asan9FakeStack8AllocateEmmm on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"onRuntimeInitialized")||(Object.defineProperty(o.ready,"onRuntimeInitialized",{configurable:!0,get:function(){Ve("You are getting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"onRuntimeInitialized",{configurable:!0,set:function(){Ve("You are setting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}));var i=Object.assign({},o),a=[],s="./this.program",c=(e,t)=>{throw t},d=!0,p=!1,u=!1,l=!1;if(o.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var h,f,m,g="";function y(e){return o.locateFile?o.locateFile(e,g):g+e}function E(e){if(e instanceof bo)return;let t=e;e&&"object"==typeof e&&e.stack&&(t=[e,e.stack]),_("exiting due to exception: "+t)}if(l){if("object"==typeof process||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(h=function(e){return read(e)}),m=function(e){let t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(t=read(e,"binary"),L("object"==typeof t),t)},f=function(e,t,r){setTimeout((()=>t(m(e))),0)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(c=(e,t)=>{E(t),quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!d&&!p)throw new Error("environment detection error");if(p?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),t&&(g=t),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");h=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},p&&(m=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)}}var v=o.print||console.log.bind(console),_=o.printErr||console.warn.bind(console);function T(e){T.shown||(T.shown={}),T.shown[e]||(T.shown[e]=1,_(e))}Object.assign(o,i),i=null,o.arguments&&(a=o.arguments),Object.getOwnPropertyDescriptor(o,"arguments")||Object.defineProperty(o,"arguments",{configurable:!0,get:function(){Ve("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),o.thisProgram&&(s=o.thisProgram),Object.getOwnPropertyDescriptor(o,"thisProgram")||Object.defineProperty(o,"thisProgram",{configurable:!0,get:function(){Ve("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),o.quit&&(c=o.quit),Object.getOwnPropertyDescriptor(o,"quit")||Object.defineProperty(o,"quit",{configurable:!0,get:function(){Ve("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),L(void 0===o.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),L(void 0===o.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),L(void 0===o.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),L(void 0===o.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),L(void 0===o.read,"Module.read option was removed (modify read_ in JS)"),L(void 0===o.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),L(void 0===o.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),L(void 0===o.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),L(void 0===o.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Object.getOwnPropertyDescriptor(o,"read")||Object.defineProperty(o,"read",{configurable:!0,get:function(){Ve("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(o,"readAsync")||Object.defineProperty(o,"readAsync",{configurable:!0,get:function(){Ve("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(o,"readBinary")||Object.defineProperty(o,"readBinary",{configurable:!0,get:function(){Ve("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(o,"setWindowTitle")||Object.defineProperty(o,"setWindowTitle",{configurable:!0,get:function(){Ve("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),L(!p,"worker environment detected but not enabled at build time. Add 'worker' to `-s ENVIRONMENT` to enable."),L(!u,"node environment detected but not enabled at build time. Add 'node' to `-s ENVIRONMENT` to enable."),L(!l,"shell environment detected but not enabled at build time. Add 'shell' to `-s ENVIRONMENT` to enable.");var w,b=e=>{};o.wasmBinary&&(w=o.wasmBinary),Object.getOwnPropertyDescriptor(o,"wasmBinary")||Object.defineProperty(o,"wasmBinary",{configurable:!0,get:function(){Ve("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});var O,P=o.noExitRuntime||!1;function S(e){return _e?po(e):W[e]}function A(e){return _e?uo(e):Y[e]}function D(e){return _e?lo(e):J[e]}function R(e){return _e?ho(e):K[e]}function C(e){return _e?fo(e):$[e]}function M(e){return _e?mo(e)>>>0:Z[e]}function k(e){return _e?go(e):ee[e]}function I(e){return _e?yo(e):te[e]}function x(e,t){return _e?Eo(e,t):W[e]=t}function N(e,t){return _e?vo(e,t):Y[e]=t}function F(e,t){return _e?_o(e,t):J[e]=t}function V(e,t){return _e?To(e,t):$[e]=t}function j(e,t){return _e?wo(e,t)>>>0:Z[e]=t}Object.getOwnPropertyDescriptor(o,"noExitRuntime")||Object.defineProperty(o,"noExitRuntime",{configurable:!0,get:function(){Ve("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),"object"!=typeof WebAssembly&&Ve("no native wasm support detected");var U=!1;function L(e,t){e||Ve("Assertion failed"+(t?": "+t:""))}var B="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function q(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.subarray&&B)return B.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var c=63&e[t++];if(224==(240&a)?a=(15&a)<<12|s<<6|c:(240!=(248&a)&&T("Invalid UTF-8 leading byte 0x"+a.toString(16)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),a=(7&a)<<18|s<<12|c<<6|63&e[t++]),a<65536)i+=String.fromCharCode(a);else{var d=a-65536;i+=String.fromCharCode(55296|d>>10,56320|1023&d)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function H(e,t){return e?q(Y,e,t):""}function Q(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;s>1114111&&T("Invalid Unicode code point 0x"+s.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function X(e,t,r){return L("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Q(e,Y,t,r)}function G(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}var z,W,Y,J,K,$,Z,ee,te,re="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function ne(e,t){L(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&R(n);)++n;if((r=n<<1)-e>32&&re)return re.decode(Y.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=D(e+2*a>>1);if(0==s)break;i+=String.fromCharCode(s)}return i}function oe(e,t,r){if(L(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),L("number"==typeof r,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i)F(t>>1,e.charCodeAt(i)),t+=2;return F(t>>1,0),t-n}function ie(e){return 2*e.length}function ae(e,t){L(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var r=0,n="";!(r>=t/4);){var o=C(e+4*r>>2);if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n}function se(e,t,r){if(L(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),L("number"==typeof r,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),V(t>>2,a),(t+=4)+4>o)break}return V(t>>2,0),t-n}function ce(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t}function de(e){var t=G(e)+1,r=to(t);return r&&Q(e,W,r,t),r}function pe(e,t,r){for(var n=0;n<e.length;++n)L(e.charCodeAt(n)===(255&e.charCodeAt(n))),x(t++>>0,e.charCodeAt(n));r||x(t>>0,0)}function ue(e){z=e,o.HEAP8=W=new Int8Array(e),o.HEAP16=J=new Int16Array(e),o.HEAP32=$=new Int32Array(e),o.HEAPU8=Y=new Uint8Array(e),o.HEAPU16=K=new Uint16Array(e),o.HEAPU32=Z=new Uint32Array(e),o.HEAPF32=ee=new Float32Array(e),o.HEAPF64=te=new Float64Array(e)}var le=5242880;o.TOTAL_STACK&&L(le===o.TOTAL_STACK,"the stack size can no longer be determined at runtime");var he,fe=o.INITIAL_MEMORY||79101952;function me(){var e=co();L(0==(3&e)),V(e+4>>2,34821223),V(e+8>>2,2310721022)}function ge(){if(!U){var e=co(),t=M(e+4>>2),r=M(e+8>>2);34821223==t&&2310721022==r||Ve("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" 0x"+t.toString(16))}}Object.getOwnPropertyDescriptor(o,"INITIAL_MEMORY")||Object.defineProperty(o,"INITIAL_MEMORY",{configurable:!0,get:function(){Ve("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),L(fe>=le,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+fe+"! (TOTAL_STACK="+le+")"),L("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support"),L(!o.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally"),L(79101952==fe,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)"}();var ye=[],Ee=[],ve=[],_e=!1,Te=!1,we=0;function be(){return P||we>0}function Oe(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)Ae(o.preRun.shift());$e(ye)}function Pe(){ge(),L(!_e),_e=!0,o.noFSInit||mt.init.initialized||mt.init(),mt.ignorePermissions=!1,st.init(),$e(Ee)}function Se(){if(ge(),o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)Re(o.postRun.shift());$e(ve)}function Ae(e){ye.unshift(e)}function De(e){Ee.unshift(e)}function Re(e){ve.unshift(e)}L(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Ce=0,Me=null,ke=null,Ie={};function xe(e){for(var t=e;;){if(!Ie[e])return e;e=t+Math.random()}}function Ne(e){Ce++,o.monitorRunDependencies&&o.monitorRunDependencies(Ce),e?(L(!Ie[e]),Ie[e]=1,null===Me&&"undefined"!=typeof setInterval&&(Me=setInterval((function(){if(U)return clearInterval(Me),void(Me=null);var e=!1;for(var t in Ie)e||(e=!0,_("still waiting on run dependencies:")),_("dependency: "+t);e&&_("(end of list)")}),1e4))):_("warning: run dependency added without ID")}function Fe(e){if(Ce--,o.monitorRunDependencies&&o.monitorRunDependencies(Ce),e?(L(Ie[e]),delete Ie[e]):_("warning: run dependency removed without ID"),0==Ce&&(null!==Me&&(clearInterval(Me),Me=null),ke)){var t=ke;ke=null,t()}}function Ve(e){o.onAbort&&o.onAbort(e),_(e="Aborted("+e+")"),U=!0;var t=new WebAssembly.RuntimeError(e);throw n(t),t}o.preloadedImages={},o.preloadedAudios={};var je,Ue,Le,Be,qe="data:application/octet-stream;base64,";function He(e){return e.startsWith(qe)}function Qe(e){return e.startsWith("file://")}function Xe(e,t){return function(){var r=e,n=t;return t||(n=o.asm),L(_e,"native function `"+r+"` called before runtime initialization"),L(!Te,"native function `"+r+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),n[e]||L(n[e],"exported native function `"+r+"` not found"),n[e].apply(null,arguments)}}function Ge(e){try{if(e==je&&w)return new Uint8Array(w);if(m)return m(e);throw"both async and sync fetching of the wasm failed"}catch(e){Ve(e)}}function ze(){return w||!d&&!p||"function"!=typeof fetch?Promise.resolve().then((function(){return Ge(je)})):fetch(je,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+je+"'";return e.arrayBuffer()})).catch((function(){return Ge(je)}))}function We(e,t){var r=8,n=0;this.offset_map={},this.func_starts=[],this.name_map={},this.import_functions=0;var o=e;function i(){var e=0,t=0;do{var n=o[r++];e+=(127&n)<<t,t+=7}while(128&n);return e}function a(){var e=i();i(),0!=(1&e)&&i()}e:for(;r<o.length;){var s=o[r++],c=i()+r;switch(s){case 2:for(var d=i();d-- >0;)switch(r=i()+r,r=i()+r,o[r++]){case 0:++n,i();break;case 1:++r,a();break;case 2:a();break;case 3:r+=2;break;default:throw"bad import kind"}this.import_functions=n;break;case 10:for(d=i();d-- >0;){var p=i();this.offset_map[n++]=r,this.func_starts.push(r),r+=p}break e}r=c}for(var u=WebAssembly.Module.customSections(t,"name"),l=0;l<u.length;++l)if(1==(o=new Uint8Array(u[l]))[0])for(r=1,i(),d=i();d-- >0;){var h=i(),f=i();this.name_map[h]=q(o,r,f),r+=f}}function Ye(e,t){var r=Object.create(e.prototype);return Object.assign(r,t)}function Je(){var e={env:$n,wasi_snapshot_preview1:$n};function t(e,t){var r=e.exports;o.asm=r,L(O=o.asm.memory,"memory not found in wasm exports"),ue(O.buffer),L(he=o.asm.__indirect_function_table,"table not found in wasm exports"),De(o.asm.__wasm_call_ctors),Fe("wasm-instantiate")}Ne("wasm-instantiate");var r=o;function i(e){L(o===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,t(e.instance)}function a(t){var r;return ze().then((function(t){return r=t,WebAssembly.instantiate(t,e)})).then((function(e){return Ue=new We(r,e.module),e})).then(t,(function(e){_("failed to asynchronously prepare wasm: "+e),Qe(je)&&_("warning: Loading from a file URI ("+je+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),Ve(e)}))}if(o.instantiateWasm){Ue=Ye(We,o.wasmOffsetData);try{return o.instantiateWasm(e,t)}catch(e){return _("Module.instantiateWasm callback failed with error: "+e),!1}}return(w||"function"!=typeof WebAssembly.instantiateStreaming||He(je)||"function"!=typeof fetch?a(i):fetch(je,{credentials:"same-origin"}).then((function(t){var r=WebAssembly.instantiateStreaming(t,e),n=t.clone().arrayBuffer();return r.then((function(e){n.then((function(t){Ue=new We(new Uint8Array(t),e.module),i(e)}),(function(e){_("failed to initialize offset-converter: "+e)}))}),(function(e){return _("wasm streaming compile failed: "+e),_("falling back to ArrayBuffer instantiation"),a(i)}))}))).catch(n),{}}He(je="mlsGen.wasm")||(je=y(je)),We.prototype.convert=function(e,t){return this.offset_map[e]+t},We.prototype.getIndex=function(e){for(var t,r=0,n=this.func_starts.length;r<n;)t=Math.floor((r+n)/2),this.func_starts[t]>e?n=t:r=t+1;return r+this.import_functions-1},We.prototype.isSameFunc=function(e,t){return this.getIndex(e)==this.getIndex(t)},We.prototype.getName=function(e){var t=this.getIndex(e);return this.name_map[t]||"wasm-function["+t+"]"};var Ke={9944289:function(){return yn((function(){return de(o.ASAN_OPTIONS||0)}))},9944386:function(){return yn((function(){return de(o.LSAN_OPTIONS||0)}))},9944483:function(){return yn((function(){return de(o.UBSAN_OPTIONS||0)}))},9944581:function(){var e=o.printWithColors;return null!=e?e:u&&process.stderr.isTTY}};function $e(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?rt(r)():rt(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(o)}}function Ze(e){return T("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function et(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){var t=Ze(e);return e===t?e:t+" ["+e+"]"}))}var tt=[];function rt(e){var t=tt[e];return t||(e>=tt.length&&(tt.length=e+1),tt[e]=t=he.get(e)),L(he.get(e)==t,"JavaScript-side Wasm function table mirror is out of date!"),t}function nt(e,t,r,n){Ve("Assertion failed: "+H(e)+", at: "+[t?H(t):"unknown filename",r,n?H(n):"unknown function"])}var ot={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=ot.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=ot.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=ot.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return ot.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return ot.normalize(e.join("/"))},join2:function(e,t){return ot.normalize(e+"/"+t)}};function it(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}return function(){Ve("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}}var at={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:mt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t="/"===n.charAt(0)}return(t?"/":"")+(e=ot.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=at.resolve(e).substr(1),t=at.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var c=[];for(s=a;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")}},st={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){st.ttys[e]={input:[],output:[],ops:t},mt.registerDevice(e,st.stream_ops)},stream_ops:{open:function(e){var t=st.ttys[e.node.rdev];if(!t)throw new mt.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new mt.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new mt.ErrnoError(29)}if(void 0===s&&0===i)throw new mt.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new mt.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new mt.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;e.input=Jn(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(v(q(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(v(q(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(_(q(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(_(q(e.output,0)),e.output=[])}}};function ct(e,t){Y.fill(0,e,e+t)}function dt(e,t){return L(t,"alignment argument is required"),Math.ceil(e/t)*t}function pt(e){e=dt(e,65536);var t=no(65536,e);return t?(ct(t,e),t):0}var ut={ops_table:null,mount:function(e){return ut.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(mt.isBlkdev(r)||mt.isFIFO(r))throw new mt.ErrnoError(63);ut.ops_table||(ut.ops_table={dir:{node:{getattr:ut.node_ops.getattr,setattr:ut.node_ops.setattr,lookup:ut.node_ops.lookup,mknod:ut.node_ops.mknod,rename:ut.node_ops.rename,unlink:ut.node_ops.unlink,rmdir:ut.node_ops.rmdir,readdir:ut.node_ops.readdir,symlink:ut.node_ops.symlink},stream:{llseek:ut.stream_ops.llseek}},file:{node:{getattr:ut.node_ops.getattr,setattr:ut.node_ops.setattr},stream:{llseek:ut.stream_ops.llseek,read:ut.stream_ops.read,write:ut.stream_ops.write,allocate:ut.stream_ops.allocate,mmap:ut.stream_ops.mmap,msync:ut.stream_ops.msync}},link:{node:{getattr:ut.node_ops.getattr,setattr:ut.node_ops.setattr,readlink:ut.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ut.node_ops.getattr,setattr:ut.node_ops.setattr},stream:mt.chrdev_stream_ops}});var o=mt.createNode(e,t,r,n);return mt.isDir(o.mode)?(o.node_ops=ut.ops_table.dir.node,o.stream_ops=ut.ops_table.dir.stream,o.contents={}):mt.isFile(o.mode)?(o.node_ops=ut.ops_table.file.node,o.stream_ops=ut.ops_table.file.stream,o.usedBytes=0,o.contents=null):mt.isLink(o.mode)?(o.node_ops=ut.ops_table.link.node,o.stream_ops=ut.ops_table.link.stream):mt.isChrdev(o.mode)&&(o.node_ops=ut.ops_table.chrdev.node,o.stream_ops=ut.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=mt.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,mt.isDir(e.mode)?t.size=4096:mt.isFile(e.mode)?t.size=e.usedBytes:mt.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ut.resizeFileStorage(e,t.size)},lookup:function(e,t){throw mt.genericErrors[44]},mknod:function(e,t,r,n){return ut.createNode(e,t,r,n)},rename:function(e,t,r){if(mt.isDir(e.mode)){var n;try{n=mt.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new mt.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=mt.lookupNode(e,t);for(var n in r.contents)throw new mt.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=ut.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!mt.isLink(e.mode))throw new mt.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(L(a>=0),a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write:function(e,t,r,n,o,i){if(L(!(t instanceof ArrayBuffer)),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return L(0===o,"canOwn must imply no weird position inside the file"),a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(ut.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&mt.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new mt.ErrnoError(28);return n},allocate:function(e,t,r){ut.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,i){if(0!==t)throw new mt.ErrnoError(28);if(!mt.isFile(e.node.mode))throw new mt.ErrnoError(43);var a,s,c=e.node.contents;if(2&i||c.buffer!==z){if((n>0||n+r<c.length)&&(c=c.subarray?c.subarray(n,n+r):Array.prototype.slice.call(c,n,n+r)),s=!0,!(a=pt(r)))throw new mt.ErrnoError(48);W.set(c,a)}else s=!1,a=c.byteOffset;return{ptr:a,allocated:s}},msync:function(e,t,r,n,o){if(!mt.isFile(e.node.mode))throw new mt.ErrnoError(43);return 2&o||ut.stream_ops.write(e,t,0,n,r,!1),0}}};function lt(e,t,r,n){var o=n?"":xe("al "+e);f(e,(function(r){L(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&Fe(o)}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&Ne(o)}var ht={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},ft={},mt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=at.resolve(mt.cwd(),e)))return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};for(var n in r)void 0===t[n]&&(t[n]=r[n]);if(t.recurse_count>8)throw new mt.ErrnoError(32);for(var o=ot.normalizeArray(e.split("/").filter((e=>!!e)),!1),i=mt.root,a="/",s=0;s<o.length;s++){var c=s===o.length-1;if(c&&t.parent)break;if(i=mt.lookupNode(i,o[s]),a=ot.join2(a,o[s]),mt.isMountpoint(i)&&(!c||c&&t.follow_mount)&&(i=i.mounted.root),!c||t.follow)for(var d=0;mt.isLink(i.mode);){var p=mt.readlink(a);if(a=at.resolve(ot.dirname(a),p),i=mt.lookupPath(a,{recurse_count:t.recurse_count}).node,d++>40)throw new mt.ErrnoError(32)}}return{path:a,node:i}},getPath:e=>{for(var t;;){if(mt.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%mt.nameTable.length},hashAddNode:e=>{var t=mt.hashName(e.parent.id,e.name);e.name_next=mt.nameTable[t],mt.nameTable[t]=e},hashRemoveNode:e=>{var t=mt.hashName(e.parent.id,e.name);if(mt.nameTable[t]===e)mt.nameTable[t]=e.name_next;else for(var r=mt.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=mt.mayLookup(e);if(r)throw new mt.ErrnoError(r,e);for(var n=mt.hashName(e.id,t),o=mt.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return mt.lookup(e,t)},createNode:(e,t,r,n)=>{L("object"==typeof e);var o=new mt.FSNode(e,t,r,n);return mt.hashAddNode(o),o},destroyNode:e=>{mt.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=mt.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>mt.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>mt.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return mt.lookupNode(e,t),20}catch(e){}return mt.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=mt.lookupNode(e,t)}catch(e){return e.errno}var o=mt.nodePermissions(e,"wx");if(o)return o;if(r){if(!mt.isDir(n.mode))return 54;if(mt.isRoot(n)||mt.getPath(n)===mt.cwd())return 10}else if(mt.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?mt.isLink(e.mode)?32:mt.isDir(e.mode)&&("r"!==mt.flagsToPermissionString(t)||512&t)?31:mt.nodePermissions(e,mt.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=mt.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!mt.streams[r])return r;throw new mt.ErrnoError(33)},getStream:e=>mt.streams[e],createStream:(e,t,r)=>{mt.FSStream||(mt.FSStream=function(){},mt.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}),e=Object.assign(new mt.FSStream,e);var n=mt.nextfd(t,r);return e.fd=n,mt.streams[n]=e,e},closeStream:e=>{mt.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=mt.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new mt.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{mt.devices[e]={stream_ops:t}},getDevice:e=>mt.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),mt.syncFSRequests++,mt.syncFSRequests>1&&_("warning: "+mt.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=mt.getMounts(mt.root.mount),n=0;function o(e){return L(mt.syncFSRequests>0),mt.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{if("string"==typeof e)throw e;var n,o="/"===r,i=!r;if(o&&mt.root)throw new mt.ErrnoError(10);if(!o&&!i){var a=mt.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,mt.isMountpoint(n))throw new mt.ErrnoError(10);if(!mt.isDir(n.mode))throw new mt.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,o?mt.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:e=>{var t=mt.lookupPath(e,{follow_mount:!1});if(!mt.isMountpoint(t.node))throw new mt.ErrnoError(28);var r=t.node,n=r.mounted,o=mt.getMounts(n);Object.keys(mt.nameTable).forEach((e=>{for(var t=mt.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&mt.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);L(-1!==i),r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=mt.lookupPath(e,{parent:!0}).node,o=ot.basename(e);if(!o||"."===o||".."===o)throw new mt.ErrnoError(28);var i=mt.mayCreate(n,o);if(i)throw new mt.ErrnoError(i);if(!n.node_ops.mknod)throw new mt.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,mt.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,mt.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{mt.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,mt.mknod(e,t,r)),symlink:(e,t)=>{if(!at.resolve(e))throw new mt.ErrnoError(44);var r=mt.lookupPath(t,{parent:!0}).node;if(!r)throw new mt.ErrnoError(44);var n=ot.basename(t),o=mt.mayCreate(r,n);if(o)throw new mt.ErrnoError(o);if(!r.node_ops.symlink)throw new mt.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=ot.dirname(e),i=ot.dirname(t),a=ot.basename(e),s=ot.basename(t);if(r=mt.lookupPath(e,{parent:!0}).node,n=mt.lookupPath(t,{parent:!0}).node,!r||!n)throw new mt.ErrnoError(44);if(r.mount!==n.mount)throw new mt.ErrnoError(75);var c,d=mt.lookupNode(r,a),p=at.relative(e,i);if("."!==p.charAt(0))throw new mt.ErrnoError(28);if("."!==(p=at.relative(t,o)).charAt(0))throw new mt.ErrnoError(55);try{c=mt.lookupNode(n,s)}catch(e){}if(d!==c){var u=mt.isDir(d.mode),l=mt.mayDelete(r,a,u);if(l)throw new mt.ErrnoError(l);if(l=c?mt.mayDelete(n,s,u):mt.mayCreate(n,s))throw new mt.ErrnoError(l);if(!r.node_ops.rename)throw new mt.ErrnoError(63);if(mt.isMountpoint(d)||c&&mt.isMountpoint(c))throw new mt.ErrnoError(10);if(n!==r&&(l=mt.nodePermissions(r,"w")))throw new mt.ErrnoError(l);mt.hashRemoveNode(d);try{r.node_ops.rename(d,n,s)}catch(e){throw e}finally{mt.hashAddNode(d)}}},rmdir:e=>{var t=mt.lookupPath(e,{parent:!0}).node,r=ot.basename(e),n=mt.lookupNode(t,r),o=mt.mayDelete(t,r,!0);if(o)throw new mt.ErrnoError(o);if(!t.node_ops.rmdir)throw new mt.ErrnoError(63);if(mt.isMountpoint(n))throw new mt.ErrnoError(10);t.node_ops.rmdir(t,r),mt.destroyNode(n)},readdir:e=>{var t=mt.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new mt.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=mt.lookupPath(e,{parent:!0}).node;if(!t)throw new mt.ErrnoError(44);var r=ot.basename(e),n=mt.lookupNode(t,r),o=mt.mayDelete(t,r,!1);if(o)throw new mt.ErrnoError(o);if(!t.node_ops.unlink)throw new mt.ErrnoError(63);if(mt.isMountpoint(n))throw new mt.ErrnoError(10);t.node_ops.unlink(t,r),mt.destroyNode(n)},readlink:e=>{var t=mt.lookupPath(e).node;if(!t)throw new mt.ErrnoError(44);if(!t.node_ops.readlink)throw new mt.ErrnoError(28);return at.resolve(mt.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=mt.lookupPath(e,{follow:!t}).node;if(!r)throw new mt.ErrnoError(44);if(!r.node_ops.getattr)throw new mt.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>mt.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?mt.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new mt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{mt.chmod(e,t,!0)},fchmod:(e,t)=>{var r=mt.getStream(e);if(!r)throw new mt.ErrnoError(8);mt.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?mt.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new mt.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{mt.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=mt.getStream(e);if(!n)throw new mt.ErrnoError(8);mt.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new mt.ErrnoError(28);var r;if(!(r="string"==typeof e?mt.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new mt.ErrnoError(63);if(mt.isDir(r.mode))throw new mt.ErrnoError(31);if(!mt.isFile(r.mode))throw new mt.ErrnoError(28);var n=mt.nodePermissions(r,"w");if(n)throw new mt.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=mt.getStream(e);if(!r)throw new mt.ErrnoError(8);if(0==(2097155&r.flags))throw new mt.ErrnoError(28);mt.truncate(r.node,t)},utime:(e,t,r)=>{var n=mt.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r,n,i)=>{if(""===e)throw new mt.ErrnoError(44);var a;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?mt.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)a=e;else{e=ot.normalize(e);try{a=mt.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(a){if(128&t)throw new mt.ErrnoError(20)}else a=mt.mknod(e,r,0),s=!0;if(!a)throw new mt.ErrnoError(44);if(mt.isChrdev(a.mode)&&(t&=-513),65536&t&&!mt.isDir(a.mode))throw new mt.ErrnoError(54);if(!s){var c=mt.mayOpen(a,t);if(c)throw new mt.ErrnoError(c)}512&t&&mt.truncate(a,0),t&=-131713;var d=mt.createStream({node:a,path:mt.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);return d.stream_ops.open&&d.stream_ops.open(d),!o.logReadFiles||1&t||(mt.readFiles||(mt.readFiles={}),e in mt.readFiles||(mt.readFiles[e]=1)),d},close:e=>{if(mt.isClosed(e))throw new mt.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{mt.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(mt.isClosed(e))throw new mt.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new mt.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new mt.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new mt.ErrnoError(28);if(mt.isClosed(e))throw new mt.ErrnoError(8);if(1==(2097155&e.flags))throw new mt.ErrnoError(8);if(mt.isDir(e.node.mode))throw new mt.ErrnoError(31);if(!e.stream_ops.read)throw new mt.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new mt.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new mt.ErrnoError(28);if(mt.isClosed(e))throw new mt.ErrnoError(8);if(0==(2097155&e.flags))throw new mt.ErrnoError(8);if(mt.isDir(e.node.mode))throw new mt.ErrnoError(31);if(!e.stream_ops.write)throw new mt.ErrnoError(28);e.seekable&&1024&e.flags&&mt.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new mt.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:(e,t,r)=>{if(mt.isClosed(e))throw new mt.ErrnoError(8);if(t<0||r<=0)throw new mt.ErrnoError(28);if(0==(2097155&e.flags))throw new mt.ErrnoError(8);if(!mt.isFile(e.node.mode)&&!mt.isDir(e.node.mode))throw new mt.ErrnoError(43);if(!e.stream_ops.allocate)throw new mt.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o,i)=>{if(0!=(2&o)&&0==(2&i)&&2!=(2097155&e.flags))throw new mt.ErrnoError(2);if(1==(2097155&e.flags))throw new mt.ErrnoError(2);if(!e.stream_ops.mmap)throw new mt.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o,i)},msync:(e,t,r,n,o)=>e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new mt.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,n=mt.open(e,t.flags),o=mt.stat(e).size,i=new Uint8Array(o);return mt.read(n,i,0,o,0),"utf8"===t.encoding?r=q(i,0):"binary"===t.encoding&&(r=i),mt.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=mt.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(G(t)+1),i=Q(t,o,0,o.length);mt.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");mt.write(n,t,0,t.byteLength,void 0,r.canOwn)}mt.close(n)},cwd:()=>mt.currentPath,chdir:e=>{var t=mt.lookupPath(e,{follow:!0});if(null===t.node)throw new mt.ErrnoError(44);if(!mt.isDir(t.node.mode))throw new mt.ErrnoError(54);var r=mt.nodePermissions(t.node,"x");if(r)throw new mt.ErrnoError(r);mt.currentPath=t.path},createDefaultDirectories:()=>{mt.mkdir("/tmp"),mt.mkdir("/home"),mt.mkdir("/home/web_user")},createDefaultDevices:()=>{mt.mkdir("/dev"),mt.registerDevice(mt.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),mt.mkdev("/dev/null",mt.makedev(1,3)),st.register(mt.makedev(5,0),st.default_tty_ops),st.register(mt.makedev(6,0),st.default_tty1_ops),mt.mkdev("/dev/tty",mt.makedev(5,0)),mt.mkdev("/dev/tty1",mt.makedev(6,0));var e=it();mt.createDevice("/dev","random",e),mt.createDevice("/dev","urandom",e),mt.mkdir("/dev/shm"),mt.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{mt.mkdir("/proc");var e=mt.mkdir("/proc/self");mt.mkdir("/proc/self/fd"),mt.mount({mount:()=>{var t=mt.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=mt.getStream(r);if(!n)throw new mt.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{o.stdin?mt.createDevice("/dev","stdin",o.stdin):mt.symlink("/dev/tty","/dev/stdin"),o.stdout?mt.createDevice("/dev","stdout",null,o.stdout):mt.symlink("/dev/tty","/dev/stdout"),o.stderr?mt.createDevice("/dev","stderr",null,o.stderr):mt.symlink("/dev/tty1","/dev/stderr");var e=mt.open("/dev/stdin",0),t=mt.open("/dev/stdout",1),r=mt.open("/dev/stderr",1);L(0===e.fd,"invalid handle for stdin ("+e.fd+")"),L(1===t.fd,"invalid handle for stdout ("+t.fd+")"),L(2===r.fd,"invalid handle for stderr ("+r.fd+")")},ensureErrnoError:()=>{mt.ErrnoError||(mt.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){for(var t in this.errno=e,ft)if(ft[t]===e){this.code=t;break}},this.setErrno(e),this.message=ht[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=et(this.stack))},mt.ErrnoError.prototype=new Error,mt.ErrnoError.prototype.constructor=mt.ErrnoError,[44].forEach((e=>{mt.genericErrors[e]=new mt.ErrnoError(e),mt.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{mt.ensureErrnoError(),mt.nameTable=new Array(4096),mt.mount(ut,{},"/"),mt.createDefaultDirectories(),mt.createDefaultDevices(),mt.createSpecialDirectories(),mt.filesystems={MEMFS:ut}},init:(e,t,r)=>{L(!mt.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),mt.init.initialized=!0,mt.ensureErrnoError(),o.stdin=e||o.stdin,o.stdout=t||o.stdout,o.stderr=r||o.stderr,mt.createStandardStreams()},quit:()=>{mt.init.initialized=!1,eo();for(var e=0;e<mt.streams.length;e++){var t=mt.streams[e];t&&mt.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=mt.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=mt.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=mt.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ot.basename(e),n=mt.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:mt.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ot.join2(e,i);try{mt.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=ot.join2("string"==typeof e?e:mt.getPath(e),t),a=mt.getMode(n,o);return mt.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:mt.getPath(e),a=t?ot.join2(e,t):e);var s=mt.getMode(n,o),c=mt.create(a,s);if(r){if("string"==typeof r){for(var d=new Array(r.length),p=0,u=r.length;p<u;++p)d[p]=r.charCodeAt(p);r=d}mt.chmod(c,146|s);var l=mt.open(c,577);mt.write(l,r,0,r.length,0,i),mt.close(l),mt.chmod(c,s)}return c},createDevice:(e,t,r,n)=>{var o=ot.join2("string"==typeof e?e:mt.getPath(e),t),i=mt.getMode(!!r,!!n);mt.createDevice.major||(mt.createDevice.major=64);var a=mt.makedev(mt.createDevice.major++,0);return mt.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var c;try{c=r()}catch(e){throw new mt.ErrnoError(29)}if(void 0===c&&0===a)throw new mt.ErrnoError(6);if(null==c)break;a++,t[n+s]=c}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new mt.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),mt.mkdev(o,i,a)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!h)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Jn(h(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new mt.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Jn(o.responseText||"",!0)})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,v("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!p)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var c=mt.createFile(e,t,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var d={};return Object.keys(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];d[e]=function(){return mt.forceLoadFile(c),t.apply(null,arguments)}})),d.read=(e,t,r,n,o)=>{mt.forceLoadFile(c);var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(L(a>=0),i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a},c.stream_ops=d,c},createPreloadedFile:(e,t,r,n,o,i,a,s,c,d)=>{var p=t?at.resolve(ot.join2(e,t)):e,u=xe("cp "+p);function l(r){function l(r){d&&d(),s||mt.createDataFile(e,t,r,n,o,c),i&&i(),Fe(u)}Browser.handledByPreloadPlugin(r,p,l,(()=>{a&&a(),Fe(u)}))||l(r)}Ne(u),"string"==typeof r?lt(r,(e=>l(e)),a):l(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=mt.indexedDB();try{var o=n.open(mt.DB_NAME(),mt.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{v("creating db"),o.result.createObjectStore(mt.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([mt.DB_STORE_NAME],"readwrite"),i=n.objectStore(mt.DB_STORE_NAME),a=0,s=0,c=e.length;function d(){0==s?t():r()}e.forEach((e=>{var t=i.put(mt.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==c&&d()},t.onerror=()=>{s++,a+s==c&&d()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=mt.indexedDB();try{var o=n.open(mt.DB_NAME(),mt.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([mt.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(mt.DB_STORE_NAME),s=0,c=0,d=e.length;function p(){0==c?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{mt.analyzePath(e).exists&&mt.unlink(e),mt.createDataFile(ot.dirname(e),ot.basename(e),t.result,!0,!0,!0),++s+c==d&&p()},t.onerror=()=>{c++,s+c==d&&p()}})),i.onerror=r},o.onerror=r},absolutePath:()=>{Ve("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder:()=>{Ve("FS.createFolder has been removed; use FS.mkdir instead")},createLink:()=>{Ve("FS.createLink has been removed; use FS.symlink instead")},joinPath:()=>{Ve("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc:()=>{Ve("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath:()=>{Ve("FS.standardizePath has been removed; use PATH.normalize instead")}},gt={mappings:{},DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if("/"===t[0])return t;var n;if(-100===e)n=mt.cwd();else{var o=mt.getStream(e);if(!o)throw new mt.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new mt.ErrnoError(44);return n}return ot.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&ot.normalize(t)!==ot.normalize(mt.getPath(e.node)))return-54;throw e}return V(r>>2,n.dev),V(r+4>>2,0),V(r+8>>2,n.ino),V(r+12>>2,n.mode),V(r+16>>2,n.nlink),V(r+20>>2,n.uid),V(r+24>>2,n.gid),V(r+28>>2,n.rdev),V(r+32>>2,0),V(r+40>>2,(Be=[n.size>>>0,(Le=n.size,+Math.abs(Le)>=1?Le>0?(0|Math.min(+Math.floor(Le/4294967296),4294967295))>>>0:~~+Math.ceil((Le-+(~~Le>>>0))/4294967296)>>>0:0)])[0]),V(r+44>>2,Be[1]),V(r+48>>2,4096),V(r+52>>2,n.blocks),V(r+56>>2,n.atime.getTime()/1e3|0),V(r+60>>2,0),V(r+64>>2,n.mtime.getTime()/1e3|0),V(r+68>>2,0),V(r+72>>2,n.ctime.getTime()/1e3|0),V(r+76>>2,0),V(r+80>>2,(Be=[n.ino>>>0,(Le=n.ino,+Math.abs(Le)>=1?Le>0?(0|Math.min(+Math.floor(Le/4294967296),4294967295))>>>0:~~+Math.ceil((Le-+(~~Le>>>0))/4294967296)>>>0:0)])[0]),V(r+84>>2,Be[1]),0},doMsync:function(e,t,r,n,o){var i=Y.slice(e,e+r);mt.msync(t,i,o,r,n)},doMkdir:function(e,t){return"/"===(e=ot.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),mt.mkdir(e,t,0),0},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return mt.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var n=mt.readlink(e),o=Math.min(r,G(n)),i=S(t+o);return X(n,t,r+1),x(t+o,i),o},doAccess:function(e,t){if(-8&t)return-28;var r=mt.lookupPath(e,{follow:!0}).node;if(!r)return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&mt.nodePermissions(r,n)?-2:0},doDup:function(e,t,r){var n=mt.getStream(r);return n&&mt.close(n),mt.open(e,t,0,r,r).fd},doReadv:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=C(t+8*i>>2),s=C(t+(8*i+4)>>2),c=mt.read(e,W,a,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o},doWritev:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=C(t+8*i>>2),s=C(t+(8*i+4)>>2),c=mt.write(e,W,a,s,n);if(c<0)return-1;o+=c}return o},varargs:void 0,get:function(){return L(null!=gt.varargs),gt.varargs+=4,C(gt.varargs-4>>2)},getStr:function(e){return H(e)},getStreamFromFD:function(e){var t=mt.getStream(e);if(!t)throw new mt.ErrnoError(8);return t},get64:function(e,t){return L(e>=0?0===t:-1===t),e}};function yt(e){try{var t=gt.getStreamFromFD(e);return mt.open(t.path,t.flags,0).fd}catch(e){if(void 0===mt||!(e instanceof mt.ErrnoError))throw e;return-e.errno}}function Et(e,t,r){gt.varargs=r;try{var n=gt.getStr(e),o=r?gt.get():0;return mt.open(n,t,o).fd}catch(e){if(void 0===mt||!(e instanceof mt.ErrnoError))throw e;return-e.errno}}function vt(e,t){try{return e=gt.getStr(e),gt.doStat(mt.stat,e,t)}catch(e){if(void 0===mt||!(e instanceof mt.ErrnoError))throw e;return-e.errno}}function _t(e,t,r,n,o){}function Tt(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}function wt(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);bt=e}var bt=void 0;function Ot(e){for(var t="",r=e;A(r);)t+=bt[A(r++)];return t}var Pt={},St={},At={},Dt=48,Rt=57;function Ct(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=Dt&&t<=Rt?"_"+e:e}function Mt(e,t){return e=Ct(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function kt(e,t){var r=Mt(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var It=void 0;function xt(e){throw new It(e)}var Nt=void 0;function Ft(e){throw new Nt(e)}function Vt(e,t,r){function n(t){var n=r(t);n.length!==e.length&&Ft("Mismatched type converter count");for(var o=0;o<e.length;++o)jt(e[o],n[o])}e.forEach((function(e){At[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach((function(e,t){St.hasOwnProperty(e)?o[t]=St[e]:(i.push(e),Pt.hasOwnProperty(e)||(Pt[e]=[]),Pt[e].push((function(){o[t]=St[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function jt(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||xt('type "'+n+'" must have a positive integer typeid pointer'),St.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;xt("Cannot register type '"+n+"' twice")}if(St[e]=t,delete At[e],Pt.hasOwnProperty(e)){var o=Pt[e];delete Pt[e],o.forEach((function(e){e()}))}}function Ut(e,t,r,n,o){var i=Tt(r);jt(e,{name:t=Ot(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=W;else if(2===r)n=J;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=$}return this.fromWireType(n[e>>i])},destructorFunction:null})}function Lt(e){if(!(this instanceof hr))return!1;if(!(e instanceof hr))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o}function Bt(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}function qt(e){xt(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ht=!1;function Qt(e){}function Xt(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}function Gt(e){e.count.value-=1,0===e.count.value&&Xt(e)}function zt(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=zt(e,t,r.baseClass);return null===n?null:r.downcast(n)}var Wt={};function Yt(){return Object.keys(rr).length}function Jt(){var e=[];for(var t in rr)rr.hasOwnProperty(t)&&e.push(rr[t]);return e}var Kt=[];function $t(){for(;Kt.length;){var e=Kt.pop();e.$$.deleteScheduled=!1,e.delete()}}var Zt=void 0;function er(e){Zt=e,Kt.length&&Zt&&Zt($t)}function tr(){o.getInheritedInstanceCount=Yt,o.getLiveInheritedInstances=Jt,o.flushPendingDeletes=$t,o.setDelayFunction=er}var rr={};function nr(e,t){for(void 0===t&&xt("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}function or(e,t){return t=nr(e,t),rr[t]}function ir(e,t){return t.ptrType&&t.ptr||Ft("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Ft("Both smartPtrType and smartPtr must be specified"),t.count={value:1},sr(Object.create(e,{$$:{value:t}}))}function ar(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=or(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?ir(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):ir(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=Wt[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var c=zt(t,this.registeredClass,i.registeredClass);return null===c?o.call(this):this.isSmartPointer?ir(i.registeredClass.instancePrototype,{ptrType:i,ptr:c,smartPtrType:this,smartPtr:e}):ir(i.registeredClass.instancePrototype,{ptrType:i,ptr:c})}function sr(e){return"undefined"==typeof FinalizationRegistry?(sr=e=>e,e):(Ht=new FinalizationRegistry((e=>{console.warn(e.leakWarning.stack.replace(/^Error: /,"")),Gt(e.$$)})),Qt=e=>Ht.unregister(e),(sr=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t},n=t.ptrType.registeredClass;r.leakWarning=new Error("Embind found a leaked C++ instance "+n.name+" <0x"+t.ptr.toString(16)+">.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"),"captureStackTrace"in Error&&Error.captureStackTrace(r.leakWarning,ar),Ht.register(e,r,e)}return e})(e))}function cr(){if(this.$$.ptr||qt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=sr(Object.create(Object.getPrototypeOf(this),{$$:{value:Bt(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function dr(){this.$$.ptr||qt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&xt("Object already scheduled for deletion"),Qt(this),Gt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function pr(){return!this.$$.ptr}function ur(){return this.$$.ptr||qt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&xt("Object already scheduled for deletion"),Kt.push(this),1===Kt.length&&Zt&&Zt($t),this.$$.deleteScheduled=!0,this}function lr(){hr.prototype.isAliasOf=Lt,hr.prototype.clone=cr,hr.prototype.delete=dr,hr.prototype.isDeleted=pr,hr.prototype.deleteLater=ur}function hr(){}function fr(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||xt("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function mr(e,t,r){o.hasOwnProperty(e)?((void 0===r||void 0!==o[e].overloadTable&&void 0!==o[e].overloadTable[r])&&xt("Cannot register public name '"+e+"' twice"),fr(o,e,e),o.hasOwnProperty(r)&&xt("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),o[e].overloadTable[r]=t):(o[e]=t,void 0!==r&&(o[e].numArguments=r))}function gr(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function yr(e,t,r){for(;t!==r;)t.upcast||xt("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Er(e,t){if(null===t)return this.isReference&&xt("null is not a valid "+this.name),0;t.$$||xt('Cannot pass "'+Jr(t)+'" as a '+this.name),t.$$.ptr||xt("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return yr(t.$$.ptr,r,this.registeredClass)}function vr(e,t){var r;if(null===t)return this.isReference&&xt("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||xt('Cannot pass "'+Jr(t)+'" as a '+this.name),t.$$.ptr||xt("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&xt("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;if(r=yr(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&xt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:xt("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,Wr.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:xt("Unsupporting sharing policy")}return r}function _r(e,t){if(null===t)return this.isReference&&xt("null is not a valid "+this.name),0;t.$$||xt('Cannot pass "'+Jr(t)+'" as a '+this.name),t.$$.ptr||xt("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&xt("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return yr(t.$$.ptr,r,this.registeredClass)}function Tr(e){return this.fromWireType(M(e>>2))}function wr(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function br(e){this.rawDestructor&&this.rawDestructor(e)}function Or(e){null!==e&&e.delete()}function Pr(){Sr.prototype.getPointee=wr,Sr.prototype.destructor=br,Sr.prototype.argPackAdvance=8,Sr.prototype.readValueFromPointer=Tr,Sr.prototype.deleteObject=Or,Sr.prototype.fromWireType=ar}function Sr(e,t,r,n,o,i,a,s,c,d,p){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=p,o||void 0!==t.baseClass?this.toWireType=vr:n?(this.toWireType=Er,this.destructorFunction=null):(this.toWireType=_r,this.destructorFunction=null)}function Ar(e,t,r){o.hasOwnProperty(e)||Ft("Replacing nonexistant public symbol"),void 0!==o[e].overloadTable&&void 0!==r?o[e].overloadTable[r]=t:(o[e]=t,o[e].argCount=r)}function Dr(e,t,r){L("dynCall_"+e in o,"bad function pointer type - no table for sig '"+e+"'"),r&&r.length?L(r.length===e.substring(1).replace(/j/g,"--").length):L(1==e.length);var n=o["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)}function Rr(e,t,r){return e.includes("j")?Dr(e,t,r):(L(rt(t),"missing table entry in dynCall: "+t),rt(t).apply(null,r))}function Cr(e,t){L(e.includes("j"),"getDynCaller should only be called with i64 sigs");var r=[];return function(){return r.length=0,Object.assign(r,arguments),Rr(e,t,r)}}function Mr(e,t){var r=(e=Ot(e)).includes("j")?Cr(e,t):rt(t);return"function"!=typeof r&&xt("unknown function pointer with signature "+e+": "+t),r}var kr=void 0;function Ir(e){var t=Zn(e),r=Ot(t);return ro(t),r}function xr(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||St[t]||(At[t]?At[t].forEach(e):(r.push(t),n[t]=!0))})),new kr(e+": "+r.map(Ir).join([", "]))}function Nr(e,t,r,n,o,i,a,s,c,d,p,u,l){p=Ot(p),i=Mr(o,i),s&&(s=Mr(a,s)),d&&(d=Mr(c,d)),l=Mr(u,l);var h=Ct(p);mr(h,(function(){xr("Cannot construct "+p+" due to unbound types",[n])})),Vt([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:hr.prototype;var a=Mt(h,(function(){if(Object.getPrototypeOf(this)!==c)throw new It("Use 'new' to construct "+p);if(void 0===u.constructor_body)throw new It(p+" has no accessible constructor");var e=u.constructor_body[arguments.length];if(void 0===e)throw new It("Tried to invoke ctor of "+p+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(u.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),c=Object.create(o,{constructor:{value:a}});a.prototype=c;var u=new gr(p,a,c,l,r,i,s,d),f=new Sr(p,u,!0,!1,!1),m=new Sr(p+"*",u,!1,!1,!1),g=new Sr(p+" const*",u,!1,!0,!1);return Wt[e]={pointerType:m,constPointerType:g},Ar(h,a),[f,m,g]}))}function Fr(e,t){for(var r=[],n=0;n<e;n++)r.push(C((t>>2)+n));return r}function Vr(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function jr(e,t,r,n,o,i){L(t>0);var a=Fr(t,r);o=Mr(n,o),Vt([],[e],(function(e){var r="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new It("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[t-1]=()=>{xr("Cannot construct "+e.name+" due to unbound types",a)},Vt([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Lr(r,n,null,o,i),[]})),[]}))}function Ur(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var r=Mt(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function Lr(e,t,r,n,o){var i=t.length;i<2&&xt("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==r,s=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){s=!0;break}var d="void"!==t[0].name,p="",u="";for(c=0;c<i-2;++c)p+=(0!==c?", ":"")+"arg"+c,u+=(0!==c?", ":"")+"arg"+c+"Wired";var l="return function "+Ct(e)+"("+p+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(l+="var destructors = [];\n");var h=s?"destructors":"null",f=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[xt,n,o,Vr,t[0],t[1]];for(a&&(l+="var thisWired = classParam.toWireType("+h+", this);\n"),c=0;c<i-2;++c)l+="var arg"+c+"Wired = argType"+c+".toWireType("+h+", arg"+c+"); // "+t[c+2].name+"\n",f.push("argType"+c),m.push(t[c+2]);if(a&&(u="thisWired"+(u.length>0?", ":"")+u),l+=(d?"var rv = ":"")+"invoker(fn"+(u.length>0?", ":"")+u+");\n",s)l+="runDestructors(destructors);\n";else for(c=a?1:2;c<t.length;++c){var g=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==t[c].destructorFunction&&(l+=g+"_dtor("+g+"); // "+t[c].name+"\n",f.push(g+"_dtor"),m.push(t[c].destructorFunction))}return d&&(l+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),l+="}\n",f.push(l),Ur(Function,f).apply(null,m)}function Br(e,t,r,n,o,i,a,s){var c=Fr(r,n);t=Ot(t),i=Mr(o,i),Vt([],[e],(function(e){var n=(e=e[0]).name+"."+t;function o(){xr("Cannot call "+n+" due to unbound types",c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var d=e.registeredClass.instancePrototype,p=d[t];return void 0===p||void 0===p.overloadTable&&p.className!==e.name&&p.argCount===r-2?(o.argCount=r-2,o.className=e.name,d[t]=o):(fr(d,t,n),d[t].overloadTable[r-2]=o),Vt([],c,(function(o){var s=Lr(n,o,e,i,a);return void 0===d[t].overloadTable?(s.argCount=r-2,d[t]=s):d[t].overloadTable[r-2]=s,[]})),[]}))}var qr=[],Hr=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Qr(e){e>4&&0==--Hr[e].refcount&&(Hr[e]=void 0,qr.push(e))}function Xr(){for(var e=0,t=5;t<Hr.length;++t)void 0!==Hr[t]&&++e;return e}function Gr(){for(var e=5;e<Hr.length;++e)if(void 0!==Hr[e])return Hr[e];return null}function zr(){o.count_emval_handles=Xr,o.get_first_emval=Gr}var Wr={toValue:function(e){return e||xt("Cannot use deleted val. handle = "+e),Hr[e].value},toHandle:function(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=qr.length?qr.pop():Hr.length;return Hr[t]={refcount:1,value:e},t}}};function Yr(e,t){jt(e,{name:t=Ot(t),fromWireType:function(e){var t=Wr.toValue(e);return Qr(e),t},toWireType:function(e,t){return Wr.toHandle(t)},argPackAdvance:8,readValueFromPointer:Tr,destructorFunction:null})}function Jr(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function Kr(e,t){switch(t){case 2:return function(e){return this.fromWireType(k(e>>2))};case 3:return function(e){return this.fromWireType(I(e>>3))};default:throw new TypeError("Unknown float type: "+e)}}function $r(e,t,r){var n=Tt(r);jt(e,{name:t=Ot(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+Jr(t)+'" to '+this.name);return t},argPackAdvance:8,readValueFromPointer:Kr(t,n),destructorFunction:null})}function Zr(e,t,r,n,o,i){var a=Fr(t,r);e=Ot(e),o=Mr(n,o),mr(e,(function(){xr("Cannot call "+e+" due to unbound types",a)}),t-1),Vt([],a,(function(r){var n=[r[0],null].concat(r.slice(1));return Ar(e,Lr(e,n,null,o,i),t-1),[]}))}function en(e,t,r){switch(t){case 0:return r?function(e){return S(e)}:function(e){return A(e)};case 1:return r?function(e){return D(e>>1)}:function(e){return R(e>>1)};case 2:return r?function(e){return C(e>>2)}:function(e){return M(e>>2)};default:throw new TypeError("Unknown integer type: "+e)}}function tn(e,t,r,n,o){t=Ot(t),-1===o&&(o=4294967295);var i=Tt(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var c=t.includes("unsigned"),d=(e,r)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+Jr(e)+'" to '+r);if(e<n||e>o)throw new TypeError('Passing a number "'+Jr(e)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+n+", "+o+"]!")};jt(e,{name:t,fromWireType:a,toWireType:c?function(e,t){return d(t,this.name),t>>>0}:function(e,t){return d(t,this.name),t},argPackAdvance:8,readValueFromPointer:en(t,i,0!==n),destructorFunction:null})}function rn(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=Z,r=t[e>>=2],o=t[e+1];return new n(z,o,r)}jt(e,{name:r=Ot(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}function nn(e,t){var r="std::string"===(t=Ot(t));jt(e,{name:t,fromWireType:function(e){var t,n=M(e>>2);if(r)for(var o=e+4,i=0;i<=n;++i){var a=e+4+i;if(i==n||0==A(a)){var s=H(o,a-o);void 0===t?t=s:(t+=String.fromCharCode(0),t+=s),o=a+1}}else{var c=new Array(n);for(i=0;i<n;++i)c[i]=String.fromCharCode(A(e+4+i));t=c.join("")}return ro(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n="string"==typeof t;n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||xt("Cannot pass non-string to std::string");var o=(r&&n?()=>G(t):()=>t.length)(),i=to(4+o+1);if(j(i>>2,o),r&&n)X(t,i+4,o+1);else if(n)for(var a=0;a<o;++a){var s=t.charCodeAt(a);s>255&&(ro(i),xt("String has UTF-16 code units that do not fit in 8 bits")),N(i+4+a,s)}else for(a=0;a<o;++a)N(i+4+a,t[a]);return null!==e&&e.push(ro,i),i},argPackAdvance:8,readValueFromPointer:Tr,destructorFunction:function(e){ro(e)}})}function on(e,t,r){var n,o,i,a,s;r=Ot(r),2===t?(n=ne,o=oe,a=ie,i=()=>K,s=1):4===t&&(n=ae,o=se,a=ce,i=()=>Z,s=2),jt(e,{name:r,fromWireType:function(e){for(var r,o=M(e>>2),a=i(),c=e+4,d=0;d<=o;++d){var p=e+4+d*t;if(d==o||0==a[p>>s]){var u=n(c,p-c);void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),c=p+t}}return ro(e),r},toWireType:function(e,n){"string"!=typeof n&&xt("Cannot pass non-string to C++ string type "+r);var i=a(n),c=to(4+i+t);return j(c>>2,i>>s),o(n,c+4,i+t),null!==e&&e.push(ro,c),c},argPackAdvance:8,readValueFromPointer:Tr,destructorFunction:function(e){ro(e)}})}function an(e,t){jt(e,{isVoid:!0,name:t=Ot(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})}function sn(e){e>4&&(Hr[e].refcount+=1)}function cn(e,t){var r=St[e];return void 0===r&&xt(t+" has unknown type "+Ir(e)),r}function dn(e,t){var r=(e=cn(e,"_emval_take_value")).readValueFromPointer(t);return Wr.toHandle(r)}function pn(){Ve("native code called abort()")}var un,ln=[];function hn(e,t){var r;for(L(Array.isArray(ln)),L(t%16==0),ln.length=0,t>>=2;r=A(e++);){L(100===r||102===r||105===r);var n=r<105;n&&1&t&&t++,ln.push(n?I(t++>>1):C(t)),++t}return ln}function fn(e,t,r){var n=hn(t,r);return Ke.hasOwnProperty(e)||Ve("No EM_ASM constant found at address "+e),Ke[e].apply(null,n)}function mn(e,t,r){return fn(e,t,r)}function gn(e,t,r,n,o,i){var a;i<<=12;var s=!1;if(0!=(16&n)&&e%65536!=0)return-28;if(0!=(32&n)){if(!(a=pt(t)))return-48;s=!0}else{var c=mt.getStream(o);if(!c)return-8;var d=mt.mmap(c,e,t,i,r,n);a=d.ptr,s=d.allocated}return gt.mappings[a]={malloc:a,len:t,allocated:s,fd:o,prot:r,flags:n,offset:i},a}function yn(e){var t=void 0!==to?to:void 0,r=void 0!==no?no:void 0,n=void 0!==ro?ro:void 0;to=oo,no=ao,ro=io;try{return e()}finally{to=t,no=r,ro=n}}function En(e,t,r,n,o,i){return yn((function(){return gn(e,t,r,n,o,i)}))}function vn(e,t){var r=gt.mappings[e];if(0===t||!r)return-28;if(t===r.len){var n=mt.getStream(r.fd);n&&(2&r.prot&&gt.doMsync(e,n,t,r.flags,r.offset),mt.munmap(n)),gt.mappings[e]=null,r.allocated&&ro(r.malloc)}return 0}function _n(e,t){return yn((function(){return vn(e,t)}))}function Tn(e){L("number"==typeof e),console.error(H(e))}function wn(){return Y.length}function bn(e,t){return X(je,e,t)}un=()=>performance.now();var On={};function Pn(e){var t;return L(Ue),(t=/\bwasm-function\[\d+\]:(0x[0-9a-f]+)/.exec(e))?+t[1]:(t=/\bwasm-function\[(\d+)\]:(\d+)/.exec(e))?Ue.convert(+t[1],+t[2]):(t=/:(\d+):\d+(?:\)|$)/.exec(e))?2147483648|+t[1]:0}function Sn(e){if(On.last_get_source_pc==e)return On.last_source;var t,r;if(!r){var n=On[e];if(!n)return null;((t=/\((.*):(\d+):(\d+)\)$/.exec(n))||(t=/@(.*):(\d+):(\d+)/.exec(n)))&&(r={file:t[1],line:t[2],column:t[3]})}return On.last_get_source_pc=e,On.last_source=r,r}function An(e){var t=Sn(e);return t&&t.column||0}function Dn(e){return yn((function(){var t=Sn(e);return t?(Dn.ret&&ro(Dn.ret),Dn.ret=de(t.file),Dn.ret):0}))}function Rn(e){return yn((function(){var t;if(2147483648&e){var r,n=On[e];if(!n)return 0;if(r=/^\s+at (.*) \(.*\)$/.exec(n))t=r[1];else{if(!(r=/^(.+?)@/.exec(n)))return 0;t=r[1]}}else t=Ue.getName(e);return Rn.ret&&ro(Rn.ret),Rn.ret=de(t),Rn.ret}))}function Cn(e){var t=Sn(e);return t?t.line:0}function Mn(e){Ve("Cannot enlarge memory arrays to size "+e+" bytes (OOM). Either (1) compile with -s INITIAL_MEMORY=X with X higher than the current value "+W.length+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function kn(e){Y.length,Mn(e>>>=0)}function In(e){var t=(new Error).stack.split("\n");return"Error"==t[0]&&t.shift(),Pn(t[e+2])}function xn(e){e.forEach((function(e){var t=Pn(e);t&&(On[t]=e)}))}function Nn(){var e=(new Error).stack.split("\n");return"Error"==e[0]&&e.shift(),xn(e),On.last_addr=Pn(e[2]),On.last_stack=e,On.last_addr}function Fn(e,t,r){var n;On.last_addr==e?n=On.last_stack:("Error"==(n=(new Error).stack.split("\n"))[0]&&n.shift(),xn(n));for(var o=2;n[o]&&Pn(n[o])!=e;)++o;for(var i=0;i<r&&n[i+o];++i)V(t+4*i>>2,Pn(n[i+o]));return i}var Vn={};function jn(){return s||"./this.program"}function Un(){if(!Un.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:jn()};for(var t in Vn)void 0===Vn[t]?delete e[t]:e[t]=Vn[t];var r=[];for(var t in e)r.push(t+"="+e[t]);Un.strings=r}return Un.strings}function Ln(e,t){var r=0;return Un().forEach((function(n,o){var i=t+r;V(e+4*o>>2,i),pe(n,i),r+=n.length+1})),0}function Bn(e,t){var r=Un();V(e>>2,r.length);var n=0;return r.forEach((function(e){n+=e.length+1})),V(t>>2,n),0}function qn(e){try{var t=gt.getStreamFromFD(e);return mt.close(t),0}catch(e){if(void 0===mt||!(e instanceof mt.ErrnoError))throw e;return e.errno}}function Hn(e,t,r,n){try{var o=gt.getStreamFromFD(e);return V(n>>2,gt.doReadv(o,t,r)),0}catch(e){if(void 0===mt||!(e instanceof mt.ErrnoError))throw e;return e.errno}}function Qn(e,t,r,n){try{var o=gt.getStreamFromFD(e);return V(n>>2,gt.doWritev(o,t,r)),0}catch(e){if(void 0===mt||!(e instanceof mt.ErrnoError))throw e;return e.errno}}function Xn(e){So(e)}function Gn(e){b(e)}var zn=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=mt.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},Wn=365,Yn=146;function Jn(e,t,r){var n=r>0?r:G(e)+1,o=new Array(n),i=Q(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(zn.prototype,{read:{get:function(){return(this.mode&Wn)===Wn},set:function(e){e?this.mode|=Wn:this.mode&=~Wn}},write:{get:function(){return(this.mode&Yn)===Yn},set:function(e){e?this.mode|=Yn:this.mode&=~Yn}},isFolder:{get:function(){return mt.isDir(this.mode)}},isDevice:{get:function(){return mt.isChrdev(this.mode)}}}),mt.FSNode=zn,mt.staticInit(),ft={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},wt(),It=o.BindingError=kt(Error,"BindingError"),Nt=o.InternalError=kt(Error,"InternalError"),lr(),tr(),Pr(),kr=o.UnboundTypeError=kt(Error,"UnboundTypeError"),zr();var Kn,$n={__assert_fail:nt,__syscall_dup:yt,__syscall_open:Et,__syscall_stat64:vt,_embind_register_bigint:_t,_embind_register_bool:Ut,_embind_register_class:Nr,_embind_register_class_constructor:jr,_embind_register_class_function:Br,_embind_register_emval:Yr,_embind_register_float:$r,_embind_register_function:Zr,_embind_register_integer:tn,_embind_register_memory_view:rn,_embind_register_std_string:nn,_embind_register_std_wstring:on,_embind_register_void:an,_emval_decref:Qr,_emval_incref:sn,_emval_take_value:dn,abort:pn,emscripten_asm_const_double:mn,emscripten_asm_const_int:fn,emscripten_builtin_mmap2:En,emscripten_builtin_munmap:_n,emscripten_console_error:Tn,emscripten_get_heap_max:wn,emscripten_get_module_name:bn,emscripten_get_now:un,emscripten_pc_get_column:An,emscripten_pc_get_file:Dn,emscripten_pc_get_function:Rn,emscripten_pc_get_line:Cn,emscripten_resize_heap:kn,emscripten_return_address:In,emscripten_stack_snapshot:Nn,emscripten_stack_unwind_buffer:Fn,environ_get:Ln,environ_sizes_get:Bn,fd_close:qn,fd_read:Hn,fd_write:Qn,proc_exit:Xn,setTempRet0:Gn},Zn=(Je(),o.___wasm_call_ctors=Xe("__wasm_call_ctors"),o.___getTypeName=Xe("__getTypeName")),eo=(o.___embind_register_native_and_builtin_types=Xe("__embind_register_native_and_builtin_types"),o.___errno_location=Xe("__errno_location"),o.___stdio_exit=Xe("__stdio_exit")),to=(o.___funcs_on_exit=Xe("__funcs_on_exit"),o._malloc=Xe("malloc")),ro=o._free=Xe("free"),no=o._memalign=Xe("memalign"),oo=o._emscripten_builtin_malloc=Xe("emscripten_builtin_malloc"),io=o._emscripten_builtin_free=Xe("emscripten_builtin_free"),ao=o._emscripten_builtin_memalign=Xe("emscripten_builtin_memalign"),so=o._emscripten_stack_init=function(){return(so=o._emscripten_stack_init=o.asm.emscripten_stack_init).apply(null,arguments)},co=(o._emscripten_stack_get_free=function(){return(o._emscripten_stack_get_free=o.asm.emscripten_stack_get_free).apply(null,arguments)},o._emscripten_stack_get_base=function(){return(o._emscripten_stack_get_base=o.asm.emscripten_stack_get_base).apply(null,arguments)},o._emscripten_stack_get_end=function(){return(co=o._emscripten_stack_get_end=o.asm.emscripten_stack_get_end).apply(null,arguments)}),po=(o.stackSave=Xe("stackSave"),o.stackRestore=Xe("stackRestore"),o.stackAlloc=Xe("stackAlloc"),o.__ZN6__asan9FakeStack17AddrIsInFakeStackEm=Xe("_ZN6__asan9FakeStack17AddrIsInFakeStackEm"),o.__ZN6__asan9FakeStack8AllocateEmmm=Xe("_ZN6__asan9FakeStack8AllocateEmmm"),o._asan_c_load_1=Xe("asan_c_load_1")),uo=o._asan_c_load_1u=Xe("asan_c_load_1u"),lo=o._asan_c_load_2=Xe("asan_c_load_2"),ho=o._asan_c_load_2u=Xe("asan_c_load_2u"),fo=o._asan_c_load_4=Xe("asan_c_load_4"),mo=o._asan_c_load_4u=Xe("asan_c_load_4u"),go=o._asan_c_load_f=Xe("asan_c_load_f"),yo=o._asan_c_load_d=Xe("asan_c_load_d"),Eo=o._asan_c_store_1=Xe("asan_c_store_1"),vo=o._asan_c_store_1u=Xe("asan_c_store_1u"),_o=o._asan_c_store_2=Xe("asan_c_store_2"),To=(o._asan_c_store_2u=Xe("asan_c_store_2u"),o._asan_c_store_4=Xe("asan_c_store_4")),wo=o._asan_c_store_4u=Xe("asan_c_store_4u");function bo(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Oo(){so(),me()}function Po(e){function t(){Kn||(Kn=!0,o.calledRun=!0,U||(Pe(),r(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),L(!o._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),Se()))}e=e||a,Ce>0||(Oo(),Oe(),Ce>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t(),ge()))}function So(e){be()||(o.onExit&&o.onExit(e),U=!0),c(e,new bo(e))}if(o._asan_c_store_f=Xe("asan_c_store_f"),o._asan_c_store_d=Xe("asan_c_store_d"),o.dynCall_jii=Xe("dynCall_jii"),Object.getOwnPropertyDescriptor(o,"intArrayFromString")||(o.intArrayFromString=()=>Ve("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"intArrayToString")||(o.intArrayToString=()=>Ve("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ccall")||(o.ccall=()=>Ve("'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"cwrap")||(o.cwrap=()=>Ve("'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setValue")||(o.setValue=()=>Ve("'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getValue")||(o.getValue=()=>Ve("'getValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"allocate")||(o.allocate=()=>Ve("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UTF8ArrayToString")||(o.UTF8ArrayToString=()=>Ve("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UTF8ToString")||(o.UTF8ToString=()=>Ve("'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToUTF8Array")||(o.stringToUTF8Array=()=>Ve("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToUTF8")||(o.stringToUTF8=()=>Ve("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF8")||(o.lengthBytesUTF8=()=>Ve("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackTrace")||(o.stackTrace=()=>Ve("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnPreRun")||(o.addOnPreRun=()=>Ve("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnInit")||(o.addOnInit=()=>Ve("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnPreMain")||(o.addOnPreMain=()=>Ve("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnExit")||(o.addOnExit=()=>Ve("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnPostRun")||(o.addOnPostRun=()=>Ve("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeStringToMemory")||(o.writeStringToMemory=()=>Ve("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeArrayToMemory")||(o.writeArrayToMemory=()=>Ve("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeAsciiToMemory")||(o.writeAsciiToMemory=()=>Ve("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addRunDependency")||(o.addRunDependency=()=>Ve("'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"removeRunDependency")||(o.removeRunDependency=()=>Ve("'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"FS_createFolder")||(o.FS_createFolder=()=>Ve("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"FS_createPath")||(o.FS_createPath=()=>Ve("'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"FS_createDataFile")||(o.FS_createDataFile=()=>Ve("'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"FS_createPreloadedFile")||(o.FS_createPreloadedFile=()=>Ve("'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"FS_createLazyFile")||(o.FS_createLazyFile=()=>Ve("'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"FS_createLink")||(o.FS_createLink=()=>Ve("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"FS_createDevice")||(o.FS_createDevice=()=>Ve("'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"FS_unlink")||(o.FS_unlink=()=>Ve("'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"getLEB")||(o.getLEB=()=>Ve("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getFunctionTables")||(o.getFunctionTables=()=>Ve("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"alignFunctionTables")||(o.alignFunctionTables=()=>Ve("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerFunctions")||(o.registerFunctions=()=>Ve("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addFunction")||(o.addFunction=()=>Ve("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"removeFunction")||(o.removeFunction=()=>Ve("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getFuncWrapper")||(o.getFuncWrapper=()=>Ve("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"prettyPrint")||(o.prettyPrint=()=>Ve("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"dynCall")||(o.dynCall=()=>Ve("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getCompilerSetting")||(o.getCompilerSetting=()=>Ve("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"print")||(o.print=()=>Ve("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"printErr")||(o.printErr=()=>Ve("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getTempRet0")||(o.getTempRet0=()=>Ve("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setTempRet0")||(o.setTempRet0=()=>Ve("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"callMain")||(o.callMain=()=>Ve("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"abort")||(o.abort=()=>Ve("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"keepRuntimeAlive")||(o.keepRuntimeAlive=()=>Ve("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"WasmOffsetConverter")||(o.WasmOffsetConverter=()=>Ve("'WasmOffsetConverter' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"zeroMemory")||(o.zeroMemory=()=>Ve("'zeroMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToNewUTF8")||(o.stringToNewUTF8=()=>Ve("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setFileTime")||(o.setFileTime=()=>Ve("'setFileTime' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"abortOnCannotGrowMemory")||(o.abortOnCannotGrowMemory=()=>Ve("'abortOnCannotGrowMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscripten_realloc_buffer")||(o.emscripten_realloc_buffer=()=>Ve("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ENV")||(o.ENV=()=>Ve("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"withStackSave")||(o.withStackSave=()=>Ve("'withStackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ERRNO_CODES")||(o.ERRNO_CODES=()=>Ve("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ERRNO_MESSAGES")||(o.ERRNO_MESSAGES=()=>Ve("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setErrNo")||(o.setErrNo=()=>Ve("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"inetPton4")||(o.inetPton4=()=>Ve("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"inetNtop4")||(o.inetNtop4=()=>Ve("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"inetPton6")||(o.inetPton6=()=>Ve("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"inetNtop6")||(o.inetNtop6=()=>Ve("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readSockaddr")||(o.readSockaddr=()=>Ve("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeSockaddr")||(o.writeSockaddr=()=>Ve("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"DNS")||(o.DNS=()=>Ve("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getHostByName")||(o.getHostByName=()=>Ve("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"Protocols")||(o.Protocols=()=>Ve("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"Sockets")||(o.Sockets=()=>Ve("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getRandomDevice")||(o.getRandomDevice=()=>Ve("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"traverseStack")||(o.traverseStack=()=>Ve("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"convertFrameToPC")||(o.convertFrameToPC=()=>Ve("'convertFrameToPC' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UNWIND_CACHE")||(o.UNWIND_CACHE=()=>Ve("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"saveInUnwindCache")||(o.saveInUnwindCache=()=>Ve("'saveInUnwindCache' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"convertPCtoSourceLocation")||(o.convertPCtoSourceLocation=()=>Ve("'convertPCtoSourceLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"withBuiltinMalloc")||(o.withBuiltinMalloc=()=>Ve("'withBuiltinMalloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readAsmConstArgsArray")||(o.readAsmConstArgsArray=()=>Ve("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readAsmConstArgs")||(o.readAsmConstArgs=()=>Ve("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"mainThreadEM_ASM")||(o.mainThreadEM_ASM=()=>Ve("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"jstoi_q")||(o.jstoi_q=()=>Ve("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"jstoi_s")||(o.jstoi_s=()=>Ve("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getExecutableName")||(o.getExecutableName=()=>Ve("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"listenOnce")||(o.listenOnce=()=>Ve("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"autoResumeAudioContext")||(o.autoResumeAudioContext=()=>Ve("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"dynCallLegacy")||(o.dynCallLegacy=()=>Ve("'dynCallLegacy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getDynCaller")||(o.getDynCaller=()=>Ve("'getDynCaller' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"dynCall")||(o.dynCall=()=>Ve("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"callRuntimeCallbacks")||(o.callRuntimeCallbacks=()=>Ve("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"wasmTableMirror")||(o.wasmTableMirror=()=>Ve("'wasmTableMirror' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setWasmTableEntry")||(o.setWasmTableEntry=()=>Ve("'setWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getWasmTableEntry")||(o.getWasmTableEntry=()=>Ve("'getWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"handleException")||(o.handleException=()=>Ve("'handleException' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runtimeKeepalivePush")||(o.runtimeKeepalivePush=()=>Ve("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runtimeKeepalivePop")||(o.runtimeKeepalivePop=()=>Ve("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"callUserCallback")||(o.callUserCallback=()=>Ve("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"maybeExit")||(o.maybeExit=()=>Ve("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"safeSetTimeout")||(o.safeSetTimeout=()=>Ve("'safeSetTimeout' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"asmjsMangle")||(o.asmjsMangle=()=>Ve("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"asyncLoad")||(o.asyncLoad=()=>Ve("'asyncLoad' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"alignMemory")||(o.alignMemory=()=>Ve("'alignMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"mmapAlloc")||(o.mmapAlloc=()=>Ve("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"reallyNegative")||(o.reallyNegative=()=>Ve("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"unSign")||(o.unSign=()=>Ve("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"reSign")||(o.reSign=()=>Ve("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"formatString")||(o.formatString=()=>Ve("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"PATH")||(o.PATH=()=>Ve("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"PATH_FS")||(o.PATH_FS=()=>Ve("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SYSCALLS")||(o.SYSCALLS=()=>Ve("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"syscallMmap2")||(o.syscallMmap2=()=>Ve("'syscallMmap2' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"syscallMunmap")||(o.syscallMunmap=()=>Ve("'syscallMunmap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getSocketFromFD")||(o.getSocketFromFD=()=>Ve("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getSocketAddress")||(o.getSocketAddress=()=>Ve("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"JSEvents")||(o.JSEvents=()=>Ve("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerKeyEventCallback")||(o.registerKeyEventCallback=()=>Ve("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"specialHTMLTargets")||(o.specialHTMLTargets=()=>Ve("'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"maybeCStringToJsString")||(o.maybeCStringToJsString=()=>Ve("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"findEventTarget")||(o.findEventTarget=()=>Ve("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"findCanvasEventTarget")||(o.findCanvasEventTarget=()=>Ve("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getBoundingClientRect")||(o.getBoundingClientRect=()=>Ve("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillMouseEventData")||(o.fillMouseEventData=()=>Ve("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerMouseEventCallback")||(o.registerMouseEventCallback=()=>Ve("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerWheelEventCallback")||(o.registerWheelEventCallback=()=>Ve("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerUiEventCallback")||(o.registerUiEventCallback=()=>Ve("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerFocusEventCallback")||(o.registerFocusEventCallback=()=>Ve("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillDeviceOrientationEventData")||(o.fillDeviceOrientationEventData=()=>Ve("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerDeviceOrientationEventCallback")||(o.registerDeviceOrientationEventCallback=()=>Ve("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillDeviceMotionEventData")||(o.fillDeviceMotionEventData=()=>Ve("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerDeviceMotionEventCallback")||(o.registerDeviceMotionEventCallback=()=>Ve("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"screenOrientation")||(o.screenOrientation=()=>Ve("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillOrientationChangeEventData")||(o.fillOrientationChangeEventData=()=>Ve("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerOrientationChangeEventCallback")||(o.registerOrientationChangeEventCallback=()=>Ve("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillFullscreenChangeEventData")||(o.fillFullscreenChangeEventData=()=>Ve("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerFullscreenChangeEventCallback")||(o.registerFullscreenChangeEventCallback=()=>Ve("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerRestoreOldStyle")||(o.registerRestoreOldStyle=()=>Ve("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"hideEverythingExceptGivenElement")||(o.hideEverythingExceptGivenElement=()=>Ve("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"restoreHiddenElements")||(o.restoreHiddenElements=()=>Ve("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setLetterbox")||(o.setLetterbox=()=>Ve("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"currentFullscreenStrategy")||(o.currentFullscreenStrategy=()=>Ve("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"restoreOldWindowedStyle")||(o.restoreOldWindowedStyle=()=>Ve("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"softFullscreenResizeWebGLRenderTarget")||(o.softFullscreenResizeWebGLRenderTarget=()=>Ve("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"doRequestFullscreen")||(o.doRequestFullscreen=()=>Ve("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillPointerlockChangeEventData")||(o.fillPointerlockChangeEventData=()=>Ve("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerPointerlockChangeEventCallback")||(o.registerPointerlockChangeEventCallback=()=>Ve("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerPointerlockErrorEventCallback")||(o.registerPointerlockErrorEventCallback=()=>Ve("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"requestPointerLock")||(o.requestPointerLock=()=>Ve("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillVisibilityChangeEventData")||(o.fillVisibilityChangeEventData=()=>Ve("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerVisibilityChangeEventCallback")||(o.registerVisibilityChangeEventCallback=()=>Ve("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerTouchEventCallback")||(o.registerTouchEventCallback=()=>Ve("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillGamepadEventData")||(o.fillGamepadEventData=()=>Ve("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerGamepadEventCallback")||(o.registerGamepadEventCallback=()=>Ve("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerBeforeUnloadEventCallback")||(o.registerBeforeUnloadEventCallback=()=>Ve("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillBatteryEventData")||(o.fillBatteryEventData=()=>Ve("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"battery")||(o.battery=()=>Ve("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerBatteryEventCallback")||(o.registerBatteryEventCallback=()=>Ve("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setCanvasElementSize")||(o.setCanvasElementSize=()=>Ve("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getCanvasElementSize")||(o.getCanvasElementSize=()=>Ve("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"demangle")||(o.demangle=()=>Ve("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"demangleAll")||(o.demangleAll=()=>Ve("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"jsStackTrace")||(o.jsStackTrace=()=>Ve("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackTrace")||(o.stackTrace=()=>Ve("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getEnvStrings")||(o.getEnvStrings=()=>Ve("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"checkWasiClock")||(o.checkWasiClock=()=>Ve("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToI64")||(o.writeI53ToI64=()=>Ve("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToI64Clamped")||(o.writeI53ToI64Clamped=()=>Ve("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToI64Signaling")||(o.writeI53ToI64Signaling=()=>Ve("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToU64Clamped")||(o.writeI53ToU64Clamped=()=>Ve("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToU64Signaling")||(o.writeI53ToU64Signaling=()=>Ve("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readI53FromI64")||(o.readI53FromI64=()=>Ve("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readI53FromU64")||(o.readI53FromU64=()=>Ve("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"convertI32PairToI53")||(o.convertI32PairToI53=()=>Ve("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"convertU32PairToI53")||(o.convertU32PairToI53=()=>Ve("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setImmediateWrapped")||(o.setImmediateWrapped=()=>Ve("'setImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"clearImmediateWrapped")||(o.clearImmediateWrapped=()=>Ve("'clearImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"polyfillSetImmediate")||(o.polyfillSetImmediate=()=>Ve("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"uncaughtExceptionCount")||(o.uncaughtExceptionCount=()=>Ve("'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exceptionLast")||(o.exceptionLast=()=>Ve("'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exceptionCaught")||(o.exceptionCaught=()=>Ve("'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ExceptionInfo")||(o.ExceptionInfo=()=>Ve("'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"CatchInfo")||(o.CatchInfo=()=>Ve("'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exception_addRef")||(o.exception_addRef=()=>Ve("'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exception_decRef")||(o.exception_decRef=()=>Ve("'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"Browser")||(o.Browser=()=>Ve("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"funcWrappers")||(o.funcWrappers=()=>Ve("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getFuncWrapper")||(o.getFuncWrapper=()=>Ve("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setMainLoop")||(o.setMainLoop=()=>Ve("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"wget")||(o.wget=()=>Ve("'wget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"FS")||(o.FS=()=>Ve("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"MEMFS")||(o.MEMFS=()=>Ve("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"TTY")||(o.TTY=()=>Ve("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"PIPEFS")||(o.PIPEFS=()=>Ve("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SOCKFS")||(o.SOCKFS=()=>Ve("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"_setNetworkCallback")||(o._setNetworkCallback=()=>Ve("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"tempFixedLengthArray")||(o.tempFixedLengthArray=()=>Ve("'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"miniTempWebGLFloatBuffers")||(o.miniTempWebGLFloatBuffers=()=>Ve("'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"heapObjectForWebGLType")||(o.heapObjectForWebGLType=()=>Ve("'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"heapAccessShiftForWebGLHeap")||(o.heapAccessShiftForWebGLHeap=()=>Ve("'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GL")||(o.GL=()=>Ve("'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGet")||(o.emscriptenWebGLGet=()=>Ve("'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"computeUnpackAlignedImageSize")||(o.computeUnpackAlignedImageSize=()=>Ve("'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGetTexPixelData")||(o.emscriptenWebGLGetTexPixelData=()=>Ve("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGetUniform")||(o.emscriptenWebGLGetUniform=()=>Ve("'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"webglGetUniformLocation")||(o.webglGetUniformLocation=()=>Ve("'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"webglPrepareUniformLocationsBeforeFirstUse")||(o.webglPrepareUniformLocationsBeforeFirstUse=()=>Ve("'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"webglGetLeftBracePos")||(o.webglGetLeftBracePos=()=>Ve("'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGetVertexAttrib")||(o.emscriptenWebGLGetVertexAttrib=()=>Ve("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeGLArray")||(o.writeGLArray=()=>Ve("'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"AL")||(o.AL=()=>Ve("'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL_unicode")||(o.SDL_unicode=()=>Ve("'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL_ttfContext")||(o.SDL_ttfContext=()=>Ve("'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL_audio")||(o.SDL_audio=()=>Ve("'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL")||(o.SDL=()=>Ve("'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL_gfx")||(o.SDL_gfx=()=>Ve("'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GLUT")||(o.GLUT=()=>Ve("'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"EGL")||(o.EGL=()=>Ve("'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GLFW_Window")||(o.GLFW_Window=()=>Ve("'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GLFW")||(o.GLFW=()=>Ve("'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GLEW")||(o.GLEW=()=>Ve("'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"IDBStore")||(o.IDBStore=()=>Ve("'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runAndAbortIfError")||(o.runAndAbortIfError=()=>Ve("'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"InternalError")||(o.InternalError=()=>Ve("'InternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"BindingError")||(o.BindingError=()=>Ve("'BindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UnboundTypeError")||(o.UnboundTypeError=()=>Ve("'UnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"PureVirtualError")||(o.PureVirtualError=()=>Ve("'PureVirtualError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"init_embind")||(o.init_embind=()=>Ve("'init_embind' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"throwInternalError")||(o.throwInternalError=()=>Ve("'throwInternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"throwBindingError")||(o.throwBindingError=()=>Ve("'throwBindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"throwUnboundTypeError")||(o.throwUnboundTypeError=()=>Ve("'throwUnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ensureOverloadTable")||(o.ensureOverloadTable=()=>Ve("'ensureOverloadTable' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exposePublicSymbol")||(o.exposePublicSymbol=()=>Ve("'exposePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"replacePublicSymbol")||(o.replacePublicSymbol=()=>Ve("'replacePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"extendError")||(o.extendError=()=>Ve("'extendError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"createNamedFunction")||(o.createNamedFunction=()=>Ve("'createNamedFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registeredInstances")||(o.registeredInstances=()=>Ve("'registeredInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getBasestPointer")||(o.getBasestPointer=()=>Ve("'getBasestPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerInheritedInstance")||(o.registerInheritedInstance=()=>Ve("'registerInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"unregisterInheritedInstance")||(o.unregisterInheritedInstance=()=>Ve("'unregisterInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getInheritedInstance")||(o.getInheritedInstance=()=>Ve("'getInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getInheritedInstanceCount")||(o.getInheritedInstanceCount=()=>Ve("'getInheritedInstanceCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getLiveInheritedInstances")||(o.getLiveInheritedInstances=()=>Ve("'getLiveInheritedInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registeredTypes")||(o.registeredTypes=()=>Ve("'registeredTypes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"awaitingDependencies")||(o.awaitingDependencies=()=>Ve("'awaitingDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"typeDependencies")||(o.typeDependencies=()=>Ve("'typeDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registeredPointers")||(o.registeredPointers=()=>Ve("'registeredPointers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerType")||(o.registerType=()=>Ve("'registerType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"whenDependentTypesAreResolved")||(o.whenDependentTypesAreResolved=()=>Ve("'whenDependentTypesAreResolved' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"embind_charCodes")||(o.embind_charCodes=()=>Ve("'embind_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"embind_init_charCodes")||(o.embind_init_charCodes=()=>Ve("'embind_init_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readLatin1String")||(o.readLatin1String=()=>Ve("'readLatin1String' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getTypeName")||(o.getTypeName=()=>Ve("'getTypeName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"heap32VectorToArray")||(o.heap32VectorToArray=()=>Ve("'heap32VectorToArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"requireRegisteredType")||(o.requireRegisteredType=()=>Ve("'requireRegisteredType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getShiftFromSize")||(o.getShiftFromSize=()=>Ve("'getShiftFromSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"integerReadValueFromPointer")||(o.integerReadValueFromPointer=()=>Ve("'integerReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"enumReadValueFromPointer")||(o.enumReadValueFromPointer=()=>Ve("'enumReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"floatReadValueFromPointer")||(o.floatReadValueFromPointer=()=>Ve("'floatReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"simpleReadValueFromPointer")||(o.simpleReadValueFromPointer=()=>Ve("'simpleReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runDestructors")||(o.runDestructors=()=>Ve("'runDestructors' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"new_")||(o.new_=()=>Ve("'new_' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"craftInvokerFunction")||(o.craftInvokerFunction=()=>Ve("'craftInvokerFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"embind__requireFunction")||(o.embind__requireFunction=()=>Ve("'embind__requireFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"tupleRegistrations")||(o.tupleRegistrations=()=>Ve("'tupleRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"structRegistrations")||(o.structRegistrations=()=>Ve("'structRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"genericPointerToWireType")||(o.genericPointerToWireType=()=>Ve("'genericPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"constNoSmartPtrRawPointerToWireType")||(o.constNoSmartPtrRawPointerToWireType=()=>Ve("'constNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"nonConstNoSmartPtrRawPointerToWireType")||(o.nonConstNoSmartPtrRawPointerToWireType=()=>Ve("'nonConstNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"init_RegisteredPointer")||(o.init_RegisteredPointer=()=>Ve("'init_RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer")||(o.RegisteredPointer=()=>Ve("'RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer_getPointee")||(o.RegisteredPointer_getPointee=()=>Ve("'RegisteredPointer_getPointee' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer_destructor")||(o.RegisteredPointer_destructor=()=>Ve("'RegisteredPointer_destructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer_deleteObject")||(o.RegisteredPointer_deleteObject=()=>Ve("'RegisteredPointer_deleteObject' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer_fromWireType")||(o.RegisteredPointer_fromWireType=()=>Ve("'RegisteredPointer_fromWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runDestructor")||(o.runDestructor=()=>Ve("'runDestructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"releaseClassHandle")||(o.releaseClassHandle=()=>Ve("'releaseClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"finalizationRegistry")||(o.finalizationRegistry=()=>Ve("'finalizationRegistry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"detachFinalizer_deps")||(o.detachFinalizer_deps=()=>Ve("'detachFinalizer_deps' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"detachFinalizer")||(o.detachFinalizer=()=>Ve("'detachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"attachFinalizer")||(o.attachFinalizer=()=>Ve("'attachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"makeClassHandle")||(o.makeClassHandle=()=>Ve("'makeClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"init_ClassHandle")||(o.init_ClassHandle=()=>Ve("'init_ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle")||(o.ClassHandle=()=>Ve("'ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_isAliasOf")||(o.ClassHandle_isAliasOf=()=>Ve("'ClassHandle_isAliasOf' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"throwInstanceAlreadyDeleted")||(o.throwInstanceAlreadyDeleted=()=>Ve("'throwInstanceAlreadyDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_clone")||(o.ClassHandle_clone=()=>Ve("'ClassHandle_clone' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_delete")||(o.ClassHandle_delete=()=>Ve("'ClassHandle_delete' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"deletionQueue")||(o.deletionQueue=()=>Ve("'deletionQueue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_isDeleted")||(o.ClassHandle_isDeleted=()=>Ve("'ClassHandle_isDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_deleteLater")||(o.ClassHandle_deleteLater=()=>Ve("'ClassHandle_deleteLater' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"flushPendingDeletes")||(o.flushPendingDeletes=()=>Ve("'flushPendingDeletes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"delayFunction")||(o.delayFunction=()=>Ve("'delayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setDelayFunction")||(o.setDelayFunction=()=>Ve("'setDelayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredClass")||(o.RegisteredClass=()=>Ve("'RegisteredClass' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"shallowCopyInternalPointer")||(o.shallowCopyInternalPointer=()=>Ve("'shallowCopyInternalPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"downcastPointer")||(o.downcastPointer=()=>Ve("'downcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"upcastPointer")||(o.upcastPointer=()=>Ve("'upcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"validateThis")||(o.validateThis=()=>Ve("'validateThis' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"char_0")||(o.char_0=()=>Ve("'char_0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"char_9")||(o.char_9=()=>Ve("'char_9' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"makeLegalFunctionName")||(o.makeLegalFunctionName=()=>Ve("'makeLegalFunctionName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_handle_array")||(o.emval_handle_array=()=>Ve("'emval_handle_array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_free_list")||(o.emval_free_list=()=>Ve("'emval_free_list' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_symbols")||(o.emval_symbols=()=>Ve("'emval_symbols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"init_emval")||(o.init_emval=()=>Ve("'init_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"count_emval_handles")||(o.count_emval_handles=()=>Ve("'count_emval_handles' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"get_first_emval")||(o.get_first_emval=()=>Ve("'get_first_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getStringOrSymbol")||(o.getStringOrSymbol=()=>Ve("'getStringOrSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"Emval")||(o.Emval=()=>Ve("'Emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_newers")||(o.emval_newers=()=>Ve("'emval_newers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"craftEmvalAllocator")||(o.craftEmvalAllocator=()=>Ve("'craftEmvalAllocator' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_get_global")||(o.emval_get_global=()=>Ve("'emval_get_global' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_methodCallers")||(o.emval_methodCallers=()=>Ve("'emval_methodCallers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_registeredMethods")||(o.emval_registeredMethods=()=>Ve("'emval_registeredMethods' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"warnOnce")||(o.warnOnce=()=>Ve("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackSave")||(o.stackSave=()=>Ve("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackRestore")||(o.stackRestore=()=>Ve("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackAlloc")||(o.stackAlloc=()=>Ve("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"AsciiToString")||(o.AsciiToString=()=>Ve("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToAscii")||(o.stringToAscii=()=>Ve("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UTF16ToString")||(o.UTF16ToString=()=>Ve("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToUTF16")||(o.stringToUTF16=()=>Ve("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF16")||(o.lengthBytesUTF16=()=>Ve("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UTF32ToString")||(o.UTF32ToString=()=>Ve("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToUTF32")||(o.stringToUTF32=()=>Ve("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF32")||(o.lengthBytesUTF32=()=>Ve("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"allocateUTF8")||(o.allocateUTF8=()=>Ve("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"allocateUTF8OnStack")||(o.allocateUTF8OnStack=()=>Ve("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),o.writeStackCookie=me,o.checkStackCookie=ge,Object.getOwnPropertyDescriptor(o,"ALLOC_NORMAL")||Object.defineProperty(o,"ALLOC_NORMAL",{configurable:!0,get:function(){Ve("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Object.getOwnPropertyDescriptor(o,"ALLOC_STACK")||Object.defineProperty(o,"ALLOC_STACK",{configurable:!0,get:function(){Ve("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),ke=function e(){Kn||Po(),Kn||(ke=e)},o.run=Po,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return Po(),e.ready});e.exports=r},63:function(e,t){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}t.Q=r,r.prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<n.length;o++)if((r=n[o])===t||r.fn===t){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){n=0;for(var o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,t)}return this},r.prototype.emitReserved=r.prototype.emit,r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},10:function(e){function t(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=t,t.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-r:e+r}return 0|Math.min(e,this.max)},t.prototype.reset=function(){this.attempts=0},t.prototype.setMin=function(e){this.ms=e},t.prototype.setMax=function(e){this.max=e},t.prototype.setJitter=function(e){this.jitter=e}},987:function(e){"use strict";var t={single_source_shortest_paths:function(e,r,n){var o={},i={};i[r]=0;var a,s,c,d,p,u,l,h=t.PriorityQueue.make();for(h.push(r,0);!h.empty();)for(c in s=(a=h.pop()).value,d=a.cost,p=e[s]||{})p.hasOwnProperty(c)&&(u=d+p[c],l=i[c],(void 0===i[c]||l>u)&&(i[c]=u,h.push(c,u),o[c]=s));if(void 0!==n&&void 0===i[n]){var f=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(f)}return o},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,r,n){var o=t.single_source_shortest_paths(e,r,n);return t.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(e){var r,n=t.PriorityQueue,o={};for(r in e=e||{},n)n.hasOwnProperty(r)&&(o[r]=n[r]);return o.queue=[],o.sorter=e.sorter||n.default_sorter,o},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},378:function(e){"use strict";e.exports=function(e){for(var t=[],r=e.length,n=0;n<r;n++){var o=e.charCodeAt(n);if(o>=55296&&o<=56319&&r>n+1){var i=e.charCodeAt(n+1);i>=56320&&i<=57343&&(o=1024*(o-55296)+i-56320+65536,n+=1)}o<128?t.push(o):o<2048?(t.push(o>>6|192),t.push(63&o|128)):o<55296||o>=57344&&o<65536?(t.push(o>>12|224),t.push(o>>6&63|128),t.push(63&o|128)):o>=65536&&o<=1114111?(t.push(o>>18|240),t.push(o>>12&63|128),t.push(o>>6&63|128),t.push(63&o|128)):t.push(239,191,189)}return new Uint8Array(t).buffer}},58:function(e){try{e.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){e.exports=!1}},830:function(e,t){t.encode=function(e){var t="";for(var r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t},t.decode=function(e){for(var t={},r=e.split("&"),n=0,o=r.length;n<o;n++){var i=r[n].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}},187:function(e){var t=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(e){var n,o,i=e,a=e.indexOf("["),s=e.indexOf("]");-1!=a&&-1!=s&&(e=e.substring(0,a)+e.substring(a,s).replace(/:/g,";")+e.substring(s,e.length));for(var c,d,p=t.exec(e||""),u={},l=14;l--;)u[r[l]]=p[l]||"";return-1!=a&&-1!=s&&(u.source=i,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=(n=u.path,o=n.replace(/\/{2,9}/g,"/").split("/"),"/"!=n.substr(0,1)&&0!==n.length||o.splice(0,1),"/"==n.substr(n.length-1,1)&&o.splice(o.length-1,1),o),u.queryKey=(c=u.query,d={},c.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(d[t]=r)})),d),u}},391:function(e,t,r){parcelRequire=function(t,n,o,i){var a,s="function"==typeof parcelRequire&&parcelRequire;function c(e,o){if(!n[e]){if(!t[e]){var i="function"==typeof parcelRequire&&parcelRequire;if(!o&&i)return i(e,!0);if(s)return s(e,!0);if("string"==typeof e)return r(784)(e);var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}p.resolve=function(r){return t[e][1][r]||r},p.cache={};var d=n[e]=new c.Module(e);t[e][0].call(d.exports,p,d,d.exports,this)}return n[e].exports;function p(e){return c(p.resolve(e))}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=t,c.cache=n,c.parent=s,c.register=function(e,r){t[e]=[function(e,t){t.exports=r},{}]};for(var d=0;d<o.length;d++)try{c(o[d])}catch(t){a||(a=t)}if(o.length){var p=c(o[o.length-1]);e.exports=p}if(parcelRequire=c,a)throw a;return c}({EgBh:[function(e,t,r){var n={};n.useBlobBuilder=function(){try{return new Blob([]),!1}catch(e){return!0}}(),n.useArrayBufferView=!n.useBlobBuilder&&function(){try{return 0===new Blob([new Uint8Array([])]).size}catch(e){return!0}}(),t.exports.binaryFeatures=n;var o=t.exports.BlobBuilder;function i(){this._pieces=[],this._parts=[]}"undefined"!=typeof window&&(o=t.exports.BlobBuilder=window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder||window.BlobBuilder),i.prototype.append=function(e){"number"==typeof e?this._pieces.push(e):(this.flush(),this._parts.push(e))},i.prototype.flush=function(){if(this._pieces.length>0){var e=new Uint8Array(this._pieces);n.useArrayBufferView||(e=e.buffer),this._parts.push(e),this._pieces=[]}},i.prototype.getBuffer=function(){if(this.flush(),n.useBlobBuilder){for(var e=new o,t=0,r=this._parts.length;t<r;t++)e.append(this._parts[t]);return e.getBlob()}return new Blob(this._parts)},t.exports.BufferBuilder=i},{}],kdPp:[function(e,t,r){var n=e("./bufferbuilder").BufferBuilder,o=e("./bufferbuilder").binaryFeatures,i={unpack:function(e){return new a(e).unpack()},pack:function(e){var t=new s;return t.pack(e),t.getBuffer()}};function a(e){this.index=0,this.dataBuffer=e,this.dataView=new Uint8Array(this.dataBuffer),this.length=this.dataBuffer.byteLength}function s(){this.bufferBuilder=new n}function c(e){var t=e.charCodeAt(0);return t<=2047?"00":t<=65535?"000":t<=2097151?"0000":t<=67108863?"00000":"000000"}t.exports=i,a.prototype.unpack=function(){var e,t=this.unpack_uint8();if(t<128)return t;if((224^t)<32)return(224^t)-32;if((e=160^t)<=15)return this.unpack_raw(e);if((e=176^t)<=15)return this.unpack_string(e);if((e=144^t)<=15)return this.unpack_array(e);if((e=128^t)<=15)return this.unpack_map(e);switch(t){case 192:return null;case 193:return;case 194:return!1;case 195:return!0;case 202:return this.unpack_float();case 203:return this.unpack_double();case 204:return this.unpack_uint8();case 205:return this.unpack_uint16();case 206:return this.unpack_uint32();case 207:return this.unpack_uint64();case 208:return this.unpack_int8();case 209:return this.unpack_int16();case 210:return this.unpack_int32();case 211:return this.unpack_int64();case 212:case 213:case 214:case 215:return;case 216:return e=this.unpack_uint16(),this.unpack_string(e);case 217:return e=this.unpack_uint32(),this.unpack_string(e);case 218:return e=this.unpack_uint16(),this.unpack_raw(e);case 219:return e=this.unpack_uint32(),this.unpack_raw(e);case 220:return e=this.unpack_uint16(),this.unpack_array(e);case 221:return e=this.unpack_uint32(),this.unpack_array(e);case 222:return e=this.unpack_uint16(),this.unpack_map(e);case 223:return e=this.unpack_uint32(),this.unpack_map(e)}},a.prototype.unpack_uint8=function(){var e=255&this.dataView[this.index];return this.index++,e},a.prototype.unpack_uint16=function(){var e=this.read(2),t=256*(255&e[0])+(255&e[1]);return this.index+=2,t},a.prototype.unpack_uint32=function(){var e=this.read(4),t=256*(256*(256*e[0]+e[1])+e[2])+e[3];return this.index+=4,t},a.prototype.unpack_uint64=function(){var e=this.read(8),t=256*(256*(256*(256*(256*(256*(256*e[0]+e[1])+e[2])+e[3])+e[4])+e[5])+e[6])+e[7];return this.index+=8,t},a.prototype.unpack_int8=function(){var e=this.unpack_uint8();return e<128?e:e-256},a.prototype.unpack_int16=function(){var e=this.unpack_uint16();return e<32768?e:e-65536},a.prototype.unpack_int32=function(){var e=this.unpack_uint32();return e<Math.pow(2,31)?e:e-Math.pow(2,32)},a.prototype.unpack_int64=function(){var e=this.unpack_uint64();return e<Math.pow(2,63)?e:e-Math.pow(2,64)},a.prototype.unpack_raw=function(e){if(this.length<this.index+e)throw new Error("BinaryPackFailure: index is out of range "+this.index+" "+e+" "+this.length);var t=this.dataBuffer.slice(this.index,this.index+e);return this.index+=e,t},a.prototype.unpack_string=function(e){for(var t,r,n=this.read(e),o=0,i="";o<e;)(t=n[o])<128?(i+=String.fromCharCode(t),o++):(192^t)<32?(r=(192^t)<<6|63&n[o+1],i+=String.fromCharCode(r),o+=2):(r=(15&t)<<12|(63&n[o+1])<<6|63&n[o+2],i+=String.fromCharCode(r),o+=3);return this.index+=e,i},a.prototype.unpack_array=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=this.unpack();return t},a.prototype.unpack_map=function(e){for(var t={},r=0;r<e;r++){var n=this.unpack(),o=this.unpack();t[n]=o}return t},a.prototype.unpack_float=function(){var e=this.unpack_uint32(),t=(e>>23&255)-127;return(0==e>>31?1:-1)*(8388607&e|8388608)*Math.pow(2,t-23)},a.prototype.unpack_double=function(){var e=this.unpack_uint32(),t=this.unpack_uint32(),r=(e>>20&2047)-1023;return(0==e>>31?1:-1)*((1048575&e|1048576)*Math.pow(2,r-20)+t*Math.pow(2,r-52))},a.prototype.read=function(e){var t=this.index;if(t+e<=this.length)return this.dataView.subarray(t,t+e);throw new Error("BinaryPackFailure: read index out of range")},s.prototype.getBuffer=function(){return this.bufferBuilder.getBuffer()},s.prototype.pack=function(e){var t=typeof e;if("string"===t)this.pack_string(e);else if("number"===t)Math.floor(e)===e?this.pack_integer(e):this.pack_double(e);else if("boolean"===t)!0===e?this.bufferBuilder.append(195):!1===e&&this.bufferBuilder.append(194);else if("undefined"===t)this.bufferBuilder.append(192);else{if("object"!==t)throw new Error('Type "'+t+'" not yet supported');if(null===e)this.bufferBuilder.append(192);else{var r=e.constructor;if(r==Array)this.pack_array(e);else if(r==Blob||r==File||e instanceof Blob||e instanceof File)this.pack_bin(e);else if(r==ArrayBuffer)o.useArrayBufferView?this.pack_bin(new Uint8Array(e)):this.pack_bin(e);else if("BYTES_PER_ELEMENT"in e)o.useArrayBufferView?this.pack_bin(new Uint8Array(e.buffer)):this.pack_bin(e.buffer);else if(r==Object||r.toString().startsWith("class"))this.pack_object(e);else if(r==Date)this.pack_string(e.toString());else{if("function"!=typeof e.toBinaryPack)throw new Error('Type "'+r.toString()+'" not yet supported');this.bufferBuilder.append(e.toBinaryPack())}}}this.bufferBuilder.flush()},s.prototype.pack_bin=function(e){var t=e.length||e.byteLength||e.size;if(t<=15)this.pack_uint8(160+t);else if(t<=65535)this.bufferBuilder.append(218),this.pack_uint16(t);else{if(!(t<=4294967295))throw new Error("Invalid length");this.bufferBuilder.append(219),this.pack_uint32(t)}this.bufferBuilder.append(e)},s.prototype.pack_string=function(e){var t=function(e){return e.length>600?new Blob([e]).size:e.replace(/[^\u0000-\u007F]/g,c).length}(e);if(t<=15)this.pack_uint8(176+t);else if(t<=65535)this.bufferBuilder.append(216),this.pack_uint16(t);else{if(!(t<=4294967295))throw new Error("Invalid length");this.bufferBuilder.append(217),this.pack_uint32(t)}this.bufferBuilder.append(e)},s.prototype.pack_array=function(e){var t=e.length;if(t<=15)this.pack_uint8(144+t);else if(t<=65535)this.bufferBuilder.append(220),this.pack_uint16(t);else{if(!(t<=4294967295))throw new Error("Invalid length");this.bufferBuilder.append(221),this.pack_uint32(t)}for(var r=0;r<t;r++)this.pack(e[r])},s.prototype.pack_integer=function(e){if(e>=-32&&e<=127)this.bufferBuilder.append(255&e);else if(e>=0&&e<=255)this.bufferBuilder.append(204),this.pack_uint8(e);else if(e>=-128&&e<=127)this.bufferBuilder.append(208),this.pack_int8(e);else if(e>=0&&e<=65535)this.bufferBuilder.append(205),this.pack_uint16(e);else if(e>=-32768&&e<=32767)this.bufferBuilder.append(209),this.pack_int16(e);else if(e>=0&&e<=4294967295)this.bufferBuilder.append(206),this.pack_uint32(e);else if(e>=-2147483648&&e<=2147483647)this.bufferBuilder.append(210),this.pack_int32(e);else if(e>=-0x8000000000000000&&e<=0x8000000000000000)this.bufferBuilder.append(211),this.pack_int64(e);else{if(!(e>=0&&e<=0x10000000000000000))throw new Error("Invalid integer");this.bufferBuilder.append(207),this.pack_uint64(e)}},s.prototype.pack_double=function(e){var t=0;e<0&&(t=1,e=-e);var r=Math.floor(Math.log(e)/Math.LN2),n=e/Math.pow(2,r)-1,o=Math.floor(n*Math.pow(2,52)),i=Math.pow(2,32),a=t<<31|r+1023<<20|o/i&1048575,s=o%i;this.bufferBuilder.append(203),this.pack_int32(a),this.pack_int32(s)},s.prototype.pack_object=function(e){var t=Object.keys(e).length;if(t<=15)this.pack_uint8(128+t);else if(t<=65535)this.bufferBuilder.append(222),this.pack_uint16(t);else{if(!(t<=4294967295))throw new Error("Invalid length");this.bufferBuilder.append(223),this.pack_uint32(t)}for(var r in e)e.hasOwnProperty(r)&&(this.pack(r),this.pack(e[r]))},s.prototype.pack_uint8=function(e){this.bufferBuilder.append(e)},s.prototype.pack_uint16=function(e){this.bufferBuilder.append(e>>8),this.bufferBuilder.append(255&e)},s.prototype.pack_uint32=function(e){var t=4294967295&e;this.bufferBuilder.append((4278190080&t)>>>24),this.bufferBuilder.append((16711680&t)>>>16),this.bufferBuilder.append((65280&t)>>>8),this.bufferBuilder.append(255&t)},s.prototype.pack_uint64=function(e){var t=e/Math.pow(2,32),r=e%Math.pow(2,32);this.bufferBuilder.append((4278190080&t)>>>24),this.bufferBuilder.append((16711680&t)>>>16),this.bufferBuilder.append((65280&t)>>>8),this.bufferBuilder.append(255&t),this.bufferBuilder.append((4278190080&r)>>>24),this.bufferBuilder.append((16711680&r)>>>16),this.bufferBuilder.append((65280&r)>>>8),this.bufferBuilder.append(255&r)},s.prototype.pack_int8=function(e){this.bufferBuilder.append(255&e)},s.prototype.pack_int16=function(e){this.bufferBuilder.append((65280&e)>>8),this.bufferBuilder.append(255&e)},s.prototype.pack_int32=function(e){this.bufferBuilder.append(e>>>24&255),this.bufferBuilder.append((16711680&e)>>>16),this.bufferBuilder.append((65280&e)>>>8),this.bufferBuilder.append(255&e)},s.prototype.pack_int64=function(e){var t=Math.floor(e/Math.pow(2,32)),r=e%Math.pow(2,32);this.bufferBuilder.append((4278190080&t)>>>24),this.bufferBuilder.append((16711680&t)>>>16),this.bufferBuilder.append((65280&t)>>>8),this.bufferBuilder.append(255&t),this.bufferBuilder.append((4278190080&r)>>>24),this.bufferBuilder.append((16711680&r)>>>16),this.bufferBuilder.append((65280&r)>>>8),this.bufferBuilder.append(255&r)}},{"./bufferbuilder":"EgBh"}],iSxC:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.extractVersion=a,r.wrapPeerConnectionEvent=function(e,t,r){if(e.RTCPeerConnection){var n=e.RTCPeerConnection.prototype,o=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return o.apply(this,arguments);var i=function(e){var t=r(e);t&&(n.handleEvent?n.handleEvent(t):n(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(n,i),o.apply(this,[e,i])};var i=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[t])return i.apply(this,arguments);if(!this._eventMap[t].has(r))return i.apply(this,arguments);var n=this._eventMap[t].get(r);return this._eventMap[t].delete(r),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,i.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}},r.disableLog=function(e){return"boolean"!=typeof e?new Error("Argument type: "+n(e)+". Please use a boolean."):(o=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},r.disableWarnings=function(e){return"boolean"!=typeof e?new Error("Argument type: "+n(e)+". Please use a boolean."):(i=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},r.log=function(){if("object"===("undefined"==typeof window?"undefined":n(window))){if(o)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},r.deprecated=function(e,t){i&&console.warn(e+" is deprecated, please use "+t+" instead.")},r.detectBrowser=function(e){var t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;var{navigator:r}=e;if(r.mozGetUserMedia)t.browser="firefox",t.version=a(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=a(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(r.mediaDevices&&r.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=a(r.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=a(r.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t},r.compactObject=function e(t){return s(t)?Object.keys(t).reduce((function(r,n){var o=s(t[n]),i=o?e(t[n]):t[n],a=o&&!Object.keys(i).length;return void 0===i||a?r:Object.assign(r,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},n,i))}),{}):t},r.walkStats=c,r.filterStats=function(e,t,r){var n=r?"outbound-rtp":"inbound-rtp",o=new Map;if(null===t)return o;var i=[];return e.forEach((function(e){"track"===e.type&&e.trackIdentifier===t.id&&i.push(e)})),i.forEach((function(t){e.forEach((function(r){r.type===n&&r.trackId===t.id&&c(e,r,o)}))})),o};var o=!0,i=!0;function a(e,t,r){var n=e.match(t);return n&&n.length>=r&&parseInt(n[r],10)}function s(e){return"[object Object]"===Object.prototype.toString.call(e)}function c(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((function(n){n.endsWith("Id")?c(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((function(t){c(e,e.get(t),r)}))})))}},{}],s6SN:[function(e,t,r){"use strict";function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetUserMedia=function(e,t){var r=e&&e.navigator;if(r.mediaDevices){var n=function(e){if("object"!==o(e)||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(r){if("require"!==r&&"advanced"!==r&&"mediaSource"!==r){var n="object"===o(e[r])?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);var i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];var a={};"number"==typeof n.ideal?(a[i("min",r)]=n.ideal,t.optional.push(a),(a={})[i("max",r)]=n.ideal,t.optional.push(a)):(a[i("",r)]=n.ideal,t.optional.push(a))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",r)]=n.exact):["min","max"].forEach((function(e){void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,r)]=n[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},a=function(e,a){if(t.version>=61)return a(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===o(e.audio)){var s=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};s((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),s(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=n(e.audio)}if(e&&"object"===o(e.video)){var c=e.video.facingMode;c=c&&("object"===o(c)?c:{ideal:c});var d,p=t.version<66;if(c&&("user"===c.exact||"environment"===c.exact||"user"===c.ideal||"environment"===c.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||p)&&(delete e.video.facingMode,"environment"===c.exact||"environment"===c.ideal?d=["back","rear"]:"user"!==c.exact&&"user"!==c.ideal||(d=["front"]),d))return r.mediaDevices.enumerateDevices().then((function(t){var r=(t=t.filter((function(e){return"videoinput"===e.kind}))).find((function(e){return d.some((function(t){return e.label.toLowerCase().includes(t)}))}));return!r&&t.length&&d.includes("back")&&(r=t[t.length-1]),r&&(e.video.deviceId=c.exact?{exact:r.deviceId}:{ideal:r.deviceId}),e.video=n(e.video),i("chrome: "+JSON.stringify(e)),a(e)}));e.video=n(e.video)}return i("chrome: "+JSON.stringify(e)),a(e)},s=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};if(r.getUserMedia=function(e,t,n){a(e,(function(e){r.webkitGetUserMedia(e,t,(function(e){n&&n(s(e))}))}))}.bind(r),r.mediaDevices.getUserMedia){var c=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(e){return a(e,(function(e){return c(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return t}),(function(e){return Promise.reject(s(e))}))}))}}}};var i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}(e("../utils.js")).log},{"../utils.js":"iSxC"}],VHa8:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetDisplayMedia=function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then((function(t){var n=r.video&&r.video.width,o=r.video&&r.video.height,i=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:i||3}},n&&(r.video.mandatory.maxWidth=n),o&&(r.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(r)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}},{}],uI5X:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimMediaStream=function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},r.shimOnTrack=function(e){if("object"!==c(e)||!e.RTCPeerConnection||"ontrack"in e.RTCPeerConnection.prototype)n.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}));else{Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var r=this;return this._ontrackpoly||(this._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(n){var o;o=e.RTCPeerConnection.prototype.getReceivers?r.getReceivers().find((function(e){return e.track&&e.track.id===n.track.id})):{track:n.track};var i=new Event("track");i.track=n.track,i.receiver=o,i.transceiver={receiver:o},i.streams=[t.stream],r.dispatchEvent(i)})),t.stream.getTracks().forEach((function(n){var o;o=e.RTCPeerConnection.prototype.getReceivers?r.getReceivers().find((function(e){return e.track&&e.track.id===n.id})):{track:n};var i=new Event("track");i.track=n,i.receiver=o,i.transceiver={receiver:o},i.streams=[t.stream],r.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}},r.shimGetSendersWithDtmf=function(e){if("object"===c(e)&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){var o=r.apply(this,arguments);return o||(o=t(this,e),this._senders.push(o)),o};var n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var r=this;this._senders=this._senders||[],o.apply(this,[e]),e.getTracks().forEach((function(e){r._senders.push(t(r,e))}))};var i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach((function(e){var r=t._senders.find((function(t){return t.track===e}));r&&t._senders.splice(t._senders.indexOf(r),1)}))}}else if("object"===c(e)&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var a=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=a.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},r.shimGetStats=function(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=this,[r,n,o]=arguments;if(arguments.length>0&&"function"==typeof r)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof r))return t.apply(this,[]);var i=function(e){var t={};return e.result().forEach((function(e){var r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){r[t]=e.stat(t)})),t[r.id]=r})),t},a=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};return arguments.length>=2?t.apply(this,[function(e){n(a(i(e)))},r]):new Promise((function(r,n){t.apply(e,[function(e){r(a(i(e)))},n])})).then(n,o)}}},r.shimSenderReceiverGetStats=function(e){if("object"===c(e)&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,r=t.apply(this,[]);return r.forEach((function(t){return t._pc=e})),r});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return n.filterStats(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var o=e.RTCPeerConnection.prototype.getReceivers;o&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=o.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t}),n.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return n.filterStats(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t,r,n,o=arguments[0];return this.getSenders().forEach((function(e){e.track===o&&(t?n=!0:t=e)})),this.getReceivers().forEach((function(e){return e.track===o&&(r?n=!0:r=e),e.track===o})),n||t&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return i.apply(this,arguments)}}}},r.shimAddTrackRemoveTrackWithNative=d,r.shimAddTrackRemoveTrack=function(e,t){if(e.RTCPeerConnection){if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return d(e);var r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=r.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var r=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((function(e){if(r.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){var o=new e.MediaStream(t.getTracks());this._streams[t.id]=o,this._reverseStreams[o.id]=t,t=o}n.apply(this,[t])};var o=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},o.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,r){var n=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var o=[].slice.call(arguments,1);if(1!==o.length||!o[0].getTracks().find((function(e){return e===t})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((function(e){return e.track===t})))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var i=this._streams[r.id];if(i)i.addTrack(t),Promise.resolve().then((function(){n.dispatchEvent(new Event("negotiationneeded"))}));else{var a=new e.MediaStream([t]);this._streams[r.id]=a,this._reverseStreams[a.id]=r,this.addStream(a)}return this.getSenders().find((function(e){return e.track===t}))},["createOffer","createAnswer"].forEach((function(t){var r=e.RTCPeerConnection.prototype[t],n=s({},t,(function(){var e=this,t=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[function(r){var n=c(e,r);t[0].apply(null,[n])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):r.apply(this,arguments).then((function(t){return c(e,t)}))}));e.RTCPeerConnection.prototype[t]=n[t]}));var i=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=(e=this,r=(t=arguments[0]).sdp,Object.keys(e._reverseStreams||[]).forEach((function(t){var n=e._reverseStreams[t],o=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),o.id)})),new RTCSessionDescription({type:t.type,sdp:r})),i.apply(this,arguments)):i.apply(this,arguments);var e,t,r};var a=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=a.get.apply(this);return""===e.type?e:c(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t,r=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{},Object.keys(this._streams).forEach((function(n){r._streams[n].getTracks().find((function(t){return e.track===t}))&&(t=r._streams[n])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function c(e,t){var r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var n=e._reverseStreams[t],o=e._streams[n.id];r=r.replace(new RegExp(o.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:r})}},r.shimPeerConnection=function(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var r=e.RTCPeerConnection.prototype[t],n=s({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=n[t]}))},r.fixNegotiationNeeded=function(e,t){n.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){var r=e.target;if(!(t.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return e}))},Object.defineProperty(r,"shimGetUserMedia",{enumerable:!0,get:function(){return o.shimGetUserMedia}}),Object.defineProperty(r,"shimGetDisplayMedia",{enumerable:!0,get:function(){return i.shimGetDisplayMedia}});var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}(e("../utils.js")),o=e("./getusermedia"),i=e("./getdisplaymedia");function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(t){return e._shimmedLocalStreams[t][0]}))};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){if(t.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")}));var n=this.getSenders();r.apply(this,arguments);var o=this.getSenders().filter((function(e){return-1===n.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(o)};var n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};var o=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((function(r){var n=t._shimmedLocalStreams[r].indexOf(e);-1!==n&&t._shimmedLocalStreams[r].splice(n,1),1===t._shimmedLocalStreams[r].length&&delete t._shimmedLocalStreams[r]})),o.apply(this,arguments)}}},{"../utils.js":"iSxC","./getusermedia":"s6SN","./getdisplaymedia":"VHa8"}],NZ1C:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.filterIceServers=function(e,t){var r=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var t=e.urls||e.url;e.url&&!e.urls&&n.deprecated("RTCIceServer.url","RTCIceServer.urls");var o="string"==typeof t;return o&&(t=[t]),t=t.filter((function(e){if(0===e.indexOf("stun:"))return!1;var t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!r?(r=!0,!0):t&&!r})),delete e.url,e.urls=o?t[0]:t,!!t.length}}))};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}(e("../utils"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}},{"../utils":"iSxC"}],YHvh:[function(e,t,r){"use strict";var n={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},n.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},n.getDescription=function(e){var t=n.splitSections(e);return t&&t[0]},n.getMediaSections=function(e){var t=n.splitSections(e);return t.shift(),t},n.matchPrefix=function(e,t){return n.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},n.parseCandidate=function(e){for(var t,r={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},n=8;n<t.length;n+=2)switch(t[n]){case"raddr":r.relatedAddress=t[n+1];break;case"rport":r.relatedPort=parseInt(t[n+1],10);break;case"tcptype":r.tcpType=t[n+1];break;case"ufrag":r.ufrag=t[n+1],r.usernameFragment=t[n+1];break;default:r[t[n]]=t[n+1]}return r},n.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var r=e.type;return t.push("typ"),t.push(r),"host"!==r&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},n.parseIceOptions=function(e){return e.substr(14).split(" ")},n.parseRtpMap=function(e){var t=e.substr(9).split(" "),r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},n.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},n.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},n.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},n.parseFmtp=function(e){for(var t,r={},n=e.substr(e.indexOf(" ")+1).split(";"),o=0;o<n.length;o++)r[(t=n[o].trim().split("="))[0].trim()]=t[1];return r},n.writeFmtp=function(e){var t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var n=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},n.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},n.writeRtcpFb=function(e){var t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},n.parseSsrcMedia=function(e){var t=e.indexOf(" "),r={ssrc:parseInt(e.substr(7,t-7),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substr(t+1,n-t-1),r.value=e.substr(n+1)):r.attribute=e.substr(t+1),r},n.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},n.getMid=function(e){var t=n.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},n.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},n.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:n.matchPrefix(e+t,"a=fingerprint:").map(n.parseFingerprint)}},n.writeDtlsParameters=function(e,t){var r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},n.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},n.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?n.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},n.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},n.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},n.getCryptoParameters=function(e,t){return n.matchPrefix(e+t,"a=crypto:").map(n.parseCryptoLine)},n.getIceParameters=function(e,t){var r=n.matchPrefix(e+t,"a=ice-ufrag:")[0],o=n.matchPrefix(e+t,"a=ice-pwd:")[0];return r&&o?{usernameFragment:r.substr(12),password:o.substr(10)}:null},n.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},n.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=n.splitLines(e)[0].split(" "),o=3;o<r.length;o++){var i=r[o],a=n.matchPrefix(e,"a=rtpmap:"+i+" ")[0];if(a){var s=n.parseRtpMap(a),c=n.matchPrefix(e,"a=fmtp:"+i+" ");switch(s.parameters=c.length?n.parseFmtp(c[0]):{},s.rtcpFeedback=n.matchPrefix(e,"a=rtcp-fb:"+i+" ").map(n.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}return n.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(n.parseExtmap(e))})),t},n.writeRtpDescription=function(e,t){var r="";r+="m="+e+" ",r+=t.codecs.length>0?"9":"0",r+=" UDP/TLS/RTP/SAVPF ",r+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){r+=n.writeRtpMap(e),r+=n.writeFmtp(e),r+=n.writeRtcpFb(e)}));var o=0;return t.codecs.forEach((function(e){e.maxptime>o&&(o=e.maxptime)})),o>0&&(r+="a=maxptime:"+o+"\r\n"),r+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){r+=n.writeExtmap(e)})),r},n.parseRtpEncodingParameters=function(e){var t,r=[],o=n.parseRtpParameters(e),i=-1!==o.fecMechanisms.indexOf("RED"),a=-1!==o.fecMechanisms.indexOf("ULPFEC"),s=n.matchPrefix(e,"a=ssrc:").map((function(e){return n.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=s.length>0&&s[0].ssrc,d=n.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));d.length>0&&d[0].length>1&&d[0][0]===c&&(t=d[0][1]),o.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var n={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(n.rtx={ssrc:t}),r.push(n),i&&((n=JSON.parse(JSON.stringify(n))).fec={ssrc:c,mechanism:a?"red+ulpfec":"red"},r.push(n))}})),0===r.length&&c&&r.push({ssrc:c});var p=n.matchPrefix(e,"b=");return p.length&&(p=0===p[0].indexOf("b=TIAS:")?parseInt(p[0].substr(7),10):0===p[0].indexOf("b=AS:")?1e3*parseInt(p[0].substr(5),10)*.95-16e3:void 0,r.forEach((function(e){e.maxBitrate=p}))),r},n.parseRtcpParameters=function(e){var t={},r=n.matchPrefix(e,"a=ssrc:").map((function(e){return n.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];r&&(t.cname=r.value,t.ssrc=r.ssrc);var o=n.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=o.length>0,t.compound=0===o.length;var i=n.matchPrefix(e,"a=rtcp-mux");return t.mux=i.length>0,t},n.parseMsid=function(e){var t,r=n.matchPrefix(e,"a=msid:");if(1===r.length)return{stream:(t=r[0].substr(7).split(" "))[0],track:t[1]};var o=n.matchPrefix(e,"a=ssrc:").map((function(e){return n.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return o.length>0?{stream:(t=o[0].value.split(" "))[0],track:t[1]}:void 0},n.parseSctpDescription=function(e){var t,r=n.parseMLine(e),o=n.matchPrefix(e,"a=max-message-size:");o.length>0&&(t=parseInt(o[0].substr(19),10)),isNaN(t)&&(t=65536);var i=n.matchPrefix(e,"a=sctp-port:");if(i.length>0)return{port:parseInt(i[0].substr(12),10),protocol:r.fmt,maxMessageSize:t};if(n.matchPrefix(e,"a=sctpmap:").length>0){var a=n.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:t}}},n.writeSctpDescription=function(e,t){var r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},n.generateSessionId=function(){return Math.random().toString().substr(2,21)},n.writeSessionBoilerplate=function(e,t,r){var o=void 0!==t?t:2;return"v=0\r\no="+(r||"thisisadapterortc")+" "+(e||n.generateSessionId())+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},n.writeMediaSection=function(e,t,r,o){var i=n.writeRtpDescription(e.kind,t);if(i+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),i+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":"active"),i+="a=mid:"+e.mid+"\r\n",e.direction?i+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?i+="a=sendrecv\r\n":e.rtpSender?i+="a=sendonly\r\n":e.rtpReceiver?i+="a=recvonly\r\n":i+="a=inactive\r\n",e.rtpSender){var a="msid:"+o.id+" "+e.rtpSender.track.id+"\r\n";i+="a="+a,i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,i+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),i},n.getDirection=function(e,t){for(var r=n.splitLines(e),o=0;o<r.length;o++)switch(r[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[o].substr(2)}return t?n.getDirection(t):"sendrecv"},n.getKind=function(e){return n.splitLines(e)[0].split(" ")[0].substr(2)},n.isRejected=function(e){return"0"===e.split(" ",2)[1]},n.parseMLine=function(e){var t=n.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},n.parseOLine=function(e){var t=n.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},n.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=n.splitLines(e),r=0;r<t.length;r++)if(t[r].length<2||"="!==t[r].charAt(1))return!1;return!0},"object"==typeof t&&(t.exports=n)},{}],NJ2u:[function(e,t,r){"use strict";var n=e("sdp");function o(e,t,r,o,i){var a=n.writeRtpDescription(e.kind,t);if(a+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":i||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var c="msid:"+(o?o.id:"-")+" "+s+"\r\n";a+="a="+c,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),a}function i(e,t){var r={codecs:[],headerExtensions:[],fecMechanisms:[]},n=function(e,t){e=parseInt(e,10);for(var r=0;r<t.length;r++)if(t[r].payloadType===e||t[r].preferredPayloadType===e)return t[r]},o=function(e,t,r,o){var i=n(e.parameters.apt,r),a=n(t.parameters.apt,o);return i&&a&&i.name.toLowerCase()===a.name.toLowerCase()};return e.codecs.forEach((function(n){for(var i=0;i<t.codecs.length;i++){var a=t.codecs[i];if(n.name.toLowerCase()===a.name.toLowerCase()&&n.clockRate===a.clockRate){if("rtx"===n.name.toLowerCase()&&n.parameters&&a.parameters.apt&&!o(n,a,e.codecs,t.codecs))continue;(a=JSON.parse(JSON.stringify(a))).numChannels=Math.min(n.numChannels,a.numChannels),r.codecs.push(a),a.rtcpFeedback=a.rtcpFeedback.filter((function(e){for(var t=0;t<n.rtcpFeedback.length;t++)if(n.rtcpFeedback[t].type===e.type&&n.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var n=0;n<t.headerExtensions.length;n++){var o=t.headerExtensions[n];if(e.uri===o.uri){r.headerExtensions.push(o);break}}})),r}function a(e,t,r){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(r)}function s(e,t){var r=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return r||e.addRemoteCandidate(t),!r}function c(e,t){var r=new Error(t);return r.name=e,r.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],r}t.exports=function(e,t){function r(t,r){r.addTrack(t),r.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function d(t,r,n,o){var i=new Event("track");i.track=r,i.receiver=n,i.transceiver={receiver:n},i.streams=o,e.setTimeout((function(){t._dispatchEvent("track",i)}))}var p=function(r){var o=this,i=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){o[e]=i[e].bind(i)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",r=JSON.parse(JSON.stringify(r||{})),this.usingBundle="max-bundle"===r.bundlePolicy,"negotiate"===r.rtcpMuxPolicy)throw c("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(r.rtcpMuxPolicy||(r.rtcpMuxPolicy="require"),r.iceTransportPolicy){case"all":case"relay":break;default:r.iceTransportPolicy="all"}switch(r.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:r.bundlePolicy="balanced"}if(r.iceServers=function(e,t){var r=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var n=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var o="string"==typeof n;return o&&(n=[n]),n=n.filter((function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||r?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(r=!0,!0)})),delete e.url,e.urls=o?n[0]:n,!!n.length}}))}(r.iceServers||[],t),this._iceGatherers=[],r.iceCandidatePoolSize)for(var a=r.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:r.iceServers,gatherPolicy:r.iceTransportPolicy}));else r.iceCandidatePoolSize=0;this._config=r,this.transceivers=[],this._sdpSessionId=n.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(p.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(p.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),p.prototype.onicecandidate=null,p.prototype.onaddstream=null,p.prototype.ontrack=null,p.prototype.onremovestream=null,p.prototype.onsignalingstatechange=null,p.prototype.oniceconnectionstatechange=null,p.prototype.onconnectionstatechange=null,p.prototype.onicegatheringstatechange=null,p.prototype.onnegotiationneeded=null,p.prototype.ondatachannel=null,p.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},p.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},p.prototype.getConfiguration=function(){return this._config},p.prototype.getLocalStreams=function(){return this.localStreams},p.prototype.getRemoteStreams=function(){return this.remoteStreams},p.prototype._createTransceiver=function(e,t){var r=this.transceivers.length>0,n={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&r)n.iceTransport=this.transceivers[0].iceTransport,n.dtlsTransport=this.transceivers[0].dtlsTransport;else{var o=this._createIceAndDtlsTransports();n.iceTransport=o.iceTransport,n.dtlsTransport=o.dtlsTransport}return t||this.transceivers.push(n),n},p.prototype.addTrack=function(t,r){if(this._isClosed)throw c("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var n;if(this.transceivers.find((function(e){return e.track===t})))throw c("InvalidAccessError","Track already exists.");for(var o=0;o<this.transceivers.length;o++)this.transceivers[o].track||this.transceivers[o].kind!==t.kind||(n=this.transceivers[o]);return n||(n=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(r)&&this.localStreams.push(r),n.track=t,n.stream=r,n.rtpSender=new e.RTCRtpSender(t,n.dtlsTransport),n.rtpSender},p.prototype.addStream=function(e){var r=this;if(t>=15025)e.getTracks().forEach((function(t){r.addTrack(t,e)}));else{var n=e.clone();e.getTracks().forEach((function(e,t){var r=n.getTracks()[t];e.addEventListener("enabled",(function(e){r.enabled=e.enabled}))})),n.getTracks().forEach((function(e){r.addTrack(e,n)}))}},p.prototype.removeTrack=function(t){if(this._isClosed)throw c("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var r=this.transceivers.find((function(e){return e.rtpSender===t}));if(!r)throw c("InvalidAccessError","Sender was not created by this connection.");var n=r.stream;r.rtpSender.stop(),r.rtpSender=null,r.track=null,r.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(n)&&this.localStreams.indexOf(n)>-1&&this.localStreams.splice(this.localStreams.indexOf(n),1),this._maybeFireNegotiationNeeded()},p.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var r=t.getSenders().find((function(t){return t.track===e}));r&&t.removeTrack(r)}))},p.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},p.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},p.prototype._createIceGatherer=function(t,r){var n=this;if(r&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var o=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(o,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var r=!e.candidate||0===Object.keys(e.candidate).length;o.state=r?"completed":"gathering",null!==n.transceivers[t].bufferedCandidateEvents&&n.transceivers[t].bufferedCandidateEvents.push(e)},o.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),o},p.prototype._gather=function(t,r){var o=this,i=this.transceivers[r].iceGatherer;if(!i.onlocalcandidate){var a=this.transceivers[r].bufferedCandidateEvents;this.transceivers[r].bufferedCandidateEvents=null,i.removeEventListener("localcandidate",this.transceivers[r].bufferCandidates),i.onlocalcandidate=function(e){if(!(o.usingBundle&&r>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:r};var s=e.candidate,c=!s||0===Object.keys(s).length;if(c)"new"!==i.state&&"gathering"!==i.state||(i.state="completed");else{"new"===i.state&&(i.state="gathering"),s.component=1,s.ufrag=i.getLocalParameters().usernameFragment;var d=n.writeCandidate(s);a.candidate=Object.assign(a.candidate,n.parseCandidate(d)),a.candidate.candidate=d,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var p=n.getMediaSections(o._localDescription.sdp);p[a.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",o._localDescription.sdp=n.getDescription(o._localDescription.sdp)+p.join("");var u=o.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==o.iceGatheringState&&(o.iceGatheringState="gathering",o._emitGatheringStateChange()),c||o._dispatchEvent("icecandidate",a),u&&(o._dispatchEvent("icecandidate",new Event("icecandidate")),o.iceGatheringState="complete",o._emitGatheringStateChange())}},e.setTimeout((function(){a.forEach((function(e){i.onlocalcandidate(e)}))}),0)}},p.prototype._createIceAndDtlsTransports=function(){var t=this,r=new e.RTCIceTransport(null);r.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var n=new e.RTCDtlsTransport(r);return n.ondtlsstatechange=function(){t._updateConnectionState()},n.onerror=function(){Object.defineProperty(n,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:r,dtlsTransport:n}},p.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var r=this.transceivers[e].iceTransport;r&&(delete r.onicestatechange,delete this.transceivers[e].iceTransport);var n=this.transceivers[e].dtlsTransport;n&&(delete n.ondtlsstatechange,delete n.onerror,delete this.transceivers[e].dtlsTransport)},p.prototype._transceive=function(e,r,o){var a=i(e.localCapabilities,e.remoteCapabilities);r&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:n.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),o&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},p.prototype.setLocalDescription=function(e){var t,r,o=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(c("TypeError",'Unsupported type "'+e.type+'"'));if(!a("setLocalDescription",e.type,o.signalingState)||o._isClosed)return Promise.reject(c("InvalidStateError","Can not set local "+e.type+" in state "+o.signalingState));if("offer"===e.type)t=n.splitSections(e.sdp),r=t.shift(),t.forEach((function(e,t){var r=n.parseRtpParameters(e);o.transceivers[t].localCapabilities=r})),o.transceivers.forEach((function(e,t){o._gather(e.mid,t)}));else if("answer"===e.type){t=n.splitSections(o._remoteDescription.sdp),r=t.shift();var s=n.matchPrefix(r,"a=ice-lite").length>0;t.forEach((function(e,t){var a=o.transceivers[t],c=a.iceGatherer,d=a.iceTransport,p=a.dtlsTransport,u=a.localCapabilities,l=a.remoteCapabilities;if(!(n.isRejected(e)&&0===n.matchPrefix(e,"a=bundle-only").length||a.rejected)){var h=n.getIceParameters(e,r),f=n.getDtlsParameters(e,r);s&&(f.role="server"),o.usingBundle&&0!==t||(o._gather(a.mid,t),"new"===d.state&&d.start(c,h,s?"controlling":"controlled"),"new"===p.state&&p.start(f));var m=i(u,l);o._transceive(a,m.codecs.length>0,!1)}}))}return o._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?o._updateSignalingState("have-local-offer"):o._updateSignalingState("stable"),Promise.resolve()},p.prototype.setRemoteDescription=function(o){var p=this;if(-1===["offer","answer"].indexOf(o.type))return Promise.reject(c("TypeError",'Unsupported type "'+o.type+'"'));if(!a("setRemoteDescription",o.type,p.signalingState)||p._isClosed)return Promise.reject(c("InvalidStateError","Can not set remote "+o.type+" in state "+p.signalingState));var u={};p.remoteStreams.forEach((function(e){u[e.id]=e}));var l=[],h=n.splitSections(o.sdp),f=h.shift(),m=n.matchPrefix(f,"a=ice-lite").length>0,g=n.matchPrefix(f,"a=group:BUNDLE ").length>0;p.usingBundle=g;var y=n.matchPrefix(f,"a=ice-options:")[0];return p.canTrickleIceCandidates=!!y&&y.substr(14).split(" ").indexOf("trickle")>=0,h.forEach((function(a,c){var d=n.splitLines(a),h=n.getKind(a),y=n.isRejected(a)&&0===n.matchPrefix(a,"a=bundle-only").length,E=d[0].substr(2).split(" ")[2],v=n.getDirection(a,f),_=n.parseMsid(a),T=n.getMid(a)||n.generateIdentifier();if(y||"application"===h&&("DTLS/SCTP"===E||"UDP/DTLS/SCTP"===E))p.transceivers[c]={mid:T,kind:h,protocol:E,rejected:!0};else{var w,b,O,P,S,A,D,R,C;!y&&p.transceivers[c]&&p.transceivers[c].rejected&&(p.transceivers[c]=p._createTransceiver(h,!0));var M,k,I=n.parseRtpParameters(a);y||(M=n.getIceParameters(a,f),(k=n.getDtlsParameters(a,f)).role="client"),D=n.parseRtpEncodingParameters(a);var x=n.parseRtcpParameters(a),N=n.matchPrefix(a,"a=end-of-candidates",f).length>0,F=n.matchPrefix(a,"a=candidate:").map((function(e){return n.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===o.type||"answer"===o.type)&&!y&&g&&c>0&&p.transceivers[c]&&(p._disposeIceAndDtlsTransports(c),p.transceivers[c].iceGatherer=p.transceivers[0].iceGatherer,p.transceivers[c].iceTransport=p.transceivers[0].iceTransport,p.transceivers[c].dtlsTransport=p.transceivers[0].dtlsTransport,p.transceivers[c].rtpSender&&p.transceivers[c].rtpSender.setTransport(p.transceivers[0].dtlsTransport),p.transceivers[c].rtpReceiver&&p.transceivers[c].rtpReceiver.setTransport(p.transceivers[0].dtlsTransport)),"offer"!==o.type||y)"answer"!==o.type||y||(b=(w=p.transceivers[c]).iceGatherer,O=w.iceTransport,P=w.dtlsTransport,S=w.rtpReceiver,A=w.sendEncodingParameters,R=w.localCapabilities,p.transceivers[c].recvEncodingParameters=D,p.transceivers[c].remoteCapabilities=I,p.transceivers[c].rtcpParameters=x,F.length&&"new"===O.state&&(!m&&!N||g&&0!==c?F.forEach((function(e){s(w.iceTransport,e)})):O.setRemoteCandidates(F)),g&&0!==c||("new"===O.state&&O.start(b,M,"controlling"),"new"===P.state&&P.start(k)),!i(w.localCapabilities,w.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&w.sendEncodingParameters[0].rtx&&delete w.sendEncodingParameters[0].rtx,p._transceive(w,"sendrecv"===v||"recvonly"===v,"sendrecv"===v||"sendonly"===v),!S||"sendrecv"!==v&&"sendonly"!==v?delete w.rtpReceiver:(C=S.track,_?(u[_.stream]||(u[_.stream]=new e.MediaStream),r(C,u[_.stream]),l.push([C,S,u[_.stream]])):(u.default||(u.default=new e.MediaStream),r(C,u.default),l.push([C,S,u.default]))));else{(w=p.transceivers[c]||p._createTransceiver(h)).mid=T,w.iceGatherer||(w.iceGatherer=p._createIceGatherer(c,g)),F.length&&"new"===w.iceTransport.state&&(!N||g&&0!==c?F.forEach((function(e){s(w.iceTransport,e)})):w.iceTransport.setRemoteCandidates(F)),R=e.RTCRtpReceiver.getCapabilities(h),t<15019&&(R.codecs=R.codecs.filter((function(e){return"rtx"!==e.name}))),A=w.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var V,j=!1;"sendrecv"===v||"sendonly"===v?(j=!w.rtpReceiver,S=w.rtpReceiver||new e.RTCRtpReceiver(w.dtlsTransport,h),j&&(C=S.track,_&&"-"===_.stream||(_?(u[_.stream]||(u[_.stream]=new e.MediaStream,Object.defineProperty(u[_.stream],"id",{get:function(){return _.stream}})),Object.defineProperty(C,"id",{get:function(){return _.track}}),V=u[_.stream]):(u.default||(u.default=new e.MediaStream),V=u.default)),V&&(r(C,V),w.associatedRemoteMediaStreams.push(V)),l.push([C,S,V]))):w.rtpReceiver&&w.rtpReceiver.track&&(w.associatedRemoteMediaStreams.forEach((function(t){var r,n,o=t.getTracks().find((function(e){return e.id===w.rtpReceiver.track.id}));o&&(r=o,(n=t).removeTrack(r),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:r})))})),w.associatedRemoteMediaStreams=[]),w.localCapabilities=R,w.remoteCapabilities=I,w.rtpReceiver=S,w.rtcpParameters=x,w.sendEncodingParameters=A,w.recvEncodingParameters=D,p._transceive(p.transceivers[c],!1,j)}}})),void 0===p._dtlsRole&&(p._dtlsRole="offer"===o.type?"active":"passive"),p._remoteDescription={type:o.type,sdp:o.sdp},"offer"===o.type?p._updateSignalingState("have-remote-offer"):p._updateSignalingState("stable"),Object.keys(u).forEach((function(t){var r=u[t];if(r.getTracks().length){if(-1===p.remoteStreams.indexOf(r)){p.remoteStreams.push(r);var n=new Event("addstream");n.stream=r,e.setTimeout((function(){p._dispatchEvent("addstream",n)}))}l.forEach((function(e){var t=e[0],n=e[1];r.id===e[2].id&&d(p,t,n,[r])}))}})),l.forEach((function(e){e[2]||d(p,e[0],e[1],[])})),e.setTimeout((function(){p&&p.transceivers&&p.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},p.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},p.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},p.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},p.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var r=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",r)}},p.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var r=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",r)}},p.prototype.createOffer=function(){var r=this;if(r._isClosed)return Promise.reject(c("InvalidStateError","Can not call createOffer after close"));var i=r.transceivers.filter((function(e){return"audio"===e.kind})).length,a=r.transceivers.filter((function(e){return"video"===e.kind})).length,s=arguments[0];if(s){if(s.mandatory||s.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==s.offerToReceiveAudio&&(i=!0===s.offerToReceiveAudio?1:!1===s.offerToReceiveAudio?0:s.offerToReceiveAudio),void 0!==s.offerToReceiveVideo&&(a=!0===s.offerToReceiveVideo?1:!1===s.offerToReceiveVideo?0:s.offerToReceiveVideo)}for(r.transceivers.forEach((function(e){"audio"===e.kind?--i<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)}));i>0||a>0;)i>0&&(r._createTransceiver("audio"),i--),a>0&&(r._createTransceiver("video"),a--);var d=n.writeSessionBoilerplate(r._sdpSessionId,r._sdpSessionVersion++);r.transceivers.forEach((function(o,i){var a=o.track,s=o.kind,c=o.mid||n.generateIdentifier();o.mid=c,o.iceGatherer||(o.iceGatherer=r._createIceGatherer(i,r.usingBundle));var d=e.RTCRtpSender.getCapabilities(s);t<15019&&(d.codecs=d.codecs.filter((function(e){return"rtx"!==e.name}))),d.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),o.remoteCapabilities&&o.remoteCapabilities.codecs&&o.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),d.headerExtensions.forEach((function(e){(o.remoteCapabilities&&o.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var p=o.sendEncodingParameters||[{ssrc:1001*(2*i+1)}];a&&t>=15019&&"video"===s&&!p[0].rtx&&(p[0].rtx={ssrc:p[0].ssrc+1}),o.wantReceive&&(o.rtpReceiver=new e.RTCRtpReceiver(o.dtlsTransport,s)),o.localCapabilities=d,o.sendEncodingParameters=p})),"max-compat"!==r._config.bundlePolicy&&(d+="a=group:BUNDLE "+r.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),d+="a=ice-options:trickle\r\n",r.transceivers.forEach((function(e,t){d+=o(e,e.localCapabilities,"offer",e.stream,r._dtlsRole),d+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===r.iceGatheringState||0!==t&&r.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,d+="a="+n.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(d+="a=end-of-candidates\r\n"))}));var p=new e.RTCSessionDescription({type:"offer",sdp:d});return Promise.resolve(p)},p.prototype.createAnswer=function(){var r=this;if(r._isClosed)return Promise.reject(c("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==r.signalingState&&"have-local-pranswer"!==r.signalingState)return Promise.reject(c("InvalidStateError","Can not call createAnswer in signalingState "+r.signalingState));var a=n.writeSessionBoilerplate(r._sdpSessionId,r._sdpSessionVersion++);r.usingBundle&&(a+="a=group:BUNDLE "+r.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var s=n.getMediaSections(r._remoteDescription.sdp).length;r.transceivers.forEach((function(e,n){if(!(n+1>s)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var c;e.stream&&("audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1}));var d=i(e.localCapabilities,e.remoteCapabilities);!d.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=o(e,d,"answer",e.stream,r._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var d=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(d)},p.prototype.addIceCandidate=function(e){var t,r=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(o,i){if(!r._remoteDescription)return i(c("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var d=0;d<r.transceivers.length;d++)if(r.transceivers[d].mid===e.sdpMid){a=d;break}var p=r.transceivers[a];if(!p)return i(c("OperationError","Can not add ICE candidate"));if(p.rejected)return o();var u=Object.keys(e.candidate).length>0?n.parseCandidate(e.candidate):{};if("tcp"===u.protocol&&(0===u.port||9===u.port))return o();if(u.component&&1!==u.component)return o();if((0===a||a>0&&p.iceTransport!==r.transceivers[0].iceTransport)&&!s(p.iceTransport,u))return i(c("OperationError","Can not add ICE candidate"));var l=e.candidate.trim();0===l.indexOf("a=")&&(l=l.substr(2)),(t=n.getMediaSections(r._remoteDescription.sdp))[a]+="a="+(u.type?l:"end-of-candidates")+"\r\n",r._remoteDescription.sdp=n.getDescription(r._remoteDescription.sdp)+t.join("")}else for(var h=0;h<r.transceivers.length&&(r.transceivers[h].rejected||(r.transceivers[h].iceTransport.addRemoteCandidate({}),(t=n.getMediaSections(r._remoteDescription.sdp))[h]+="a=end-of-candidates\r\n",r._remoteDescription.sdp=n.getDescription(r._remoteDescription.sdp)+t.join(""),!r.usingBundle));h++);o()}))},p.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var r=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?r=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(r=e.rtpReceiver)})),!r)throw c("InvalidAccessError","Invalid selector.");return r.getStats()}var n=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&n.push(e[t].getStats())}))})),Promise.all(n).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))},["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var r=e[t];if(r&&r.prototype&&r.prototype.getStats){var n=r.prototype.getStats;r.prototype.getStats=function(){return n.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(r){e[r].type=function(e){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type}(e[r]),t.set(r,e[r])})),t}))}}}));var u=["createOffer","createAnswer"];return u.forEach((function(e){var t=p.prototype[e];p.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(u=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=p.prototype[e];p.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=p.prototype[e];p.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),p}},{sdp:"YHvh"}],YdKx:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetUserMedia=function(e){var t=e&&e.navigator,r=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return r(e).catch((function(e){return Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))}))}}},{}],P3bV:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetDisplayMedia=function(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}},{}],XRic:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimPeerConnection=function(e,t){if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var r=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){r.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}!e.RTCRtpSender||"dtmf"in e.RTCRtpSender.prototype||Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var a=(0,i.default)(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=(0,o.filterIceServers)(e.iceServers,t.version),n.log("ICE servers after filtering:",e.iceServers)),new a(e)},e.RTCPeerConnection.prototype=a.prototype},r.shimReplaceTrack=function(e){!e.RTCRtpSender||"replaceTrack"in e.RTCRtpSender.prototype||(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)},Object.defineProperty(r,"shimGetUserMedia",{enumerable:!0,get:function(){return a.shimGetUserMedia}}),Object.defineProperty(r,"shimGetDisplayMedia",{enumerable:!0,get:function(){return s.shimGetDisplayMedia}});var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}(e("../utils")),o=e("./filtericeservers"),i=function(e){return e&&e.__esModule?e:{default:e}}(e("rtcpeerconnection-shim")),a=e("./getusermedia"),s=e("./getdisplaymedia");function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}},{"../utils":"iSxC","./filtericeservers":"NZ1C","rtcpeerconnection-shim":"NJ2u","./getusermedia":"YdKx","./getdisplaymedia":"P3bV"}],GzSv:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetUserMedia=function(e,t){var r=e&&e.navigator,o=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,o){n.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(t,o)},!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){var a=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},s=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(e){return"object"===i(e)&&"object"===i(e.audio)&&(e=JSON.parse(JSON.stringify(e)),a(e.audio,"autoGainControl","mozAutoGainControl"),a(e.audio,"noiseSuppression","mozNoiseSuppression")),s(e)},o&&o.prototype.getSettings){var c=o.prototype.getSettings;o.prototype.getSettings=function(){var e=c.apply(this,arguments);return a(e,"mozAutoGainControl","autoGainControl"),a(e,"mozNoiseSuppression","noiseSuppression"),e}}if(o&&o.prototype.applyConstraints){var d=o.prototype.applyConstraints;o.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===i(e)&&(e=JSON.parse(JSON.stringify(e)),a(e,"autoGainControl","mozAutoGainControl"),a(e,"noiseSuppression","mozNoiseSuppression")),d.apply(this,[e])}}}};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}(e("../utils"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}},{"../utils":"iSxC"}],UuGU:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetDisplayMedia=function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){var n=new DOMException("getDisplayMedia without video constraints is undefined");return n.name="NotFoundError",n.code=8,Promise.reject(n)}return!0===r.video?r.video={mediaSource:t}:r.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(r)})}},{}],Fzdr:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimOnTrack=function(e){"object"===s(e)&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},r.shimPeerConnection=function(e,t){if("object"===s(e)&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var r=e.RTCPeerConnection.prototype[t],n=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=n[t]}));var r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var[e,o,i]=arguments;return n.apply(this,[e||null]).then((function(e){if(t.version<53&&!o)try{e.forEach((function(e){e.type=r[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,n){e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))}))}return e})).then(o,i)}}},r.shimSenderGetStats=function(e){if("object"===s(e)&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpSender.prototype))){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,r=t.apply(this,[]);return r.forEach((function(t){return t._pc=e})),r});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}},r.shimReceiverGetStats=function(e){if("object"===s(e)&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpReceiver.prototype))){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,r=t.apply(this,[]);return r.forEach((function(t){return t._pc=e})),r}),n.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},r.shimRemoveStream=function(e){!e.RTCPeerConnection||"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;n.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(r){r.track&&e.getTracks().includes(r.track)&&t.removeTrack(r)}))})},r.shimRTCDataChannel=function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)},r.shimAddTransceiver=function(e){if("object"===s(e)&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var e=arguments[1],r=e&&"sendEncodings"in e;r&&e.sendEncodings.forEach((function(e){if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));var n=t.apply(this,arguments);if(r){var{sender:o}=n,i=o.getParameters();"encodings"in i&&(1!==i.encodings.length||0!==Object.keys(i.encodings[0]).length)||(i.encodings=e.sendEncodings,o.sendEncodings=e.sendEncodings,this.setParametersPromises.push(o.setParameters(i).then((function(){delete o.sendEncodings})).catch((function(){delete o.sendEncodings}))))}return n})}},r.shimGetParameters=function(e){if("object"===s(e)&&e.RTCRtpSender){var t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){var e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}},r.shimCreateOffer=function(e){if("object"===s(e)&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){var e=arguments,r=this;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(r,e)})).finally((function(){r.setParametersPromises=[]})):t.apply(this,arguments)}}},r.shimCreateAnswer=function(e){if("object"===s(e)&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){var e=arguments,r=this;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(r,e)})).finally((function(){r.setParametersPromises=[]})):t.apply(this,arguments)}}},Object.defineProperty(r,"shimGetUserMedia",{enumerable:!0,get:function(){return o.shimGetUserMedia}}),Object.defineProperty(r,"shimGetDisplayMedia",{enumerable:!0,get:function(){return i.shimGetDisplayMedia}});var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}(e("../utils")),o=e("./getusermedia"),i=e("./getdisplaymedia");function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}},{"../utils":"iSxC","./getusermedia":"GzSv","./getdisplaymedia":"UuGU"}],t1lL:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimLocalStreamsAPI=function(e){if("object"===i(e)&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){var r=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((function(n){return t.call(r,n,e)})),e.getVideoTracks().forEach((function(n){return t.call(r,n,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e){for(var r=this,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o&&o.forEach((function(e){r._localStreams?r._localStreams.includes(e)||r._localStreams.push(e):r._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._localStreams||(this._localStreams=[]);var r=this._localStreams.indexOf(e);if(-1!==r){this._localStreams.splice(r,1);var n=e.getTracks();this.getSenders().forEach((function(e){n.includes(e.track)&&t.removeTrack(e)}))}})}},r.shimRemoteStreamsAPI=function(e){if("object"===i(e)&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((function(e){if(t._remoteStreams||(t._remoteStreams=[]),!t._remoteStreams.includes(e)){t._remoteStreams.push(e);var r=new Event("addstream");r.stream=e,t.dispatchEvent(r)}}))})}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}}))}),t.apply(e,arguments)}}},r.shimCallbacksAPI=function(e){if("object"===i(e)&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,r=t.createOffer,n=t.createAnswer,o=t.setLocalDescription,a=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],o=r.apply(this,[n]);return t?(o.then(e,t),Promise.resolve()):o},t.createAnswer=function(e,t){var r=arguments.length>=2?arguments[2]:arguments[0],o=n.apply(this,[r]);return t?(o.then(e,t),Promise.resolve()):o};var c=function(e,t,r){var n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=c,c=function(e,t,r){var n=a.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=c,c=function(e,t,r){var n=s.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=c}},r.shimGetUserMedia=function(e){var t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){var r=t.mediaDevices,n=r.getUserMedia.bind(r);t.mediaDevices.getUserMedia=function(e){return n(a(e))}}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))},r.shimConstraints=a,r.shimRTCIceServerUrls=function(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){for(var o=[],i=0;i<e.iceServers.length;i++){var a=e.iceServers[i];!a.hasOwnProperty("urls")&&a.hasOwnProperty("url")?(n.deprecated("RTCIceServer.url","RTCIceServer.urls"),(a=JSON.parse(JSON.stringify(a))).urls=a.url,delete a.url,o.push(a)):o.push(e.iceServers[i])}e.iceServers=o}return new t(e,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})}},r.shimTrackEventTransceiver=function(e){"object"===i(e)&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},r.shimCreateOfferLegacy=function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var r=this.getTransceivers().find((function(e){return"audio"===e.receiver.track.kind}));!1===e.offerToReceiveAudio&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveAudio||r||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var n=this.getTransceivers().find((function(e){return"video"===e.receiver.track.kind}));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video")}return t.apply(this,arguments)}},r.shimAudioContext=function(e){"object"!==i(e)||e.AudioContext||(e.AudioContext=e.webkitAudioContext)};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}(e("../utils"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return e&&void 0!==e.video?Object.assign({},e,{video:n.compactObject(e.video)}):e}},{"../utils":"iSxC"}],GOQK:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimRTCIceCandidate=function(e){if(e.RTCIceCandidate&&(!e.RTCIceCandidate||!("foundation"in e.RTCIceCandidate.prototype))){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"===a(e)&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var r=new t(e),o=n.default.parseCandidate(e.candidate),i=Object.assign(r,o);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,o.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}},r.shimMaxMessageSize=function(e,t){if(e.RTCPeerConnection){"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){var{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(e){if(!e||!e.sdp)return!1;var t=n.default.splitSections(e.sdp);return t.shift(),t.some((function(e){var t=n.default.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){var o,i=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var r=parseInt(t[1],10);return r!=r?-1:r}(arguments[0]),a=(d=i,p=65536,"firefox"===t.browser&&(p=t.version<57?-1===d?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),p),s=function(e,r){var o=65536;"firefox"===t.browser&&57===t.version&&(o=65535);var i=n.default.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?o=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==r&&(o=2147483637),o}(arguments[0],i);o=0===a&&0===s?Number.POSITIVE_INFINITY:0===a||0===s?Math.max(a,s):Math.min(a,s);var c={};Object.defineProperty(c,"maxMessageSize",{get:function(){return o}}),this._sctp=c}var d,p;return r.apply(this,arguments)}}},r.shimSendThrowTypeError=function(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=t.apply(this,arguments);return r(e,this),e},o.wrapPeerConnectionEvent(e,"datachannel",(function(e){return r(e.channel,e.target),e}))}function r(e,t){var r=e.send;e.send=function(){var n=arguments[0],o=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&o>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}},r.shimConnectionState=function(e){if(e.RTCPeerConnection&&!("connectionState"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(e){var r=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(e){var t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;var r=new Event("connectionstatechange",e);t.dispatchEvent(r)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}},r.removeExtmapAllowMixed=function(e,t){if(e.RTCPeerConnection&&!("chrome"===t.browser&&t.version>=71||"safari"===t.browser&&t.version>=605)){var r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){var n=t.sdp.split("\n").filter((function(e){return"a=extmap-allow-mixed"!==e.trim()})).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return r.apply(this,arguments)}}},r.shimAddIceCandidateNullOrEmpty=function(e,t){if(e.RTCPeerConnection&&e.RTCPeerConnection.prototype){var r=e.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("sdp")),o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}(e("./utils"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}},{sdp:"YHvh","./utils":"iSxC"}],KtlG:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.adapterFactory=function(){var{window:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},r=n.log,d=n.detectBrowser(e),p={browserDetails:d,commonShim:c,extractVersion:n.extractVersion,disableLog:n.disableLog,disableWarnings:n.disableWarnings};switch(d.browser){case"chrome":if(!o||!o.shimPeerConnection||!t.shimChrome)return r("Chrome shim is not included in this adapter release."),p;if(null===d.version)return r("Chrome shim can not determine version, not shimming."),p;r("adapter.js shimming chrome."),p.browserShim=o,c.shimAddIceCandidateNullOrEmpty(e,d),o.shimGetUserMedia(e,d),o.shimMediaStream(e,d),o.shimPeerConnection(e,d),o.shimOnTrack(e,d),o.shimAddTrackRemoveTrack(e,d),o.shimGetSendersWithDtmf(e,d),o.shimGetStats(e,d),o.shimSenderReceiverGetStats(e,d),o.fixNegotiationNeeded(e,d),c.shimRTCIceCandidate(e,d),c.shimConnectionState(e,d),c.shimMaxMessageSize(e,d),c.shimSendThrowTypeError(e,d),c.removeExtmapAllowMixed(e,d);break;case"firefox":if(!a||!a.shimPeerConnection||!t.shimFirefox)return r("Firefox shim is not included in this adapter release."),p;r("adapter.js shimming firefox."),p.browserShim=a,c.shimAddIceCandidateNullOrEmpty(e,d),a.shimGetUserMedia(e,d),a.shimPeerConnection(e,d),a.shimOnTrack(e,d),a.shimRemoveStream(e,d),a.shimSenderGetStats(e,d),a.shimReceiverGetStats(e,d),a.shimRTCDataChannel(e,d),a.shimAddTransceiver(e,d),a.shimGetParameters(e,d),a.shimCreateOffer(e,d),a.shimCreateAnswer(e,d),c.shimRTCIceCandidate(e,d),c.shimConnectionState(e,d),c.shimMaxMessageSize(e,d),c.shimSendThrowTypeError(e,d);break;case"edge":if(!i||!i.shimPeerConnection||!t.shimEdge)return r("MS edge shim is not included in this adapter release."),p;r("adapter.js shimming edge."),p.browserShim=i,i.shimGetUserMedia(e,d),i.shimGetDisplayMedia(e,d),i.shimPeerConnection(e,d),i.shimReplaceTrack(e,d),c.shimMaxMessageSize(e,d),c.shimSendThrowTypeError(e,d);break;case"safari":if(!s||!t.shimSafari)return r("Safari shim is not included in this adapter release."),p;r("adapter.js shimming safari."),p.browserShim=s,c.shimAddIceCandidateNullOrEmpty(e,d),s.shimRTCIceServerUrls(e,d),s.shimCreateOfferLegacy(e,d),s.shimCallbacksAPI(e,d),s.shimLocalStreamsAPI(e,d),s.shimRemoteStreamsAPI(e,d),s.shimTrackEventTransceiver(e,d),s.shimGetUserMedia(e,d),s.shimAudioContext(e,d),c.shimRTCIceCandidate(e,d),c.shimMaxMessageSize(e,d),c.shimSendThrowTypeError(e,d),c.removeExtmapAllowMixed(e,d);break;default:r("Unsupported browser!")}return p};var n=p(e("./utils")),o=p(e("./chrome/chrome_shim")),i=p(e("./edge/edge_shim")),a=p(e("./firefox/firefox_shim")),s=p(e("./safari/safari_shim")),c=p(e("./common_shim"));function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function p(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}},{"./utils":"iSxC","./chrome/chrome_shim":"uI5X","./edge/edge_shim":"XRic","./firefox/firefox_shim":"Fzdr","./safari/safari_shim":"t1lL","./common_shim":"GOQK"}],tI1X:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(0,e("./adapter_factory.js").adapterFactory)({window:"undefined"==typeof window?void 0:window});r.default=n},{"./adapter_factory.js":"KtlG"}],sXtV:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.webRTCAdapter=void 0;var o=n(e("webrtc-adapter"));r.webRTCAdapter=o.default},{"webrtc-adapter":"tI1X"}],I31f:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Supports=void 0;var n=e("./adapter");r.Supports=new(function(){function e(){this.isIOS=["iPad","iPhone","iPod"].includes(navigator.platform),this.supportedBrowsers=["firefox","chrome","safari"],this.minFirefoxVersion=59,this.minChromeVersion=72,this.minSafariVersion=605}return e.prototype.isWebRTCSupported=function(){return"undefined"!=typeof RTCPeerConnection},e.prototype.isBrowserSupported=function(){var e=this.getBrowser(),t=this.getVersion();return!!this.supportedBrowsers.includes(e)&&("chrome"===e?t>=this.minChromeVersion:"firefox"===e?t>=this.minFirefoxVersion:"safari"===e&&!this.isIOS&&t>=this.minSafariVersion)},e.prototype.getBrowser=function(){return n.webRTCAdapter.browserDetails.browser},e.prototype.getVersion=function(){return n.webRTCAdapter.browserDetails.version||0},e.prototype.isUnifiedPlanSupported=function(){var e,t=this.getBrowser(),r=n.webRTCAdapter.browserDetails.version||0;if("chrome"===t&&r<72)return!1;if("firefox"===t&&r>=59)return!0;if(!window.RTCRtpTransceiver||!("currentDirection"in RTCRtpTransceiver.prototype))return!1;var o=!1;try{(e=new RTCPeerConnection).addTransceiver("audio"),o=!0}catch(e){}finally{e&&e.close()}return o},e.prototype.toString=function(){return"Supports: \n browser:"+this.getBrowser()+" \n version:"+this.getVersion()+" \n isIOS:"+this.isIOS+" \n isWebRTCSupported:"+this.isWebRTCSupported()+" \n isBrowserSupported:"+this.isBrowserSupported()+" \n isUnifiedPlanSupported:"+this.isUnifiedPlanSupported()},e}())},{"./adapter":"sXtV"}],BHXf:[function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.util=void 0;var a=i(e("peerjs-js-binarypack")),s=e("./supports"),c={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"turn:0.peerjs.com:3478",username:"peerjs",credential:"peerjsp"}],sdpSemantics:"unified-plan"};r.util=new(function(){function e(){this.CLOUD_HOST="0.peerjs.com",this.CLOUD_PORT=443,this.chunkedBrowsers={Chrome:1,chrome:1},this.chunkedMTU=16300,this.defaultConfig=c,this.browser=s.Supports.getBrowser(),this.browserVersion=s.Supports.getVersion(),this.supports=function(){var e,t={browser:s.Supports.isBrowserSupported(),webRTC:s.Supports.isWebRTCSupported(),audioVideo:!1,data:!1,binaryBlob:!1,reliable:!1};if(!t.webRTC)return t;try{e=new RTCPeerConnection(c),t.audioVideo=!0;var r=void 0;try{r=e.createDataChannel("_PEERJSTEST",{ordered:!0}),t.data=!0,t.reliable=!!r.ordered;try{r.binaryType="blob",t.binaryBlob=!s.Supports.isIOS}catch(e){}}catch(e){}finally{r&&r.close()}}catch(e){}finally{e&&e.close()}return t}(),this.pack=a.pack,this.unpack=a.unpack,this._dataCount=1}return e.prototype.noop=function(){},e.prototype.validateId=function(e){return!e||/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(e)},e.prototype.chunk=function(e){for(var t=[],n=e.size,o=Math.ceil(n/r.util.chunkedMTU),i=0,a=0;a<n;){var s=Math.min(n,a+r.util.chunkedMTU),c=e.slice(a,s),d={__peerData:this._dataCount,n:i,data:c,total:o};t.push(d),a=s,i++}return this._dataCount++,t},e.prototype.blobToArrayBuffer=function(e,t){var r=new FileReader;return r.onload=function(e){e.target&&t(e.target.result)},r.readAsArrayBuffer(e),r},e.prototype.binaryStringToArrayBuffer=function(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=255&e.charCodeAt(r);return t.buffer},e.prototype.randomToken=function(){return Math.random().toString(36).substr(2)},e.prototype.isSecure=function(){return"https:"===location.protocol},e}())},{"peerjs-js-binarypack":"kdPp","./supports":"I31f"}],JJlS:[function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o="~";function i(){}function a(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,r,n,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,n||e,i),c=o?o+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function c(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function d(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(o=!1)),d.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},d.prototype.listeners=function(e){var t=o?o+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,i=r.length,a=new Array(i);n<i;n++)a[n]=r[n].fn;return a},d.prototype.listenerCount=function(e){var t=o?o+e:e,r=this._events[t];return r?r.fn?1:r.length:0},d.prototype.emit=function(e,t,r,n,i,a){var s=o?o+e:e;if(!this._events[s])return!1;var c,d,p=this._events[s],u=arguments.length;if(p.fn){switch(p.once&&this.removeListener(e,p.fn,void 0,!0),u){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,t),!0;case 3:return p.fn.call(p.context,t,r),!0;case 4:return p.fn.call(p.context,t,r,n),!0;case 5:return p.fn.call(p.context,t,r,n,i),!0;case 6:return p.fn.call(p.context,t,r,n,i,a),!0}for(d=1,c=new Array(u-1);d<u;d++)c[d-1]=arguments[d];p.fn.apply(p.context,c)}else{var l,h=p.length;for(d=0;d<h;d++)switch(p[d].once&&this.removeListener(e,p[d].fn,void 0,!0),u){case 1:p[d].fn.call(p[d].context);break;case 2:p[d].fn.call(p[d].context,t);break;case 3:p[d].fn.call(p[d].context,t,r);break;case 4:p[d].fn.call(p[d].context,t,r,n);break;default:if(!c)for(l=1,c=new Array(u-1);l<u;l++)c[l-1]=arguments[l];p[d].fn.apply(p[d].context,c)}}return!0},d.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},d.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},d.prototype.removeListener=function(e,t,r,n){var i=o?o+e:e;if(!this._events[i])return this;if(!t)return c(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||n&&!a.once||r&&a.context!==r||c(this,i);else{for(var s=0,d=[],p=a.length;s<p;s++)(a[s].fn!==t||n&&!a[s].once||r&&a[s].context!==r)&&d.push(a[s]);d.length?this._events[i]=1===d.length?d[0]:d:c(this,i)}return this},d.prototype.removeAllListeners=function(e){var t;return e?(t=o?o+e:e,this._events[t]&&c(this,t)):(this._events=new i,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prefixed=o,d.EventEmitter=d,void 0!==t&&(t.exports=d)},{}],WOs9:[function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(r,"__esModule",{value:!0}),r.LogLevel=void 0;var i,a="PeerJS: ";!function(e){e[e.Disabled=0]="Disabled",e[e.Errors=1]="Errors",e[e.Warnings=2]="Warnings",e[e.All=3]="All"}(i=r.LogLevel||(r.LogLevel={}));var s=function(){function e(){this._logLevel=i.Disabled}return Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){this._logLevel=e},enumerable:!1,configurable:!0}),e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logLevel>=i.All&&this._print.apply(this,o([i.All],n(e)))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logLevel>=i.Warnings&&this._print.apply(this,o([i.Warnings],n(e)))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logLevel>=i.Errors&&this._print.apply(this,o([i.Errors],n(e)))},e.prototype.setLogFunction=function(e){this._print=e},e.prototype._print=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var s=o([a],n(t));for(var c in s)s[c]instanceof Error&&(s[c]="("+s[c].name+") "+s[c].message);e>=i.All?console.log.apply(console,o([],n(s))):e>=i.Warnings?console.warn.apply(console,o(["WARNING"],n(s))):e>=i.Errors&&console.error.apply(console,o(["ERROR"],n(s)))},e}();r.default=new s},{}],ZRYf:[function(e,t,r){"use strict";var n;Object.defineProperty(r,"__esModule",{value:!0}),r.ServerMessageType=r.SocketEventType=r.SerializationType=r.PeerErrorType=r.PeerEventType=r.ConnectionType=r.ConnectionEventType=void 0,(n=r.ConnectionEventType||(r.ConnectionEventType={})).Open="open",n.Stream="stream",n.Data="data",n.Close="close",n.Error="error",n.IceStateChanged="iceStateChanged",function(e){e.Data="data",e.Media="media"}(r.ConnectionType||(r.ConnectionType={})),function(e){e.Open="open",e.Close="close",e.Connection="connection",e.Call="call",e.Disconnected="disconnected",e.Error="error"}(r.PeerEventType||(r.PeerEventType={})),function(e){e.BrowserIncompatible="browser-incompatible",e.Disconnected="disconnected",e.InvalidID="invalid-id",e.InvalidKey="invalid-key",e.Network="network",e.PeerUnavailable="peer-unavailable",e.SslUnavailable="ssl-unavailable",e.ServerError="server-error",e.SocketError="socket-error",e.SocketClosed="socket-closed",e.UnavailableID="unavailable-id",e.WebRTC="webrtc"}(r.PeerErrorType||(r.PeerErrorType={})),function(e){e.Binary="binary",e.BinaryUTF8="binary-utf8",e.JSON="json"}(r.SerializationType||(r.SerializationType={})),function(e){e.Message="message",e.Disconnected="disconnected",e.Error="error",e.Close="close"}(r.SocketEventType||(r.SocketEventType={})),function(e){e.Heartbeat="HEARTBEAT",e.Candidate="CANDIDATE",e.Offer="OFFER",e.Answer="ANSWER",e.Open="OPEN",e.Error="ERROR",e.IdTaken="ID-TAKEN",e.InvalidKey="INVALID-KEY",e.Leave="LEAVE",e.Expire="EXPIRE"}(r.ServerMessageType||(r.ServerMessageType={}))},{}],wJlv:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},a=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.Socket=void 0;var c=e("eventemitter3"),d=s(e("./logger")),p=e("./enums"),u=function(e){function t(t,r,n,o,i,a){void 0===a&&(a=5e3);var s=e.call(this)||this;s.pingInterval=a,s._disconnected=!0,s._messagesQueue=[];var c=t?"wss://":"ws://";return s._baseUrl=c+r+":"+n+o+"peerjs?key="+i,s}return n(t,e),t.prototype.start=function(e,t){var r=this;this._id=e;var n=this._baseUrl+"&id="+e+"&token="+t;!this._socket&&this._disconnected&&(this._socket=new WebSocket(n),this._disconnected=!1,this._socket.onmessage=function(e){var t;try{t=JSON.parse(e.data),d.default.log("Server message received:",t)}catch(t){return void d.default.log("Invalid server message",e.data)}r.emit(p.SocketEventType.Message,t)},this._socket.onclose=function(e){r._disconnected||(d.default.log("Socket closed.",e),r._cleanup(),r._disconnected=!0,r.emit(p.SocketEventType.Disconnected))},this._socket.onopen=function(){r._disconnected||(r._sendQueuedMessages(),d.default.log("Socket open"),r._scheduleHeartbeat())})},t.prototype._scheduleHeartbeat=function(){var e=this;this._wsPingTimer=setTimeout((function(){e._sendHeartbeat()}),this.pingInterval)},t.prototype._sendHeartbeat=function(){if(this._wsOpen()){var e=JSON.stringify({type:p.ServerMessageType.Heartbeat});this._socket.send(e),this._scheduleHeartbeat()}else d.default.log("Cannot send heartbeat, because socket closed")},t.prototype._wsOpen=function(){return!!this._socket&&1===this._socket.readyState},t.prototype._sendQueuedMessages=function(){var e,t,r=i([],o(this._messagesQueue));this._messagesQueue=[];try{for(var n=a(r),s=n.next();!s.done;s=n.next()){var c=s.value;this.send(c)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t.prototype.send=function(e){if(!this._disconnected)if(this._id)if(e.type){if(this._wsOpen()){var t=JSON.stringify(e);this._socket.send(t)}}else this.emit(p.SocketEventType.Error,"Invalid message");else this._messagesQueue.push(e)},t.prototype.close=function(){this._disconnected||(this._cleanup(),this._disconnected=!0)},t.prototype._cleanup=function(){this._socket&&(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(),this._socket=void 0),clearTimeout(this._wsPingTimer)},t}(c.EventEmitter);r.Socket=u},{eventemitter3:"JJlS","./logger":"WOs9","./enums":"ZRYf"}],HCdX:[function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.Negotiator=void 0;var s=e("./util"),c=a(e("./logger")),d=e("./enums"),p=function(){function e(e){this.connection=e}return e.prototype.startConnection=function(e){var t=this._startPeerConnection();if(this.connection.peerConnection=t,this.connection.type===d.ConnectionType.Media&&e._stream&&this._addTracksToConnection(e._stream,t),e.originator){if(this.connection.type===d.ConnectionType.Data){var r=this.connection,n={ordered:!!e.reliable},o=t.createDataChannel(r.label,n);r.initialize(o)}this._makeOffer()}else this.handleSDP("OFFER",e.sdp)},e.prototype._startPeerConnection=function(){c.default.log("Creating RTCPeerConnection.");var e=new RTCPeerConnection(this.connection.provider.options.config);return this._setupListeners(e),e},e.prototype._setupListeners=function(e){var t=this,r=this.connection.peer,n=this.connection.connectionId,o=this.connection.type,i=this.connection.provider;c.default.log("Listening for ICE candidates."),e.onicecandidate=function(e){e.candidate&&e.candidate.candidate&&(c.default.log("Received ICE candidates for "+r+":",e.candidate),i.socket.send({type:d.ServerMessageType.Candidate,payload:{candidate:e.candidate,type:o,connectionId:n},dst:r}))},e.oniceconnectionstatechange=function(){switch(e.iceConnectionState){case"failed":c.default.log("iceConnectionState is failed, closing connections to "+r),t.connection.emit(d.ConnectionEventType.Error,new Error("Negotiation of connection to "+r+" failed.")),t.connection.close();break;case"closed":c.default.log("iceConnectionState is closed, closing connections to "+r),t.connection.emit(d.ConnectionEventType.Error,new Error("Connection to "+r+" closed.")),t.connection.close();break;case"disconnected":c.default.log("iceConnectionState changed to disconnected on the connection with "+r);break;case"completed":e.onicecandidate=s.util.noop}t.connection.emit(d.ConnectionEventType.IceStateChanged,e.iceConnectionState)},c.default.log("Listening for data channel"),e.ondatachannel=function(e){c.default.log("Received data channel");var t=e.channel;i.getConnection(r,n).initialize(t)},c.default.log("Listening for remote stream"),e.ontrack=function(e){c.default.log("Received remote stream");var o=e.streams[0],a=i.getConnection(r,n);if(a.type===d.ConnectionType.Media){var s=a;t._addStreamToMediaConnection(o,s)}}},e.prototype.cleanup=function(){c.default.log("Cleaning up PeerConnection to "+this.connection.peer);var e=this.connection.peerConnection;if(e){this.connection.peerConnection=null,e.onicecandidate=e.oniceconnectionstatechange=e.ondatachannel=e.ontrack=function(){};var t="closed"!==e.signalingState,r=!1;if(this.connection.type===d.ConnectionType.Data){var n=this.connection.dataChannel;n&&(r=!!n.readyState&&"closed"!==n.readyState)}(t||r)&&e.close()}},e.prototype._makeOffer=function(){return o(this,void 0,Promise,(function(){var e,t,r,o,a,p,u;return i(this,(function(i){switch(i.label){case 0:e=this.connection.peerConnection,t=this.connection.provider,i.label=1;case 1:return i.trys.push([1,7,,8]),[4,e.createOffer(this.connection.options.constraints)];case 2:r=i.sent(),c.default.log("Created offer."),this.connection.options.sdpTransform&&"function"==typeof this.connection.options.sdpTransform&&(r.sdp=this.connection.options.sdpTransform(r.sdp)||r.sdp),i.label=3;case 3:return i.trys.push([3,5,,6]),[4,e.setLocalDescription(r)];case 4:return i.sent(),c.default.log("Set localDescription:",r,"for:"+this.connection.peer),o={sdp:r,type:this.connection.type,connectionId:this.connection.connectionId,metadata:this.connection.metadata,browser:s.util.browser},this.connection.type===d.ConnectionType.Data&&(a=this.connection,o=n(n({},o),{label:a.label,reliable:a.reliable,serialization:a.serialization})),t.socket.send({type:d.ServerMessageType.Offer,payload:o,dst:this.connection.peer}),[3,6];case 5:return"OperationError: Failed to set local offer sdp: Called in wrong state: kHaveRemoteOffer"!=(p=i.sent())&&(t.emitError(d.PeerErrorType.WebRTC,p),c.default.log("Failed to setLocalDescription, ",p)),[3,6];case 6:return[3,8];case 7:return u=i.sent(),t.emitError(d.PeerErrorType.WebRTC,u),c.default.log("Failed to createOffer, ",u),[3,8];case 8:return[2]}}))}))},e.prototype._makeAnswer=function(){return o(this,void 0,Promise,(function(){var e,t,r,n,o;return i(this,(function(i){switch(i.label){case 0:e=this.connection.peerConnection,t=this.connection.provider,i.label=1;case 1:return i.trys.push([1,7,,8]),[4,e.createAnswer()];case 2:r=i.sent(),c.default.log("Created answer."),this.connection.options.sdpTransform&&"function"==typeof this.connection.options.sdpTransform&&(r.sdp=this.connection.options.sdpTransform(r.sdp)||r.sdp),i.label=3;case 3:return i.trys.push([3,5,,6]),[4,e.setLocalDescription(r)];case 4:return i.sent(),c.default.log("Set localDescription:",r,"for:"+this.connection.peer),t.socket.send({type:d.ServerMessageType.Answer,payload:{sdp:r,type:this.connection.type,connectionId:this.connection.connectionId,browser:s.util.browser},dst:this.connection.peer}),[3,6];case 5:return n=i.sent(),t.emitError(d.PeerErrorType.WebRTC,n),c.default.log("Failed to setLocalDescription, ",n),[3,6];case 6:return[3,8];case 7:return o=i.sent(),t.emitError(d.PeerErrorType.WebRTC,o),c.default.log("Failed to create answer, ",o),[3,8];case 8:return[2]}}))}))},e.prototype.handleSDP=function(e,t){return o(this,void 0,Promise,(function(){var r,n,o,a;return i(this,(function(i){switch(i.label){case 0:t=new RTCSessionDescription(t),r=this.connection.peerConnection,n=this.connection.provider,c.default.log("Setting remote description",t),o=this,i.label=1;case 1:return i.trys.push([1,5,,6]),[4,r.setRemoteDescription(t)];case 2:return i.sent(),c.default.log("Set remoteDescription:"+e+" for:"+this.connection.peer),"OFFER"!==e?[3,4]:[4,o._makeAnswer()];case 3:i.sent(),i.label=4;case 4:return[3,6];case 5:return a=i.sent(),n.emitError(d.PeerErrorType.WebRTC,a),c.default.log("Failed to setRemoteDescription, ",a),[3,6];case 6:return[2]}}))}))},e.prototype.handleCandidate=function(e){return o(this,void 0,Promise,(function(){var t,r,n,o,a,s;return i(this,(function(i){switch(i.label){case 0:c.default.log("handleCandidate:",e),t=e.candidate,r=e.sdpMLineIndex,n=e.sdpMid,o=this.connection.peerConnection,a=this.connection.provider,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,o.addIceCandidate(new RTCIceCandidate({sdpMid:n,sdpMLineIndex:r,candidate:t}))];case 2:return i.sent(),c.default.log("Added ICE candidate for:"+this.connection.peer),[3,4];case 3:return s=i.sent(),a.emitError(d.PeerErrorType.WebRTC,s),c.default.log("Failed to handleCandidate, ",s),[3,4];case 4:return[2]}}))}))},e.prototype._addTracksToConnection=function(e,t){if(c.default.log("add tracks from stream "+e.id+" to peer connection"),!t.addTrack)return c.default.error("Your browser does't support RTCPeerConnection#addTrack. Ignored.");e.getTracks().forEach((function(r){t.addTrack(r,e)}))},e.prototype._addStreamToMediaConnection=function(e,t){c.default.log("add stream "+e.id+" to media connection "+t.connectionId),t.addStream(e)},e}();r.Negotiator=p},{"./util":"BHXf","./logger":"WOs9","./enums":"ZRYf"}],tQFK:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0}),r.BaseConnection=void 0;var o=function(e){function t(t,r,n){var o=e.call(this)||this;return o.peer=t,o.provider=r,o.options=n,o._open=!1,o.metadata=n.metadata,o}return n(t,e),Object.defineProperty(t.prototype,"open",{get:function(){return this._open},enumerable:!1,configurable:!0}),t}(e("eventemitter3").EventEmitter);r.BaseConnection=o},{eventemitter3:"JJlS"}],dbHP:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.MediaConnection=void 0;var s=e("./util"),c=a(e("./logger")),d=e("./negotiator"),p=e("./enums"),u=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i._localStream=i.options._stream,i.connectionId=i.options.connectionId||t.ID_PREFIX+s.util.randomToken(),i._negotiator=new d.Negotiator(i),i._localStream&&i._negotiator.startConnection({_stream:i._localStream,originator:!0}),i}return n(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return p.ConnectionType.Media},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localStream",{get:function(){return this._localStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remoteStream",{get:function(){return this._remoteStream},enumerable:!1,configurable:!0}),t.prototype.addStream=function(t){c.default.log("Receiving stream",t),this._remoteStream=t,e.prototype.emit.call(this,p.ConnectionEventType.Stream,t)},t.prototype.handleMessage=function(e){var t=e.type,r=e.payload;switch(e.type){case p.ServerMessageType.Answer:this._negotiator.handleSDP(t,r.sdp),this._open=!0;break;case p.ServerMessageType.Candidate:this._negotiator.handleCandidate(r.candidate);break;default:c.default.warn("Unrecognized message type:"+t+" from peer:"+this.peer)}},t.prototype.answer=function(e,t){var r,n;if(void 0===t&&(t={}),this._localStream)c.default.warn("Local stream already exists on this MediaConnection. Are you answering a call twice?");else{this._localStream=e,t&&t.sdpTransform&&(this.options.sdpTransform=t.sdpTransform),this._negotiator.startConnection(o(o({},this.options._payload),{_stream:e}));var a=this.provider._getMessages(this.connectionId);try{for(var s=i(a),d=s.next();!d.done;d=s.next()){var p=d.value;this.handleMessage(p)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}this._open=!0}},t.prototype.close=function(){this._negotiator&&(this._negotiator.cleanup(),this._negotiator=null),this._localStream=null,this._remoteStream=null,this.provider&&(this.provider._removeConnection(this),this.provider=null),this.options&&this.options._stream&&(this.options._stream=null),this.open&&(this._open=!1,e.prototype.emit.call(this,p.ConnectionEventType.Close))},t.ID_PREFIX="mc_",t}(e("./baseconnection").BaseConnection);r.MediaConnection=u},{"./util":"BHXf","./logger":"WOs9","./negotiator":"HCdX","./enums":"ZRYf","./baseconnection":"tQFK"}],GGp6:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.EncodingQueue=void 0;var i=e("eventemitter3"),a=o(e("./logger")),s=function(e){function t(){var t=e.call(this)||this;return t.fileReader=new FileReader,t._queue=[],t._processing=!1,t.fileReader.onload=function(e){t._processing=!1,e.target&&t.emit("done",e.target.result),t.doNextTask()},t.fileReader.onerror=function(e){a.default.error("EncodingQueue error:",e),t._processing=!1,t.destroy(),t.emit("error",e)},t}return n(t,e),Object.defineProperty(t.prototype,"queue",{get:function(){return this._queue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"processing",{get:function(){return this._processing},enumerable:!1,configurable:!0}),t.prototype.enque=function(e){this.queue.push(e),this.processing||this.doNextTask()},t.prototype.destroy=function(){this.fileReader.abort(),this._queue=[]},t.prototype.doNextTask=function(){0!==this.size&&(this.processing||(this._processing=!0,this.fileReader.readAsArrayBuffer(this.queue.shift())))},t}(i.EventEmitter);r.EncodingQueue=s},{eventemitter3:"JJlS","./logger":"WOs9"}],GBTQ:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.DataConnection=void 0;var a=e("./util"),s=i(e("./logger")),c=e("./negotiator"),d=e("./enums"),p=e("./baseconnection"),u=e("./encodingQueue"),l=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i.stringify=JSON.stringify,i.parse=JSON.parse,i._buffer=[],i._bufferSize=0,i._buffering=!1,i._chunkedData={},i._encodingQueue=new u.EncodingQueue,i.connectionId=i.options.connectionId||t.ID_PREFIX+a.util.randomToken(),i.label=i.options.label||i.connectionId,i.serialization=i.options.serialization||d.SerializationType.Binary,i.reliable=!!i.options.reliable,i._encodingQueue.on("done",(function(e){i._bufferedSend(e)})),i._encodingQueue.on("error",(function(){s.default.error("DC#"+i.connectionId+": Error occured in encoding from blob to arraybuffer, close DC"),i.close()})),i._negotiator=new c.Negotiator(i),i._negotiator.startConnection(i.options._payload||{originator:!0}),i}return n(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return d.ConnectionType.Data},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataChannel",{get:function(){return this._dc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bufferSize",{get:function(){return this._bufferSize},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){this._dc=e,this._configureDataChannel()},t.prototype._configureDataChannel=function(){var e=this;a.util.supports.binaryBlob&&!a.util.supports.reliable||(this.dataChannel.binaryType="arraybuffer"),this.dataChannel.onopen=function(){s.default.log("DC#"+e.connectionId+" dc connection success"),e._open=!0,e.emit(d.ConnectionEventType.Open)},this.dataChannel.onmessage=function(t){s.default.log("DC#"+e.connectionId+" dc onmessage:",t.data),e._handleDataMessage(t)},this.dataChannel.onclose=function(){s.default.log("DC#"+e.connectionId+" dc closed for:",e.peer),e.close()}},t.prototype._handleDataMessage=function(t){var r=this,n=t.data,o=n.constructor,i=n;if(this.serialization===d.SerializationType.Binary||this.serialization===d.SerializationType.BinaryUTF8){if(o===Blob)return void a.util.blobToArrayBuffer(n,(function(e){var t=a.util.unpack(e);r.emit(d.ConnectionEventType.Data,t)}));if(o===ArrayBuffer)i=a.util.unpack(n);else if(o===String){var s=a.util.binaryStringToArrayBuffer(n);i=a.util.unpack(s)}}else this.serialization===d.SerializationType.JSON&&(i=this.parse(n));i.__peerData?this._handleChunk(i):e.prototype.emit.call(this,d.ConnectionEventType.Data,i)},t.prototype._handleChunk=function(e){var t=e.__peerData,r=this._chunkedData[t]||{data:[],count:0,total:e.total};if(r.data[e.n]=e.data,r.count++,this._chunkedData[t]=r,r.total===r.count){delete this._chunkedData[t];var n=new Blob(r.data);this._handleDataMessage({data:n})}},t.prototype.close=function(){this._buffer=[],this._bufferSize=0,this._chunkedData={},this._negotiator&&(this._negotiator.cleanup(),this._negotiator=null),this.provider&&(this.provider._removeConnection(this),this.provider=null),this.dataChannel&&(this.dataChannel.onopen=null,this.dataChannel.onmessage=null,this.dataChannel.onclose=null,this._dc=null),this._encodingQueue&&(this._encodingQueue.destroy(),this._encodingQueue.removeAllListeners(),this._encodingQueue=null),this.open&&(this._open=!1,e.prototype.emit.call(this,d.ConnectionEventType.Close))},t.prototype.send=function(t,r){if(this.open)if(this.serialization===d.SerializationType.JSON)this._bufferedSend(this.stringify(t));else if(this.serialization===d.SerializationType.Binary||this.serialization===d.SerializationType.BinaryUTF8){var n=a.util.pack(t);if(!r&&n.size>a.util.chunkedMTU)return void this._sendChunks(n);a.util.supports.binaryBlob?this._bufferedSend(n):this._encodingQueue.enque(n)}else this._bufferedSend(t);else e.prototype.emit.call(this,d.ConnectionEventType.Error,new Error("Connection is not open. You should listen for the `open` event before sending messages."))},t.prototype._bufferedSend=function(e){!this._buffering&&this._trySend(e)||(this._buffer.push(e),this._bufferSize=this._buffer.length)},t.prototype._trySend=function(e){var r=this;if(!this.open)return!1;if(this.dataChannel.bufferedAmount>t.MAX_BUFFERED_AMOUNT)return this._buffering=!0,setTimeout((function(){r._buffering=!1,r._tryBuffer()}),50),!1;try{this.dataChannel.send(e)}catch(e){return s.default.error("DC#:"+this.connectionId+" Error when sending:",e),this._buffering=!0,this.close(),!1}return!0},t.prototype._tryBuffer=function(){if(this.open&&0!==this._buffer.length){var e=this._buffer[0];this._trySend(e)&&(this._buffer.shift(),this._bufferSize=this._buffer.length,this._tryBuffer())}},t.prototype._sendChunks=function(e){var t,r,n=a.util.chunk(e);s.default.log("DC#"+this.connectionId+" Try to send "+n.length+" chunks...");try{for(var i=o(n),c=i.next();!c.done;c=i.next()){var d=c.value;this.send(d,!0)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.prototype.handleMessage=function(e){var t=e.payload;switch(e.type){case d.ServerMessageType.Answer:this._negotiator.handleSDP(e.type,t.sdp);break;case d.ServerMessageType.Candidate:this._negotiator.handleCandidate(t.candidate);break;default:s.default.warn("Unrecognized message type:",e.type,"from peer:",this.peer)}},t.ID_PREFIX="dc_",t.MAX_BUFFERED_AMOUNT=8388608,t}(p.BaseConnection);r.DataConnection=l},{"./util":"BHXf","./logger":"WOs9","./negotiator":"HCdX","./enums":"ZRYf","./baseconnection":"tQFK","./encodingQueue":"GGp6"}],in7L:[function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.API=void 0;var a=e("./util"),s=i(e("./logger")),c=function(){function e(e){this._options=e}return e.prototype._buildUrl=function(e){return(this._options.secure?"https://":"http://")+this._options.host+":"+this._options.port+this._options.path+this._options.key+"/"+e+"?ts="+(new Date).getTime()+Math.random()},e.prototype.retrieveId=function(){return n(this,void 0,Promise,(function(){var e,t,r,n;return o(this,(function(o){switch(o.label){case 0:e=this._buildUrl("id"),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,fetch(e)];case 2:if(200!==(t=o.sent()).status)throw new Error("Error. Status:"+t.status);return[2,t.text()];case 3:throw r=o.sent(),s.default.error("Error retrieving ID",r),n="","/"===this._options.path&&this._options.host!==a.util.CLOUD_HOST&&(n=" If you passed in a `path` to your self-hosted PeerServer, you'll also need to pass in that same path when creating a new Peer."),new Error("Could not get an ID from the server."+n);case 4:return[2]}}))}))},e.prototype.listAllPeers=function(){return n(this,void 0,Promise,(function(){var e,t,r,n;return o(this,(function(o){switch(o.label){case 0:e=this._buildUrl("peers"),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,fetch(e)];case 2:if(200!==(t=o.sent()).status){if(401===t.status)throw r=this._options.host===a.util.CLOUD_HOST?"It looks like you're using the cloud server. You can email team@peerjs.com to enable peer listing for your API key.":"You need to enable `allow_discovery` on your self-hosted PeerServer to use this feature.",new Error("It doesn't look like you have permission to list peers IDs. "+r);throw new Error("Error. Status:"+t.status)}return[2,t.json()];case 3:throw n=o.sent(),s.default.error("Error retrieving list peers",n),new Error("Could not get list peers from the server."+n);case 4:return[2]}}))}))},e}();r.API=c},{"./util":"BHXf","./logger":"WOs9"}],Hxpd:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.Peer=void 0;var c=e("eventemitter3"),d=e("./util"),p=s(e("./logger")),u=e("./socket"),l=e("./mediaconnection"),h=e("./dataconnection"),f=e("./enums"),m=e("./api"),g=function(e){function t(r,n){var i,a=e.call(this)||this;return a._id=null,a._lastServerId=null,a._destroyed=!1,a._disconnected=!1,a._open=!1,a._connections=new Map,a._lostMessages=new Map,r&&r.constructor==Object?n=r:r&&(i=r.toString()),n=o({debug:0,host:d.util.CLOUD_HOST,port:d.util.CLOUD_PORT,path:"/",key:t.DEFAULT_KEY,token:d.util.randomToken(),config:d.util.defaultConfig},n),a._options=n,"/"===a._options.host&&(a._options.host=window.location.hostname),a._options.path&&("/"!==a._options.path[0]&&(a._options.path="/"+a._options.path),"/"!==a._options.path[a._options.path.length-1]&&(a._options.path+="/")),void 0===a._options.secure&&a._options.host!==d.util.CLOUD_HOST?a._options.secure=d.util.isSecure():a._options.host==d.util.CLOUD_HOST&&(a._options.secure=!0),a._options.logFunction&&p.default.setLogFunction(a._options.logFunction),p.default.logLevel=a._options.debug||0,a._api=new m.API(n),a._socket=a._createServerConnection(),d.util.supports.audioVideo||d.util.supports.data?i&&!d.util.validateId(i)?(a._delayedAbort(f.PeerErrorType.InvalidID,'ID "'+i+'" is invalid'),a):(i?a._initialize(i):a._api.retrieveId().then((function(e){return a._initialize(e)})).catch((function(e){return a._abort(f.PeerErrorType.ServerError,e)})),a):(a._delayedAbort(f.PeerErrorType.BrowserIncompatible,"The current browser does not support WebRTC"),a)}return n(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"open",{get:function(){return this._open},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"socket",{get:function(){return this._socket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connections",{get:function(){var e,t,r=Object.create(null);try{for(var n=i(this._connections),o=n.next();!o.done;o=n.next()){var s=a(o.value,2),c=s[0],d=s[1];r[c]=d}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disconnected",{get:function(){return this._disconnected},enumerable:!1,configurable:!0}),t.prototype._createServerConnection=function(){var e=this,t=new u.Socket(this._options.secure,this._options.host,this._options.port,this._options.path,this._options.key,this._options.pingInterval);return t.on(f.SocketEventType.Message,(function(t){e._handleMessage(t)})),t.on(f.SocketEventType.Error,(function(t){e._abort(f.PeerErrorType.SocketError,t)})),t.on(f.SocketEventType.Disconnected,(function(){e.disconnected||(e.emitError(f.PeerErrorType.Network,"Lost connection to server."),e.disconnect())})),t.on(f.SocketEventType.Close,(function(){e.disconnected||e._abort(f.PeerErrorType.SocketClosed,"Underlying socket is already closed.")})),t},t.prototype._initialize=function(e){this._id=e,this.socket.start(e,this._options.token)},t.prototype._handleMessage=function(e){var t,r,n=e.type,o=e.payload,a=e.src;switch(n){case f.ServerMessageType.Open:this._lastServerId=this.id,this._open=!0,this.emit(f.PeerEventType.Open,this.id);break;case f.ServerMessageType.Error:this._abort(f.PeerErrorType.ServerError,o.msg);break;case f.ServerMessageType.IdTaken:this._abort(f.PeerErrorType.UnavailableID,'ID "'+this.id+'" is taken');break;case f.ServerMessageType.InvalidKey:this._abort(f.PeerErrorType.InvalidKey,'API KEY "'+this._options.key+'" is invalid');break;case f.ServerMessageType.Leave:p.default.log("Received leave message from "+a),this._cleanupPeer(a),this._connections.delete(a);break;case f.ServerMessageType.Expire:this.emitError(f.PeerErrorType.PeerUnavailable,"Could not connect to peer "+a);break;case f.ServerMessageType.Offer:var s=o.connectionId;if((g=this.getConnection(a,s))&&(g.close(),p.default.warn("Offer received for existing Connection ID:"+s)),o.type===f.ConnectionType.Media)g=new l.MediaConnection(a,this,{connectionId:s,_payload:o,metadata:o.metadata}),this._addConnection(a,g),this.emit(f.PeerEventType.Call,g);else{if(o.type!==f.ConnectionType.Data)return void p.default.warn("Received malformed connection type:"+o.type);g=new h.DataConnection(a,this,{connectionId:s,_payload:o,metadata:o.metadata,label:o.label,serialization:o.serialization,reliable:o.reliable}),this._addConnection(a,g),this.emit(f.PeerEventType.Connection,g)}var c=this._getMessages(s);try{for(var d=i(c),u=d.next();!u.done;u=d.next()){var m=u.value;g.handleMessage(m)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}break;default:if(!o)return void p.default.warn("You received a malformed message from "+a+" of type "+n);var g;s=o.connectionId,(g=this.getConnection(a,s))&&g.peerConnection?g.handleMessage(e):s?this._storeMessage(s,e):p.default.warn("You received an unrecognized message:",e)}},t.prototype._storeMessage=function(e,t){this._lostMessages.has(e)||this._lostMessages.set(e,[]),this._lostMessages.get(e).push(t)},t.prototype._getMessages=function(e){var t=this._lostMessages.get(e);return t?(this._lostMessages.delete(e),t):[]},t.prototype.connect=function(e,t){if(void 0===t&&(t={}),this.disconnected)return p.default.warn("You cannot connect to a new Peer because you called .disconnect() on this Peer and ended your connection with the server. You can create a new Peer to reconnect, or call reconnect on this peer if you believe its ID to still be available."),void this.emitError(f.PeerErrorType.Disconnected,"Cannot connect to new Peer after disconnecting from server.");var r=new h.DataConnection(e,this,t);return this._addConnection(e,r),r},t.prototype.call=function(e,t,r){if(void 0===r&&(r={}),this.disconnected)return p.default.warn("You cannot connect to a new Peer because you called .disconnect() on this Peer and ended your connection with the server. You can create a new Peer to reconnect."),void this.emitError(f.PeerErrorType.Disconnected,"Cannot connect to new Peer after disconnecting from server.");if(t){r._stream=t;var n=new l.MediaConnection(e,this,r);return this._addConnection(e,n),n}p.default.error("To call a peer, you must provide a stream from your browser's `getUserMedia`.")},t.prototype._addConnection=function(e,t){p.default.log("add connection "+t.type+":"+t.connectionId+" to peerId:"+e),this._connections.has(e)||this._connections.set(e,[]),this._connections.get(e).push(t)},t.prototype._removeConnection=function(e){var t=this._connections.get(e.peer);if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}this._lostMessages.delete(e.connectionId)},t.prototype.getConnection=function(e,t){var r,n,o=this._connections.get(e);if(!o)return null;try{for(var a=i(o),s=a.next();!s.done;s=a.next()){var c=s.value;if(c.connectionId===t)return c}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return null},t.prototype._delayedAbort=function(e,t){var r=this;setTimeout((function(){r._abort(e,t)}),0)},t.prototype._abort=function(e,t){p.default.error("Aborting!"),this.emitError(e,t),this._lastServerId?this.disconnect():this.destroy()},t.prototype.emitError=function(e,t){var r;p.default.error("Error:",t),(r="string"==typeof t?new Error(t):t).type=e,this.emit(f.PeerEventType.Error,r)},t.prototype.destroy=function(){this.destroyed||(p.default.log("Destroy peer with ID:"+this.id),this.disconnect(),this._cleanup(),this._destroyed=!0,this.emit(f.PeerEventType.Close))},t.prototype._cleanup=function(){var e,t;try{for(var r=i(this._connections.keys()),n=r.next();!n.done;n=r.next()){var o=n.value;this._cleanupPeer(o),this._connections.delete(o)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.socket.removeAllListeners()},t.prototype._cleanupPeer=function(e){var t,r,n=this._connections.get(e);if(n)try{for(var o=i(n),a=o.next();!a.done;a=o.next())a.value.close()}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},t.prototype.disconnect=function(){if(!this.disconnected){var e=this.id;p.default.log("Disconnect peer with ID:"+e),this._disconnected=!0,this._open=!1,this.socket.close(),this._lastServerId=e,this._id=null,this.emit(f.PeerEventType.Disconnected,e)}},t.prototype.reconnect=function(){if(this.disconnected&&!this.destroyed)p.default.log("Attempting reconnection to server with ID "+this._lastServerId),this._disconnected=!1,this._initialize(this._lastServerId);else{if(this.destroyed)throw new Error("This peer cannot reconnect to the server. It has already been destroyed.");if(this.disconnected||this.open)throw new Error("Peer "+this.id+" cannot reconnect because it is not disconnected from the server!");p.default.error("In a hurry? We're still trying to make the initial connection!")}},t.prototype.listAllPeers=function(e){var t=this;void 0===e&&(e=function(e){}),this._api.listAllPeers().then((function(t){return e(t)})).catch((function(e){return t._abort(f.PeerErrorType.ServerError,e)}))},t.DEFAULT_KEY="peerjs",t}(c.EventEmitter);r.Peer=g},{eventemitter3:"JJlS","./util":"BHXf","./logger":"WOs9","./socket":"wJlv","./mediaconnection":"dbHP","./dataconnection":"GBTQ","./enums":"ZRYf","./api":"in7L"}],iTK6:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.peerjs=void 0;var n=e("./util"),o=e("./peer");r.peerjs={Peer:o.Peer,util:n.util},r.default=o.Peer,window.peerjs=r.peerjs,window.Peer=o.Peer},{"./util":"BHXf","./peer":"Hxpd"}]},{},["iTK6"])},784:function(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=function(){return[]},t.resolve=t,t.id=784,e.exports=t},592:function(e,t,r){const n=r(138),o=r(115),i=r(907),a=r(776);function s(e,t,r,i,a){const s=[].slice.call(arguments,1),c=s.length,d="function"==typeof s[c-1];if(!d&&!n())throw new Error("Callback required as last argument");if(!d){if(c<1)throw new Error("Too few arguments provided");return 1===c?(r=t,t=i=void 0):2!==c||t.getContext||(i=r,r=t,t=void 0),new Promise((function(n,a){try{const a=o.create(r,i);n(e(a,t,i))}catch(e){a(e)}}))}if(c<2)throw new Error("Too few arguments provided");2===c?(a=r,r=t,t=i=void 0):3===c&&(t.getContext&&void 0===a?(a=i,i=void 0):(a=i,i=r,r=t,t=void 0));try{const n=o.create(r,i);a(null,e(n,t,i))}catch(e){a(e)}}t.create=o.create,t.toCanvas=s.bind(null,i.render),t.toDataURL=s.bind(null,i.renderToDataURL),t.toString=s.bind(null,(function(e,t,r){return a.render(e,r)}))},138:function(e){e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},845:function(e,t,r){const n=r(242).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=n(e),o=145===r?26:2*Math.ceil((r-13)/(2*t-2)),i=[r-7];for(let e=1;e<t-1;e++)i[e]=i[e-1]-o;return i.push(6),i.reverse()},t.getPositions=function(e){const r=[],n=t.getRowColCoords(e),o=n.length;for(let e=0;e<o;e++)for(let t=0;t<o;t++)0===e&&0===t||0===e&&t===o-1||e===o-1&&0===t||r.push([n[e],n[t]]);return r}},260:function(e,t,r){const n=r(910),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*o.indexOf(this.data[t]);r+=o.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(o.indexOf(this.data[t]),6)},e.exports=i},245:function(e){function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r<t;r++)this.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},280:function(e){function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,r,n){const o=e*this.size+t;this.data[o]=r,n&&(this.reservedBit[o]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},424:function(e,t,r){const n=r(378),o=r(910);function i(e){this.mode=o.BYTE,this.data=new Uint8Array(n(e))}i.getBitsLength=function(e){return 8*e},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},e.exports=i},393:function(e,t,r){const n=r(908),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case n.L:return o[4*(e-1)+0];case n.M:return o[4*(e-1)+1];case n.Q:return o[4*(e-1)+2];case n.H:return o[4*(e-1)+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case n.L:return i[4*(e-1)+0];case n.M:return i[4*(e-1)+1];case n.Q:return i[4*(e-1)+2];case n.H:return i[4*(e-1)+3];default:return}}},908:function(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return r}}},526:function(e,t,r){const n=r(242).getSymbolSize;t.getPositions=function(e){const t=n(e);return[[0,0],[t-7,0],[0,t-7]]}},642:function(e,t,r){const n=r(242),o=n.getBCHDigit(1335);t.getEncodedBits=function(e,t){const r=e.bit<<3|t;let i=r<<10;for(;n.getBCHDigit(i)-o>=0;)i^=1335<<n.getBCHDigit(i)-o;return 21522^(r<<10|i)}},729:function(e,t){const r=new Uint8Array(512),n=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)r[t]=e,n[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)r[e]=r[e-255]}(),t.log=function(e){if(e<1)throw new Error("log("+e+")");return n[e]},t.exp=function(e){return r[e]},t.mul=function(e,t){return 0===e||0===t?0:r[n[e]+n[t]]}},442:function(e,t,r){const n=r(910),o=r(242);function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return 13*e},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=o.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},e.exports=i},126:function(e,t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function r(e,r,n){switch(e){case t.Patterns.PATTERN000:return(r+n)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return n%3==0;case t.Patterns.PATTERN011:return(r+n)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case t.Patterns.PATTERN101:return r*n%2+r*n%3==0;case t.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case t.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let r=0,n=0,o=0,i=null,a=null;for(let s=0;s<t;s++){n=o=0,i=a=null;for(let c=0;c<t;c++){let t=e.get(s,c);t===i?n++:(n>=5&&(r+=n-5+3),i=t,n=1),t=e.get(c,s),t===a?o++:(o>=5&&(r+=o-5+3),a=t,o=1)}n>=5&&(r+=n-5+3),o>=5&&(r+=o-5+3)}return r},t.getPenaltyN2=function(e){const t=e.size;let r=0;for(let n=0;n<t-1;n++)for(let o=0;o<t-1;o++){const t=e.get(n,o)+e.get(n,o+1)+e.get(n+1,o)+e.get(n+1,o+1);4!==t&&0!==t||r++}return 3*r},t.getPenaltyN3=function(e){const t=e.size;let r=0,n=0,o=0;for(let i=0;i<t;i++){n=o=0;for(let a=0;a<t;a++)n=n<<1&2047|e.get(i,a),a>=10&&(1488===n||93===n)&&r++,o=o<<1&2047|e.get(a,i),a>=10&&(1488===o||93===o)&&r++}return 40*r},t.getPenaltyN4=function(e){let t=0;const r=e.data.length;for(let n=0;n<r;n++)t+=e.data[n];return 10*Math.abs(Math.ceil(100*t/r/5)-10)},t.applyMask=function(e,t){const n=t.size;for(let o=0;o<n;o++)for(let i=0;i<n;i++)t.isReserved(i,o)||t.xor(i,o,r(e,i,o))},t.getBestMask=function(e,r){const n=Object.keys(t.Patterns).length;let o=0,i=1/0;for(let a=0;a<n;a++){r(a),t.applyMask(a,e);const n=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(a,e),n<i&&(i=n,o=a)}return o}},910:function(e,t,r){const n=r(114),o=r(7);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!n.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return o.testNumeric(e)?t.NUMERIC:o.testAlphanumeric(e)?t.ALPHANUMERIC:o.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return r}}},85:function(e,t,r){const n=r(910);function o(e){this.mode=n.NUMERIC,this.data=e.toString()}o.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);const o=this.data.length-t;o>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*o+1))},e.exports=o},143:function(e,t,r){const n=r(729);t.mul=function(e,t){const r=new Uint8Array(e.length+t.length-1);for(let o=0;o<e.length;o++)for(let i=0;i<t.length;i++)r[o+i]^=n.mul(e[o],t[i]);return r},t.mod=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){const e=r[0];for(let o=0;o<t.length;o++)r[o]^=n.mul(t[o],e);let o=0;for(;o<r.length&&0===r[o];)o++;r=r.slice(o)}return r},t.generateECPolynomial=function(e){let r=new Uint8Array([1]);for(let o=0;o<e;o++)r=t.mul(r,new Uint8Array([1,n.exp(o)]));return r}},115:function(e,t,r){const n=r(242),o=r(908),i=r(245),a=r(280),s=r(845),c=r(526),d=r(126),p=r(393),u=r(882),l=r(103),h=r(642),f=r(910),m=r(130);function g(e,t,r){const n=e.size,o=h.getEncodedBits(t,r);let i,a;for(i=0;i<15;i++)a=1==(o>>i&1),i<6?e.set(i,8,a,!0):i<8?e.set(i+1,8,a,!0):e.set(n-15+i,8,a,!0),i<8?e.set(8,n-i-1,a,!0):i<9?e.set(8,15-i-1+1,a,!0):e.set(8,15-i-1,a,!0);e.set(n-8,8,1,!0)}function y(e,t,r,o){let h;if(Array.isArray(e))h=m.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=m.rawSplit(e);n=l.getBestVersionForData(t,r)}h=m.fromString(e,n||40)}}const y=l.getBestVersionForData(h,r);if(!y)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<y)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+y+".\n")}else t=y;const E=function(e,t,r){const o=new i;r.forEach((function(t){o.put(t.mode.bit,4),o.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(o)}));const a=8*(n.getSymbolTotalCodewords(e)-p.getTotalCodewordsCount(e,t));for(o.getLengthInBits()+4<=a&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);const s=(a-o.getLengthInBits())/8;for(let e=0;e<s;e++)o.put(e%2?17:236,8);return function(e,t,r){const o=n.getSymbolTotalCodewords(t),i=o-p.getTotalCodewordsCount(t,r),a=p.getBlocksCount(t,r),s=a-o%a,c=Math.floor(o/a),d=Math.floor(i/a),l=d+1,h=c-d,f=new u(h);let m=0;const g=new Array(a),y=new Array(a);let E=0;const v=new Uint8Array(e.buffer);for(let e=0;e<a;e++){const t=e<s?d:l;g[e]=v.slice(m,m+t),y[e]=f.encode(g[e]),m+=t,E=Math.max(E,t)}const _=new Uint8Array(o);let T,w,b=0;for(T=0;T<E;T++)for(w=0;w<a;w++)T<g[w].length&&(_[b++]=g[w][T]);for(T=0;T<h;T++)for(w=0;w<a;w++)_[b++]=y[w][T];return _}(o,e,t)}(t,r,h),v=n.getSymbolSize(t),_=new a(v);return function(e,t){const r=e.size,n=c.getPositions(t);for(let t=0;t<n.length;t++){const o=n[t][0],i=n[t][1];for(let t=-1;t<=7;t++)if(!(o+t<=-1||r<=o+t))for(let n=-1;n<=7;n++)i+n<=-1||r<=i+n||(t>=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(o+t,i+n,!0,!0):e.set(o+t,i+n,!1,!0))}}(_,t),function(e){const t=e.size;for(let r=8;r<t-8;r++){const t=r%2==0;e.set(r,6,t,!0),e.set(6,r,t,!0)}}(_),function(e,t){const r=s.getPositions(t);for(let t=0;t<r.length;t++){const n=r[t][0],o=r[t][1];for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)-2===t||2===t||-2===r||2===r||0===t&&0===r?e.set(n+t,o+r,!0,!0):e.set(n+t,o+r,!1,!0)}}(_,t),g(_,r,0),t>=7&&function(e,t){const r=e.size,n=l.getEncodedBits(t);let o,i,a;for(let t=0;t<18;t++)o=Math.floor(t/3),i=t%3+r-8-3,a=1==(n>>t&1),e.set(o,i,a,!0),e.set(i,o,a,!0)}(_,t),function(e,t){const r=e.size;let n=-1,o=r-1,i=7,a=0;for(let s=r-1;s>0;s-=2)for(6===s&&s--;;){for(let r=0;r<2;r++)if(!e.isReserved(o,s-r)){let n=!1;a<t.length&&(n=1==(t[a]>>>i&1)),e.set(o,s-r,n),i--,-1===i&&(a++,i=7)}if(o+=n,o<0||r<=o){o-=n,n=-n;break}}}(_,E),isNaN(o)&&(o=d.getBestMask(_,g.bind(null,_,r))),d.applyMask(o,_),g(_,r,o),{modules:_,version:t,errorCorrectionLevel:r,maskPattern:o,segments:h}}t.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,i,a=o.M;return void 0!==t&&(a=o.from(t.errorCorrectionLevel,o.M),r=l.from(t.version),i=d.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),y(e,r,a,i)}},882:function(e,t,r){const n=r(143);function o(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}o.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},o.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=n.mod(t,this.genPoly),o=this.degree-r.length;if(o>0){const e=new Uint8Array(this.degree);return e.set(r,o),e}return r},e.exports=o},7:function(e,t){let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+")(?:.|[\r\n]))+";t.KANJI=new RegExp(r,"g"),t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=new RegExp(n,"g"),t.NUMERIC=new RegExp("[0-9]+","g"),t.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const o=new RegExp("^"+r+"$"),i=new RegExp("^[0-9]+$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return o.test(e)},t.testNumeric=function(e){return i.test(e)},t.testAlphanumeric=function(e){return a.test(e)}},130:function(e,t,r){const n=r(910),o=r(85),i=r(260),a=r(424),s=r(442),c=r(7),d=r(242),p=r(987);function u(e){return unescape(encodeURIComponent(e)).length}function l(e,t,r){const n=[];let o;for(;null!==(o=e.exec(r));)n.push({data:o[0],index:o.index,mode:t,length:o[0].length});return n}function h(e){const t=l(c.NUMERIC,n.NUMERIC,e),r=l(c.ALPHANUMERIC,n.ALPHANUMERIC,e);let o,i;return d.isKanjiModeEnabled()?(o=l(c.BYTE,n.BYTE,e),i=l(c.KANJI,n.KANJI,e)):(o=l(c.BYTE_KANJI,n.BYTE,e),i=[]),t.concat(r,o,i).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function f(e,t){switch(t){case n.NUMERIC:return o.getBitsLength(e);case n.ALPHANUMERIC:return i.getBitsLength(e);case n.KANJI:return s.getBitsLength(e);case n.BYTE:return a.getBitsLength(e)}}function m(e,t){let r;const c=n.getBestModeForData(e);if(r=n.from(t,c),r!==n.BYTE&&r.bit<c.bit)throw new Error('"'+e+'" cannot be encoded with mode '+n.toString(r)+".\n Suggested mode is: "+n.toString(c));switch(r!==n.KANJI||d.isKanjiModeEnabled()||(r=n.BYTE),r){case n.NUMERIC:return new o(e);case n.ALPHANUMERIC:return new i(e);case n.KANJI:return new s(e);case n.BYTE:return new a(e)}}t.fromArray=function(e){return e.reduce((function(e,t){return"string"==typeof t?e.push(m(t,null)):t.data&&e.push(m(t.data,t.mode)),e}),[])},t.fromString=function(e,r){const o=function(e,t){const r={},o={start:{}};let i=["start"];for(let a=0;a<e.length;a++){const s=e[a],c=[];for(let e=0;e<s.length;e++){const d=s[e],p=""+a+e;c.push(p),r[p]={node:d,lastCount:0},o[p]={};for(let e=0;e<i.length;e++){const a=i[e];r[a]&&r[a].node.mode===d.mode?(o[a][p]=f(r[a].lastCount+d.length,d.mode)-f(r[a].lastCount,d.mode),r[a].lastCount+=d.length):(r[a]&&(r[a].lastCount=d.length),o[a][p]=f(d.length,d.mode)+4+n.getCharCountIndicator(d.mode,t))}}i=c}for(let e=0;e<i.length;e++)o[i[e]].end=0;return{map:o,table:r}}(function(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r];switch(o.mode){case n.NUMERIC:t.push([o,{data:o.data,mode:n.ALPHANUMERIC,length:o.length},{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.ALPHANUMERIC:t.push([o,{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.KANJI:t.push([o,{data:o.data,mode:n.BYTE,length:u(o.data)}]);break;case n.BYTE:t.push([{data:o.data,mode:n.BYTE,length:u(o.data)}])}}return t}(h(e,d.isKanjiModeEnabled())),r),i=p.find_path(o.map,"start","end"),a=[];for(let e=1;e<i.length-1;e++)a.push(o.table[i[e]].node);return t.fromArray(a.reduce((function(e,t){const r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[]))},t.rawSplit=function(e){return t.fromArray(h(e,d.isKanjiModeEnabled()))}},242:function(e,t){let r;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return n[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');r=e},t.isKanjiModeEnabled=function(){return void 0!==r},t.toSJIS=function(e){return r(e)}},114:function(e,t){t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},103:function(e,t,r){const n=r(242),o=r(393),i=r(908),a=r(910),s=r(114),c=n.getBCHDigit(7973);function d(e,t){return a.getCharCountIndicator(e,t)+4}function p(e,t){let r=0;return e.forEach((function(e){const n=d(e.mode,t);r+=n+e.getBitsLength()})),r}t.from=function(e,t){return s.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!s.isValid(e))throw new Error("Invalid QR Code version");void 0===r&&(r=a.BYTE);const i=8*(n.getSymbolTotalCodewords(e)-o.getTotalCodewordsCount(e,t));if(r===a.MIXED)return i;const c=i-d(r,e);switch(r){case a.NUMERIC:return Math.floor(c/10*3);case a.ALPHANUMERIC:return Math.floor(c/11*2);case a.KANJI:return Math.floor(c/13);case a.BYTE:default:return Math.floor(c/8)}},t.getBestVersionForData=function(e,r){let n;const o=i.from(r,i.M);if(Array.isArray(e)){if(e.length>1)return function(e,r){for(let n=1;n<=40;n++)if(p(e,n)<=t.getCapacity(n,r,a.MIXED))return n}(e,o);if(0===e.length)return 1;n=e[0]}else n=e;return function(e,r,n){for(let o=1;o<=40;o++)if(r<=t.getCapacity(o,n,e))return o}(n.mode,n.getLength(),o)},t.getEncodedBits=function(e){if(!s.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;n.getBCHDigit(t)-c>=0;)t^=7973<<n.getBCHDigit(t)-c;return e<<12|t}},907:function(e,t,r){const n=r(653);t.render=function(e,t,r){let o=r,i=t;void 0!==o||t&&t.getContext||(o=t,t=void 0),t||(i=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),o=n.getOptions(o);const a=n.getImageWidth(e.modules.size,o),s=i.getContext("2d"),c=s.createImageData(a,a);return n.qrToImageData(c.data,e,o),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(s,i,a),s.putImageData(c,0,0),i},t.renderToDataURL=function(e,r,n){let o=n;void 0!==o||r&&r.getContext||(o=r,r=void 0),o||(o={});const i=t.render(e,r,o),a=o.type||"image/png",s=o.rendererOpts||{};return i.toDataURL(a,s.quality)}},776:function(e,t,r){const n=r(653);function o(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function i(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}t.render=function(e,t,r){const a=n.getOptions(t),s=e.modules.size,c=e.modules.data,d=s+2*a.margin,p=a.color.light.a?"<path "+o(a.color.light,"fill")+' d="M0 0h'+d+"v"+d+'H0z"/>':"",u="<path "+o(a.color.dark,"stroke")+' d="'+function(e,t,r){let n="",o=0,a=!1,s=0;for(let c=0;c<e.length;c++){const d=Math.floor(c%t),p=Math.floor(c/t);d||a||(a=!0),e[c]?(s++,c>0&&d>0&&e[c-1]||(n+=a?i("M",d+r,.5+p+r):i("m",o,0),o=0,a=!1),d+1<t&&e[c+1]||(n+=i("h",s),s=0)):o++}return n}(c,s,a.margin)+'"/>',l='viewBox="0 0 '+d+" "+d+'"',h='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+l+' shape-rendering="crispEdges">'+p+u+"</svg>\n";return"function"==typeof r&&r(null,h),h}},653:function(e,t){function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,o=e.scale||4;return{width:n,scale:n?4:o,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){const n=t.getScale(e,r);return Math.floor((e+2*r.margin)*n)},t.qrToImageData=function(e,r,n){const o=r.modules.size,i=r.modules.data,a=t.getScale(o,n),s=Math.floor((o+2*n.margin)*a),c=n.margin*a,d=[n.color.light,n.color.dark];for(let t=0;t<s;t++)for(let r=0;r<s;r++){let p=4*(t*s+r),u=n.color.light;t>=c&&r>=c&&t<s-c&&r<s-c&&(u=d[i[Math.floor((t-c)/a)*o+Math.floor((r-c)/a)]?1:0]),e[p++]=u.r,e[p++]=u.g,e[p++]=u.b,e[p]=u.a}}},281:function(e){"use strict";var t,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),n={},o=0,i=0;function a(e){var t="";do{t=r[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function s(){var e=a(+new Date);return e!==t?(o=0,t=e):e+"."+a(o++)}for(;i<64;i++)n[r[i]]=i;s.encode=a,s.decode=function(e){var t=0;for(i=0;i<e.length;i++)t=64*t+n[e.charAt(i)];return t},e.exports=s}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{CalibrationTimedOutError:function(){return d},ImpulseResponseCalibration:function(){return Re},Listener:function(){return p},MissingSpeakerIdError:function(){return c},Speaker:function(){return m},UnsupportedDeviceError:function(){return s},VolumeCalibration:function(){return Pe}});var e={};r.r(e),r.d(e,{Decoder:function(){return he},Encoder:function(){return le},PacketType:function(){return ue},protocol:function(){return pe}});var t=r(391),o=r.n(t);const i={targetElementId:null,siteUrl:null};var a=class{constructor(e=i){this.peer=new(o())({secure:!0,host:"easyeyes-peer-server.herokuapp.com",port:443}),this.conn=null,this.lastPeerId=null,this.targetElement=e.targetElementId,this.siteUrl=e.siteUrl,this.dataStore=[],this.sourceAudioContext=new(window.AudioContext||window.webkitAudioContext||window.audioContext)}displayUpdate=(e,t=!0)=>{if(document.getElementById(this.targetElement)){const r=document.getElementById(this.targetElement);t?r.innerText+=`\n${e}`:r.innerText=e}else console.log("MESSAGE: ",e)};onPeerDisconnected=()=>{this.displayUpdate("Connection lost. Please reconnect"),this.peer.id=this.lastPeerId,this.peer._lastServerId=this.lastPeerId,this.peer.reconnect()};onPeerClose=()=>{this.displayUpdate("Connection closed"),this.conn=null};onPeerError=e=>{this.displayUpdate(e),console.log(`${e}`)};parseURLSearchParams=()=>Object.fromEntries(new URLSearchParams(location.search));queryStringFromObject=e=>Object.keys(e).map((t=>`${t}=${e[t]}`)).join("&");static keypressFeedbackSound="data:audio/mpeg;base64,//uQZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAALAAATlgAXFxcXFxcXFxcuLi4uLi4uLi5FRUVFRUVFRUVdXV1dXV1dXV10dHR0dHR0dHSLi4uLi4uLi4uioqKioqKioqK6urq6urq6urrR0dHR0dHR0dHo6Ojo6Ojo6Oj///////////8AAAA5TEFNRTMuMTAwAaoAAAAALgYAABSAJAZbTgAAgAAAE5YfafL/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//uQZAAAA0YVyhVvQAAAAA0goAABGfWdITn6gAgAADSDAAAAAEWjAwMwMDMFBzCQsw8PMPCwUDgkNMpNzXEoSUTP3s6nJPd4z28k62JNdIwIUHj3nvynRempMmLAo/tff9/3IchyHIch/IxY3SUmG86enD4Pg+fgmfEAIQQcsP+oH//E7/+Ud/1HP/B9AAABMCFFFAAAwDgCyMCVAgQcBQmARAHw0AOGAUgFJgUoL8YKsEvqzGA1APJQAIGBNgDpoBRvQYb6EIGhIkmJg1QA0aH0H4GDBgJ4G55UBpM1AGgUG0wAgOBIUAYJGoGFQ4AkHitxzRSocGMwDYYCwJAWAICgBD8jhwlEqBNsMiAkCBpQY2FxpG61opmucDLrjKi6Fmk5oK9PWVh1DNFM2IaRH/q8mTQgTF4sk0bnv//zEuqRMjYycuuj///5wxZzIvLSMTUxYyZL////86ZBqh4D+QUIABcwBQBLMCmAeTA4wJowO8E2DAeYwQ8CWMDLBHDB1QpIxscoSMwBQJj/WZBA3O4mFMHIAGzAKAVgwmcG8OIV//uSZCIN9VQ4wgd/gAAAAA0g4AABD+S/Di5+qgAAADSAAAAEEzcNTC4yM0m41SLDHAJLSggBKwtKRwb6+IBi4ctbepDskh2KmAgA16NTNrON66ptO40mNa9ayZHVx7zmGPHktZb7vP9xLn4fr+9jeO//8P+z39///9T/////t+d6vf1+c6fP9Hv5cxg4aA4TgkGIYmLbYHGAxaCjHwlM0lwBC4zGwzVG+MFnGoTY8sn0w1MSHA09vAM8ssDCSYAykIABmeCI4AKDMDIRfGbFAjWE8h+BfIEfBoFCTQJUcA5ZIrQDjzQ+gWzxsjDLtE4s46kxjHZZom2SXfyj6uadvNvb0ee/3dX//01YAVKw/FoW3hDrwUDTAwDMVigy8rTYaRNKug2tzzBwxnAx/DOuMhFECAOxWsDO6kAwkdQFH0BiwIgYlAwCgdAwiZBBI1kCC5JcWwCQWMQ/JQnkVFkOVN8oku8yDkjbMiry+2rrLvW/MvT53q/yv+n2///dywQL8DRgOgsrBBi0LGcngZrCZgYxGEAoZ+IplUdGJ1ifHVRh5v/7kmRMDPOhJ0MTn6qAAAANIAAAARDEiQhOf0pAAAA0gAAABAdCcEnCwmbqA1JhbIFwYKEAUGAXgOJo45oXAyjT0MinMgXM2UNoNGyYeLN0ENORMgQC5EYAJlr4Z3L3lgaHG5VO0lWX1q92J3t9sWM+bu9/fe8/VT/L+zq9v+zr9/+//8r71SAAAA9tq0AA1hzXXdxmzgPWzJyU20wh4EDDUSzWI4x4rgMGBd+IImDoAiEBAMCJn2HpqAlRpDIZhbxxp2ASQcGVRJG6RC4xmaZHiYlYPKGGdEGJjIoa4YtICXGHRhGJg2QMkYJADRGfCMTZE5+4ze1gMF1k163DfQrNgh83G3zIYoMdC4wEOwcrzMxMMam0AlYxkKzOgqMDhUuUBgYIQOWiEgwYHAogAwXBAYHAKAVVm0ZW2J1Wno9taaAzuOSF34AjMUjdBOy+pjbpKCil9TG/hOWRkUkxad2pAAAGFlrIADgyUqh1syPqzGQRoUAEDDoFgKMDw7MVA2NJ1sKHaMVghBwfGAgOgJR0migMTBUODDQezBI5jGNQzXD/+5JkjYD20jDN67/kngAADSAAAAEXjN0dTv9SAAAANIAAAASwgEb7HKvHZpiFAM0Bgs8wPYBNNi8MMfMIKRGRlOETOErM6wMGpBTQHTjJEQaKEBoKmlLXGizd5Ax5W2Byh0X6R9YRJ2rQFSKzgZDB0DQDKJHDr/MoZRDsaleN+vVhpoVqzczvZYx+Hdbx1/MuWOZb///Vr1YX93I/6P9KAWAQE8pFZWkOCuFAO0EEAThJ4OYwBQMHIJgUUVrHHRwaURUkZ4YX6MYvO6EDvpgTJY6aVeR7mGcgzBgfQE2YCuA5H9adJQKBCAhAqA53/aS/bk0T1zjIhpmcjVumpqS/ZZ1v6TuOXxF1+49x5d5Knl/Luvw7ua/8P/DdWT+dOkhD5zhvqb0db/93/5AQAQsF3glyO4MAysKti2BGAAdE0L31C4EMAhEAgAu28hgMOFHwEgaYACAFHpko0GM0ia2Yx0/wmKECIhpq5poYK2CTmAQAMhgAQBKYAoARFUAhUQbKhIMAxAFG3eFpLns4drJbaY9+pDVDPZ/QKtLHKNCpsTA6//uSZIEE9GAuRhNfzIAAAA0gAAABEnjLFK588sAAADSAAAAEdTXMSKxfop3DPM5RNbal/EvU7p6/Ie/t93Z1v6OqEAzmEmBoIQcGTCwGMCghPwvOQgUwEbKMZBgNAwOPZioUiMIl/ACXRGoREDB0clmTLApMiq4x2azRlmMM7NijivBEQxUIGvMGdAsjAxgHcDSxgRZANSYAOAgYs0FXAnwaIl43xAcuEVEogHIiFKRHEuREzUfFfSOoEgRyTk8Isema00Fl0gzqujqL/ZT3Krfoq7r1H/AvWzp/yXv/3f/oA0GjFwIZS19BgKAsiCDxuUBAMZ8D6zIZAIFMChweF7GFbQAITYoiSSSvMRBoUJ5l4RGVzOa2hhmAr6mbNSaYcYlxgqAvmAaCEYDAE6yBgAFIpAsGADyaXw+/MSnONGVBjhuNW+/dbYnEQqJJNwIgainmo0TB3Ofkus/yHs5P3dnW/+ryf+QqTEFNRTMuMTAwqqqqqqqqqqqqAABjBgrdYuwIwHSioNCCFkYbBZpMaoVDIRMDhB326ByJkJgYuGdC4P/7kmSwDPT4N0MLn6SAAAANIAAAARDIpRJOePLAAAA0gAAABDAGIA0YOGJhoVGKx+YbQxu2mmHbCT5rII6wYW2ASgYFJDgHYBAIpMARM6WcpEFALUjnWoXbkbwf8AGkx+2FugJGw/l2gIK+vverzfFet8Re/kur09f/f/u6f/1GySAhOMFigxOOnJAAdLIIqmTCCa9ahACTDANMqFMLAIQjQw0EVbjH4aOuN8OAgFCBn0sS0GpU0IAjUJ3MCoPaDTTB4AwnIE7MGrBCjAcgE836g5kUx6AtCKkjKElvKarxnFzLOlKRocalMtnabKM6hpYW5TSrdLe1Kop3e+ZWtymHt445fv9Vfyy/Hn5Xv///v1bXt4M9Z7+o729b+K/4b6pMQU1FMy4xMDCqqqqqqqqqqqoAArJ2QY8DbERAFjDyZMdBUwYDwIEDHduP9KsmPhhMKGHR0ZzTg0NTB4kGhkYqgZ2MZGQRUYNHoGXBgA4HWYEoBbGCNgvJhVgV8ZJaR2GsQJb5g5gRMYD+BQmAhADQNAVRoA4EQAOXUBwAkYBsAVr/+5Jk0w/0GynDE59coAAADSAAAAEULMkADn9SAAAANIAAAATsdabY4ta/VUMV5DuqzWuVs3pSSLmoKyJqFQGpUi+IAy2PdQm57ZU/m8oR6dDu/KvzehHpx5O/KkuvNN/o39SX9fblC3lusxd7wMr2zmhS+YLExsQBmRRQGKE6HITacxM2hgy8ATH50NVDsxSlQMPDL4bNJAg7HUAIBQcOjCRbMBtAdDAAACkwB4EWMCzCGTGll+U7EVMUMoPCSjDHgWcwaECqP+mza0I1QpATkY0Sm3lwsB0q0C3xd6GWuF4jEAeiqacWb5bdVxJbap8YzlnZWta3hLq34RaGf5hj3/pZ3HveY/3ku7/5a/7Wf//9/92aGoPcO9Z3nep/9H+mTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqgBOZ2IMSwdMDATGQhDC4ZXKRj8wGMxub0k5717G//uSZPaO9axfvJOfPEAAAA0gAAABFsja3g5/cEAAADSAAAAELQSBSmZKFYVCYsIjBA1MCgYxWdDkBzMRAEwgQDIIBMgFIzWQTUjgPK3c02lpDWsiqM0Ih0w6QzjB4BzMDcD4wFgEzAfAeQQs8TcsNydp+n5wlq8UapFM2auMpwfZrv475ll25Y5ll3mtzMuwCWO8Ocqe/lndv+j/b1f6/9QATU2x0wCPIAYTCoUHAxhIYX2MXBDC24mvTCAedLotPVa09tEZwuBrSZmkoXXBgkY2SmmPBjQkpGrwfaYZQGhQDcPACJNPw90xLlijCVZWUifsophFk7ww7v7fGk6gE/vB+l0VNkSFwo0bYXJC6gyQQEiwvlDzbHAhHpZLIQbJ1UxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUASWNHVvyNdkdcuCnNLhmA8HuRIHbo/1AhfJ9JZVctla8gMQwpDT96eCGcDAGg8qCCIBce3D8P35RGMZXL8gcmxBByacE9hDD09hNohydtFshlp7EeIe9aMiMe/P/7kmTNjPTPJLaLvPDwAAANIAAAAQ/obuBt+FJAAAA0gAAABEchD3bEIchgekEBmZYRmyPAM3j4DJ8fhgfmeIjtD4HTwPAiPgNGB+BAAjtCABG8AwMvgwAEo5cSIfzt69YYDMdo9RxSsKtgIcom1PMylIK9rWkMkKzctAIIkqXCTqLYAoUrBCJrAlHzJipaMuaPvWraLnsMj6ExUtGUZ0ZRnJ7Q6PrnS7VrsC55kSlRyTYjonPkkybMT2AyVMrbMrYly661bq13Fz0K2JlbEdH1zk9ocnsB09CcutLYmj71p7Q6PWDI+hMXWjJ06Mozk9odH0BkfQmLrRlGdE6M5JrhKJzZKPoSSephKVHJlGcmLhkZXJJ9CYnrRkqSmMZybKpMQU1FMy4xMDCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+5Jk7QT0dTc4kxw0ogAADSAAAAEZOaLm5+WQSAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqglFJEIRoPjA2MDYyViqViCJxDHghjyPQ4ioUiYKw4EMzYZXAooDEE1y2zRpTu00acWUWWcacaUWYeWcacJAhYgWJFCRQGIFiBZZRZRZlw7s7PG////s7M7Ozs7M5xpRZR5RRpxZRZh5RRZRbRC1NP///9PKqqq4NNNNRKqJXTTTTVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZIIP9BFGHYksMlIAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ=="};class s extends Error{constructor(e){super(e),this.name="UnsupportedDeviceError",this.message=e}}class c extends Error{constructor(e){super(e),this.name="missingSpeakerIdError",this.message=e}}class d extends Error{constructor(e){super(e),this.name="calibrationTimedOutError",this.message=e}}var p=class extends a{constructor(e){super(e),this.startTime=Date.now(),this.receiverPeerId=null;const t=this.parseURLSearchParams();this.speakerPeerId=t.speakerPeerId,this.peer.on("open",this.onPeerOpen),this.peer.on("connection",this.onPeerConnection),this.peer.on("disconnected",this.onPeerDisconnected),this.peer.on("close",this.onPeerClose),this.peer.on("error",this.onPeerError)}onPeerOpen=e=>{this.displayUpdate("Listener - onPeerOpen"),null===e?(this.displayUpdate("Received null id from peer open"),this.peer.id=this.lastPeerId):this.lastPeerId=this.peer.id,this.join()};onPeerConnection=e=>{this.displayUpdate("Listener - onPeerConnection"),e.on("open",(()=>{e.send("Sender does not accept incoming connections"),setTimeout((()=>{e.close()}),500)}))};onConnData=e=>{if(this.displayUpdate("Listener - onConnData"),!Object.prototype.hasOwnProperty.call(e,"speakerPeerId"))throw this.displayUpdate('Error in parsing data received! Must set "speakerPeerId" property'),new c('Must set "speakerPeerId" property');{this.displayUpdate(this.speakerPeerId),this.speakerPeerId=e.speakerPeerId;const t={speakerPeerId:this.speakerPeerId};window.location.search=this.queryStringFromObject(t)}};join=()=>{this.displayUpdate("Listener - join"),this.conn&&(this.displayUpdate("Closing old connection"),this.conn.close()),this.displayUpdate(`Creating connection to: ${this.speakerPeerId}`),this.conn=this.peer.connect(this.speakerPeerId,{reliable:!0}),this.displayUpdate("Created connection"),this.conn.on("open",(async()=>{this.displayUpdate("Listener - conn open"),await this.openAudioStream()})),this.conn.on("data",this.onConnData),this.conn.on("close",(()=>{console.log("Connection closed")}))};getMobileOS=()=>{const e=navigator.userAgent;return/android/i.test(e)?"Android":/iPad|iPhone|iPod/.test(e)||"MacIntel"===(navigator?.userAgentData?.platform||navigator?.platform)&&navigator.maxTouchPoints>1?"iOS":"Other"};sendSamplingRate=e=>{this.displayUpdate("Listener - sendSamplingRate"),this.conn.send({name:"samplingRate",payload:e})};applyHQTrackConstraints=async e=>{const t=e.getAudioTracks()[0],r=t.getCapabilities().sampleRate.max>=96e3,n={sampleRate:r?96e3:48e3,sampleSize:r?24:16};try{await t.applyConstraints(n)}catch(e){console.warn(e),this.displayUpdate(`Error applying contraints to track: ${e}`)}return t.getSettings().sampleRate};openAudioStream=async()=>{this.displayUpdate("Listener - openAudioStream");const e=this.getMobileOS();if("iOS"===e)navigator.mediaDevices.getUserMedia({audio:{sampleRate:96e3,channelCount:1,sampleSize:24},video:!1}).then((e=>{this.applyHQTrackConstraints(e).then((t=>{this.sendSamplingRate(t),this.peer.call(this.speakerPeerId,e),this.displayUpdate("Listener - openAudioStream")})).catch((e=>{console.log(e),this.displayUpdate(`Error in applying track contraints ${e}`)}))})).catch((e=>{console.log(e),this.displayUpdate(`Error in opening audio stream ${e}`)}));else{const t=new s(`${e} is not supported`);this.conn.send({name:t.name,payload:t})}}},u=r(592);const l=e=>new Promise((t=>{setTimeout(t,1e3*e)})),h=(e,t=",")=>e.split("\n").map((e=>e.split(t)[1]));class f extends a{constructor(e,t,r){super(e),this.siteUrl+="/listener?",this.ac=new t(r),this.result=null,this.peer.on("open",this.#onPeerOpen),this.peer.on("connection",this.#onPeerConnection),this.peer.on("close",this.#onPeerClose),this.peer.on("disconnected",this.#onPeerDisconnected),this.peer.on("error",this.#onPeerError)}static startCalibration=async(e,t,r,n=12e4)=>{window.speaker=new f(e,t,r);const{speaker:o}=window;return new Promise(((e,t)=>{o.peer.on("call",(async r=>{r.answer(),o.ac.createLocalAudio(document.getElementById(o.targetElement)),r.on("stream",(async t=>{for(window.localStream=t,window.localAudio.srcObject=t,window.localAudio.autoplay=!1;!o.ac.sampleRatesSet();)console.log("SinkSamplingRate is undefined, sleeping"),await l(1);o.result=await o.ac.startCalibration(t),e(o.result)})),setTimeout((()=>{t(new d(`Calibration failed to produce a result after ${n/1e3} seconds. Please try again.`))}),n)}))}))};#showQRCode=()=>{const e={speakerPeerId:this.peer.id},t=this.queryStringFromObject(e),r=this.siteUrl+t,n=document.createElement("a");n.setAttribute("href",r),n.innerHTML="Click here to connect to the speaker's microphone",n.target="_blank";const o=document.createElement("canvas");o.setAttribute("id","qrCanvas"),console.log(r),u.toCanvas(o,r,(e=>{e&&console.error(e)})),document.getElementById(this.targetElement)?(document.getElementById(this.targetElement).appendChild(n),document.getElementById(this.targetElement).appendChild(o)):console.log("TEST: Peer reachable at: ",r)};#onPeerOpen=e=>{null===e?(console.error("Received null id from peer open"),this.peer.id=this.lastPeerId):this.lastPeerId=this.peer.id,e!==this.peer.id&&console.warn("DEBUG Check you assumption that id === this.peer.id"),this.#showQRCode()};#onPeerConnection=e=>{console.log("Speaker - #onPeerConnection"),this.conn&&this.conn.open?e.on("open",(()=>{e.send("Already connected to another client"),setTimeout((()=>{e.close()}),500)})):(this.conn=e,console.log("Connected to: ",this.conn.peer),this.#ready())};#onPeerClose=()=>{this.conn=null,console.log("Connection destroyed")};#onPeerDisconnected=()=>{console.log("Connection lost. Please reconnect"),this.peer.id=this.lastPeerId,this.peer._lastServerId=this.lastPeerId,this.peer.reconnect()};#onPeerError=e=>{console.error(e)};#onIncomingData=e=>{if(Object.prototype.hasOwnProperty.call(e,"name")&&Object.prototype.hasOwnProperty.call(e,"payload"))switch(console.log(e),e.name){case"samplingRate":this.ac.setSamplingRates(e.payload);break;case s.name:case c.name:throw e.payload}else console.error("Received malformed data: ",e)};#ready=()=>{this.conn.on("data",this.#onIncomingData),this.conn.on("close",(()=>{console.log("Connection reset<br>Awaiting connection..."),this.conn=null}))};downloadData=()=>{this.ac.downloadData()}}var m=f,g=r(187),y=r(58),E="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function v(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||y))return new XMLHttpRequest}catch(e){}if(!t)try{return new(E[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}function _(e,...t){return t.reduce(((t,r)=>(e.hasOwnProperty(r)&&(t[r]=e[r]),t)),{})}const T=setTimeout,w=clearTimeout;function b(e,t){t.useNativeTimers?(e.setTimeoutFn=T.bind(E),e.clearTimeoutFn=w.bind(E)):(e.setTimeoutFn=setTimeout.bind(E),e.clearTimeoutFn=clearTimeout.bind(E))}var O=r(63);const P=Object.create(null);P.open="0",P.close="1",P.ping="2",P.pong="3",P.message="4",P.upgrade="5",P.noop="6";const S=Object.create(null);Object.keys(P).forEach((e=>{S[P[e]]=e}));const A={type:"error",data:"parser error"},D="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),R="function"==typeof ArrayBuffer,C=(e,t)=>{const r=new FileReader;return r.onload=function(){const e=r.result.split(",")[1];t("b"+e)},r.readAsDataURL(e)};for(var M=({type:e,data:t},r,n)=>{return D&&t instanceof Blob?r?n(t):C(t,n):R&&(t instanceof ArrayBuffer||(o=t,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(o):o&&o.buffer instanceof ArrayBuffer))?r?n(t):C(new Blob([t]),n):n(P[e]+(t||""));var o},k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I="undefined"==typeof Uint8Array?[]:new Uint8Array(256),x=0;x<k.length;x++)I[k.charCodeAt(x)]=x;const N="function"==typeof ArrayBuffer,F=(e,t)=>{if(N){const r=function(e){var t,r,n,o,i,a=.75*e.length,s=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var d=new ArrayBuffer(a),p=new Uint8Array(d);for(t=0;t<s;t+=4)r=I[e.charCodeAt(t)],n=I[e.charCodeAt(t+1)],o=I[e.charCodeAt(t+2)],i=I[e.charCodeAt(t+3)],p[c++]=r<<2|n>>4,p[c++]=(15&n)<<4|o>>2,p[c++]=(3&o)<<6|63&i;return d}(e);return V(r,t)}return{base64:!0,data:e}},V=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}};var j=(e,t)=>{if("string"!=typeof e)return{type:"message",data:V(e,t)};const r=e.charAt(0);return"b"===r?{type:"message",data:F(e.substring(1),t)}:S[r]?e.length>1?{type:S[r],data:e.substring(1)}:{type:S[r]}:A};const U=String.fromCharCode(30);class L extends O.Q{constructor(e){super(),this.writable=!1,b(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t){const r=new Error(e);return r.type="TransportError",r.description=t,super.emit("error",r),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emit("open")}onData(e){const t=j(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emit("packet",e)}onClose(){this.readyState="closed",super.emit("close")}}var B=r(281),q=r(830);class H extends L{constructor(){super(...arguments),this.polling=!1}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emit("poll")}onData(e){((e,t)=>{const r=e.split(U),n=[];for(let e=0;e<r.length;e++){const o=j(r[e],t);if(n.push(o),"error"===o.type)break}return n})(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose(),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const r=e.length,n=new Array(r);let o=0;e.forEach(((e,i)=>{M(e,!1,(e=>{n[i]=e,++o===r&&t(n.join(U))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emit("drain")}))}))}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let r="";!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=B()),this.supportsBinary||e.sid||(e.b64=1),this.opts.port&&("https"===t&&443!==Number(this.opts.port)||"http"===t&&80!==Number(this.opts.port))&&(r=":"+this.opts.port);const n=q.encode(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(n.length?"?"+n:"")}}function Q(){}const X=null!=new v({xdomain:!1}).responseType;class G extends O.Q{constructor(e,t){super(),b(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.create()}create(){const e=_(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new v(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&t.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{t.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{4===t.readyState&&(200===t.status||1223===t.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof t.status?t.status:0)}),0))},t.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=G.requestsCount++,G.requests[this.index]=this)}onSuccess(){this.emit("success"),this.cleanup()}onData(e){this.emit("data",e),this.onSuccess()}onError(e){this.emit("error",e),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=Q,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete G.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&this.onData(e)}abort(){this.cleanup()}}function z(){for(let e in G.requests)G.requests.hasOwnProperty(e)&&G.requests[e].abort()}G.requestsCount=0,G.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",z):"function"==typeof addEventListener&&addEventListener("onpagehide"in E?"pagehide":"unload",z,!1));const W="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),Y=E.WebSocket||E.MozWebSocket,J="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class K extends L{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,r=J?{}:_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=J?new Y(e,t,r):t?new Y(e,t):new Y(e)}catch(e){return this.emit("error",e)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=this.onClose.bind(this),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],n=t===e.length-1;M(r,this.supportsBinary,(e=>{try{this.ws.send(e)}catch(e){}n&&W((()=>{this.writable=!0,this.emit("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let r="";this.opts.port&&("wss"===t&&443!==Number(this.opts.port)||"ws"===t&&80!==Number(this.opts.port))&&(r=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=B()),this.supportsBinary||(e.b64=1);const n=q.encode(e);return t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(n.length?"?"+n:"")}check(){return!(!Y||"__initialize"in Y&&this.name===K.prototype.name)}}const $={websocket:K,polling:class extends H{constructor(e){if(super(e),"undefined"!=typeof location){const t="https:"===location.protocol;let r=location.port;r||(r=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||r!==e.port,this.xs=e.secure!==t}const t=e&&e.forceBase64;this.supportsBinary=X&&!t}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new G(this.uri(),e)}doWrite(e,t){const r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(e=>{this.onError("xhr post error",e)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e=>{this.onError("xhr poll error",e)})),this.pollXhr=e}}};class Z extends O.Q{constructor(e,t={}){super(),e&&"object"==typeof e&&(t=e,e=null),e?(e=g(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=g(t.host).host),b(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=q.decode(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",(()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())}),!1),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close")},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=function(e){const t={};for(let r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}(this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const r=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new $[e](r)}open(){let e;if(this.opts.rememberUpgrade&&Z.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(()=>{this.onClose("transport close")}))}probe(e){let t=this.createTransport(e),r=!1;Z.priorWebsocketSuccess=!1;const n=()=>{r||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!r)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Z.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{r||"closed"!==this.readyState&&(d(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function o(){r||(r=!0,d(),t.close(),t=null)}const i=e=>{const r=new Error("probe error: "+e);r.transport=t.name,o(),this.emitReserved("upgradeError",r)};function a(){i("transport closed")}function s(){i("socket closed")}function c(e){t&&e.name!==t.name&&o()}const d=()=>{t.removeListener("open",n),t.removeListener("error",i),t.removeListener("close",a),this.off("close",s),this.off("upgrading",c)};t.once("open",n),t.once("error",i),t.once("close",a),this.once("close",s),this.once("upgrading",c),t.open()}onOpen(){if(this.readyState="open",Z.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emitReserved("flush"))}write(e,t,r){return this.sendPacket("message",e,t,r),this}send(e,t,r){return this.sendPacket("message",e,t,r),this}sendPacket(e,t,r,n){if("function"==typeof t&&(n=t,t=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;const o={type:e,data:t,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?r():e()})):this.upgrading?r():e()),this}onError(e){Z.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let r=0;const n=e.length;for(;r<n;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}Z.protocol=4,Z.protocol;const ee="function"==typeof ArrayBuffer,te=Object.prototype.toString,re="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===te.call(Blob),ne="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===te.call(File);function oe(e){return ee&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||re&&e instanceof Blob||ne&&e instanceof File}function ie(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,r=e.length;t<r;t++)if(ie(e[t]))return!0;return!1}if(oe(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return ie(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&ie(e[t]))return!0;return!1}function ae(e){const t=[],r=e.data,n=e;return n.data=se(r,t),n.attachments=t.length,{packet:n,buffers:t}}function se(e,t){if(!e)return e;if(oe(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}if(Array.isArray(e)){const r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=se(e[n],t);return r}if("object"==typeof e&&!(e instanceof Date)){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=se(e[n],t));return r}return e}function ce(e,t){return e.data=de(e.data,t),e.attachments=void 0,e}function de(e,t){if(!e)return e;if(e&&e._placeholder)return t[e.num];if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=de(e[r],t);else if("object"==typeof e)for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=de(e[r],t));return e}const pe=5;var ue;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(ue||(ue={}));class le{encode(e){return e.type!==ue.EVENT&&e.type!==ue.ACK||!ie(e)?[this.encodeAsString(e)]:(e.type=e.type===ue.EVENT?ue.BINARY_EVENT:ue.BINARY_ACK,this.encodeAsBinary(e))}encodeAsString(e){let t=""+e.type;return e.type!==ue.BINARY_EVENT&&e.type!==ue.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data)),t}encodeAsBinary(e){const t=ae(e),r=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(r),n}}class he extends O.Q{constructor(){super()}add(e){let t;if("string"==typeof e)t=this.decodeString(e),t.type===ue.BINARY_EVENT||t.type===ue.BINARY_ACK?(this.reconstructor=new fe(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t);else{if(!oe(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const r={type:Number(e.charAt(0))};if(void 0===ue[r.type])throw new Error("unknown packet type "+r.type);if(r.type===ue.BINARY_EVENT||r.type===ue.BINARY_ACK){const n=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const o=e.substring(n,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");r.attachments=Number(o)}if("/"===e.charAt(t+1)){const n=t+1;for(;++t&&","!==e.charAt(t)&&t!==e.length;);r.nsp=e.substring(n,t)}else r.nsp="/";const n=e.charAt(t+1);if(""!==n&&Number(n)==n){const n=t+1;for(;++t;){const r=e.charAt(t);if(null==r||Number(r)!=r){--t;break}if(t===e.length)break}r.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){const n=function(e){try{return JSON.parse(e)}catch(e){return!1}}(e.substr(t));if(!he.isPayloadValid(r.type,n))throw new Error("invalid payload");r.data=n}return r}static isPayloadValid(e,t){switch(e){case ue.CONNECT:return"object"==typeof t;case ue.DISCONNECT:return void 0===t;case ue.CONNECT_ERROR:return"string"==typeof t||"object"==typeof t;case ue.EVENT:case ue.BINARY_EVENT:return Array.isArray(t)&&t.length>0;case ue.ACK:case ue.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class fe{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=ce(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function me(e,t,r){return e.on(t,r),function(){e.off(t,r)}}const ge=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ye extends O.Q{constructor(e,t,r){super(),this.connected=!1,this.disconnected=!0,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}subEvents(){if(this.subs)return;const e=this.io;this.subs=[me(e,"open",this.onopen.bind(this)),me(e,"packet",this.onpacket.bind(this)),me(e,"error",this.onerror.bind(this)),me(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(ge.hasOwnProperty(e))throw new Error('"'+e+'" is a reserved event name');t.unshift(e);const r={type:ue.EVENT,data:t,options:{}};if(r.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,n=t.pop();this._registerAckCallback(e,n),r.id=e}const n=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!n||!this.connected)||(this.connected?this.packet(r):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(e,t){const r=this.flags.timeout;if(void 0===r)return void(this.acks[e]=t);const n=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(n),t.apply(this,[null,...e])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this.packet({type:ue.CONNECT,data:e})})):this.packet({type:ue.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e){this.connected=!1,this.disconnected=!0,delete this.id,this.emitReserved("disconnect",e)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ue.CONNECT:if(e.data&&e.data.sid){const t=e.data.sid;this.onconnect(t)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ue.EVENT:case ue.BINARY_EVENT:this.onevent(e);break;case ue.ACK:case ue.BINARY_ACK:this.onack(e);break;case ue.DISCONNECT:this.ondisconnect();break;case ue.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const r of t)r.apply(this,e)}super.emit.apply(this,e)}ack(e){const t=this;let r=!1;return function(...n){r||(r=!0,t.packet({type:ue.ACK,id:e,data:n}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>this.packet(e))),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ue.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}}var Ee=r(10);class ve extends O.Q{constructor(t,r){var n;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(r=t,t=void 0),(r=r||{}).path=r.path||"/socket.io",this.opts=r,b(this,r),this.reconnection(!1!==r.reconnection),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=r.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new Ee({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==r.timeout?2e4:r.timeout),this._readyState="closed",this.uri=t;const o=r.parser||e;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=!1!==r.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Z(this.uri,this.opts);const t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const n=me(t,"open",(function(){r.onopen(),e&&e()})),o=me(t,"error",(t=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",t),e?e(t):r.maybeReconnectOnOpen()}));if(!1!==this._timeout){const e=this._timeout;0===e&&n();const r=this.setTimeoutFn((()=>{n(),t.close(),t.emit("error",new Error("timeout"))}),e);this.opts.autoUnref&&r.unref(),this.subs.push((function(){clearTimeout(r)}))}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(me(e,"ping",this.onping.bind(this)),me(e,"data",this.ondata.bind(this)),me(e,"error",this.onerror.bind(this)),me(e,"close",this.onclose.bind(this)),me(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){this.decoder.add(e)}ondecoded(e){this.emitReserved("packet",e)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r||(r=new ye(this,e,t),this.nsps[e]=r),r}_destroy(e){const t=Object.keys(this.nsps);for(const e of t)if(this.nsps[e].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&r.unref(),this.subs.push((function(){clearTimeout(r)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const _e={};function Te(e,t){"object"==typeof e&&(t=e,e=void 0);const r=function(e,t="",r){let n=e;r=r||"undefined"!=typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),n=g(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const o=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+t,n.href=n.protocol+"://"+o+(r&&r.port===n.port?"":":"+n.port),n}(e,(t=t||{}).path||"/socket.io"),n=r.source,o=r.id,i=r.path,a=_e[o]&&i in _e[o].nsps;let s;return t.forceNew||t["force new connection"]||!1===t.multiplex||a?s=new ve(n,t):(_e[o]||(_e[o]=new ve(n,t)),s=_e[o]),r.query&&!t.query&&(t.query=r.queryKey),s.socket(r.path,t)}Object.assign(Te,{Manager:ve,Socket:ye,io:Te,connect:Te});class we{static PYTHON_SERVER_URL="https://easyeyes-python-server.herokuapp.com";static TEST_SERVER_URL="http://localhost:3001";constructor(e=we.PYTHON_SERVER_URL){this.socket=Te(e,{reconnection:!0,reconnectionDelay:1e3,reconnectionDelayMax:5e3,reconnectionAttempts:99999})}getImpulseResponse=async e=>{let t=null;try{t=(await this.asyncEmit("data",{task:"impulse-response",data:e})).data.trim().split(",").map((e=>parseFloat(e)))}catch(e){console.error(e)}return t};getVolumeCalibration=async e=>{let t,r;try{t=await this.asyncEmit("data",{task:"volume-calibration",data:e});const[n,o,i,a]=t.data.trim().split(",").map((e=>parseFloat(e.split(":")[1])));r=n}catch(e){throw new Error(e)}return r};asyncEmit=(e,t)=>new Promise(((r,n)=>{this.socket.emit(e,t),this.socket.on(e,(e=>{r(e)})),this.socket.on("error",(e=>{n(e)})),setTimeout(n,9e4)}))}var be=we,Oe=class extends class{#mediaRecorder;#recordedChunks=[];#audioBlob;#audioContext;#recordedSignals=[];sinkSamplingRate;#saveRecording=async()=>{const e=await this.#audioBlob.arrayBuffer(),t=(await this.#audioContext.decodeAudioData(e)).getChannelData(0);console.log(`Decoded audio buffer with ${t.length} samples`),this.#recordedSignals.push(t)};#onRecorderDataAvailable=e=>{e.data&&e.data.size>0&&this.#recordedChunks.push(e.data)};#setMediaRecorder=e=>{this.#mediaRecorder=new MediaRecorder(e),this.#mediaRecorder.ondataavailable=e=>this.#onRecorderDataAvailable(e)};#setAudioContext=()=>{this.#audioContext=new(window.AudioContext||window.webkitAudioContext||window.audioContext)({sampleRate:this.sinkSamplingRate})};startRecording=async e=>{this.#setAudioContext(),this.#mediaRecorder||this.#setMediaRecorder(e),this.#recordedChunks=[],this.#mediaRecorder.start()};stopRecording=async()=>{await new Promise((e=>{this.#mediaRecorder.onstop=()=>{this.#audioBlob=new Blob(this.#recordedChunks,{type:"audio/wav; codecs=opus"}),e(this.#audioBlob)},this.#mediaRecorder.stop()})),await this.#saveRecording()};getLastRecordedSignal=()=>this.#recordedSignals[this.#recordedSignals.length-1];getAllRecordedSignals=()=>this.#recordedSignals;setSinkSamplingRate=e=>{this.sinkSamplingRate=e}}{constructor(e=1,t=1){super(),this.numCalibratingRounds=e,this.numCalibrationNodes=t,this.pyServer=new be}#isCalibrating=!1;#sourceAudioContext;numCalibratingRounds;numCalibratingRoundsCompleted=0;sourceSamplingRate;numCalibrationNodes;calibrationNodes=[];localAudio;createLocalAudio=e=>{this.localAudio=document.createElement("audio"),this.localAudio.setAttribute("id","localAudio"),e.appendChild(this.localAudio)};calibrationSteps=async(e,t,r=(()=>{}),n=(()=>{}))=>{for(this.numCalibratingRoundsCompleted=0;!this.#isCalibrating&&this.numCalibratingRoundsCompleted<this.numCalibratingRounds;)await r(),await this.startRecording(e),console.log(`Calibration Round ${this.numCalibratingRoundsCompleted}`),await t(),console.log("Calibration Round Complete"),await this.stopRecording(),await n(),this.calibrationNodes=[],await l(2),this.numCalibratingRoundsCompleted+=1};getCalibrationStatus=()=>this.#isCalibrating;setSamplingRates=e=>{this.sinkSamplingRate=e,this.sourceSamplingRate=e,console.log("sampling rate",e)};sampleRatesSet=()=>this.sourceSamplingRate&&this.sinkSamplingRate;addCalibrationNode=e=>{this.calibrationNodes.push(e)};makeNewSourceAudioContext=()=>{const e={sampleRate:this.sourceSamplingRate};return this.#sourceAudioContext=new(window.AudioContext||window.webkitAudioContext||window.audioContext)(e),this.#sourceAudioContext};downloadData=()=>{const e=this.getAllRecordedSignals(),t=e.length-1;((e,t="recordedMLSignal.csv")=>{let r="data:text/csv;charset=utf-8,";e.forEach(((e,t)=>{r+=`${t},${e}\r\n`}));const n=encodeURI(r),o=document.createElement("a");o.setAttribute("href",n),o.setAttribute("download",t),document.body.appendChild(o),o.click()})(e[t],`recordedMLSignal_${t}.csv`)}},Pe=class extends Oe{constructor(e=1,t=1){super(e,t)}#CALIBRATION_TONE_FREQUENCY=1e3;#CALIBRATION_TONE_TYPE="sine";#CALIBRATION_TONE_DURATION=5;soundGainDBSPL=null;handleIncomingData=e=>{if(console.log("Received data: ",e),"soundGainDBSPL"!==e.type)throw new Error(`Unknown data type: ${e.type}`);this.soundGainDBSPL=e.value};#getTruncatedSignal=(e=3.5,t=4.5)=>{const r=Math.floor(e*this.sourceSamplingRate),n=Math.floor(t*this.sourceSamplingRate),o=Array.from(this.getLastRecordedSignal().slice(r,n));return(e=>{const t=new Set(e);1===t.size&&t.has(0)&&console.warn("The last capture failed, all recorded signal is zero",this.getAllRecordedSignals()),0===t.size&&console.warn("The last capture failed, no recorded signal")})(o),o};#createCalibrationNode=()=>{const e=this.makeNewSourceAudioContext(),t=e.createOscillator(),r=e.createGain();t.frequency.value=this.#CALIBRATION_TONE_FREQUENCY,t.type=this.#CALIBRATION_TONE_TYPE,r.gain.value=.04,t.connect(r),r.connect(e.destination),this.addCalibrationNode(t)};#playCalibrationAudio=async()=>{const e=this.#CALIBRATION_TONE_DURATION*this.numCalibrationNodes,t=1.2*e;for(let e=0;e<this.calibrationNodes.length;e+=1)this.calibrationNodes[e].start(e*this.#CALIBRATION_TONE_DURATION),this.calibrationNodes[e].stop(e*this.#CALIBRATION_TONE_DURATION+this.#CALIBRATION_TONE_DURATION);console.log(`Playing a buffer of ${e} seconds of audio`),console.log(`Waiting a total of ${t} seconds`),await l(t)};#sendToServerForProcessing=()=>{console.log("Sending data to server"),this.pyServer.getVolumeCalibration({sampleRate:this.sourceSamplingRate,payload:this.#getTruncatedSignal()}).then((e=>{null===this.soundGainDBSPL&&(this.soundGainDBSPL=e)})).catch((e=>{console.warn(e)}))};startCalibration=async e=>{do{await this.calibrationSteps([e,[this.#playCalibrationAudio,this.#createCalibrationNode,this.#sendToServerForProcessing]])}while(null===this.soundGainDBSPL);return this.soundGainDBSPL}};const Se=r(972);class Ae{static N=18;#WASMInstance;#MLSGenInstance;constructor(e,t,r){this.#WASMInstance=e,console.warn("initializing MLSGen, need to manually garbage collect"),this.#MLSGenInstance=new this.#WASMInstance.MLSGen(Ae.N,t,r)}static factory=async(e,t)=>{if(void 0===e||void 0===t)throw new Error("sourceSamplingRate and sinkSamplingRate must be defined");return console.log(`sourceSamplingRate: ${e} sinkSamplingRate: ${t}`),new Ae(await Se().then((e=>e)),e,t)};withGarbageCollection=async e=>{try{for(let t=0;t<e.length;t+=1){const[r,n]=e[t];await r(...n)}}catch(e){console.error(e)}finally{null!=this&&void 0!==this.#MLSGenInstance&&null!==this.#MLSGenInstance&&(this.#MLSGenInstance.Destruct(),this.#MLSGenInstance.delete(),console.warn("GARBAGE COLLECTION: deleted MLSGen"),this.#WASMInstance.doLeakCheck())}};getImpulseResponse=()=>this.#MLSGenInstance.getImpulseResponse();setRecordedSignals=e=>{const t=this.average(e),r=this.#MLSGenInstance.setRecordedSignalsMemoryView(t.byteLength);for(let e=0;e<t.length;e++)r[e]=t[e]};getMLS=()=>this.#MLSGenInstance.getMLS()}var De=Ae,Re=class extends Oe{constructor({download:e=!1,numCalibrationRounds:t=2,numCalibrationNodes:r=3}){super(t,r),this.#download=e}#download;#mlsGenInterface;#mlsBufferView;invertedImpulseResponse=null;#P;#average=e=>{let t=e[0].length;for(let r=0;r<e.length;r+=1)t=e[0].length<e[r].length?e[0].length:e[r].length;for(let r=0;r<e.length;r+=1)e[r]=e[r].slice(0,t);for(let t=0;t<e[0].length;t+=1){let r=0;for(let n=0;n<e.length;n+=1)r+=e[n][t];e[0][t]=r/e.length}return e[0]};#afterRecord=()=>{this.#download&&this.downloadData()};sendToServerForProcessing=async e=>(console.log("Sending data to server"),this.pyServer.getImpulseResponse({sampleRate:this.sourceSamplingRate||96e3,payload:e&&e.length>0?h(e):this.#average(this.getAllRecordedSignals())}).then((e=>{null==this.invertedImpulseResponse&&(this.invertedImpulseResponse=e)})).catch((e=>{console.error(e)})));#createCalibrationNodeFromBuffer=e=>{const t=this.makeNewSourceAudioContext(),r=t.createBuffer(1,e.length,t.sampleRate),n=r.getChannelData(0);try{for(let t=0;t<e.length;t+=1)n[t]=e[t]}catch(e){console.error(e)}const o=t.createBufferSource();o.buffer=r,o.connect(t.destination),this.addCalibrationNode(o)};#setCalibrationNodesFromBuffer=(e=[this.#mlsBufferView])=>{if(this.#P=e[0].length,1===e.length)for(;this.calibrationNodes.length<this.numCalibrationNodes;)this.#createCalibrationNodeFromBuffer(e[0]);else{if(e.length!==this.numCalibrationNodes)throw new Error("The length of the data buffer array must be 1 or equal to this.numCalibrationNodes");e.forEach((e=>{this.#createCalibrationNodeFromBuffer(e)}))}};#playCalibrationAudio=async()=>{const{duration:e}=this.calibrationNodes[0].buffer,t=e*this.numCalibrationNodes,r=1.2*t;for(let t=0;t<this.calibrationNodes.length;t+=1)this.calibrationNodes[t].start(t*e);console.log(`Playing a buffer of ${t} seconds of audio`),console.log(`Waiting a total of ${r} seconds`),await l(r)};startCalibration=async e=>{for(await De.factory(this.sinkSamplingRate,this.sourceSamplingRate).then((e=>{this.#mlsGenInterface=e,this.#mlsBufferView=this.#mlsGenInterface.getMLS()}));this.numCalibratingRoundsCompleted<this.numCalibratingRounds;)await this.#mlsGenInterface.withGarbageCollection([[this.calibrationSteps,[e,this.#playCalibrationAudio,this.#setCalibrationNodesFromBuffer,this.#afterRecord]]]);return await this.sendToServerForProcessing(),this.invertedImpulseResponse}}}(),n}()}));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.speakerCalibrator=t():e.speakerCalibrator=t()}(self,(function(){return function(){var e={2058:function(e){var t,r=(t="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e){var r,n,o=void 0!==(e=e||{})?e:{};o.ready=new Promise((function(e,t){r=e,n=t})),Object.getOwnPropertyDescriptor(o.ready,"_main")||(Object.defineProperty(o.ready,"_main",{configurable:!0,get:function(){je("You are getting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"_main",{configurable:!0,set:function(){je("You are setting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___getTypeName")||(Object.defineProperty(o.ready,"___getTypeName",{configurable:!0,get:function(){je("You are getting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___getTypeName",{configurable:!0,set:function(){je("You are setting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___embind_register_native_and_builtin_types")||(Object.defineProperty(o.ready,"___embind_register_native_and_builtin_types",{configurable:!0,get:function(){je("You are getting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___embind_register_native_and_builtin_types",{configurable:!0,set:function(){je("You are setting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"___stdio_exit")||(Object.defineProperty(o.ready,"___stdio_exit",{configurable:!0,get:function(){je("You are getting ___stdio_exit on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"___stdio_exit",{configurable:!0,set:function(){je("You are setting ___stdio_exit on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"__ZN6__asan9FakeStack17AddrIsInFakeStackEm")||(Object.defineProperty(o.ready,"__ZN6__asan9FakeStack17AddrIsInFakeStackEm",{configurable:!0,get:function(){je("You are getting __ZN6__asan9FakeStack17AddrIsInFakeStackEm on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"__ZN6__asan9FakeStack17AddrIsInFakeStackEm",{configurable:!0,set:function(){je("You are setting __ZN6__asan9FakeStack17AddrIsInFakeStackEm on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"__ZN6__asan9FakeStack8AllocateEmmm")||(Object.defineProperty(o.ready,"__ZN6__asan9FakeStack8AllocateEmmm",{configurable:!0,get:function(){je("You are getting __ZN6__asan9FakeStack8AllocateEmmm on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"__ZN6__asan9FakeStack8AllocateEmmm",{configurable:!0,set:function(){je("You are setting __ZN6__asan9FakeStack8AllocateEmmm on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}})),Object.getOwnPropertyDescriptor(o.ready,"onRuntimeInitialized")||(Object.defineProperty(o.ready,"onRuntimeInitialized",{configurable:!0,get:function(){je("You are getting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}),Object.defineProperty(o.ready,"onRuntimeInitialized",{configurable:!0,set:function(){je("You are setting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js")}}));var i=Object.assign({},o),a=[],s="./this.program",c=(e,t)=>{throw t},d=!0,u=!1,p=!1,l=!1;if(o.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var f,h,m,g="";function y(e){return o.locateFile?o.locateFile(e,g):g+e}function E(e){if(e instanceof bo)return;let t=e;e&&"object"==typeof e&&e.stack&&(t=[e,e.stack]),_("exiting due to exception: "+t)}if(l){if("object"==typeof process||"object"==typeof window||"function"==typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");"undefined"!=typeof read&&(f=function(e){return read(e)}),m=function(e){let t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(t=read(e,"binary"),L("object"==typeof t),t)},h=function(e,t,r){setTimeout((()=>t(m(e))),0)},"undefined"!=typeof scriptArgs?a=scriptArgs:void 0!==arguments&&(a=arguments),"function"==typeof quit&&(c=(e,t)=>{E(t),quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)}else{if(!d&&!u)throw new Error("environment detection error");if(u?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),t&&(g=t),g=0!==g.indexOf("blob:")?g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1):"","object"!=typeof window&&"function"!=typeof importScripts)throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");f=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},u&&(m=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),h=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)}}var v=o.print||console.log.bind(console),_=o.printErr||console.warn.bind(console);function T(e){T.shown||(T.shown={}),T.shown[e]||(T.shown[e]=1,_(e))}Object.assign(o,i),i=null,o.arguments&&(a=o.arguments),Object.getOwnPropertyDescriptor(o,"arguments")||Object.defineProperty(o,"arguments",{configurable:!0,get:function(){je("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),o.thisProgram&&(s=o.thisProgram),Object.getOwnPropertyDescriptor(o,"thisProgram")||Object.defineProperty(o,"thisProgram",{configurable:!0,get:function(){je("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),o.quit&&(c=o.quit),Object.getOwnPropertyDescriptor(o,"quit")||Object.defineProperty(o,"quit",{configurable:!0,get:function(){je("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),L(void 0===o.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),L(void 0===o.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),L(void 0===o.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),L(void 0===o.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),L(void 0===o.read,"Module.read option was removed (modify read_ in JS)"),L(void 0===o.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),L(void 0===o.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),L(void 0===o.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),L(void 0===o.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Object.getOwnPropertyDescriptor(o,"read")||Object.defineProperty(o,"read",{configurable:!0,get:function(){je("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(o,"readAsync")||Object.defineProperty(o,"readAsync",{configurable:!0,get:function(){je("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(o,"readBinary")||Object.defineProperty(o,"readBinary",{configurable:!0,get:function(){je("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(o,"setWindowTitle")||Object.defineProperty(o,"setWindowTitle",{configurable:!0,get:function(){je("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),L(!u,"worker environment detected but not enabled at build time. Add 'worker' to `-s ENVIRONMENT` to enable."),L(!p,"node environment detected but not enabled at build time. Add 'node' to `-s ENVIRONMENT` to enable."),L(!l,"shell environment detected but not enabled at build time. Add 'shell' to `-s ENVIRONMENT` to enable.");var w,b=e=>{};o.wasmBinary&&(w=o.wasmBinary),Object.getOwnPropertyDescriptor(o,"wasmBinary")||Object.defineProperty(o,"wasmBinary",{configurable:!0,get:function(){je("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});var O,P=o.noExitRuntime||!1;function S(e){return _e?uo(e):W[e]}function A(e){return _e?po(e):Y[e]}function D(e){return _e?lo(e):J[e]}function R(e){return _e?fo(e):$[e]}function C(e){return _e?ho(e):K[e]}function M(e){return _e?mo(e)>>>0:Z[e]}function k(e){return _e?go(e):ee[e]}function I(e){return _e?yo(e):te[e]}function x(e,t){return _e?Eo(e,t):W[e]=t}function F(e,t){return _e?vo(e,t):Y[e]=t}function N(e,t){return _e?_o(e,t):J[e]=t}function j(e,t){return _e?To(e,t):K[e]=t}function V(e,t){return _e?wo(e,t)>>>0:Z[e]=t}Object.getOwnPropertyDescriptor(o,"noExitRuntime")||Object.defineProperty(o,"noExitRuntime",{configurable:!0,get:function(){je("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),"object"!=typeof WebAssembly&&je("no native wasm support detected");var U=!1;function L(e,t){e||je("Assertion failed"+(t?": "+t:""))}var B="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function q(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.subarray&&B)return B.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var c=63&e[t++];if(224==(240&a)?a=(15&a)<<12|s<<6|c:(240!=(248&a)&&T("Invalid UTF-8 leading byte 0x"+a.toString(16)+" encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),a=(7&a)<<18|s<<12|c<<6|63&e[t++]),a<65536)i+=String.fromCharCode(a);else{var d=a-65536;i+=String.fromCharCode(55296|d>>10,56320|1023&d)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function H(e,t){return e?q(Y,e,t):""}function Q(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)break;s>1114111&&T("Invalid Unicode code point 0x"+s.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."),t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o}function X(e,t,r){return L("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),Q(e,Y,t,r)}function G(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}var z,W,Y,J,$,K,Z,ee,te,re="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function ne(e,t){L(e%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&R(n);)++n;if((r=n<<1)-e>32&&re)return re.decode(Y.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=D(e+2*a>>1);if(0==s)break;i+=String.fromCharCode(s)}return i}function oe(e,t,r){if(L(t%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!"),L("number"==typeof r,"stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i)N(t>>1,e.charCodeAt(i)),t+=2;return N(t>>1,0),t-n}function ie(e){return 2*e.length}function ae(e,t){L(e%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");for(var r=0,n="";!(r>=t/4);){var o=C(e+4*r>>2);if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n}function se(e,t,r){if(L(t%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!"),L("number"==typeof r,"stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),j(t>>2,a),(t+=4)+4>o)break}return j(t>>2,0),t-n}function ce(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t}function de(e){var t=G(e)+1,r=to(t);return r&&Q(e,W,r,t),r}function ue(e,t,r){for(var n=0;n<e.length;++n)L(e.charCodeAt(n)===(255&e.charCodeAt(n))),x(t++>>0,e.charCodeAt(n));r||x(t>>0,0)}function pe(e){z=e,o.HEAP8=W=new Int8Array(e),o.HEAP16=J=new Int16Array(e),o.HEAP32=K=new Int32Array(e),o.HEAPU8=Y=new Uint8Array(e),o.HEAPU16=$=new Uint16Array(e),o.HEAPU32=Z=new Uint32Array(e),o.HEAPF32=ee=new Float32Array(e),o.HEAPF64=te=new Float64Array(e)}var le=5242880;o.TOTAL_STACK&&L(le===o.TOTAL_STACK,"the stack size can no longer be determined at runtime");var fe,he=o.INITIAL_MEMORY||79101952;function me(){var e=co();L(0==(3&e)),j(e+4>>2,34821223),j(e+8>>2,2310721022)}function ge(){if(!U){var e=co(),t=M(e+4>>2),r=M(e+8>>2);34821223==t&&2310721022==r||je("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+r.toString(16)+" 0x"+t.toString(16))}}Object.getOwnPropertyDescriptor(o,"INITIAL_MEMORY")||Object.defineProperty(o,"INITIAL_MEMORY",{configurable:!0,get:function(){je("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),L(he>=le,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+he+"! (TOTAL_STACK="+le+")"),L("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support"),L(!o.wasmMemory,"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally"),L(79101952==he,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically"),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)"}();var ye=[],Ee=[],ve=[],_e=!1,Te=!1,we=0;function be(){return P||we>0}function Oe(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)Ae(o.preRun.shift());Ke(ye)}function Pe(){ge(),L(!_e),_e=!0,o.noFSInit||mt.init.initialized||mt.init(),mt.ignorePermissions=!1,st.init(),Ke(Ee)}function Se(){if(ge(),o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)Re(o.postRun.shift());Ke(ve)}function Ae(e){ye.unshift(e)}function De(e){Ee.unshift(e)}function Re(e){ve.unshift(e)}L(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),L(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Ce=0,Me=null,ke=null,Ie={};function xe(e){for(var t=e;;){if(!Ie[e])return e;e=t+Math.random()}}function Fe(e){Ce++,o.monitorRunDependencies&&o.monitorRunDependencies(Ce),e?(L(!Ie[e]),Ie[e]=1,null===Me&&"undefined"!=typeof setInterval&&(Me=setInterval((function(){if(U)return clearInterval(Me),void(Me=null);var e=!1;for(var t in Ie)e||(e=!0,_("still waiting on run dependencies:")),_("dependency: "+t);e&&_("(end of list)")}),1e4))):_("warning: run dependency added without ID")}function Ne(e){if(Ce--,o.monitorRunDependencies&&o.monitorRunDependencies(Ce),e?(L(Ie[e]),delete Ie[e]):_("warning: run dependency removed without ID"),0==Ce&&(null!==Me&&(clearInterval(Me),Me=null),ke)){var t=ke;ke=null,t()}}function je(e){o.onAbort&&o.onAbort(e),_(e="Aborted("+e+")"),U=!0;var t=new WebAssembly.RuntimeError(e);throw n(t),t}o.preloadedImages={},o.preloadedAudios={};var Ve,Ue,Le,Be,qe="data:application/octet-stream;base64,";function He(e){return e.startsWith(qe)}function Qe(e){return e.startsWith("file://")}function Xe(e,t){return function(){var r=e,n=t;return t||(n=o.asm),L(_e,"native function `"+r+"` called before runtime initialization"),L(!Te,"native function `"+r+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),n[e]||L(n[e],"exported native function `"+r+"` not found"),n[e].apply(null,arguments)}}function Ge(e){try{if(e==Ve&&w)return new Uint8Array(w);if(m)return m(e);throw"both async and sync fetching of the wasm failed"}catch(e){je(e)}}function ze(){return w||!d&&!u||"function"!=typeof fetch?Promise.resolve().then((function(){return Ge(Ve)})):fetch(Ve,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Ve+"'";return e.arrayBuffer()})).catch((function(){return Ge(Ve)}))}function We(e,t){var r=8,n=0;this.offset_map={},this.func_starts=[],this.name_map={},this.import_functions=0;var o=e;function i(){var e=0,t=0;do{var n=o[r++];e+=(127&n)<<t,t+=7}while(128&n);return e}function a(){var e=i();i(),0!=(1&e)&&i()}e:for(;r<o.length;){var s=o[r++],c=i()+r;switch(s){case 2:for(var d=i();d-- >0;)switch(r=i()+r,r=i()+r,o[r++]){case 0:++n,i();break;case 1:++r,a();break;case 2:a();break;case 3:r+=2;break;default:throw"bad import kind"}this.import_functions=n;break;case 10:for(d=i();d-- >0;){var u=i();this.offset_map[n++]=r,this.func_starts.push(r),r+=u}break e}r=c}for(var p=WebAssembly.Module.customSections(t,"name"),l=0;l<p.length;++l)if(1==(o=new Uint8Array(p[l]))[0])for(r=1,i(),d=i();d-- >0;){var f=i(),h=i();this.name_map[f]=q(o,r,h),r+=h}}function Ye(e,t){var r=Object.create(e.prototype);return Object.assign(r,t)}function Je(){var e={env:Kn,wasi_snapshot_preview1:Kn};function t(e,t){var r=e.exports;o.asm=r,L(O=o.asm.memory,"memory not found in wasm exports"),pe(O.buffer),L(fe=o.asm.__indirect_function_table,"table not found in wasm exports"),De(o.asm.__wasm_call_ctors),Ne("wasm-instantiate")}Fe("wasm-instantiate");var r=o;function i(e){L(o===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,t(e.instance)}function a(t){var r;return ze().then((function(t){return r=t,WebAssembly.instantiate(t,e)})).then((function(e){return Ue=new We(r,e.module),e})).then(t,(function(e){_("failed to asynchronously prepare wasm: "+e),Qe(Ve)&&_("warning: Loading from a file URI ("+Ve+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"),je(e)}))}if(o.instantiateWasm){Ue=Ye(We,o.wasmOffsetData);try{return o.instantiateWasm(e,t)}catch(e){return _("Module.instantiateWasm callback failed with error: "+e),!1}}return(w||"function"!=typeof WebAssembly.instantiateStreaming||He(Ve)||"function"!=typeof fetch?a(i):fetch(Ve,{credentials:"same-origin"}).then((function(t){var r=WebAssembly.instantiateStreaming(t,e),n=t.clone().arrayBuffer();return r.then((function(e){n.then((function(t){Ue=new We(new Uint8Array(t),e.module),i(e)}),(function(e){_("failed to initialize offset-converter: "+e)}))}),(function(e){return _("wasm streaming compile failed: "+e),_("falling back to ArrayBuffer instantiation"),a(i)}))}))).catch(n),{}}He(Ve="mlsGen.wasm")||(Ve=y(Ve)),We.prototype.convert=function(e,t){return this.offset_map[e]+t},We.prototype.getIndex=function(e){for(var t,r=0,n=this.func_starts.length;r<n;)t=Math.floor((r+n)/2),this.func_starts[t]>e?n=t:r=t+1;return r+this.import_functions-1},We.prototype.isSameFunc=function(e,t){return this.getIndex(e)==this.getIndex(t)},We.prototype.getName=function(e){var t=this.getIndex(e);return this.name_map[t]||"wasm-function["+t+"]"};var $e={9944289:function(){return yn((function(){return de(o.ASAN_OPTIONS||0)}))},9944386:function(){return yn((function(){return de(o.LSAN_OPTIONS||0)}))},9944483:function(){return yn((function(){return de(o.UBSAN_OPTIONS||0)}))},9944581:function(){var e=o.printWithColors;return null!=e?e:p&&process.stderr.isTTY}};function Ke(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?rt(r)():rt(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(o)}}function Ze(e){return T("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function et(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){var t=Ze(e);return e===t?e:t+" ["+e+"]"}))}var tt=[];function rt(e){var t=tt[e];return t||(e>=tt.length&&(tt.length=e+1),tt[e]=t=fe.get(e)),L(fe.get(e)==t,"JavaScript-side Wasm function table mirror is out of date!"),t}function nt(e,t,r,n){je("Assertion failed: "+H(e)+", at: "+[t?H(t):"unknown filename",r,n?H(n):"unknown function"])}var ot={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=ot.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=ot.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=ot.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return ot.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return ot.normalize(e.join("/"))},join2:function(e,t){return ot.normalize(e+"/"+t)}};function it(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}return function(){je("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}}var at={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:mt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t="/"===n.charAt(0)}return(t?"/":"")+(e=ot.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=at.resolve(e).substr(1),t=at.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var c=[];for(s=a;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")}},st={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){st.ttys[e]={input:[],output:[],ops:t},mt.registerDevice(e,st.stream_ops)},stream_ops:{open:function(e){var t=st.ttys[e.node.rdev];if(!t)throw new mt.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new mt.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new mt.ErrnoError(29)}if(void 0===s&&0===i)throw new mt.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new mt.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new mt.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;e.input=Jn(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(v(q(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(v(q(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(_(q(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(_(q(e.output,0)),e.output=[])}}};function ct(e,t){Y.fill(0,e,e+t)}function dt(e,t){return L(t,"alignment argument is required"),Math.ceil(e/t)*t}function ut(e){e=dt(e,65536);var t=no(65536,e);return t?(ct(t,e),t):0}var pt={ops_table:null,mount:function(e){return pt.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(mt.isBlkdev(r)||mt.isFIFO(r))throw new mt.ErrnoError(63);pt.ops_table||(pt.ops_table={dir:{node:{getattr:pt.node_ops.getattr,setattr:pt.node_ops.setattr,lookup:pt.node_ops.lookup,mknod:pt.node_ops.mknod,rename:pt.node_ops.rename,unlink:pt.node_ops.unlink,rmdir:pt.node_ops.rmdir,readdir:pt.node_ops.readdir,symlink:pt.node_ops.symlink},stream:{llseek:pt.stream_ops.llseek}},file:{node:{getattr:pt.node_ops.getattr,setattr:pt.node_ops.setattr},stream:{llseek:pt.stream_ops.llseek,read:pt.stream_ops.read,write:pt.stream_ops.write,allocate:pt.stream_ops.allocate,mmap:pt.stream_ops.mmap,msync:pt.stream_ops.msync}},link:{node:{getattr:pt.node_ops.getattr,setattr:pt.node_ops.setattr,readlink:pt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:pt.node_ops.getattr,setattr:pt.node_ops.setattr},stream:mt.chrdev_stream_ops}});var o=mt.createNode(e,t,r,n);return mt.isDir(o.mode)?(o.node_ops=pt.ops_table.dir.node,o.stream_ops=pt.ops_table.dir.stream,o.contents={}):mt.isFile(o.mode)?(o.node_ops=pt.ops_table.file.node,o.stream_ops=pt.ops_table.file.stream,o.usedBytes=0,o.contents=null):mt.isLink(o.mode)?(o.node_ops=pt.ops_table.link.node,o.stream_ops=pt.ops_table.link.stream):mt.isChrdev(o.mode)&&(o.node_ops=pt.ops_table.chrdev.node,o.stream_ops=pt.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=mt.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,mt.isDir(e.mode)?t.size=4096:mt.isFile(e.mode)?t.size=e.usedBytes:mt.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&pt.resizeFileStorage(e,t.size)},lookup:function(e,t){throw mt.genericErrors[44]},mknod:function(e,t,r,n){return pt.createNode(e,t,r,n)},rename:function(e,t,r){if(mt.isDir(e.mode)){var n;try{n=mt.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new mt.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=mt.lookupNode(e,t);for(var n in r.contents)throw new mt.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=pt.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!mt.isLink(e.mode))throw new mt.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(L(a>=0),a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write:function(e,t,r,n,o,i){if(L(!(t instanceof ArrayBuffer)),!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return L(0===o,"canOwn must imply no weird position inside the file"),a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(pt.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&mt.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new mt.ErrnoError(28);return n},allocate:function(e,t,r){pt.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,i){if(0!==t)throw new mt.ErrnoError(28);if(!mt.isFile(e.node.mode))throw new mt.ErrnoError(43);var a,s,c=e.node.contents;if(2&i||c.buffer!==z){if((n>0||n+r<c.length)&&(c=c.subarray?c.subarray(n,n+r):Array.prototype.slice.call(c,n,n+r)),s=!0,!(a=ut(r)))throw new mt.ErrnoError(48);W.set(c,a)}else s=!1,a=c.byteOffset;return{ptr:a,allocated:s}},msync:function(e,t,r,n,o){if(!mt.isFile(e.node.mode))throw new mt.ErrnoError(43);return 2&o||pt.stream_ops.write(e,t,0,n,r,!1),0}}};function lt(e,t,r,n){var o=n?"":xe("al "+e);h(e,(function(r){L(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&Ne(o)}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&Fe(o)}var ft={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"},ht={},mt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=at.resolve(mt.cwd(),e)))return{path:"",node:null};var r={follow_mount:!0,recurse_count:0};for(var n in r)void 0===t[n]&&(t[n]=r[n]);if(t.recurse_count>8)throw new mt.ErrnoError(32);for(var o=ot.normalizeArray(e.split("/").filter((e=>!!e)),!1),i=mt.root,a="/",s=0;s<o.length;s++){var c=s===o.length-1;if(c&&t.parent)break;if(i=mt.lookupNode(i,o[s]),a=ot.join2(a,o[s]),mt.isMountpoint(i)&&(!c||c&&t.follow_mount)&&(i=i.mounted.root),!c||t.follow)for(var d=0;mt.isLink(i.mode);){var u=mt.readlink(a);if(a=at.resolve(ot.dirname(a),u),i=mt.lookupPath(a,{recurse_count:t.recurse_count}).node,d++>40)throw new mt.ErrnoError(32)}}return{path:a,node:i}},getPath:e=>{for(var t;;){if(mt.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%mt.nameTable.length},hashAddNode:e=>{var t=mt.hashName(e.parent.id,e.name);e.name_next=mt.nameTable[t],mt.nameTable[t]=e},hashRemoveNode:e=>{var t=mt.hashName(e.parent.id,e.name);if(mt.nameTable[t]===e)mt.nameTable[t]=e.name_next;else for(var r=mt.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=mt.mayLookup(e);if(r)throw new mt.ErrnoError(r,e);for(var n=mt.hashName(e.id,t),o=mt.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return mt.lookup(e,t)},createNode:(e,t,r,n)=>{L("object"==typeof e);var o=new mt.FSNode(e,t,r,n);return mt.hashAddNode(o),o},destroyNode:e=>{mt.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=mt.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>mt.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>mt.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return mt.lookupNode(e,t),20}catch(e){}return mt.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=mt.lookupNode(e,t)}catch(e){return e.errno}var o=mt.nodePermissions(e,"wx");if(o)return o;if(r){if(!mt.isDir(n.mode))return 54;if(mt.isRoot(n)||mt.getPath(n)===mt.cwd())return 10}else if(mt.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?mt.isLink(e.mode)?32:mt.isDir(e.mode)&&("r"!==mt.flagsToPermissionString(t)||512&t)?31:mt.nodePermissions(e,mt.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=mt.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!mt.streams[r])return r;throw new mt.ErrnoError(33)},getStream:e=>mt.streams[e],createStream:(e,t,r)=>{mt.FSStream||(mt.FSStream=function(){},mt.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}),e=Object.assign(new mt.FSStream,e);var n=mt.nextfd(t,r);return e.fd=n,mt.streams[n]=e,e},closeStream:e=>{mt.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=mt.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new mt.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{mt.devices[e]={stream_ops:t}},getDevice:e=>mt.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),mt.syncFSRequests++,mt.syncFSRequests>1&&_("warning: "+mt.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=mt.getMounts(mt.root.mount),n=0;function o(e){return L(mt.syncFSRequests>0),mt.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{if("string"==typeof e)throw e;var n,o="/"===r,i=!r;if(o&&mt.root)throw new mt.ErrnoError(10);if(!o&&!i){var a=mt.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,mt.isMountpoint(n))throw new mt.ErrnoError(10);if(!mt.isDir(n.mode))throw new mt.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,o?mt.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:e=>{var t=mt.lookupPath(e,{follow_mount:!1});if(!mt.isMountpoint(t.node))throw new mt.ErrnoError(28);var r=t.node,n=r.mounted,o=mt.getMounts(n);Object.keys(mt.nameTable).forEach((e=>{for(var t=mt.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&mt.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);L(-1!==i),r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=mt.lookupPath(e,{parent:!0}).node,o=ot.basename(e);if(!o||"."===o||".."===o)throw new mt.ErrnoError(28);var i=mt.mayCreate(n,o);if(i)throw new mt.ErrnoError(i);if(!n.node_ops.mknod)throw new mt.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,mt.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,mt.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{mt.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,mt.mknod(e,t,r)),symlink:(e,t)=>{if(!at.resolve(e))throw new mt.ErrnoError(44);var r=mt.lookupPath(t,{parent:!0}).node;if(!r)throw new mt.ErrnoError(44);var n=ot.basename(t),o=mt.mayCreate(r,n);if(o)throw new mt.ErrnoError(o);if(!r.node_ops.symlink)throw new mt.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=ot.dirname(e),i=ot.dirname(t),a=ot.basename(e),s=ot.basename(t);if(r=mt.lookupPath(e,{parent:!0}).node,n=mt.lookupPath(t,{parent:!0}).node,!r||!n)throw new mt.ErrnoError(44);if(r.mount!==n.mount)throw new mt.ErrnoError(75);var c,d=mt.lookupNode(r,a),u=at.relative(e,i);if("."!==u.charAt(0))throw new mt.ErrnoError(28);if("."!==(u=at.relative(t,o)).charAt(0))throw new mt.ErrnoError(55);try{c=mt.lookupNode(n,s)}catch(e){}if(d!==c){var p=mt.isDir(d.mode),l=mt.mayDelete(r,a,p);if(l)throw new mt.ErrnoError(l);if(l=c?mt.mayDelete(n,s,p):mt.mayCreate(n,s))throw new mt.ErrnoError(l);if(!r.node_ops.rename)throw new mt.ErrnoError(63);if(mt.isMountpoint(d)||c&&mt.isMountpoint(c))throw new mt.ErrnoError(10);if(n!==r&&(l=mt.nodePermissions(r,"w")))throw new mt.ErrnoError(l);mt.hashRemoveNode(d);try{r.node_ops.rename(d,n,s)}catch(e){throw e}finally{mt.hashAddNode(d)}}},rmdir:e=>{var t=mt.lookupPath(e,{parent:!0}).node,r=ot.basename(e),n=mt.lookupNode(t,r),o=mt.mayDelete(t,r,!0);if(o)throw new mt.ErrnoError(o);if(!t.node_ops.rmdir)throw new mt.ErrnoError(63);if(mt.isMountpoint(n))throw new mt.ErrnoError(10);t.node_ops.rmdir(t,r),mt.destroyNode(n)},readdir:e=>{var t=mt.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new mt.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=mt.lookupPath(e,{parent:!0}).node;if(!t)throw new mt.ErrnoError(44);var r=ot.basename(e),n=mt.lookupNode(t,r),o=mt.mayDelete(t,r,!1);if(o)throw new mt.ErrnoError(o);if(!t.node_ops.unlink)throw new mt.ErrnoError(63);if(mt.isMountpoint(n))throw new mt.ErrnoError(10);t.node_ops.unlink(t,r),mt.destroyNode(n)},readlink:e=>{var t=mt.lookupPath(e).node;if(!t)throw new mt.ErrnoError(44);if(!t.node_ops.readlink)throw new mt.ErrnoError(28);return at.resolve(mt.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=mt.lookupPath(e,{follow:!t}).node;if(!r)throw new mt.ErrnoError(44);if(!r.node_ops.getattr)throw new mt.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>mt.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?mt.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new mt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{mt.chmod(e,t,!0)},fchmod:(e,t)=>{var r=mt.getStream(e);if(!r)throw new mt.ErrnoError(8);mt.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?mt.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new mt.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{mt.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=mt.getStream(e);if(!n)throw new mt.ErrnoError(8);mt.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new mt.ErrnoError(28);var r;if(!(r="string"==typeof e?mt.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new mt.ErrnoError(63);if(mt.isDir(r.mode))throw new mt.ErrnoError(31);if(!mt.isFile(r.mode))throw new mt.ErrnoError(28);var n=mt.nodePermissions(r,"w");if(n)throw new mt.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=mt.getStream(e);if(!r)throw new mt.ErrnoError(8);if(0==(2097155&r.flags))throw new mt.ErrnoError(28);mt.truncate(r.node,t)},utime:(e,t,r)=>{var n=mt.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r,n,i)=>{if(""===e)throw new mt.ErrnoError(44);var a;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?mt.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)a=e;else{e=ot.normalize(e);try{a=mt.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(a){if(128&t)throw new mt.ErrnoError(20)}else a=mt.mknod(e,r,0),s=!0;if(!a)throw new mt.ErrnoError(44);if(mt.isChrdev(a.mode)&&(t&=-513),65536&t&&!mt.isDir(a.mode))throw new mt.ErrnoError(54);if(!s){var c=mt.mayOpen(a,t);if(c)throw new mt.ErrnoError(c)}512&t&&mt.truncate(a,0),t&=-131713;var d=mt.createStream({node:a,path:mt.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,i);return d.stream_ops.open&&d.stream_ops.open(d),!o.logReadFiles||1&t||(mt.readFiles||(mt.readFiles={}),e in mt.readFiles||(mt.readFiles[e]=1)),d},close:e=>{if(mt.isClosed(e))throw new mt.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{mt.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(mt.isClosed(e))throw new mt.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new mt.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new mt.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,n,o)=>{if(n<0||o<0)throw new mt.ErrnoError(28);if(mt.isClosed(e))throw new mt.ErrnoError(8);if(1==(2097155&e.flags))throw new mt.ErrnoError(8);if(mt.isDir(e.node.mode))throw new mt.ErrnoError(31);if(!e.stream_ops.read)throw new mt.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new mt.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new mt.ErrnoError(28);if(mt.isClosed(e))throw new mt.ErrnoError(8);if(0==(2097155&e.flags))throw new mt.ErrnoError(8);if(mt.isDir(e.node.mode))throw new mt.ErrnoError(31);if(!e.stream_ops.write)throw new mt.ErrnoError(28);e.seekable&&1024&e.flags&&mt.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new mt.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:(e,t,r)=>{if(mt.isClosed(e))throw new mt.ErrnoError(8);if(t<0||r<=0)throw new mt.ErrnoError(28);if(0==(2097155&e.flags))throw new mt.ErrnoError(8);if(!mt.isFile(e.node.mode)&&!mt.isDir(e.node.mode))throw new mt.ErrnoError(43);if(!e.stream_ops.allocate)throw new mt.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o,i)=>{if(0!=(2&o)&&0==(2&i)&&2!=(2097155&e.flags))throw new mt.ErrnoError(2);if(1==(2097155&e.flags))throw new mt.ErrnoError(2);if(!e.stream_ops.mmap)throw new mt.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o,i)},msync:(e,t,r,n,o)=>e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new mt.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,n=mt.open(e,t.flags),o=mt.stat(e).size,i=new Uint8Array(o);return mt.read(n,i,0,o,0),"utf8"===t.encoding?r=q(i,0):"binary"===t.encoding&&(r=i),mt.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=mt.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(G(t)+1),i=Q(t,o,0,o.length);mt.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");mt.write(n,t,0,t.byteLength,void 0,r.canOwn)}mt.close(n)},cwd:()=>mt.currentPath,chdir:e=>{var t=mt.lookupPath(e,{follow:!0});if(null===t.node)throw new mt.ErrnoError(44);if(!mt.isDir(t.node.mode))throw new mt.ErrnoError(54);var r=mt.nodePermissions(t.node,"x");if(r)throw new mt.ErrnoError(r);mt.currentPath=t.path},createDefaultDirectories:()=>{mt.mkdir("/tmp"),mt.mkdir("/home"),mt.mkdir("/home/web_user")},createDefaultDevices:()=>{mt.mkdir("/dev"),mt.registerDevice(mt.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),mt.mkdev("/dev/null",mt.makedev(1,3)),st.register(mt.makedev(5,0),st.default_tty_ops),st.register(mt.makedev(6,0),st.default_tty1_ops),mt.mkdev("/dev/tty",mt.makedev(5,0)),mt.mkdev("/dev/tty1",mt.makedev(6,0));var e=it();mt.createDevice("/dev","random",e),mt.createDevice("/dev","urandom",e),mt.mkdir("/dev/shm"),mt.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{mt.mkdir("/proc");var e=mt.mkdir("/proc/self");mt.mkdir("/proc/self/fd"),mt.mount({mount:()=>{var t=mt.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=mt.getStream(r);if(!n)throw new mt.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{o.stdin?mt.createDevice("/dev","stdin",o.stdin):mt.symlink("/dev/tty","/dev/stdin"),o.stdout?mt.createDevice("/dev","stdout",null,o.stdout):mt.symlink("/dev/tty","/dev/stdout"),o.stderr?mt.createDevice("/dev","stderr",null,o.stderr):mt.symlink("/dev/tty1","/dev/stderr");var e=mt.open("/dev/stdin",0),t=mt.open("/dev/stdout",1),r=mt.open("/dev/stderr",1);L(0===e.fd,"invalid handle for stdin ("+e.fd+")"),L(1===t.fd,"invalid handle for stdout ("+t.fd+")"),L(2===r.fd,"invalid handle for stderr ("+r.fd+")")},ensureErrnoError:()=>{mt.ErrnoError||(mt.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){for(var t in this.errno=e,ht)if(ht[t]===e){this.code=t;break}},this.setErrno(e),this.message=ft[e],this.stack&&(Object.defineProperty(this,"stack",{value:(new Error).stack,writable:!0}),this.stack=et(this.stack))},mt.ErrnoError.prototype=new Error,mt.ErrnoError.prototype.constructor=mt.ErrnoError,[44].forEach((e=>{mt.genericErrors[e]=new mt.ErrnoError(e),mt.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{mt.ensureErrnoError(),mt.nameTable=new Array(4096),mt.mount(pt,{},"/"),mt.createDefaultDirectories(),mt.createDefaultDevices(),mt.createSpecialDirectories(),mt.filesystems={MEMFS:pt}},init:(e,t,r)=>{L(!mt.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),mt.init.initialized=!0,mt.ensureErrnoError(),o.stdin=e||o.stdin,o.stdout=t||o.stdout,o.stderr=r||o.stderr,mt.createStandardStreams()},quit:()=>{mt.init.initialized=!1,eo();for(var e=0;e<mt.streams.length;e++){var t=mt.streams[e];t&&mt.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=mt.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=mt.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=mt.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ot.basename(e),n=mt.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,n)=>{e="string"==typeof e?e:mt.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ot.join2(e,i);try{mt.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=ot.join2("string"==typeof e?e:mt.getPath(e),t),a=mt.getMode(n,o);return mt.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:mt.getPath(e),a=t?ot.join2(e,t):e);var s=mt.getMode(n,o),c=mt.create(a,s);if(r){if("string"==typeof r){for(var d=new Array(r.length),u=0,p=r.length;u<p;++u)d[u]=r.charCodeAt(u);r=d}mt.chmod(c,146|s);var l=mt.open(c,577);mt.write(l,r,0,r.length,0,i),mt.close(l),mt.chmod(c,s)}return c},createDevice:(e,t,r,n)=>{var o=ot.join2("string"==typeof e?e:mt.getPath(e),t),i=mt.getMode(!!r,!!n);mt.createDevice.major||(mt.createDevice.major=64);var a=mt.makedev(mt.createDevice.major++,0);return mt.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var c;try{c=r()}catch(e){throw new mt.ErrnoError(29)}if(void 0===c&&0===a)throw new mt.ErrnoError(6);if(null==c)break;a++,t[n+s]=c}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new mt.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),mt.mkdev(o,i,a)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!f)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Jn(f(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new mt.ErrnoError(29)}},createLazyFile:(e,t,r,n,o)=>{function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((e=>{var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Jn(o.responseText||"",!0)})(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,v("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!u)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var c=mt.createFile(e,t,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var d={};return Object.keys(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];d[e]=function(){return mt.forceLoadFile(c),t.apply(null,arguments)}})),d.read=(e,t,r,n,o)=>{mt.forceLoadFile(c);var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(L(a>=0),i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a},c.stream_ops=d,c},createPreloadedFile:(e,t,r,n,o,i,a,s,c,d)=>{var u=t?at.resolve(ot.join2(e,t)):e,p=xe("cp "+u);function l(r){function l(r){d&&d(),s||mt.createDataFile(e,t,r,n,o,c),i&&i(),Ne(p)}Browser.handledByPreloadPlugin(r,u,l,(()=>{a&&a(),Ne(p)}))||l(r)}Fe(p),"string"==typeof r?lt(r,(e=>l(e)),a):l(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=mt.indexedDB();try{var o=n.open(mt.DB_NAME(),mt.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{v("creating db"),o.result.createObjectStore(mt.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([mt.DB_STORE_NAME],"readwrite"),i=n.objectStore(mt.DB_STORE_NAME),a=0,s=0,c=e.length;function d(){0==s?t():r()}e.forEach((e=>{var t=i.put(mt.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==c&&d()},t.onerror=()=>{s++,a+s==c&&d()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=mt.indexedDB();try{var o=n.open(mt.DB_NAME(),mt.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([mt.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(mt.DB_STORE_NAME),s=0,c=0,d=e.length;function u(){0==c?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{mt.analyzePath(e).exists&&mt.unlink(e),mt.createDataFile(ot.dirname(e),ot.basename(e),t.result,!0,!0,!0),++s+c==d&&u()},t.onerror=()=>{c++,s+c==d&&u()}})),i.onerror=r},o.onerror=r},absolutePath:()=>{je("FS.absolutePath has been removed; use PATH_FS.resolve instead")},createFolder:()=>{je("FS.createFolder has been removed; use FS.mkdir instead")},createLink:()=>{je("FS.createLink has been removed; use FS.symlink instead")},joinPath:()=>{je("FS.joinPath has been removed; use PATH.join instead")},mmapAlloc:()=>{je("FS.mmapAlloc has been replaced by the top level function mmapAlloc")},standardizePath:()=>{je("FS.standardizePath has been removed; use PATH.normalize instead")}},gt={mappings:{},DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if("/"===t[0])return t;var n;if(-100===e)n=mt.cwd();else{var o=mt.getStream(e);if(!o)throw new mt.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new mt.ErrnoError(44);return n}return ot.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&ot.normalize(t)!==ot.normalize(mt.getPath(e.node)))return-54;throw e}return j(r>>2,n.dev),j(r+4>>2,0),j(r+8>>2,n.ino),j(r+12>>2,n.mode),j(r+16>>2,n.nlink),j(r+20>>2,n.uid),j(r+24>>2,n.gid),j(r+28>>2,n.rdev),j(r+32>>2,0),j(r+40>>2,(Be=[n.size>>>0,(Le=n.size,+Math.abs(Le)>=1?Le>0?(0|Math.min(+Math.floor(Le/4294967296),4294967295))>>>0:~~+Math.ceil((Le-+(~~Le>>>0))/4294967296)>>>0:0)])[0]),j(r+44>>2,Be[1]),j(r+48>>2,4096),j(r+52>>2,n.blocks),j(r+56>>2,n.atime.getTime()/1e3|0),j(r+60>>2,0),j(r+64>>2,n.mtime.getTime()/1e3|0),j(r+68>>2,0),j(r+72>>2,n.ctime.getTime()/1e3|0),j(r+76>>2,0),j(r+80>>2,(Be=[n.ino>>>0,(Le=n.ino,+Math.abs(Le)>=1?Le>0?(0|Math.min(+Math.floor(Le/4294967296),4294967295))>>>0:~~+Math.ceil((Le-+(~~Le>>>0))/4294967296)>>>0:0)])[0]),j(r+84>>2,Be[1]),0},doMsync:function(e,t,r,n,o){var i=Y.slice(e,e+r);mt.msync(t,i,o,r,n)},doMkdir:function(e,t){return"/"===(e=ot.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),mt.mkdir(e,t,0),0},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return mt.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var n=mt.readlink(e),o=Math.min(r,G(n)),i=S(t+o);return X(n,t,r+1),x(t+o,i),o},doAccess:function(e,t){if(-8&t)return-28;var r=mt.lookupPath(e,{follow:!0}).node;if(!r)return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&mt.nodePermissions(r,n)?-2:0},doDup:function(e,t,r){var n=mt.getStream(r);return n&&mt.close(n),mt.open(e,t,0,r,r).fd},doReadv:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=C(t+8*i>>2),s=C(t+(8*i+4)>>2),c=mt.read(e,W,a,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o},doWritev:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=C(t+8*i>>2),s=C(t+(8*i+4)>>2),c=mt.write(e,W,a,s,n);if(c<0)return-1;o+=c}return o},varargs:void 0,get:function(){return L(null!=gt.varargs),gt.varargs+=4,C(gt.varargs-4>>2)},getStr:function(e){return H(e)},getStreamFromFD:function(e){var t=mt.getStream(e);if(!t)throw new mt.ErrnoError(8);return t},get64:function(e,t){return L(e>=0?0===t:-1===t),e}};function yt(e){try{var t=gt.getStreamFromFD(e);return mt.open(t.path,t.flags,0).fd}catch(e){if(void 0===mt||!(e instanceof mt.ErrnoError))throw e;return-e.errno}}function Et(e,t,r){gt.varargs=r;try{var n=gt.getStr(e),o=r?gt.get():0;return mt.open(n,t,o).fd}catch(e){if(void 0===mt||!(e instanceof mt.ErrnoError))throw e;return-e.errno}}function vt(e,t){try{return e=gt.getStr(e),gt.doStat(mt.stat,e,t)}catch(e){if(void 0===mt||!(e instanceof mt.ErrnoError))throw e;return-e.errno}}function _t(e,t,r,n,o){}function Tt(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}function wt(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);bt=e}var bt=void 0;function Ot(e){for(var t="",r=e;A(r);)t+=bt[A(r++)];return t}var Pt={},St={},At={},Dt=48,Rt=57;function Ct(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=Dt&&t<=Rt?"_"+e:e}function Mt(e,t){return e=Ct(e),new Function("body","return function "+e+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(t)}function kt(e,t){var r=Mt(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var It=void 0;function xt(e){throw new It(e)}var Ft=void 0;function Nt(e){throw new Ft(e)}function jt(e,t,r){function n(t){var n=r(t);n.length!==e.length&&Nt("Mismatched type converter count");for(var o=0;o<e.length;++o)Vt(e[o],n[o])}e.forEach((function(e){At[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach((function(e,t){St.hasOwnProperty(e)?o[t]=St[e]:(i.push(e),Pt.hasOwnProperty(e)||(Pt[e]=[]),Pt[e].push((function(){o[t]=St[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function Vt(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||xt('type "'+n+'" must have a positive integer typeid pointer'),St.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;xt("Cannot register type '"+n+"' twice")}if(St[e]=t,delete At[e],Pt.hasOwnProperty(e)){var o=Pt[e];delete Pt[e],o.forEach((function(e){e()}))}}function Ut(e,t,r,n,o){var i=Tt(r);Vt(e,{name:t=Ot(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=W;else if(2===r)n=J;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=K}return this.fromWireType(n[e>>i])},destructorFunction:null})}function Lt(e){if(!(this instanceof fr))return!1;if(!(e instanceof fr))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o}function Bt(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}function qt(e){xt(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Ht=!1;function Qt(e){}function Xt(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}function Gt(e){e.count.value-=1,0===e.count.value&&Xt(e)}function zt(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=zt(e,t,r.baseClass);return null===n?null:r.downcast(n)}var Wt={};function Yt(){return Object.keys(rr).length}function Jt(){var e=[];for(var t in rr)rr.hasOwnProperty(t)&&e.push(rr[t]);return e}var $t=[];function Kt(){for(;$t.length;){var e=$t.pop();e.$$.deleteScheduled=!1,e.delete()}}var Zt=void 0;function er(e){Zt=e,$t.length&&Zt&&Zt(Kt)}function tr(){o.getInheritedInstanceCount=Yt,o.getLiveInheritedInstances=Jt,o.flushPendingDeletes=Kt,o.setDelayFunction=er}var rr={};function nr(e,t){for(void 0===t&&xt("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}function or(e,t){return t=nr(e,t),rr[t]}function ir(e,t){return t.ptrType&&t.ptr||Nt("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Nt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},sr(Object.create(e,{$$:{value:t}}))}function ar(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=or(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?ir(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):ir(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=Wt[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var c=zt(t,this.registeredClass,i.registeredClass);return null===c?o.call(this):this.isSmartPointer?ir(i.registeredClass.instancePrototype,{ptrType:i,ptr:c,smartPtrType:this,smartPtr:e}):ir(i.registeredClass.instancePrototype,{ptrType:i,ptr:c})}function sr(e){return"undefined"==typeof FinalizationRegistry?(sr=e=>e,e):(Ht=new FinalizationRegistry((e=>{console.warn(e.leakWarning.stack.replace(/^Error: /,"")),Gt(e.$$)})),Qt=e=>Ht.unregister(e),(sr=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t},n=t.ptrType.registeredClass;r.leakWarning=new Error("Embind found a leaked C++ instance "+n.name+" <0x"+t.ptr.toString(16)+">.\nWe'll free it automatically in this case, but this functionality is not reliable across various environments.\nMake sure to invoke .delete() manually once you're done with the instance instead.\nOriginally allocated"),"captureStackTrace"in Error&&Error.captureStackTrace(r.leakWarning,ar),Ht.register(e,r,e)}return e})(e))}function cr(){if(this.$$.ptr||qt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=sr(Object.create(Object.getPrototypeOf(this),{$$:{value:Bt(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function dr(){this.$$.ptr||qt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&xt("Object already scheduled for deletion"),Qt(this),Gt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function ur(){return!this.$$.ptr}function pr(){return this.$$.ptr||qt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&xt("Object already scheduled for deletion"),$t.push(this),1===$t.length&&Zt&&Zt(Kt),this.$$.deleteScheduled=!0,this}function lr(){fr.prototype.isAliasOf=Lt,fr.prototype.clone=cr,fr.prototype.delete=dr,fr.prototype.isDeleted=ur,fr.prototype.deleteLater=pr}function fr(){}function hr(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||xt("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[t].overloadTable+")!"),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}}function mr(e,t,r){o.hasOwnProperty(e)?((void 0===r||void 0!==o[e].overloadTable&&void 0!==o[e].overloadTable[r])&&xt("Cannot register public name '"+e+"' twice"),hr(o,e,e),o.hasOwnProperty(r)&&xt("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),o[e].overloadTable[r]=t):(o[e]=t,void 0!==r&&(o[e].numArguments=r))}function gr(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function yr(e,t,r){for(;t!==r;)t.upcast||xt("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function Er(e,t){if(null===t)return this.isReference&&xt("null is not a valid "+this.name),0;t.$$||xt('Cannot pass "'+Jr(t)+'" as a '+this.name),t.$$.ptr||xt("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return yr(t.$$.ptr,r,this.registeredClass)}function vr(e,t){var r;if(null===t)return this.isReference&&xt("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||xt('Cannot pass "'+Jr(t)+'" as a '+this.name),t.$$.ptr||xt("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&xt("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);var n=t.$$.ptrType.registeredClass;if(r=yr(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&xt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:xt("Cannot convert argument of type "+(t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,Wr.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:xt("Unsupporting sharing policy")}return r}function _r(e,t){if(null===t)return this.isReference&&xt("null is not a valid "+this.name),0;t.$$||xt('Cannot pass "'+Jr(t)+'" as a '+this.name),t.$$.ptr||xt("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&xt("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return yr(t.$$.ptr,r,this.registeredClass)}function Tr(e){return this.fromWireType(M(e>>2))}function wr(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function br(e){this.rawDestructor&&this.rawDestructor(e)}function Or(e){null!==e&&e.delete()}function Pr(){Sr.prototype.getPointee=wr,Sr.prototype.destructor=br,Sr.prototype.argPackAdvance=8,Sr.prototype.readValueFromPointer=Tr,Sr.prototype.deleteObject=Or,Sr.prototype.fromWireType=ar}function Sr(e,t,r,n,o,i,a,s,c,d,u){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=d,this.rawDestructor=u,o||void 0!==t.baseClass?this.toWireType=vr:n?(this.toWireType=Er,this.destructorFunction=null):(this.toWireType=_r,this.destructorFunction=null)}function Ar(e,t,r){o.hasOwnProperty(e)||Nt("Replacing nonexistant public symbol"),void 0!==o[e].overloadTable&&void 0!==r?o[e].overloadTable[r]=t:(o[e]=t,o[e].argCount=r)}function Dr(e,t,r){L("dynCall_"+e in o,"bad function pointer type - no table for sig '"+e+"'"),r&&r.length?L(r.length===e.substring(1).replace(/j/g,"--").length):L(1==e.length);var n=o["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)}function Rr(e,t,r){return e.includes("j")?Dr(e,t,r):(L(rt(t),"missing table entry in dynCall: "+t),rt(t).apply(null,r))}function Cr(e,t){L(e.includes("j"),"getDynCaller should only be called with i64 sigs");var r=[];return function(){return r.length=0,Object.assign(r,arguments),Rr(e,t,r)}}function Mr(e,t){var r=(e=Ot(e)).includes("j")?Cr(e,t):rt(t);return"function"!=typeof r&&xt("unknown function pointer with signature "+e+": "+t),r}var kr=void 0;function Ir(e){var t=Zn(e),r=Ot(t);return ro(t),r}function xr(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||St[t]||(At[t]?At[t].forEach(e):(r.push(t),n[t]=!0))})),new kr(e+": "+r.map(Ir).join([", "]))}function Fr(e,t,r,n,o,i,a,s,c,d,u,p,l){u=Ot(u),i=Mr(o,i),s&&(s=Mr(a,s)),d&&(d=Mr(c,d)),l=Mr(p,l);var f=Ct(u);mr(f,(function(){xr("Cannot construct "+u+" due to unbound types",[n])})),jt([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:fr.prototype;var a=Mt(f,(function(){if(Object.getPrototypeOf(this)!==c)throw new It("Use 'new' to construct "+u);if(void 0===p.constructor_body)throw new It(u+" has no accessible constructor");var e=p.constructor_body[arguments.length];if(void 0===e)throw new It("Tried to invoke ctor of "+u+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(p.constructor_body).toString()+") parameters instead!");return e.apply(this,arguments)})),c=Object.create(o,{constructor:{value:a}});a.prototype=c;var p=new gr(u,a,c,l,r,i,s,d),h=new Sr(u,p,!0,!1,!1),m=new Sr(u+"*",p,!1,!1,!1),g=new Sr(u+" const*",p,!1,!0,!1);return Wt[e]={pointerType:m,constPointerType:g},Ar(f,a),[h,m,g]}))}function Nr(e,t){for(var r=[],n=0;n<e;n++)r.push(C((t>>2)+n));return r}function jr(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function Vr(e,t,r,n,o,i){L(t>0);var a=Nr(t,r);o=Mr(n,o),jt([],[e],(function(e){var r="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new It("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[t-1]=()=>{xr("Cannot construct "+e.name+" due to unbound types",a)},jt([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=Lr(r,n,null,o,i),[]})),[]}))}function Ur(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var r=Mt(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function Lr(e,t,r,n,o){var i=t.length;i<2&&xt("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==r,s=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){s=!0;break}var d="void"!==t[0].name,u="",p="";for(c=0;c<i-2;++c)u+=(0!==c?", ":"")+"arg"+c,p+=(0!==c?", ":"")+"arg"+c+"Wired";var l="return function "+Ct(e)+"("+u+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(l+="var destructors = [];\n");var f=s?"destructors":"null",h=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[xt,n,o,jr,t[0],t[1]];for(a&&(l+="var thisWired = classParam.toWireType("+f+", this);\n"),c=0;c<i-2;++c)l+="var arg"+c+"Wired = argType"+c+".toWireType("+f+", arg"+c+"); // "+t[c+2].name+"\n",h.push("argType"+c),m.push(t[c+2]);if(a&&(p="thisWired"+(p.length>0?", ":"")+p),l+=(d?"var rv = ":"")+"invoker(fn"+(p.length>0?", ":"")+p+");\n",s)l+="runDestructors(destructors);\n";else for(c=a?1:2;c<t.length;++c){var g=1===c?"thisWired":"arg"+(c-2)+"Wired";null!==t[c].destructorFunction&&(l+=g+"_dtor("+g+"); // "+t[c].name+"\n",h.push(g+"_dtor"),m.push(t[c].destructorFunction))}return d&&(l+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),l+="}\n",h.push(l),Ur(Function,h).apply(null,m)}function Br(e,t,r,n,o,i,a,s){var c=Nr(r,n);t=Ot(t),i=Mr(o,i),jt([],[e],(function(e){var n=(e=e[0]).name+"."+t;function o(){xr("Cannot call "+n+" due to unbound types",c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var d=e.registeredClass.instancePrototype,u=d[t];return void 0===u||void 0===u.overloadTable&&u.className!==e.name&&u.argCount===r-2?(o.argCount=r-2,o.className=e.name,d[t]=o):(hr(d,t,n),d[t].overloadTable[r-2]=o),jt([],c,(function(o){var s=Lr(n,o,e,i,a);return void 0===d[t].overloadTable?(s.argCount=r-2,d[t]=s):d[t].overloadTable[r-2]=s,[]})),[]}))}var qr=[],Hr=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Qr(e){e>4&&0==--Hr[e].refcount&&(Hr[e]=void 0,qr.push(e))}function Xr(){for(var e=0,t=5;t<Hr.length;++t)void 0!==Hr[t]&&++e;return e}function Gr(){for(var e=5;e<Hr.length;++e)if(void 0!==Hr[e])return Hr[e];return null}function zr(){o.count_emval_handles=Xr,o.get_first_emval=Gr}var Wr={toValue:function(e){return e||xt("Cannot use deleted val. handle = "+e),Hr[e].value},toHandle:function(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=qr.length?qr.pop():Hr.length;return Hr[t]={refcount:1,value:e},t}}};function Yr(e,t){Vt(e,{name:t=Ot(t),fromWireType:function(e){var t=Wr.toValue(e);return Qr(e),t},toWireType:function(e,t){return Wr.toHandle(t)},argPackAdvance:8,readValueFromPointer:Tr,destructorFunction:null})}function Jr(e){if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e}function $r(e,t){switch(t){case 2:return function(e){return this.fromWireType(k(e>>2))};case 3:return function(e){return this.fromWireType(I(e>>3))};default:throw new TypeError("Unknown float type: "+e)}}function Kr(e,t,r){var n=Tt(r);Vt(e,{name:t=Ot(t),fromWireType:function(e){return e},toWireType:function(e,t){if("number"!=typeof t&&"boolean"!=typeof t)throw new TypeError('Cannot convert "'+Jr(t)+'" to '+this.name);return t},argPackAdvance:8,readValueFromPointer:$r(t,n),destructorFunction:null})}function Zr(e,t,r,n,o,i){var a=Nr(t,r);e=Ot(e),o=Mr(n,o),mr(e,(function(){xr("Cannot call "+e+" due to unbound types",a)}),t-1),jt([],a,(function(r){var n=[r[0],null].concat(r.slice(1));return Ar(e,Lr(e,n,null,o,i),t-1),[]}))}function en(e,t,r){switch(t){case 0:return r?function(e){return S(e)}:function(e){return A(e)};case 1:return r?function(e){return D(e>>1)}:function(e){return R(e>>1)};case 2:return r?function(e){return C(e>>2)}:function(e){return M(e>>2)};default:throw new TypeError("Unknown integer type: "+e)}}function tn(e,t,r,n,o){t=Ot(t),-1===o&&(o=4294967295);var i=Tt(r),a=e=>e;if(0===n){var s=32-8*r;a=e=>e<<s>>>s}var c=t.includes("unsigned"),d=(e,r)=>{if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+Jr(e)+'" to '+r);if(e<n||e>o)throw new TypeError('Passing a number "'+Jr(e)+'" from JS side to C/C++ side to an argument of type "'+t+'", which is outside the valid range ['+n+", "+o+"]!")};Vt(e,{name:t,fromWireType:a,toWireType:c?function(e,t){return d(t,this.name),t>>>0}:function(e,t){return d(t,this.name),t},argPackAdvance:8,readValueFromPointer:en(t,i,0!==n),destructorFunction:null})}function rn(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=Z,r=t[e>>=2],o=t[e+1];return new n(z,o,r)}Vt(e,{name:r=Ot(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}function nn(e,t){var r="std::string"===(t=Ot(t));Vt(e,{name:t,fromWireType:function(e){var t,n=M(e>>2);if(r)for(var o=e+4,i=0;i<=n;++i){var a=e+4+i;if(i==n||0==A(a)){var s=H(o,a-o);void 0===t?t=s:(t+=String.fromCharCode(0),t+=s),o=a+1}}else{var c=new Array(n);for(i=0;i<n;++i)c[i]=String.fromCharCode(A(e+4+i));t=c.join("")}return ro(e),t},toWireType:function(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var n="string"==typeof t;n||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||xt("Cannot pass non-string to std::string");var o=(r&&n?()=>G(t):()=>t.length)(),i=to(4+o+1);if(V(i>>2,o),r&&n)X(t,i+4,o+1);else if(n)for(var a=0;a<o;++a){var s=t.charCodeAt(a);s>255&&(ro(i),xt("String has UTF-16 code units that do not fit in 8 bits")),F(i+4+a,s)}else for(a=0;a<o;++a)F(i+4+a,t[a]);return null!==e&&e.push(ro,i),i},argPackAdvance:8,readValueFromPointer:Tr,destructorFunction:function(e){ro(e)}})}function on(e,t,r){var n,o,i,a,s;r=Ot(r),2===t?(n=ne,o=oe,a=ie,i=()=>$,s=1):4===t&&(n=ae,o=se,a=ce,i=()=>Z,s=2),Vt(e,{name:r,fromWireType:function(e){for(var r,o=M(e>>2),a=i(),c=e+4,d=0;d<=o;++d){var u=e+4+d*t;if(d==o||0==a[u>>s]){var p=n(c,u-c);void 0===r?r=p:(r+=String.fromCharCode(0),r+=p),c=u+t}}return ro(e),r},toWireType:function(e,n){"string"!=typeof n&&xt("Cannot pass non-string to C++ string type "+r);var i=a(n),c=to(4+i+t);return V(c>>2,i>>s),o(n,c+4,i+t),null!==e&&e.push(ro,c),c},argPackAdvance:8,readValueFromPointer:Tr,destructorFunction:function(e){ro(e)}})}function an(e,t){Vt(e,{isVoid:!0,name:t=Ot(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})}function sn(e){e>4&&(Hr[e].refcount+=1)}function cn(e,t){var r=St[e];return void 0===r&&xt(t+" has unknown type "+Ir(e)),r}function dn(e,t){var r=(e=cn(e,"_emval_take_value")).readValueFromPointer(t);return Wr.toHandle(r)}function un(){je("native code called abort()")}var pn,ln=[];function fn(e,t){var r;for(L(Array.isArray(ln)),L(t%16==0),ln.length=0,t>>=2;r=A(e++);){L(100===r||102===r||105===r);var n=r<105;n&&1&t&&t++,ln.push(n?I(t++>>1):C(t)),++t}return ln}function hn(e,t,r){var n=fn(t,r);return $e.hasOwnProperty(e)||je("No EM_ASM constant found at address "+e),$e[e].apply(null,n)}function mn(e,t,r){return hn(e,t,r)}function gn(e,t,r,n,o,i){var a;i<<=12;var s=!1;if(0!=(16&n)&&e%65536!=0)return-28;if(0!=(32&n)){if(!(a=ut(t)))return-48;s=!0}else{var c=mt.getStream(o);if(!c)return-8;var d=mt.mmap(c,e,t,i,r,n);a=d.ptr,s=d.allocated}return gt.mappings[a]={malloc:a,len:t,allocated:s,fd:o,prot:r,flags:n,offset:i},a}function yn(e){var t=void 0!==to?to:void 0,r=void 0!==no?no:void 0,n=void 0!==ro?ro:void 0;to=oo,no=ao,ro=io;try{return e()}finally{to=t,no=r,ro=n}}function En(e,t,r,n,o,i){return yn((function(){return gn(e,t,r,n,o,i)}))}function vn(e,t){var r=gt.mappings[e];if(0===t||!r)return-28;if(t===r.len){var n=mt.getStream(r.fd);n&&(2&r.prot&&gt.doMsync(e,n,t,r.flags,r.offset),mt.munmap(n)),gt.mappings[e]=null,r.allocated&&ro(r.malloc)}return 0}function _n(e,t){return yn((function(){return vn(e,t)}))}function Tn(e){L("number"==typeof e),console.error(H(e))}function wn(){return Y.length}function bn(e,t){return X(Ve,e,t)}pn=()=>performance.now();var On={};function Pn(e){var t;return L(Ue),(t=/\bwasm-function\[\d+\]:(0x[0-9a-f]+)/.exec(e))?+t[1]:(t=/\bwasm-function\[(\d+)\]:(\d+)/.exec(e))?Ue.convert(+t[1],+t[2]):(t=/:(\d+):\d+(?:\)|$)/.exec(e))?2147483648|+t[1]:0}function Sn(e){if(On.last_get_source_pc==e)return On.last_source;var t,r;if(!r){var n=On[e];if(!n)return null;((t=/\((.*):(\d+):(\d+)\)$/.exec(n))||(t=/@(.*):(\d+):(\d+)/.exec(n)))&&(r={file:t[1],line:t[2],column:t[3]})}return On.last_get_source_pc=e,On.last_source=r,r}function An(e){var t=Sn(e);return t&&t.column||0}function Dn(e){return yn((function(){var t=Sn(e);return t?(Dn.ret&&ro(Dn.ret),Dn.ret=de(t.file),Dn.ret):0}))}function Rn(e){return yn((function(){var t;if(2147483648&e){var r,n=On[e];if(!n)return 0;if(r=/^\s+at (.*) \(.*\)$/.exec(n))t=r[1];else{if(!(r=/^(.+?)@/.exec(n)))return 0;t=r[1]}}else t=Ue.getName(e);return Rn.ret&&ro(Rn.ret),Rn.ret=de(t),Rn.ret}))}function Cn(e){var t=Sn(e);return t?t.line:0}function Mn(e){je("Cannot enlarge memory arrays to size "+e+" bytes (OOM). Either (1) compile with -s INITIAL_MEMORY=X with X higher than the current value "+W.length+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function kn(e){Y.length,Mn(e>>>=0)}function In(e){var t=(new Error).stack.split("\n");return"Error"==t[0]&&t.shift(),Pn(t[e+2])}function xn(e){e.forEach((function(e){var t=Pn(e);t&&(On[t]=e)}))}function Fn(){var e=(new Error).stack.split("\n");return"Error"==e[0]&&e.shift(),xn(e),On.last_addr=Pn(e[2]),On.last_stack=e,On.last_addr}function Nn(e,t,r){var n;On.last_addr==e?n=On.last_stack:("Error"==(n=(new Error).stack.split("\n"))[0]&&n.shift(),xn(n));for(var o=2;n[o]&&Pn(n[o])!=e;)++o;for(var i=0;i<r&&n[i+o];++i)j(t+4*i>>2,Pn(n[i+o]));return i}var jn={};function Vn(){return s||"./this.program"}function Un(){if(!Un.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:Vn()};for(var t in jn)void 0===jn[t]?delete e[t]:e[t]=jn[t];var r=[];for(var t in e)r.push(t+"="+e[t]);Un.strings=r}return Un.strings}function Ln(e,t){var r=0;return Un().forEach((function(n,o){var i=t+r;j(e+4*o>>2,i),ue(n,i),r+=n.length+1})),0}function Bn(e,t){var r=Un();j(e>>2,r.length);var n=0;return r.forEach((function(e){n+=e.length+1})),j(t>>2,n),0}function qn(e){try{var t=gt.getStreamFromFD(e);return mt.close(t),0}catch(e){if(void 0===mt||!(e instanceof mt.ErrnoError))throw e;return e.errno}}function Hn(e,t,r,n){try{var o=gt.getStreamFromFD(e);return j(n>>2,gt.doReadv(o,t,r)),0}catch(e){if(void 0===mt||!(e instanceof mt.ErrnoError))throw e;return e.errno}}function Qn(e,t,r,n){try{var o=gt.getStreamFromFD(e);return j(n>>2,gt.doWritev(o,t,r)),0}catch(e){if(void 0===mt||!(e instanceof mt.ErrnoError))throw e;return e.errno}}function Xn(e){So(e)}function Gn(e){b(e)}var zn=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=mt.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},Wn=365,Yn=146;function Jn(e,t,r){var n=r>0?r:G(e)+1,o=new Array(n),i=Q(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(zn.prototype,{read:{get:function(){return(this.mode&Wn)===Wn},set:function(e){e?this.mode|=Wn:this.mode&=~Wn}},write:{get:function(){return(this.mode&Yn)===Yn},set:function(e){e?this.mode|=Yn:this.mode&=~Yn}},isFolder:{get:function(){return mt.isDir(this.mode)}},isDevice:{get:function(){return mt.isChrdev(this.mode)}}}),mt.FSNode=zn,mt.staticInit(),ht={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135},wt(),It=o.BindingError=kt(Error,"BindingError"),Ft=o.InternalError=kt(Error,"InternalError"),lr(),tr(),Pr(),kr=o.UnboundTypeError=kt(Error,"UnboundTypeError"),zr();var $n,Kn={__assert_fail:nt,__syscall_dup:yt,__syscall_open:Et,__syscall_stat64:vt,_embind_register_bigint:_t,_embind_register_bool:Ut,_embind_register_class:Fr,_embind_register_class_constructor:Vr,_embind_register_class_function:Br,_embind_register_emval:Yr,_embind_register_float:Kr,_embind_register_function:Zr,_embind_register_integer:tn,_embind_register_memory_view:rn,_embind_register_std_string:nn,_embind_register_std_wstring:on,_embind_register_void:an,_emval_decref:Qr,_emval_incref:sn,_emval_take_value:dn,abort:un,emscripten_asm_const_double:mn,emscripten_asm_const_int:hn,emscripten_builtin_mmap2:En,emscripten_builtin_munmap:_n,emscripten_console_error:Tn,emscripten_get_heap_max:wn,emscripten_get_module_name:bn,emscripten_get_now:pn,emscripten_pc_get_column:An,emscripten_pc_get_file:Dn,emscripten_pc_get_function:Rn,emscripten_pc_get_line:Cn,emscripten_resize_heap:kn,emscripten_return_address:In,emscripten_stack_snapshot:Fn,emscripten_stack_unwind_buffer:Nn,environ_get:Ln,environ_sizes_get:Bn,fd_close:qn,fd_read:Hn,fd_write:Qn,proc_exit:Xn,setTempRet0:Gn},Zn=(Je(),o.___wasm_call_ctors=Xe("__wasm_call_ctors"),o.___getTypeName=Xe("__getTypeName")),eo=(o.___embind_register_native_and_builtin_types=Xe("__embind_register_native_and_builtin_types"),o.___errno_location=Xe("__errno_location"),o.___stdio_exit=Xe("__stdio_exit")),to=(o.___funcs_on_exit=Xe("__funcs_on_exit"),o._malloc=Xe("malloc")),ro=o._free=Xe("free"),no=o._memalign=Xe("memalign"),oo=o._emscripten_builtin_malloc=Xe("emscripten_builtin_malloc"),io=o._emscripten_builtin_free=Xe("emscripten_builtin_free"),ao=o._emscripten_builtin_memalign=Xe("emscripten_builtin_memalign"),so=o._emscripten_stack_init=function(){return(so=o._emscripten_stack_init=o.asm.emscripten_stack_init).apply(null,arguments)},co=(o._emscripten_stack_get_free=function(){return(o._emscripten_stack_get_free=o.asm.emscripten_stack_get_free).apply(null,arguments)},o._emscripten_stack_get_base=function(){return(o._emscripten_stack_get_base=o.asm.emscripten_stack_get_base).apply(null,arguments)},o._emscripten_stack_get_end=function(){return(co=o._emscripten_stack_get_end=o.asm.emscripten_stack_get_end).apply(null,arguments)}),uo=(o.stackSave=Xe("stackSave"),o.stackRestore=Xe("stackRestore"),o.stackAlloc=Xe("stackAlloc"),o.__ZN6__asan9FakeStack17AddrIsInFakeStackEm=Xe("_ZN6__asan9FakeStack17AddrIsInFakeStackEm"),o.__ZN6__asan9FakeStack8AllocateEmmm=Xe("_ZN6__asan9FakeStack8AllocateEmmm"),o._asan_c_load_1=Xe("asan_c_load_1")),po=o._asan_c_load_1u=Xe("asan_c_load_1u"),lo=o._asan_c_load_2=Xe("asan_c_load_2"),fo=o._asan_c_load_2u=Xe("asan_c_load_2u"),ho=o._asan_c_load_4=Xe("asan_c_load_4"),mo=o._asan_c_load_4u=Xe("asan_c_load_4u"),go=o._asan_c_load_f=Xe("asan_c_load_f"),yo=o._asan_c_load_d=Xe("asan_c_load_d"),Eo=o._asan_c_store_1=Xe("asan_c_store_1"),vo=o._asan_c_store_1u=Xe("asan_c_store_1u"),_o=o._asan_c_store_2=Xe("asan_c_store_2"),To=(o._asan_c_store_2u=Xe("asan_c_store_2u"),o._asan_c_store_4=Xe("asan_c_store_4")),wo=o._asan_c_store_4u=Xe("asan_c_store_4u");function bo(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Oo(){so(),me()}function Po(e){function t(){$n||($n=!0,o.calledRun=!0,U||(Pe(),r(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),L(!o._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),Se()))}e=e||a,Ce>0||(Oo(),Oe(),Ce>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t(),ge()))}function So(e){be()||(o.onExit&&o.onExit(e),U=!0),c(e,new bo(e))}if(o._asan_c_store_f=Xe("asan_c_store_f"),o._asan_c_store_d=Xe("asan_c_store_d"),o.dynCall_jii=Xe("dynCall_jii"),Object.getOwnPropertyDescriptor(o,"intArrayFromString")||(o.intArrayFromString=()=>je("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"intArrayToString")||(o.intArrayToString=()=>je("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ccall")||(o.ccall=()=>je("'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"cwrap")||(o.cwrap=()=>je("'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setValue")||(o.setValue=()=>je("'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getValue")||(o.getValue=()=>je("'getValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"allocate")||(o.allocate=()=>je("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UTF8ArrayToString")||(o.UTF8ArrayToString=()=>je("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UTF8ToString")||(o.UTF8ToString=()=>je("'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToUTF8Array")||(o.stringToUTF8Array=()=>je("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToUTF8")||(o.stringToUTF8=()=>je("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF8")||(o.lengthBytesUTF8=()=>je("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackTrace")||(o.stackTrace=()=>je("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnPreRun")||(o.addOnPreRun=()=>je("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnInit")||(o.addOnInit=()=>je("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnPreMain")||(o.addOnPreMain=()=>je("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnExit")||(o.addOnExit=()=>je("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addOnPostRun")||(o.addOnPostRun=()=>je("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeStringToMemory")||(o.writeStringToMemory=()=>je("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeArrayToMemory")||(o.writeArrayToMemory=()=>je("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeAsciiToMemory")||(o.writeAsciiToMemory=()=>je("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addRunDependency")||(o.addRunDependency=()=>je("'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"removeRunDependency")||(o.removeRunDependency=()=>je("'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"FS_createFolder")||(o.FS_createFolder=()=>je("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"FS_createPath")||(o.FS_createPath=()=>je("'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"FS_createDataFile")||(o.FS_createDataFile=()=>je("'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"FS_createPreloadedFile")||(o.FS_createPreloadedFile=()=>je("'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"FS_createLazyFile")||(o.FS_createLazyFile=()=>je("'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"FS_createLink")||(o.FS_createLink=()=>je("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"FS_createDevice")||(o.FS_createDevice=()=>je("'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"FS_unlink")||(o.FS_unlink=()=>je("'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")),Object.getOwnPropertyDescriptor(o,"getLEB")||(o.getLEB=()=>je("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getFunctionTables")||(o.getFunctionTables=()=>je("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"alignFunctionTables")||(o.alignFunctionTables=()=>je("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerFunctions")||(o.registerFunctions=()=>je("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"addFunction")||(o.addFunction=()=>je("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"removeFunction")||(o.removeFunction=()=>je("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getFuncWrapper")||(o.getFuncWrapper=()=>je("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"prettyPrint")||(o.prettyPrint=()=>je("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"dynCall")||(o.dynCall=()=>je("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getCompilerSetting")||(o.getCompilerSetting=()=>je("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"print")||(o.print=()=>je("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"printErr")||(o.printErr=()=>je("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getTempRet0")||(o.getTempRet0=()=>je("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setTempRet0")||(o.setTempRet0=()=>je("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"callMain")||(o.callMain=()=>je("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"abort")||(o.abort=()=>je("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"keepRuntimeAlive")||(o.keepRuntimeAlive=()=>je("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"WasmOffsetConverter")||(o.WasmOffsetConverter=()=>je("'WasmOffsetConverter' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"zeroMemory")||(o.zeroMemory=()=>je("'zeroMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToNewUTF8")||(o.stringToNewUTF8=()=>je("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setFileTime")||(o.setFileTime=()=>je("'setFileTime' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"abortOnCannotGrowMemory")||(o.abortOnCannotGrowMemory=()=>je("'abortOnCannotGrowMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscripten_realloc_buffer")||(o.emscripten_realloc_buffer=()=>je("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ENV")||(o.ENV=()=>je("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"withStackSave")||(o.withStackSave=()=>je("'withStackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ERRNO_CODES")||(o.ERRNO_CODES=()=>je("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ERRNO_MESSAGES")||(o.ERRNO_MESSAGES=()=>je("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setErrNo")||(o.setErrNo=()=>je("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"inetPton4")||(o.inetPton4=()=>je("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"inetNtop4")||(o.inetNtop4=()=>je("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"inetPton6")||(o.inetPton6=()=>je("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"inetNtop6")||(o.inetNtop6=()=>je("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readSockaddr")||(o.readSockaddr=()=>je("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeSockaddr")||(o.writeSockaddr=()=>je("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"DNS")||(o.DNS=()=>je("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getHostByName")||(o.getHostByName=()=>je("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"Protocols")||(o.Protocols=()=>je("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"Sockets")||(o.Sockets=()=>je("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getRandomDevice")||(o.getRandomDevice=()=>je("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"traverseStack")||(o.traverseStack=()=>je("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"convertFrameToPC")||(o.convertFrameToPC=()=>je("'convertFrameToPC' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UNWIND_CACHE")||(o.UNWIND_CACHE=()=>je("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"saveInUnwindCache")||(o.saveInUnwindCache=()=>je("'saveInUnwindCache' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"convertPCtoSourceLocation")||(o.convertPCtoSourceLocation=()=>je("'convertPCtoSourceLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"withBuiltinMalloc")||(o.withBuiltinMalloc=()=>je("'withBuiltinMalloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readAsmConstArgsArray")||(o.readAsmConstArgsArray=()=>je("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readAsmConstArgs")||(o.readAsmConstArgs=()=>je("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"mainThreadEM_ASM")||(o.mainThreadEM_ASM=()=>je("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"jstoi_q")||(o.jstoi_q=()=>je("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"jstoi_s")||(o.jstoi_s=()=>je("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getExecutableName")||(o.getExecutableName=()=>je("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"listenOnce")||(o.listenOnce=()=>je("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"autoResumeAudioContext")||(o.autoResumeAudioContext=()=>je("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"dynCallLegacy")||(o.dynCallLegacy=()=>je("'dynCallLegacy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getDynCaller")||(o.getDynCaller=()=>je("'getDynCaller' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"dynCall")||(o.dynCall=()=>je("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"callRuntimeCallbacks")||(o.callRuntimeCallbacks=()=>je("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"wasmTableMirror")||(o.wasmTableMirror=()=>je("'wasmTableMirror' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setWasmTableEntry")||(o.setWasmTableEntry=()=>je("'setWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getWasmTableEntry")||(o.getWasmTableEntry=()=>je("'getWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"handleException")||(o.handleException=()=>je("'handleException' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runtimeKeepalivePush")||(o.runtimeKeepalivePush=()=>je("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runtimeKeepalivePop")||(o.runtimeKeepalivePop=()=>je("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"callUserCallback")||(o.callUserCallback=()=>je("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"maybeExit")||(o.maybeExit=()=>je("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"safeSetTimeout")||(o.safeSetTimeout=()=>je("'safeSetTimeout' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"asmjsMangle")||(o.asmjsMangle=()=>je("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"asyncLoad")||(o.asyncLoad=()=>je("'asyncLoad' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"alignMemory")||(o.alignMemory=()=>je("'alignMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"mmapAlloc")||(o.mmapAlloc=()=>je("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"reallyNegative")||(o.reallyNegative=()=>je("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"unSign")||(o.unSign=()=>je("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"reSign")||(o.reSign=()=>je("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"formatString")||(o.formatString=()=>je("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"PATH")||(o.PATH=()=>je("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"PATH_FS")||(o.PATH_FS=()=>je("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SYSCALLS")||(o.SYSCALLS=()=>je("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"syscallMmap2")||(o.syscallMmap2=()=>je("'syscallMmap2' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"syscallMunmap")||(o.syscallMunmap=()=>je("'syscallMunmap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getSocketFromFD")||(o.getSocketFromFD=()=>je("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getSocketAddress")||(o.getSocketAddress=()=>je("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"JSEvents")||(o.JSEvents=()=>je("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerKeyEventCallback")||(o.registerKeyEventCallback=()=>je("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"specialHTMLTargets")||(o.specialHTMLTargets=()=>je("'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"maybeCStringToJsString")||(o.maybeCStringToJsString=()=>je("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"findEventTarget")||(o.findEventTarget=()=>je("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"findCanvasEventTarget")||(o.findCanvasEventTarget=()=>je("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getBoundingClientRect")||(o.getBoundingClientRect=()=>je("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillMouseEventData")||(o.fillMouseEventData=()=>je("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerMouseEventCallback")||(o.registerMouseEventCallback=()=>je("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerWheelEventCallback")||(o.registerWheelEventCallback=()=>je("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerUiEventCallback")||(o.registerUiEventCallback=()=>je("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerFocusEventCallback")||(o.registerFocusEventCallback=()=>je("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillDeviceOrientationEventData")||(o.fillDeviceOrientationEventData=()=>je("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerDeviceOrientationEventCallback")||(o.registerDeviceOrientationEventCallback=()=>je("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillDeviceMotionEventData")||(o.fillDeviceMotionEventData=()=>je("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerDeviceMotionEventCallback")||(o.registerDeviceMotionEventCallback=()=>je("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"screenOrientation")||(o.screenOrientation=()=>je("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillOrientationChangeEventData")||(o.fillOrientationChangeEventData=()=>je("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerOrientationChangeEventCallback")||(o.registerOrientationChangeEventCallback=()=>je("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillFullscreenChangeEventData")||(o.fillFullscreenChangeEventData=()=>je("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerFullscreenChangeEventCallback")||(o.registerFullscreenChangeEventCallback=()=>je("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerRestoreOldStyle")||(o.registerRestoreOldStyle=()=>je("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"hideEverythingExceptGivenElement")||(o.hideEverythingExceptGivenElement=()=>je("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"restoreHiddenElements")||(o.restoreHiddenElements=()=>je("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setLetterbox")||(o.setLetterbox=()=>je("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"currentFullscreenStrategy")||(o.currentFullscreenStrategy=()=>je("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"restoreOldWindowedStyle")||(o.restoreOldWindowedStyle=()=>je("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"softFullscreenResizeWebGLRenderTarget")||(o.softFullscreenResizeWebGLRenderTarget=()=>je("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"doRequestFullscreen")||(o.doRequestFullscreen=()=>je("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillPointerlockChangeEventData")||(o.fillPointerlockChangeEventData=()=>je("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerPointerlockChangeEventCallback")||(o.registerPointerlockChangeEventCallback=()=>je("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerPointerlockErrorEventCallback")||(o.registerPointerlockErrorEventCallback=()=>je("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"requestPointerLock")||(o.requestPointerLock=()=>je("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillVisibilityChangeEventData")||(o.fillVisibilityChangeEventData=()=>je("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerVisibilityChangeEventCallback")||(o.registerVisibilityChangeEventCallback=()=>je("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerTouchEventCallback")||(o.registerTouchEventCallback=()=>je("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillGamepadEventData")||(o.fillGamepadEventData=()=>je("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerGamepadEventCallback")||(o.registerGamepadEventCallback=()=>je("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerBeforeUnloadEventCallback")||(o.registerBeforeUnloadEventCallback=()=>je("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"fillBatteryEventData")||(o.fillBatteryEventData=()=>je("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"battery")||(o.battery=()=>je("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerBatteryEventCallback")||(o.registerBatteryEventCallback=()=>je("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setCanvasElementSize")||(o.setCanvasElementSize=()=>je("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getCanvasElementSize")||(o.getCanvasElementSize=()=>je("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"demangle")||(o.demangle=()=>je("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"demangleAll")||(o.demangleAll=()=>je("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"jsStackTrace")||(o.jsStackTrace=()=>je("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackTrace")||(o.stackTrace=()=>je("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getEnvStrings")||(o.getEnvStrings=()=>je("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"checkWasiClock")||(o.checkWasiClock=()=>je("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToI64")||(o.writeI53ToI64=()=>je("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToI64Clamped")||(o.writeI53ToI64Clamped=()=>je("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToI64Signaling")||(o.writeI53ToI64Signaling=()=>je("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToU64Clamped")||(o.writeI53ToU64Clamped=()=>je("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeI53ToU64Signaling")||(o.writeI53ToU64Signaling=()=>je("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readI53FromI64")||(o.readI53FromI64=()=>je("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readI53FromU64")||(o.readI53FromU64=()=>je("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"convertI32PairToI53")||(o.convertI32PairToI53=()=>je("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"convertU32PairToI53")||(o.convertU32PairToI53=()=>je("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setImmediateWrapped")||(o.setImmediateWrapped=()=>je("'setImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"clearImmediateWrapped")||(o.clearImmediateWrapped=()=>je("'clearImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"polyfillSetImmediate")||(o.polyfillSetImmediate=()=>je("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"uncaughtExceptionCount")||(o.uncaughtExceptionCount=()=>je("'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exceptionLast")||(o.exceptionLast=()=>je("'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exceptionCaught")||(o.exceptionCaught=()=>je("'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ExceptionInfo")||(o.ExceptionInfo=()=>je("'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"CatchInfo")||(o.CatchInfo=()=>je("'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exception_addRef")||(o.exception_addRef=()=>je("'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exception_decRef")||(o.exception_decRef=()=>je("'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"Browser")||(o.Browser=()=>je("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"funcWrappers")||(o.funcWrappers=()=>je("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getFuncWrapper")||(o.getFuncWrapper=()=>je("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setMainLoop")||(o.setMainLoop=()=>je("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"wget")||(o.wget=()=>je("'wget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"FS")||(o.FS=()=>je("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"MEMFS")||(o.MEMFS=()=>je("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"TTY")||(o.TTY=()=>je("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"PIPEFS")||(o.PIPEFS=()=>je("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SOCKFS")||(o.SOCKFS=()=>je("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"_setNetworkCallback")||(o._setNetworkCallback=()=>je("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"tempFixedLengthArray")||(o.tempFixedLengthArray=()=>je("'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"miniTempWebGLFloatBuffers")||(o.miniTempWebGLFloatBuffers=()=>je("'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"heapObjectForWebGLType")||(o.heapObjectForWebGLType=()=>je("'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"heapAccessShiftForWebGLHeap")||(o.heapAccessShiftForWebGLHeap=()=>je("'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GL")||(o.GL=()=>je("'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGet")||(o.emscriptenWebGLGet=()=>je("'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"computeUnpackAlignedImageSize")||(o.computeUnpackAlignedImageSize=()=>je("'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGetTexPixelData")||(o.emscriptenWebGLGetTexPixelData=()=>je("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGetUniform")||(o.emscriptenWebGLGetUniform=()=>je("'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"webglGetUniformLocation")||(o.webglGetUniformLocation=()=>je("'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"webglPrepareUniformLocationsBeforeFirstUse")||(o.webglPrepareUniformLocationsBeforeFirstUse=()=>je("'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"webglGetLeftBracePos")||(o.webglGetLeftBracePos=()=>je("'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emscriptenWebGLGetVertexAttrib")||(o.emscriptenWebGLGetVertexAttrib=()=>je("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"writeGLArray")||(o.writeGLArray=()=>je("'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"AL")||(o.AL=()=>je("'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL_unicode")||(o.SDL_unicode=()=>je("'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL_ttfContext")||(o.SDL_ttfContext=()=>je("'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL_audio")||(o.SDL_audio=()=>je("'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL")||(o.SDL=()=>je("'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"SDL_gfx")||(o.SDL_gfx=()=>je("'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GLUT")||(o.GLUT=()=>je("'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"EGL")||(o.EGL=()=>je("'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GLFW_Window")||(o.GLFW_Window=()=>je("'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GLFW")||(o.GLFW=()=>je("'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"GLEW")||(o.GLEW=()=>je("'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"IDBStore")||(o.IDBStore=()=>je("'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runAndAbortIfError")||(o.runAndAbortIfError=()=>je("'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"InternalError")||(o.InternalError=()=>je("'InternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"BindingError")||(o.BindingError=()=>je("'BindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UnboundTypeError")||(o.UnboundTypeError=()=>je("'UnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"PureVirtualError")||(o.PureVirtualError=()=>je("'PureVirtualError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"init_embind")||(o.init_embind=()=>je("'init_embind' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"throwInternalError")||(o.throwInternalError=()=>je("'throwInternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"throwBindingError")||(o.throwBindingError=()=>je("'throwBindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"throwUnboundTypeError")||(o.throwUnboundTypeError=()=>je("'throwUnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ensureOverloadTable")||(o.ensureOverloadTable=()=>je("'ensureOverloadTable' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"exposePublicSymbol")||(o.exposePublicSymbol=()=>je("'exposePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"replacePublicSymbol")||(o.replacePublicSymbol=()=>je("'replacePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"extendError")||(o.extendError=()=>je("'extendError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"createNamedFunction")||(o.createNamedFunction=()=>je("'createNamedFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registeredInstances")||(o.registeredInstances=()=>je("'registeredInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getBasestPointer")||(o.getBasestPointer=()=>je("'getBasestPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerInheritedInstance")||(o.registerInheritedInstance=()=>je("'registerInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"unregisterInheritedInstance")||(o.unregisterInheritedInstance=()=>je("'unregisterInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getInheritedInstance")||(o.getInheritedInstance=()=>je("'getInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getInheritedInstanceCount")||(o.getInheritedInstanceCount=()=>je("'getInheritedInstanceCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getLiveInheritedInstances")||(o.getLiveInheritedInstances=()=>je("'getLiveInheritedInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registeredTypes")||(o.registeredTypes=()=>je("'registeredTypes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"awaitingDependencies")||(o.awaitingDependencies=()=>je("'awaitingDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"typeDependencies")||(o.typeDependencies=()=>je("'typeDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registeredPointers")||(o.registeredPointers=()=>je("'registeredPointers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"registerType")||(o.registerType=()=>je("'registerType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"whenDependentTypesAreResolved")||(o.whenDependentTypesAreResolved=()=>je("'whenDependentTypesAreResolved' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"embind_charCodes")||(o.embind_charCodes=()=>je("'embind_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"embind_init_charCodes")||(o.embind_init_charCodes=()=>je("'embind_init_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"readLatin1String")||(o.readLatin1String=()=>je("'readLatin1String' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getTypeName")||(o.getTypeName=()=>je("'getTypeName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"heap32VectorToArray")||(o.heap32VectorToArray=()=>je("'heap32VectorToArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"requireRegisteredType")||(o.requireRegisteredType=()=>je("'requireRegisteredType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getShiftFromSize")||(o.getShiftFromSize=()=>je("'getShiftFromSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"integerReadValueFromPointer")||(o.integerReadValueFromPointer=()=>je("'integerReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"enumReadValueFromPointer")||(o.enumReadValueFromPointer=()=>je("'enumReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"floatReadValueFromPointer")||(o.floatReadValueFromPointer=()=>je("'floatReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"simpleReadValueFromPointer")||(o.simpleReadValueFromPointer=()=>je("'simpleReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runDestructors")||(o.runDestructors=()=>je("'runDestructors' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"new_")||(o.new_=()=>je("'new_' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"craftInvokerFunction")||(o.craftInvokerFunction=()=>je("'craftInvokerFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"embind__requireFunction")||(o.embind__requireFunction=()=>je("'embind__requireFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"tupleRegistrations")||(o.tupleRegistrations=()=>je("'tupleRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"structRegistrations")||(o.structRegistrations=()=>je("'structRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"genericPointerToWireType")||(o.genericPointerToWireType=()=>je("'genericPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"constNoSmartPtrRawPointerToWireType")||(o.constNoSmartPtrRawPointerToWireType=()=>je("'constNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"nonConstNoSmartPtrRawPointerToWireType")||(o.nonConstNoSmartPtrRawPointerToWireType=()=>je("'nonConstNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"init_RegisteredPointer")||(o.init_RegisteredPointer=()=>je("'init_RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer")||(o.RegisteredPointer=()=>je("'RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer_getPointee")||(o.RegisteredPointer_getPointee=()=>je("'RegisteredPointer_getPointee' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer_destructor")||(o.RegisteredPointer_destructor=()=>je("'RegisteredPointer_destructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer_deleteObject")||(o.RegisteredPointer_deleteObject=()=>je("'RegisteredPointer_deleteObject' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredPointer_fromWireType")||(o.RegisteredPointer_fromWireType=()=>je("'RegisteredPointer_fromWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"runDestructor")||(o.runDestructor=()=>je("'runDestructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"releaseClassHandle")||(o.releaseClassHandle=()=>je("'releaseClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"finalizationRegistry")||(o.finalizationRegistry=()=>je("'finalizationRegistry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"detachFinalizer_deps")||(o.detachFinalizer_deps=()=>je("'detachFinalizer_deps' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"detachFinalizer")||(o.detachFinalizer=()=>je("'detachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"attachFinalizer")||(o.attachFinalizer=()=>je("'attachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"makeClassHandle")||(o.makeClassHandle=()=>je("'makeClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"init_ClassHandle")||(o.init_ClassHandle=()=>je("'init_ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle")||(o.ClassHandle=()=>je("'ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_isAliasOf")||(o.ClassHandle_isAliasOf=()=>je("'ClassHandle_isAliasOf' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"throwInstanceAlreadyDeleted")||(o.throwInstanceAlreadyDeleted=()=>je("'throwInstanceAlreadyDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_clone")||(o.ClassHandle_clone=()=>je("'ClassHandle_clone' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_delete")||(o.ClassHandle_delete=()=>je("'ClassHandle_delete' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"deletionQueue")||(o.deletionQueue=()=>je("'deletionQueue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_isDeleted")||(o.ClassHandle_isDeleted=()=>je("'ClassHandle_isDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"ClassHandle_deleteLater")||(o.ClassHandle_deleteLater=()=>je("'ClassHandle_deleteLater' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"flushPendingDeletes")||(o.flushPendingDeletes=()=>je("'flushPendingDeletes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"delayFunction")||(o.delayFunction=()=>je("'delayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"setDelayFunction")||(o.setDelayFunction=()=>je("'setDelayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"RegisteredClass")||(o.RegisteredClass=()=>je("'RegisteredClass' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"shallowCopyInternalPointer")||(o.shallowCopyInternalPointer=()=>je("'shallowCopyInternalPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"downcastPointer")||(o.downcastPointer=()=>je("'downcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"upcastPointer")||(o.upcastPointer=()=>je("'upcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"validateThis")||(o.validateThis=()=>je("'validateThis' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"char_0")||(o.char_0=()=>je("'char_0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"char_9")||(o.char_9=()=>je("'char_9' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"makeLegalFunctionName")||(o.makeLegalFunctionName=()=>je("'makeLegalFunctionName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_handle_array")||(o.emval_handle_array=()=>je("'emval_handle_array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_free_list")||(o.emval_free_list=()=>je("'emval_free_list' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_symbols")||(o.emval_symbols=()=>je("'emval_symbols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"init_emval")||(o.init_emval=()=>je("'init_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"count_emval_handles")||(o.count_emval_handles=()=>je("'count_emval_handles' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"get_first_emval")||(o.get_first_emval=()=>je("'get_first_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"getStringOrSymbol")||(o.getStringOrSymbol=()=>je("'getStringOrSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"Emval")||(o.Emval=()=>je("'Emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_newers")||(o.emval_newers=()=>je("'emval_newers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"craftEmvalAllocator")||(o.craftEmvalAllocator=()=>je("'craftEmvalAllocator' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_get_global")||(o.emval_get_global=()=>je("'emval_get_global' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_methodCallers")||(o.emval_methodCallers=()=>je("'emval_methodCallers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"emval_registeredMethods")||(o.emval_registeredMethods=()=>je("'emval_registeredMethods' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"warnOnce")||(o.warnOnce=()=>je("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackSave")||(o.stackSave=()=>je("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackRestore")||(o.stackRestore=()=>je("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stackAlloc")||(o.stackAlloc=()=>je("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"AsciiToString")||(o.AsciiToString=()=>je("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToAscii")||(o.stringToAscii=()=>je("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UTF16ToString")||(o.UTF16ToString=()=>je("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToUTF16")||(o.stringToUTF16=()=>je("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF16")||(o.lengthBytesUTF16=()=>je("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"UTF32ToString")||(o.UTF32ToString=()=>je("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"stringToUTF32")||(o.stringToUTF32=()=>je("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"lengthBytesUTF32")||(o.lengthBytesUTF32=()=>je("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"allocateUTF8")||(o.allocateUTF8=()=>je("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),Object.getOwnPropertyDescriptor(o,"allocateUTF8OnStack")||(o.allocateUTF8OnStack=()=>je("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")),o.writeStackCookie=me,o.checkStackCookie=ge,Object.getOwnPropertyDescriptor(o,"ALLOC_NORMAL")||Object.defineProperty(o,"ALLOC_NORMAL",{configurable:!0,get:function(){je("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Object.getOwnPropertyDescriptor(o,"ALLOC_STACK")||Object.defineProperty(o,"ALLOC_STACK",{configurable:!0,get:function(){je("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),ke=function e(){$n||Po(),$n||(ke=e)},o.run=Po,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return Po(),e.ready});e.exports=r},9669:function(e,t,r){e.exports=r(1609)},5448:function(e,t,r){"use strict";var n=r(4867),o=r(6026),i=r(4372),a=r(5327),s=r(4097),c=r(4109),d=r(7985),u=r(7874),p=r(2648),l=r(644),f=r(205);e.exports=function(e){return new Promise((function(t,r){var h,m=e.data,g=e.headers,y=e.responseType;function E(){e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h)}n.isFormData(m)&&n.isStandardBrowserEnv()&&delete g["Content-Type"];var v=new XMLHttpRequest;if(e.auth){var _=e.auth.username||"",T=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";g.Authorization="Basic "+btoa(_+":"+T)}var w=s(e.baseURL,e.url);function b(){if(v){var n="getAllResponseHeaders"in v?c(v.getAllResponseHeaders()):null,i={data:y&&"text"!==y&&"json"!==y?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:n,config:e,request:v};o((function(e){t(e),E()}),(function(e){r(e),E()}),i),v=null}}if(v.open(e.method.toUpperCase(),a(w,e.params,e.paramsSerializer),!0),v.timeout=e.timeout,"onloadend"in v?v.onloadend=b:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(b)},v.onabort=function(){v&&(r(new p("Request aborted",p.ECONNABORTED,e,v)),v=null)},v.onerror=function(){r(new p("Network Error",p.ERR_NETWORK,e,v,v)),v=null},v.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||u;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new p(t,n.clarifyTimeoutError?p.ETIMEDOUT:p.ECONNABORTED,e,v)),v=null},n.isStandardBrowserEnv()){var O=(e.withCredentials||d(w))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;O&&(g[e.xsrfHeaderName]=O)}"setRequestHeader"in v&&n.forEach(g,(function(e,t){void 0===m&&"content-type"===t.toLowerCase()?delete g[t]:v.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(v.withCredentials=!!e.withCredentials),y&&"json"!==y&&(v.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&v.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&v.upload&&v.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(h=function(e){v&&(r(!e||e&&e.type?new l:e),v.abort(),v=null)},e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h))),m||(m=null);var P=f(w);P&&-1===["http","https","file"].indexOf(P)?r(new p("Unsupported protocol "+P+":",p.ERR_BAD_REQUEST,e)):v.send(m)}))}},1609:function(e,t,r){"use strict";var n=r(4867),o=r(1849),i=r(321),a=r(7185),s=function e(t){var r=new i(t),s=o(i.prototype.request,r);return n.extend(s,i.prototype,r),n.extend(s,r),s.create=function(r){return e(a(t,r))},s}(r(5546));s.Axios=i,s.CanceledError=r(644),s.CancelToken=r(4972),s.isCancel=r(6502),s.VERSION=r(7288).version,s.toFormData=r(7675),s.AxiosError=r(2648),s.Cancel=s.CanceledError,s.all=function(e){return Promise.all(e)},s.spread=r(8713),s.isAxiosError=r(6268),e.exports=s,e.exports.default=s},4972:function(e,t,r){"use strict";var n=r(644);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t<n;t++)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},o.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},644:function(e,t,r){"use strict";var n=r(2648);function o(e){n.call(this,null==e?"canceled":e,n.ERR_CANCELED),this.name="CanceledError"}r(4867).inherits(o,n,{__CANCEL__:!0}),e.exports=o},6502:function(e){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:function(e,t,r){"use strict";var n=r(4867),o=r(5327),i=r(782),a=r(3572),s=r(7185),c=r(4097),d=r(4875),u=d.validators;function p(e){this.defaults=e,this.interceptors={request:new i,response:new i}}p.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&d.assertOptions(r,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var i,c=[];if(this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)})),!o){var p=[a,void 0];for(Array.prototype.unshift.apply(p,n),p=p.concat(c),i=Promise.resolve(t);p.length;)i=i.then(p.shift(),p.shift());return i}for(var l=t;n.length;){var f=n.shift(),h=n.shift();try{l=f(l)}catch(e){h(e);break}}try{i=a(l)}catch(e){return Promise.reject(e)}for(;c.length;)i=i.then(c.shift(),c.shift());return i},p.prototype.getUri=function(e){e=s(this.defaults,e);var t=c(e.baseURL,e.url);return o(t,e.params,e.paramsSerializer)},n.forEach(["delete","get","head","options"],(function(e){p.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(s(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}p.prototype[e]=t(),p.prototype[e+"Form"]=t(!0)})),e.exports=p},2648:function(e,t,r){"use strict";var n=r(4867);function o(e,t,r,n,o){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}n.inherits(o,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var i=o.prototype,a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){a[e]={value:e}})),Object.defineProperties(o,a),Object.defineProperty(i,"isAxiosError",{value:!0}),o.from=function(e,t,r,a,s,c){var d=Object.create(i);return n.toFlatObject(e,d,(function(e){return e!==Error.prototype})),o.call(d,e.message,t,r,a,s),d.name=e.name,c&&Object.assign(d,c),d},e.exports=o},782:function(e,t,r){"use strict";var n=r(4867);function o(){this.handlers=[]}o.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},4097:function(e,t,r){"use strict";var n=r(1793),o=r(7303);e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},3572:function(e,t,r){"use strict";var n=r(4867),o=r(8527),i=r(6502),a=r(5546),s=r(644);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new s}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||a.adapter)(e).then((function(t){return c(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},7185:function(e,t,r){"use strict";var n=r(4867);e.exports=function(e,t){t=t||{};var r={};function o(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function i(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:o(void 0,e[r]):o(e[r],t[r])}function a(e){if(!n.isUndefined(t[e]))return o(void 0,t[e])}function s(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:o(void 0,e[r]):o(void 0,t[r])}function c(r){return r in t?o(e[r],t[r]):r in e?o(void 0,e[r]):void 0}var d={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=d[e]||i,o=t(e);n.isUndefined(o)&&t!==c||(r[e]=o)})),r}},6026:function(e,t,r){"use strict";var n=r(2648);e.exports=function(e,t,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?t(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}},8527:function(e,t,r){"use strict";var n=r(4867),o=r(5546);e.exports=function(e,t,r){var i=this||o;return n.forEach(r,(function(r){e=r.call(i,e,t)})),e}},5546:function(e,t,r){"use strict";var n=r(4867),o=r(6016),i=r(2648),a=r(7874),s=r(7675),c={"Content-Type":"application/x-www-form-urlencoded"};function d(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,p={transitional:a,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=r(5448)),u),transformRequest:[function(e,t){if(o(t,"Accept"),o(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e))return e;if(n.isArrayBufferView(e))return e.buffer;if(n.isURLSearchParams(e))return d(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,i=n.isObject(e),a=t&&t["Content-Type"];if((r=n.isFileList(e))||i&&"multipart/form-data"===a){var c=this.env&&this.env.FormData;return s(r?{"files[]":e}:e,c&&new c)}return i||"application/json"===a?(d(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(0,JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||p.transitional,r=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,a=!r&&"json"===this.responseType;if(a||o&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(a){if("SyntaxError"===e.name)throw i.from(e,i.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:r(1623)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){p.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){p.headers[e]=n.merge(c)})),e.exports=p},7874:function(e){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},7288:function(e){e.exports={version:"0.27.2"}},1849:function(e){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},5327:function(e,t,r){"use strict";var n=r(4867);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var a=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),a.push(o(t)+"="+o(e))})))})),i=a.join("&")}if(i){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},7303:function(e){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:function(e,t,r){"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,o,i,a){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(o)&&s.push("path="+o),n.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:function(e){"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},6268:function(e,t,r){"use strict";var n=r(4867);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},7985:function(e,t,r){"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},6016:function(e,t,r){"use strict";var n=r(4867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},1623:function(e){e.exports=null},4109:function(e,t,r){"use strict";var n=r(4867),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,i,a={};return e?(n.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(a[t]&&o.indexOf(t)>=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([r]):a[t]?a[t]+", "+r:r}})),a):a}},205:function(e){"use strict";e.exports=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}},8713:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},7675:function(e,t,r){"use strict";var n=r(4867);e.exports=function(e,t){t=t||new FormData;var r=[];function o(e){return null===e?"":n.isDate(e)?e.toISOString():n.isArrayBuffer(e)||n.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}return function e(i,a){if(n.isPlainObject(i)||n.isArray(i)){if(-1!==r.indexOf(i))throw Error("Circular reference detected in "+a);r.push(i),n.forEach(i,(function(r,i){if(!n.isUndefined(r)){var s,c=a?a+"."+i:i;if(r&&!a&&"object"==typeof r)if(n.endsWith(i,"{}"))r=JSON.stringify(r);else if(n.endsWith(i,"[]")&&(s=n.toArray(r)))return void s.forEach((function(e){!n.isUndefined(e)&&t.append(c,o(e))}));e(r,c)}})),r.pop()}else t.append(a,o(i))}(e),t}},4875:function(e,t,r){"use strict";var n=r(7288).version,o=r(2648),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var a={};i.transitional=function(e,t,r){function i(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new o(i(n," has been removed"+(t?" in "+t:"")),o.ERR_DEPRECATED);return t&&!a[n]&&(a[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new o("options must be an object",o.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),i=n.length;i-- >0;){var a=n[i],s=t[a];if(s){var c=e[a],d=void 0===c||s(c,a,e);if(!0!==d)throw new o("option "+a+" must be "+d,o.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new o("Unknown option "+a,o.ERR_BAD_OPTION)}},validators:i}},4867:function(e,t,r){"use strict";var n,o=r(1849),i=Object.prototype.toString,a=(n=Object.create(null),function(e){var t=i.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())});function s(e){return e=e.toLowerCase(),function(t){return a(t)===e}}function c(e){return Array.isArray(e)}function d(e){return void 0===e}var u=s("ArrayBuffer");function p(e){return null!==e&&"object"==typeof e}function l(e){if("object"!==a(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var f=s("Date"),h=s("File"),m=s("Blob"),g=s("FileList");function y(e){return"[object Function]"===i.call(e)}var E=s("URLSearchParams");function v(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),c(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}var _,T=(_="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return _&&e instanceof _});e.exports={isArray:c,isArrayBuffer:u,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||i.call(e)===t||y(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&u(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:p,isPlainObject:l,isUndefined:d,isDate:f,isFile:h,isBlob:m,isFunction:y,isStream:function(e){return p(e)&&y(e.pipe)},isURLSearchParams:E,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:v,merge:function e(){var t={};function r(r,n){l(t[n])&&l(r)?t[n]=e(t[n],r):l(r)?t[n]=e({},r):c(r)?t[n]=r.slice():t[n]=r}for(var n=0,o=arguments.length;n<o;n++)v(arguments[n],r);return t},extend:function(e,t,r){return v(t,(function(t,n){e[n]=r&&"function"==typeof t?o(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r){var n,o,i,a={};t=t||{};do{for(o=(n=Object.getOwnPropertyNames(e)).length;o-- >0;)a[i=n[o]]||(t[i]=e[i],a[i]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:s,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;var t=e.length;if(d(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:T,isFileList:g}},5987:function(e){"use strict";var t={single_source_shortest_paths:function(e,r,n){var o={},i={};i[r]=0;var a,s,c,d,u,p,l,f=t.PriorityQueue.make();for(f.push(r,0);!f.empty();)for(c in s=(a=f.pop()).value,d=a.cost,u=e[s]||{})u.hasOwnProperty(c)&&(p=d+u[c],l=i[c],(void 0===i[c]||l>p)&&(i[c]=p,f.push(c,p),o[c]=s));if(void 0!==n&&void 0===i[n]){var h=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(h)}return o},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,r,n){var o=t.single_source_shortest_paths(e,r,n);return t.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(e){var r,n=t.PriorityQueue,o={};for(r in e=e||{},n)n.hasOwnProperty(r)&&(o[r]=n[r]);return o.queue=[],o.sorter=e.sorter||n.default_sorter,o},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},2378:function(e){"use strict";e.exports=function(e){for(var t=[],r=e.length,n=0;n<r;n++){var o=e.charCodeAt(n);if(o>=55296&&o<=56319&&r>n+1){var i=e.charCodeAt(n+1);i>=56320&&i<=57343&&(o=1024*(o-55296)+i-56320+65536,n+=1)}o<128?t.push(o):o<2048?(t.push(o>>6|192),t.push(63&o|128)):o<55296||o>=57344&&o<65536?(t.push(o>>12|224),t.push(o>>6&63|128),t.push(63&o|128)):o>=65536&&o<=1114111?(t.push(o>>18|240),t.push(o>>12&63|128),t.push(o>>6&63|128),t.push(63&o|128)):t.push(239,191,189)}return new Uint8Array(t).buffer}},5391:function(e,t,r){parcelRequire=function(t,n,o,i){var a,s="function"==typeof parcelRequire&&parcelRequire;function c(e,o){if(!n[e]){if(!t[e]){var i="function"==typeof parcelRequire&&parcelRequire;if(!o&&i)return i(e,!0);if(s)return s(e,!0);if("string"==typeof e)return r(5784)(e);var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}u.resolve=function(r){return t[e][1][r]||r},u.cache={};var d=n[e]=new c.Module(e);t[e][0].call(d.exports,u,d,d.exports,this)}return n[e].exports;function u(e){return c(u.resolve(e))}}c.isParcelRequire=!0,c.Module=function(e){this.id=e,this.bundle=c,this.exports={}},c.modules=t,c.cache=n,c.parent=s,c.register=function(e,r){t[e]=[function(e,t){t.exports=r},{}]};for(var d=0;d<o.length;d++)try{c(o[d])}catch(t){a||(a=t)}if(o.length){var u=c(o[o.length-1]);e.exports=u}if(parcelRequire=c,a)throw a;return c}({EgBh:[function(e,t,r){var n={};n.useBlobBuilder=function(){try{return new Blob([]),!1}catch(e){return!0}}(),n.useArrayBufferView=!n.useBlobBuilder&&function(){try{return 0===new Blob([new Uint8Array([])]).size}catch(e){return!0}}(),t.exports.binaryFeatures=n;var o=t.exports.BlobBuilder;function i(){this._pieces=[],this._parts=[]}"undefined"!=typeof window&&(o=t.exports.BlobBuilder=window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder||window.BlobBuilder),i.prototype.append=function(e){"number"==typeof e?this._pieces.push(e):(this.flush(),this._parts.push(e))},i.prototype.flush=function(){if(this._pieces.length>0){var e=new Uint8Array(this._pieces);n.useArrayBufferView||(e=e.buffer),this._parts.push(e),this._pieces=[]}},i.prototype.getBuffer=function(){if(this.flush(),n.useBlobBuilder){for(var e=new o,t=0,r=this._parts.length;t<r;t++)e.append(this._parts[t]);return e.getBlob()}return new Blob(this._parts)},t.exports.BufferBuilder=i},{}],kdPp:[function(e,t,r){var n=e("./bufferbuilder").BufferBuilder,o=e("./bufferbuilder").binaryFeatures,i={unpack:function(e){return new a(e).unpack()},pack:function(e){var t=new s;return t.pack(e),t.getBuffer()}};function a(e){this.index=0,this.dataBuffer=e,this.dataView=new Uint8Array(this.dataBuffer),this.length=this.dataBuffer.byteLength}function s(){this.bufferBuilder=new n}function c(e){var t=e.charCodeAt(0);return t<=2047?"00":t<=65535?"000":t<=2097151?"0000":t<=67108863?"00000":"000000"}t.exports=i,a.prototype.unpack=function(){var e,t=this.unpack_uint8();if(t<128)return t;if((224^t)<32)return(224^t)-32;if((e=160^t)<=15)return this.unpack_raw(e);if((e=176^t)<=15)return this.unpack_string(e);if((e=144^t)<=15)return this.unpack_array(e);if((e=128^t)<=15)return this.unpack_map(e);switch(t){case 192:return null;case 193:return;case 194:return!1;case 195:return!0;case 202:return this.unpack_float();case 203:return this.unpack_double();case 204:return this.unpack_uint8();case 205:return this.unpack_uint16();case 206:return this.unpack_uint32();case 207:return this.unpack_uint64();case 208:return this.unpack_int8();case 209:return this.unpack_int16();case 210:return this.unpack_int32();case 211:return this.unpack_int64();case 212:case 213:case 214:case 215:return;case 216:return e=this.unpack_uint16(),this.unpack_string(e);case 217:return e=this.unpack_uint32(),this.unpack_string(e);case 218:return e=this.unpack_uint16(),this.unpack_raw(e);case 219:return e=this.unpack_uint32(),this.unpack_raw(e);case 220:return e=this.unpack_uint16(),this.unpack_array(e);case 221:return e=this.unpack_uint32(),this.unpack_array(e);case 222:return e=this.unpack_uint16(),this.unpack_map(e);case 223:return e=this.unpack_uint32(),this.unpack_map(e)}},a.prototype.unpack_uint8=function(){var e=255&this.dataView[this.index];return this.index++,e},a.prototype.unpack_uint16=function(){var e=this.read(2),t=256*(255&e[0])+(255&e[1]);return this.index+=2,t},a.prototype.unpack_uint32=function(){var e=this.read(4),t=256*(256*(256*e[0]+e[1])+e[2])+e[3];return this.index+=4,t},a.prototype.unpack_uint64=function(){var e=this.read(8),t=256*(256*(256*(256*(256*(256*(256*e[0]+e[1])+e[2])+e[3])+e[4])+e[5])+e[6])+e[7];return this.index+=8,t},a.prototype.unpack_int8=function(){var e=this.unpack_uint8();return e<128?e:e-256},a.prototype.unpack_int16=function(){var e=this.unpack_uint16();return e<32768?e:e-65536},a.prototype.unpack_int32=function(){var e=this.unpack_uint32();return e<Math.pow(2,31)?e:e-Math.pow(2,32)},a.prototype.unpack_int64=function(){var e=this.unpack_uint64();return e<Math.pow(2,63)?e:e-Math.pow(2,64)},a.prototype.unpack_raw=function(e){if(this.length<this.index+e)throw new Error("BinaryPackFailure: index is out of range "+this.index+" "+e+" "+this.length);var t=this.dataBuffer.slice(this.index,this.index+e);return this.index+=e,t},a.prototype.unpack_string=function(e){for(var t,r,n=this.read(e),o=0,i="";o<e;)(t=n[o])<128?(i+=String.fromCharCode(t),o++):(192^t)<32?(r=(192^t)<<6|63&n[o+1],i+=String.fromCharCode(r),o+=2):(r=(15&t)<<12|(63&n[o+1])<<6|63&n[o+2],i+=String.fromCharCode(r),o+=3);return this.index+=e,i},a.prototype.unpack_array=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=this.unpack();return t},a.prototype.unpack_map=function(e){for(var t={},r=0;r<e;r++){var n=this.unpack(),o=this.unpack();t[n]=o}return t},a.prototype.unpack_float=function(){var e=this.unpack_uint32(),t=(e>>23&255)-127;return(0==e>>31?1:-1)*(8388607&e|8388608)*Math.pow(2,t-23)},a.prototype.unpack_double=function(){var e=this.unpack_uint32(),t=this.unpack_uint32(),r=(e>>20&2047)-1023;return(0==e>>31?1:-1)*((1048575&e|1048576)*Math.pow(2,r-20)+t*Math.pow(2,r-52))},a.prototype.read=function(e){var t=this.index;if(t+e<=this.length)return this.dataView.subarray(t,t+e);throw new Error("BinaryPackFailure: read index out of range")},s.prototype.getBuffer=function(){return this.bufferBuilder.getBuffer()},s.prototype.pack=function(e){var t=typeof e;if("string"===t)this.pack_string(e);else if("number"===t)Math.floor(e)===e?this.pack_integer(e):this.pack_double(e);else if("boolean"===t)!0===e?this.bufferBuilder.append(195):!1===e&&this.bufferBuilder.append(194);else if("undefined"===t)this.bufferBuilder.append(192);else{if("object"!==t)throw new Error('Type "'+t+'" not yet supported');if(null===e)this.bufferBuilder.append(192);else{var r=e.constructor;if(r==Array)this.pack_array(e);else if(r==Blob||r==File||e instanceof Blob||e instanceof File)this.pack_bin(e);else if(r==ArrayBuffer)o.useArrayBufferView?this.pack_bin(new Uint8Array(e)):this.pack_bin(e);else if("BYTES_PER_ELEMENT"in e)o.useArrayBufferView?this.pack_bin(new Uint8Array(e.buffer)):this.pack_bin(e.buffer);else if(r==Object||r.toString().startsWith("class"))this.pack_object(e);else if(r==Date)this.pack_string(e.toString());else{if("function"!=typeof e.toBinaryPack)throw new Error('Type "'+r.toString()+'" not yet supported');this.bufferBuilder.append(e.toBinaryPack())}}}this.bufferBuilder.flush()},s.prototype.pack_bin=function(e){var t=e.length||e.byteLength||e.size;if(t<=15)this.pack_uint8(160+t);else if(t<=65535)this.bufferBuilder.append(218),this.pack_uint16(t);else{if(!(t<=4294967295))throw new Error("Invalid length");this.bufferBuilder.append(219),this.pack_uint32(t)}this.bufferBuilder.append(e)},s.prototype.pack_string=function(e){var t=function(e){return e.length>600?new Blob([e]).size:e.replace(/[^\u0000-\u007F]/g,c).length}(e);if(t<=15)this.pack_uint8(176+t);else if(t<=65535)this.bufferBuilder.append(216),this.pack_uint16(t);else{if(!(t<=4294967295))throw new Error("Invalid length");this.bufferBuilder.append(217),this.pack_uint32(t)}this.bufferBuilder.append(e)},s.prototype.pack_array=function(e){var t=e.length;if(t<=15)this.pack_uint8(144+t);else if(t<=65535)this.bufferBuilder.append(220),this.pack_uint16(t);else{if(!(t<=4294967295))throw new Error("Invalid length");this.bufferBuilder.append(221),this.pack_uint32(t)}for(var r=0;r<t;r++)this.pack(e[r])},s.prototype.pack_integer=function(e){if(e>=-32&&e<=127)this.bufferBuilder.append(255&e);else if(e>=0&&e<=255)this.bufferBuilder.append(204),this.pack_uint8(e);else if(e>=-128&&e<=127)this.bufferBuilder.append(208),this.pack_int8(e);else if(e>=0&&e<=65535)this.bufferBuilder.append(205),this.pack_uint16(e);else if(e>=-32768&&e<=32767)this.bufferBuilder.append(209),this.pack_int16(e);else if(e>=0&&e<=4294967295)this.bufferBuilder.append(206),this.pack_uint32(e);else if(e>=-2147483648&&e<=2147483647)this.bufferBuilder.append(210),this.pack_int32(e);else if(e>=-0x8000000000000000&&e<=0x8000000000000000)this.bufferBuilder.append(211),this.pack_int64(e);else{if(!(e>=0&&e<=0x10000000000000000))throw new Error("Invalid integer");this.bufferBuilder.append(207),this.pack_uint64(e)}},s.prototype.pack_double=function(e){var t=0;e<0&&(t=1,e=-e);var r=Math.floor(Math.log(e)/Math.LN2),n=e/Math.pow(2,r)-1,o=Math.floor(n*Math.pow(2,52)),i=Math.pow(2,32),a=t<<31|r+1023<<20|o/i&1048575,s=o%i;this.bufferBuilder.append(203),this.pack_int32(a),this.pack_int32(s)},s.prototype.pack_object=function(e){var t=Object.keys(e).length;if(t<=15)this.pack_uint8(128+t);else if(t<=65535)this.bufferBuilder.append(222),this.pack_uint16(t);else{if(!(t<=4294967295))throw new Error("Invalid length");this.bufferBuilder.append(223),this.pack_uint32(t)}for(var r in e)e.hasOwnProperty(r)&&(this.pack(r),this.pack(e[r]))},s.prototype.pack_uint8=function(e){this.bufferBuilder.append(e)},s.prototype.pack_uint16=function(e){this.bufferBuilder.append(e>>8),this.bufferBuilder.append(255&e)},s.prototype.pack_uint32=function(e){var t=4294967295&e;this.bufferBuilder.append((4278190080&t)>>>24),this.bufferBuilder.append((16711680&t)>>>16),this.bufferBuilder.append((65280&t)>>>8),this.bufferBuilder.append(255&t)},s.prototype.pack_uint64=function(e){var t=e/Math.pow(2,32),r=e%Math.pow(2,32);this.bufferBuilder.append((4278190080&t)>>>24),this.bufferBuilder.append((16711680&t)>>>16),this.bufferBuilder.append((65280&t)>>>8),this.bufferBuilder.append(255&t),this.bufferBuilder.append((4278190080&r)>>>24),this.bufferBuilder.append((16711680&r)>>>16),this.bufferBuilder.append((65280&r)>>>8),this.bufferBuilder.append(255&r)},s.prototype.pack_int8=function(e){this.bufferBuilder.append(255&e)},s.prototype.pack_int16=function(e){this.bufferBuilder.append((65280&e)>>8),this.bufferBuilder.append(255&e)},s.prototype.pack_int32=function(e){this.bufferBuilder.append(e>>>24&255),this.bufferBuilder.append((16711680&e)>>>16),this.bufferBuilder.append((65280&e)>>>8),this.bufferBuilder.append(255&e)},s.prototype.pack_int64=function(e){var t=Math.floor(e/Math.pow(2,32)),r=e%Math.pow(2,32);this.bufferBuilder.append((4278190080&t)>>>24),this.bufferBuilder.append((16711680&t)>>>16),this.bufferBuilder.append((65280&t)>>>8),this.bufferBuilder.append(255&t),this.bufferBuilder.append((4278190080&r)>>>24),this.bufferBuilder.append((16711680&r)>>>16),this.bufferBuilder.append((65280&r)>>>8),this.bufferBuilder.append(255&r)}},{"./bufferbuilder":"EgBh"}],iSxC:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.extractVersion=a,r.wrapPeerConnectionEvent=function(e,t,r){if(e.RTCPeerConnection){var n=e.RTCPeerConnection.prototype,o=n.addEventListener;n.addEventListener=function(e,n){if(e!==t)return o.apply(this,arguments);var i=function(e){var t=r(e);t&&(n.handleEvent?n.handleEvent(t):n(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(n,i),o.apply(this,[e,i])};var i=n.removeEventListener;n.removeEventListener=function(e,r){if(e!==t||!this._eventMap||!this._eventMap[t])return i.apply(this,arguments);if(!this._eventMap[t].has(r))return i.apply(this,arguments);var n=this._eventMap[t].get(r);return this._eventMap[t].delete(r),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,i.apply(this,[e,n])},Object.defineProperty(n,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}},r.disableLog=function(e){return"boolean"!=typeof e?new Error("Argument type: "+n(e)+". Please use a boolean."):(o=e,e?"adapter.js logging disabled":"adapter.js logging enabled")},r.disableWarnings=function(e){return"boolean"!=typeof e?new Error("Argument type: "+n(e)+". Please use a boolean."):(i=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))},r.log=function(){if("object"===("undefined"==typeof window?"undefined":n(window))){if(o)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}},r.deprecated=function(e,t){i&&console.warn(e+" is deprecated, please use "+t+" instead.")},r.detectBrowser=function(e){var t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;var{navigator:r}=e;if(r.mozGetUserMedia)t.browser="firefox",t.version=a(r.userAgent,/Firefox\/(\d+)\./,1);else if(r.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=a(r.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(r.mediaDevices&&r.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=a(r.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!e.RTCPeerConnection||!r.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=a(r.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t},r.compactObject=function e(t){return s(t)?Object.keys(t).reduce((function(r,n){var o=s(t[n]),i=o?e(t[n]):t[n],a=o&&!Object.keys(i).length;return void 0===i||a?r:Object.assign(r,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},n,i))}),{}):t},r.walkStats=c,r.filterStats=function(e,t,r){var n=r?"outbound-rtp":"inbound-rtp",o=new Map;if(null===t)return o;var i=[];return e.forEach((function(e){"track"===e.type&&e.trackIdentifier===t.id&&i.push(e)})),i.forEach((function(t){e.forEach((function(r){r.type===n&&r.trackId===t.id&&c(e,r,o)}))})),o};var o=!0,i=!0;function a(e,t,r){var n=e.match(t);return n&&n.length>=r&&parseInt(n[r],10)}function s(e){return"[object Object]"===Object.prototype.toString.call(e)}function c(e,t,r){t&&!r.has(t.id)&&(r.set(t.id,t),Object.keys(t).forEach((function(n){n.endsWith("Id")?c(e,e.get(t[n]),r):n.endsWith("Ids")&&t[n].forEach((function(t){c(e,e.get(t),r)}))})))}},{}],s6SN:[function(e,t,r){"use strict";function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetUserMedia=function(e,t){var r=e&&e.navigator;if(r.mediaDevices){var n=function(e){if("object"!==o(e)||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(r){if("require"!==r&&"advanced"!==r&&"mediaSource"!==r){var n="object"===o(e[r])?e[r]:{ideal:e[r]};void 0!==n.exact&&"number"==typeof n.exact&&(n.min=n.max=n.exact);var i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==n.ideal){t.optional=t.optional||[];var a={};"number"==typeof n.ideal?(a[i("min",r)]=n.ideal,t.optional.push(a),(a={})[i("max",r)]=n.ideal,t.optional.push(a)):(a[i("",r)]=n.ideal,t.optional.push(a))}void 0!==n.exact&&"number"!=typeof n.exact?(t.mandatory=t.mandatory||{},t.mandatory[i("",r)]=n.exact):["min","max"].forEach((function(e){void 0!==n[e]&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,r)]=n[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},a=function(e,a){if(t.version>=61)return a(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===o(e.audio)){var s=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])};s((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),s(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=n(e.audio)}if(e&&"object"===o(e.video)){var c=e.video.facingMode;c=c&&("object"===o(c)?c:{ideal:c});var d,u=t.version<66;if(c&&("user"===c.exact||"environment"===c.exact||"user"===c.ideal||"environment"===c.ideal)&&(!r.mediaDevices.getSupportedConstraints||!r.mediaDevices.getSupportedConstraints().facingMode||u)&&(delete e.video.facingMode,"environment"===c.exact||"environment"===c.ideal?d=["back","rear"]:"user"!==c.exact&&"user"!==c.ideal||(d=["front"]),d))return r.mediaDevices.enumerateDevices().then((function(t){var r=(t=t.filter((function(e){return"videoinput"===e.kind}))).find((function(e){return d.some((function(t){return e.label.toLowerCase().includes(t)}))}));return!r&&t.length&&d.includes("back")&&(r=t[t.length-1]),r&&(e.video.deviceId=c.exact?{exact:r.deviceId}:{ideal:r.deviceId}),e.video=n(e.video),i("chrome: "+JSON.stringify(e)),a(e)}));e.video=n(e.video)}return i("chrome: "+JSON.stringify(e)),a(e)},s=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};if(r.getUserMedia=function(e,t,n){a(e,(function(e){r.webkitGetUserMedia(e,t,(function(e){n&&n(s(e))}))}))}.bind(r),r.mediaDevices.getUserMedia){var c=r.mediaDevices.getUserMedia.bind(r.mediaDevices);r.mediaDevices.getUserMedia=function(e){return a(e,(function(e){return c(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return t}),(function(e){return Promise.reject(s(e))}))}))}}}};var i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}(e("../utils.js")).log},{"../utils.js":"iSxC"}],VHa8:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetDisplayMedia=function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(r){return t(r).then((function(t){var n=r.video&&r.video.width,o=r.video&&r.video.height,i=r.video&&r.video.frameRate;return r.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:i||3}},n&&(r.video.mandatory.maxWidth=n),o&&(r.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(r)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}},{}],uI5X:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimMediaStream=function(e){e.MediaStream=e.MediaStream||e.webkitMediaStream},r.shimOnTrack=function(e){if("object"!==c(e)||!e.RTCPeerConnection||"ontrack"in e.RTCPeerConnection.prototype)n.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}));else{Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var r=this;return this._ontrackpoly||(this._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(n){var o;o=e.RTCPeerConnection.prototype.getReceivers?r.getReceivers().find((function(e){return e.track&&e.track.id===n.track.id})):{track:n.track};var i=new Event("track");i.track=n.track,i.receiver=o,i.transceiver={receiver:o},i.streams=[t.stream],r.dispatchEvent(i)})),t.stream.getTracks().forEach((function(n){var o;o=e.RTCPeerConnection.prototype.getReceivers?r.getReceivers().find((function(e){return e.track&&e.track.id===n.id})):{track:n};var i=new Event("track");i.track=n,i.receiver=o,i.transceiver={receiver:o},i.streams=[t.stream],r.dispatchEvent(i)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}},r.shimGetSendersWithDtmf=function(e){if("object"===c(e)&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var r=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){var o=r.apply(this,arguments);return o||(o=t(this,e),this._senders.push(o)),o};var n=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){n.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var r=this;this._senders=this._senders||[],o.apply(this,[e]),e.getTracks().forEach((function(e){r._senders.push(t(r,e))}))};var i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[],i.apply(this,[e]),e.getTracks().forEach((function(e){var r=t._senders.find((function(t){return t.track===e}));r&&t._senders.splice(t._senders.indexOf(r),1)}))}}else if("object"===c(e)&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var a=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=a.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}},r.shimGetStats=function(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=this,[r,n,o]=arguments;if(arguments.length>0&&"function"==typeof r)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof r))return t.apply(this,[]);var i=function(e){var t={};return e.result().forEach((function(e){var r={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){r[t]=e.stat(t)})),t[r.id]=r})),t},a=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};return arguments.length>=2?t.apply(this,[function(e){n(a(i(e)))},r]):new Promise((function(r,n){t.apply(e,[function(e){r(a(i(e)))},n])})).then(n,o)}}},r.shimSenderReceiverGetStats=function(e){if("object"===c(e)&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,r=t.apply(this,[]);return r.forEach((function(t){return t._pc=e})),r});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return n.filterStats(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var o=e.RTCPeerConnection.prototype.getReceivers;o&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=o.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t}),n.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return n.filterStats(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t,r,n,o=arguments[0];return this.getSenders().forEach((function(e){e.track===o&&(t?n=!0:t=e)})),this.getReceivers().forEach((function(e){return e.track===o&&(r?n=!0:r=e),e.track===o})),n||t&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):t?t.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return i.apply(this,arguments)}}}},r.shimAddTrackRemoveTrackWithNative=d,r.shimAddTrackRemoveTrack=function(e,t){if(e.RTCPeerConnection){if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return d(e);var r=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=r.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var r=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((function(e){if(r.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){var o=new e.MediaStream(t.getTracks());this._streams[t.id]=o,this._reverseStreams[o.id]=t,t=o}n.apply(this,[t])};var o=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},o.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,r){var n=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var o=[].slice.call(arguments,1);if(1!==o.length||!o[0].getTracks().find((function(e){return e===t})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((function(e){return e.track===t})))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var i=this._streams[r.id];if(i)i.addTrack(t),Promise.resolve().then((function(){n.dispatchEvent(new Event("negotiationneeded"))}));else{var a=new e.MediaStream([t]);this._streams[r.id]=a,this._reverseStreams[a.id]=r,this.addStream(a)}return this.getSenders().find((function(e){return e.track===t}))},["createOffer","createAnswer"].forEach((function(t){var r=e.RTCPeerConnection.prototype[t],n=s({},t,(function(){var e=this,t=arguments;return arguments.length&&"function"==typeof arguments[0]?r.apply(this,[function(r){var n=c(e,r);t[0].apply(null,[n])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):r.apply(this,arguments).then((function(t){return c(e,t)}))}));e.RTCPeerConnection.prototype[t]=n[t]}));var i=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=(e=this,r=(t=arguments[0]).sdp,Object.keys(e._reverseStreams||[]).forEach((function(t){var n=e._reverseStreams[t],o=e._streams[n.id];r=r.replace(new RegExp(n.id,"g"),o.id)})),new RTCSessionDescription({type:t.type,sdp:r})),i.apply(this,arguments)):i.apply(this,arguments);var e,t,r};var a=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=a.get.apply(this);return""===e.type?e:c(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t,r=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{},Object.keys(this._streams).forEach((function(n){r._streams[n].getTracks().find((function(t){return e.track===t}))&&(t=r._streams[n])})),t&&(1===t.getTracks().length?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function c(e,t){var r=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var n=e._reverseStreams[t],o=e._streams[n.id];r=r.replace(new RegExp(o.id,"g"),n.id)})),new RTCSessionDescription({type:t.type,sdp:r})}},r.shimPeerConnection=function(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var r=e.RTCPeerConnection.prototype[t],n=s({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=n[t]}))},r.fixNegotiationNeeded=function(e,t){n.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){var r=e.target;if(!(t.version<72||r.getConfiguration&&"plan-b"===r.getConfiguration().sdpSemantics)||"stable"===r.signalingState)return e}))},Object.defineProperty(r,"shimGetUserMedia",{enumerable:!0,get:function(){return o.shimGetUserMedia}}),Object.defineProperty(r,"shimGetDisplayMedia",{enumerable:!0,get:function(){return i.shimGetDisplayMedia}});var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}(e("../utils.js")),o=e("./getusermedia"),i=e("./getdisplaymedia");function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(t){return e._shimmedLocalStreams[t][0]}))};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){if(!r)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var n=t.apply(this,arguments);return this._shimmedLocalStreams[r.id]?-1===this._shimmedLocalStreams[r.id].indexOf(n)&&this._shimmedLocalStreams[r.id].push(n):this._shimmedLocalStreams[r.id]=[r,n],n};var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){if(t.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")}));var n=this.getSenders();r.apply(this,arguments);var o=this.getSenders().filter((function(e){return-1===n.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(o)};var n=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],n.apply(this,arguments)};var o=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((function(r){var n=t._shimmedLocalStreams[r].indexOf(e);-1!==n&&t._shimmedLocalStreams[r].splice(n,1),1===t._shimmedLocalStreams[r].length&&delete t._shimmedLocalStreams[r]})),o.apply(this,arguments)}}},{"../utils.js":"iSxC","./getusermedia":"s6SN","./getdisplaymedia":"VHa8"}],NZ1C:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.filterIceServers=function(e,t){var r=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var t=e.urls||e.url;e.url&&!e.urls&&n.deprecated("RTCIceServer.url","RTCIceServer.urls");var o="string"==typeof t;return o&&(t=[t]),t=t.filter((function(e){if(0===e.indexOf("stun:"))return!1;var t=e.startsWith("turn")&&!e.startsWith("turn:[")&&e.includes("transport=udp");return t&&!r?(r=!0,!0):t&&!r})),delete e.url,e.urls=o?t[0]:t,!!t.length}}))};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}(e("../utils"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}},{"../utils":"iSxC"}],YHvh:[function(e,t,r){"use strict";var n={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},n.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},n.getDescription=function(e){var t=n.splitSections(e);return t&&t[0]},n.getMediaSections=function(e){var t=n.splitSections(e);return t.shift(),t},n.matchPrefix=function(e,t){return n.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},n.parseCandidate=function(e){for(var t,r={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:parseInt(t[1],10),protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},n=8;n<t.length;n+=2)switch(t[n]){case"raddr":r.relatedAddress=t[n+1];break;case"rport":r.relatedPort=parseInt(t[n+1],10);break;case"tcptype":r.tcpType=t[n+1];break;case"ufrag":r.ufrag=t[n+1],r.usernameFragment=t[n+1];break;default:r[t[n]]=t[n+1]}return r},n.writeCandidate=function(e){var t=[];t.push(e.foundation),t.push(e.component),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var r=e.type;return t.push("typ"),t.push(r),"host"!==r&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},n.parseIceOptions=function(e){return e.substr(14).split(" ")},n.parseRtpMap=function(e){var t=e.substr(9).split(" "),r={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),r.name=t[0],r.clockRate=parseInt(t[1],10),r.channels=3===t.length?parseInt(t[2],10):1,r.numChannels=r.channels,r},n.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var r=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==r?"/"+r:"")+"\r\n"},n.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},n.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},n.parseFmtp=function(e){for(var t,r={},n=e.substr(e.indexOf(" ")+1).split(";"),o=0;o<n.length;o++)r[(t=n[o].trim().split("="))[0].trim()]=t[1];return r},n.writeFmtp=function(e){var t="",r=e.payloadType;if(void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var n=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?n.push(t+"="+e.parameters[t]):n.push(t)})),t+="a=fmtp:"+r+" "+n.join(";")+"\r\n"}return t},n.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},n.writeRtcpFb=function(e){var t="",r=e.payloadType;return void 0!==e.preferredPayloadType&&(r=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+r+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},n.parseSsrcMedia=function(e){var t=e.indexOf(" "),r={ssrc:parseInt(e.substr(7,t-7),10)},n=e.indexOf(":",t);return n>-1?(r.attribute=e.substr(t+1,n-t-1),r.value=e.substr(n+1)):r.attribute=e.substr(t+1),r},n.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},n.getMid=function(e){var t=n.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},n.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},n.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:n.matchPrefix(e+t,"a=fingerprint:").map(n.parseFingerprint)}},n.writeDtlsParameters=function(e,t){var r="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){r+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),r},n.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},n.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"==typeof e.keyParams?n.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},n.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},n.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},n.getCryptoParameters=function(e,t){return n.matchPrefix(e+t,"a=crypto:").map(n.parseCryptoLine)},n.getIceParameters=function(e,t){var r=n.matchPrefix(e+t,"a=ice-ufrag:")[0],o=n.matchPrefix(e+t,"a=ice-pwd:")[0];return r&&o?{usernameFragment:r.substr(12),password:o.substr(10)}:null},n.writeIceParameters=function(e){return"a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n"},n.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=n.splitLines(e)[0].split(" "),o=3;o<r.length;o++){var i=r[o],a=n.matchPrefix(e,"a=rtpmap:"+i+" ")[0];if(a){var s=n.parseRtpMap(a),c=n.matchPrefix(e,"a=fmtp:"+i+" ");switch(s.parameters=c.length?n.parseFmtp(c[0]):{},s.rtcpFeedback=n.matchPrefix(e,"a=rtcp-fb:"+i+" ").map(n.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}return n.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(n.parseExtmap(e))})),t},n.writeRtpDescription=function(e,t){var r="";r+="m="+e+" ",r+=t.codecs.length>0?"9":"0",r+=" UDP/TLS/RTP/SAVPF ",r+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",r+="c=IN IP4 0.0.0.0\r\n",r+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){r+=n.writeRtpMap(e),r+=n.writeFmtp(e),r+=n.writeRtcpFb(e)}));var o=0;return t.codecs.forEach((function(e){e.maxptime>o&&(o=e.maxptime)})),o>0&&(r+="a=maxptime:"+o+"\r\n"),r+="a=rtcp-mux\r\n",t.headerExtensions&&t.headerExtensions.forEach((function(e){r+=n.writeExtmap(e)})),r},n.parseRtpEncodingParameters=function(e){var t,r=[],o=n.parseRtpParameters(e),i=-1!==o.fecMechanisms.indexOf("RED"),a=-1!==o.fecMechanisms.indexOf("ULPFEC"),s=n.matchPrefix(e,"a=ssrc:").map((function(e){return n.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),c=s.length>0&&s[0].ssrc,d=n.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));d.length>0&&d[0].length>1&&d[0][0]===c&&(t=d[0][1]),o.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var n={ssrc:c,codecPayloadType:parseInt(e.parameters.apt,10)};c&&t&&(n.rtx={ssrc:t}),r.push(n),i&&((n=JSON.parse(JSON.stringify(n))).fec={ssrc:c,mechanism:a?"red+ulpfec":"red"},r.push(n))}})),0===r.length&&c&&r.push({ssrc:c});var u=n.matchPrefix(e,"b=");return u.length&&(u=0===u[0].indexOf("b=TIAS:")?parseInt(u[0].substr(7),10):0===u[0].indexOf("b=AS:")?1e3*parseInt(u[0].substr(5),10)*.95-16e3:void 0,r.forEach((function(e){e.maxBitrate=u}))),r},n.parseRtcpParameters=function(e){var t={},r=n.matchPrefix(e,"a=ssrc:").map((function(e){return n.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];r&&(t.cname=r.value,t.ssrc=r.ssrc);var o=n.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=o.length>0,t.compound=0===o.length;var i=n.matchPrefix(e,"a=rtcp-mux");return t.mux=i.length>0,t},n.parseMsid=function(e){var t,r=n.matchPrefix(e,"a=msid:");if(1===r.length)return{stream:(t=r[0].substr(7).split(" "))[0],track:t[1]};var o=n.matchPrefix(e,"a=ssrc:").map((function(e){return n.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return o.length>0?{stream:(t=o[0].value.split(" "))[0],track:t[1]}:void 0},n.parseSctpDescription=function(e){var t,r=n.parseMLine(e),o=n.matchPrefix(e,"a=max-message-size:");o.length>0&&(t=parseInt(o[0].substr(19),10)),isNaN(t)&&(t=65536);var i=n.matchPrefix(e,"a=sctp-port:");if(i.length>0)return{port:parseInt(i[0].substr(12),10),protocol:r.fmt,maxMessageSize:t};if(n.matchPrefix(e,"a=sctpmap:").length>0){var a=n.matchPrefix(e,"a=sctpmap:")[0].substr(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:t}}},n.writeSctpDescription=function(e,t){var r=[];return r="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&r.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),r.join("")},n.generateSessionId=function(){return Math.random().toString().substr(2,21)},n.writeSessionBoilerplate=function(e,t,r){var o=void 0!==t?t:2;return"v=0\r\no="+(r||"thisisadapterortc")+" "+(e||n.generateSessionId())+" "+o+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},n.writeMediaSection=function(e,t,r,o){var i=n.writeRtpDescription(e.kind,t);if(i+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),i+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":"active"),i+="a=mid:"+e.mid+"\r\n",e.direction?i+="a="+e.direction+"\r\n":e.rtpSender&&e.rtpReceiver?i+="a=sendrecv\r\n":e.rtpSender?i+="a=sendonly\r\n":e.rtpReceiver?i+="a=recvonly\r\n":i+="a=inactive\r\n",e.rtpSender){var a="msid:"+o.id+" "+e.rtpSender.track.id+"\r\n";i+="a="+a,i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+a,e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+a,i+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return i+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(i+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),i},n.getDirection=function(e,t){for(var r=n.splitLines(e),o=0;o<r.length;o++)switch(r[o]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[o].substr(2)}return t?n.getDirection(t):"sendrecv"},n.getKind=function(e){return n.splitLines(e)[0].split(" ")[0].substr(2)},n.isRejected=function(e){return"0"===e.split(" ",2)[1]},n.parseMLine=function(e){var t=n.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},n.parseOLine=function(e){var t=n.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},n.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=n.splitLines(e),r=0;r<t.length;r++)if(t[r].length<2||"="!==t[r].charAt(1))return!1;return!0},"object"==typeof t&&(t.exports=n)},{}],NJ2u:[function(e,t,r){"use strict";var n=e("sdp");function o(e,t,r,o,i){var a=n.writeRtpDescription(e.kind,t);if(a+=n.writeIceParameters(e.iceGatherer.getLocalParameters()),a+=n.writeDtlsParameters(e.dtlsTransport.getLocalParameters(),"offer"===r?"actpass":i||"active"),a+="a=mid:"+e.mid+"\r\n",e.rtpSender&&e.rtpReceiver?a+="a=sendrecv\r\n":e.rtpSender?a+="a=sendonly\r\n":e.rtpReceiver?a+="a=recvonly\r\n":a+="a=inactive\r\n",e.rtpSender){var s=e.rtpSender._initialTrackId||e.rtpSender.track.id;e.rtpSender._initialTrackId=s;var c="msid:"+(o?o.id:"-")+" "+s+"\r\n";a+="a="+c,a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" "+c,e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" "+c,a+="a=ssrc-group:FID "+e.sendEncodingParameters[0].ssrc+" "+e.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return a+="a=ssrc:"+e.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",e.rtpSender&&e.sendEncodingParameters[0].rtx&&(a+="a=ssrc:"+e.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),a}function i(e,t){var r={codecs:[],headerExtensions:[],fecMechanisms:[]},n=function(e,t){e=parseInt(e,10);for(var r=0;r<t.length;r++)if(t[r].payloadType===e||t[r].preferredPayloadType===e)return t[r]},o=function(e,t,r,o){var i=n(e.parameters.apt,r),a=n(t.parameters.apt,o);return i&&a&&i.name.toLowerCase()===a.name.toLowerCase()};return e.codecs.forEach((function(n){for(var i=0;i<t.codecs.length;i++){var a=t.codecs[i];if(n.name.toLowerCase()===a.name.toLowerCase()&&n.clockRate===a.clockRate){if("rtx"===n.name.toLowerCase()&&n.parameters&&a.parameters.apt&&!o(n,a,e.codecs,t.codecs))continue;(a=JSON.parse(JSON.stringify(a))).numChannels=Math.min(n.numChannels,a.numChannels),r.codecs.push(a),a.rtcpFeedback=a.rtcpFeedback.filter((function(e){for(var t=0;t<n.rtcpFeedback.length;t++)if(n.rtcpFeedback[t].type===e.type&&n.rtcpFeedback[t].parameter===e.parameter)return!0;return!1}));break}}})),e.headerExtensions.forEach((function(e){for(var n=0;n<t.headerExtensions.length;n++){var o=t.headerExtensions[n];if(e.uri===o.uri){r.headerExtensions.push(o);break}}})),r}function a(e,t,r){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[t][e].indexOf(r)}function s(e,t){var r=e.getRemoteCandidates().find((function(e){return t.foundation===e.foundation&&t.ip===e.ip&&t.port===e.port&&t.priority===e.priority&&t.protocol===e.protocol&&t.type===e.type}));return r||e.addRemoteCandidate(t),!r}function c(e,t){var r=new Error(t);return r.name=e,r.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[e],r}t.exports=function(e,t){function r(t,r){r.addTrack(t),r.dispatchEvent(new e.MediaStreamTrackEvent("addtrack",{track:t}))}function d(t,r,n,o){var i=new Event("track");i.track=r,i.receiver=n,i.transceiver={receiver:n},i.streams=o,e.setTimeout((function(){t._dispatchEvent("track",i)}))}var u=function(r){var o=this,i=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(e){o[e]=i[e].bind(i)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",r=JSON.parse(JSON.stringify(r||{})),this.usingBundle="max-bundle"===r.bundlePolicy,"negotiate"===r.rtcpMuxPolicy)throw c("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(r.rtcpMuxPolicy||(r.rtcpMuxPolicy="require"),r.iceTransportPolicy){case"all":case"relay":break;default:r.iceTransportPolicy="all"}switch(r.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:r.bundlePolicy="balanced"}if(r.iceServers=function(e,t){var r=!1;return(e=JSON.parse(JSON.stringify(e))).filter((function(e){if(e&&(e.urls||e.url)){var n=e.urls||e.url;e.url&&!e.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var o="string"==typeof n;return o&&(n=[n]),n=n.filter((function(e){return 0!==e.indexOf("turn:")||-1===e.indexOf("transport=udp")||-1!==e.indexOf("turn:[")||r?0===e.indexOf("stun:")&&t>=14393&&-1===e.indexOf("?transport=udp"):(r=!0,!0)})),delete e.url,e.urls=o?n[0]:n,!!n.length}}))}(r.iceServers||[],t),this._iceGatherers=[],r.iceCandidatePoolSize)for(var a=r.iceCandidatePoolSize;a>0;a--)this._iceGatherers.push(new e.RTCIceGatherer({iceServers:r.iceServers,gatherPolicy:r.iceTransportPolicy}));else r.iceCandidatePoolSize=0;this._config=r,this.transceivers=[],this._sdpSessionId=n.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(u.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(u.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),u.prototype.onicecandidate=null,u.prototype.onaddstream=null,u.prototype.ontrack=null,u.prototype.onremovestream=null,u.prototype.onsignalingstatechange=null,u.prototype.oniceconnectionstatechange=null,u.prototype.onconnectionstatechange=null,u.prototype.onicegatheringstatechange=null,u.prototype.onnegotiationneeded=null,u.prototype.ondatachannel=null,u.prototype._dispatchEvent=function(e,t){this._isClosed||(this.dispatchEvent(t),"function"==typeof this["on"+e]&&this["on"+e](t))},u.prototype._emitGatheringStateChange=function(){var e=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",e)},u.prototype.getConfiguration=function(){return this._config},u.prototype.getLocalStreams=function(){return this.localStreams},u.prototype.getRemoteStreams=function(){return this.remoteStreams},u.prototype._createTransceiver=function(e,t){var r=this.transceivers.length>0,n={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:e,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&r)n.iceTransport=this.transceivers[0].iceTransport,n.dtlsTransport=this.transceivers[0].dtlsTransport;else{var o=this._createIceAndDtlsTransports();n.iceTransport=o.iceTransport,n.dtlsTransport=o.dtlsTransport}return t||this.transceivers.push(n),n},u.prototype.addTrack=function(t,r){if(this._isClosed)throw c("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var n;if(this.transceivers.find((function(e){return e.track===t})))throw c("InvalidAccessError","Track already exists.");for(var o=0;o<this.transceivers.length;o++)this.transceivers[o].track||this.transceivers[o].kind!==t.kind||(n=this.transceivers[o]);return n||(n=this._createTransceiver(t.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(r)&&this.localStreams.push(r),n.track=t,n.stream=r,n.rtpSender=new e.RTCRtpSender(t,n.dtlsTransport),n.rtpSender},u.prototype.addStream=function(e){var r=this;if(t>=15025)e.getTracks().forEach((function(t){r.addTrack(t,e)}));else{var n=e.clone();e.getTracks().forEach((function(e,t){var r=n.getTracks()[t];e.addEventListener("enabled",(function(e){r.enabled=e.enabled}))})),n.getTracks().forEach((function(e){r.addTrack(e,n)}))}},u.prototype.removeTrack=function(t){if(this._isClosed)throw c("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(t instanceof e.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var r=this.transceivers.find((function(e){return e.rtpSender===t}));if(!r)throw c("InvalidAccessError","Sender was not created by this connection.");var n=r.stream;r.rtpSender.stop(),r.rtpSender=null,r.track=null,r.stream=null,-1===this.transceivers.map((function(e){return e.stream})).indexOf(n)&&this.localStreams.indexOf(n)>-1&&this.localStreams.splice(this.localStreams.indexOf(n),1),this._maybeFireNegotiationNeeded()},u.prototype.removeStream=function(e){var t=this;e.getTracks().forEach((function(e){var r=t.getSenders().find((function(t){return t.track===e}));r&&t.removeTrack(r)}))},u.prototype.getSenders=function(){return this.transceivers.filter((function(e){return!!e.rtpSender})).map((function(e){return e.rtpSender}))},u.prototype.getReceivers=function(){return this.transceivers.filter((function(e){return!!e.rtpReceiver})).map((function(e){return e.rtpReceiver}))},u.prototype._createIceGatherer=function(t,r){var n=this;if(r&&t>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var o=new e.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(o,"state",{value:"new",writable:!0}),this.transceivers[t].bufferedCandidateEvents=[],this.transceivers[t].bufferCandidates=function(e){var r=!e.candidate||0===Object.keys(e.candidate).length;o.state=r?"completed":"gathering",null!==n.transceivers[t].bufferedCandidateEvents&&n.transceivers[t].bufferedCandidateEvents.push(e)},o.addEventListener("localcandidate",this.transceivers[t].bufferCandidates),o},u.prototype._gather=function(t,r){var o=this,i=this.transceivers[r].iceGatherer;if(!i.onlocalcandidate){var a=this.transceivers[r].bufferedCandidateEvents;this.transceivers[r].bufferedCandidateEvents=null,i.removeEventListener("localcandidate",this.transceivers[r].bufferCandidates),i.onlocalcandidate=function(e){if(!(o.usingBundle&&r>0)){var a=new Event("icecandidate");a.candidate={sdpMid:t,sdpMLineIndex:r};var s=e.candidate,c=!s||0===Object.keys(s).length;if(c)"new"!==i.state&&"gathering"!==i.state||(i.state="completed");else{"new"===i.state&&(i.state="gathering"),s.component=1,s.ufrag=i.getLocalParameters().usernameFragment;var d=n.writeCandidate(s);a.candidate=Object.assign(a.candidate,n.parseCandidate(d)),a.candidate.candidate=d,a.candidate.toJSON=function(){return{candidate:a.candidate.candidate,sdpMid:a.candidate.sdpMid,sdpMLineIndex:a.candidate.sdpMLineIndex,usernameFragment:a.candidate.usernameFragment}}}var u=n.getMediaSections(o._localDescription.sdp);u[a.candidate.sdpMLineIndex]+=c?"a=end-of-candidates\r\n":"a="+a.candidate.candidate+"\r\n",o._localDescription.sdp=n.getDescription(o._localDescription.sdp)+u.join("");var p=o.transceivers.every((function(e){return e.iceGatherer&&"completed"===e.iceGatherer.state}));"gathering"!==o.iceGatheringState&&(o.iceGatheringState="gathering",o._emitGatheringStateChange()),c||o._dispatchEvent("icecandidate",a),p&&(o._dispatchEvent("icecandidate",new Event("icecandidate")),o.iceGatheringState="complete",o._emitGatheringStateChange())}},e.setTimeout((function(){a.forEach((function(e){i.onlocalcandidate(e)}))}),0)}},u.prototype._createIceAndDtlsTransports=function(){var t=this,r=new e.RTCIceTransport(null);r.onicestatechange=function(){t._updateIceConnectionState(),t._updateConnectionState()};var n=new e.RTCDtlsTransport(r);return n.ondtlsstatechange=function(){t._updateConnectionState()},n.onerror=function(){Object.defineProperty(n,"state",{value:"failed",writable:!0}),t._updateConnectionState()},{iceTransport:r,dtlsTransport:n}},u.prototype._disposeIceAndDtlsTransports=function(e){var t=this.transceivers[e].iceGatherer;t&&(delete t.onlocalcandidate,delete this.transceivers[e].iceGatherer);var r=this.transceivers[e].iceTransport;r&&(delete r.onicestatechange,delete this.transceivers[e].iceTransport);var n=this.transceivers[e].dtlsTransport;n&&(delete n.ondtlsstatechange,delete n.onerror,delete this.transceivers[e].dtlsTransport)},u.prototype._transceive=function(e,r,o){var a=i(e.localCapabilities,e.remoteCapabilities);r&&e.rtpSender&&(a.encodings=e.sendEncodingParameters,a.rtcp={cname:n.localCName,compound:e.rtcpParameters.compound},e.recvEncodingParameters.length&&(a.rtcp.ssrc=e.recvEncodingParameters[0].ssrc),e.rtpSender.send(a)),o&&e.rtpReceiver&&a.codecs.length>0&&("video"===e.kind&&e.recvEncodingParameters&&t<15019&&e.recvEncodingParameters.forEach((function(e){delete e.rtx})),e.recvEncodingParameters.length?a.encodings=e.recvEncodingParameters:a.encodings=[{}],a.rtcp={compound:e.rtcpParameters.compound},e.rtcpParameters.cname&&(a.rtcp.cname=e.rtcpParameters.cname),e.sendEncodingParameters.length&&(a.rtcp.ssrc=e.sendEncodingParameters[0].ssrc),e.rtpReceiver.receive(a))},u.prototype.setLocalDescription=function(e){var t,r,o=this;if(-1===["offer","answer"].indexOf(e.type))return Promise.reject(c("TypeError",'Unsupported type "'+e.type+'"'));if(!a("setLocalDescription",e.type,o.signalingState)||o._isClosed)return Promise.reject(c("InvalidStateError","Can not set local "+e.type+" in state "+o.signalingState));if("offer"===e.type)t=n.splitSections(e.sdp),r=t.shift(),t.forEach((function(e,t){var r=n.parseRtpParameters(e);o.transceivers[t].localCapabilities=r})),o.transceivers.forEach((function(e,t){o._gather(e.mid,t)}));else if("answer"===e.type){t=n.splitSections(o._remoteDescription.sdp),r=t.shift();var s=n.matchPrefix(r,"a=ice-lite").length>0;t.forEach((function(e,t){var a=o.transceivers[t],c=a.iceGatherer,d=a.iceTransport,u=a.dtlsTransport,p=a.localCapabilities,l=a.remoteCapabilities;if(!(n.isRejected(e)&&0===n.matchPrefix(e,"a=bundle-only").length||a.rejected)){var f=n.getIceParameters(e,r),h=n.getDtlsParameters(e,r);s&&(h.role="server"),o.usingBundle&&0!==t||(o._gather(a.mid,t),"new"===d.state&&d.start(c,f,s?"controlling":"controlled"),"new"===u.state&&u.start(h));var m=i(p,l);o._transceive(a,m.codecs.length>0,!1)}}))}return o._localDescription={type:e.type,sdp:e.sdp},"offer"===e.type?o._updateSignalingState("have-local-offer"):o._updateSignalingState("stable"),Promise.resolve()},u.prototype.setRemoteDescription=function(o){var u=this;if(-1===["offer","answer"].indexOf(o.type))return Promise.reject(c("TypeError",'Unsupported type "'+o.type+'"'));if(!a("setRemoteDescription",o.type,u.signalingState)||u._isClosed)return Promise.reject(c("InvalidStateError","Can not set remote "+o.type+" in state "+u.signalingState));var p={};u.remoteStreams.forEach((function(e){p[e.id]=e}));var l=[],f=n.splitSections(o.sdp),h=f.shift(),m=n.matchPrefix(h,"a=ice-lite").length>0,g=n.matchPrefix(h,"a=group:BUNDLE ").length>0;u.usingBundle=g;var y=n.matchPrefix(h,"a=ice-options:")[0];return u.canTrickleIceCandidates=!!y&&y.substr(14).split(" ").indexOf("trickle")>=0,f.forEach((function(a,c){var d=n.splitLines(a),f=n.getKind(a),y=n.isRejected(a)&&0===n.matchPrefix(a,"a=bundle-only").length,E=d[0].substr(2).split(" ")[2],v=n.getDirection(a,h),_=n.parseMsid(a),T=n.getMid(a)||n.generateIdentifier();if(y||"application"===f&&("DTLS/SCTP"===E||"UDP/DTLS/SCTP"===E))u.transceivers[c]={mid:T,kind:f,protocol:E,rejected:!0};else{var w,b,O,P,S,A,D,R,C;!y&&u.transceivers[c]&&u.transceivers[c].rejected&&(u.transceivers[c]=u._createTransceiver(f,!0));var M,k,I=n.parseRtpParameters(a);y||(M=n.getIceParameters(a,h),(k=n.getDtlsParameters(a,h)).role="client"),D=n.parseRtpEncodingParameters(a);var x=n.parseRtcpParameters(a),F=n.matchPrefix(a,"a=end-of-candidates",h).length>0,N=n.matchPrefix(a,"a=candidate:").map((function(e){return n.parseCandidate(e)})).filter((function(e){return 1===e.component}));if(("offer"===o.type||"answer"===o.type)&&!y&&g&&c>0&&u.transceivers[c]&&(u._disposeIceAndDtlsTransports(c),u.transceivers[c].iceGatherer=u.transceivers[0].iceGatherer,u.transceivers[c].iceTransport=u.transceivers[0].iceTransport,u.transceivers[c].dtlsTransport=u.transceivers[0].dtlsTransport,u.transceivers[c].rtpSender&&u.transceivers[c].rtpSender.setTransport(u.transceivers[0].dtlsTransport),u.transceivers[c].rtpReceiver&&u.transceivers[c].rtpReceiver.setTransport(u.transceivers[0].dtlsTransport)),"offer"!==o.type||y)"answer"!==o.type||y||(b=(w=u.transceivers[c]).iceGatherer,O=w.iceTransport,P=w.dtlsTransport,S=w.rtpReceiver,A=w.sendEncodingParameters,R=w.localCapabilities,u.transceivers[c].recvEncodingParameters=D,u.transceivers[c].remoteCapabilities=I,u.transceivers[c].rtcpParameters=x,N.length&&"new"===O.state&&(!m&&!F||g&&0!==c?N.forEach((function(e){s(w.iceTransport,e)})):O.setRemoteCandidates(N)),g&&0!==c||("new"===O.state&&O.start(b,M,"controlling"),"new"===P.state&&P.start(k)),!i(w.localCapabilities,w.remoteCapabilities).codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&w.sendEncodingParameters[0].rtx&&delete w.sendEncodingParameters[0].rtx,u._transceive(w,"sendrecv"===v||"recvonly"===v,"sendrecv"===v||"sendonly"===v),!S||"sendrecv"!==v&&"sendonly"!==v?delete w.rtpReceiver:(C=S.track,_?(p[_.stream]||(p[_.stream]=new e.MediaStream),r(C,p[_.stream]),l.push([C,S,p[_.stream]])):(p.default||(p.default=new e.MediaStream),r(C,p.default),l.push([C,S,p.default]))));else{(w=u.transceivers[c]||u._createTransceiver(f)).mid=T,w.iceGatherer||(w.iceGatherer=u._createIceGatherer(c,g)),N.length&&"new"===w.iceTransport.state&&(!F||g&&0!==c?N.forEach((function(e){s(w.iceTransport,e)})):w.iceTransport.setRemoteCandidates(N)),R=e.RTCRtpReceiver.getCapabilities(f),t<15019&&(R.codecs=R.codecs.filter((function(e){return"rtx"!==e.name}))),A=w.sendEncodingParameters||[{ssrc:1001*(2*c+2)}];var j,V=!1;"sendrecv"===v||"sendonly"===v?(V=!w.rtpReceiver,S=w.rtpReceiver||new e.RTCRtpReceiver(w.dtlsTransport,f),V&&(C=S.track,_&&"-"===_.stream||(_?(p[_.stream]||(p[_.stream]=new e.MediaStream,Object.defineProperty(p[_.stream],"id",{get:function(){return _.stream}})),Object.defineProperty(C,"id",{get:function(){return _.track}}),j=p[_.stream]):(p.default||(p.default=new e.MediaStream),j=p.default)),j&&(r(C,j),w.associatedRemoteMediaStreams.push(j)),l.push([C,S,j]))):w.rtpReceiver&&w.rtpReceiver.track&&(w.associatedRemoteMediaStreams.forEach((function(t){var r,n,o=t.getTracks().find((function(e){return e.id===w.rtpReceiver.track.id}));o&&(r=o,(n=t).removeTrack(r),n.dispatchEvent(new e.MediaStreamTrackEvent("removetrack",{track:r})))})),w.associatedRemoteMediaStreams=[]),w.localCapabilities=R,w.remoteCapabilities=I,w.rtpReceiver=S,w.rtcpParameters=x,w.sendEncodingParameters=A,w.recvEncodingParameters=D,u._transceive(u.transceivers[c],!1,V)}}})),void 0===u._dtlsRole&&(u._dtlsRole="offer"===o.type?"active":"passive"),u._remoteDescription={type:o.type,sdp:o.sdp},"offer"===o.type?u._updateSignalingState("have-remote-offer"):u._updateSignalingState("stable"),Object.keys(p).forEach((function(t){var r=p[t];if(r.getTracks().length){if(-1===u.remoteStreams.indexOf(r)){u.remoteStreams.push(r);var n=new Event("addstream");n.stream=r,e.setTimeout((function(){u._dispatchEvent("addstream",n)}))}l.forEach((function(e){var t=e[0],n=e[1];r.id===e[2].id&&d(u,t,n,[r])}))}})),l.forEach((function(e){e[2]||d(u,e[0],e[1],[])})),e.setTimeout((function(){u&&u.transceivers&&u.transceivers.forEach((function(e){e.iceTransport&&"new"===e.iceTransport.state&&e.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),e.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},u.prototype.close=function(){this.transceivers.forEach((function(e){e.iceTransport&&e.iceTransport.stop(),e.dtlsTransport&&e.dtlsTransport.stop(),e.rtpSender&&e.rtpSender.stop(),e.rtpReceiver&&e.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},u.prototype._updateSignalingState=function(e){this.signalingState=e;var t=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",t)},u.prototype._maybeFireNegotiationNeeded=function(){var t=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,e.setTimeout((function(){if(t.needNegotiation){t.needNegotiation=!1;var e=new Event("negotiationneeded");t._dispatchEvent("negotiationneeded",e)}}),0))},u.prototype._updateIceConnectionState=function(){var e,t={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&!e.rejected&&t[e.iceTransport.state]++})),e="new",t.failed>0?e="failed":t.checking>0?e="checking":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0?e="connected":t.completed>0&&(e="completed"),e!==this.iceConnectionState){this.iceConnectionState=e;var r=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",r)}},u.prototype._updateConnectionState=function(){var e,t={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(e){e.iceTransport&&e.dtlsTransport&&!e.rejected&&(t[e.iceTransport.state]++,t[e.dtlsTransport.state]++)})),t.connected+=t.completed,e="new",t.failed>0?e="failed":t.connecting>0?e="connecting":t.disconnected>0?e="disconnected":t.new>0?e="new":t.connected>0&&(e="connected"),e!==this.connectionState){this.connectionState=e;var r=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",r)}},u.prototype.createOffer=function(){var r=this;if(r._isClosed)return Promise.reject(c("InvalidStateError","Can not call createOffer after close"));var i=r.transceivers.filter((function(e){return"audio"===e.kind})).length,a=r.transceivers.filter((function(e){return"video"===e.kind})).length,s=arguments[0];if(s){if(s.mandatory||s.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==s.offerToReceiveAudio&&(i=!0===s.offerToReceiveAudio?1:!1===s.offerToReceiveAudio?0:s.offerToReceiveAudio),void 0!==s.offerToReceiveVideo&&(a=!0===s.offerToReceiveVideo?1:!1===s.offerToReceiveVideo?0:s.offerToReceiveVideo)}for(r.transceivers.forEach((function(e){"audio"===e.kind?--i<0&&(e.wantReceive=!1):"video"===e.kind&&--a<0&&(e.wantReceive=!1)}));i>0||a>0;)i>0&&(r._createTransceiver("audio"),i--),a>0&&(r._createTransceiver("video"),a--);var d=n.writeSessionBoilerplate(r._sdpSessionId,r._sdpSessionVersion++);r.transceivers.forEach((function(o,i){var a=o.track,s=o.kind,c=o.mid||n.generateIdentifier();o.mid=c,o.iceGatherer||(o.iceGatherer=r._createIceGatherer(i,r.usingBundle));var d=e.RTCRtpSender.getCapabilities(s);t<15019&&(d.codecs=d.codecs.filter((function(e){return"rtx"!==e.name}))),d.codecs.forEach((function(e){"H264"===e.name&&void 0===e.parameters["level-asymmetry-allowed"]&&(e.parameters["level-asymmetry-allowed"]="1"),o.remoteCapabilities&&o.remoteCapabilities.codecs&&o.remoteCapabilities.codecs.forEach((function(t){e.name.toLowerCase()===t.name.toLowerCase()&&e.clockRate===t.clockRate&&(e.preferredPayloadType=t.payloadType)}))})),d.headerExtensions.forEach((function(e){(o.remoteCapabilities&&o.remoteCapabilities.headerExtensions||[]).forEach((function(t){e.uri===t.uri&&(e.id=t.id)}))}));var u=o.sendEncodingParameters||[{ssrc:1001*(2*i+1)}];a&&t>=15019&&"video"===s&&!u[0].rtx&&(u[0].rtx={ssrc:u[0].ssrc+1}),o.wantReceive&&(o.rtpReceiver=new e.RTCRtpReceiver(o.dtlsTransport,s)),o.localCapabilities=d,o.sendEncodingParameters=u})),"max-compat"!==r._config.bundlePolicy&&(d+="a=group:BUNDLE "+r.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),d+="a=ice-options:trickle\r\n",r.transceivers.forEach((function(e,t){d+=o(e,e.localCapabilities,"offer",e.stream,r._dtlsRole),d+="a=rtcp-rsize\r\n",!e.iceGatherer||"new"===r.iceGatheringState||0!==t&&r.usingBundle||(e.iceGatherer.getLocalCandidates().forEach((function(e){e.component=1,d+="a="+n.writeCandidate(e)+"\r\n"})),"completed"===e.iceGatherer.state&&(d+="a=end-of-candidates\r\n"))}));var u=new e.RTCSessionDescription({type:"offer",sdp:d});return Promise.resolve(u)},u.prototype.createAnswer=function(){var r=this;if(r._isClosed)return Promise.reject(c("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==r.signalingState&&"have-local-pranswer"!==r.signalingState)return Promise.reject(c("InvalidStateError","Can not call createAnswer in signalingState "+r.signalingState));var a=n.writeSessionBoilerplate(r._sdpSessionId,r._sdpSessionVersion++);r.usingBundle&&(a+="a=group:BUNDLE "+r.transceivers.map((function(e){return e.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n";var s=n.getMediaSections(r._remoteDescription.sdp).length;r.transceivers.forEach((function(e,n){if(!(n+1>s)){if(e.rejected)return"application"===e.kind?"DTLS/SCTP"===e.protocol?a+="m=application 0 DTLS/SCTP 5000\r\n":a+="m=application 0 "+e.protocol+" webrtc-datachannel\r\n":"audio"===e.kind?a+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===e.kind&&(a+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(a+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+e.mid+"\r\n");var c;e.stream&&("audio"===e.kind?c=e.stream.getAudioTracks()[0]:"video"===e.kind&&(c=e.stream.getVideoTracks()[0]),c&&t>=15019&&"video"===e.kind&&!e.sendEncodingParameters[0].rtx&&(e.sendEncodingParameters[0].rtx={ssrc:e.sendEncodingParameters[0].ssrc+1}));var d=i(e.localCapabilities,e.remoteCapabilities);!d.codecs.filter((function(e){return"rtx"===e.name.toLowerCase()})).length&&e.sendEncodingParameters[0].rtx&&delete e.sendEncodingParameters[0].rtx,a+=o(e,d,"answer",e.stream,r._dtlsRole),e.rtcpParameters&&e.rtcpParameters.reducedSize&&(a+="a=rtcp-rsize\r\n")}}));var d=new e.RTCSessionDescription({type:"answer",sdp:a});return Promise.resolve(d)},u.prototype.addIceCandidate=function(e){var t,r=this;return e&&void 0===e.sdpMLineIndex&&!e.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(o,i){if(!r._remoteDescription)return i(c("InvalidStateError","Can not add ICE candidate without a remote description"));if(e&&""!==e.candidate){var a=e.sdpMLineIndex;if(e.sdpMid)for(var d=0;d<r.transceivers.length;d++)if(r.transceivers[d].mid===e.sdpMid){a=d;break}var u=r.transceivers[a];if(!u)return i(c("OperationError","Can not add ICE candidate"));if(u.rejected)return o();var p=Object.keys(e.candidate).length>0?n.parseCandidate(e.candidate):{};if("tcp"===p.protocol&&(0===p.port||9===p.port))return o();if(p.component&&1!==p.component)return o();if((0===a||a>0&&u.iceTransport!==r.transceivers[0].iceTransport)&&!s(u.iceTransport,p))return i(c("OperationError","Can not add ICE candidate"));var l=e.candidate.trim();0===l.indexOf("a=")&&(l=l.substr(2)),(t=n.getMediaSections(r._remoteDescription.sdp))[a]+="a="+(p.type?l:"end-of-candidates")+"\r\n",r._remoteDescription.sdp=n.getDescription(r._remoteDescription.sdp)+t.join("")}else for(var f=0;f<r.transceivers.length&&(r.transceivers[f].rejected||(r.transceivers[f].iceTransport.addRemoteCandidate({}),(t=n.getMediaSections(r._remoteDescription.sdp))[f]+="a=end-of-candidates\r\n",r._remoteDescription.sdp=n.getDescription(r._remoteDescription.sdp)+t.join(""),!r.usingBundle));f++);o()}))},u.prototype.getStats=function(t){if(t&&t instanceof e.MediaStreamTrack){var r=null;if(this.transceivers.forEach((function(e){e.rtpSender&&e.rtpSender.track===t?r=e.rtpSender:e.rtpReceiver&&e.rtpReceiver.track===t&&(r=e.rtpReceiver)})),!r)throw c("InvalidAccessError","Invalid selector.");return r.getStats()}var n=[];return this.transceivers.forEach((function(e){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(t){e[t]&&n.push(e[t].getStats())}))})),Promise.all(n).then((function(e){var t=new Map;return e.forEach((function(e){e.forEach((function(e){t.set(e.id,e)}))})),t}))},["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(t){var r=e[t];if(r&&r.prototype&&r.prototype.getStats){var n=r.prototype.getStats;r.prototype.getStats=function(){return n.apply(this).then((function(e){var t=new Map;return Object.keys(e).forEach((function(r){e[r].type=function(e){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type}(e[r]),t.set(r,e[r])})),t}))}}}));var p=["createOffer","createAnswer"];return p.forEach((function(e){var t=u.prototype[e];u.prototype[e]=function(){var e=arguments;return"function"==typeof e[0]||"function"==typeof e[1]?t.apply(this,[arguments[2]]).then((function(t){"function"==typeof e[0]&&e[0].apply(null,[t])}),(function(t){"function"==typeof e[1]&&e[1].apply(null,[t])})):t.apply(this,arguments)}})),(p=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(e){var t=u.prototype[e];u.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]||"function"==typeof e[2]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)}),(function(t){"function"==typeof e[2]&&e[2].apply(null,[t])})):t.apply(this,arguments)}})),["getStats"].forEach((function(e){var t=u.prototype[e];u.prototype[e]=function(){var e=arguments;return"function"==typeof e[1]?t.apply(this,arguments).then((function(){"function"==typeof e[1]&&e[1].apply(null)})):t.apply(this,arguments)}})),u}},{sdp:"YHvh"}],YdKx:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetUserMedia=function(e){var t=e&&e.navigator,r=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return r(e).catch((function(e){return Promise.reject(function(e){return{name:{PermissionDeniedError:"NotAllowedError"}[e.name]||e.name,message:e.message,constraint:e.constraint,toString:function(){return this.name}}}(e))}))}}},{}],P3bV:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetDisplayMedia=function(e){"getDisplayMedia"in e.navigator&&e.navigator.mediaDevices&&(e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||(e.navigator.mediaDevices.getDisplayMedia=e.navigator.getDisplayMedia.bind(e.navigator)))}},{}],XRic:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimPeerConnection=function(e,t){if(e.RTCIceGatherer&&(e.RTCIceCandidate||(e.RTCIceCandidate=function(e){return e}),e.RTCSessionDescription||(e.RTCSessionDescription=function(e){return e}),t.version<15025)){var r=Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype,"enabled");Object.defineProperty(e.MediaStreamTrack.prototype,"enabled",{set:function(e){r.set.call(this,e);var t=new Event("enabled");t.enabled=e,this.dispatchEvent(t)}})}!e.RTCRtpSender||"dtmf"in e.RTCRtpSender.prototype||Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new e.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),e.RTCDtmfSender&&!e.RTCDTMFSender&&(e.RTCDTMFSender=e.RTCDtmfSender);var a=(0,i.default)(e,t.version);e.RTCPeerConnection=function(e){return e&&e.iceServers&&(e.iceServers=(0,o.filterIceServers)(e.iceServers,t.version),n.log("ICE servers after filtering:",e.iceServers)),new a(e)},e.RTCPeerConnection.prototype=a.prototype},r.shimReplaceTrack=function(e){!e.RTCRtpSender||"replaceTrack"in e.RTCRtpSender.prototype||(e.RTCRtpSender.prototype.replaceTrack=e.RTCRtpSender.prototype.setTrack)},Object.defineProperty(r,"shimGetUserMedia",{enumerable:!0,get:function(){return a.shimGetUserMedia}}),Object.defineProperty(r,"shimGetDisplayMedia",{enumerable:!0,get:function(){return s.shimGetDisplayMedia}});var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}(e("../utils")),o=e("./filtericeservers"),i=function(e){return e&&e.__esModule?e:{default:e}}(e("rtcpeerconnection-shim")),a=e("./getusermedia"),s=e("./getdisplaymedia");function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}},{"../utils":"iSxC","./filtericeservers":"NZ1C","rtcpeerconnection-shim":"NJ2u","./getusermedia":"YdKx","./getdisplaymedia":"P3bV"}],GzSv:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetUserMedia=function(e,t){var r=e&&e.navigator,o=e&&e.MediaStreamTrack;if(r.getUserMedia=function(e,t,o){n.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),r.mediaDevices.getUserMedia(e).then(t,o)},!(t.version>55&&"autoGainControl"in r.mediaDevices.getSupportedConstraints())){var a=function(e,t,r){t in e&&!(r in e)&&(e[r]=e[t],delete e[t])},s=r.mediaDevices.getUserMedia.bind(r.mediaDevices);if(r.mediaDevices.getUserMedia=function(e){return"object"===i(e)&&"object"===i(e.audio)&&(e=JSON.parse(JSON.stringify(e)),a(e.audio,"autoGainControl","mozAutoGainControl"),a(e.audio,"noiseSuppression","mozNoiseSuppression")),s(e)},o&&o.prototype.getSettings){var c=o.prototype.getSettings;o.prototype.getSettings=function(){var e=c.apply(this,arguments);return a(e,"mozAutoGainControl","autoGainControl"),a(e,"mozNoiseSuppression","noiseSuppression"),e}}if(o&&o.prototype.applyConstraints){var d=o.prototype.applyConstraints;o.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===i(e)&&(e=JSON.parse(JSON.stringify(e)),a(e,"autoGainControl","mozAutoGainControl"),a(e,"noiseSuppression","mozNoiseSuppression")),d.apply(this,[e])}}}};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}(e("../utils"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}},{"../utils":"iSxC"}],UuGU:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimGetDisplayMedia=function(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(r){if(!r||!r.video){var n=new DOMException("getDisplayMedia without video constraints is undefined");return n.name="NotFoundError",n.code=8,Promise.reject(n)}return!0===r.video?r.video={mediaSource:t}:r.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(r)})}},{}],Fzdr:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimOnTrack=function(e){"object"===s(e)&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},r.shimPeerConnection=function(e,t){if("object"===s(e)&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var r=e.RTCPeerConnection.prototype[t],n=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),r.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=n[t]}));var r={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var[e,o,i]=arguments;return n.apply(this,[e||null]).then((function(e){if(t.version<53&&!o)try{e.forEach((function(e){e.type=r[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,n){e.set(n,Object.assign({},t,{type:r[t.type]||t.type}))}))}return e})).then(o,i)}}},r.shimSenderGetStats=function(e){if("object"===s(e)&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpSender.prototype))){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,r=t.apply(this,[]);return r.forEach((function(t){return t._pc=e})),r});var r=e.RTCPeerConnection.prototype.addTrack;r&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=r.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}},r.shimReceiverGetStats=function(e){if("object"===s(e)&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpReceiver.prototype))){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,r=t.apply(this,[]);return r.forEach((function(t){return t._pc=e})),r}),n.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},r.shimRemoveStream=function(e){!e.RTCPeerConnection||"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;n.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(r){r.track&&e.getTracks().includes(r.track)&&t.removeTrack(r)}))})},r.shimRTCDataChannel=function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)},r.shimAddTransceiver=function(e){if("object"===s(e)&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var e=arguments[1],r=e&&"sendEncodings"in e;r&&e.sendEncodings.forEach((function(e){if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));var n=t.apply(this,arguments);if(r){var{sender:o}=n,i=o.getParameters();"encodings"in i&&(1!==i.encodings.length||0!==Object.keys(i.encodings[0]).length)||(i.encodings=e.sendEncodings,o.sendEncodings=e.sendEncodings,this.setParametersPromises.push(o.setParameters(i).then((function(){delete o.sendEncodings})).catch((function(){delete o.sendEncodings}))))}return n})}},r.shimGetParameters=function(e){if("object"===s(e)&&e.RTCRtpSender){var t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){var e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}},r.shimCreateOffer=function(e){if("object"===s(e)&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){var e=arguments,r=this;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(r,e)})).finally((function(){r.setParametersPromises=[]})):t.apply(this,arguments)}}},r.shimCreateAnswer=function(e){if("object"===s(e)&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){var e=arguments,r=this;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(r,e)})).finally((function(){r.setParametersPromises=[]})):t.apply(this,arguments)}}},Object.defineProperty(r,"shimGetUserMedia",{enumerable:!0,get:function(){return o.shimGetUserMedia}}),Object.defineProperty(r,"shimGetDisplayMedia",{enumerable:!0,get:function(){return i.shimGetDisplayMedia}});var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}(e("../utils")),o=e("./getusermedia"),i=e("./getdisplaymedia");function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}},{"../utils":"iSxC","./getusermedia":"GzSv","./getdisplaymedia":"UuGU"}],t1lL:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimLocalStreamsAPI=function(e){if("object"===i(e)&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){var r=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((function(n){return t.call(r,n,e)})),e.getVideoTracks().forEach((function(n){return t.call(r,n,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e){for(var r=this,n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o&&o.forEach((function(e){r._localStreams?r._localStreams.includes(e)||r._localStreams.push(e):r._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._localStreams||(this._localStreams=[]);var r=this._localStreams.indexOf(e);if(-1!==r){this._localStreams.splice(r,1);var n=e.getTracks();this.getSenders().forEach((function(e){n.includes(e.track)&&t.removeTrack(e)}))}})}},r.shimRemoteStreamsAPI=function(e){if("object"===i(e)&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((function(e){if(t._remoteStreams||(t._remoteStreams=[]),!t._remoteStreams.includes(e)){t._remoteStreams.push(e);var r=new Event("addstream");r.stream=e,t.dispatchEvent(r)}}))})}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var r=new Event("addstream");r.stream=t,e.dispatchEvent(r)}}))}),t.apply(e,arguments)}}},r.shimCallbacksAPI=function(e){if("object"===i(e)&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,r=t.createOffer,n=t.createAnswer,o=t.setLocalDescription,a=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],o=r.apply(this,[n]);return t?(o.then(e,t),Promise.resolve()):o},t.createAnswer=function(e,t){var r=arguments.length>=2?arguments[2]:arguments[0],o=n.apply(this,[r]);return t?(o.then(e,t),Promise.resolve()):o};var c=function(e,t,r){var n=o.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n};t.setLocalDescription=c,c=function(e,t,r){var n=a.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.setRemoteDescription=c,c=function(e,t,r){var n=s.apply(this,[e]);return r?(n.then(t,r),Promise.resolve()):n},t.addIceCandidate=c}},r.shimGetUserMedia=function(e){var t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){var r=t.mediaDevices,n=r.getUserMedia.bind(r);t.mediaDevices.getUserMedia=function(e){return n(a(e))}}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r,n)}.bind(t))},r.shimConstraints=a,r.shimRTCIceServerUrls=function(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,r){if(e&&e.iceServers){for(var o=[],i=0;i<e.iceServers.length;i++){var a=e.iceServers[i];!a.hasOwnProperty("urls")&&a.hasOwnProperty("url")?(n.deprecated("RTCIceServer.url","RTCIceServer.urls"),(a=JSON.parse(JSON.stringify(a))).urls=a.url,delete a.url,o.push(a)):o.push(e.iceServers[i])}e.iceServers=o}return new t(e,r)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})}},r.shimTrackEventTransceiver=function(e){"object"===i(e)&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},r.shimCreateOfferLegacy=function(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var r=this.getTransceivers().find((function(e){return"audio"===e.receiver.track.kind}));!1===e.offerToReceiveAudio&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveAudio||r||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var n=this.getTransceivers().find((function(e){return"video"===e.receiver.track.kind}));!1===e.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveVideo||n||this.addTransceiver("video")}return t.apply(this,arguments)}},r.shimAudioContext=function(e){"object"!==i(e)||e.AudioContext||(e.AudioContext=e.webkitAudioContext)};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}(e("../utils"));function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return e&&void 0!==e.video?Object.assign({},e,{video:n.compactObject(e.video)}):e}},{"../utils":"iSxC"}],GOQK:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.shimRTCIceCandidate=function(e){if(e.RTCIceCandidate&&(!e.RTCIceCandidate||!("foundation"in e.RTCIceCandidate.prototype))){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"===a(e)&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var r=new t(e),o=n.default.parseCandidate(e.candidate),i=Object.assign(r,o);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,o.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}},r.shimMaxMessageSize=function(e,t){if(e.RTCPeerConnection){"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76){var{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(function(e){if(!e||!e.sdp)return!1;var t=n.default.splitSections(e.sdp);return t.shift(),t.some((function(e){var t=n.default.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))}(arguments[0])){var o,i=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var r=parseInt(t[1],10);return r!=r?-1:r}(arguments[0]),a=(d=i,u=65536,"firefox"===t.browser&&(u=t.version<57?-1===d?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),u),s=function(e,r){var o=65536;"firefox"===t.browser&&57===t.version&&(o=65535);var i=n.default.matchPrefix(e.sdp,"a=max-message-size:");return i.length>0?o=parseInt(i[0].substr(19),10):"firefox"===t.browser&&-1!==r&&(o=2147483637),o}(arguments[0],i);o=0===a&&0===s?Number.POSITIVE_INFINITY:0===a||0===s?Math.max(a,s):Math.min(a,s);var c={};Object.defineProperty(c,"maxMessageSize",{get:function(){return o}}),this._sctp=c}var d,u;return r.apply(this,arguments)}}},r.shimSendThrowTypeError=function(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=t.apply(this,arguments);return r(e,this),e},o.wrapPeerConnectionEvent(e,"datachannel",(function(e){return r(e.channel,e.target),e}))}function r(e,t){var r=e.send;e.send=function(){var n=arguments[0],o=n.length||n.size||n.byteLength;if("open"===e.readyState&&t.sctp&&o>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return r.apply(e,arguments)}}},r.shimConnectionState=function(e){if(e.RTCPeerConnection&&!("connectionState"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(e){var r=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(e){var t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;var r=new Event("connectionstatechange",e);t.dispatchEvent(r)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),r.apply(this,arguments)}}))}},r.removeExtmapAllowMixed=function(e,t){if(e.RTCPeerConnection&&!("chrome"===t.browser&&t.version>=71||"safari"===t.browser&&t.version>=605)){var r=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){var n=t.sdp.split("\n").filter((function(e){return"a=extmap-allow-mixed"!==e.trim()})).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return r.apply(this,arguments)}}},r.shimAddIceCandidateNullOrEmpty=function(e,t){if(e.RTCPeerConnection&&e.RTCPeerConnection.prototype){var r=e.RTCPeerConnection.prototype.addIceCandidate;r&&0!==r.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():r.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("sdp")),o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}(e("./utils"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}},{sdp:"YHvh","./utils":"iSxC"}],KtlG:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.adapterFactory=function(){var{window:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},r=n.log,d=n.detectBrowser(e),u={browserDetails:d,commonShim:c,extractVersion:n.extractVersion,disableLog:n.disableLog,disableWarnings:n.disableWarnings};switch(d.browser){case"chrome":if(!o||!o.shimPeerConnection||!t.shimChrome)return r("Chrome shim is not included in this adapter release."),u;if(null===d.version)return r("Chrome shim can not determine version, not shimming."),u;r("adapter.js shimming chrome."),u.browserShim=o,c.shimAddIceCandidateNullOrEmpty(e,d),o.shimGetUserMedia(e,d),o.shimMediaStream(e,d),o.shimPeerConnection(e,d),o.shimOnTrack(e,d),o.shimAddTrackRemoveTrack(e,d),o.shimGetSendersWithDtmf(e,d),o.shimGetStats(e,d),o.shimSenderReceiverGetStats(e,d),o.fixNegotiationNeeded(e,d),c.shimRTCIceCandidate(e,d),c.shimConnectionState(e,d),c.shimMaxMessageSize(e,d),c.shimSendThrowTypeError(e,d),c.removeExtmapAllowMixed(e,d);break;case"firefox":if(!a||!a.shimPeerConnection||!t.shimFirefox)return r("Firefox shim is not included in this adapter release."),u;r("adapter.js shimming firefox."),u.browserShim=a,c.shimAddIceCandidateNullOrEmpty(e,d),a.shimGetUserMedia(e,d),a.shimPeerConnection(e,d),a.shimOnTrack(e,d),a.shimRemoveStream(e,d),a.shimSenderGetStats(e,d),a.shimReceiverGetStats(e,d),a.shimRTCDataChannel(e,d),a.shimAddTransceiver(e,d),a.shimGetParameters(e,d),a.shimCreateOffer(e,d),a.shimCreateAnswer(e,d),c.shimRTCIceCandidate(e,d),c.shimConnectionState(e,d),c.shimMaxMessageSize(e,d),c.shimSendThrowTypeError(e,d);break;case"edge":if(!i||!i.shimPeerConnection||!t.shimEdge)return r("MS edge shim is not included in this adapter release."),u;r("adapter.js shimming edge."),u.browserShim=i,i.shimGetUserMedia(e,d),i.shimGetDisplayMedia(e,d),i.shimPeerConnection(e,d),i.shimReplaceTrack(e,d),c.shimMaxMessageSize(e,d),c.shimSendThrowTypeError(e,d);break;case"safari":if(!s||!t.shimSafari)return r("Safari shim is not included in this adapter release."),u;r("adapter.js shimming safari."),u.browserShim=s,c.shimAddIceCandidateNullOrEmpty(e,d),s.shimRTCIceServerUrls(e,d),s.shimCreateOfferLegacy(e,d),s.shimCallbacksAPI(e,d),s.shimLocalStreamsAPI(e,d),s.shimRemoteStreamsAPI(e,d),s.shimTrackEventTransceiver(e,d),s.shimGetUserMedia(e,d),s.shimAudioContext(e,d),c.shimRTCIceCandidate(e,d),c.shimMaxMessageSize(e,d),c.shimSendThrowTypeError(e,d),c.removeExtmapAllowMixed(e,d);break;default:r("Unsupported browser!")}return u};var n=u(e("./utils")),o=u(e("./chrome/chrome_shim")),i=u(e("./edge/edge_shim")),a=u(e("./firefox/firefox_shim")),s=u(e("./safari/safari_shim")),c=u(e("./common_shim"));function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function u(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=n?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(r,o,i):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}},{"./utils":"iSxC","./chrome/chrome_shim":"uI5X","./edge/edge_shim":"XRic","./firefox/firefox_shim":"Fzdr","./safari/safari_shim":"t1lL","./common_shim":"GOQK"}],tI1X:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(0,e("./adapter_factory.js").adapterFactory)({window:"undefined"==typeof window?void 0:window});r.default=n},{"./adapter_factory.js":"KtlG"}],sXtV:[function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.webRTCAdapter=void 0;var o=n(e("webrtc-adapter"));r.webRTCAdapter=o.default},{"webrtc-adapter":"tI1X"}],I31f:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Supports=void 0;var n=e("./adapter");r.Supports=new(function(){function e(){this.isIOS=["iPad","iPhone","iPod"].includes(navigator.platform),this.supportedBrowsers=["firefox","chrome","safari"],this.minFirefoxVersion=59,this.minChromeVersion=72,this.minSafariVersion=605}return e.prototype.isWebRTCSupported=function(){return"undefined"!=typeof RTCPeerConnection},e.prototype.isBrowserSupported=function(){var e=this.getBrowser(),t=this.getVersion();return!!this.supportedBrowsers.includes(e)&&("chrome"===e?t>=this.minChromeVersion:"firefox"===e?t>=this.minFirefoxVersion:"safari"===e&&!this.isIOS&&t>=this.minSafariVersion)},e.prototype.getBrowser=function(){return n.webRTCAdapter.browserDetails.browser},e.prototype.getVersion=function(){return n.webRTCAdapter.browserDetails.version||0},e.prototype.isUnifiedPlanSupported=function(){var e,t=this.getBrowser(),r=n.webRTCAdapter.browserDetails.version||0;if("chrome"===t&&r<72)return!1;if("firefox"===t&&r>=59)return!0;if(!window.RTCRtpTransceiver||!("currentDirection"in RTCRtpTransceiver.prototype))return!1;var o=!1;try{(e=new RTCPeerConnection).addTransceiver("audio"),o=!0}catch(e){}finally{e&&e.close()}return o},e.prototype.toString=function(){return"Supports: \n browser:"+this.getBrowser()+" \n version:"+this.getVersion()+" \n isIOS:"+this.isIOS+" \n isWebRTCSupported:"+this.isWebRTCSupported()+" \n isBrowserSupported:"+this.isBrowserSupported()+" \n isUnifiedPlanSupported:"+this.isUnifiedPlanSupported()},e}())},{"./adapter":"sXtV"}],BHXf:[function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(r,"__esModule",{value:!0}),r.util=void 0;var a=i(e("peerjs-js-binarypack")),s=e("./supports"),c={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"turn:0.peerjs.com:3478",username:"peerjs",credential:"peerjsp"}],sdpSemantics:"unified-plan"};r.util=new(function(){function e(){this.CLOUD_HOST="0.peerjs.com",this.CLOUD_PORT=443,this.chunkedBrowsers={Chrome:1,chrome:1},this.chunkedMTU=16300,this.defaultConfig=c,this.browser=s.Supports.getBrowser(),this.browserVersion=s.Supports.getVersion(),this.supports=function(){var e,t={browser:s.Supports.isBrowserSupported(),webRTC:s.Supports.isWebRTCSupported(),audioVideo:!1,data:!1,binaryBlob:!1,reliable:!1};if(!t.webRTC)return t;try{e=new RTCPeerConnection(c),t.audioVideo=!0;var r=void 0;try{r=e.createDataChannel("_PEERJSTEST",{ordered:!0}),t.data=!0,t.reliable=!!r.ordered;try{r.binaryType="blob",t.binaryBlob=!s.Supports.isIOS}catch(e){}}catch(e){}finally{r&&r.close()}}catch(e){}finally{e&&e.close()}return t}(),this.pack=a.pack,this.unpack=a.unpack,this._dataCount=1}return e.prototype.noop=function(){},e.prototype.validateId=function(e){return!e||/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(e)},e.prototype.chunk=function(e){for(var t=[],n=e.size,o=Math.ceil(n/r.util.chunkedMTU),i=0,a=0;a<n;){var s=Math.min(n,a+r.util.chunkedMTU),c=e.slice(a,s),d={__peerData:this._dataCount,n:i,data:c,total:o};t.push(d),a=s,i++}return this._dataCount++,t},e.prototype.blobToArrayBuffer=function(e,t){var r=new FileReader;return r.onload=function(e){e.target&&t(e.target.result)},r.readAsArrayBuffer(e),r},e.prototype.binaryStringToArrayBuffer=function(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=255&e.charCodeAt(r);return t.buffer},e.prototype.randomToken=function(){return Math.random().toString(36).substr(2)},e.prototype.isSecure=function(){return"https:"===location.protocol},e}())},{"peerjs-js-binarypack":"kdPp","./supports":"I31f"}],JJlS:[function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o="~";function i(){}function a(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,r,n,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,n||e,i),c=o?o+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function c(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function d(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(o=!1)),d.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(o?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},d.prototype.listeners=function(e){var t=o?o+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var n=0,i=r.length,a=new Array(i);n<i;n++)a[n]=r[n].fn;return a},d.prototype.listenerCount=function(e){var t=o?o+e:e,r=this._events[t];return r?r.fn?1:r.length:0},d.prototype.emit=function(e,t,r,n,i,a){var s=o?o+e:e;if(!this._events[s])return!1;var c,d,u=this._events[s],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,n),!0;case 5:return u.fn.call(u.context,t,r,n,i),!0;case 6:return u.fn.call(u.context,t,r,n,i,a),!0}for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u.fn.apply(u.context,c)}else{var l,f=u.length;for(d=0;d<f;d++)switch(u[d].once&&this.removeListener(e,u[d].fn,void 0,!0),p){case 1:u[d].fn.call(u[d].context);break;case 2:u[d].fn.call(u[d].context,t);break;case 3:u[d].fn.call(u[d].context,t,r);break;case 4:u[d].fn.call(u[d].context,t,r,n);break;default:if(!c)for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u[d].fn.apply(u[d].context,c)}}return!0},d.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},d.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},d.prototype.removeListener=function(e,t,r,n){var i=o?o+e:e;if(!this._events[i])return this;if(!t)return c(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||n&&!a.once||r&&a.context!==r||c(this,i);else{for(var s=0,d=[],u=a.length;s<u;s++)(a[s].fn!==t||n&&!a[s].once||r&&a[s].context!==r)&&d.push(a[s]);d.length?this._events[i]=1===d.length?d[0]:d:c(this,i)}return this},d.prototype.removeAllListeners=function(e){var t;return e?(t=o?o+e:e,this._events[t]&&c(this,t)):(this._events=new i,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prefixed=o,d.EventEmitter=d,void 0!==t&&(t.exports=d)},{}],WOs9:[function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e};Object.defineProperty(r,"__esModule",{value:!0}),r.LogLevel=void 0;var i,a="PeerJS: ";!function(e){e[e.Disabled=0]="Disabled",e[e.Errors=1]="Errors",e[e.Warnings=2]="Warnings",e[e.All=3]="All"}(i=r.LogLevel||(r.LogLevel={}));var s=function(){function e(){this._logLevel=i.Disabled}return Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){this._logLevel=e},enumerable:!1,configurable:!0}),e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logLevel>=i.All&&this._print.apply(this,o([i.All],n(e)))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logLevel>=i.Warnings&&this._print.apply(this,o([i.Warnings],n(e)))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logLevel>=i.Errors&&this._print.apply(this,o([i.Errors],n(e)))},e.prototype.setLogFunction=function(e){this._print=e},e.prototype._print=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var s=o([a],n(t));for(var c in s)s[c]instanceof Error&&(s[c]="("+s[c].name+") "+s[c].message);e>=i.All?console.log.apply(console,o([],n(s))):e>=i.Warnings?console.warn.apply(console,o(["WARNING"],n(s))):e>=i.Errors&&console.error.apply(console,o(["ERROR"],n(s)))},e}();r.default=new s},{}],ZRYf:[function(e,t,r){"use strict";var n;Object.defineProperty(r,"__esModule",{value:!0}),r.ServerMessageType=r.SocketEventType=r.SerializationType=r.PeerErrorType=r.PeerEventType=r.ConnectionType=r.ConnectionEventType=void 0,(n=r.ConnectionEventType||(r.ConnectionEventType={})).Open="open",n.Stream="stream",n.Data="data",n.Close="close",n.Error="error",n.IceStateChanged="iceStateChanged",function(e){e.Data="data",e.Media="media"}(r.ConnectionType||(r.ConnectionType={})),function(e){e.Open="open",e.Close="close",e.Connection="connection",e.Call="call",e.Disconnected="disconnected",e.Error="error"}(r.PeerEventType||(r.PeerEventType={})),function(e){e.BrowserIncompatible="browser-incompatible",e.Disconnected="disconnected",e.InvalidID="invalid-id",e.InvalidKey="invalid-key",e.Network="network",e.PeerUnavailable="peer-unavailable",e.SslUnavailable="ssl-unavailable",e.ServerError="server-error",e.SocketError="socket-error",e.SocketClosed="socket-closed",e.UnavailableID="unavailable-id",e.WebRTC="webrtc"}(r.PeerErrorType||(r.PeerErrorType={})),function(e){e.Binary="binary",e.BinaryUTF8="binary-utf8",e.JSON="json"}(r.SerializationType||(r.SerializationType={})),function(e){e.Message="message",e.Disconnected="disconnected",e.Error="error",e.Close="close"}(r.SocketEventType||(r.SocketEventType={})),function(e){e.Heartbeat="HEARTBEAT",e.Candidate="CANDIDATE",e.Offer="OFFER",e.Answer="ANSWER",e.Open="OPEN",e.Error="ERROR",e.IdTaken="ID-TAKEN",e.InvalidKey="INVALID-KEY",e.Leave="LEAVE",e.Expire="EXPIRE"}(r.ServerMessageType||(r.ServerMessageType={}))},{}],wJlv:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e},a=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.Socket=void 0;var c=e("eventemitter3"),d=s(e("./logger")),u=e("./enums"),p=function(e){function t(t,r,n,o,i,a){void 0===a&&(a=5e3);var s=e.call(this)||this;s.pingInterval=a,s._disconnected=!0,s._messagesQueue=[];var c=t?"wss://":"ws://";return s._baseUrl=c+r+":"+n+o+"peerjs?key="+i,s}return n(t,e),t.prototype.start=function(e,t){var r=this;this._id=e;var n=this._baseUrl+"&id="+e+"&token="+t;!this._socket&&this._disconnected&&(this._socket=new WebSocket(n),this._disconnected=!1,this._socket.onmessage=function(e){var t;try{t=JSON.parse(e.data),d.default.log("Server message received:",t)}catch(t){return void d.default.log("Invalid server message",e.data)}r.emit(u.SocketEventType.Message,t)},this._socket.onclose=function(e){r._disconnected||(d.default.log("Socket closed.",e),r._cleanup(),r._disconnected=!0,r.emit(u.SocketEventType.Disconnected))},this._socket.onopen=function(){r._disconnected||(r._sendQueuedMessages(),d.default.log("Socket open"),r._scheduleHeartbeat())})},t.prototype._scheduleHeartbeat=function(){var e=this;this._wsPingTimer=setTimeout((function(){e._sendHeartbeat()}),this.pingInterval)},t.prototype._sendHeartbeat=function(){if(this._wsOpen()){var e=JSON.stringify({type:u.ServerMessageType.Heartbeat});this._socket.send(e),this._scheduleHeartbeat()}else d.default.log("Cannot send heartbeat, because socket closed")},t.prototype._wsOpen=function(){return!!this._socket&&1===this._socket.readyState},t.prototype._sendQueuedMessages=function(){var e,t,r=i([],o(this._messagesQueue));this._messagesQueue=[];try{for(var n=a(r),s=n.next();!s.done;s=n.next()){var c=s.value;this.send(c)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},t.prototype.send=function(e){if(!this._disconnected)if(this._id)if(e.type){if(this._wsOpen()){var t=JSON.stringify(e);this._socket.send(t)}}else this.emit(u.SocketEventType.Error,"Invalid message");else this._messagesQueue.push(e)},t.prototype.close=function(){this._disconnected||(this._cleanup(),this._disconnected=!0)},t.prototype._cleanup=function(){this._socket&&(this._socket.onopen=this._socket.onmessage=this._socket.onclose=null,this._socket.close(),this._socket=void 0),clearTimeout(this._wsPingTimer)},t}(c.EventEmitter);r.Socket=p},{eventemitter3:"JJlS","./logger":"WOs9","./enums":"ZRYf"}],HCdX:[function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.Negotiator=void 0;var s=e("./util"),c=a(e("./logger")),d=e("./enums"),u=function(){function e(e){this.connection=e}return e.prototype.startConnection=function(e){var t=this._startPeerConnection();if(this.connection.peerConnection=t,this.connection.type===d.ConnectionType.Media&&e._stream&&this._addTracksToConnection(e._stream,t),e.originator){if(this.connection.type===d.ConnectionType.Data){var r=this.connection,n={ordered:!!e.reliable},o=t.createDataChannel(r.label,n);r.initialize(o)}this._makeOffer()}else this.handleSDP("OFFER",e.sdp)},e.prototype._startPeerConnection=function(){c.default.log("Creating RTCPeerConnection.");var e=new RTCPeerConnection(this.connection.provider.options.config);return this._setupListeners(e),e},e.prototype._setupListeners=function(e){var t=this,r=this.connection.peer,n=this.connection.connectionId,o=this.connection.type,i=this.connection.provider;c.default.log("Listening for ICE candidates."),e.onicecandidate=function(e){e.candidate&&e.candidate.candidate&&(c.default.log("Received ICE candidates for "+r+":",e.candidate),i.socket.send({type:d.ServerMessageType.Candidate,payload:{candidate:e.candidate,type:o,connectionId:n},dst:r}))},e.oniceconnectionstatechange=function(){switch(e.iceConnectionState){case"failed":c.default.log("iceConnectionState is failed, closing connections to "+r),t.connection.emit(d.ConnectionEventType.Error,new Error("Negotiation of connection to "+r+" failed.")),t.connection.close();break;case"closed":c.default.log("iceConnectionState is closed, closing connections to "+r),t.connection.emit(d.ConnectionEventType.Error,new Error("Connection to "+r+" closed.")),t.connection.close();break;case"disconnected":c.default.log("iceConnectionState changed to disconnected on the connection with "+r);break;case"completed":e.onicecandidate=s.util.noop}t.connection.emit(d.ConnectionEventType.IceStateChanged,e.iceConnectionState)},c.default.log("Listening for data channel"),e.ondatachannel=function(e){c.default.log("Received data channel");var t=e.channel;i.getConnection(r,n).initialize(t)},c.default.log("Listening for remote stream"),e.ontrack=function(e){c.default.log("Received remote stream");var o=e.streams[0],a=i.getConnection(r,n);if(a.type===d.ConnectionType.Media){var s=a;t._addStreamToMediaConnection(o,s)}}},e.prototype.cleanup=function(){c.default.log("Cleaning up PeerConnection to "+this.connection.peer);var e=this.connection.peerConnection;if(e){this.connection.peerConnection=null,e.onicecandidate=e.oniceconnectionstatechange=e.ondatachannel=e.ontrack=function(){};var t="closed"!==e.signalingState,r=!1;if(this.connection.type===d.ConnectionType.Data){var n=this.connection.dataChannel;n&&(r=!!n.readyState&&"closed"!==n.readyState)}(t||r)&&e.close()}},e.prototype._makeOffer=function(){return o(this,void 0,Promise,(function(){var e,t,r,o,a,u,p;return i(this,(function(i){switch(i.label){case 0:e=this.connection.peerConnection,t=this.connection.provider,i.label=1;case 1:return i.trys.push([1,7,,8]),[4,e.createOffer(this.connection.options.constraints)];case 2:r=i.sent(),c.default.log("Created offer."),this.connection.options.sdpTransform&&"function"==typeof this.connection.options.sdpTransform&&(r.sdp=this.connection.options.sdpTransform(r.sdp)||r.sdp),i.label=3;case 3:return i.trys.push([3,5,,6]),[4,e.setLocalDescription(r)];case 4:return i.sent(),c.default.log("Set localDescription:",r,"for:"+this.connection.peer),o={sdp:r,type:this.connection.type,connectionId:this.connection.connectionId,metadata:this.connection.metadata,browser:s.util.browser},this.connection.type===d.ConnectionType.Data&&(a=this.connection,o=n(n({},o),{label:a.label,reliable:a.reliable,serialization:a.serialization})),t.socket.send({type:d.ServerMessageType.Offer,payload:o,dst:this.connection.peer}),[3,6];case 5:return"OperationError: Failed to set local offer sdp: Called in wrong state: kHaveRemoteOffer"!=(u=i.sent())&&(t.emitError(d.PeerErrorType.WebRTC,u),c.default.log("Failed to setLocalDescription, ",u)),[3,6];case 6:return[3,8];case 7:return p=i.sent(),t.emitError(d.PeerErrorType.WebRTC,p),c.default.log("Failed to createOffer, ",p),[3,8];case 8:return[2]}}))}))},e.prototype._makeAnswer=function(){return o(this,void 0,Promise,(function(){var e,t,r,n,o;return i(this,(function(i){switch(i.label){case 0:e=this.connection.peerConnection,t=this.connection.provider,i.label=1;case 1:return i.trys.push([1,7,,8]),[4,e.createAnswer()];case 2:r=i.sent(),c.default.log("Created answer."),this.connection.options.sdpTransform&&"function"==typeof this.connection.options.sdpTransform&&(r.sdp=this.connection.options.sdpTransform(r.sdp)||r.sdp),i.label=3;case 3:return i.trys.push([3,5,,6]),[4,e.setLocalDescription(r)];case 4:return i.sent(),c.default.log("Set localDescription:",r,"for:"+this.connection.peer),t.socket.send({type:d.ServerMessageType.Answer,payload:{sdp:r,type:this.connection.type,connectionId:this.connection.connectionId,browser:s.util.browser},dst:this.connection.peer}),[3,6];case 5:return n=i.sent(),t.emitError(d.PeerErrorType.WebRTC,n),c.default.log("Failed to setLocalDescription, ",n),[3,6];case 6:return[3,8];case 7:return o=i.sent(),t.emitError(d.PeerErrorType.WebRTC,o),c.default.log("Failed to create answer, ",o),[3,8];case 8:return[2]}}))}))},e.prototype.handleSDP=function(e,t){return o(this,void 0,Promise,(function(){var r,n,o,a;return i(this,(function(i){switch(i.label){case 0:t=new RTCSessionDescription(t),r=this.connection.peerConnection,n=this.connection.provider,c.default.log("Setting remote description",t),o=this,i.label=1;case 1:return i.trys.push([1,5,,6]),[4,r.setRemoteDescription(t)];case 2:return i.sent(),c.default.log("Set remoteDescription:"+e+" for:"+this.connection.peer),"OFFER"!==e?[3,4]:[4,o._makeAnswer()];case 3:i.sent(),i.label=4;case 4:return[3,6];case 5:return a=i.sent(),n.emitError(d.PeerErrorType.WebRTC,a),c.default.log("Failed to setRemoteDescription, ",a),[3,6];case 6:return[2]}}))}))},e.prototype.handleCandidate=function(e){return o(this,void 0,Promise,(function(){var t,r,n,o,a,s;return i(this,(function(i){switch(i.label){case 0:c.default.log("handleCandidate:",e),t=e.candidate,r=e.sdpMLineIndex,n=e.sdpMid,o=this.connection.peerConnection,a=this.connection.provider,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,o.addIceCandidate(new RTCIceCandidate({sdpMid:n,sdpMLineIndex:r,candidate:t}))];case 2:return i.sent(),c.default.log("Added ICE candidate for:"+this.connection.peer),[3,4];case 3:return s=i.sent(),a.emitError(d.PeerErrorType.WebRTC,s),c.default.log("Failed to handleCandidate, ",s),[3,4];case 4:return[2]}}))}))},e.prototype._addTracksToConnection=function(e,t){if(c.default.log("add tracks from stream "+e.id+" to peer connection"),!t.addTrack)return c.default.error("Your browser does't support RTCPeerConnection#addTrack. Ignored.");e.getTracks().forEach((function(r){t.addTrack(r,e)}))},e.prototype._addStreamToMediaConnection=function(e,t){c.default.log("add stream "+e.id+" to media connection "+t.connectionId),t.addStream(e)},e}();r.Negotiator=u},{"./util":"BHXf","./logger":"WOs9","./enums":"ZRYf"}],tQFK:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0}),r.BaseConnection=void 0;var o=function(e){function t(t,r,n){var o=e.call(this)||this;return o.peer=t,o.provider=r,o.options=n,o._open=!1,o.metadata=n.metadata,o}return n(t,e),Object.defineProperty(t.prototype,"open",{get:function(){return this._open},enumerable:!1,configurable:!0}),t}(e("eventemitter3").EventEmitter);r.BaseConnection=o},{eventemitter3:"JJlS"}],dbHP:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.MediaConnection=void 0;var s=e("./util"),c=a(e("./logger")),d=e("./negotiator"),u=e("./enums"),p=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i._localStream=i.options._stream,i.connectionId=i.options.connectionId||t.ID_PREFIX+s.util.randomToken(),i._negotiator=new d.Negotiator(i),i._localStream&&i._negotiator.startConnection({_stream:i._localStream,originator:!0}),i}return n(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return u.ConnectionType.Media},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localStream",{get:function(){return this._localStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remoteStream",{get:function(){return this._remoteStream},enumerable:!1,configurable:!0}),t.prototype.addStream=function(t){c.default.log("Receiving stream",t),this._remoteStream=t,e.prototype.emit.call(this,u.ConnectionEventType.Stream,t)},t.prototype.handleMessage=function(e){var t=e.type,r=e.payload;switch(e.type){case u.ServerMessageType.Answer:this._negotiator.handleSDP(t,r.sdp),this._open=!0;break;case u.ServerMessageType.Candidate:this._negotiator.handleCandidate(r.candidate);break;default:c.default.warn("Unrecognized message type:"+t+" from peer:"+this.peer)}},t.prototype.answer=function(e,t){var r,n;if(void 0===t&&(t={}),this._localStream)c.default.warn("Local stream already exists on this MediaConnection. Are you answering a call twice?");else{this._localStream=e,t&&t.sdpTransform&&(this.options.sdpTransform=t.sdpTransform),this._negotiator.startConnection(o(o({},this.options._payload),{_stream:e}));var a=this.provider._getMessages(this.connectionId);try{for(var s=i(a),d=s.next();!d.done;d=s.next()){var u=d.value;this.handleMessage(u)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}this._open=!0}},t.prototype.close=function(){this._negotiator&&(this._negotiator.cleanup(),this._negotiator=null),this._localStream=null,this._remoteStream=null,this.provider&&(this.provider._removeConnection(this),this.provider=null),this.options&&this.options._stream&&(this.options._stream=null),this.open&&(this._open=!1,e.prototype.emit.call(this,u.ConnectionEventType.Close))},t.ID_PREFIX="mc_",t}(e("./baseconnection").BaseConnection);r.MediaConnection=p},{"./util":"BHXf","./logger":"WOs9","./negotiator":"HCdX","./enums":"ZRYf","./baseconnection":"tQFK"}],GGp6:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.EncodingQueue=void 0;var i=e("eventemitter3"),a=o(e("./logger")),s=function(e){function t(){var t=e.call(this)||this;return t.fileReader=new FileReader,t._queue=[],t._processing=!1,t.fileReader.onload=function(e){t._processing=!1,e.target&&t.emit("done",e.target.result),t.doNextTask()},t.fileReader.onerror=function(e){a.default.error("EncodingQueue error:",e),t._processing=!1,t.destroy(),t.emit("error",e)},t}return n(t,e),Object.defineProperty(t.prototype,"queue",{get:function(){return this._queue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"processing",{get:function(){return this._processing},enumerable:!1,configurable:!0}),t.prototype.enque=function(e){this.queue.push(e),this.processing||this.doNextTask()},t.prototype.destroy=function(){this.fileReader.abort(),this._queue=[]},t.prototype.doNextTask=function(){0!==this.size&&(this.processing||(this._processing=!0,this.fileReader.readAsArrayBuffer(this.queue.shift())))},t}(i.EventEmitter);r.EncodingQueue=s},{eventemitter3:"JJlS","./logger":"WOs9"}],GBTQ:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.DataConnection=void 0;var a=e("./util"),s=i(e("./logger")),c=e("./negotiator"),d=e("./enums"),u=e("./baseconnection"),p=e("./encodingQueue"),l=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i.stringify=JSON.stringify,i.parse=JSON.parse,i._buffer=[],i._bufferSize=0,i._buffering=!1,i._chunkedData={},i._encodingQueue=new p.EncodingQueue,i.connectionId=i.options.connectionId||t.ID_PREFIX+a.util.randomToken(),i.label=i.options.label||i.connectionId,i.serialization=i.options.serialization||d.SerializationType.Binary,i.reliable=!!i.options.reliable,i._encodingQueue.on("done",(function(e){i._bufferedSend(e)})),i._encodingQueue.on("error",(function(){s.default.error("DC#"+i.connectionId+": Error occured in encoding from blob to arraybuffer, close DC"),i.close()})),i._negotiator=new c.Negotiator(i),i._negotiator.startConnection(i.options._payload||{originator:!0}),i}return n(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return d.ConnectionType.Data},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataChannel",{get:function(){return this._dc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bufferSize",{get:function(){return this._bufferSize},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e){this._dc=e,this._configureDataChannel()},t.prototype._configureDataChannel=function(){var e=this;a.util.supports.binaryBlob&&!a.util.supports.reliable||(this.dataChannel.binaryType="arraybuffer"),this.dataChannel.onopen=function(){s.default.log("DC#"+e.connectionId+" dc connection success"),e._open=!0,e.emit(d.ConnectionEventType.Open)},this.dataChannel.onmessage=function(t){s.default.log("DC#"+e.connectionId+" dc onmessage:",t.data),e._handleDataMessage(t)},this.dataChannel.onclose=function(){s.default.log("DC#"+e.connectionId+" dc closed for:",e.peer),e.close()}},t.prototype._handleDataMessage=function(t){var r=this,n=t.data,o=n.constructor,i=n;if(this.serialization===d.SerializationType.Binary||this.serialization===d.SerializationType.BinaryUTF8){if(o===Blob)return void a.util.blobToArrayBuffer(n,(function(e){var t=a.util.unpack(e);r.emit(d.ConnectionEventType.Data,t)}));if(o===ArrayBuffer)i=a.util.unpack(n);else if(o===String){var s=a.util.binaryStringToArrayBuffer(n);i=a.util.unpack(s)}}else this.serialization===d.SerializationType.JSON&&(i=this.parse(n));i.__peerData?this._handleChunk(i):e.prototype.emit.call(this,d.ConnectionEventType.Data,i)},t.prototype._handleChunk=function(e){var t=e.__peerData,r=this._chunkedData[t]||{data:[],count:0,total:e.total};if(r.data[e.n]=e.data,r.count++,this._chunkedData[t]=r,r.total===r.count){delete this._chunkedData[t];var n=new Blob(r.data);this._handleDataMessage({data:n})}},t.prototype.close=function(){this._buffer=[],this._bufferSize=0,this._chunkedData={},this._negotiator&&(this._negotiator.cleanup(),this._negotiator=null),this.provider&&(this.provider._removeConnection(this),this.provider=null),this.dataChannel&&(this.dataChannel.onopen=null,this.dataChannel.onmessage=null,this.dataChannel.onclose=null,this._dc=null),this._encodingQueue&&(this._encodingQueue.destroy(),this._encodingQueue.removeAllListeners(),this._encodingQueue=null),this.open&&(this._open=!1,e.prototype.emit.call(this,d.ConnectionEventType.Close))},t.prototype.send=function(t,r){if(this.open)if(this.serialization===d.SerializationType.JSON)this._bufferedSend(this.stringify(t));else if(this.serialization===d.SerializationType.Binary||this.serialization===d.SerializationType.BinaryUTF8){var n=a.util.pack(t);if(!r&&n.size>a.util.chunkedMTU)return void this._sendChunks(n);a.util.supports.binaryBlob?this._bufferedSend(n):this._encodingQueue.enque(n)}else this._bufferedSend(t);else e.prototype.emit.call(this,d.ConnectionEventType.Error,new Error("Connection is not open. You should listen for the `open` event before sending messages."))},t.prototype._bufferedSend=function(e){!this._buffering&&this._trySend(e)||(this._buffer.push(e),this._bufferSize=this._buffer.length)},t.prototype._trySend=function(e){var r=this;if(!this.open)return!1;if(this.dataChannel.bufferedAmount>t.MAX_BUFFERED_AMOUNT)return this._buffering=!0,setTimeout((function(){r._buffering=!1,r._tryBuffer()}),50),!1;try{this.dataChannel.send(e)}catch(e){return s.default.error("DC#:"+this.connectionId+" Error when sending:",e),this._buffering=!0,this.close(),!1}return!0},t.prototype._tryBuffer=function(){if(this.open&&0!==this._buffer.length){var e=this._buffer[0];this._trySend(e)&&(this._buffer.shift(),this._bufferSize=this._buffer.length,this._tryBuffer())}},t.prototype._sendChunks=function(e){var t,r,n=a.util.chunk(e);s.default.log("DC#"+this.connectionId+" Try to send "+n.length+" chunks...");try{for(var i=o(n),c=i.next();!c.done;c=i.next()){var d=c.value;this.send(d,!0)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.prototype.handleMessage=function(e){var t=e.payload;switch(e.type){case d.ServerMessageType.Answer:this._negotiator.handleSDP(e.type,t.sdp);break;case d.ServerMessageType.Candidate:this._negotiator.handleCandidate(t.candidate);break;default:s.default.warn("Unrecognized message type:",e.type,"from peer:",this.peer)}},t.ID_PREFIX="dc_",t.MAX_BUFFERED_AMOUNT=8388608,t}(u.BaseConnection);r.DataConnection=l},{"./util":"BHXf","./logger":"WOs9","./negotiator":"HCdX","./enums":"ZRYf","./baseconnection":"tQFK","./encodingQueue":"GGp6"}],in7L:[function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.API=void 0;var a=e("./util"),s=i(e("./logger")),c=function(){function e(e){this._options=e}return e.prototype._buildUrl=function(e){return(this._options.secure?"https://":"http://")+this._options.host+":"+this._options.port+this._options.path+this._options.key+"/"+e+"?ts="+(new Date).getTime()+Math.random()},e.prototype.retrieveId=function(){return n(this,void 0,Promise,(function(){var e,t,r,n;return o(this,(function(o){switch(o.label){case 0:e=this._buildUrl("id"),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,fetch(e)];case 2:if(200!==(t=o.sent()).status)throw new Error("Error. Status:"+t.status);return[2,t.text()];case 3:throw r=o.sent(),s.default.error("Error retrieving ID",r),n="","/"===this._options.path&&this._options.host!==a.util.CLOUD_HOST&&(n=" If you passed in a `path` to your self-hosted PeerServer, you'll also need to pass in that same path when creating a new Peer."),new Error("Could not get an ID from the server."+n);case 4:return[2]}}))}))},e.prototype.listAllPeers=function(){return n(this,void 0,Promise,(function(){var e,t,r,n;return o(this,(function(o){switch(o.label){case 0:e=this._buildUrl("peers"),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,fetch(e)];case 2:if(200!==(t=o.sent()).status){if(401===t.status)throw r=this._options.host===a.util.CLOUD_HOST?"It looks like you're using the cloud server. You can email team@peerjs.com to enable peer listing for your API key.":"You need to enable `allow_discovery` on your self-hosted PeerServer to use this feature.",new Error("It doesn't look like you have permission to list peers IDs. "+r);throw new Error("Error. Status:"+t.status)}return[2,t.json()];case 3:throw n=o.sent(),s.default.error("Error retrieving list peers",n),new Error("Could not get list peers from the server."+n);case 4:return[2]}}))}))},e}();r.API=c},{"./util":"BHXf","./logger":"WOs9"}],Hxpd:[function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.Peer=void 0;var c=e("eventemitter3"),d=e("./util"),u=s(e("./logger")),p=e("./socket"),l=e("./mediaconnection"),f=e("./dataconnection"),h=e("./enums"),m=e("./api"),g=function(e){function t(r,n){var i,a=e.call(this)||this;return a._id=null,a._lastServerId=null,a._destroyed=!1,a._disconnected=!1,a._open=!1,a._connections=new Map,a._lostMessages=new Map,r&&r.constructor==Object?n=r:r&&(i=r.toString()),n=o({debug:0,host:d.util.CLOUD_HOST,port:d.util.CLOUD_PORT,path:"/",key:t.DEFAULT_KEY,token:d.util.randomToken(),config:d.util.defaultConfig},n),a._options=n,"/"===a._options.host&&(a._options.host=window.location.hostname),a._options.path&&("/"!==a._options.path[0]&&(a._options.path="/"+a._options.path),"/"!==a._options.path[a._options.path.length-1]&&(a._options.path+="/")),void 0===a._options.secure&&a._options.host!==d.util.CLOUD_HOST?a._options.secure=d.util.isSecure():a._options.host==d.util.CLOUD_HOST&&(a._options.secure=!0),a._options.logFunction&&u.default.setLogFunction(a._options.logFunction),u.default.logLevel=a._options.debug||0,a._api=new m.API(n),a._socket=a._createServerConnection(),d.util.supports.audioVideo||d.util.supports.data?i&&!d.util.validateId(i)?(a._delayedAbort(h.PeerErrorType.InvalidID,'ID "'+i+'" is invalid'),a):(i?a._initialize(i):a._api.retrieveId().then((function(e){return a._initialize(e)})).catch((function(e){return a._abort(h.PeerErrorType.ServerError,e)})),a):(a._delayedAbort(h.PeerErrorType.BrowserIncompatible,"The current browser does not support WebRTC"),a)}return n(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this._options},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"open",{get:function(){return this._open},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"socket",{get:function(){return this._socket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connections",{get:function(){var e,t,r=Object.create(null);try{for(var n=i(this._connections),o=n.next();!o.done;o=n.next()){var s=a(o.value,2),c=s[0],d=s[1];r[c]=d}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disconnected",{get:function(){return this._disconnected},enumerable:!1,configurable:!0}),t.prototype._createServerConnection=function(){var e=this,t=new p.Socket(this._options.secure,this._options.host,this._options.port,this._options.path,this._options.key,this._options.pingInterval);return t.on(h.SocketEventType.Message,(function(t){e._handleMessage(t)})),t.on(h.SocketEventType.Error,(function(t){e._abort(h.PeerErrorType.SocketError,t)})),t.on(h.SocketEventType.Disconnected,(function(){e.disconnected||(e.emitError(h.PeerErrorType.Network,"Lost connection to server."),e.disconnect())})),t.on(h.SocketEventType.Close,(function(){e.disconnected||e._abort(h.PeerErrorType.SocketClosed,"Underlying socket is already closed.")})),t},t.prototype._initialize=function(e){this._id=e,this.socket.start(e,this._options.token)},t.prototype._handleMessage=function(e){var t,r,n=e.type,o=e.payload,a=e.src;switch(n){case h.ServerMessageType.Open:this._lastServerId=this.id,this._open=!0,this.emit(h.PeerEventType.Open,this.id);break;case h.ServerMessageType.Error:this._abort(h.PeerErrorType.ServerError,o.msg);break;case h.ServerMessageType.IdTaken:this._abort(h.PeerErrorType.UnavailableID,'ID "'+this.id+'" is taken');break;case h.ServerMessageType.InvalidKey:this._abort(h.PeerErrorType.InvalidKey,'API KEY "'+this._options.key+'" is invalid');break;case h.ServerMessageType.Leave:u.default.log("Received leave message from "+a),this._cleanupPeer(a),this._connections.delete(a);break;case h.ServerMessageType.Expire:this.emitError(h.PeerErrorType.PeerUnavailable,"Could not connect to peer "+a);break;case h.ServerMessageType.Offer:var s=o.connectionId;if((g=this.getConnection(a,s))&&(g.close(),u.default.warn("Offer received for existing Connection ID:"+s)),o.type===h.ConnectionType.Media)g=new l.MediaConnection(a,this,{connectionId:s,_payload:o,metadata:o.metadata}),this._addConnection(a,g),this.emit(h.PeerEventType.Call,g);else{if(o.type!==h.ConnectionType.Data)return void u.default.warn("Received malformed connection type:"+o.type);g=new f.DataConnection(a,this,{connectionId:s,_payload:o,metadata:o.metadata,label:o.label,serialization:o.serialization,reliable:o.reliable}),this._addConnection(a,g),this.emit(h.PeerEventType.Connection,g)}var c=this._getMessages(s);try{for(var d=i(c),p=d.next();!p.done;p=d.next()){var m=p.value;g.handleMessage(m)}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}break;default:if(!o)return void u.default.warn("You received a malformed message from "+a+" of type "+n);var g;s=o.connectionId,(g=this.getConnection(a,s))&&g.peerConnection?g.handleMessage(e):s?this._storeMessage(s,e):u.default.warn("You received an unrecognized message:",e)}},t.prototype._storeMessage=function(e,t){this._lostMessages.has(e)||this._lostMessages.set(e,[]),this._lostMessages.get(e).push(t)},t.prototype._getMessages=function(e){var t=this._lostMessages.get(e);return t?(this._lostMessages.delete(e),t):[]},t.prototype.connect=function(e,t){if(void 0===t&&(t={}),this.disconnected)return u.default.warn("You cannot connect to a new Peer because you called .disconnect() on this Peer and ended your connection with the server. You can create a new Peer to reconnect, or call reconnect on this peer if you believe its ID to still be available."),void this.emitError(h.PeerErrorType.Disconnected,"Cannot connect to new Peer after disconnecting from server.");var r=new f.DataConnection(e,this,t);return this._addConnection(e,r),r},t.prototype.call=function(e,t,r){if(void 0===r&&(r={}),this.disconnected)return u.default.warn("You cannot connect to a new Peer because you called .disconnect() on this Peer and ended your connection with the server. You can create a new Peer to reconnect."),void this.emitError(h.PeerErrorType.Disconnected,"Cannot connect to new Peer after disconnecting from server.");if(t){r._stream=t;var n=new l.MediaConnection(e,this,r);return this._addConnection(e,n),n}u.default.error("To call a peer, you must provide a stream from your browser's `getUserMedia`.")},t.prototype._addConnection=function(e,t){u.default.log("add connection "+t.type+":"+t.connectionId+" to peerId:"+e),this._connections.has(e)||this._connections.set(e,[]),this._connections.get(e).push(t)},t.prototype._removeConnection=function(e){var t=this._connections.get(e.peer);if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}this._lostMessages.delete(e.connectionId)},t.prototype.getConnection=function(e,t){var r,n,o=this._connections.get(e);if(!o)return null;try{for(var a=i(o),s=a.next();!s.done;s=a.next()){var c=s.value;if(c.connectionId===t)return c}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return null},t.prototype._delayedAbort=function(e,t){var r=this;setTimeout((function(){r._abort(e,t)}),0)},t.prototype._abort=function(e,t){u.default.error("Aborting!"),this.emitError(e,t),this._lastServerId?this.disconnect():this.destroy()},t.prototype.emitError=function(e,t){var r;u.default.error("Error:",t),(r="string"==typeof t?new Error(t):t).type=e,this.emit(h.PeerEventType.Error,r)},t.prototype.destroy=function(){this.destroyed||(u.default.log("Destroy peer with ID:"+this.id),this.disconnect(),this._cleanup(),this._destroyed=!0,this.emit(h.PeerEventType.Close))},t.prototype._cleanup=function(){var e,t;try{for(var r=i(this._connections.keys()),n=r.next();!n.done;n=r.next()){var o=n.value;this._cleanupPeer(o),this._connections.delete(o)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.socket.removeAllListeners()},t.prototype._cleanupPeer=function(e){var t,r,n=this._connections.get(e);if(n)try{for(var o=i(n),a=o.next();!a.done;a=o.next())a.value.close()}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}},t.prototype.disconnect=function(){if(!this.disconnected){var e=this.id;u.default.log("Disconnect peer with ID:"+e),this._disconnected=!0,this._open=!1,this.socket.close(),this._lastServerId=e,this._id=null,this.emit(h.PeerEventType.Disconnected,e)}},t.prototype.reconnect=function(){if(this.disconnected&&!this.destroyed)u.default.log("Attempting reconnection to server with ID "+this._lastServerId),this._disconnected=!1,this._initialize(this._lastServerId);else{if(this.destroyed)throw new Error("This peer cannot reconnect to the server. It has already been destroyed.");if(this.disconnected||this.open)throw new Error("Peer "+this.id+" cannot reconnect because it is not disconnected from the server!");u.default.error("In a hurry? We're still trying to make the initial connection!")}},t.prototype.listAllPeers=function(e){var t=this;void 0===e&&(e=function(e){}),this._api.listAllPeers().then((function(t){return e(t)})).catch((function(e){return t._abort(h.PeerErrorType.ServerError,e)}))},t.DEFAULT_KEY="peerjs",t}(c.EventEmitter);r.Peer=g},{eventemitter3:"JJlS","./util":"BHXf","./logger":"WOs9","./socket":"wJlv","./mediaconnection":"dbHP","./dataconnection":"GBTQ","./enums":"ZRYf","./api":"in7L"}],iTK6:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.peerjs=void 0;var n=e("./util"),o=e("./peer");r.peerjs={Peer:o.Peer,util:n.util},r.default=o.Peer,window.peerjs=r.peerjs,window.Peer=o.Peer},{"./util":"BHXf","./peer":"Hxpd"}]},{},["iTK6"])},5784:function(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=function(){return[]},t.resolve=t,t.id=5784,e.exports=t},2592:function(e,t,r){const n=r(7138),o=r(5115),i=r(6907),a=r(3776);function s(e,t,r,i,a){const s=[].slice.call(arguments,1),c=s.length,d="function"==typeof s[c-1];if(!d&&!n())throw new Error("Callback required as last argument");if(!d){if(c<1)throw new Error("Too few arguments provided");return 1===c?(r=t,t=i=void 0):2!==c||t.getContext||(i=r,r=t,t=void 0),new Promise((function(n,a){try{const a=o.create(r,i);n(e(a,t,i))}catch(e){a(e)}}))}if(c<2)throw new Error("Too few arguments provided");2===c?(a=r,r=t,t=i=void 0):3===c&&(t.getContext&&void 0===a?(a=i,i=void 0):(a=i,i=r,r=t,t=void 0));try{const n=o.create(r,i);a(null,e(n,t,i))}catch(e){a(e)}}t.create=o.create,t.toCanvas=s.bind(null,i.render),t.toDataURL=s.bind(null,i.renderToDataURL),t.toString=s.bind(null,(function(e,t,r){return a.render(e,r)}))},7138:function(e){e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},1845:function(e,t,r){const n=r(242).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=n(e),o=145===r?26:2*Math.ceil((r-13)/(2*t-2)),i=[r-7];for(let e=1;e<t-1;e++)i[e]=i[e-1]-o;return i.push(6),i.reverse()},t.getPositions=function(e){const r=[],n=t.getRowColCoords(e),o=n.length;for(let e=0;e<o;e++)for(let t=0;t<o;t++)0===e&&0===t||0===e&&t===o-1||e===o-1&&0===t||r.push([n[e],n[t]]);return r}},8260:function(e,t,r){const n=r(6910),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*o.indexOf(this.data[t]);r+=o.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(o.indexOf(this.data[t]),6)},e.exports=i},7245:function(e){function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r<t;r++)this.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},3280:function(e){function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,r,n){const o=e*this.size+t;this.data[o]=r,n&&(this.reservedBit[o]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},3424:function(e,t,r){const n=r(2378),o=r(6910);function i(e){this.mode=o.BYTE,this.data=new Uint8Array(n(e))}i.getBitsLength=function(e){return 8*e},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},e.exports=i},5393:function(e,t,r){const n=r(4908),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case n.L:return o[4*(e-1)+0];case n.M:return o[4*(e-1)+1];case n.Q:return o[4*(e-1)+2];case n.H:return o[4*(e-1)+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case n.L:return i[4*(e-1)+0];case n.M:return i[4*(e-1)+1];case n.Q:return i[4*(e-1)+2];case n.H:return i[4*(e-1)+3];default:return}}},4908:function(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return r}}},6526:function(e,t,r){const n=r(242).getSymbolSize;t.getPositions=function(e){const t=n(e);return[[0,0],[t-7,0],[0,t-7]]}},1642:function(e,t,r){const n=r(242),o=n.getBCHDigit(1335);t.getEncodedBits=function(e,t){const r=e.bit<<3|t;let i=r<<10;for(;n.getBCHDigit(i)-o>=0;)i^=1335<<n.getBCHDigit(i)-o;return 21522^(r<<10|i)}},9729:function(e,t){const r=new Uint8Array(512),n=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)r[t]=e,n[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)r[e]=r[e-255]}(),t.log=function(e){if(e<1)throw new Error("log("+e+")");return n[e]},t.exp=function(e){return r[e]},t.mul=function(e,t){return 0===e||0===t?0:r[n[e]+n[t]]}},5442:function(e,t,r){const n=r(6910),o=r(242);function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return 13*e},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=o.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},e.exports=i},7126:function(e,t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function r(e,r,n){switch(e){case t.Patterns.PATTERN000:return(r+n)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return n%3==0;case t.Patterns.PATTERN011:return(r+n)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case t.Patterns.PATTERN101:return r*n%2+r*n%3==0;case t.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case t.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let r=0,n=0,o=0,i=null,a=null;for(let s=0;s<t;s++){n=o=0,i=a=null;for(let c=0;c<t;c++){let t=e.get(s,c);t===i?n++:(n>=5&&(r+=n-5+3),i=t,n=1),t=e.get(c,s),t===a?o++:(o>=5&&(r+=o-5+3),a=t,o=1)}n>=5&&(r+=n-5+3),o>=5&&(r+=o-5+3)}return r},t.getPenaltyN2=function(e){const t=e.size;let r=0;for(let n=0;n<t-1;n++)for(let o=0;o<t-1;o++){const t=e.get(n,o)+e.get(n,o+1)+e.get(n+1,o)+e.get(n+1,o+1);4!==t&&0!==t||r++}return 3*r},t.getPenaltyN3=function(e){const t=e.size;let r=0,n=0,o=0;for(let i=0;i<t;i++){n=o=0;for(let a=0;a<t;a++)n=n<<1&2047|e.get(i,a),a>=10&&(1488===n||93===n)&&r++,o=o<<1&2047|e.get(a,i),a>=10&&(1488===o||93===o)&&r++}return 40*r},t.getPenaltyN4=function(e){let t=0;const r=e.data.length;for(let n=0;n<r;n++)t+=e.data[n];return 10*Math.abs(Math.ceil(100*t/r/5)-10)},t.applyMask=function(e,t){const n=t.size;for(let o=0;o<n;o++)for(let i=0;i<n;i++)t.isReserved(i,o)||t.xor(i,o,r(e,i,o))},t.getBestMask=function(e,r){const n=Object.keys(t.Patterns).length;let o=0,i=1/0;for(let a=0;a<n;a++){r(a),t.applyMask(a,e);const n=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(a,e),n<i&&(i=n,o=a)}return o}},6910:function(e,t,r){const n=r(3114),o=r(7007);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!n.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return o.testNumeric(e)?t.NUMERIC:o.testAlphanumeric(e)?t.ALPHANUMERIC:o.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return r}}},1085:function(e,t,r){const n=r(6910);function o(e){this.mode=n.NUMERIC,this.data=e.toString()}o.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);const o=this.data.length-t;o>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*o+1))},e.exports=o},6143:function(e,t,r){const n=r(9729);t.mul=function(e,t){const r=new Uint8Array(e.length+t.length-1);for(let o=0;o<e.length;o++)for(let i=0;i<t.length;i++)r[o+i]^=n.mul(e[o],t[i]);return r},t.mod=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){const e=r[0];for(let o=0;o<t.length;o++)r[o]^=n.mul(t[o],e);let o=0;for(;o<r.length&&0===r[o];)o++;r=r.slice(o)}return r},t.generateECPolynomial=function(e){let r=new Uint8Array([1]);for(let o=0;o<e;o++)r=t.mul(r,new Uint8Array([1,n.exp(o)]));return r}},5115:function(e,t,r){const n=r(242),o=r(4908),i=r(7245),a=r(3280),s=r(1845),c=r(6526),d=r(7126),u=r(5393),p=r(2882),l=r(3103),f=r(1642),h=r(6910),m=r(6130);function g(e,t,r){const n=e.size,o=f.getEncodedBits(t,r);let i,a;for(i=0;i<15;i++)a=1==(o>>i&1),i<6?e.set(i,8,a,!0):i<8?e.set(i+1,8,a,!0):e.set(n-15+i,8,a,!0),i<8?e.set(8,n-i-1,a,!0):i<9?e.set(8,15-i-1+1,a,!0):e.set(8,15-i-1,a,!0);e.set(n-8,8,1,!0)}function y(e,t,r,o){let f;if(Array.isArray(e))f=m.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=m.rawSplit(e);n=l.getBestVersionForData(t,r)}f=m.fromString(e,n||40)}}const y=l.getBestVersionForData(f,r);if(!y)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<y)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+y+".\n")}else t=y;const E=function(e,t,r){const o=new i;r.forEach((function(t){o.put(t.mode.bit,4),o.put(t.getLength(),h.getCharCountIndicator(t.mode,e)),t.write(o)}));const a=8*(n.getSymbolTotalCodewords(e)-u.getTotalCodewordsCount(e,t));for(o.getLengthInBits()+4<=a&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);const s=(a-o.getLengthInBits())/8;for(let e=0;e<s;e++)o.put(e%2?17:236,8);return function(e,t,r){const o=n.getSymbolTotalCodewords(t),i=o-u.getTotalCodewordsCount(t,r),a=u.getBlocksCount(t,r),s=a-o%a,c=Math.floor(o/a),d=Math.floor(i/a),l=d+1,f=c-d,h=new p(f);let m=0;const g=new Array(a),y=new Array(a);let E=0;const v=new Uint8Array(e.buffer);for(let e=0;e<a;e++){const t=e<s?d:l;g[e]=v.slice(m,m+t),y[e]=h.encode(g[e]),m+=t,E=Math.max(E,t)}const _=new Uint8Array(o);let T,w,b=0;for(T=0;T<E;T++)for(w=0;w<a;w++)T<g[w].length&&(_[b++]=g[w][T]);for(T=0;T<f;T++)for(w=0;w<a;w++)_[b++]=y[w][T];return _}(o,e,t)}(t,r,f),v=n.getSymbolSize(t),_=new a(v);return function(e,t){const r=e.size,n=c.getPositions(t);for(let t=0;t<n.length;t++){const o=n[t][0],i=n[t][1];for(let t=-1;t<=7;t++)if(!(o+t<=-1||r<=o+t))for(let n=-1;n<=7;n++)i+n<=-1||r<=i+n||(t>=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(o+t,i+n,!0,!0):e.set(o+t,i+n,!1,!0))}}(_,t),function(e){const t=e.size;for(let r=8;r<t-8;r++){const t=r%2==0;e.set(r,6,t,!0),e.set(6,r,t,!0)}}(_),function(e,t){const r=s.getPositions(t);for(let t=0;t<r.length;t++){const n=r[t][0],o=r[t][1];for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)-2===t||2===t||-2===r||2===r||0===t&&0===r?e.set(n+t,o+r,!0,!0):e.set(n+t,o+r,!1,!0)}}(_,t),g(_,r,0),t>=7&&function(e,t){const r=e.size,n=l.getEncodedBits(t);let o,i,a;for(let t=0;t<18;t++)o=Math.floor(t/3),i=t%3+r-8-3,a=1==(n>>t&1),e.set(o,i,a,!0),e.set(i,o,a,!0)}(_,t),function(e,t){const r=e.size;let n=-1,o=r-1,i=7,a=0;for(let s=r-1;s>0;s-=2)for(6===s&&s--;;){for(let r=0;r<2;r++)if(!e.isReserved(o,s-r)){let n=!1;a<t.length&&(n=1==(t[a]>>>i&1)),e.set(o,s-r,n),i--,-1===i&&(a++,i=7)}if(o+=n,o<0||r<=o){o-=n,n=-n;break}}}(_,E),isNaN(o)&&(o=d.getBestMask(_,g.bind(null,_,r))),d.applyMask(o,_),g(_,r,o),{modules:_,version:t,errorCorrectionLevel:r,maskPattern:o,segments:f}}t.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,i,a=o.M;return void 0!==t&&(a=o.from(t.errorCorrectionLevel,o.M),r=l.from(t.version),i=d.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),y(e,r,a,i)}},2882:function(e,t,r){const n=r(6143);function o(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}o.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},o.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=n.mod(t,this.genPoly),o=this.degree-r.length;if(o>0){const e=new Uint8Array(this.degree);return e.set(r,o),e}return r},e.exports=o},7007:function(e,t){let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+")(?:.|[\r\n]))+";t.KANJI=new RegExp(r,"g"),t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=new RegExp(n,"g"),t.NUMERIC=new RegExp("[0-9]+","g"),t.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const o=new RegExp("^"+r+"$"),i=new RegExp("^[0-9]+$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return o.test(e)},t.testNumeric=function(e){return i.test(e)},t.testAlphanumeric=function(e){return a.test(e)}},6130:function(e,t,r){const n=r(6910),o=r(1085),i=r(8260),a=r(3424),s=r(5442),c=r(7007),d=r(242),u=r(5987);function p(e){return unescape(encodeURIComponent(e)).length}function l(e,t,r){const n=[];let o;for(;null!==(o=e.exec(r));)n.push({data:o[0],index:o.index,mode:t,length:o[0].length});return n}function f(e){const t=l(c.NUMERIC,n.NUMERIC,e),r=l(c.ALPHANUMERIC,n.ALPHANUMERIC,e);let o,i;return d.isKanjiModeEnabled()?(o=l(c.BYTE,n.BYTE,e),i=l(c.KANJI,n.KANJI,e)):(o=l(c.BYTE_KANJI,n.BYTE,e),i=[]),t.concat(r,o,i).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function h(e,t){switch(t){case n.NUMERIC:return o.getBitsLength(e);case n.ALPHANUMERIC:return i.getBitsLength(e);case n.KANJI:return s.getBitsLength(e);case n.BYTE:return a.getBitsLength(e)}}function m(e,t){let r;const c=n.getBestModeForData(e);if(r=n.from(t,c),r!==n.BYTE&&r.bit<c.bit)throw new Error('"'+e+'" cannot be encoded with mode '+n.toString(r)+".\n Suggested mode is: "+n.toString(c));switch(r!==n.KANJI||d.isKanjiModeEnabled()||(r=n.BYTE),r){case n.NUMERIC:return new o(e);case n.ALPHANUMERIC:return new i(e);case n.KANJI:return new s(e);case n.BYTE:return new a(e)}}t.fromArray=function(e){return e.reduce((function(e,t){return"string"==typeof t?e.push(m(t,null)):t.data&&e.push(m(t.data,t.mode)),e}),[])},t.fromString=function(e,r){const o=function(e,t){const r={},o={start:{}};let i=["start"];for(let a=0;a<e.length;a++){const s=e[a],c=[];for(let e=0;e<s.length;e++){const d=s[e],u=""+a+e;c.push(u),r[u]={node:d,lastCount:0},o[u]={};for(let e=0;e<i.length;e++){const a=i[e];r[a]&&r[a].node.mode===d.mode?(o[a][u]=h(r[a].lastCount+d.length,d.mode)-h(r[a].lastCount,d.mode),r[a].lastCount+=d.length):(r[a]&&(r[a].lastCount=d.length),o[a][u]=h(d.length,d.mode)+4+n.getCharCountIndicator(d.mode,t))}}i=c}for(let e=0;e<i.length;e++)o[i[e]].end=0;return{map:o,table:r}}(function(e){const t=[];for(let r=0;r<e.length;r++){const o=e[r];switch(o.mode){case n.NUMERIC:t.push([o,{data:o.data,mode:n.ALPHANUMERIC,length:o.length},{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.ALPHANUMERIC:t.push([o,{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.KANJI:t.push([o,{data:o.data,mode:n.BYTE,length:p(o.data)}]);break;case n.BYTE:t.push([{data:o.data,mode:n.BYTE,length:p(o.data)}])}}return t}(f(e,d.isKanjiModeEnabled())),r),i=u.find_path(o.map,"start","end"),a=[];for(let e=1;e<i.length-1;e++)a.push(o.table[i[e]].node);return t.fromArray(a.reduce((function(e,t){const r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[]))},t.rawSplit=function(e){return t.fromArray(f(e,d.isKanjiModeEnabled()))}},242:function(e,t){let r;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return n[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');r=e},t.isKanjiModeEnabled=function(){return void 0!==r},t.toSJIS=function(e){return r(e)}},3114:function(e,t){t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},3103:function(e,t,r){const n=r(242),o=r(5393),i=r(4908),a=r(6910),s=r(3114),c=n.getBCHDigit(7973);function d(e,t){return a.getCharCountIndicator(e,t)+4}function u(e,t){let r=0;return e.forEach((function(e){const n=d(e.mode,t);r+=n+e.getBitsLength()})),r}t.from=function(e,t){return s.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!s.isValid(e))throw new Error("Invalid QR Code version");void 0===r&&(r=a.BYTE);const i=8*(n.getSymbolTotalCodewords(e)-o.getTotalCodewordsCount(e,t));if(r===a.MIXED)return i;const c=i-d(r,e);switch(r){case a.NUMERIC:return Math.floor(c/10*3);case a.ALPHANUMERIC:return Math.floor(c/11*2);case a.KANJI:return Math.floor(c/13);case a.BYTE:default:return Math.floor(c/8)}},t.getBestVersionForData=function(e,r){let n;const o=i.from(r,i.M);if(Array.isArray(e)){if(e.length>1)return function(e,r){for(let n=1;n<=40;n++)if(u(e,n)<=t.getCapacity(n,r,a.MIXED))return n}(e,o);if(0===e.length)return 1;n=e[0]}else n=e;return function(e,r,n){for(let o=1;o<=40;o++)if(r<=t.getCapacity(o,n,e))return o}(n.mode,n.getLength(),o)},t.getEncodedBits=function(e){if(!s.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;n.getBCHDigit(t)-c>=0;)t^=7973<<n.getBCHDigit(t)-c;return e<<12|t}},6907:function(e,t,r){const n=r(9653);t.render=function(e,t,r){let o=r,i=t;void 0!==o||t&&t.getContext||(o=t,t=void 0),t||(i=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),o=n.getOptions(o);const a=n.getImageWidth(e.modules.size,o),s=i.getContext("2d"),c=s.createImageData(a,a);return n.qrToImageData(c.data,e,o),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(s,i,a),s.putImageData(c,0,0),i},t.renderToDataURL=function(e,r,n){let o=n;void 0!==o||r&&r.getContext||(o=r,r=void 0),o||(o={});const i=t.render(e,r,o),a=o.type||"image/png",s=o.rendererOpts||{};return i.toDataURL(a,s.quality)}},3776:function(e,t,r){const n=r(9653);function o(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function i(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}t.render=function(e,t,r){const a=n.getOptions(t),s=e.modules.size,c=e.modules.data,d=s+2*a.margin,u=a.color.light.a?"<path "+o(a.color.light,"fill")+' d="M0 0h'+d+"v"+d+'H0z"/>':"",p="<path "+o(a.color.dark,"stroke")+' d="'+function(e,t,r){let n="",o=0,a=!1,s=0;for(let c=0;c<e.length;c++){const d=Math.floor(c%t),u=Math.floor(c/t);d||a||(a=!0),e[c]?(s++,c>0&&d>0&&e[c-1]||(n+=a?i("M",d+r,.5+u+r):i("m",o,0),o=0,a=!1),d+1<t&&e[c+1]||(n+=i("h",s),s=0)):o++}return n}(c,s,a.margin)+'"/>',l='viewBox="0 0 '+d+" "+d+'"',f='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+l+' shape-rendering="crispEdges">'+u+p+"</svg>\n";return"function"==typeof r&&r(null,f),f}},9653:function(e,t){function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,o=e.scale||4;return{width:n,scale:n?4:o,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){const n=t.getScale(e,r);return Math.floor((e+2*r.margin)*n)},t.qrToImageData=function(e,r,n){const o=r.modules.size,i=r.modules.data,a=t.getScale(o,n),s=Math.floor((o+2*n.margin)*a),c=n.margin*a,d=[n.color.light,n.color.dark];for(let t=0;t<s;t++)for(let r=0;r<s;r++){let u=4*(t*s+r),p=n.color.light;t>=c&&r>=c&&t<s-c&&r<s-c&&(p=d[i[Math.floor((t-c)/a)*o+Math.floor((r-c)/a)]?1:0]),e[u++]=p.r,e[u++]=p.g,e[u++]=p.b,e[u]=p.a}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{CalibrationTimedOutError:function(){return c},ImpulseResponseCalibration:function(){return O},Listener:function(){return d},MissingSpeakerIdError:function(){return s},Speaker:function(){return h},UnsupportedDeviceError:function(){return a},VolumeCalibration:function(){return _}});var e=r(5391),t=r.n(e);const o={targetElementId:null,siteUrl:null};var i=class{constructor(e=o){this.peer=new(t())({secure:!0,host:"easyeyes-peer-server.herokuapp.com",port:443}),this.conn=null,this.lastPeerId=null,this.targetElement=e.targetElementId,this.siteUrl=e.siteUrl,this.dataStore=[],this.sourceAudioContext=new(window.AudioContext||window.webkitAudioContext||window.audioContext)}displayUpdate=(e,t=!0)=>{if(document.getElementById(this.targetElement)){const r=document.getElementById(this.targetElement);t?r.innerText+=`\n${e}`:r.innerText=e}else console.log("MESSAGE: ",e)};onPeerDisconnected=()=>{this.displayUpdate("Connection lost. Please reconnect"),this.peer.id=this.lastPeerId,this.peer._lastServerId=this.lastPeerId,this.peer.reconnect()};onPeerClose=()=>{this.displayUpdate("Connection closed"),this.conn=null};onPeerError=e=>{this.displayUpdate(e),console.log(`${e}`)};parseURLSearchParams=()=>Object.fromEntries(new URLSearchParams(location.search));queryStringFromObject=e=>Object.keys(e).map((t=>`${t}=${e[t]}`)).join("&");static keypressFeedbackSound="data:audio/mpeg;base64,//uQZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAALAAATlgAXFxcXFxcXFxcuLi4uLi4uLi5FRUVFRUVFRUVdXV1dXV1dXV10dHR0dHR0dHSLi4uLi4uLi4uioqKioqKioqK6urq6urq6urrR0dHR0dHR0dHo6Ojo6Ojo6Oj///////////8AAAA5TEFNRTMuMTAwAaoAAAAALgYAABSAJAZbTgAAgAAAE5YfafL/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//uQZAAAA0YVyhVvQAAAAA0goAABGfWdITn6gAgAADSDAAAAAEWjAwMwMDMFBzCQsw8PMPCwUDgkNMpNzXEoSUTP3s6nJPd4z28k62JNdIwIUHj3nvynRempMmLAo/tff9/3IchyHIch/IxY3SUmG86enD4Pg+fgmfEAIQQcsP+oH//E7/+Ud/1HP/B9AAABMCFFFAAAwDgCyMCVAgQcBQmARAHw0AOGAUgFJgUoL8YKsEvqzGA1APJQAIGBNgDpoBRvQYb6EIGhIkmJg1QA0aH0H4GDBgJ4G55UBpM1AGgUG0wAgOBIUAYJGoGFQ4AkHitxzRSocGMwDYYCwJAWAICgBD8jhwlEqBNsMiAkCBpQY2FxpG61opmucDLrjKi6Fmk5oK9PWVh1DNFM2IaRH/q8mTQgTF4sk0bnv//zEuqRMjYycuuj///5wxZzIvLSMTUxYyZL////86ZBqh4D+QUIABcwBQBLMCmAeTA4wJowO8E2DAeYwQ8CWMDLBHDB1QpIxscoSMwBQJj/WZBA3O4mFMHIAGzAKAVgwmcG8OIV//uSZCIN9VQ4wgd/gAAAAA0g4AABD+S/Di5+qgAAADSAAAAEEzcNTC4yM0m41SLDHAJLSggBKwtKRwb6+IBi4ctbepDskh2KmAgA16NTNrON66ptO40mNa9ayZHVx7zmGPHktZb7vP9xLn4fr+9jeO//8P+z39///9T/////t+d6vf1+c6fP9Hv5cxg4aA4TgkGIYmLbYHGAxaCjHwlM0lwBC4zGwzVG+MFnGoTY8sn0w1MSHA09vAM8ssDCSYAykIABmeCI4AKDMDIRfGbFAjWE8h+BfIEfBoFCTQJUcA5ZIrQDjzQ+gWzxsjDLtE4s46kxjHZZom2SXfyj6uadvNvb0ee/3dX//01YAVKw/FoW3hDrwUDTAwDMVigy8rTYaRNKug2tzzBwxnAx/DOuMhFECAOxWsDO6kAwkdQFH0BiwIgYlAwCgdAwiZBBI1kCC5JcWwCQWMQ/JQnkVFkOVN8oku8yDkjbMiry+2rrLvW/MvT53q/yv+n2///dywQL8DRgOgsrBBi0LGcngZrCZgYxGEAoZ+IplUdGJ1ifHVRh5v/7kmRMDPOhJ0MTn6qAAAANIAAAARDEiQhOf0pAAAA0gAAABAdCcEnCwmbqA1JhbIFwYKEAUGAXgOJo45oXAyjT0MinMgXM2UNoNGyYeLN0ENORMgQC5EYAJlr4Z3L3lgaHG5VO0lWX1q92J3t9sWM+bu9/fe8/VT/L+zq9v+zr9/+//8r71SAAAA9tq0AA1hzXXdxmzgPWzJyU20wh4EDDUSzWI4x4rgMGBd+IImDoAiEBAMCJn2HpqAlRpDIZhbxxp2ASQcGVRJG6RC4xmaZHiYlYPKGGdEGJjIoa4YtICXGHRhGJg2QMkYJADRGfCMTZE5+4ze1gMF1k163DfQrNgh83G3zIYoMdC4wEOwcrzMxMMam0AlYxkKzOgqMDhUuUBgYIQOWiEgwYHAogAwXBAYHAKAVVm0ZW2J1Wno9taaAzuOSF34AjMUjdBOy+pjbpKCil9TG/hOWRkUkxad2pAAAGFlrIADgyUqh1syPqzGQRoUAEDDoFgKMDw7MVA2NJ1sKHaMVghBwfGAgOgJR0migMTBUODDQezBI5jGNQzXD/+5JkjYD20jDN67/kngAADSAAAAEXjN0dTv9SAAAANIAAAASwgEb7HKvHZpiFAM0Bgs8wPYBNNi8MMfMIKRGRlOETOErM6wMGpBTQHTjJEQaKEBoKmlLXGizd5Ax5W2Byh0X6R9YRJ2rQFSKzgZDB0DQDKJHDr/MoZRDsaleN+vVhpoVqzczvZYx+Hdbx1/MuWOZb///Vr1YX93I/6P9KAWAQE8pFZWkOCuFAO0EEAThJ4OYwBQMHIJgUUVrHHRwaURUkZ4YX6MYvO6EDvpgTJY6aVeR7mGcgzBgfQE2YCuA5H9adJQKBCAhAqA53/aS/bk0T1zjIhpmcjVumpqS/ZZ1v6TuOXxF1+49x5d5Knl/Luvw7ua/8P/DdWT+dOkhD5zhvqb0db/93/5AQAQsF3glyO4MAysKti2BGAAdE0L31C4EMAhEAgAu28hgMOFHwEgaYACAFHpko0GM0ia2Yx0/wmKECIhpq5poYK2CTmAQAMhgAQBKYAoARFUAhUQbKhIMAxAFG3eFpLns4drJbaY9+pDVDPZ/QKtLHKNCpsTA6//uSZIEE9GAuRhNfzIAAAA0gAAABEnjLFK588sAAADSAAAAEdTXMSKxfop3DPM5RNbal/EvU7p6/Ie/t93Z1v6OqEAzmEmBoIQcGTCwGMCghPwvOQgUwEbKMZBgNAwOPZioUiMIl/ACXRGoREDB0clmTLApMiq4x2azRlmMM7NijivBEQxUIGvMGdAsjAxgHcDSxgRZANSYAOAgYs0FXAnwaIl43xAcuEVEogHIiFKRHEuREzUfFfSOoEgRyTk8Isema00Fl0gzqujqL/ZT3Krfoq7r1H/AvWzp/yXv/3f/oA0GjFwIZS19BgKAsiCDxuUBAMZ8D6zIZAIFMChweF7GFbQAITYoiSSSvMRBoUJ5l4RGVzOa2hhmAr6mbNSaYcYlxgqAvmAaCEYDAE6yBgAFIpAsGADyaXw+/MSnONGVBjhuNW+/dbYnEQqJJNwIgainmo0TB3Ofkus/yHs5P3dnW/+ryf+QqTEFNRTMuMTAwqqqqqqqqqqqqAABjBgrdYuwIwHSioNCCFkYbBZpMaoVDIRMDhB326ByJkJgYuGdC4P/7kmSwDPT4N0MLn6SAAAANIAAAARDIpRJOePLAAAA0gAAABDAGIA0YOGJhoVGKx+YbQxu2mmHbCT5rII6wYW2ASgYFJDgHYBAIpMARM6WcpEFALUjnWoXbkbwf8AGkx+2FugJGw/l2gIK+vverzfFet8Re/kur09f/f/u6f/1GySAhOMFigxOOnJAAdLIIqmTCCa9ahACTDANMqFMLAIQjQw0EVbjH4aOuN8OAgFCBn0sS0GpU0IAjUJ3MCoPaDTTB4AwnIE7MGrBCjAcgE836g5kUx6AtCKkjKElvKarxnFzLOlKRocalMtnabKM6hpYW5TSrdLe1Kop3e+ZWtymHt445fv9Vfyy/Hn5Xv///v1bXt4M9Z7+o729b+K/4b6pMQU1FMy4xMDCqqqqqqqqqqqoAArJ2QY8DbERAFjDyZMdBUwYDwIEDHduP9KsmPhhMKGHR0ZzTg0NTB4kGhkYqgZ2MZGQRUYNHoGXBgA4HWYEoBbGCNgvJhVgV8ZJaR2GsQJb5g5gRMYD+BQmAhADQNAVRoA4EQAOXUBwAkYBsAVr/+5Jk0w/0GynDE59coAAADSAAAAEULMkADn9SAAAANIAAAATsdabY4ta/VUMV5DuqzWuVs3pSSLmoKyJqFQGpUi+IAy2PdQm57ZU/m8oR6dDu/KvzehHpx5O/KkuvNN/o39SX9fblC3lusxd7wMr2zmhS+YLExsQBmRRQGKE6HITacxM2hgy8ATH50NVDsxSlQMPDL4bNJAg7HUAIBQcOjCRbMBtAdDAAACkwB4EWMCzCGTGll+U7EVMUMoPCSjDHgWcwaECqP+mza0I1QpATkY0Sm3lwsB0q0C3xd6GWuF4jEAeiqacWb5bdVxJbap8YzlnZWta3hLq34RaGf5hj3/pZ3HveY/3ku7/5a/7Wf//9/92aGoPcO9Z3nep/9H+mTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqgBOZ2IMSwdMDATGQhDC4ZXKRj8wGMxub0k5717G//uSZPaO9axfvJOfPEAAAA0gAAABFsja3g5/cEAAADSAAAAELQSBSmZKFYVCYsIjBA1MCgYxWdDkBzMRAEwgQDIIBMgFIzWQTUjgPK3c02lpDWsiqM0Ih0w6QzjB4BzMDcD4wFgEzAfAeQQs8TcsNydp+n5wlq8UapFM2auMpwfZrv475ll25Y5ll3mtzMuwCWO8Ocqe/lndv+j/b1f6/9QATU2x0wCPIAYTCoUHAxhIYX2MXBDC24mvTCAedLotPVa09tEZwuBrSZmkoXXBgkY2SmmPBjQkpGrwfaYZQGhQDcPACJNPw90xLlijCVZWUifsophFk7ww7v7fGk6gE/vB+l0VNkSFwo0bYXJC6gyQQEiwvlDzbHAhHpZLIQbJ1UxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUASWNHVvyNdkdcuCnNLhmA8HuRIHbo/1AhfJ9JZVctla8gMQwpDT96eCGcDAGg8qCCIBce3D8P35RGMZXL8gcmxBByacE9hDD09hNohydtFshlp7EeIe9aMiMe/P/7kmTNjPTPJLaLvPDwAAANIAAAAQ/obuBt+FJAAAA0gAAABEchD3bEIchgekEBmZYRmyPAM3j4DJ8fhgfmeIjtD4HTwPAiPgNGB+BAAjtCABG8AwMvgwAEo5cSIfzt69YYDMdo9RxSsKtgIcom1PMylIK9rWkMkKzctAIIkqXCTqLYAoUrBCJrAlHzJipaMuaPvWraLnsMj6ExUtGUZ0ZRnJ7Q6PrnS7VrsC55kSlRyTYjonPkkybMT2AyVMrbMrYly661bq13Fz0K2JlbEdH1zk9ocnsB09CcutLYmj71p7Q6PWDI+hMXWjJ06Mozk9odH0BkfQmLrRlGdE6M5JrhKJzZKPoSSephKVHJlGcmLhkZXJJ9CYnrRkqSmMZybKpMQU1FMy4xMDCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+5Jk7QT0dTc4kxw0ogAADSAAAAEZOaLm5+WQSAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqglFJEIRoPjA2MDYyViqViCJxDHghjyPQ4ioUiYKw4EMzYZXAooDEE1y2zRpTu00acWUWWcacaUWYeWcacJAhYgWJFCRQGIFiBZZRZRZlw7s7PG////s7M7Ozs7M5xpRZR5RRpxZRZh5RRZRbRC1NP///9PKqqq4NNNNRKqJXTTTTVVVTEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uSZIIP9BFGHYksMlIAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVQ=="};class a extends Error{constructor(e){super(e),this.name="UnsupportedDeviceError",this.message=e}}class s extends Error{constructor(e){super(e),this.name="missingSpeakerIdError",this.message=e}}class c extends Error{constructor(e){super(e),this.name="calibrationTimedOutError",this.message=e}}var d=class extends i{constructor(e){super(e),this.startTime=Date.now(),this.receiverPeerId=null;const t=this.parseURLSearchParams();this.speakerPeerId=t.speakerPeerId,this.peer.on("open",this.onPeerOpen),this.peer.on("connection",this.onPeerConnection),this.peer.on("disconnected",this.onPeerDisconnected),this.peer.on("close",this.onPeerClose),this.peer.on("error",this.onPeerError)}onPeerOpen=e=>{this.displayUpdate("Listener - onPeerOpen"),null===e?(this.displayUpdate("Received null id from peer open"),this.peer.id=this.lastPeerId):this.lastPeerId=this.peer.id,this.join()};onPeerConnection=e=>{this.displayUpdate("Listener - onPeerConnection"),e.on("open",(()=>{e.send("Sender does not accept incoming connections"),setTimeout((()=>{e.close()}),500)}))};onConnData=e=>{if(this.displayUpdate("Listener - onConnData"),!Object.prototype.hasOwnProperty.call(e,"speakerPeerId"))throw this.displayUpdate('Error in parsing data received! Must set "speakerPeerId" property'),new s('Must set "speakerPeerId" property');{this.displayUpdate(this.speakerPeerId),this.speakerPeerId=e.speakerPeerId;const t={speakerPeerId:this.speakerPeerId};window.location.search=this.queryStringFromObject(t)}};join=()=>{this.displayUpdate("Listener - join"),this.conn&&(this.displayUpdate("Closing old connection"),this.conn.close()),this.displayUpdate(`Creating connection to: ${this.speakerPeerId}`),this.conn=this.peer.connect(this.speakerPeerId,{reliable:!0}),this.displayUpdate("Created connection"),this.conn.on("open",(async()=>{this.displayUpdate("Listener - conn open"),await this.openAudioStream()})),this.conn.on("data",this.onConnData),this.conn.on("close",(()=>{console.log("Connection closed")}))};getMobileOS=()=>{const e=navigator.userAgent;return/android/i.test(e)?"Android":/iPad|iPhone|iPod/.test(e)||"MacIntel"===(navigator?.userAgentData?.platform||navigator?.platform)&&navigator.maxTouchPoints>1?"iOS":"Other"};sendSamplingRate=e=>{this.displayUpdate("Listener - sendSamplingRate"),this.conn.send({name:"samplingRate",payload:e})};applyHQTrackConstraints=async e=>{const t=e.getAudioTracks()[0],r=t.getCapabilities().sampleRate.max>=96e3,n={sampleRate:r?96e3:48e3,sampleSize:r?24:16};try{await t.applyConstraints(n)}catch(e){console.warn(e),this.displayUpdate(`Error applying contraints to track: ${e}`)}return t.getSettings().sampleRate};openAudioStream=async()=>{this.displayUpdate("Listener - openAudioStream");const e=this.getMobileOS();if("iOS"===e)navigator.mediaDevices.getUserMedia({audio:{sampleRate:96e3,channelCount:1,sampleSize:24},video:!1}).then((e=>{this.applyHQTrackConstraints(e).then((t=>{this.sendSamplingRate(t),this.peer.call(this.speakerPeerId,e),this.displayUpdate("Listener - openAudioStream")})).catch((e=>{console.log(e),this.displayUpdate(`Error in applying track contraints ${e}`)}))})).catch((e=>{console.log(e),this.displayUpdate(`Error in opening audio stream ${e}`)}));else{const t=new a(`${e} is not supported`);this.conn.send({name:t.name,payload:t})}}},u=r(2592);const p=e=>new Promise((t=>{setTimeout(t,1e3*e)})),l=(e,t=",")=>e.trim().split("\n").map((e=>parseFloat(e.trim().split(t)[1])));class f extends i{constructor(e,t,r){super(e),this.siteUrl+="/listener?",this.ac=new t(r),this.result=null,this.peer.on("open",this.#onPeerOpen),this.peer.on("connection",this.#onPeerConnection),this.peer.on("close",this.#onPeerClose),this.peer.on("disconnected",this.#onPeerDisconnected),this.peer.on("error",this.#onPeerError)}static startCalibration=async(e,t,r,n=12e4)=>{window.speaker=new f(e,t,r);const{speaker:o}=window;return new Promise(((e,t)=>{o.peer.on("call",(async r=>{r.answer(),o.#removeUIElems(),o.#showSpinner(),o.ac.createLocalAudio(document.getElementById(o.targetElement)),r.on("stream",(async t=>{for(window.localStream=t,window.localAudio.srcObject=t,window.localAudio.autoplay=!1;!o.ac.sampleRatesSet();)console.log("SinkSamplingRate is undefined, sleeping"),await p(1);o.result=await o.ac.startCalibration(t),o.#removeUIElems(),e(o.result)})),setTimeout((()=>{t(new c(`Calibration failed to produce a result after ${n/1e3} seconds. Please try again.`))}),n)}))}))};#showQRCode=()=>{const e={speakerPeerId:this.peer.id},t=this.queryStringFromObject(e),r=this.siteUrl+t,n=document.createElement("canvas");n.setAttribute("id","qrCanvas"),console.log(r),u.toCanvas(n,r,(e=>{e&&console.error(e)})),document.getElementById(this.targetElement)?(document.getElementById(this.targetElement),document.getElementById(this.targetElement).appendChild(n)):console.log("TEST: Peer reachable at: ",r)};#showSpinner=()=>{const e=document.createElement("div");e.className="spinner-border ml-auto",e.role="status",e.ariaHidden="true",document.getElementById(this.targetElement).appendChild(e)};#removeUIElems=()=>{const e=document.getElementById(this.targetElement);for(;e.firstChild;)e.firstChild.remove()};#onPeerOpen=e=>{null===e?(console.error("Received null id from peer open"),this.peer.id=this.lastPeerId):this.lastPeerId=this.peer.id,e!==this.peer.id&&console.warn("DEBUG Check you assumption that id === this.peer.id"),this.#showQRCode()};#onPeerConnection=e=>{this.conn&&this.conn.open?e.on("open",(()=>{e.send("Already connected to another client"),setTimeout((()=>{e.close()}),500)})):(this.conn=e,console.log("Connected to: ",this.conn.peer),this.#ready())};#onPeerClose=()=>{this.conn=null,console.log("Connection destroyed")};#onPeerDisconnected=()=>{console.log("Connection lost. Please reconnect"),this.peer.id=this.lastPeerId,this.peer._lastServerId=this.lastPeerId,this.peer.reconnect()};#onPeerError=e=>{console.error(e)};#onIncomingData=e=>{if(Object.prototype.hasOwnProperty.call(e,"name")&&Object.prototype.hasOwnProperty.call(e,"payload"))switch(e.name){case"samplingRate":this.ac.setSamplingRates(e.payload);break;case a.name:case s.name:throw e.payload}else console.error("Received malformed data: ",e)};#ready=()=>{this.conn.on("data",this.#onIncomingData),this.conn.on("close",(()=>{console.log("Connection reset<br>Awaiting connection..."),this.conn=null}))};downloadData=()=>{this.ac.downloadData()}}var h=f,m=r(9669),g=r.n(m);class y{static PYTHON_SERVER_URL="https://easyeyes-python-flask-server.herokuapp.com";static TEST_SERVER_URL="http://127.0.0.1:5000";getImpulseResponse=async({payload:e,sampleRate:t,P:r})=>{let n=null;console.log({payload:e});const o=JSON.stringify({task:"impulse-response",payload:e,"sample-rate":t,P:r});return await g()({method:"post",baseURL:y.PYTHON_SERVER_URL,url:"/task/impulse-response",headers:{"Content-Type":"application/json"},data:o}).then((function(e){n=e})).catch((function(e){throw e})),n.data["inverted-impulse-response"]};getVolumeCalibration=async e=>{let t,r;try{t=await this.asyncEmit("data",{task:"volume-calibration",data:e});const[n,o,i,a]=t.data.trim().split(",").map((e=>parseFloat(e.split(":")[1])));r=n}catch(e){throw new Error(e)}return r};asyncEmit=(e,t)=>new Promise(((r,n)=>{this.socket.emit(e,t),this.socket.on(e,(e=>{r(e)})),this.socket.on("error",(e=>{n(e)})),setTimeout(n,9e4)}))}var E=y,v=class extends class{#mediaRecorder;#recordedChunks=[];#audioBlob;#audioContext;#recordedSignals=[];sinkSamplingRate;#saveRecording=async()=>{const e=await this.#audioBlob.arrayBuffer(),t=(await this.#audioContext.decodeAudioData(e)).getChannelData(0);console.log(`Decoded audio buffer with ${t.length} samples`),this.#recordedSignals.push(Array.from(t))};#onRecorderDataAvailable=e=>{e.data&&e.data.size>0&&this.#recordedChunks.push(e.data)};#setMediaRecorder=e=>{this.#mediaRecorder=new MediaRecorder(e),this.#mediaRecorder.ondataavailable=e=>this.#onRecorderDataAvailable(e)};#setAudioContext=()=>{this.#audioContext=new(window.AudioContext||window.webkitAudioContext||window.audioContext)({sampleRate:this.sinkSamplingRate})};startRecording=async e=>{this.#setAudioContext(),this.#mediaRecorder||this.#setMediaRecorder(e),this.#recordedChunks=[],this.#mediaRecorder.start()};stopRecording=async()=>{await new Promise((e=>{this.#mediaRecorder.onstop=()=>{this.#audioBlob=new Blob(this.#recordedChunks,{type:"audio/wav; codecs=opus"}),e(this.#audioBlob)},this.#mediaRecorder.stop()})),await this.#saveRecording()};getLastRecordedSignal=()=>this.#recordedSignals[this.#recordedSignals.length-1];getAllRecordedSignals=()=>this.#recordedSignals;setSinkSamplingRate=e=>{this.sinkSamplingRate=e}}{constructor(e=1,t=1){super(),this.numCalibratingRounds=e,this.numCalibrationNodes=t,this.pyServerAPI=new E}#isCalibrating=!1;#sourceAudioContext;numCalibratingRounds;numCalibratingRoundsCompleted=0;sourceSamplingRate;numCalibrationNodes;calibrationNodes=[];localAudio;createLocalAudio=e=>{this.localAudio=document.createElement("audio"),this.localAudio.setAttribute("id","localAudio"),e.appendChild(this.localAudio)};calibrationSteps=async(e,t,r=(()=>{}),n=(()=>{}))=>{for(this.numCalibratingRoundsCompleted=0;!this.#isCalibrating&&this.numCalibratingRoundsCompleted<this.numCalibratingRounds;)await r(),await this.startRecording(e),console.log(`Calibration Round ${this.numCalibratingRoundsCompleted}`),await t(),console.log("Calibration Round Complete"),await this.stopRecording(),await n(),this.calibrationNodes=[],await p(2),this.numCalibratingRoundsCompleted+=1};getCalibrationStatus=()=>this.#isCalibrating;setSamplingRates=e=>{this.sinkSamplingRate=e,this.sourceSamplingRate=e,console.log("sampling rate",e)};sampleRatesSet=()=>this.sourceSamplingRate&&this.sinkSamplingRate;addCalibrationNode=e=>{this.calibrationNodes.push(e)};makeNewSourceAudioContext=()=>{const e={sampleRate:this.sourceSamplingRate};return this.#sourceAudioContext=new(window.AudioContext||window.webkitAudioContext||window.audioContext)(e),this.#sourceAudioContext};downloadData=()=>{const e=this.getAllRecordedSignals(),t=e.length-1;((e,t="recordedMLSignal.csv")=>{let r="data:text/csv;charset=utf-8,";e.forEach(((e,t)=>{r+=`${t},${e}\r\n`}));const n=encodeURI(r),o=document.createElement("a");o.setAttribute("href",n),o.setAttribute("download",t),document.body.appendChild(o),o.click()})(e[t],`recordedMLSignal_${t}.csv`)}},_=class extends v{constructor({download:e=!1,numCalibrationRounds:t=1,numCalibrationNodes:r=1}){super(t,r)}#CALIBRATION_TONE_FREQUENCY=1e3;#CALIBRATION_TONE_TYPE="sine";#CALIBRATION_TONE_DURATION=5;soundGainDBSPL=null;handleIncomingData=e=>{if(console.log("Received data: ",e),"soundGainDBSPL"!==e.type)throw new Error(`Unknown data type: ${e.type}`);this.soundGainDBSPL=e.value};#getTruncatedSignal=(e=3.5,t=4.5)=>{const r=Math.floor(e*this.sourceSamplingRate),n=Math.floor(t*this.sourceSamplingRate),o=Array.from(this.getLastRecordedSignal().slice(r,n));return(e=>{const t=new Set(e);1===t.size&&t.has(0)&&console.warn("The last capture failed, all recorded signal is zero",this.getAllRecordedSignals()),0===t.size&&console.warn("The last capture failed, no recorded signal")})(o),o};#createCalibrationNode=()=>{const e=this.makeNewSourceAudioContext(),t=e.createOscillator(),r=e.createGain();t.frequency.value=this.#CALIBRATION_TONE_FREQUENCY,t.type=this.#CALIBRATION_TONE_TYPE,r.gain.value=.04,t.connect(r),r.connect(e.destination),this.addCalibrationNode(t)};#playCalibrationAudio=async()=>{const e=this.#CALIBRATION_TONE_DURATION*this.numCalibrationNodes,t=1.2*e;for(let e=0;e<this.calibrationNodes.length;e+=1)this.calibrationNodes[e].start(e*this.#CALIBRATION_TONE_DURATION),this.calibrationNodes[e].stop(e*this.#CALIBRATION_TONE_DURATION+this.#CALIBRATION_TONE_DURATION);console.log(`Playing a buffer of ${e} seconds of audio`),console.log(`Waiting a total of ${t} seconds`),await p(t)};#sendToServerForProcessing=()=>{console.log("Sending data to server"),this.pyServerAPI.getVolumeCalibration({sampleRate:this.sourceSamplingRate,payload:this.#getTruncatedSignal()}).then((e=>{null===this.soundGainDBSPL&&(this.soundGainDBSPL=e)})).catch((e=>{console.warn(e)}))};startCalibration=async e=>{do{await this.calibrationSteps(e,this.#playCalibrationAudio,this.#createCalibrationNode,this.#sendToServerForProcessing)}while(null===this.soundGainDBSPL);return this.soundGainDBSPL}};const T=r(2058);class w{static N=18;#WASMInstance;#MLSGenInstance;constructor(e,t,r){this.#WASMInstance=e,console.warn("initializing MLSGen, need to manually garbage collect"),this.#MLSGenInstance=new this.#WASMInstance.MLSGen(w.N,t,r)}static factory=async(e,t)=>{if(void 0===e||void 0===t)throw new Error("sourceSamplingRate and sinkSamplingRate must be defined");return console.log(`sourceSamplingRate: ${e} sinkSamplingRate: ${t}`),new w(await T().then((e=>e)),e,t)};withGarbageCollection=async e=>{try{for(let t=0;t<e.length;t+=1){const[r,n]=e[t];await r(...n)}}catch(e){console.error(e)}finally{null!=this&&void 0!==this.#MLSGenInstance&&null!==this.#MLSGenInstance&&(this.#MLSGenInstance.Destruct(),this.#MLSGenInstance.delete(),console.warn("GARBAGE COLLECTION: deleted MLSGen"),this.#WASMInstance.doLeakCheck())}};getImpulseResponse=()=>this.#MLSGenInstance.getImpulseResponse();setRecordedSignals=e=>{const t=this.average(e),r=this.#MLSGenInstance.setRecordedSignalsMemoryView(t.byteLength);for(let e=0;e<t.length;e++)r[e]=t[e]};getMLS=()=>this.#MLSGenInstance.getMLS()}var b=w,O=class extends v{constructor({download:e=!1,numCalibrationRounds:t=5,numCalibrationNodes:r=4}){super(t,r),this.#download=e}#download;#mlsGenInterface;#mlsBufferView;invertedImpulseResponse=null;#P=Math.pow(2,18)-1;#afterRecord=()=>{this.#download&&this.downloadData()};sendToServerForProcessing=async e=>(console.log("Sending data to server"),this.pyServerAPI.getImpulseResponse({sampleRate:this.sourceSamplingRate||96e3,payload:e&&e.length>0?[l(e)]:this.getAllRecordedSignals(),P:this.#P}).then((e=>{null==this.invertedImpulseResponse&&(this.invertedImpulseResponse=e)})).catch((e=>{console.error(e)})));#createCalibrationNodeFromBuffer=e=>{const t=this.makeNewSourceAudioContext(),r=t.createBuffer(1,e.length,t.sampleRate),n=r.getChannelData(0);try{for(let t=0;t<e.length;t+=1)n[t]=e[t]}catch(e){console.error(e)}const o=t.createBufferSource();o.buffer=r,o.connect(t.destination),this.addCalibrationNode(o)};#setCalibrationNodesFromBuffer=(e=[this.#mlsBufferView])=>{if(this.#P=e[0].length,1===e.length)for(;this.calibrationNodes.length<this.numCalibrationNodes;)this.#createCalibrationNodeFromBuffer(e[0]);else{if(e.length!==this.numCalibrationNodes)throw new Error("The length of the data buffer array must be 1 or equal to this.numCalibrationNodes");e.forEach((e=>{this.#createCalibrationNodeFromBuffer(e)}))}};#playCalibrationAudio=async()=>{const{duration:e}=this.calibrationNodes[0].buffer,t=e*this.numCalibrationNodes,r=1.2*t;for(let t=0;t<this.calibrationNodes.length;t+=1)this.calibrationNodes[t].start(t*e);console.log(`Playing a buffer of ${t} seconds of audio`),console.log(`Waiting a total of ${r} seconds`),await p(r)};startCalibration=async e=>{for(await b.factory(this.sinkSamplingRate,this.sourceSamplingRate).then((e=>{this.#mlsGenInterface=e,this.#mlsBufferView=this.#mlsGenInterface.getMLS()}));this.numCalibratingRoundsCompleted<this.numCalibratingRounds;)await this.#mlsGenInterface.withGarbageCollection([[this.calibrationSteps,[e,this.#playCalibrationAudio,this.#setCalibrationNodesFromBuffer,this.#afterRecord]]]);return await this.sendToServerForProcessing(),this.invertedImpulseResponse}}}(),n}()}));