{"version":3,"file":"index.cjs.js","sources":["../wasm/middle-layer.js","../src/tagUtil.ts","../src/index.ts"],"sourcesContent":["// include: shell.js\n// The Module object: Our interface to the outside world. We import\n// and export values on it. There are various ways Module can be used:\n// 1. Not defined. We create it here\n// 2. A function parameter, function(Module) { ..generated code.. }\n// 3. pre-run appended it, var Module = {}; ..generated code..\n// 4. External script tag defines var Module.\n// We need to check if Module already exists (e.g. case 3 above).\n// Substitution will be replaced with actual code on later stage of the build,\n// this way Closure Compiler will not mangle it (e.g. case 4. above).\n// Note that if you want to run closure, and also to use Module\n// after the generated code, you will need to define var Module = {};\n// before the code. Then that object will be used in the code, and you\n// can continue to use Module afterwards as well.\nvar Module = typeof Module != 'undefined' ? Module : {};\n\n// --pre-jses are emitted after the Module integration code, so that they can\n// refer to Module (if they choose; they can also define Module)\n\n\n// Sometimes an existing Module object exists with properties\n// meant to overwrite the default module functionality. Here\n// we collect those properties and reapply _after_ we configure\n// the current environment's defaults to avoid having to be so\n// defensive during initialization.\nvar moduleOverrides = Object.assign({}, Module);\n\nvar arguments_ = [];\nvar thisProgram = './this.program';\nvar quit_ = (status, toThrow) => {\n throw toThrow;\n};\n\n// Determine the runtime environment we are in. You can customize this by\n// setting the ENVIRONMENT setting at compile time (see settings.js).\n\nvar ENVIRONMENT_IS_WEB = true;\nvar ENVIRONMENT_IS_WORKER = false;\nvar ENVIRONMENT_IS_NODE = false;\nvar ENVIRONMENT_IS_SHELL = false;\n\nif (Module['ENVIRONMENT']) {\n throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');\n}\n\n// `/` should be present at the end if `scriptDirectory` is not empty\nvar scriptDirectory = '';\nfunction locateFile(path) {\n if (Module['locateFile']) {\n return Module['locateFile'](path, scriptDirectory);\n }\n return scriptDirectory + path;\n}\n\n// Hooks that are implemented differently in different runtime environments.\nvar read_,\n readAsync,\n readBinary;\n\nif (ENVIRONMENT_IS_SHELL) {\n\n if ((typeof process == 'object' && typeof require === 'function') || typeof window == 'object' || typeof importScripts == 'function') 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?)');\n\n if (typeof read != 'undefined') {\n read_ = read;\n }\n\n readBinary = (f) => {\n if (typeof readbuffer == 'function') {\n return new Uint8Array(readbuffer(f));\n }\n let data = read(f, 'binary');\n assert(typeof data == 'object');\n return data;\n };\n\n readAsync = (f, onload, onerror) => {\n setTimeout(() => onload(readBinary(f)));\n };\n\n if (typeof clearTimeout == 'undefined') {\n globalThis.clearTimeout = (id) => {};\n }\n\n if (typeof setTimeout == 'undefined') {\n // spidermonkey lacks setTimeout but we use it above in readAsync.\n globalThis.setTimeout = (f) => (typeof f == 'function') ? f() : abort();\n }\n\n if (typeof scriptArgs != 'undefined') {\n arguments_ = scriptArgs;\n } else if (typeof arguments != 'undefined') {\n arguments_ = arguments;\n }\n\n if (typeof quit == 'function') {\n quit_ = (status, toThrow) => {\n // Unlike node which has process.exitCode, d8 has no such mechanism. So we\n // have no way to set the exit code and then let the program exit with\n // that code when it naturally stops running (say, when all setTimeouts\n // have completed). For that reason, we must call `quit` - the only way to\n // set the exit code - but quit also halts immediately. To increase\n // consistency with node (and the web) we schedule the actual quit call\n // using a setTimeout to give the current stack and any exception handlers\n // a chance to run. This enables features such as addOnPostRun (which\n // expected to be able to run code after main returns).\n setTimeout(() => {\n if (!(toThrow instanceof ExitStatus)) {\n let toLog = toThrow;\n if (toThrow && typeof toThrow == 'object' && toThrow.stack) {\n toLog = [toThrow, toThrow.stack];\n }\n err(`exiting due to exception: ${toLog}`);\n }\n quit(status);\n });\n throw toThrow;\n };\n }\n\n if (typeof print != 'undefined') {\n // Prefer to use print/printErr where they exist, as they usually work better.\n if (typeof console == 'undefined') console = /** @type{!Console} */({});\n console.log = /** @type{!function(this:Console, ...*): undefined} */ (print);\n console.warn = console.error = /** @type{!function(this:Console, ...*): undefined} */ (typeof printErr != 'undefined' ? printErr : print);\n }\n\n} else\n\n// Note that this includes Node.js workers when relevant (pthreads is enabled).\n// Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and\n// ENVIRONMENT_IS_NODE.\nif (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n if (ENVIRONMENT_IS_WORKER) { // Check worker, not web, since window could be polyfilled\n scriptDirectory = self.location.href;\n } else if (typeof document != 'undefined' && document.currentScript) { // web\n scriptDirectory = document.currentScript.src;\n }\n // blob urls look like blob:http://site.com/etc/etc and we cannot infer anything from them.\n // otherwise, slice off the final part of the url to find the script directory.\n // if scriptDirectory does not contain a slash, lastIndexOf will return -1,\n // and scriptDirectory will correctly be replaced with an empty string.\n // If scriptDirectory contains a query (starting with ?) or a fragment (starting with #),\n // they are removed because they could contain a slash.\n if (scriptDirectory.indexOf('blob:') !== 0) {\n scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, \"\").lastIndexOf('/')+1);\n } else {\n scriptDirectory = '';\n }\n\n if (!(typeof window == 'object' || typeof importScripts == 'function')) 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?)');\n\n // Differentiate the Web Worker from the Node Worker case, as reading must\n // be done differently.\n {\n// include: web_or_worker_shell_read.js\nread_ = (url) => {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.send(null);\n return xhr.responseText;\n }\n\n if (ENVIRONMENT_IS_WORKER) {\n readBinary = (url) => {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.responseType = 'arraybuffer';\n xhr.send(null);\n return new Uint8Array(/** @type{!ArrayBuffer} */(xhr.response));\n };\n }\n\n readAsync = (url, onload, onerror) => {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.onload = () => {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0\n onload(xhr.response);\n return;\n }\n onerror();\n };\n xhr.onerror = onerror;\n xhr.send(null);\n }\n\n// end include: web_or_worker_shell_read.js\n }\n} else\n{\n throw new Error('environment detection error');\n}\n\nvar out = Module['print'] || console.log.bind(console);\nvar err = Module['printErr'] || console.error.bind(console);\n\n// Merge back in the overrides\nObject.assign(Module, moduleOverrides);\n// Free the object hierarchy contained in the overrides, this lets the GC\n// reclaim data used e.g. in memoryInitializerRequest, which is a large typed array.\nmoduleOverrides = null;\ncheckIncomingModuleAPI();\n\n// Emit code to handle expected values on the Module object. This applies Module.x\n// to the proper local x. This has two benefits: first, we only emit it if it is\n// expected to arrive, and second, by using a local everywhere else that can be\n// minified.\n\nif (Module['arguments']) arguments_ = Module['arguments'];legacyModuleProp('arguments', 'arguments_');\n\nif (Module['thisProgram']) thisProgram = Module['thisProgram'];legacyModuleProp('thisProgram', 'thisProgram');\n\nif (Module['quit']) quit_ = Module['quit'];legacyModuleProp('quit', 'quit_');\n\n// perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message\n// Assertions on removed incoming Module JS APIs.\nassert(typeof Module['memoryInitializerPrefixURL'] == 'undefined', 'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead');\nassert(typeof Module['pthreadMainPrefixURL'] == 'undefined', 'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead');\nassert(typeof Module['cdInitializerPrefixURL'] == 'undefined', 'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead');\nassert(typeof Module['filePackagePrefixURL'] == 'undefined', 'Module.filePackagePrefixURL option was removed, use Module.locateFile instead');\nassert(typeof Module['read'] == 'undefined', 'Module.read option was removed (modify read_ in JS)');\nassert(typeof Module['readAsync'] == 'undefined', 'Module.readAsync option was removed (modify readAsync in JS)');\nassert(typeof Module['readBinary'] == 'undefined', 'Module.readBinary option was removed (modify readBinary in JS)');\nassert(typeof Module['setWindowTitle'] == 'undefined', 'Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)');\nassert(typeof Module['TOTAL_MEMORY'] == 'undefined', 'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY');\nlegacyModuleProp('asm', 'wasmExports');\nlegacyModuleProp('read', 'read_');\nlegacyModuleProp('readAsync', 'readAsync');\nlegacyModuleProp('readBinary', 'readBinary');\nlegacyModuleProp('setWindowTitle', 'setWindowTitle');\nvar IDBFS = 'IDBFS is no longer included by default; build with -lidbfs.js';\nvar PROXYFS = 'PROXYFS is no longer included by default; build with -lproxyfs.js';\nvar WORKERFS = 'WORKERFS is no longer included by default; build with -lworkerfs.js';\nvar FETCHFS = 'FETCHFS is no longer included by default; build with -lfetchfs.js';\nvar ICASEFS = 'ICASEFS is no longer included by default; build with -licasefs.js';\nvar JSFILEFS = 'JSFILEFS is no longer included by default; build with -ljsfilefs.js';\nvar OPFS = 'OPFS is no longer included by default; build with -lopfs.js';\n\nvar NODEFS = 'NODEFS is no longer included by default; build with -lnodefs.js';\n\nassert(!ENVIRONMENT_IS_WORKER, \"worker environment detected but not enabled at build time. Add 'worker' to `-sENVIRONMENT` to enable.\");\n\nassert(!ENVIRONMENT_IS_NODE, \"node environment detected but not enabled at build time. Add 'node' to `-sENVIRONMENT` to enable.\");\n\nassert(!ENVIRONMENT_IS_SHELL, \"shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable.\");\n\n\n// end include: shell.js\n// include: preamble.js\n// === Preamble library stuff ===\n\n// Documentation for the public APIs defined in this file must be updated in:\n// site/source/docs/api_reference/preamble.js.rst\n// A prebuilt local version of the documentation is available at:\n// site/build/text/docs/api_reference/preamble.js.txt\n// You can also build docs locally as HTML or other formats in site/\n// An online HTML version (which may be of a different version of Emscripten)\n// is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html\n\nvar wasmBinary; \nif (Module['wasmBinary']) wasmBinary = Module['wasmBinary'];legacyModuleProp('wasmBinary', 'wasmBinary');\n\nif (typeof WebAssembly != 'object') {\n abort('no native wasm support detected');\n}\n\n// Wasm globals\n\nvar wasmMemory;\n\n//========================================\n// Runtime essentials\n//========================================\n\n// whether we are quitting the application. no code should run after this.\n// set in exit() and abort()\nvar ABORT = false;\n\n// set by exit() and abort(). Passed to 'onExit' handler.\n// NOTE: This is also used as the process return code code in shell environments\n// but only when noExitRuntime is false.\nvar EXITSTATUS;\n\n// In STRICT mode, we only define assert() when ASSERTIONS is set. i.e. we\n// don't define it at all in release modes. This matches the behaviour of\n// MINIMAL_RUNTIME.\n// TODO(sbc): Make this the default even without STRICT enabled.\n/** @type {function(*, string=)} */\nfunction assert(condition, text) {\n if (!condition) {\n abort('Assertion failed' + (text ? ': ' + text : ''));\n }\n}\n\n// We used to include malloc/free by default in the past. Show a helpful error in\n// builds with assertions.\n\n// Memory management\n\nvar HEAP,\n/** @type {!Int8Array} */\n HEAP8,\n/** @type {!Uint8Array} */\n HEAPU8,\n/** @type {!Int16Array} */\n HEAP16,\n/** @type {!Uint16Array} */\n HEAPU16,\n/** @type {!Int32Array} */\n HEAP32,\n/** @type {!Uint32Array} */\n HEAPU32,\n/** @type {!Float32Array} */\n HEAPF32,\n/** @type {!Float64Array} */\n HEAPF64;\n\nfunction updateMemoryViews() {\n var b = wasmMemory.buffer;\n Module['HEAP8'] = HEAP8 = new Int8Array(b);\n Module['HEAP16'] = HEAP16 = new Int16Array(b);\n Module['HEAPU8'] = HEAPU8 = new Uint8Array(b);\n Module['HEAPU16'] = HEAPU16 = new Uint16Array(b);\n Module['HEAP32'] = HEAP32 = new Int32Array(b);\n Module['HEAPU32'] = HEAPU32 = new Uint32Array(b);\n Module['HEAPF32'] = HEAPF32 = new Float32Array(b);\n Module['HEAPF64'] = HEAPF64 = new Float64Array(b);\n}\n\nassert(!Module['STACK_SIZE'], 'STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time')\n\nassert(typeof Int32Array != 'undefined' && typeof Float64Array !== 'undefined' && Int32Array.prototype.subarray != undefined && Int32Array.prototype.set != undefined,\n 'JS engine does not provide full typed array support');\n\n// If memory is defined in wasm, the user can't provide it, or set INITIAL_MEMORY\nassert(!Module['wasmMemory'], 'Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally');\nassert(!Module['INITIAL_MEMORY'], 'Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically');\n\n// include: runtime_stack_check.js\n// Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode.\nfunction writeStackCookie() {\n var max = _emscripten_stack_get_end();\n assert((max & 3) == 0);\n // If the stack ends at address zero we write our cookies 4 bytes into the\n // stack. This prevents interference with SAFE_HEAP and ASAN which also\n // monitor writes to address zero.\n if (max == 0) {\n max += 4;\n }\n // The stack grow downwards towards _emscripten_stack_get_end.\n // We write cookies to the final two words in the stack and detect if they are\n // ever overwritten.\n HEAPU32[((max)>>2)] = 0x02135467;\n HEAPU32[(((max)+(4))>>2)] = 0x89BACDFE;\n // Also test the global address 0 for integrity.\n HEAPU32[((0)>>2)] = 1668509029;\n}\n\nfunction checkStackCookie() {\n if (ABORT) return;\n var max = _emscripten_stack_get_end();\n // See writeStackCookie().\n if (max == 0) {\n max += 4;\n }\n var cookie1 = HEAPU32[((max)>>2)];\n var cookie2 = HEAPU32[(((max)+(4))>>2)];\n if (cookie1 != 0x02135467 || cookie2 != 0x89BACDFE) {\n abort(`Stack overflow! Stack cookie has been overwritten at ${ptrToString(max)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ptrToString(cookie2)} ${ptrToString(cookie1)}`);\n }\n // Also test the global address 0 for integrity.\n if (HEAPU32[((0)>>2)] != 0x63736d65 /* 'emsc' */) {\n abort('Runtime error: The application has corrupted its heap memory area (address zero)!');\n }\n}\n// end include: runtime_stack_check.js\n// include: runtime_assertions.js\n// Endianness check\n(function() {\n var h16 = new Int16Array(1);\n var h8 = new Int8Array(h16.buffer);\n h16[0] = 0x6373;\n if (h8[0] !== 0x73 || h8[1] !== 0x63) throw 'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)';\n})();\n\n// end include: runtime_assertions.js\nvar __ATPRERUN__ = []; // functions called before the runtime is initialized\nvar __ATINIT__ = []; // functions called during startup\nvar __ATEXIT__ = []; // functions called during shutdown\nvar __ATPOSTRUN__ = []; // functions called after the main() is called\n\nvar runtimeInitialized = false;\n\nfunction preRun() {\n if (Module['preRun']) {\n if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];\n while (Module['preRun'].length) {\n addOnPreRun(Module['preRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPRERUN__);\n}\n\nfunction initRuntime() {\n assert(!runtimeInitialized);\n runtimeInitialized = true;\n\n checkStackCookie();\n\n \n callRuntimeCallbacks(__ATINIT__);\n}\n\nfunction postRun() {\n checkStackCookie();\n\n if (Module['postRun']) {\n if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];\n while (Module['postRun'].length) {\n addOnPostRun(Module['postRun'].shift());\n }\n }\n\n callRuntimeCallbacks(__ATPOSTRUN__);\n}\n\nfunction addOnPreRun(cb) {\n __ATPRERUN__.unshift(cb);\n}\n\nfunction addOnInit(cb) {\n __ATINIT__.unshift(cb);\n}\n\nfunction addOnExit(cb) {\n}\n\nfunction addOnPostRun(cb) {\n __ATPOSTRUN__.unshift(cb);\n}\n\n// include: runtime_math.js\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32\n\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc\n\nassert(Math.imul, 'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');\nassert(Math.fround, 'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');\nassert(Math.clz32, 'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');\nassert(Math.trunc, 'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill');\n// end include: runtime_math.js\n// A counter of dependencies for calling run(). If we need to\n// do asynchronous work before running, increment this and\n// decrement it. Incrementing must happen in a place like\n// Module.preRun (used by emcc to add file preloading).\n// Note that you can add dependencies in preRun, even though\n// it happens right before run - run will be postponed until\n// the dependencies are met.\nvar runDependencies = 0;\nvar runDependencyWatcher = null;\nvar dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled\nvar runDependencyTracking = {};\n\nfunction getUniqueRunDependency(id) {\n var orig = id;\n while (1) {\n if (!runDependencyTracking[id]) return id;\n id = orig + Math.random();\n }\n}\n\nfunction addRunDependency(id) {\n runDependencies++;\n\n Module['monitorRunDependencies']?.(runDependencies);\n\n if (id) {\n assert(!runDependencyTracking[id]);\n runDependencyTracking[id] = 1;\n if (runDependencyWatcher === null && typeof setInterval != 'undefined') {\n // Check for missing dependencies every few seconds\n runDependencyWatcher = setInterval(() => {\n if (ABORT) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n return;\n }\n var shown = false;\n for (var dep in runDependencyTracking) {\n if (!shown) {\n shown = true;\n err('still waiting on run dependencies:');\n }\n err(`dependency: ${dep}`);\n }\n if (shown) {\n err('(end of list)');\n }\n }, 10000);\n }\n } else {\n err('warning: run dependency added without ID');\n }\n}\n\nfunction removeRunDependency(id) {\n runDependencies--;\n\n Module['monitorRunDependencies']?.(runDependencies);\n\n if (id) {\n assert(runDependencyTracking[id]);\n delete runDependencyTracking[id];\n } else {\n err('warning: run dependency removed without ID');\n }\n if (runDependencies == 0) {\n if (runDependencyWatcher !== null) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n }\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback(); // can add another dependenciesFulfilled\n }\n }\n}\n\n/** @param {string|number=} what */\nfunction abort(what) {\n Module['onAbort']?.(what);\n\n what = 'Aborted(' + what + ')';\n // TODO(sbc): Should we remove printing and leave it up to whoever\n // catches the exception?\n err(what);\n\n ABORT = true;\n EXITSTATUS = 1;\n\n // Use a wasm runtime error, because a JS error might be seen as a foreign\n // exception, which means we'd run destructors on it. We need the error to\n // simply make the program stop.\n // FIXME This approach does not work in Wasm EH because it currently does not assume\n // all RuntimeErrors are from traps; it decides whether a RuntimeError is from\n // a trap or not based on a hidden field within the object. So at the moment\n // we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that\n // allows this in the wasm spec.\n\n // Suppress closure compiler warning here. Closure compiler's builtin extern\n // defintion for WebAssembly.RuntimeError claims it takes no arguments even\n // though it can.\n // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed.\n /** @suppress {checkTypes} */\n var e = new WebAssembly.RuntimeError(what);\n\n // Throw the error whether or not MODULARIZE is set because abort is used\n // in code paths apart from instantiation where an exception is expected\n // to be thrown when abort is called.\n throw e;\n}\n\n// include: memoryprofiler.js\n// end include: memoryprofiler.js\n// show errors on likely calls to FS when it was not included\nvar FS = {\n error() {\n abort('Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM');\n },\n init() { FS.error() },\n createDataFile() { FS.error() },\n createPreloadedFile() { FS.error() },\n createLazyFile() { FS.error() },\n open() { FS.error() },\n mkdev() { FS.error() },\n registerDevice() { FS.error() },\n analyzePath() { FS.error() },\n\n ErrnoError() { FS.error() },\n};\nModule['FS_createDataFile'] = FS.createDataFile;\nModule['FS_createPreloadedFile'] = FS.createPreloadedFile;\n\n// include: URIUtils.js\n// Prefix of data URIs emitted by SINGLE_FILE and related options.\nvar dataURIPrefix = 'data:application/octet-stream;base64,';\n\n/**\n * Indicates whether filename is a base64 data URI.\n * @noinline\n */\nvar isDataURI = (filename) => filename.startsWith(dataURIPrefix);\n\n/**\n * Indicates whether filename is delivered via file protocol (as opposed to http/https)\n * @noinline\n */\nvar isFileURI = (filename) => filename.startsWith('file://');\n// end include: URIUtils.js\nfunction createExportWrapper(name) {\n return function() {\n assert(runtimeInitialized, `native function \\`${name}\\` called before runtime initialization`);\n var f = wasmExports[name];\n assert(f, `exported native function \\`${name}\\` not found`);\n return f.apply(null, arguments);\n };\n}\n\n// include: runtime_exceptions.js\n// end include: runtime_exceptions.js\nvar wasmBinaryFile;\n wasmBinaryFile = 'middle-layer.wasm';\n if (!isDataURI(wasmBinaryFile)) {\n wasmBinaryFile = locateFile(wasmBinaryFile);\n }\n\nfunction getBinarySync(file) {\n if (file == wasmBinaryFile && wasmBinary) {\n return new Uint8Array(wasmBinary);\n }\n if (readBinary) {\n return readBinary(file);\n }\n throw \"both async and sync fetching of the wasm failed\";\n}\n\nfunction getBinaryPromise(binaryFile) {\n // If we don't have the binary yet, try to load it asynchronously.\n // Fetch has some additional restrictions over XHR, like it can't be used on a file:// url.\n // See https://github.com/github/fetch/pull/92#issuecomment-140665932\n // Cordova or Electron apps are typically loaded from a file:// url.\n // So use fetch if it is available and the url is not a file, otherwise fall back to XHR.\n if (!wasmBinary\n && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {\n if (typeof fetch == 'function'\n ) {\n return fetch(binaryFile, { credentials: 'same-origin' }).then((response) => {\n if (!response['ok']) {\n throw \"failed to load wasm binary file at '\" + binaryFile + \"'\";\n }\n return response['arrayBuffer']();\n }).catch(() => getBinarySync(binaryFile));\n }\n }\n\n // Otherwise, getBinarySync should be able to get it synchronously\n return Promise.resolve().then(() => getBinarySync(binaryFile));\n}\n\nfunction instantiateArrayBuffer(binaryFile, imports, receiver) {\n return getBinaryPromise(binaryFile).then((binary) => {\n return WebAssembly.instantiate(binary, imports);\n }).then((instance) => {\n return instance;\n }).then(receiver, (reason) => {\n err(`failed to asynchronously prepare wasm: ${reason}`);\n\n // Warn on some common problems.\n if (isFileURI(wasmBinaryFile)) {\n err(`warning: Loading from a file URI (${wasmBinaryFile}) 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`);\n }\n abort(reason);\n });\n}\n\nfunction instantiateAsync(binary, binaryFile, imports, callback) {\n if (!binary &&\n typeof WebAssembly.instantiateStreaming == 'function' &&\n !isDataURI(binaryFile) &&\n typeof fetch == 'function') {\n return fetch(binaryFile, { credentials: 'same-origin' }).then((response) => {\n // Suppress closure warning here since the upstream definition for\n // instantiateStreaming only allows Promise rather than\n // an actual Response.\n // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure is fixed.\n /** @suppress {checkTypes} */\n var result = WebAssembly.instantiateStreaming(response, imports);\n\n return result.then(\n callback,\n function(reason) {\n // We expect the most common failure cause to be a bad MIME type for the binary,\n // in which case falling back to ArrayBuffer instantiation should work.\n err(`wasm streaming compile failed: ${reason}`);\n err('falling back to ArrayBuffer instantiation');\n return instantiateArrayBuffer(binaryFile, imports, callback);\n });\n });\n }\n return instantiateArrayBuffer(binaryFile, imports, callback);\n}\n\n// Create the wasm instance.\n// Receives the wasm imports, returns the exports.\nfunction createWasm() {\n // prepare imports\n var info = {\n 'env': wasmImports,\n 'wasi_snapshot_preview1': wasmImports,\n };\n // Load the wasm module and create an instance of using native support in the JS engine.\n // handle a generated wasm instance, receiving its exports and\n // performing other necessary setup\n /** @param {WebAssembly.Module=} module*/\n function receiveInstance(instance, module) {\n wasmExports = instance.exports;\n\n \n\n wasmMemory = wasmExports['memory'];\n \n assert(wasmMemory, \"memory not found in wasm exports\");\n // This assertion doesn't hold when emscripten is run in --post-link\n // mode.\n // TODO(sbc): Read INITIAL_MEMORY out of the wasm file in post-link mode.\n //assert(wasmMemory.buffer.byteLength === 16777216);\n updateMemoryViews();\n\n addOnInit(wasmExports['__wasm_call_ctors']);\n\n removeRunDependency('wasm-instantiate');\n return wasmExports;\n }\n // wait for the pthread pool (if any)\n addRunDependency('wasm-instantiate');\n\n // Prefer streaming instantiation if available.\n // Async compilation can be confusing when an error on the page overwrites Module\n // (for example, if the order of elements is wrong, and the one defining Module is\n // later), so we save Module and check it later.\n var trueModule = Module;\n function receiveInstantiationResult(result) {\n // 'result' is a ResultObject object which has both the module and instance.\n // receiveInstance() will swap in the exports (to Module.asm) so they can be called\n assert(Module === trueModule, 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?');\n trueModule = null;\n // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.\n // When the regression is fixed, can restore the above PTHREADS-enabled path.\n receiveInstance(result['instance']);\n }\n\n // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback\n // to manually instantiate the Wasm module themselves. This allows pages to\n // run the instantiation parallel to any other async startup actions they are\n // performing.\n // Also pthreads and wasm workers initialize the wasm instance through this\n // path.\n if (Module['instantiateWasm']) {\n\n try {\n return Module['instantiateWasm'](info, receiveInstance);\n } catch(e) {\n err(`Module.instantiateWasm callback failed with error: ${e}`);\n return false;\n }\n }\n\n instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult);\n return {}; // no exports yet; we'll fill them in later\n}\n\n// Globals used by JS i64 conversions (see makeSetValue)\nvar tempDouble;\nvar tempI64;\n\n// include: runtime_debug.js\nfunction legacyModuleProp(prop, newName, incomming=true) {\n if (!Object.getOwnPropertyDescriptor(Module, prop)) {\n Object.defineProperty(Module, prop, {\n configurable: true,\n get() {\n let extra = incomming ? ' (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' : '';\n abort(`\\`Module.${prop}\\` has been replaced by \\`${newName}\\`` + extra);\n\n }\n });\n }\n}\n\nfunction ignoredModuleProp(prop) {\n if (Object.getOwnPropertyDescriptor(Module, prop)) {\n abort(`\\`Module.${prop}\\` was supplied but \\`${prop}\\` not included in INCOMING_MODULE_JS_API`);\n }\n}\n\n// forcing the filesystem exports a few things by default\nfunction isExportedByForceFilesystem(name) {\n return name === 'FS_createPath' ||\n name === 'FS_createDataFile' ||\n name === 'FS_createPreloadedFile' ||\n name === 'FS_unlink' ||\n name === 'addRunDependency' ||\n // The old FS has some functionality that WasmFS lacks.\n name === 'FS_createLazyFile' ||\n name === 'FS_createDevice' ||\n name === 'removeRunDependency';\n}\n\nfunction missingGlobal(sym, msg) {\n if (typeof globalThis !== 'undefined') {\n Object.defineProperty(globalThis, sym, {\n configurable: true,\n get() {\n warnOnce(`\\`${sym}\\` is not longer defined by emscripten. ${msg}`);\n return undefined;\n }\n });\n }\n}\n\nmissingGlobal('buffer', 'Please use HEAP8.buffer or wasmMemory.buffer');\nmissingGlobal('asm', 'Please use wasmExports instead');\n\nfunction missingLibrarySymbol(sym) {\n if (typeof globalThis !== 'undefined' && !Object.getOwnPropertyDescriptor(globalThis, sym)) {\n Object.defineProperty(globalThis, sym, {\n configurable: true,\n get() {\n // Can't `abort()` here because it would break code that does runtime\n // checks. e.g. `if (typeof SDL === 'undefined')`.\n var msg = `\\`${sym}\\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`;\n // DEFAULT_LIBRARY_FUNCS_TO_INCLUDE requires the name as it appears in\n // library.js, which means $name for a JS name with no prefix, or name\n // for a JS name like _name.\n var librarySymbol = sym;\n if (!librarySymbol.startsWith('_')) {\n librarySymbol = '$' + sym;\n }\n msg += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${librarySymbol}')`;\n if (isExportedByForceFilesystem(sym)) {\n msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you';\n }\n warnOnce(msg);\n return undefined;\n }\n });\n }\n // Any symbol that is not included from the JS libary is also (by definition)\n // not exported on the Module object.\n unexportedRuntimeSymbol(sym);\n}\n\nfunction unexportedRuntimeSymbol(sym) {\n if (!Object.getOwnPropertyDescriptor(Module, sym)) {\n Object.defineProperty(Module, sym, {\n configurable: true,\n get() {\n var msg = `'${sym}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;\n if (isExportedByForceFilesystem(sym)) {\n msg += '. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you';\n }\n abort(msg);\n }\n });\n }\n}\n\n// Used by XXXXX_DEBUG settings to output debug messages.\nfunction dbg(text) {\n // TODO(sbc): Make this configurable somehow. Its not always convenient for\n // logging to show up as warnings.\n console.warn.apply(console, arguments);\n}\n// end include: runtime_debug.js\n// === Body ===\n\n// end include: preamble.js\n\n /** @constructor */\n function ExitStatus(status) {\n this.name = 'ExitStatus';\n this.message = `Program terminated with exit(${status})`;\n this.status = status;\n }\n\n var callRuntimeCallbacks = (callbacks) => {\n while (callbacks.length > 0) {\n // Pass the module as the first argument.\n callbacks.shift()(Module);\n }\n };\n\n \n /**\n * @param {number} ptr\n * @param {string} type\n */\n function getValue(ptr, type = 'i8') {\n if (type.endsWith('*')) type = '*';\n switch (type) {\n case 'i1': return HEAP8[((ptr)>>0)];\n case 'i8': return HEAP8[((ptr)>>0)];\n case 'i16': return HEAP16[((ptr)>>1)];\n case 'i32': return HEAP32[((ptr)>>2)];\n case 'i64': abort('to do getValue(i64) use WASM_BIGINT');\n case 'float': return HEAPF32[((ptr)>>2)];\n case 'double': return HEAPF64[((ptr)>>3)];\n case '*': return HEAPU32[((ptr)>>2)];\n default: abort(`invalid type for getValue: ${type}`);\n }\n }\n\n var noExitRuntime = Module['noExitRuntime'] || true;\n\n var ptrToString = (ptr) => {\n assert(typeof ptr === 'number');\n // With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned.\n ptr >>>= 0;\n return '0x' + ptr.toString(16).padStart(8, '0');\n };\n\n \n /**\n * @param {number} ptr\n * @param {number} value\n * @param {string} type\n */\n function setValue(ptr, value, type = 'i8') {\n if (type.endsWith('*')) type = '*';\n switch (type) {\n case 'i1': HEAP8[((ptr)>>0)] = value; break;\n case 'i8': HEAP8[((ptr)>>0)] = value; break;\n case 'i16': HEAP16[((ptr)>>1)] = value; break;\n case 'i32': HEAP32[((ptr)>>2)] = value; break;\n case 'i64': abort('to do setValue(i64) use WASM_BIGINT');\n case 'float': HEAPF32[((ptr)>>2)] = value; break;\n case 'double': HEAPF64[((ptr)>>3)] = value; break;\n case '*': HEAPU32[((ptr)>>2)] = value; break;\n default: abort(`invalid type for setValue: ${type}`);\n }\n }\n\n var warnOnce = (text) => {\n warnOnce.shown ||= {};\n if (!warnOnce.shown[text]) {\n warnOnce.shown[text] = 1;\n err(text);\n }\n };\n\n var _emscripten_date_now = () => Date.now();\n\n var _emscripten_memcpy_js = (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num);\n\n var getHeapMax = () =>\n HEAPU8.length;\n \n var abortOnCannotGrowMemory = (requestedSize) => {\n abort(`Cannot enlarge memory arrays to size ${requestedSize} bytes (OOM). Either (1) compile with -sINITIAL_MEMORY=X with X higher than the current value ${HEAP8.length}, (2) compile with -sALLOW_MEMORY_GROWTH which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -sABORTING_MALLOC=0`);\n };\n var _emscripten_resize_heap = (requestedSize) => {\n var oldSize = HEAPU8.length;\n // With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned.\n requestedSize >>>= 0;\n abortOnCannotGrowMemory(requestedSize);\n };\n\n \n var runtimeKeepaliveCounter = 0;\n var keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0;\n \n var UTF8Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf8') : undefined;\n \n /**\n * Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given\n * array that contains uint8 values, returns a copy of that string as a\n * Javascript String object.\n * heapOrArray is either a regular array, or a JavaScript typed array view.\n * @param {number} idx\n * @param {number=} maxBytesToRead\n * @return {string}\n */\n var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => {\n var endIdx = idx + maxBytesToRead;\n var endPtr = idx;\n // TextDecoder needs to know the byte length in advance, it doesn't stop on\n // null terminator by itself. Also, use the length info to avoid running tiny\n // strings through TextDecoder, since .subarray() allocates garbage.\n // (As a tiny code save trick, compare endPtr against endIdx using a negation,\n // so that undefined means Infinity)\n while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;\n \n if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {\n return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));\n }\n var str = '';\n // If building with TextDecoder, we have already computed the string length\n // above, so test loop end condition against that\n while (idx < endPtr) {\n // For UTF8 byte structure, see:\n // http://en.wikipedia.org/wiki/UTF-8#Description\n // https://www.ietf.org/rfc/rfc2279.txt\n // https://tools.ietf.org/html/rfc3629\n var u0 = heapOrArray[idx++];\n if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; }\n var u1 = heapOrArray[idx++] & 63;\n if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode(((u0 & 31) << 6) | u1); continue; }\n var u2 = heapOrArray[idx++] & 63;\n if ((u0 & 0xF0) == 0xE0) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n if ((u0 & 0xF8) != 0xF0) warnOnce('Invalid UTF-8 leading byte ' + ptrToString(u0) + ' encountered when deserializing a UTF-8 string in wasm memory to a JS string!');\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63);\n }\n \n if (u0 < 0x10000) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 0x10000;\n str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));\n }\n }\n return str;\n };\n \n /**\n * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the\n * emscripten HEAP, returns a copy of that string as a Javascript String object.\n *\n * @param {number} ptr\n * @param {number=} maxBytesToRead - An optional length that specifies the\n * maximum number of bytes to read. You can omit this parameter to scan the\n * string until the first 0 byte. If maxBytesToRead is passed, and the string\n * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the\n * string will cut short at that byte index (i.e. maxBytesToRead will not\n * produce a string of exact length [ptr, ptr+maxBytesToRead[) N.B. mixing\n * frequent uses of UTF8ToString() with and without maxBytesToRead may throw\n * JS JIT optimizations off, so it is worth to consider consistently using one\n * @return {string}\n */\n var UTF8ToString = (ptr, maxBytesToRead) => {\n assert(typeof ptr == 'number', `UTF8ToString expects a number (got ${typeof ptr})`);\n return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : '';\n };\n var SYSCALLS = {\n varargs:undefined,\n get() {\n assert(SYSCALLS.varargs != undefined);\n // the `+` prepended here is necessary to convince the JSCompiler that varargs is indeed a number.\n var ret = HEAP32[((+SYSCALLS.varargs)>>2)];\n SYSCALLS.varargs += 4;\n return ret;\n },\n getp() { return SYSCALLS.get() },\n getStr(ptr) {\n var ret = UTF8ToString(ptr);\n return ret;\n },\n };\n var _proc_exit = (code) => {\n EXITSTATUS = code;\n if (!keepRuntimeAlive()) {\n Module['onExit']?.(code);\n ABORT = true;\n }\n quit_(code, new ExitStatus(code));\n };\n \n /** @suppress {duplicate } */\n /** @param {boolean|number=} implicit */\n var exitJS = (status, implicit) => {\n EXITSTATUS = status;\n \n checkUnflushedContent();\n \n // if exit() was called explicitly, warn the user if the runtime isn't actually being shut down\n if (keepRuntimeAlive() && !implicit) {\n var msg = `program exited (with status: ${status}), but keepRuntimeAlive() is set (counter=${runtimeKeepaliveCounter}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`;\n err(msg);\n }\n \n _proc_exit(status);\n };\n var _exit = exitJS;\n\n var lengthBytesUTF8 = (str) => {\n var len = 0;\n for (var i = 0; i < str.length; ++i) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code\n // unit, not a Unicode code point of the character! So decode\n // UTF16->UTF32->UTF8.\n // See http://unicode.org/faq/utf_bom.html#utf16-3\n var c = str.charCodeAt(i); // possibly a lead surrogate\n if (c <= 0x7F) {\n len++;\n } else if (c <= 0x7FF) {\n len += 2;\n } else if (c >= 0xD800 && c <= 0xDFFF) {\n len += 4; ++i;\n } else {\n len += 3;\n }\n }\n return len;\n };\n \n var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {\n assert(typeof str === 'string', `stringToUTF8Array expects a string (got ${typeof str})`);\n // Parameter maxBytesToWrite is not optional. Negative values, 0, null,\n // undefined and false each don't write out any bytes.\n if (!(maxBytesToWrite > 0))\n return 0;\n \n var startIdx = outIdx;\n var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator.\n for (var i = 0; i < str.length; ++i) {\n // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code\n // unit, not a Unicode code point of the character! So decode\n // UTF16->UTF32->UTF8.\n // See http://unicode.org/faq/utf_bom.html#utf16-3\n // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description\n // and https://www.ietf.org/rfc/rfc2279.txt\n // and https://tools.ietf.org/html/rfc3629\n var u = str.charCodeAt(i); // possibly a lead surrogate\n if (u >= 0xD800 && u <= 0xDFFF) {\n var u1 = str.charCodeAt(++i);\n u = 0x10000 + ((u & 0x3FF) << 10) | (u1 & 0x3FF);\n }\n if (u <= 0x7F) {\n if (outIdx >= endIdx) break;\n heap[outIdx++] = u;\n } else if (u <= 0x7FF) {\n if (outIdx + 1 >= endIdx) break;\n heap[outIdx++] = 0xC0 | (u >> 6);\n heap[outIdx++] = 0x80 | (u & 63);\n } else if (u <= 0xFFFF) {\n if (outIdx + 2 >= endIdx) break;\n heap[outIdx++] = 0xE0 | (u >> 12);\n heap[outIdx++] = 0x80 | ((u >> 6) & 63);\n heap[outIdx++] = 0x80 | (u & 63);\n } else {\n if (outIdx + 3 >= endIdx) break;\n if (u > 0x10FFFF) warnOnce('Invalid Unicode code point ' + ptrToString(u) + ' encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).');\n heap[outIdx++] = 0xF0 | (u >> 18);\n heap[outIdx++] = 0x80 | ((u >> 12) & 63);\n heap[outIdx++] = 0x80 | ((u >> 6) & 63);\n heap[outIdx++] = 0x80 | (u & 63);\n }\n }\n // Null-terminate the pointer to the buffer.\n heap[outIdx] = 0;\n return outIdx - startIdx;\n };\n var stringToUTF8 = (str, outPtr, maxBytesToWrite) => {\n assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');\n return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);\n };\n \n /** @suppress {duplicate } */\n var stringToNewUTF8 = (str) => {\n var size = lengthBytesUTF8(str) + 1;\n var ret = _malloc(size);\n if (ret) stringToUTF8(str, ret, size);\n return ret;\n };\n var allocateUTF8 = stringToNewUTF8;\n\nfunction checkIncomingModuleAPI() {\n ignoredModuleProp('fetchSettings');\n}\nvar wasmImports = {\n /** @export */\n emscripten_date_now: _emscripten_date_now,\n /** @export */\n emscripten_memcpy_js: _emscripten_memcpy_js,\n /** @export */\n emscripten_resize_heap: _emscripten_resize_heap,\n /** @export */\n exit: _exit\n};\nvar wasmExports = createWasm();\nvar ___wasm_call_ctors = createExportWrapper('__wasm_call_ctors');\nvar _malloc = Module['_malloc'] = createExportWrapper('malloc');\nvar _free = Module['_free'] = createExportWrapper('free');\nvar _initEncoder = Module['_initEncoder'] = createExportWrapper('initEncoder');\nvar _clearEncoder = Module['_clearEncoder'] = createExportWrapper('clearEncoder');\nvar _createAnalysisBuffer = Module['_createAnalysisBuffer'] = createExportWrapper('createAnalysisBuffer');\nvar _processEncoding = Module['_processEncoding'] = createExportWrapper('processEncoding');\nvar _getEncodedDataLen = Module['_getEncodedDataLen'] = createExportWrapper('getEncodedDataLen');\nvar _transferEncodedData = Module['_transferEncodedData'] = createExportWrapper('transferEncodedData');\nvar _decodeComments = Module['_decodeComments'] = createExportWrapper('decodeComments');\nvar ___errno_location = createExportWrapper('__errno_location');\nvar _fflush = Module['_fflush'] = createExportWrapper('fflush');\nvar _emscripten_stack_init = () => (_emscripten_stack_init = wasmExports['emscripten_stack_init'])();\nvar _emscripten_stack_get_free = () => (_emscripten_stack_get_free = wasmExports['emscripten_stack_get_free'])();\nvar _emscripten_stack_get_base = () => (_emscripten_stack_get_base = wasmExports['emscripten_stack_get_base'])();\nvar _emscripten_stack_get_end = () => (_emscripten_stack_get_end = wasmExports['emscripten_stack_get_end'])();\nvar stackSave = createExportWrapper('stackSave');\nvar stackRestore = createExportWrapper('stackRestore');\nvar stackAlloc = createExportWrapper('stackAlloc');\nvar _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports['emscripten_stack_get_current'])();\n\n\n// include: postamble.js\n// === Auto-generated postamble setup entry stuff ===\n\nModule['UTF8ToString'] = UTF8ToString;\nModule['allocateUTF8'] = allocateUTF8;\nvar missingLibrarySymbols = [\n 'writeI53ToI64',\n 'writeI53ToI64Clamped',\n 'writeI53ToI64Signaling',\n 'writeI53ToU64Clamped',\n 'writeI53ToU64Signaling',\n 'readI53FromI64',\n 'readI53FromU64',\n 'convertI32PairToI53',\n 'convertI32PairToI53Checked',\n 'convertU32PairToI53',\n 'zeroMemory',\n 'growMemory',\n 'isLeapYear',\n 'ydayFromDate',\n 'arraySum',\n 'addDays',\n 'setErrNo',\n 'inetPton4',\n 'inetNtop4',\n 'inetPton6',\n 'inetNtop6',\n 'readSockaddr',\n 'writeSockaddr',\n 'getHostByName',\n 'initRandomFill',\n 'randomFill',\n 'getCallstack',\n 'emscriptenLog',\n 'convertPCtoSourceLocation',\n 'readEmAsmArgs',\n 'jstoi_q',\n 'jstoi_s',\n 'getExecutableName',\n 'listenOnce',\n 'autoResumeAudioContext',\n 'dynCallLegacy',\n 'getDynCaller',\n 'dynCall',\n 'handleException',\n 'runtimeKeepalivePush',\n 'runtimeKeepalivePop',\n 'callUserCallback',\n 'maybeExit',\n 'asmjsMangle',\n 'asyncLoad',\n 'alignMemory',\n 'mmapAlloc',\n 'handleAllocatorInit',\n 'HandleAllocator',\n 'getNativeTypeSize',\n 'STACK_SIZE',\n 'STACK_ALIGN',\n 'POINTER_SIZE',\n 'ASSERTIONS',\n 'getCFunc',\n 'ccall',\n 'cwrap',\n 'uleb128Encode',\n 'sigToWasmTypes',\n 'generateFuncType',\n 'convertJsFunctionToWasm',\n 'getEmptyTableSlot',\n 'updateTableMap',\n 'getFunctionAddress',\n 'addFunction',\n 'removeFunction',\n 'reallyNegative',\n 'unSign',\n 'strLen',\n 'reSign',\n 'formatString',\n 'intArrayFromString',\n 'intArrayToString',\n 'AsciiToString',\n 'stringToAscii',\n 'UTF16ToString',\n 'stringToUTF16',\n 'lengthBytesUTF16',\n 'UTF32ToString',\n 'stringToUTF32',\n 'lengthBytesUTF32',\n 'stringToUTF8OnStack',\n 'writeArrayToMemory',\n 'registerKeyEventCallback',\n 'maybeCStringToJsString',\n 'findEventTarget',\n 'findCanvasEventTarget',\n 'getBoundingClientRect',\n 'fillMouseEventData',\n 'registerMouseEventCallback',\n 'registerWheelEventCallback',\n 'registerUiEventCallback',\n 'registerFocusEventCallback',\n 'fillDeviceOrientationEventData',\n 'registerDeviceOrientationEventCallback',\n 'fillDeviceMotionEventData',\n 'registerDeviceMotionEventCallback',\n 'screenOrientation',\n 'fillOrientationChangeEventData',\n 'registerOrientationChangeEventCallback',\n 'fillFullscreenChangeEventData',\n 'registerFullscreenChangeEventCallback',\n 'JSEvents_requestFullscreen',\n 'JSEvents_resizeCanvasForFullscreen',\n 'registerRestoreOldStyle',\n 'hideEverythingExceptGivenElement',\n 'restoreHiddenElements',\n 'setLetterbox',\n 'softFullscreenResizeWebGLRenderTarget',\n 'doRequestFullscreen',\n 'fillPointerlockChangeEventData',\n 'registerPointerlockChangeEventCallback',\n 'registerPointerlockErrorEventCallback',\n 'requestPointerLock',\n 'fillVisibilityChangeEventData',\n 'registerVisibilityChangeEventCallback',\n 'registerTouchEventCallback',\n 'fillGamepadEventData',\n 'registerGamepadEventCallback',\n 'disableGamepadApiIfItThrows',\n 'registerBeforeUnloadEventCallback',\n 'fillBatteryEventData',\n 'battery',\n 'registerBatteryEventCallback',\n 'setCanvasElementSize',\n 'getCanvasElementSize',\n 'demangle',\n 'demangleAll',\n 'jsStackTrace',\n 'stackTrace',\n 'getEnvStrings',\n 'checkWasiClock',\n 'flush_NO_FILESYSTEM',\n 'wasiRightsToMuslOFlags',\n 'wasiOFlagsToMuslOFlags',\n 'createDyncallWrapper',\n 'safeSetTimeout',\n 'setImmediateWrapped',\n 'clearImmediateWrapped',\n 'polyfillSetImmediate',\n 'getPromise',\n 'makePromise',\n 'idsToPromises',\n 'makePromiseCallback',\n 'ExceptionInfo',\n 'findMatchingCatch',\n 'Browser_asyncPrepareDataCounter',\n 'setMainLoop',\n 'getSocketFromFD',\n 'getSocketAddress',\n 'FS_createPreloadedFile',\n 'FS_modeStringToFlags',\n 'FS_getMode',\n 'FS_stdin_getChar',\n 'FS_createDataFile',\n 'FS_unlink',\n 'FS_mkdirTree',\n '_setNetworkCallback',\n 'heapObjectForWebGLType',\n 'heapAccessShiftForWebGLHeap',\n 'webgl_enable_ANGLE_instanced_arrays',\n 'webgl_enable_OES_vertex_array_object',\n 'webgl_enable_WEBGL_draw_buffers',\n 'webgl_enable_WEBGL_multi_draw',\n 'emscriptenWebGLGet',\n 'computeUnpackAlignedImageSize',\n 'colorChannelsInGlTextureFormat',\n 'emscriptenWebGLGetTexPixelData',\n '__glGenObject',\n 'emscriptenWebGLGetUniform',\n 'webglGetUniformLocation',\n 'webglPrepareUniformLocationsBeforeFirstUse',\n 'webglGetLeftBracePos',\n 'emscriptenWebGLGetVertexAttrib',\n '__glGetActiveAttribOrUniform',\n 'writeGLArray',\n 'registerWebGlEventCallback',\n 'runAndAbortIfError',\n 'SDL_unicode',\n 'SDL_ttfContext',\n 'SDL_audio',\n 'ALLOC_NORMAL',\n 'ALLOC_STACK',\n 'allocate',\n 'writeStringToMemory',\n 'writeAsciiToMemory',\n];\nmissingLibrarySymbols.forEach(missingLibrarySymbol)\n\nvar unexportedSymbols = [\n 'run',\n 'addOnPreRun',\n 'addOnInit',\n 'addOnPreMain',\n 'addOnExit',\n 'addOnPostRun',\n 'addRunDependency',\n 'removeRunDependency',\n 'FS_createFolder',\n 'FS_createPath',\n 'FS_createLazyFile',\n 'FS_createLink',\n 'FS_createDevice',\n 'FS_readFile',\n 'out',\n 'err',\n 'callMain',\n 'abort',\n 'wasmMemory',\n 'wasmExports',\n 'stackAlloc',\n 'stackSave',\n 'stackRestore',\n 'getTempRet0',\n 'setTempRet0',\n 'writeStackCookie',\n 'checkStackCookie',\n 'ptrToString',\n 'exitJS',\n 'getHeapMax',\n 'abortOnCannotGrowMemory',\n 'ENV',\n 'MONTH_DAYS_REGULAR',\n 'MONTH_DAYS_LEAP',\n 'MONTH_DAYS_REGULAR_CUMULATIVE',\n 'MONTH_DAYS_LEAP_CUMULATIVE',\n 'ERRNO_CODES',\n 'ERRNO_MESSAGES',\n 'DNS',\n 'Protocols',\n 'Sockets',\n 'timers',\n 'warnOnce',\n 'UNWIND_CACHE',\n 'readEmAsmArgsArray',\n 'keepRuntimeAlive',\n 'wasmTable',\n 'noExitRuntime',\n 'freeTableIndexes',\n 'functionsInTableMap',\n 'setValue',\n 'getValue',\n 'PATH',\n 'PATH_FS',\n 'UTF8Decoder',\n 'UTF8ArrayToString',\n 'stringToUTF8Array',\n 'stringToUTF8',\n 'lengthBytesUTF8',\n 'UTF16Decoder',\n 'stringToNewUTF8',\n 'JSEvents',\n 'specialHTMLTargets',\n 'currentFullscreenStrategy',\n 'restoreOldWindowedStyle',\n 'ExitStatus',\n 'promiseMap',\n 'uncaughtExceptionCount',\n 'exceptionLast',\n 'exceptionCaught',\n 'Browser',\n 'wget',\n 'SYSCALLS',\n 'preloadPlugins',\n 'FS_stdin_getChar_buffer',\n 'FS',\n 'MEMFS',\n 'TTY',\n 'PIPEFS',\n 'SOCKFS',\n 'tempFixedLengthArray',\n 'miniTempWebGLFloatBuffers',\n 'miniTempWebGLIntBuffers',\n 'GL',\n 'emscripten_webgl_power_preferences',\n 'AL',\n 'GLUT',\n 'EGL',\n 'GLEW',\n 'IDBStore',\n 'SDL',\n 'SDL_gfx',\n 'allocateUTF8OnStack',\n];\nunexportedSymbols.forEach(unexportedRuntimeSymbol);\n\n\n\nvar calledRun;\n\ndependenciesFulfilled = function runCaller() {\n // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)\n if (!calledRun) run();\n if (!calledRun) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled\n};\n\nfunction stackCheckInit() {\n // This is normally called automatically during __wasm_call_ctors but need to\n // get these values before even running any of the ctors so we call it redundantly\n // here.\n _emscripten_stack_init();\n // TODO(sbc): Move writeStackCookie to native to to avoid this.\n writeStackCookie();\n}\n\nfunction run() {\n\n if (runDependencies > 0) {\n return;\n }\n\n stackCheckInit();\n\n preRun();\n\n // a preRun added a dependency, run will be called later\n if (runDependencies > 0) {\n return;\n }\n\n function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if (calledRun) return;\n calledRun = true;\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n initRuntime();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n assert(!Module['_main'], 'compiled without a main, but one is present. if you added it from JS, use Module[\"onRuntimeInitialized\"]');\n\n postRun();\n }\n\n if (Module['setStatus']) {\n Module['setStatus']('Running...');\n setTimeout(function() {\n setTimeout(function() {\n Module['setStatus']('');\n }, 1);\n doRun();\n }, 1);\n } else\n {\n doRun();\n }\n checkStackCookie();\n}\n\nfunction checkUnflushedContent() {\n // Compiler settings do not allow exiting the runtime, so flushing\n // the streams is not possible. but in ASSERTIONS mode we check\n // if there was something to flush, and if so tell the user they\n // should request that the runtime be exitable.\n // Normally we would not even include flush() at all, but in ASSERTIONS\n // builds we do so just for this check, and here we see if there is any\n // content to flush, that is, we check if there would have been\n // something a non-ASSERTIONS build would have not seen.\n // How we flush the streams depends on whether we are in SYSCALLS_REQUIRE_FILESYSTEM=0\n // mode (which has its own special function for this; otherwise, all\n // the code is inside libc)\n var oldOut = out;\n var oldErr = err;\n var has = false;\n out = err = (x) => {\n has = true;\n }\n try { // it doesn't matter if it fails\n _fflush(0);\n } catch(e) {}\n out = oldOut;\n err = oldErr;\n if (has) {\n warnOnce('stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the Emscripten FAQ), or make sure to emit a newline when you printf etc.');\n warnOnce('(this may also be due to not including full filesystem support - try building with -sFORCE_FILESYSTEM)');\n }\n}\n\nif (Module['preInit']) {\n if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];\n while (Module['preInit'].length > 0) {\n Module['preInit'].pop()();\n }\n}\n\nrun();\n\n\n// end include: postamble.js\n// postMiddleLayer.js\nModule.preRun = () => Module._isInitialized = false;\nModule.postRun = () => Module._isInitialized = true;\nModule.ANALYSIS_SAMPLE_COUNT = 8192; // If you change this, you must also change ANALYSIS_SAMPLE_COUNT in middle-layer.c\nexport default Module;\n\n//# sourceMappingURL=middle-layer.wasm.map","import {EncodeTag, P} from \"./types\";\n\nexport function tagsToBuffer(tags:EncodeTag[], Module:any):P {\n if (!tags.length) return null;\n // Check for reserved characters in tag names and values.\n tags.forEach(tag => {\n if (tag.name.indexOf('=') !== -1) throw Error(`Tag name \"${tag.name}\" contains reserved character \"=\"`);\n if (tag.name.indexOf('\\t') !== -1) throw Error(`Tag name \"${tag.name}\" contains reserved character (tab)`);\n if (tag.value.indexOf('\\t') !== -1) throw Error(`Tag value \"${tag.value}\" contains reserved character (tab)`);\n // I don't care if value has an equal sign in it, because parsing can just stop at the first equal sign.\n });\n const serializedTabArray = tags.map(tag => `${tag.name}=${tag.value}`);\n const serializedTabs = serializedTabArray.join('\\t');\n return Module.allocateUTF8(serializedTabs);\n}\n\nexport function bufferToTags(pBuffer:P, Module:any):EncodeTag[] {\n if (pBuffer === null) return [];\n const serializedTabs:string = Module.UTF8ToString(pBuffer);\n if (serializedTabs === '') return [];\n const serializedTabArray = serializedTabs.split('\\t');\n return serializedTabArray.map(serializedTab => {\n const equalPos = serializedTab.indexOf('=');\n if (equalPos === -1) { return {name:serializedTab, value: ''}; }\n return {\n name: serializedTab.slice(0, equalPos),\n value: serializedTab.slice(equalPos+1)\n };\n });\n}","import Module from '../wasm/middle-layer';\nimport {P, P32, EncodeTag, EncodeOptions} from \"./types\";\nimport {tagsToBuffer, bufferToTags} from \"./tagUtil\";\n\nexport type {EncodeTag, EncodeOptions} from \"./types\";\n\nconst DEFAULT_ENCODE_OPTIONS:EncodeOptions = {\n quality: .5,\n tags: []\n};\n\nconst {_clearEncoder, _createAnalysisBuffer, _decodeComments, _initEncoder, _processEncoding, _getEncodedDataLen, _transferEncodedData, ANALYSIS_SAMPLE_COUNT} = Module;\n\nlet waitForModuleInitPromise:Promise|null = null;\nasync function _waitForModuleInit():Promise {\n if (Module._isInitialized) return; // Module has already been initialized.\n if (Module._isInitialized === undefined) throw Error('Unexpected behavior from middle-layer.js import.'); // middle-layer.js should have a preRun() function that sets Module._isInitialized to false. If it's not there, then the WASM build for middle-layer is probably wrong.\n if (waitForModuleInitPromise !== null) return await waitForModuleInitPromise; // Module is already being initialized.\n waitForModuleInitPromise = new Promise((resolve) => { // Module has not yet been initialized.\n Module.onRuntimeInitialized = resolve();\n });\n return waitForModuleInitPromise;\n}\n\nfunction _init(audioBuffer:AudioBuffer, quality:number, tagsBuffer:P):P {\n const channelCount = audioBuffer.numberOfChannels;\n const sampleRate = audioBuffer.sampleRate;\n return _initEncoder(channelCount, sampleRate, quality, tagsBuffer);\n}\n\nfunction _getChannelSampleBuffers(audioBuffer:AudioBuffer):Float32Array[] {\n const channelCount = audioBuffer.numberOfChannels;\n const channelSampleBuffers:Float32Array[] = [];\n for(let channelI = 0; channelI < channelCount; ++channelI) {\n channelSampleBuffers[channelI] = audioBuffer.getChannelData(channelI);\n }\n return channelSampleBuffers;\n}\n\nfunction _processAndTransferData(pEncoderState:P, sampleCount:number):Uint8Array {\n _processEncoding(pEncoderState, sampleCount);\n const oggBytesLength = _getEncodedDataLen(pEncoderState);\n if (oggBytesLength === 0) return new Uint8Array(0);\n const pOggBytes = _transferEncodedData(pEncoderState);\n return new Uint8Array(Module.HEAPU8.subarray(pOggBytes, pOggBytes + oggBytesLength));\n}\n\nfunction _processSampleBufferChunk(pEncoderState:P, channelSampleBuffers:Float32Array[], fromSampleNo:number, fromSampleCount:number, p32AnalysisBuffer:P32):Uint8Array {\n if (p32AnalysisBuffer === null) throw Error('Unexpected');\n \n const fromSampleNoEnd = fromSampleNo + fromSampleCount;\n for(let channelI = 0; channelI < channelSampleBuffers.length; ++channelI) {\n const channelSamples = channelSampleBuffers[channelI];\n const p32ChannelAnalysisBuffer= Module.HEAPU32[p32AnalysisBuffer + channelI] >> 2;\n Module.HEAPF32.set(channelSamples.subarray(fromSampleNo, fromSampleNoEnd), p32ChannelAnalysisBuffer);\n }\n return _processAndTransferData(pEncoderState, fromSampleCount);\n}\n\nfunction _yield():Promise {\n return new Promise(resolve => setTimeout(resolve, 0));\n}\n\nfunction _finishProcessing(pEncoderState:P):Uint8Array {\n return _processAndTransferData(pEncoderState, 0);\n}\n\nfunction _fillInDefaults(encodeOptions:Partial):EncodeOptions {\n if (encodeOptions === DEFAULT_ENCODE_OPTIONS) return DEFAULT_ENCODE_OPTIONS;\n const useOptions:any = {...DEFAULT_ENCODE_OPTIONS};\n const encodeOptionsAny = encodeOptions as any;\n for(const key in encodeOptions) {\n if (encodeOptionsAny[key] !== undefined) useOptions[key] = encodeOptionsAny[key];\n }\n return useOptions;\n}\n\nasync function _decodeOggArrayBuffer(arrayBuffer:ArrayBuffer, audioContext?:AudioContext):Promise {\n const useAudioContext = audioContext ?? new AudioContext(); // Requires a user gesture on browser, e.g., clicking a button.\n return await useAudioContext.decodeAudioData(arrayBuffer); // Returns AudioBuffer. This call detaches the arrayBuffer, making it unusable for most things.\n}\n\nfunction _decodeOggArrayBufferTags(arrayBuffer:ArrayBuffer):EncodeTag[] {\n let pOggBytes:P = null, pComments:P = null;\n try {\n const oggBytes = new Uint8Array(arrayBuffer);\n pOggBytes = Module._malloc(oggBytes.length);\n Module.HEAPU8.set(oggBytes, pOggBytes);\n pComments = _decodeComments(pOggBytes, oggBytes.length);\n return bufferToTags(pComments, Module);\n } finally {\n if (pComments !== null) Module._free(pComments);\n if (pOggBytes !== null) Module._free(pOggBytes);\n }\n}\n\n/**\n * Encodes an AudioBuffer to an Ogg blob.\n * \n * @param {AudioBuffer} audioBuffer AudioBuffer to encode to Ogg.\n * @param {EncodeOptions} encodeOptions An optional object where you can set the following members:\n * quality: A number between 0 and 1. Default is .5.\n * tags: An array of objects with \"tag\" and \"value\" members containing strings. \"tag\" values can't contain \n * tabs ('\\t') or equal signs (\"=\"). \"value\" values can't contain tabs.\n * @throws {Error} If tags in an invalid format were passed or something unexpected happens.\n * @returns {Promise} A Blob containing the encoded Ogg file.\n */\nexport async function encodeAudioBuffer(audioBuffer:AudioBuffer, encodeOptions:Partial = DEFAULT_ENCODE_OPTIONS):Promise {\n let pEncoderState:P = null;\n const oggByteBuffers:Uint8Array[] = [];\n const options = _fillInDefaults(encodeOptions);\n let tagsBuffer:P = null;\n\n try {\n await _waitForModuleInit();\n\n tagsBuffer = tagsToBuffer(options.tags, Module);\n const sampleCount = audioBuffer.length;\n pEncoderState = _init(audioBuffer, options.quality, tagsBuffer);\n const channelSampleBuffers = _getChannelSampleBuffers(audioBuffer);\n\n let fromSampleNo = 0;\n if (pEncoderState === null) throw Error('Unexpected');\n while(fromSampleNo < sampleCount) {\n const p32AnalysisBuffer= _createAnalysisBuffer(pEncoderState) >> 2;\n const fromSampleCount = Math.min(ANALYSIS_SAMPLE_COUNT, sampleCount - fromSampleNo);\n const oggBytes = _processSampleBufferChunk(pEncoderState, channelSampleBuffers, fromSampleNo, fromSampleCount, p32AnalysisBuffer);\n if (oggBytes.length) oggByteBuffers.push(oggBytes);\n fromSampleNo += fromSampleCount;\n await _yield();\n }\n\n const lastOggBytes = _finishProcessing(pEncoderState);\n if (lastOggBytes.length) oggByteBuffers.push(lastOggBytes);\n return new Blob(oggByteBuffers, {type:'audio/ogg'});\n } finally {\n if (pEncoderState !== null) _clearEncoder(pEncoderState);\n if (tagsBuffer !== null) Module._free(tagsBuffer);\n }\n}\n\n/** \n * Decode an Ogg file from a Blob to an AudioBuffer. This depends on the browser's AudioContext.decodeAudioData() \n * function. On some browsers, this function may require a user gesture, e.g., clicking a button. before it can be\n * called successfully. If you are creating a lot of AudioContexts in your app, you may want to reuse the same\n * AudioContext instance by passing it as a param. It's a good practice for cross-browser compatibility.\n * \n * @param {Blob} blob The Ogg file to decode.\n * @param {AudioContext} audioContext Optional. If not provided, a new AudioContext will be created.\n * @throws {Error} If the file is in an unexpected format, the browser needs a user gesture, or something unexpected.\n * @returns {Promise} Populated with the decoded audio data.\n */\nexport async function decodeOggBlob(blob:Blob, audioContext?:AudioContext):Promise {\n const arrayBuffer = await blob.arrayBuffer();\n return await _decodeOggArrayBuffer(arrayBuffer, audioContext);\n}\n\n/**\n * Decode an Ogg file from a Blob to an AudioBuffer and tags. This depends on the browser's AudioContext.decodeAudioData()\n * function. On some browsers, this function may require a user gesture, e.g., clicking a button. before it can be\n * called successfully. If you are creating a lot of AudioContexts in your app, you may want to reuse the same\n * AudioContext instance by passing it as a param. It's a good practice for cross-browser compatibility.\n *\n * @param {Blob} blob The Ogg file to decode.\n * @param {AudioContext} audioContext Optional. If not provided, a new AudioContext will be created.\n * @throws {Error} If the file is in an unexpected format, the browser needs a user gesture, or something unexpected.\n * @returns {Promise} Array where first element is the decoded audioBuffer and the second element is an array of \n * objects with \"tag\" and \"value\" members containing strings.\n */\n export async function decodeOggBlobWithTags(blob:Blob, audioContext?:AudioContext):Promise<[audioBuffer:AudioBuffer, tags:EncodeTag[]]> {\n await _waitForModuleInit();\n const arrayBuffer = await blob.arrayBuffer();\n const tags:EncodeTag[] = _decodeOggArrayBufferTags(arrayBuffer); // Must be called before _decodeOggArrayBuffer() which detaches the arrayBuffer. \n const audioBuffer = await _decodeOggArrayBuffer(arrayBuffer, audioContext);\n return [audioBuffer, tags];\n}"],"names":["Module","moduleOverrides","quit_","status","toThrow","ENVIRONMENT_IS_WEB","ENVIRONMENT_IS_WORKER","ENVIRONMENT_IS_NODE","ENVIRONMENT_IS_SHELL","scriptDirectory","locateFile","path","err","checkIncomingModuleAPI","legacyModuleProp","assert","wasmBinary","abort","wasmMemory","ABORT","condition","text","HEAP8","HEAPU8","HEAPU32","updateMemoryViews","b","writeStackCookie","max","_emscripten_stack_get_end","checkStackCookie","cookie1","cookie2","ptrToString","h16","h8","__ATPRERUN__","__ATINIT__","__ATPOSTRUN__","runtimeInitialized","preRun","addOnPreRun","callRuntimeCallbacks","initRuntime","postRun","addOnPostRun","cb","addOnInit","runDependencies","runDependencyWatcher","dependenciesFulfilled","runDependencyTracking","addRunDependency","id","_a","shown","dep","removeRunDependency","callback","what","e","FS","dataURIPrefix","isDataURI","filename","isFileURI","createExportWrapper","name","f","wasmExports","wasmBinaryFile","getBinarySync","file","getBinaryPromise","binaryFile","response","instantiateArrayBuffer","imports","receiver","binary","instance","reason","instantiateAsync","result","createWasm","info","wasmImports","receiveInstance","module","trueModule","receiveInstantiationResult","prop","newName","incomming","extra","ignoredModuleProp","isExportedByForceFilesystem","missingGlobal","sym","msg","warnOnce","missingLibrarySymbol","librarySymbol","unexportedRuntimeSymbol","ExitStatus","callbacks","noExitRuntime","ptr","_emscripten_date_now","_emscripten_memcpy_js","dest","src","num","abortOnCannotGrowMemory","requestedSize","_emscripten_resize_heap","runtimeKeepaliveCounter","keepRuntimeAlive","UTF8Decoder","UTF8ArrayToString","heapOrArray","idx","maxBytesToRead","endIdx","endPtr","str","u0","u1","u2","ch","UTF8ToString","_proc_exit","code","exitJS","implicit","checkUnflushedContent","_exit","lengthBytesUTF8","len","i","c","stringToUTF8Array","heap","outIdx","maxBytesToWrite","startIdx","u","stringToUTF8","outPtr","stringToNewUTF8","size","ret","_malloc","allocateUTF8","_fflush","_emscripten_stack_init","missingLibrarySymbols","unexportedSymbols","calledRun","runCaller","run","stackCheckInit","doRun","oldErr","has","x","tagsToBuffer","tags","tag","serializedTabs","bufferToTags","pBuffer","serializedTab","equalPos","DEFAULT_ENCODE_OPTIONS","_clearEncoder","_createAnalysisBuffer","_decodeComments","_initEncoder","_processEncoding","_getEncodedDataLen","_transferEncodedData","ANALYSIS_SAMPLE_COUNT","waitForModuleInitPromise","_waitForModuleInit","resolve","_init","audioBuffer","quality","tagsBuffer","channelCount","sampleRate","_getChannelSampleBuffers","channelSampleBuffers","channelI","_processAndTransferData","pEncoderState","sampleCount","oggBytesLength","pOggBytes","_processSampleBufferChunk","fromSampleNo","fromSampleCount","p32AnalysisBuffer","fromSampleNoEnd","channelSamples","p32ChannelAnalysisBuffer","_yield","_finishProcessing","_fillInDefaults","encodeOptions","useOptions","encodeOptionsAny","key","_decodeOggArrayBuffer","arrayBuffer","audioContext","_decodeOggArrayBufferTags","pComments","oggBytes","encodeAudioBuffer","oggByteBuffers","options","lastOggBytes","decodeOggBlob","blob","decodeOggBlobWithTags"],"mappings":"gFAcA,IAAIA,EAAS,OAAOA,EAAU,IAAcA,EAAS,CAAA,EAWjDC,EAAkB,OAAO,OAAO,CAAE,EAAED,CAAM,EAI1CE,EAAQ,CAACC,EAAQC,IAAY,CAC/B,MAAMA,CACR,EAKIC,GAAqB,GACrBC,GAAwB,GACxBC,GAAsB,GACtBC,GAAuB,GAE3B,GAAIR,EAAO,YACT,MAAM,IAAI,MAAM,kKAAkK,EAIpL,IAAIS,EAAkB,GACtB,SAASC,GAAWC,EAAM,CACxB,OAAIX,EAAO,WACFA,EAAO,WAAcW,EAAMF,CAAe,EAE5CA,EAAkBE,CAC3B,CAkGE,GAfW,OAAO,SAAY,KAAe,SAAS,gBACpDF,EAAkB,SAAS,cAAc,KAQvCA,EAAgB,QAAQ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ChElE,EAAO,mBAAwBkE,EAAoB,mBAAmB,EACpElE,EAAO,qBAA0BkE,EAAoB,qBAAqB,EAC/ElE,EAAO,gBAAqBkE,EAAoB,gBAAgB,EAEtF,IAAIwF,GAAU1J,EAAO,QAAakE,EAAoB,QAAQ,EAC1DyF,GAAyB,KAAOA,GAAyBtF,EAAY,uBAAwB,EAG7FxC,EAA4B,KAAOA,EAA4BwC,EAAY,0BAA2B,EAU1GrE,EAAO,aAAkBkI,GACzBlI,EAAO,aAAkByJ,GACzB,IAAIG,GAAwB,CAC1B,gBACA,uBACA,yBACA,uBACA,yBACA,iBACA,iBACA,sBACA,6BACA,sBACA,aACA,aACA,aACA,eACA,WACA,UACA,WACA,YACA,YACA,YACA,YACA,eACA,gBACA,gBACA,iBACA,aACA,eACA,gBACA,4BACA,gBACA,UACA,UACA,oBACA,aACA,yBACA,gBACA,eACA,UACA,kBACA,uBACA,sBACA,mBACA,YACA,cACA,YACA,cACA,YACA,sBACA,kBACA,oBACA,aACA,cACA,eACA,aACA,WACA,QACA,QACA,gBACA,iBACA,mBACA,0BACA,oBACA,iBACA,qBACA,cACA,iBACA,iBACA,SACA,SACA,SACA,eACA,qBACA,mBACA,gBACA,gBACA,gBACA,gBACA,mBACA,gBACA,gBACA,mBACA,sBACA,qBACA,2BACA,yBACA,kBACA,wBACA,wBACA,qBACA,6BACA,6BACA,0BACA,6BACA,iCACA,yCACA,4BACA,oCACA,oBACA,iCACA,yCACA,gCACA,wCACA,6BACA,qCACA,0BACA,mCACA,wBACA,eACA,wCACA,sBACA,iCACA,yCACA,wCACA,qBACA,gCACA,wCACA,6BACA,uBACA,+BACA,8BACA,oCACA,uBACA,UACA,+BACA,uBACA,uBACA,WACA,cACA,eACA,aACA,gBACA,iBACA,sBACA,yBACA,yBACA,uBACA,iBACA,sBACA,wBACA,uBACA,aACA,cACA,gBACA,sBACA,gBACA,oBACA,kCACA,cACA,kBACA,mBACA,yBACA,uBACA,aACA,mBACA,oBACA,YACA,eACA,sBACA,yBACA,8BACA,sCACA,uCACA,kCACA,gCACA,qBACA,gCACA,iCACA,iCACA,gBACA,4BACA,0BACA,6CACA,uBACA,iCACA,+BACA,eACA,6BACA,qBACA,cACA,iBACA,YACA,eACA,cACA,WACA,sBACA,oBACF,EACAA,GAAsB,QAAQvD,EAAoB,EAElD,IAAIwD,GAAoB,CACtB,MACA,cACA,YACA,eACA,YACA,eACA,mBACA,sBACA,kBACA,gBACA,oBACA,gBACA,kBACA,cACA,MACA,MACA,WACA,QACA,aACA,cACA,aACA,YACA,eACA,cACA,cACA,mBACA,mBACA,cACA,SACA,aACA,0BACA,MACA,qBACA,kBACA,gCACA,6BACA,cACA,iBACA,MACA,YACA,UACA,SACA,WACA,eACA,qBACA,mBACA,YACA,gBACA,mBACA,sBACA,WACA,WACA,OACA,UACA,cACA,oBACA,oBACA,eACA,kBACA,eACA,kBACA,WACA,qBACA,4BACA,0BACA,aACA,aACA,yBACA,gBACA,kBACA,UACA,OACA,WACA,iBACA,0BACA,KACA,QACA,MACA,SACA,SACA,uBACA,4BACA,0BACA,KACA,qCACA,KACA,OACA,MACA,OACA,WACA,MACA,UACA,qBACF,EACAA,GAAkB,QAAQtD,CAAuB,EAIjD,IAAIuD,EAEJ5G,EAAwB,SAAS6G,GAAY,CAEtCD,GAAWE,KACXF,IAAW5G,EAAwB6G,EAC1C,EAEA,SAASE,IAAiB,CAIxBN,KAEAhI,IACF,CAEA,SAASqI,IAAM,CAWb,GATIhH,EAAkB,IAIpBiH,KAEFzH,KAGIQ,EAAkB,GACpB,OAGF,SAASkH,GAAQ,CAGXJ,IACJA,EAAY,GACZ9J,EAAO,UAAe,GAElB,CAAAmB,IAEJwB,KAEI3C,EAAO,sBAAyBA,EAAO,qBAAuB,EAElEe,EAAO,CAACf,EAAO,MAAU,0GAA0G,EAEnI4C,MACD,CAEG5C,EAAO,WACTA,EAAO,UAAa,YAAY,EAChC,WAAW,UAAW,CACpB,WAAW,UAAW,CACpBA,EAAO,UAAa,EAA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