@cornerstonejs/dicom-image-loader 0.2.0 → 0.2.1

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.
@@ -1,3229 +1,2 @@
1
- /******/ (() => { // webpackBootstrap
2
- /******/ var __webpack_modules__ = ({
3
-
4
- /***/ "../../../node_modules/@babel/runtime/regenerator/index.js":
5
- /*!*****************************************************************!*\
6
- !*** ../../../node_modules/@babel/runtime/regenerator/index.js ***!
7
- \*****************************************************************/
8
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
9
-
10
- module.exports = __webpack_require__(/*! regenerator-runtime */ "../../../node_modules/regenerator-runtime/runtime.js");
11
-
12
-
13
- /***/ }),
14
-
15
- /***/ "../../../node_modules/@cornerstonejs/codec-charls/dist/charlswasm_decode.js":
16
- /*!***********************************************************************************!*\
17
- !*** ../../../node_modules/@cornerstonejs/codec-charls/dist/charlswasm_decode.js ***!
18
- \***********************************************************************************/
19
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
20
-
21
- var __filename = "/index.js";
22
- var __dirname = "/";
23
-
24
- var CharLSWASM = (() => {
25
- var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
26
- if (true) _scriptDir = _scriptDir || __filename;
27
- return (
28
- function(CharLSWASM) {
29
- CharLSWASM = CharLSWASM || {};
30
-
31
- var Module=typeof CharLSWASM!="undefined"?CharLSWASM:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;function logExceptionOnExit(e){if(e instanceof ExitStatus)return;let toLog=e;err("exiting due to exception: "+toLog)}if(ENVIRONMENT_IS_NODE){var fs=__webpack_require__(/*! fs */ "?a97b");var nodePath=__webpack_require__(/*! path */ "?890c");if(ENVIRONMENT_IS_WORKER){scriptDirectory=nodePath.dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",function(reason){throw reason});quit_=(status,toThrow)=>{if(keepRuntimeAlive()){process["exitCode"]=status;throw toThrow}logExceptionOnExit(toThrow);process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=title=>document.title=title}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||52428800;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile;wasmBinaryFile="charlswasm_decode.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["z"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["C"];addOnInit(Module["asm"]["A"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(function(instance){return instance}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);readyPromiseReject(e)}}instantiateAsync().catch(readyPromiseReject);return{}}function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module)}}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){HEAPU32[this.ptr+4>>2]=type};this.get_type=function(){return HEAPU32[this.ptr+4>>2]};this.set_destructor=function(destructor){HEAPU32[this.ptr+8>>2]=destructor};this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+12>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+12>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+13>>0]!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=prev-1;return prev===1};this.set_adjusted_ptr=function(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr};this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var structRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAP32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}return name}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i<myTypes.length;++i){registerType(myTypes[i],myTypeConverters[i])}}var typeConverters=new Array(dependentTypes.length);var unregisteredTypes=[];var registered=0;dependentTypes.forEach((dt,i)=>{if(registeredTypes.hasOwnProperty(dt)){typeConverters[i]=registeredTypes[dt]}else{unregisteredTypes.push(dt);if(!awaitingDependencies.hasOwnProperty(dt)){awaitingDependencies[dt]=[]}awaitingDependencies[dt].push(()=>{typeConverters[i]=registeredTypes[dt];++registered;if(registered===unregisteredTypes.length){onComplete(typeConverters)}})}});if(0===unregisteredTypes.length){onComplete(typeConverters)}}function __embind_finalize_value_object(structType){var reg=structRegistrations[structType];delete structRegistrations[structType];var rawConstructor=reg.rawConstructor;var rawDestructor=reg.rawDestructor;var fieldRecords=reg.fields;var fieldTypes=fieldRecords.map(field=>field.getterReturnType).concat(fieldRecords.map(field=>field.setterArgumentType));whenDependentTypesAreResolved([structType],fieldTypes,fieldTypes=>{var fields={};fieldRecords.forEach((field,i)=>{var fieldName=field.fieldName;var getterReturnType=fieldTypes[i];var getter=field.getter;var getterContext=field.getterContext;var setterArgumentType=fieldTypes[i+fieldRecords.length];var setter=field.setter;var setterContext=field.setterContext;fields[fieldName]={read:ptr=>{return getterReturnType["fromWireType"](getter(getterContext,ptr))},write:(ptr,o)=>{var destructors=[];setter(setterContext,ptr,setterArgumentType["toWireType"](destructors,o));runDestructors(destructors)}}});return[{name:reg.name,"fromWireType":function(ptr){var rv={};for(var i in fields){rv[i]=fields[i].read(ptr)}rawDestructor(ptr);return rv},"toWireType":function(destructors,o){for(var fieldName in fields){if(!(fieldName in o)){throw new TypeError('Missing field: "'+fieldName+'"')}}var ptr=rawConstructor();for(fieldName in fields){fields[fieldName].write(ptr,o[fieldName])}if(destructors!==null){destructors.push(rawDestructor,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:rawDestructor}]})}function __embind_register_bigint(primitiveType,name,size,minRange,maxRange){}function getShiftFromSize(size){switch(size){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+size)}}function embind_init_charCodes(){var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes}var embind_charCodes=undefined;function readLatin1String(ptr){var ret="";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret}var BindingError=undefined;function throwBindingError(message){throw new BindingError(message)}function registerType(rawType,registeredInstance,options={}){if(!("argPackAdvance"in registeredInstance)){throw new TypeError("registerType registeredInstance requires argPackAdvance")}var name=registeredInstance.name;if(!rawType){throwBindingError('type "'+name+'" must have a positive integer typeid pointer')}if(registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations){return}else{throwBindingError("Cannot register type '"+name+"' twice")}}registeredTypes[rawType]=registeredInstance;delete typeDependencies[rawType];if(awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType];delete awaitingDependencies[rawType];callbacks.forEach(cb=>cb())}}function __embind_register_bool(rawType,name,size,trueValue,falseValue){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(wt){return!!wt},"toWireType":function(destructors,o){return o?trueValue:falseValue},"argPackAdvance":8,"readValueFromPointer":function(pointer){var heap;if(size===1){heap=HEAP8}else if(size===2){heap=HEAP16}else if(size===4){heap=HEAP32}else{throw new TypeError("Unknown boolean type size: "+name)}return this["fromWireType"](heap[pointer>>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationRegistry=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}var registeredPointers={};function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}var delayFunction=undefined;function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function attachFinalizer(handle){if("undefined"===typeof FinalizationRegistry){attachFinalizer=handle=>handle;return handle}finalizationRegistry=new FinalizationRegistry(info=>{releaseClassHandle(info.$$)});attachFinalizer=handle=>{var $$=handle.$$;var hasSmartPtr=!!$$.smartPtr;if(hasSmartPtr){var info={$$:$$};finalizationRegistry.register(handle,info,handle)}return handle};detachFinalizer=handle=>finalizationRegistry.unregister(handle);return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+embindRepr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+embindRepr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,Emval.toHandle(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+embindRepr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&&registeredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}var wasmTableMirror=[];function getWasmTableEntry(funcPtr){var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}var rtn=getWasmTableEntry(ptr).apply(null,args);return rtn}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=0;Object.assign(argCache,arguments);return dynCall(sig,ptr,argCache)}}function embind__requireFunction(signature,rawFunction){signature=readLatin1String(signature);function makeDynCaller(){if(signature.includes("j")){return getDynCaller(signature,rawFunction)}return getWasmTableEntry(rawFunction)}var fp=makeDynCaller();if(typeof fp!="function"){throwBindingError("unknown function pointer with signature "+signature+": "+rawFunction)}return fp}var UnboundTypeError=undefined;function getTypeName(type){var ptr=___getTypeName(type);var rv=readLatin1String(ptr);_free(ptr);return rv}function throwUnboundTypeError(message,types){var unboundTypes=[];var seen={};function visit(type){if(seen[type]){return}if(registeredTypes[type]){return}if(typeDependencies[type]){typeDependencies[type].forEach(visit);return}unboundTypes.push(type);seen[type]=true}types.forEach(visit);throw new UnboundTypeError(message+": "+unboundTypes.map(getTypeName).join([", "]))}function __embind_register_class(rawType,rawPointerType,rawConstPointerType,baseClassRawType,getActualTypeSignature,getActualType,upcastSignature,upcast,downcastSignature,downcast,name,destructorSignature,rawDestructor){name=readLatin1String(name);getActualType=embind__requireFunction(getActualTypeSignature,getActualType);if(upcast){upcast=embind__requireFunction(upcastSignature,upcast)}if(downcast){downcast=embind__requireFunction(downcastSignature,downcast)}rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);var legalFunctionName=makeLegalFunctionName(name);exposePublicSymbol(legalFunctionName,function(){throwUnboundTypeError("Cannot construct "+name+" due to unbound types",[baseClassRawType])});whenDependentTypesAreResolved([rawType,rawPointerType,rawConstPointerType],baseClassRawType?[baseClassRawType]:[],function(base){base=base[0];var baseClass;var basePrototype;if(baseClassRawType){baseClass=base.registeredClass;basePrototype=baseClass.instancePrototype}else{basePrototype=ClassHandle.prototype}var constructor=createNamedFunction(legalFunctionName,function(){if(Object.getPrototypeOf(this)!==instancePrototype){throw new BindingError("Use 'new' to construct "+name)}if(undefined===registeredClass.constructor_body){throw new BindingError(name+" has no accessible constructor")}var body=registeredClass.constructor_body[arguments.length];if(undefined===body){throw new BindingError("Tried to invoke ctor of "+name+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(registeredClass.constructor_body).toString()+") parameters instead!")}return body.apply(this,arguments)});var instancePrototype=Object.create(basePrototype,{constructor:{value:constructor}});constructor.prototype=instancePrototype;var registeredClass=new RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast);var referenceConverter=new RegisteredPointer(name,registeredClass,true,false,false);var pointerConverter=new RegisteredPointer(name+"*",registeredClass,false,false,false);var constPointerConverter=new RegisteredPointer(name+" const*",registeredClass,false,true,false);registeredPointers[rawType]={pointerType:pointerConverter,constPointerType:constPointerConverter};replacePublicSymbol(legalFunctionName,constructor);return[referenceConverter,pointerConverter,constPointerConverter]})}function heap32VectorToArray(count,firstElement){var array=[];for(var i=0;i<count;i++){array.push(HEAPU32[firstElement+i*4>>2])}return array}function new_(constructor,argumentList){if(!(constructor instanceof Function)){throw new TypeError("new_ called with constructor type "+typeof constructor+" which is not a function")}var dummy=createNamedFunction(constructor.name||"unknownFunctionName",function(){});dummy.prototype=constructor.prototype;var obj=new dummy;var r=constructor.apply(obj,argumentList);return r instanceof Object?r:obj}function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFunc,cppTargetFunc){var argCount=argTypes.length;if(argCount<2){throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!")}var isClassMethodFunc=argTypes[1]!==null&&classType!==null;var needsDestructorStack=false;for(var i=1;i<argTypes.length;++i){if(argTypes[i]!==null&&argTypes[i].destructorFunction===undefined){needsDestructorStack=true;break}}var returns=argTypes[0].name!=="void";var argsList="";var argsListWired="";for(var i=0;i<argCount-2;++i){argsList+=(i!==0?", ":"")+"arg"+i;argsListWired+=(i!==0?", ":"")+"arg"+i+"Wired"}var invokerFnBody="return function "+makeLegalFunctionName(humanName)+"("+argsList+") {\n"+"if (arguments.length !== "+(argCount-2)+") {\n"+"throwBindingError('function "+humanName+" called with ' + arguments.length + ' arguments, expected "+(argCount-2)+" args!');\n"+"}\n";if(needsDestructorStack){invokerFnBody+="var destructors = [];\n"}var dtorStack=needsDestructorStack?"destructors":"null";var args1=["throwBindingError","invoker","fn","runDestructors","retType","classParam"];var args2=[throwBindingError,cppInvokerFunc,cppTargetFunc,runDestructors,argTypes[0],argTypes[1]];if(isClassMethodFunc){invokerFnBody+="var thisWired = classParam.toWireType("+dtorStack+", this);\n"}for(var i=0;i<argCount-2;++i){invokerFnBody+="var arg"+i+"Wired = argType"+i+".toWireType("+dtorStack+", arg"+i+"); // "+argTypes[i+2].name+"\n";args1.push("argType"+i);args2.push(argTypes[i+2])}if(isClassMethodFunc){argsListWired="thisWired"+(argsListWired.length>0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i<argTypes.length;++i){var paramName=i===1?"thisWired":"arg"+(i-2)+"Wired";if(argTypes[i].destructorFunction!==null){invokerFnBody+=paramName+"_dtor("+paramName+"); // "+argTypes[i].name+"\n";args1.push(paramName+"_dtor");args2.push(argTypes[i].destructorFunction)}}}if(returns){invokerFnBody+="var ret = retType.fromWireType(rv);\n"+"return ret;\n"}else{}invokerFnBody+="}\n";args1.push(invokerFnBody);var invokerFunction=new_(Function,args1).apply(null,args2);return invokerFunction}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=()=>{throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){argTypes.splice(1,0,null);classType.registeredClass.constructor_body[argCount-1]=craftInvokerFunction(humanName,argTypes,null,invoker,rawConstructor);return[]});return[]})}function __embind_register_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,context,isPureVirtual){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;if(methodName.startsWith("@@")){methodName=Symbol[methodName.substring(2)]}if(isPureVirtual){classType.registeredClass.pureVirtualFunctions.push(methodName)}function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.instancePrototype;var method=proto[methodName];if(undefined===method||undefined===method.overloadTable&&method.className!==classType.name&&method.argCount===argCount-2){unboundTypesHandler.argCount=argCount-2;unboundTypesHandler.className=classType.name;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-2]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var memberFunction=craftInvokerFunction(humanName,argTypes,classType,rawInvoker,context);if(undefined===proto[methodName].overloadTable){memberFunction.argCount=argCount-2;proto[methodName]=memberFunction}else{proto[methodName].overloadTable[argCount-2]=memberFunction}return[]});return[]})}var emval_free_list=[];var emval_handle_array=[{},{value:undefined},{value:null},{value:true},{value:false}];function __emval_decref(handle){if(handle>4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i<emval_handle_array.length;++i){if(emval_handle_array[i]!==undefined){++count}}return count}function get_first_emval(){for(var i=5;i<emval_handle_array.length;++i){if(emval_handle_array[i]!==undefined){return emval_handle_array[i]}}return null}function init_emval(){Module["count_emval_handles"]=count_emval_handles;Module["get_first_emval"]=get_first_emval}var Emval={toValue:handle=>{if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value},toHandle:value=>{switch(value){case undefined:return 1;case null:return 2;case true:return 3;case false:return 4;default:{var handle=emval_free_list.length?emval_free_list.pop():emval_handle_array.length;emval_handle_array[handle]={refcount:1,value:value};return handle}}}};function __embind_register_emval(rawType,name){name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(handle){var rv=Emval.toValue(handle);__emval_decref(handle);return rv},"toWireType":function(destructors,value){return Emval.toHandle(value)},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:null})}function embindRepr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=value=>value;if(minRange===0){var bitshift=32-8*size;fromWireType=value=>value<<bitshift>>>bitshift}var isUnsignedType=name.includes("unsigned");var checkAssertions=(value,toTypeName)=>{};var toWireType;if(isUnsignedType){toWireType=function(destructors,value){checkAssertions(value,this.name);return value>>>0}}else{toWireType=function(destructors,value){checkAssertions(value,this.name);return value}}registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":toWireType,"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var payload=value+4;var str;if(stdStringIsUTF8){var decodeStartPtr=payload;for(var i=0;i<=length;++i){var currentBytePtr=payload+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i<length;++i){a[i]=String.fromCharCode(HEAPU8[payload+i])}str=a.join("")}_free(value);return str},"toWireType":function(destructors,value){if(value instanceof ArrayBuffer){value=new Uint8Array(value)}var length;var valueIsOfTypeString=typeof value=="string";if(!(valueIsOfTypeString||value instanceof Uint8Array||value instanceof Uint8ClampedArray||value instanceof Int8Array)){throwBindingError("Cannot pass non-string to std::string")}if(stdStringIsUTF8&&valueIsOfTypeString){length=lengthBytesUTF8(value)}else{length=value.length}var base=_malloc(4+length+1);var ptr=base+4;HEAPU32[base>>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr,length+1)}else{if(valueIsOfTypeString){for(var i=0;i<length;++i){var charCode=value.charCodeAt(i);if(charCode>255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+i]=charCode}}else{for(var i=0;i<length;++i){HEAPU8[ptr+i]=value[i]}}}if(destructors!==null){destructors.push(_free,base)}return base},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}var UTF16Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder)return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr));var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite<str.length*2?maxBytesToWrite/2:str.length;for(var i=0;i<numCharsToWrite;++i){var codeUnit=str.charCodeAt(i);HEAP16[outPtr>>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);if(codeUnit>=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);if(codeUnit>=55296&&codeUnit<=57343)++i;len+=4}return len}function __embind_register_std_wstring(rawType,charSize,name){name=readLatin1String(name);var decodeString,encodeString,getHeap,lengthBytesUTF,shift;if(charSize===2){decodeString=UTF16ToString;encodeString=stringToUTF16;lengthBytesUTF=lengthBytesUTF16;getHeap=()=>HEAPU16;shift=1}else if(charSize===4){decodeString=UTF32ToString;encodeString=stringToUTF32;lengthBytesUTF=lengthBytesUTF32;getHeap=()=>HEAPU32;shift=2}registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value=="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_object(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){structRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),fields:[]}}function __embind_register_value_object_field(structType,fieldName,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){structRegistrations[structType].fields.push({fieldName:readLatin1String(fieldName),getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}var emval_symbols={};function getStringOrSymbol(address){var symbol=emval_symbols[address];if(symbol===undefined){return readLatin1String(address)}return symbol}function emval_get_global(){if(typeof globalThis=="object"){return globalThis}return function(){return Function}()("return this")()}function __emval_get_global(name){if(name===0){return Emval.toHandle(emval_get_global())}else{name=getStringOrSymbol(name);return Emval.toHandle(emval_get_global()[name])}}function __emval_incref(handle){if(handle>4){emval_handle_array[handle].refcount+=1}}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function craftEmvalAllocator(argCount){var argsList="";for(var i=0;i<argCount;++i){argsList+=(i!==0?", ":"")+"arg"+i}var getMemory=()=>HEAPU32;var functionBody="return function emval_allocator_"+argCount+"(constructor, argTypes, args) {\n"+" var HEAPU32 = getMemory();\n";for(var i=0;i<argCount;++i){functionBody+="var argType"+i+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+i+"');\n"+"var arg"+i+" = argType"+i+".readValueFromPointer(args);\n"+"args += argType"+i+"['argPackAdvance'];\n"+"argTypes += 4;\n"}functionBody+="var obj = new constructor("+argsList+");\n"+"return valueToHandle(obj);\n"+"}\n";return new Function("requireRegisteredType","Module","valueToHandle","getMemory",functionBody)(requireRegisteredType,Module,Emval.toHandle,getMemory)}var emval_newers={};function __emval_new(handle,argCount,argTypes,args){handle=Emval.toValue(handle);var newer=emval_newers[argCount];if(!newer){newer=craftEmvalAllocator(argCount);emval_newers[argCount]=newer}return newer(handle,argTypes,args)}function __emval_take_value(type,arg){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](arg);return Emval.toHandle(v)}function _abort(){abort("")}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}let alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}function getCFunc(ident){var func=Module["_"+ident];return func}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string"){return UTF8ToString(ret)}if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func.apply(null,cArgs);function onDone(ret){if(stack!==0)stackRestore(stack);return convertReturnValue(ret)}ret=onDone(ret);return ret}InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_embind();init_RegisteredPointer();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();var asmLibraryArg={"h":___cxa_throw,"q":__embind_finalize_value_object,"r":__embind_register_bigint,"w":__embind_register_bool,"p":__embind_register_class,"o":__embind_register_class_constructor,"c":__embind_register_class_function,"v":__embind_register_emval,"k":__embind_register_float,"e":__embind_register_function,"b":__embind_register_integer,"a":__embind_register_memory_view,"j":__embind_register_std_string,"g":__embind_register_std_wstring,"u":__embind_register_value_object,"d":__embind_register_value_object_field,"x":__embind_register_void,"i":__emval_decref,"m":__emval_get_global,"l":__emval_incref,"y":__emval_new,"n":__emval_take_value,"f":_abort,"t":_emscripten_memcpy_big,"s":_emscripten_resize_heap};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["A"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["B"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["D"]).apply(null,arguments)};var __embind_initialize_bindings=Module["__embind_initialize_bindings"]=function(){return(__embind_initialize_bindings=Module["__embind_initialize_bindings"]=Module["asm"]["E"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["F"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["G"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["H"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["I"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["J"]).apply(null,arguments)};Module["ccall"]=ccall;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();
32
-
33
-
34
- return CharLSWASM.ready
35
- }
36
- );
37
- })();
38
- if (true)
39
- module.exports = CharLSWASM;
40
- else {}
41
-
42
-
43
- /***/ }),
44
-
45
- /***/ "../../../node_modules/@cornerstonejs/codec-libjpeg-turbo-8bit/dist/libjpegturbowasm_decode.js":
46
- /*!*****************************************************************************************************!*\
47
- !*** ../../../node_modules/@cornerstonejs/codec-libjpeg-turbo-8bit/dist/libjpegturbowasm_decode.js ***!
48
- \*****************************************************************************************************/
49
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
50
-
51
- var __filename = "/index.js";
52
- var __dirname = "/";
53
-
54
- var libjpegturbowasm_decode = (() => {
55
- var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
56
- if (true) _scriptDir = _scriptDir || __filename;
57
- return (
58
- function(libjpegturbowasm_decode) {
59
- libjpegturbowasm_decode = libjpegturbowasm_decode || {};
60
-
61
- var Module=typeof libjpegturbowasm_decode!="undefined"?libjpegturbowasm_decode:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;function logExceptionOnExit(e){if(e instanceof ExitStatus)return;let toLog=e;err("exiting due to exception: "+toLog)}if(ENVIRONMENT_IS_NODE){var fs=__webpack_require__(/*! fs */ "?acd3");var nodePath=__webpack_require__(/*! path */ "?6bec");if(ENVIRONMENT_IS_WORKER){scriptDirectory=nodePath.dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",function(reason){throw reason});quit_=(status,toThrow)=>{if(keepRuntimeAlive()){process["exitCode"]=status;throw toThrow}logExceptionOnExit(toThrow);process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=title=>document.title=title}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||52428800;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile;wasmBinaryFile="libjpegturbowasm_decode.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["K"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["M"];addOnInit(Module["asm"]["L"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(function(instance){return instance}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);readyPromiseReject(e)}}instantiateAsync().catch(readyPromiseReject);return{}}function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module)}}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){HEAPU32[this.ptr+4>>2]=type};this.get_type=function(){return HEAPU32[this.ptr+4>>2]};this.set_destructor=function(destructor){HEAPU32[this.ptr+8>>2]=destructor};this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+12>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+12>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+13>>0]!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=prev-1;return prev===1};this.set_adjusted_ptr=function(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr};this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var structRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAP32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}return name}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i<myTypes.length;++i){registerType(myTypes[i],myTypeConverters[i])}}var typeConverters=new Array(dependentTypes.length);var unregisteredTypes=[];var registered=0;dependentTypes.forEach((dt,i)=>{if(registeredTypes.hasOwnProperty(dt)){typeConverters[i]=registeredTypes[dt]}else{unregisteredTypes.push(dt);if(!awaitingDependencies.hasOwnProperty(dt)){awaitingDependencies[dt]=[]}awaitingDependencies[dt].push(()=>{typeConverters[i]=registeredTypes[dt];++registered;if(registered===unregisteredTypes.length){onComplete(typeConverters)}})}});if(0===unregisteredTypes.length){onComplete(typeConverters)}}function __embind_finalize_value_object(structType){var reg=structRegistrations[structType];delete structRegistrations[structType];var rawConstructor=reg.rawConstructor;var rawDestructor=reg.rawDestructor;var fieldRecords=reg.fields;var fieldTypes=fieldRecords.map(field=>field.getterReturnType).concat(fieldRecords.map(field=>field.setterArgumentType));whenDependentTypesAreResolved([structType],fieldTypes,fieldTypes=>{var fields={};fieldRecords.forEach((field,i)=>{var fieldName=field.fieldName;var getterReturnType=fieldTypes[i];var getter=field.getter;var getterContext=field.getterContext;var setterArgumentType=fieldTypes[i+fieldRecords.length];var setter=field.setter;var setterContext=field.setterContext;fields[fieldName]={read:ptr=>{return getterReturnType["fromWireType"](getter(getterContext,ptr))},write:(ptr,o)=>{var destructors=[];setter(setterContext,ptr,setterArgumentType["toWireType"](destructors,o));runDestructors(destructors)}}});return[{name:reg.name,"fromWireType":function(ptr){var rv={};for(var i in fields){rv[i]=fields[i].read(ptr)}rawDestructor(ptr);return rv},"toWireType":function(destructors,o){for(var fieldName in fields){if(!(fieldName in o)){throw new TypeError('Missing field: "'+fieldName+'"')}}var ptr=rawConstructor();for(fieldName in fields){fields[fieldName].write(ptr,o[fieldName])}if(destructors!==null){destructors.push(rawDestructor,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:rawDestructor}]})}function __embind_register_bigint(primitiveType,name,size,minRange,maxRange){}function getShiftFromSize(size){switch(size){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+size)}}function embind_init_charCodes(){var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes}var embind_charCodes=undefined;function readLatin1String(ptr){var ret="";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret}var BindingError=undefined;function throwBindingError(message){throw new BindingError(message)}function registerType(rawType,registeredInstance,options={}){if(!("argPackAdvance"in registeredInstance)){throw new TypeError("registerType registeredInstance requires argPackAdvance")}var name=registeredInstance.name;if(!rawType){throwBindingError('type "'+name+'" must have a positive integer typeid pointer')}if(registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations){return}else{throwBindingError("Cannot register type '"+name+"' twice")}}registeredTypes[rawType]=registeredInstance;delete typeDependencies[rawType];if(awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType];delete awaitingDependencies[rawType];callbacks.forEach(cb=>cb())}}function __embind_register_bool(rawType,name,size,trueValue,falseValue){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(wt){return!!wt},"toWireType":function(destructors,o){return o?trueValue:falseValue},"argPackAdvance":8,"readValueFromPointer":function(pointer){var heap;if(size===1){heap=HEAP8}else if(size===2){heap=HEAP16}else if(size===4){heap=HEAP32}else{throw new TypeError("Unknown boolean type size: "+name)}return this["fromWireType"](heap[pointer>>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationRegistry=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}var registeredPointers={};function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}var delayFunction=undefined;function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function attachFinalizer(handle){if("undefined"===typeof FinalizationRegistry){attachFinalizer=handle=>handle;return handle}finalizationRegistry=new FinalizationRegistry(info=>{releaseClassHandle(info.$$)});attachFinalizer=handle=>{var $$=handle.$$;var hasSmartPtr=!!$$.smartPtr;if(hasSmartPtr){var info={$$:$$};finalizationRegistry.register(handle,info,handle)}return handle};detachFinalizer=handle=>finalizationRegistry.unregister(handle);return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+embindRepr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+embindRepr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,Emval.toHandle(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+embindRepr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&&registeredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}var wasmTableMirror=[];function getWasmTableEntry(funcPtr){var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}var rtn=getWasmTableEntry(ptr).apply(null,args);return rtn}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=0;Object.assign(argCache,arguments);return dynCall(sig,ptr,argCache)}}function embind__requireFunction(signature,rawFunction){signature=readLatin1String(signature);function makeDynCaller(){if(signature.includes("j")){return getDynCaller(signature,rawFunction)}return getWasmTableEntry(rawFunction)}var fp=makeDynCaller();if(typeof fp!="function"){throwBindingError("unknown function pointer with signature "+signature+": "+rawFunction)}return fp}var UnboundTypeError=undefined;function getTypeName(type){var ptr=___getTypeName(type);var rv=readLatin1String(ptr);_free(ptr);return rv}function throwUnboundTypeError(message,types){var unboundTypes=[];var seen={};function visit(type){if(seen[type]){return}if(registeredTypes[type]){return}if(typeDependencies[type]){typeDependencies[type].forEach(visit);return}unboundTypes.push(type);seen[type]=true}types.forEach(visit);throw new UnboundTypeError(message+": "+unboundTypes.map(getTypeName).join([", "]))}function __embind_register_class(rawType,rawPointerType,rawConstPointerType,baseClassRawType,getActualTypeSignature,getActualType,upcastSignature,upcast,downcastSignature,downcast,name,destructorSignature,rawDestructor){name=readLatin1String(name);getActualType=embind__requireFunction(getActualTypeSignature,getActualType);if(upcast){upcast=embind__requireFunction(upcastSignature,upcast)}if(downcast){downcast=embind__requireFunction(downcastSignature,downcast)}rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);var legalFunctionName=makeLegalFunctionName(name);exposePublicSymbol(legalFunctionName,function(){throwUnboundTypeError("Cannot construct "+name+" due to unbound types",[baseClassRawType])});whenDependentTypesAreResolved([rawType,rawPointerType,rawConstPointerType],baseClassRawType?[baseClassRawType]:[],function(base){base=base[0];var baseClass;var basePrototype;if(baseClassRawType){baseClass=base.registeredClass;basePrototype=baseClass.instancePrototype}else{basePrototype=ClassHandle.prototype}var constructor=createNamedFunction(legalFunctionName,function(){if(Object.getPrototypeOf(this)!==instancePrototype){throw new BindingError("Use 'new' to construct "+name)}if(undefined===registeredClass.constructor_body){throw new BindingError(name+" has no accessible constructor")}var body=registeredClass.constructor_body[arguments.length];if(undefined===body){throw new BindingError("Tried to invoke ctor of "+name+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(registeredClass.constructor_body).toString()+") parameters instead!")}return body.apply(this,arguments)});var instancePrototype=Object.create(basePrototype,{constructor:{value:constructor}});constructor.prototype=instancePrototype;var registeredClass=new RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast);var referenceConverter=new RegisteredPointer(name,registeredClass,true,false,false);var pointerConverter=new RegisteredPointer(name+"*",registeredClass,false,false,false);var constPointerConverter=new RegisteredPointer(name+" const*",registeredClass,false,true,false);registeredPointers[rawType]={pointerType:pointerConverter,constPointerType:constPointerConverter};replacePublicSymbol(legalFunctionName,constructor);return[referenceConverter,pointerConverter,constPointerConverter]})}function heap32VectorToArray(count,firstElement){var array=[];for(var i=0;i<count;i++){array.push(HEAPU32[firstElement+i*4>>2])}return array}function new_(constructor,argumentList){if(!(constructor instanceof Function)){throw new TypeError("new_ called with constructor type "+typeof constructor+" which is not a function")}var dummy=createNamedFunction(constructor.name||"unknownFunctionName",function(){});dummy.prototype=constructor.prototype;var obj=new dummy;var r=constructor.apply(obj,argumentList);return r instanceof Object?r:obj}function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFunc,cppTargetFunc){var argCount=argTypes.length;if(argCount<2){throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!")}var isClassMethodFunc=argTypes[1]!==null&&classType!==null;var needsDestructorStack=false;for(var i=1;i<argTypes.length;++i){if(argTypes[i]!==null&&argTypes[i].destructorFunction===undefined){needsDestructorStack=true;break}}var returns=argTypes[0].name!=="void";var argsList="";var argsListWired="";for(var i=0;i<argCount-2;++i){argsList+=(i!==0?", ":"")+"arg"+i;argsListWired+=(i!==0?", ":"")+"arg"+i+"Wired"}var invokerFnBody="return function "+makeLegalFunctionName(humanName)+"("+argsList+") {\n"+"if (arguments.length !== "+(argCount-2)+") {\n"+"throwBindingError('function "+humanName+" called with ' + arguments.length + ' arguments, expected "+(argCount-2)+" args!');\n"+"}\n";if(needsDestructorStack){invokerFnBody+="var destructors = [];\n"}var dtorStack=needsDestructorStack?"destructors":"null";var args1=["throwBindingError","invoker","fn","runDestructors","retType","classParam"];var args2=[throwBindingError,cppInvokerFunc,cppTargetFunc,runDestructors,argTypes[0],argTypes[1]];if(isClassMethodFunc){invokerFnBody+="var thisWired = classParam.toWireType("+dtorStack+", this);\n"}for(var i=0;i<argCount-2;++i){invokerFnBody+="var arg"+i+"Wired = argType"+i+".toWireType("+dtorStack+", arg"+i+"); // "+argTypes[i+2].name+"\n";args1.push("argType"+i);args2.push(argTypes[i+2])}if(isClassMethodFunc){argsListWired="thisWired"+(argsListWired.length>0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i<argTypes.length;++i){var paramName=i===1?"thisWired":"arg"+(i-2)+"Wired";if(argTypes[i].destructorFunction!==null){invokerFnBody+=paramName+"_dtor("+paramName+"); // "+argTypes[i].name+"\n";args1.push(paramName+"_dtor");args2.push(argTypes[i].destructorFunction)}}}if(returns){invokerFnBody+="var ret = retType.fromWireType(rv);\n"+"return ret;\n"}else{}invokerFnBody+="}\n";args1.push(invokerFnBody);var invokerFunction=new_(Function,args1).apply(null,args2);return invokerFunction}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=()=>{throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){argTypes.splice(1,0,null);classType.registeredClass.constructor_body[argCount-1]=craftInvokerFunction(humanName,argTypes,null,invoker,rawConstructor);return[]});return[]})}function __embind_register_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,context,isPureVirtual){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;if(methodName.startsWith("@@")){methodName=Symbol[methodName.substring(2)]}if(isPureVirtual){classType.registeredClass.pureVirtualFunctions.push(methodName)}function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.instancePrototype;var method=proto[methodName];if(undefined===method||undefined===method.overloadTable&&method.className!==classType.name&&method.argCount===argCount-2){unboundTypesHandler.argCount=argCount-2;unboundTypesHandler.className=classType.name;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-2]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var memberFunction=craftInvokerFunction(humanName,argTypes,classType,rawInvoker,context);if(undefined===proto[methodName].overloadTable){memberFunction.argCount=argCount-2;proto[methodName]=memberFunction}else{proto[methodName].overloadTable[argCount-2]=memberFunction}return[]});return[]})}var emval_free_list=[];var emval_handle_array=[{},{value:undefined},{value:null},{value:true},{value:false}];function __emval_decref(handle){if(handle>4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i<emval_handle_array.length;++i){if(emval_handle_array[i]!==undefined){++count}}return count}function get_first_emval(){for(var i=5;i<emval_handle_array.length;++i){if(emval_handle_array[i]!==undefined){return emval_handle_array[i]}}return null}function init_emval(){Module["count_emval_handles"]=count_emval_handles;Module["get_first_emval"]=get_first_emval}var Emval={toValue:handle=>{if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value},toHandle:value=>{switch(value){case undefined:return 1;case null:return 2;case true:return 3;case false:return 4;default:{var handle=emval_free_list.length?emval_free_list.pop():emval_handle_array.length;emval_handle_array[handle]={refcount:1,value:value};return handle}}}};function __embind_register_emval(rawType,name){name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(handle){var rv=Emval.toValue(handle);__emval_decref(handle);return rv},"toWireType":function(destructors,value){return Emval.toHandle(value)},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:null})}function embindRepr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=value=>value;if(minRange===0){var bitshift=32-8*size;fromWireType=value=>value<<bitshift>>>bitshift}var isUnsignedType=name.includes("unsigned");var checkAssertions=(value,toTypeName)=>{};var toWireType;if(isUnsignedType){toWireType=function(destructors,value){checkAssertions(value,this.name);return value>>>0}}else{toWireType=function(destructors,value){checkAssertions(value,this.name);return value}}registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":toWireType,"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var payload=value+4;var str;if(stdStringIsUTF8){var decodeStartPtr=payload;for(var i=0;i<=length;++i){var currentBytePtr=payload+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i<length;++i){a[i]=String.fromCharCode(HEAPU8[payload+i])}str=a.join("")}_free(value);return str},"toWireType":function(destructors,value){if(value instanceof ArrayBuffer){value=new Uint8Array(value)}var length;var valueIsOfTypeString=typeof value=="string";if(!(valueIsOfTypeString||value instanceof Uint8Array||value instanceof Uint8ClampedArray||value instanceof Int8Array)){throwBindingError("Cannot pass non-string to std::string")}if(stdStringIsUTF8&&valueIsOfTypeString){length=lengthBytesUTF8(value)}else{length=value.length}var base=_malloc(4+length+1);var ptr=base+4;HEAPU32[base>>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr,length+1)}else{if(valueIsOfTypeString){for(var i=0;i<length;++i){var charCode=value.charCodeAt(i);if(charCode>255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+i]=charCode}}else{for(var i=0;i<length;++i){HEAPU8[ptr+i]=value[i]}}}if(destructors!==null){destructors.push(_free,base)}return base},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}var UTF16Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder)return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr));var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite<str.length*2?maxBytesToWrite/2:str.length;for(var i=0;i<numCharsToWrite;++i){var codeUnit=str.charCodeAt(i);HEAP16[outPtr>>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);if(codeUnit>=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);if(codeUnit>=55296&&codeUnit<=57343)++i;len+=4}return len}function __embind_register_std_wstring(rawType,charSize,name){name=readLatin1String(name);var decodeString,encodeString,getHeap,lengthBytesUTF,shift;if(charSize===2){decodeString=UTF16ToString;encodeString=stringToUTF16;lengthBytesUTF=lengthBytesUTF16;getHeap=()=>HEAPU16;shift=1}else if(charSize===4){decodeString=UTF32ToString;encodeString=stringToUTF32;lengthBytesUTF=lengthBytesUTF32;getHeap=()=>HEAPU32;shift=2}registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value=="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_object(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){structRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),fields:[]}}function __embind_register_value_object_field(structType,fieldName,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){structRegistrations[structType].fields.push({fieldName:readLatin1String(fieldName),getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function __emscripten_throw_longjmp(){throw Infinity}var emval_symbols={};function getStringOrSymbol(address){var symbol=emval_symbols[address];if(symbol===undefined){return readLatin1String(address)}return symbol}function emval_get_global(){if(typeof globalThis=="object"){return globalThis}return function(){return Function}()("return this")()}function __emval_get_global(name){if(name===0){return Emval.toHandle(emval_get_global())}else{name=getStringOrSymbol(name);return Emval.toHandle(emval_get_global()[name])}}function __emval_incref(handle){if(handle>4){emval_handle_array[handle].refcount+=1}}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function craftEmvalAllocator(argCount){var argsList="";for(var i=0;i<argCount;++i){argsList+=(i!==0?", ":"")+"arg"+i}var getMemory=()=>HEAPU32;var functionBody="return function emval_allocator_"+argCount+"(constructor, argTypes, args) {\n"+" var HEAPU32 = getMemory();\n";for(var i=0;i<argCount;++i){functionBody+="var argType"+i+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+i+"');\n"+"var arg"+i+" = argType"+i+".readValueFromPointer(args);\n"+"args += argType"+i+"['argPackAdvance'];\n"+"argTypes += 4;\n"}functionBody+="var obj = new constructor("+argsList+");\n"+"return valueToHandle(obj);\n"+"}\n";return new Function("requireRegisteredType","Module","valueToHandle","getMemory",functionBody)(requireRegisteredType,Module,Emval.toHandle,getMemory)}var emval_newers={};function __emval_new(handle,argCount,argTypes,args){handle=Emval.toValue(handle);var newer=emval_newers[argCount];if(!newer){newer=craftEmvalAllocator(argCount);emval_newers[argCount]=newer}return newer(handle,argTypes,args)}function __emval_take_value(type,arg){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](arg);return Emval.toHandle(v)}function _abort(){abort("")}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}let alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var SYSCALLS={varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret}};function _environ_get(__environ,environ_buf){var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}function _environ_sizes_get(penviron_count,penviron_buf_size){var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAPU32[penviron_buf_size>>2]=bufSize;return 0}function _proc_exit(code){EXITSTATUS=code;if(!keepRuntimeAlive()){if(Module["onExit"])Module["onExit"](code);ABORT=true}quit_(code,new ExitStatus(code))}function exitJS(status,implicit){EXITSTATUS=status;_proc_exit(status)}var _exit=exitJS;function _fd_close(fd){return 52}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){return 70}var printCharBuffers=[null,[],[]];function printChar(stream,curr){var buffer=printCharBuffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}}function _fd_write(fd,iov,iovcnt,pnum){var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j])}num+=len}HEAPU32[pnum>>2]=num;return 0}function getCFunc(ident){var func=Module["_"+ident];return func}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string"){return UTF8ToString(ret)}if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func.apply(null,cArgs);function onDone(ret){if(stack!==0)stackRestore(stack);return convertReturnValue(ret)}ret=onDone(ret);return ret}InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_embind();init_RegisteredPointer();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();var asmLibraryArg={"g":___cxa_throw,"A":__embind_finalize_value_object,"w":__embind_register_bigint,"F":__embind_register_bool,"u":__embind_register_class,"t":__embind_register_class_constructor,"c":__embind_register_class_function,"E":__embind_register_emval,"m":__embind_register_float,"b":__embind_register_integer,"a":__embind_register_memory_view,"l":__embind_register_std_string,"h":__embind_register_std_wstring,"J":__embind_register_value_object,"d":__embind_register_value_object_field,"G":__embind_register_void,"x":__emscripten_throw_longjmp,"i":__emval_decref,"r":__emval_get_global,"p":__emval_incref,"q":__emval_new,"s":__emval_take_value,"j":_abort,"D":_emscripten_memcpy_big,"y":_emscripten_resize_heap,"z":_environ_get,"B":_environ_sizes_get,"I":_exit,"C":_fd_close,"v":_fd_seek,"k":_fd_write,"o":invoke_ii,"n":invoke_iii,"H":invoke_iiii,"f":invoke_vi,"e":invoke_viii};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["L"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["N"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["O"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["P"]).apply(null,arguments)};var __embind_initialize_bindings=Module["__embind_initialize_bindings"]=function(){return(__embind_initialize_bindings=Module["__embind_initialize_bindings"]=Module["asm"]["Q"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["R"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["S"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["T"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["U"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["V"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["W"]).apply(null,arguments)};function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}Module["ccall"]=ccall;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();
62
-
63
-
64
- return libjpegturbowasm_decode.ready
65
- }
66
- );
67
- })();
68
- if (true)
69
- module.exports = libjpegturbowasm_decode;
70
- else {}
71
-
72
-
73
- /***/ }),
74
-
75
- /***/ "../../../node_modules/@cornerstonejs/codec-openjpeg/dist/openjpegwasm_decode.js":
76
- /*!***************************************************************************************!*\
77
- !*** ../../../node_modules/@cornerstonejs/codec-openjpeg/dist/openjpegwasm_decode.js ***!
78
- \***************************************************************************************/
79
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
80
-
81
- var __filename = "/index.js";
82
- var __dirname = "/";
83
-
84
- var OpenJPEGWASM = (() => {
85
- var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
86
- if (true) _scriptDir = _scriptDir || __filename;
87
- return (
88
- function(OpenJPEGWASM) {
89
- OpenJPEGWASM = OpenJPEGWASM || {};
90
-
91
- var Module=typeof OpenJPEGWASM!="undefined"?OpenJPEGWASM:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;function logExceptionOnExit(e){if(e instanceof ExitStatus)return;let toLog=e;err("exiting due to exception: "+toLog)}if(ENVIRONMENT_IS_NODE){var fs=__webpack_require__(/*! fs */ "?4441");var nodePath=__webpack_require__(/*! path */ "?9e30");if(ENVIRONMENT_IS_WORKER){scriptDirectory=nodePath.dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",function(reason){throw reason});quit_=(status,toThrow)=>{if(keepRuntimeAlive()){process["exitCode"]=status;throw toThrow}logExceptionOnExit(toThrow);process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=title=>document.title=title}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||52428800;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile;wasmBinaryFile="openjpegwasm_decode.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["E"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["G"];addOnInit(Module["asm"]["F"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(function(instance){return instance}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);readyPromiseReject(e)}}instantiateAsync().catch(readyPromiseReject);return{}}function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module)}}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){HEAPU32[this.ptr+4>>2]=type};this.get_type=function(){return HEAPU32[this.ptr+4>>2]};this.set_destructor=function(destructor){HEAPU32[this.ptr+8>>2]=destructor};this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+12>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+12>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+13>>0]!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=prev-1;return prev===1};this.set_adjusted_ptr=function(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr};this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var structRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAP32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}return name}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i<myTypes.length;++i){registerType(myTypes[i],myTypeConverters[i])}}var typeConverters=new Array(dependentTypes.length);var unregisteredTypes=[];var registered=0;dependentTypes.forEach((dt,i)=>{if(registeredTypes.hasOwnProperty(dt)){typeConverters[i]=registeredTypes[dt]}else{unregisteredTypes.push(dt);if(!awaitingDependencies.hasOwnProperty(dt)){awaitingDependencies[dt]=[]}awaitingDependencies[dt].push(()=>{typeConverters[i]=registeredTypes[dt];++registered;if(registered===unregisteredTypes.length){onComplete(typeConverters)}})}});if(0===unregisteredTypes.length){onComplete(typeConverters)}}function __embind_finalize_value_object(structType){var reg=structRegistrations[structType];delete structRegistrations[structType];var rawConstructor=reg.rawConstructor;var rawDestructor=reg.rawDestructor;var fieldRecords=reg.fields;var fieldTypes=fieldRecords.map(field=>field.getterReturnType).concat(fieldRecords.map(field=>field.setterArgumentType));whenDependentTypesAreResolved([structType],fieldTypes,fieldTypes=>{var fields={};fieldRecords.forEach((field,i)=>{var fieldName=field.fieldName;var getterReturnType=fieldTypes[i];var getter=field.getter;var getterContext=field.getterContext;var setterArgumentType=fieldTypes[i+fieldRecords.length];var setter=field.setter;var setterContext=field.setterContext;fields[fieldName]={read:ptr=>{return getterReturnType["fromWireType"](getter(getterContext,ptr))},write:(ptr,o)=>{var destructors=[];setter(setterContext,ptr,setterArgumentType["toWireType"](destructors,o));runDestructors(destructors)}}});return[{name:reg.name,"fromWireType":function(ptr){var rv={};for(var i in fields){rv[i]=fields[i].read(ptr)}rawDestructor(ptr);return rv},"toWireType":function(destructors,o){for(var fieldName in fields){if(!(fieldName in o)){throw new TypeError('Missing field: "'+fieldName+'"')}}var ptr=rawConstructor();for(fieldName in fields){fields[fieldName].write(ptr,o[fieldName])}if(destructors!==null){destructors.push(rawDestructor,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:rawDestructor}]})}function __embind_register_bigint(primitiveType,name,size,minRange,maxRange){}function getShiftFromSize(size){switch(size){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+size)}}function embind_init_charCodes(){var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes}var embind_charCodes=undefined;function readLatin1String(ptr){var ret="";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret}var BindingError=undefined;function throwBindingError(message){throw new BindingError(message)}function registerType(rawType,registeredInstance,options={}){if(!("argPackAdvance"in registeredInstance)){throw new TypeError("registerType registeredInstance requires argPackAdvance")}var name=registeredInstance.name;if(!rawType){throwBindingError('type "'+name+'" must have a positive integer typeid pointer')}if(registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations){return}else{throwBindingError("Cannot register type '"+name+"' twice")}}registeredTypes[rawType]=registeredInstance;delete typeDependencies[rawType];if(awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType];delete awaitingDependencies[rawType];callbacks.forEach(cb=>cb())}}function __embind_register_bool(rawType,name,size,trueValue,falseValue){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(wt){return!!wt},"toWireType":function(destructors,o){return o?trueValue:falseValue},"argPackAdvance":8,"readValueFromPointer":function(pointer){var heap;if(size===1){heap=HEAP8}else if(size===2){heap=HEAP16}else if(size===4){heap=HEAP32}else{throw new TypeError("Unknown boolean type size: "+name)}return this["fromWireType"](heap[pointer>>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationRegistry=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}var registeredPointers={};function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}var delayFunction=undefined;function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function attachFinalizer(handle){if("undefined"===typeof FinalizationRegistry){attachFinalizer=handle=>handle;return handle}finalizationRegistry=new FinalizationRegistry(info=>{releaseClassHandle(info.$$)});attachFinalizer=handle=>{var $$=handle.$$;var hasSmartPtr=!!$$.smartPtr;if(hasSmartPtr){var info={$$:$$};finalizationRegistry.register(handle,info,handle)}return handle};detachFinalizer=handle=>finalizationRegistry.unregister(handle);return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+embindRepr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+embindRepr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,Emval.toHandle(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+embindRepr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&&registeredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}var wasmTableMirror=[];function getWasmTableEntry(funcPtr){var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}var rtn=getWasmTableEntry(ptr).apply(null,args);return rtn}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=0;Object.assign(argCache,arguments);return dynCall(sig,ptr,argCache)}}function embind__requireFunction(signature,rawFunction){signature=readLatin1String(signature);function makeDynCaller(){if(signature.includes("j")){return getDynCaller(signature,rawFunction)}return getWasmTableEntry(rawFunction)}var fp=makeDynCaller();if(typeof fp!="function"){throwBindingError("unknown function pointer with signature "+signature+": "+rawFunction)}return fp}var UnboundTypeError=undefined;function getTypeName(type){var ptr=___getTypeName(type);var rv=readLatin1String(ptr);_free(ptr);return rv}function throwUnboundTypeError(message,types){var unboundTypes=[];var seen={};function visit(type){if(seen[type]){return}if(registeredTypes[type]){return}if(typeDependencies[type]){typeDependencies[type].forEach(visit);return}unboundTypes.push(type);seen[type]=true}types.forEach(visit);throw new UnboundTypeError(message+": "+unboundTypes.map(getTypeName).join([", "]))}function __embind_register_class(rawType,rawPointerType,rawConstPointerType,baseClassRawType,getActualTypeSignature,getActualType,upcastSignature,upcast,downcastSignature,downcast,name,destructorSignature,rawDestructor){name=readLatin1String(name);getActualType=embind__requireFunction(getActualTypeSignature,getActualType);if(upcast){upcast=embind__requireFunction(upcastSignature,upcast)}if(downcast){downcast=embind__requireFunction(downcastSignature,downcast)}rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);var legalFunctionName=makeLegalFunctionName(name);exposePublicSymbol(legalFunctionName,function(){throwUnboundTypeError("Cannot construct "+name+" due to unbound types",[baseClassRawType])});whenDependentTypesAreResolved([rawType,rawPointerType,rawConstPointerType],baseClassRawType?[baseClassRawType]:[],function(base){base=base[0];var baseClass;var basePrototype;if(baseClassRawType){baseClass=base.registeredClass;basePrototype=baseClass.instancePrototype}else{basePrototype=ClassHandle.prototype}var constructor=createNamedFunction(legalFunctionName,function(){if(Object.getPrototypeOf(this)!==instancePrototype){throw new BindingError("Use 'new' to construct "+name)}if(undefined===registeredClass.constructor_body){throw new BindingError(name+" has no accessible constructor")}var body=registeredClass.constructor_body[arguments.length];if(undefined===body){throw new BindingError("Tried to invoke ctor of "+name+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(registeredClass.constructor_body).toString()+") parameters instead!")}return body.apply(this,arguments)});var instancePrototype=Object.create(basePrototype,{constructor:{value:constructor}});constructor.prototype=instancePrototype;var registeredClass=new RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast);var referenceConverter=new RegisteredPointer(name,registeredClass,true,false,false);var pointerConverter=new RegisteredPointer(name+"*",registeredClass,false,false,false);var constPointerConverter=new RegisteredPointer(name+" const*",registeredClass,false,true,false);registeredPointers[rawType]={pointerType:pointerConverter,constPointerType:constPointerConverter};replacePublicSymbol(legalFunctionName,constructor);return[referenceConverter,pointerConverter,constPointerConverter]})}function heap32VectorToArray(count,firstElement){var array=[];for(var i=0;i<count;i++){array.push(HEAPU32[firstElement+i*4>>2])}return array}function new_(constructor,argumentList){if(!(constructor instanceof Function)){throw new TypeError("new_ called with constructor type "+typeof constructor+" which is not a function")}var dummy=createNamedFunction(constructor.name||"unknownFunctionName",function(){});dummy.prototype=constructor.prototype;var obj=new dummy;var r=constructor.apply(obj,argumentList);return r instanceof Object?r:obj}function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFunc,cppTargetFunc){var argCount=argTypes.length;if(argCount<2){throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!")}var isClassMethodFunc=argTypes[1]!==null&&classType!==null;var needsDestructorStack=false;for(var i=1;i<argTypes.length;++i){if(argTypes[i]!==null&&argTypes[i].destructorFunction===undefined){needsDestructorStack=true;break}}var returns=argTypes[0].name!=="void";var argsList="";var argsListWired="";for(var i=0;i<argCount-2;++i){argsList+=(i!==0?", ":"")+"arg"+i;argsListWired+=(i!==0?", ":"")+"arg"+i+"Wired"}var invokerFnBody="return function "+makeLegalFunctionName(humanName)+"("+argsList+") {\n"+"if (arguments.length !== "+(argCount-2)+") {\n"+"throwBindingError('function "+humanName+" called with ' + arguments.length + ' arguments, expected "+(argCount-2)+" args!');\n"+"}\n";if(needsDestructorStack){invokerFnBody+="var destructors = [];\n"}var dtorStack=needsDestructorStack?"destructors":"null";var args1=["throwBindingError","invoker","fn","runDestructors","retType","classParam"];var args2=[throwBindingError,cppInvokerFunc,cppTargetFunc,runDestructors,argTypes[0],argTypes[1]];if(isClassMethodFunc){invokerFnBody+="var thisWired = classParam.toWireType("+dtorStack+", this);\n"}for(var i=0;i<argCount-2;++i){invokerFnBody+="var arg"+i+"Wired = argType"+i+".toWireType("+dtorStack+", arg"+i+"); // "+argTypes[i+2].name+"\n";args1.push("argType"+i);args2.push(argTypes[i+2])}if(isClassMethodFunc){argsListWired="thisWired"+(argsListWired.length>0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i<argTypes.length;++i){var paramName=i===1?"thisWired":"arg"+(i-2)+"Wired";if(argTypes[i].destructorFunction!==null){invokerFnBody+=paramName+"_dtor("+paramName+"); // "+argTypes[i].name+"\n";args1.push(paramName+"_dtor");args2.push(argTypes[i].destructorFunction)}}}if(returns){invokerFnBody+="var ret = retType.fromWireType(rv);\n"+"return ret;\n"}else{}invokerFnBody+="}\n";args1.push(invokerFnBody);var invokerFunction=new_(Function,args1).apply(null,args2);return invokerFunction}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=()=>{throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){argTypes.splice(1,0,null);classType.registeredClass.constructor_body[argCount-1]=craftInvokerFunction(humanName,argTypes,null,invoker,rawConstructor);return[]});return[]})}function __embind_register_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,context,isPureVirtual){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;if(methodName.startsWith("@@")){methodName=Symbol[methodName.substring(2)]}if(isPureVirtual){classType.registeredClass.pureVirtualFunctions.push(methodName)}function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.instancePrototype;var method=proto[methodName];if(undefined===method||undefined===method.overloadTable&&method.className!==classType.name&&method.argCount===argCount-2){unboundTypesHandler.argCount=argCount-2;unboundTypesHandler.className=classType.name;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-2]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var memberFunction=craftInvokerFunction(humanName,argTypes,classType,rawInvoker,context);if(undefined===proto[methodName].overloadTable){memberFunction.argCount=argCount-2;proto[methodName]=memberFunction}else{proto[methodName].overloadTable[argCount-2]=memberFunction}return[]});return[]})}var emval_free_list=[];var emval_handle_array=[{},{value:undefined},{value:null},{value:true},{value:false}];function __emval_decref(handle){if(handle>4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i<emval_handle_array.length;++i){if(emval_handle_array[i]!==undefined){++count}}return count}function get_first_emval(){for(var i=5;i<emval_handle_array.length;++i){if(emval_handle_array[i]!==undefined){return emval_handle_array[i]}}return null}function init_emval(){Module["count_emval_handles"]=count_emval_handles;Module["get_first_emval"]=get_first_emval}var Emval={toValue:handle=>{if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value},toHandle:value=>{switch(value){case undefined:return 1;case null:return 2;case true:return 3;case false:return 4;default:{var handle=emval_free_list.length?emval_free_list.pop():emval_handle_array.length;emval_handle_array[handle]={refcount:1,value:value};return handle}}}};function __embind_register_emval(rawType,name){name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(handle){var rv=Emval.toValue(handle);__emval_decref(handle);return rv},"toWireType":function(destructors,value){return Emval.toHandle(value)},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:null})}function embindRepr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=value=>value;if(minRange===0){var bitshift=32-8*size;fromWireType=value=>value<<bitshift>>>bitshift}var isUnsignedType=name.includes("unsigned");var checkAssertions=(value,toTypeName)=>{};var toWireType;if(isUnsignedType){toWireType=function(destructors,value){checkAssertions(value,this.name);return value>>>0}}else{toWireType=function(destructors,value){checkAssertions(value,this.name);return value}}registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":toWireType,"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var payload=value+4;var str;if(stdStringIsUTF8){var decodeStartPtr=payload;for(var i=0;i<=length;++i){var currentBytePtr=payload+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i<length;++i){a[i]=String.fromCharCode(HEAPU8[payload+i])}str=a.join("")}_free(value);return str},"toWireType":function(destructors,value){if(value instanceof ArrayBuffer){value=new Uint8Array(value)}var length;var valueIsOfTypeString=typeof value=="string";if(!(valueIsOfTypeString||value instanceof Uint8Array||value instanceof Uint8ClampedArray||value instanceof Int8Array)){throwBindingError("Cannot pass non-string to std::string")}if(stdStringIsUTF8&&valueIsOfTypeString){length=lengthBytesUTF8(value)}else{length=value.length}var base=_malloc(4+length+1);var ptr=base+4;HEAPU32[base>>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr,length+1)}else{if(valueIsOfTypeString){for(var i=0;i<length;++i){var charCode=value.charCodeAt(i);if(charCode>255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+i]=charCode}}else{for(var i=0;i<length;++i){HEAPU8[ptr+i]=value[i]}}}if(destructors!==null){destructors.push(_free,base)}return base},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}var UTF16Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder)return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr));var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite<str.length*2?maxBytesToWrite/2:str.length;for(var i=0;i<numCharsToWrite;++i){var codeUnit=str.charCodeAt(i);HEAP16[outPtr>>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);if(codeUnit>=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);if(codeUnit>=55296&&codeUnit<=57343)++i;len+=4}return len}function __embind_register_std_wstring(rawType,charSize,name){name=readLatin1String(name);var decodeString,encodeString,getHeap,lengthBytesUTF,shift;if(charSize===2){decodeString=UTF16ToString;encodeString=stringToUTF16;lengthBytesUTF=lengthBytesUTF16;getHeap=()=>HEAPU16;shift=1}else if(charSize===4){decodeString=UTF32ToString;encodeString=stringToUTF32;lengthBytesUTF=lengthBytesUTF32;getHeap=()=>HEAPU32;shift=2}registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value=="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_object(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){structRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),fields:[]}}function __embind_register_value_object_field(structType,fieldName,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){structRegistrations[structType].fields.push({fieldName:readLatin1String(fieldName),getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}var emval_symbols={};function getStringOrSymbol(address){var symbol=emval_symbols[address];if(symbol===undefined){return readLatin1String(address)}return symbol}function emval_get_global(){if(typeof globalThis=="object"){return globalThis}return function(){return Function}()("return this")()}function __emval_get_global(name){if(name===0){return Emval.toHandle(emval_get_global())}else{name=getStringOrSymbol(name);return Emval.toHandle(emval_get_global()[name])}}function __emval_incref(handle){if(handle>4){emval_handle_array[handle].refcount+=1}}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function craftEmvalAllocator(argCount){var argsList="";for(var i=0;i<argCount;++i){argsList+=(i!==0?", ":"")+"arg"+i}var getMemory=()=>HEAPU32;var functionBody="return function emval_allocator_"+argCount+"(constructor, argTypes, args) {\n"+" var HEAPU32 = getMemory();\n";for(var i=0;i<argCount;++i){functionBody+="var argType"+i+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+i+"');\n"+"var arg"+i+" = argType"+i+".readValueFromPointer(args);\n"+"args += argType"+i+"['argPackAdvance'];\n"+"argTypes += 4;\n"}functionBody+="var obj = new constructor("+argsList+");\n"+"return valueToHandle(obj);\n"+"}\n";return new Function("requireRegisteredType","Module","valueToHandle","getMemory",functionBody)(requireRegisteredType,Module,Emval.toHandle,getMemory)}var emval_newers={};function __emval_new(handle,argCount,argTypes,args){handle=Emval.toValue(handle);var newer=emval_newers[argCount];if(!newer){newer=craftEmvalAllocator(argCount);emval_newers[argCount]=newer}return newer(handle,argTypes,args)}function __emval_take_value(type,arg){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](arg);return Emval.toHandle(v)}function _abort(){abort("")}function getHeapMax(){return 2147483648}function _emscripten_get_heap_max(){return getHeapMax()}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}let alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var SYSCALLS={varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret}};function _environ_get(__environ,environ_buf){var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAPU32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}function _environ_sizes_get(penviron_count,penviron_buf_size){var strings=getEnvStrings();HEAPU32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAPU32[penviron_buf_size>>2]=bufSize;return 0}function _fd_close(fd){return 52}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){return 70}var printCharBuffers=[null,[],[]];function printChar(stream,curr){var buffer=printCharBuffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}}function _fd_write(fd,iov,iovcnt,pnum){var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j])}num+=len}HEAPU32[pnum>>2]=num;return 0}function getCFunc(ident){var func=Module["_"+ident];return func}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string"){return UTF8ToString(ret)}if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func.apply(null,cArgs);function onDone(ret){if(stack!==0)stackRestore(stack);return convertReturnValue(ret)}ret=onDone(ret);return ret}InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_embind();init_RegisteredPointer();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();var asmLibraryArg={"D":___cxa_throw,"e":__embind_finalize_value_object,"t":__embind_register_bigint,"B":__embind_register_bool,"r":__embind_register_class,"q":__embind_register_class_constructor,"b":__embind_register_class_function,"A":__embind_register_emval,"l":__embind_register_float,"d":__embind_register_integer,"a":__embind_register_memory_view,"k":__embind_register_std_string,"f":__embind_register_std_wstring,"g":__embind_register_value_object,"c":__embind_register_value_object_field,"C":__embind_register_void,"h":__emval_decref,"o":__emval_get_global,"m":__emval_incref,"n":__emval_new,"p":__emval_take_value,"i":_abort,"v":_emscripten_get_heap_max,"z":_emscripten_memcpy_big,"u":_emscripten_resize_heap,"w":_environ_get,"x":_environ_sizes_get,"y":_fd_close,"s":_fd_seek,"j":_fd_write};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["F"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["H"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["I"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["J"]).apply(null,arguments)};var __embind_initialize_bindings=Module["__embind_initialize_bindings"]=function(){return(__embind_initialize_bindings=Module["__embind_initialize_bindings"]=Module["asm"]["K"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["L"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["M"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["N"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["O"]).apply(null,arguments)};var dynCall_iji=Module["dynCall_iji"]=function(){return(dynCall_iji=Module["dynCall_iji"]=Module["asm"]["P"]).apply(null,arguments)};var dynCall_jji=Module["dynCall_jji"]=function(){return(dynCall_jji=Module["dynCall_jji"]=Module["asm"]["Q"]).apply(null,arguments)};var dynCall_iiji=Module["dynCall_iiji"]=function(){return(dynCall_iiji=Module["dynCall_iiji"]=Module["asm"]["R"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["S"]).apply(null,arguments)};Module["ccall"]=ccall;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();
92
-
93
-
94
- return OpenJPEGWASM.ready
95
- }
96
- );
97
- })();
98
- if (true)
99
- module.exports = OpenJPEGWASM;
100
- else {}
101
-
102
-
103
- /***/ }),
104
-
105
- /***/ "../../../node_modules/@cornerstonejs/codec-openjph/dist/openjphjs.js":
106
- /*!****************************************************************************!*\
107
- !*** ../../../node_modules/@cornerstonejs/codec-openjph/dist/openjphjs.js ***!
108
- \****************************************************************************/
109
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
110
-
111
- var __filename = "/index.js";
112
- var __dirname = "/";
113
-
114
- var Module = (() => {
115
- var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
116
- if (true) _scriptDir = _scriptDir || __filename;
117
- return (
118
- function(Module) {
119
- Module = Module || {};
120
-
121
- var Module=typeof Module!="undefined"?Module:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides=Object.assign({},Module);var arguments_=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var ENVIRONMENT_IS_WEB=typeof window=="object";var ENVIRONMENT_IS_WORKER=typeof importScripts=="function";var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;function logExceptionOnExit(e){if(e instanceof ExitStatus)return;let toLog=e;err("exiting due to exception: "+toLog)}if(ENVIRONMENT_IS_NODE){var fs=__webpack_require__(/*! fs */ "?32cd");var nodePath=__webpack_require__(/*! path */ "?6c09");if(ENVIRONMENT_IS_WORKER){scriptDirectory=nodePath.dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=(filename,binary)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);return fs.readFileSync(filename,binary?undefined:"utf8")};readBinary=filename=>{var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}return ret};readAsync=(filename,onload,onerror)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,function(err,data){if(err)onerror(err);else onload(data.buffer)})};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",function(reason){throw reason});quit_=(status,toThrow)=>{if(keepRuntimeAlive()){process["exitCode"]=status;throw toThrow}logExceptionOnExit(toThrow);process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=(url,onload,onerror)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=title=>document.title=title}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);Object.assign(Module,moduleOverrides);moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var UTF8Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heapOrArray,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heapOrArray[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heapOrArray.buffer&&UTF8Decoder){return UTF8Decoder.decode(heapOrArray.subarray(idx,endPtr))}var str="";while(idx<endPtr){var u0=heapOrArray[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heapOrArray[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heapOrArray[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heapOrArray[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||52428800;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile;wasmBinaryFile="openjphjs.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["Q"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["U"];addOnInit(Module["asm"]["R"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(function(instance){return instance}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);readyPromiseReject(e)}}instantiateAsync().catch(readyPromiseReject);return{}}function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){callbacks.shift()(Module)}}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var info=new ExceptionInfo(ptr);if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(info);exception_addRef(info);return info.get_exception_ptr()}var exceptionLast=0;var wasmTableMirror=[];function getWasmTableEntry(funcPtr){var func=wasmTableMirror[funcPtr];if(!func){if(funcPtr>=wasmTableMirror.length)wasmTableMirror.length=funcPtr+1;wasmTableMirror[funcPtr]=func=wasmTable.get(funcPtr)}return func}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){getWasmTableEntry(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var info=exceptionCaught.pop();exception_decRef(info);exceptionLast=0}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-24;this.set_type=function(type){HEAPU32[this.ptr+4>>2]=type};this.get_type=function(){return HEAPU32[this.ptr+4>>2]};this.set_destructor=function(destructor){HEAPU32[this.ptr+8>>2]=destructor};this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+12>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+12>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+13>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+13>>0]!=0};this.init=function(type,destructor){this.set_adjusted_ptr(0);this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=prev-1;return prev===1};this.set_adjusted_ptr=function(adjustedPtr){HEAPU32[this.ptr+16>>2]=adjustedPtr};this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_type());if(isPointer){return HEAPU32[this.excPtr>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.excPtr}}function ___resumeException(ptr){if(!exceptionLast){exceptionLast=ptr}throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var i=0;i<arguments.length;i++){var caughtType=arguments[i];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0}var info=new ExceptionInfo(thrown);info.set_adjusted_ptr(thrown);var thrownType=info.get_type();if(!thrownType){setTempRet0(0);return thrown}for(var i=0;i<arguments.length;i++){var caughtType=arguments[i];if(caughtType===0||caughtType===thrownType){break}var adjusted_ptr_addr=info.ptr+16;if(___cxa_can_catch(caughtType,thrownType,adjusted_ptr_addr)){setTempRet0(caughtType);return thrown}}setTempRet0(thrownType);return thrown}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var structRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAP32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}return name}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i<myTypes.length;++i){registerType(myTypes[i],myTypeConverters[i])}}var typeConverters=new Array(dependentTypes.length);var unregisteredTypes=[];var registered=0;dependentTypes.forEach((dt,i)=>{if(registeredTypes.hasOwnProperty(dt)){typeConverters[i]=registeredTypes[dt]}else{unregisteredTypes.push(dt);if(!awaitingDependencies.hasOwnProperty(dt)){awaitingDependencies[dt]=[]}awaitingDependencies[dt].push(()=>{typeConverters[i]=registeredTypes[dt];++registered;if(registered===unregisteredTypes.length){onComplete(typeConverters)}})}});if(0===unregisteredTypes.length){onComplete(typeConverters)}}function __embind_finalize_value_object(structType){var reg=structRegistrations[structType];delete structRegistrations[structType];var rawConstructor=reg.rawConstructor;var rawDestructor=reg.rawDestructor;var fieldRecords=reg.fields;var fieldTypes=fieldRecords.map(field=>field.getterReturnType).concat(fieldRecords.map(field=>field.setterArgumentType));whenDependentTypesAreResolved([structType],fieldTypes,fieldTypes=>{var fields={};fieldRecords.forEach((field,i)=>{var fieldName=field.fieldName;var getterReturnType=fieldTypes[i];var getter=field.getter;var getterContext=field.getterContext;var setterArgumentType=fieldTypes[i+fieldRecords.length];var setter=field.setter;var setterContext=field.setterContext;fields[fieldName]={read:ptr=>{return getterReturnType["fromWireType"](getter(getterContext,ptr))},write:(ptr,o)=>{var destructors=[];setter(setterContext,ptr,setterArgumentType["toWireType"](destructors,o));runDestructors(destructors)}}});return[{name:reg.name,"fromWireType":function(ptr){var rv={};for(var i in fields){rv[i]=fields[i].read(ptr)}rawDestructor(ptr);return rv},"toWireType":function(destructors,o){for(var fieldName in fields){if(!(fieldName in o)){throw new TypeError('Missing field: "'+fieldName+'"')}}var ptr=rawConstructor();for(fieldName in fields){fields[fieldName].write(ptr,o[fieldName])}if(destructors!==null){destructors.push(rawDestructor,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:rawDestructor}]})}function __embind_register_bigint(primitiveType,name,size,minRange,maxRange){}function getShiftFromSize(size){switch(size){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+size)}}function embind_init_charCodes(){var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes}var embind_charCodes=undefined;function readLatin1String(ptr){var ret="";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret}var BindingError=undefined;function throwBindingError(message){throw new BindingError(message)}function registerType(rawType,registeredInstance,options={}){if(!("argPackAdvance"in registeredInstance)){throw new TypeError("registerType registeredInstance requires argPackAdvance")}var name=registeredInstance.name;if(!rawType){throwBindingError('type "'+name+'" must have a positive integer typeid pointer')}if(registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations){return}else{throwBindingError("Cannot register type '"+name+"' twice")}}registeredTypes[rawType]=registeredInstance;delete typeDependencies[rawType];if(awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType];delete awaitingDependencies[rawType];callbacks.forEach(cb=>cb())}}function __embind_register_bool(rawType,name,size,trueValue,falseValue){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(wt){return!!wt},"toWireType":function(destructors,o){return o?trueValue:falseValue},"argPackAdvance":8,"readValueFromPointer":function(pointer){var heap;if(size===1){heap=HEAP8}else if(size===2){heap=HEAP16}else if(size===4){heap=HEAP32}else{throw new TypeError("Unknown boolean type size: "+name)}return this["fromWireType"](heap[pointer>>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationRegistry=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}var registeredPointers={};function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}var delayFunction=undefined;function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function attachFinalizer(handle){if("undefined"===typeof FinalizationRegistry){attachFinalizer=handle=>handle;return handle}finalizationRegistry=new FinalizationRegistry(info=>{releaseClassHandle(info.$$)});attachFinalizer=handle=>{var $$=handle.$$;var hasSmartPtr=!!$$.smartPtr;if(hasSmartPtr){var info={$$:$$};finalizationRegistry.register(handle,info,handle)}return handle};detachFinalizer=handle=>finalizationRegistry.unregister(handle);return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+embindRepr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+embindRepr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,Emval.toHandle(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+embindRepr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&&registeredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}var rtn=getWasmTableEntry(ptr).apply(null,args);return rtn}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=0;Object.assign(argCache,arguments);return dynCall(sig,ptr,argCache)}}function embind__requireFunction(signature,rawFunction){signature=readLatin1String(signature);function makeDynCaller(){if(signature.includes("j")){return getDynCaller(signature,rawFunction)}return getWasmTableEntry(rawFunction)}var fp=makeDynCaller();if(typeof fp!="function"){throwBindingError("unknown function pointer with signature "+signature+": "+rawFunction)}return fp}var UnboundTypeError=undefined;function getTypeName(type){var ptr=___getTypeName(type);var rv=readLatin1String(ptr);_free(ptr);return rv}function throwUnboundTypeError(message,types){var unboundTypes=[];var seen={};function visit(type){if(seen[type]){return}if(registeredTypes[type]){return}if(typeDependencies[type]){typeDependencies[type].forEach(visit);return}unboundTypes.push(type);seen[type]=true}types.forEach(visit);throw new UnboundTypeError(message+": "+unboundTypes.map(getTypeName).join([", "]))}function __embind_register_class(rawType,rawPointerType,rawConstPointerType,baseClassRawType,getActualTypeSignature,getActualType,upcastSignature,upcast,downcastSignature,downcast,name,destructorSignature,rawDestructor){name=readLatin1String(name);getActualType=embind__requireFunction(getActualTypeSignature,getActualType);if(upcast){upcast=embind__requireFunction(upcastSignature,upcast)}if(downcast){downcast=embind__requireFunction(downcastSignature,downcast)}rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);var legalFunctionName=makeLegalFunctionName(name);exposePublicSymbol(legalFunctionName,function(){throwUnboundTypeError("Cannot construct "+name+" due to unbound types",[baseClassRawType])});whenDependentTypesAreResolved([rawType,rawPointerType,rawConstPointerType],baseClassRawType?[baseClassRawType]:[],function(base){base=base[0];var baseClass;var basePrototype;if(baseClassRawType){baseClass=base.registeredClass;basePrototype=baseClass.instancePrototype}else{basePrototype=ClassHandle.prototype}var constructor=createNamedFunction(legalFunctionName,function(){if(Object.getPrototypeOf(this)!==instancePrototype){throw new BindingError("Use 'new' to construct "+name)}if(undefined===registeredClass.constructor_body){throw new BindingError(name+" has no accessible constructor")}var body=registeredClass.constructor_body[arguments.length];if(undefined===body){throw new BindingError("Tried to invoke ctor of "+name+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(registeredClass.constructor_body).toString()+") parameters instead!")}return body.apply(this,arguments)});var instancePrototype=Object.create(basePrototype,{constructor:{value:constructor}});constructor.prototype=instancePrototype;var registeredClass=new RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast);var referenceConverter=new RegisteredPointer(name,registeredClass,true,false,false);var pointerConverter=new RegisteredPointer(name+"*",registeredClass,false,false,false);var constPointerConverter=new RegisteredPointer(name+" const*",registeredClass,false,true,false);registeredPointers[rawType]={pointerType:pointerConverter,constPointerType:constPointerConverter};replacePublicSymbol(legalFunctionName,constructor);return[referenceConverter,pointerConverter,constPointerConverter]})}function heap32VectorToArray(count,firstElement){var array=[];for(var i=0;i<count;i++){array.push(HEAPU32[firstElement+i*4>>2])}return array}function new_(constructor,argumentList){if(!(constructor instanceof Function)){throw new TypeError("new_ called with constructor type "+typeof constructor+" which is not a function")}var dummy=createNamedFunction(constructor.name||"unknownFunctionName",function(){});dummy.prototype=constructor.prototype;var obj=new dummy;var r=constructor.apply(obj,argumentList);return r instanceof Object?r:obj}function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFunc,cppTargetFunc){var argCount=argTypes.length;if(argCount<2){throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!")}var isClassMethodFunc=argTypes[1]!==null&&classType!==null;var needsDestructorStack=false;for(var i=1;i<argTypes.length;++i){if(argTypes[i]!==null&&argTypes[i].destructorFunction===undefined){needsDestructorStack=true;break}}var returns=argTypes[0].name!=="void";var argsList="";var argsListWired="";for(var i=0;i<argCount-2;++i){argsList+=(i!==0?", ":"")+"arg"+i;argsListWired+=(i!==0?", ":"")+"arg"+i+"Wired"}var invokerFnBody="return function "+makeLegalFunctionName(humanName)+"("+argsList+") {\n"+"if (arguments.length !== "+(argCount-2)+") {\n"+"throwBindingError('function "+humanName+" called with ' + arguments.length + ' arguments, expected "+(argCount-2)+" args!');\n"+"}\n";if(needsDestructorStack){invokerFnBody+="var destructors = [];\n"}var dtorStack=needsDestructorStack?"destructors":"null";var args1=["throwBindingError","invoker","fn","runDestructors","retType","classParam"];var args2=[throwBindingError,cppInvokerFunc,cppTargetFunc,runDestructors,argTypes[0],argTypes[1]];if(isClassMethodFunc){invokerFnBody+="var thisWired = classParam.toWireType("+dtorStack+", this);\n"}for(var i=0;i<argCount-2;++i){invokerFnBody+="var arg"+i+"Wired = argType"+i+".toWireType("+dtorStack+", arg"+i+"); // "+argTypes[i+2].name+"\n";args1.push("argType"+i);args2.push(argTypes[i+2])}if(isClassMethodFunc){argsListWired="thisWired"+(argsListWired.length>0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i<argTypes.length;++i){var paramName=i===1?"thisWired":"arg"+(i-2)+"Wired";if(argTypes[i].destructorFunction!==null){invokerFnBody+=paramName+"_dtor("+paramName+"); // "+argTypes[i].name+"\n";args1.push(paramName+"_dtor");args2.push(argTypes[i].destructorFunction)}}}if(returns){invokerFnBody+="var ret = retType.fromWireType(rv);\n"+"return ret;\n"}else{}invokerFnBody+="}\n";args1.push(invokerFnBody);var invokerFunction=new_(Function,args1).apply(null,args2);return invokerFunction}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=()=>{throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){argTypes.splice(1,0,null);classType.registeredClass.constructor_body[argCount-1]=craftInvokerFunction(humanName,argTypes,null,invoker,rawConstructor);return[]});return[]})}function __embind_register_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,context,isPureVirtual){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;if(methodName.startsWith("@@")){methodName=Symbol[methodName.substring(2)]}if(isPureVirtual){classType.registeredClass.pureVirtualFunctions.push(methodName)}function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.instancePrototype;var method=proto[methodName];if(undefined===method||undefined===method.overloadTable&&method.className!==classType.name&&method.argCount===argCount-2){unboundTypesHandler.argCount=argCount-2;unboundTypesHandler.className=classType.name;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-2]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var memberFunction=craftInvokerFunction(humanName,argTypes,classType,rawInvoker,context);if(undefined===proto[methodName].overloadTable){memberFunction.argCount=argCount-2;proto[methodName]=memberFunction}else{proto[methodName].overloadTable[argCount-2]=memberFunction}return[]});return[]})}var emval_free_list=[];var emval_handle_array=[{},{value:undefined},{value:null},{value:true},{value:false}];function __emval_decref(handle){if(handle>4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i<emval_handle_array.length;++i){if(emval_handle_array[i]!==undefined){++count}}return count}function get_first_emval(){for(var i=5;i<emval_handle_array.length;++i){if(emval_handle_array[i]!==undefined){return emval_handle_array[i]}}return null}function init_emval(){Module["count_emval_handles"]=count_emval_handles;Module["get_first_emval"]=get_first_emval}var Emval={toValue:handle=>{if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value},toHandle:value=>{switch(value){case undefined:return 1;case null:return 2;case true:return 3;case false:return 4;default:{var handle=emval_free_list.length?emval_free_list.pop():emval_handle_array.length;emval_handle_array[handle]={refcount:1,value:value};return handle}}}};function __embind_register_emval(rawType,name){name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(handle){var rv=Emval.toValue(handle);__emval_decref(handle);return rv},"toWireType":function(destructors,value){return Emval.toHandle(value)},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:null})}function embindRepr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=value=>value;if(minRange===0){var bitshift=32-8*size;fromWireType=value=>value<<bitshift>>>bitshift}var isUnsignedType=name.includes("unsigned");var checkAssertions=(value,toTypeName)=>{};var toWireType;if(isUnsignedType){toWireType=function(destructors,value){checkAssertions(value,this.name);return value>>>0}}else{toWireType=function(destructors,value){checkAssertions(value,this.name);return value}}registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":toWireType,"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var payload=value+4;var str;if(stdStringIsUTF8){var decodeStartPtr=payload;for(var i=0;i<=length;++i){var currentBytePtr=payload+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i<length;++i){a[i]=String.fromCharCode(HEAPU8[payload+i])}str=a.join("")}_free(value);return str},"toWireType":function(destructors,value){if(value instanceof ArrayBuffer){value=new Uint8Array(value)}var length;var valueIsOfTypeString=typeof value=="string";if(!(valueIsOfTypeString||value instanceof Uint8Array||value instanceof Uint8ClampedArray||value instanceof Int8Array)){throwBindingError("Cannot pass non-string to std::string")}if(stdStringIsUTF8&&valueIsOfTypeString){length=lengthBytesUTF8(value)}else{length=value.length}var base=_malloc(4+length+1);var ptr=base+4;HEAPU32[base>>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr,length+1)}else{if(valueIsOfTypeString){for(var i=0;i<length;++i){var charCode=value.charCodeAt(i);if(charCode>255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+i]=charCode}}else{for(var i=0;i<length;++i){HEAPU8[ptr+i]=value[i]}}}if(destructors!==null){destructors.push(_free,base)}return base},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}var UTF16Decoder=typeof TextDecoder!="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder)return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr));var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite<str.length*2?maxBytesToWrite/2:str.length;for(var i=0;i<numCharsToWrite;++i){var codeUnit=str.charCodeAt(i);HEAP16[outPtr>>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);if(codeUnit>=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i<str.length;++i){var codeUnit=str.charCodeAt(i);if(codeUnit>=55296&&codeUnit<=57343)++i;len+=4}return len}function __embind_register_std_wstring(rawType,charSize,name){name=readLatin1String(name);var decodeString,encodeString,getHeap,lengthBytesUTF,shift;if(charSize===2){decodeString=UTF16ToString;encodeString=stringToUTF16;lengthBytesUTF=lengthBytesUTF16;getHeap=()=>HEAPU16;shift=1}else if(charSize===4){decodeString=UTF32ToString;encodeString=stringToUTF32;lengthBytesUTF=lengthBytesUTF32;getHeap=()=>HEAPU32;shift=2}registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value=="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_object(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){structRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),fields:[]}}function __embind_register_value_object_field(structType,fieldName,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){structRegistrations[structType].fields.push({fieldName:readLatin1String(fieldName),getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function __emval_incref(handle){if(handle>4){emval_handle_array[handle].refcount+=1}}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function __emval_take_value(type,arg){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](arg);return Emval.toHandle(v)}function _abort(){abort("")}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}let alignUp=(x,multiple)=>x+(multiple-x%multiple)%multiple;for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var SYSCALLS={varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret}};function _fd_close(fd){return 52}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){return 70}var printCharBuffers=[null,[],[]];function printChar(stream,curr){var buffer=printCharBuffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}}function _fd_write(fd,iov,iovcnt,pnum){var num=0;for(var i=0;i<iovcnt;i++){var ptr=HEAPU32[iov>>2];var len=HEAPU32[iov+4>>2];iov+=8;for(var j=0;j<len;j++){printChar(fd,HEAPU8[ptr+j])}num+=len}HEAPU32[pnum>>2]=num;return 0}function _llvm_eh_typeid_for(type){return type}function getCFunc(ident){var func=Module["_"+ident];return func}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":str=>{var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":arr=>{var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string"){return UTF8ToString(ret)}if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func.apply(null,cArgs);function onDone(ret){if(stack!==0)stackRestore(stack);return convertReturnValue(ret)}ret=onDone(ret);return ret}InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_embind();init_RegisteredPointer();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();var asmLibraryArg={"M":___cxa_begin_catch,"v":___cxa_end_catch,"c":___cxa_find_matching_catch_2,"j":___cxa_find_matching_catch_3,"i":___cxa_throw,"f":___resumeException,"B":__embind_finalize_value_object,"E":__embind_register_bigint,"J":__embind_register_bool,"z":__embind_register_class,"y":__embind_register_class_constructor,"a":__embind_register_class_function,"I":__embind_register_emval,"u":__embind_register_float,"o":__embind_register_function,"h":__embind_register_integer,"d":__embind_register_memory_view,"t":__embind_register_std_string,"q":__embind_register_std_wstring,"p":__embind_register_value_object,"C":__embind_register_value_object_field,"K":__embind_register_void,"O":__emval_decref,"P":__emval_incref,"n":__emval_take_value,"r":_abort,"H":_emscripten_memcpy_big,"F":_emscripten_resize_heap,"G":_fd_close,"D":_fd_seek,"s":_fd_write,"b":invoke_ii,"A":invoke_iii,"w":invoke_iiii,"e":invoke_vi,"k":invoke_vii,"l":invoke_viii,"x":invoke_viiii,"L":invoke_viiiiii,"m":invoke_viiiiiii,"g":invoke_viiiiiiiiii,"N":_llvm_eh_typeid_for};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["R"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["S"]).apply(null,arguments)};var ___cxa_free_exception=Module["___cxa_free_exception"]=function(){return(___cxa_free_exception=Module["___cxa_free_exception"]=Module["asm"]["T"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["V"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["W"]).apply(null,arguments)};var __embind_initialize_bindings=Module["__embind_initialize_bindings"]=function(){return(__embind_initialize_bindings=Module["__embind_initialize_bindings"]=Module["asm"]["X"]).apply(null,arguments)};var setTempRet0=Module["setTempRet0"]=function(){return(setTempRet0=Module["setTempRet0"]=Module["asm"]["Y"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["Z"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["_"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["$"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["aa"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["ba"]).apply(null,arguments)};var dynCall_ji=Module["dynCall_ji"]=function(){return(dynCall_ji=Module["dynCall_ji"]=Module["asm"]["ca"]).apply(null,arguments)};var dynCall_iiji=Module["dynCall_iiji"]=function(){return(dynCall_iiji=Module["dynCall_iiji"]=Module["asm"]["da"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["ea"]).apply(null,arguments)};function invoke_iii(index,a1,a2){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(index,a1){var sp=stackSave();try{return getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{getWasmTableEntry(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return getWasmTableEntry(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0)throw e;_setThrew(1,0)}}Module["ccall"]=ccall;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();
122
-
123
-
124
- return Module.ready
125
- }
126
- );
127
- })();
128
- if (true)
129
- module.exports = Module;
130
- else {}
131
-
132
-
133
- /***/ }),
134
-
135
- /***/ "./shared/calculateMinMax.ts":
136
- /*!***********************************!*\
137
- !*** ./shared/calculateMinMax.ts ***!
138
- \***********************************/
139
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
140
-
141
- "use strict";
142
- __webpack_require__.r(__webpack_exports__);
143
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
144
- /* harmony export */ "default": () => (/* binding */ calculateMinMax)
145
- /* harmony export */ });
146
- /* harmony import */ var _getMinMax__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getMinMax */ "./shared/getMinMax.ts");
147
-
148
- /**
149
- * Check the minimum and maximum values in the imageFrame pixel data
150
- * match with the provided smallestPixelValue and largestPixelValue metaData.
151
- *
152
- * If 'strict' is true, log to the console a warning if these values do not match.
153
- * Otherwise, correct them automatically.
154
- *
155
- * @param {Object} imageFrame
156
- * @param {Boolean} strict If 'strict' is true, log to the console a warning if these values do not match.
157
- * Otherwise, correct them automatically.Default is true.
158
- */
159
-
160
- function calculateMinMax(imageFrame) {
161
- var strict = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
162
- var minMax = (0,_getMinMax__WEBPACK_IMPORTED_MODULE_0__["default"])(imageFrame.pixelData);
163
- var mustAssign = !(isNumber(imageFrame.smallestPixelValue) && isNumber(imageFrame.largestPixelValue));
164
-
165
- if (strict === true && !mustAssign) {
166
- if (imageFrame.smallestPixelValue !== minMax.min) {
167
- console.warn('Image smallestPixelValue tag is incorrect. Rendering performance will suffer considerably.');
168
- }
169
-
170
- if (imageFrame.largestPixelValue !== minMax.max) {
171
- console.warn('Image largestPixelValue tag is incorrect. Rendering performance will suffer considerably.');
172
- }
173
- } else {
174
- imageFrame.smallestPixelValue = minMax.min;
175
- imageFrame.largestPixelValue = minMax.max;
176
- }
177
- }
178
-
179
- function isNumber(numValue) {
180
- return typeof numValue === 'number';
181
- }
182
-
183
- /***/ }),
184
-
185
- /***/ "./shared/decodeImageFrame.ts":
186
- /*!************************************!*\
187
- !*** ./shared/decodeImageFrame.ts ***!
188
- \************************************/
189
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
190
-
191
- "use strict";
192
- __webpack_require__.r(__webpack_exports__);
193
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
194
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
195
- /* harmony export */ });
196
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
197
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
198
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../../node_modules/@babel/runtime/regenerator/index.js");
199
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);
200
- /* harmony import */ var _decoders_decodeLittleEndian__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./decoders/decodeLittleEndian */ "./shared/decoders/decodeLittleEndian.ts");
201
- /* harmony import */ var _decoders_decodeBigEndian__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./decoders/decodeBigEndian */ "./shared/decoders/decodeBigEndian.ts");
202
- /* harmony import */ var _decoders_decodeRLE__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./decoders/decodeRLE */ "./shared/decoders/decodeRLE.ts");
203
- /* harmony import */ var _decoders_decodeJPEGBaseline8Bit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./decoders/decodeJPEGBaseline8Bit */ "./shared/decoders/decodeJPEGBaseline8Bit.ts");
204
- /* harmony import */ var _decoders_decodeJPEGBaseline12Bit_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./decoders/decodeJPEGBaseline12Bit-js */ "./shared/decoders/decodeJPEGBaseline12Bit-js.ts");
205
- /* harmony import */ var _decoders_decodeJPEGLossless__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./decoders/decodeJPEGLossless */ "./shared/decoders/decodeJPEGLossless.ts");
206
- /* harmony import */ var _decoders_decodeJPEGLS__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./decoders/decodeJPEGLS */ "./shared/decoders/decodeJPEGLS.ts");
207
- /* harmony import */ var _decoders_decodeJPEG2000__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./decoders/decodeJPEG2000 */ "./shared/decoders/decodeJPEG2000.ts");
208
- /* harmony import */ var _decoders_decodeHTJ2K__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./decoders/decodeHTJ2K */ "./shared/decoders/decodeHTJ2K.ts");
209
- /* harmony import */ var _scaling_scaleArray__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./scaling/scaleArray */ "./shared/scaling/scaleArray.ts");
210
-
211
-
212
-
213
-
214
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
215
-
216
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
217
-
218
- /* eslint-disable complexity */
219
-
220
-
221
-
222
- // import decodeJPEGBaseline12Bit from './decoders/decodeJPEGBaseline12Bit';
223
-
224
-
225
-
226
-
227
-
228
-
229
-
230
-
231
- /**
232
- * Decodes the provided image frame.
233
- * This is an async function return the result, or you can provide an optional
234
- * callbackFn that is called with the results.
235
- */
236
- function decodeImageFrame(_x, _x2, _x3, _x4, _x5, _x6) {
237
- return _decodeImageFrame.apply(this, arguments);
238
- }
239
-
240
- function _decodeImageFrame() {
241
- _decodeImageFrame = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(imageFrame, transferSyntax, pixelData, decodeConfig, options, callbackFn) {
242
- var start, decodePromise, opts, decodedFrame, postProcessed;
243
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {
244
- while (1) {
245
- switch (_context.prev = _context.next) {
246
- case 0:
247
- start = new Date().getTime();
248
- decodePromise = null;
249
- _context.t0 = transferSyntax;
250
- _context.next = _context.t0 === '1.2.840.10008.1.2' ? 5 : _context.t0 === '1.2.840.10008.1.2.1' ? 5 : _context.t0 === '1.2.840.10008.1.2.2' ? 7 : _context.t0 === '1.2.840.10008.1.2.1.99' ? 9 : _context.t0 === '1.2.840.10008.1.2.5' ? 11 : _context.t0 === '1.2.840.10008.1.2.4.50' ? 13 : _context.t0 === '1.2.840.10008.1.2.4.51' ? 16 : _context.t0 === '1.2.840.10008.1.2.4.57' ? 18 : _context.t0 === '1.2.840.10008.1.2.4.70' ? 20 : _context.t0 === '1.2.840.10008.1.2.4.80' ? 22 : _context.t0 === '1.2.840.10008.1.2.4.81' ? 25 : _context.t0 === '1.2.840.10008.1.2.4.90' ? 28 : _context.t0 === '1.2.840.10008.1.2.4.91' ? 31 : _context.t0 === '3.2.840.10008.1.2.4.96' ? 34 : 37;
251
- break;
252
-
253
- case 5:
254
- // Implicit or Explicit VR Little Endian
255
- decodePromise = (0,_decoders_decodeLittleEndian__WEBPACK_IMPORTED_MODULE_3__["default"])(imageFrame, pixelData);
256
- return _context.abrupt("break", 38);
257
-
258
- case 7:
259
- // Explicit VR Big Endian (retired)
260
- decodePromise = (0,_decoders_decodeBigEndian__WEBPACK_IMPORTED_MODULE_4__["default"])(imageFrame, pixelData);
261
- return _context.abrupt("break", 38);
262
-
263
- case 9:
264
- // Deflate transfer syntax (deflated by dicomParser)
265
- decodePromise = (0,_decoders_decodeLittleEndian__WEBPACK_IMPORTED_MODULE_3__["default"])(imageFrame, pixelData);
266
- return _context.abrupt("break", 38);
267
-
268
- case 11:
269
- // RLE Lossless
270
- decodePromise = (0,_decoders_decodeRLE__WEBPACK_IMPORTED_MODULE_5__["default"])(imageFrame, pixelData);
271
- return _context.abrupt("break", 38);
272
-
273
- case 13:
274
- // JPEG Baseline lossy process 1 (8 bit)
275
- opts = _objectSpread({}, imageFrame);
276
- decodePromise = (0,_decoders_decodeJPEGBaseline8Bit__WEBPACK_IMPORTED_MODULE_6__["default"])(pixelData, opts);
277
- return _context.abrupt("break", 38);
278
-
279
- case 16:
280
- // JPEG Baseline lossy process 2 & 4 (12 bit)
281
- // opts = {
282
- // ...imageFrame,
283
- // };
284
- // decodePromise = decodeJPEGBaseline12Bit(pixelData, opts);
285
- //throw new Error('Currently unsupported: 1.2.840.10008.1.2.4.51');
286
- decodePromise = (0,_decoders_decodeJPEGBaseline12Bit_js__WEBPACK_IMPORTED_MODULE_7__["default"])(imageFrame, pixelData);
287
- return _context.abrupt("break", 38);
288
-
289
- case 18:
290
- // JPEG Lossless, Nonhierarchical (Processes 14)
291
- decodePromise = (0,_decoders_decodeJPEGLossless__WEBPACK_IMPORTED_MODULE_8__["default"])(imageFrame, pixelData);
292
- return _context.abrupt("break", 38);
293
-
294
- case 20:
295
- // JPEG Lossless, Nonhierarchical (Processes 14 [Selection 1])
296
- decodePromise = (0,_decoders_decodeJPEGLossless__WEBPACK_IMPORTED_MODULE_8__["default"])(imageFrame, pixelData);
297
- return _context.abrupt("break", 38);
298
-
299
- case 22:
300
- // JPEG-LS Lossless Image Compression
301
- opts = _objectSpread({
302
- signed: imageFrame.pixelRepresentation === 1,
303
- // imageFrame.signed,
304
- // shouldn't need...
305
- bytesPerPixel: imageFrame.bitsAllocated <= 8 ? 1 : 2
306
- }, imageFrame);
307
- decodePromise = (0,_decoders_decodeJPEGLS__WEBPACK_IMPORTED_MODULE_9__["default"])(pixelData, opts);
308
- return _context.abrupt("break", 38);
309
-
310
- case 25:
311
- // JPEG-LS Lossy (Near-Lossless) Image Compression
312
- opts = _objectSpread({
313
- signed: false,
314
- // imageFrame.signed,
315
- // shouldn't need...
316
- bytesPerPixel: imageFrame.bitsAllocated <= 8 ? 1 : 2
317
- }, imageFrame);
318
- decodePromise = (0,_decoders_decodeJPEGLS__WEBPACK_IMPORTED_MODULE_9__["default"])(pixelData, opts);
319
- return _context.abrupt("break", 38);
320
-
321
- case 28:
322
- opts = _objectSpread({}, imageFrame); // JPEG 2000 Lossless
323
- // imageFrame, pixelData, decodeConfig, options
324
-
325
- decodePromise = (0,_decoders_decodeJPEG2000__WEBPACK_IMPORTED_MODULE_10__["default"])(pixelData, opts);
326
- return _context.abrupt("break", 38);
327
-
328
- case 31:
329
- // JPEG 2000 Lossy
330
- opts = _objectSpread({}, imageFrame); // JPEG 2000 Lossy
331
- // imageFrame, pixelData, decodeConfig, options
332
-
333
- decodePromise = (0,_decoders_decodeJPEG2000__WEBPACK_IMPORTED_MODULE_10__["default"])(pixelData, opts);
334
- return _context.abrupt("break", 38);
335
-
336
- case 34:
337
- // HTJ2K
338
- opts = _objectSpread({}, imageFrame);
339
- decodePromise = (0,_decoders_decodeHTJ2K__WEBPACK_IMPORTED_MODULE_11__["default"])(pixelData, opts);
340
- return _context.abrupt("break", 38);
341
-
342
- case 37:
343
- throw new Error("no decoder for transfer syntax ".concat(transferSyntax));
344
-
345
- case 38:
346
- if (decodePromise) {
347
- _context.next = 40;
348
- break;
349
- }
350
-
351
- throw new Error('decodePromise not defined');
352
-
353
- case 40:
354
- _context.next = 42;
355
- return decodePromise;
356
-
357
- case 42:
358
- decodedFrame = _context.sent;
359
- postProcessed = postProcessDecodedPixels(decodedFrame, options, start, decodeConfig); // Call the callbackFn to agree with older arguments
360
-
361
- callbackFn === null || callbackFn === void 0 ? void 0 : callbackFn(postProcessed);
362
- return _context.abrupt("return", postProcessed);
363
-
364
- case 46:
365
- case "end":
366
- return _context.stop();
367
- }
368
- }
369
- }, _callee);
370
- }));
371
- return _decodeImageFrame.apply(this, arguments);
372
- }
373
-
374
- function postProcessDecodedPixels(imageFrame, options, start, decodeConfig) {
375
- var _ref = decodeConfig || {},
376
- use16BitDataType = _ref.use16BitDataType;
377
-
378
- var shouldShift = imageFrame.pixelRepresentation !== undefined && imageFrame.pixelRepresentation === 1;
379
- var shift = shouldShift && imageFrame.bitsStored !== undefined ? 32 - imageFrame.bitsStored : undefined;
380
-
381
- if (shouldShift && shift !== undefined) {
382
- for (var i = 0; i < imageFrame.pixelData.length; i++) {
383
- // eslint-disable-next-line no-bitwise
384
- imageFrame.pixelData[i] = imageFrame.pixelData[i] << shift >> shift;
385
- }
386
- } // Cache the pixelData reference quickly incase we want to set a targetBuffer _and_ scale.
387
-
388
-
389
- var pixelDataArray = imageFrame.pixelData;
390
- imageFrame.pixelDataLength = imageFrame.pixelData.length;
391
-
392
- if (options.targetBuffer) {
393
- var offset, length; // If we have a target buffer, write to that instead. This helps reduce memory duplication.
394
-
395
- var _options$targetBuffer = options.targetBuffer;
396
- offset = _options$targetBuffer.offset;
397
- length = _options$targetBuffer.length;
398
- var _options$targetBuffer2 = options.targetBuffer,
399
- arrayBuffer = _options$targetBuffer2.arrayBuffer,
400
- type = _options$targetBuffer2.type;
401
- var TypedArrayConstructor;
402
-
403
- if (offset === null || offset === undefined) {
404
- offset = 0;
405
- }
406
-
407
- if ((length === null || length === undefined) && offset !== 0) {
408
- length = imageFrame.pixelDataLength - offset;
409
- } else if (length === null || length === undefined) {
410
- length = imageFrame.pixelDataLength;
411
- }
412
-
413
- switch (type) {
414
- case 'Uint8Array':
415
- TypedArrayConstructor = Uint8Array;
416
- break;
417
-
418
- case use16BitDataType && 'Uint16Array':
419
- TypedArrayConstructor = Uint16Array;
420
- break;
421
-
422
- case use16BitDataType && 'Int16Array':
423
- TypedArrayConstructor = Int16Array;
424
- break;
425
-
426
- case 'Float32Array':
427
- TypedArrayConstructor = Float32Array;
428
- break;
429
-
430
- default:
431
- throw new Error('target array for image does not have a valid type.');
432
- }
433
-
434
- var imageFramePixelData = imageFrame.pixelData;
435
-
436
- if (length !== imageFramePixelData.length) {
437
- throw new Error("target array for image does not have the same length (".concat(length, ") as the decoded image length (").concat(imageFramePixelData.length, ")."));
438
- } // TypedArray.Set is api level and ~50x faster than copying elements even for
439
- // Arrays of different types, which aren't simply memcpy ops.
440
-
441
-
442
- var typedArray;
443
-
444
- if (arrayBuffer) {
445
- typedArray = new TypedArrayConstructor(arrayBuffer, offset, length);
446
- } else {
447
- typedArray = new TypedArrayConstructor(length);
448
- }
449
-
450
- typedArray.set(imageFramePixelData, 0); // If need to scale, need to scale correct array.
451
-
452
- pixelDataArray = typedArray;
453
- }
454
-
455
- if (options.preScale.enabled) {
456
- var scalingParameters = options.preScale.scalingParameters;
457
-
458
- if (!scalingParameters) {
459
- throw new Error('options.preScale.scalingParameters must be defined if preScale.enabled is true, and scalingParameters cannot be derived from the metadata providers.');
460
- }
461
-
462
- var rescaleSlope = scalingParameters.rescaleSlope,
463
- rescaleIntercept = scalingParameters.rescaleIntercept;
464
-
465
- if (typeof rescaleSlope === 'number' && typeof rescaleIntercept === 'number') {
466
- // @ts-ignore
467
- if ((0,_scaling_scaleArray__WEBPACK_IMPORTED_MODULE_12__["default"])(pixelDataArray, scalingParameters)) {
468
- imageFrame.preScale = _objectSpread(_objectSpread({}, options.preScale), {}, {
469
- scaled: true
470
- });
471
- }
472
- }
473
- } // Handle cases where the targetBuffer is not backed by a SharedArrayBuffer
474
-
475
-
476
- if (options.targetBuffer && (!options.targetBuffer.arrayBuffer || options.targetBuffer.arrayBuffer instanceof ArrayBuffer)) {
477
- imageFrame.pixelData = pixelDataArray;
478
- }
479
-
480
- var end = new Date().getTime();
481
- imageFrame.decodeTimeInMS = end - start;
482
- return imageFrame;
483
- }
484
-
485
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (decodeImageFrame);
486
-
487
- /***/ }),
488
-
489
- /***/ "./shared/decoders/decodeBigEndian.ts":
490
- /*!********************************************!*\
491
- !*** ./shared/decoders/decodeBigEndian.ts ***!
492
- \********************************************/
493
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
494
-
495
- "use strict";
496
- __webpack_require__.r(__webpack_exports__);
497
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
498
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
499
- /* harmony export */ });
500
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
501
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../../node_modules/@babel/runtime/regenerator/index.js");
502
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
503
-
504
-
505
-
506
- /* eslint no-bitwise: 0 */
507
- function swap16(val) {
508
- return (val & 0xff) << 8 | val >> 8 & 0xff;
509
- }
510
-
511
- function decodeBigEndian(_x, _x2) {
512
- return _decodeBigEndian.apply(this, arguments);
513
- }
514
-
515
- function _decodeBigEndian() {
516
- _decodeBigEndian = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(imageFrame, pixelData) {
517
- var arrayBuffer, offset, length, i;
518
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) {
519
- while (1) {
520
- switch (_context.prev = _context.next) {
521
- case 0:
522
- if (imageFrame.bitsAllocated === 16) {
523
- arrayBuffer = pixelData.buffer;
524
- offset = pixelData.byteOffset;
525
- length = pixelData.length; // if pixel data is not aligned on even boundary, shift it so we can create the 16 bit array
526
- // buffers on it
527
-
528
- if (offset % 2) {
529
- arrayBuffer = arrayBuffer.slice(offset);
530
- offset = 0;
531
- }
532
-
533
- if (imageFrame.pixelRepresentation === 0) {
534
- imageFrame.pixelData = new Uint16Array(arrayBuffer, offset, length / 2);
535
- } else {
536
- imageFrame.pixelData = new Int16Array(arrayBuffer, offset, length / 2);
537
- } // Do the byte swap
538
-
539
-
540
- for (i = 0; i < imageFrame.pixelData.length; i++) {
541
- imageFrame.pixelData[i] = swap16(imageFrame.pixelData[i]);
542
- }
543
- } else if (imageFrame.bitsAllocated === 8) {
544
- imageFrame.pixelData = pixelData;
545
- }
546
-
547
- return _context.abrupt("return", imageFrame);
548
-
549
- case 2:
550
- case "end":
551
- return _context.stop();
552
- }
553
- }
554
- }, _callee);
555
- }));
556
- return _decodeBigEndian.apply(this, arguments);
557
- }
558
-
559
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (decodeBigEndian);
560
-
561
- /***/ }),
562
-
563
- /***/ "./shared/decoders/decodeHTJ2K.ts":
564
- /*!****************************************!*\
565
- !*** ./shared/decoders/decodeHTJ2K.ts ***!
566
- \****************************************/
567
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
568
-
569
- "use strict";
570
- __webpack_require__.r(__webpack_exports__);
571
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
572
- /* harmony export */ "initialize": () => (/* binding */ initialize),
573
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
574
- /* harmony export */ });
575
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
576
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
577
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../../node_modules/@babel/runtime/regenerator/index.js");
578
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);
579
- /* harmony import */ var _cornerstonejs_codec_openjph_wasmjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/codec-openjph/wasmjs */ "../../../node_modules/@cornerstonejs/codec-openjph/dist/openjphjs.js");
580
- /* harmony import */ var _cornerstonejs_codec_openjph_wasmjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_cornerstonejs_codec_openjph_wasmjs__WEBPACK_IMPORTED_MODULE_3__);
581
- /* harmony import */ var _cornerstonejs_codec_openjph_wasm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/codec-openjph/wasm */ "../../../node_modules/@cornerstonejs/codec-openjph/dist/openjphjs.wasm");
582
-
583
-
584
-
585
-
586
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
587
-
588
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
589
-
590
-
591
-
592
- var local = {
593
- codec: undefined,
594
- decoder: undefined,
595
- decodeConfig: {}
596
- };
597
- function initialize(decodeConfig) {
598
- local.decodeConfig = decodeConfig;
599
-
600
- if (local.codec) {
601
- return Promise.resolve();
602
- }
603
-
604
- var openJphModule = _cornerstonejs_codec_openjph_wasmjs__WEBPACK_IMPORTED_MODULE_3___default()({
605
- locateFile: function locateFile(f) {
606
- if (f.endsWith('.wasm')) {
607
- return _cornerstonejs_codec_openjph_wasm__WEBPACK_IMPORTED_MODULE_4__;
608
- }
609
-
610
- return f;
611
- }
612
- });
613
- return new Promise(function (resolve, reject) {
614
- openJphModule.then(function (instance) {
615
- local.codec = instance;
616
- local.decoder = new instance.HTJ2KDecoder();
617
- resolve();
618
- }, reject);
619
- });
620
- } // https://github.com/chafey/openjpegjs/blob/master/test/browser/index.html
621
-
622
- function decodeAsync(_x, _x2) {
623
- return _decodeAsync.apply(this, arguments);
624
- }
625
-
626
- function _decodeAsync() {
627
- _decodeAsync = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(compressedImageFrame, imageInfo) {
628
- var decoder, encodedBufferInWASM, frameInfo, decodedBufferInWASM, imageFrame, imageOffset, numDecompositions, numLayers, progessionOrder, reversible, blockDimensions, tileSize, tileOffset, decodedSize, compressionRatio, encodedImageInfo, pixelData, _pixelData, b, byteOffset, byteLength, pixelDataArrayBuffer, encodeOptions;
629
-
630
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {
631
- while (1) {
632
- switch (_context.prev = _context.next) {
633
- case 0:
634
- _context.next = 2;
635
- return initialize();
636
-
637
- case 2:
638
- decoder = local.decoder; // get pointer to the source/encoded bit stream buffer in WASM memory
639
- // that can hold the encoded bitstream
640
-
641
- encodedBufferInWASM = decoder.getEncodedBuffer(compressedImageFrame.length); // copy the encoded bitstream into WASM memory buffer
642
-
643
- encodedBufferInWASM.set(compressedImageFrame); // decode it
644
-
645
- decoder.decode(); // decoder.decodeSubResolution(decodeLevel, decodeLayer);
646
- // const resolutionAtLevel = decoder.calculateSizeAtDecompositionLevel(decodeLevel);
647
- // get information about the decoded image
648
-
649
- frameInfo = decoder.getFrameInfo(); // get the decoded pixels
650
-
651
- decodedBufferInWASM = decoder.getDecodedBuffer();
652
- imageFrame = new Uint8Array(decodedBufferInWASM.length);
653
- imageFrame.set(decodedBufferInWASM);
654
- imageOffset = "x: ".concat(decoder.getImageOffset().x, ", y: ").concat(decoder.getImageOffset().y);
655
- numDecompositions = decoder.getNumDecompositions();
656
- numLayers = decoder.getNumLayers();
657
- progessionOrder = ['unknown', 'LRCP', 'RLCP', 'RPCL', 'PCRL', 'CPRL'][decoder.getProgressionOrder() + 1];
658
- reversible = decoder.getIsReversible();
659
- blockDimensions = "".concat(decoder.getBlockDimensions().width, " x ").concat(decoder.getBlockDimensions().height);
660
- tileSize = "".concat(decoder.getTileSize().width, " x ").concat(decoder.getTileSize().height);
661
- tileOffset = "".concat(decoder.getTileOffset().x, ", ").concat(decoder.getTileOffset().y); // const colorTransform = decoder.getColorSpace();
662
-
663
- decodedSize = "".concat(decodedBufferInWASM.length.toLocaleString(), " bytes");
664
- compressionRatio = "".concat((decodedBufferInWASM.length / encodedBufferInWASM.length).toFixed(2), ":1");
665
- encodedImageInfo = {
666
- columns: frameInfo.width,
667
- rows: frameInfo.height,
668
- bitsPerPixel: frameInfo.bitsPerSample,
669
- signed: frameInfo.isSigned,
670
- bytesPerPixel: imageInfo.bytesPerPixel,
671
- componentsPerPixel: frameInfo.componentCount
672
- }; // const pixelData = getPixelData(frameInfo, decodedBufferInWASM);
673
-
674
- /**
675
- * Have to truncate the arraybuffer here to the length of the typed array. Not
676
- * sure why the arraybuffer is so huge, maybe this is allocated by the WASM
677
- * module? In any case, I think it's too big to postMessage in it's entirety.
678
- */
679
-
680
- pixelData = getPixelData(frameInfo, decodedBufferInWASM);
681
- _pixelData = pixelData, b = _pixelData.buffer, byteOffset = _pixelData.byteOffset, byteLength = _pixelData.byteLength;
682
- pixelDataArrayBuffer = b.slice(byteOffset, byteOffset + byteLength); // @ts-ignore
683
-
684
- pixelData = new pixelData.constructor(pixelDataArrayBuffer);
685
- encodeOptions = {
686
- imageOffset: imageOffset,
687
- numDecompositions: numDecompositions,
688
- numLayers: numLayers,
689
- progessionOrder: progessionOrder,
690
- reversible: reversible,
691
- blockDimensions: blockDimensions,
692
- tileSize: tileSize,
693
- tileOffset: tileOffset,
694
- // colorTransform,
695
- decodedSize: decodedSize,
696
- compressionRatio: compressionRatio
697
- };
698
- return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread({}, imageInfo), {}, {
699
- pixelData: pixelData,
700
- imageInfo: encodedImageInfo,
701
- encodeOptions: encodeOptions
702
- }, encodeOptions), encodedImageInfo));
703
-
704
- case 27:
705
- case "end":
706
- return _context.stop();
707
- }
708
- }
709
- }, _callee);
710
- }));
711
- return _decodeAsync.apply(this, arguments);
712
- }
713
-
714
- function getPixelData(frameInfo, decodedBuffer) {
715
- if (frameInfo.bitsPerSample > 8) {
716
- if (frameInfo.isSigned) {
717
- return new Int16Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength / 2);
718
- }
719
-
720
- return new Uint16Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength / 2);
721
- }
722
-
723
- if (frameInfo.isSigned) {
724
- return new Int8Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength);
725
- }
726
-
727
- return new Uint8Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength);
728
- }
729
-
730
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (decodeAsync);
731
-
732
- /***/ }),
733
-
734
- /***/ "./shared/decoders/decodeJPEG2000.ts":
735
- /*!*******************************************!*\
736
- !*** ./shared/decoders/decodeJPEG2000.ts ***!
737
- \*******************************************/
738
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
739
-
740
- "use strict";
741
- __webpack_require__.r(__webpack_exports__);
742
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
743
- /* harmony export */ "initialize": () => (/* binding */ initialize),
744
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
745
- /* harmony export */ });
746
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
747
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
748
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../../node_modules/@babel/runtime/regenerator/index.js");
749
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);
750
- /* harmony import */ var _cornerstonejs_codec_openjpeg_decodewasmjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/codec-openjpeg/decodewasmjs */ "../../../node_modules/@cornerstonejs/codec-openjpeg/dist/openjpegwasm_decode.js");
751
- /* harmony import */ var _cornerstonejs_codec_openjpeg_decodewasmjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_cornerstonejs_codec_openjpeg_decodewasmjs__WEBPACK_IMPORTED_MODULE_3__);
752
- /* harmony import */ var _cornerstonejs_codec_openjpeg_decodewasm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/codec-openjpeg/decodewasm */ "../../../node_modules/@cornerstonejs/codec-openjpeg/dist/openjpegwasm_decode.wasm");
753
-
754
-
755
-
756
-
757
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
758
-
759
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
760
-
761
- // https://emscripten.org/docs/api_reference/module.html
762
- // Webpack asset/resource copies this to our output folder
763
- // TODO: At some point maybe we can use this instead.
764
- // This is closer to what Webpack 5 wants but it doesn't seem to work now
765
- // const wasm = new URL('./blah.wasm', import.meta.url)
766
-
767
-
768
- var local = {
769
- codec: undefined,
770
- decoder: undefined,
771
- decodeConfig: {}
772
- };
773
- function initialize(decodeConfig) {
774
- local.decodeConfig = decodeConfig;
775
-
776
- if (local.codec) {
777
- return Promise.resolve();
778
- }
779
-
780
- var openJpegModule = _cornerstonejs_codec_openjpeg_decodewasmjs__WEBPACK_IMPORTED_MODULE_3___default()({
781
- locateFile: function locateFile(f) {
782
- if (f.endsWith('.wasm')) {
783
- return _cornerstonejs_codec_openjpeg_decodewasm__WEBPACK_IMPORTED_MODULE_4__.toString();
784
- }
785
-
786
- return f;
787
- }
788
- });
789
- return new Promise(function (resolve, reject) {
790
- openJpegModule.then(function (instance) {
791
- local.codec = instance;
792
- local.decoder = new instance.J2KDecoder();
793
- resolve();
794
- }, reject);
795
- });
796
- } // https://github.com/chafey/openjpegjs/blob/master/test/browser/index.html
797
-
798
- function decodeAsync(_x, _x2) {
799
- return _decodeAsync.apply(this, arguments);
800
- }
801
-
802
- function _decodeAsync() {
803
- _decodeAsync = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(compressedImageFrame, imageInfo) {
804
- var decoder, encodedBufferInWASM, frameInfo, decodedBufferInWASM, imageFrame, imageOffset, numDecompositions, numLayers, progessionOrder, reversible, blockDimensions, tileSize, tileOffset, colorTransform, decodedSize, compressionRatio, encodedImageInfo, pixelData, encodeOptions;
805
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {
806
- while (1) {
807
- switch (_context.prev = _context.next) {
808
- case 0:
809
- _context.next = 2;
810
- return initialize();
811
-
812
- case 2:
813
- decoder = local.decoder; // get pointer to the source/encoded bit stream buffer in WASM memory
814
- // that can hold the encoded bitstream
815
-
816
- encodedBufferInWASM = decoder.getEncodedBuffer(compressedImageFrame.length); // copy the encoded bitstream into WASM memory buffer
817
-
818
- encodedBufferInWASM.set(compressedImageFrame); // decode it
819
-
820
- decoder.decode(); // decoder.decodeSubResolution(decodeLevel, decodeLayer);
821
- // const resolutionAtLevel = decoder.calculateSizeAtDecompositionLevel(decodeLevel);
822
- // get information about the decoded image
823
-
824
- frameInfo = decoder.getFrameInfo(); // get the decoded pixels
825
-
826
- decodedBufferInWASM = decoder.getDecodedBuffer();
827
- imageFrame = new Uint8Array(decodedBufferInWASM.length);
828
- imageFrame.set(decodedBufferInWASM);
829
- imageOffset = "x: ".concat(decoder.getImageOffset().x, ", y: ").concat(decoder.getImageOffset().y);
830
- numDecompositions = decoder.getNumDecompositions();
831
- numLayers = decoder.getNumLayers();
832
- progessionOrder = ['unknown', 'LRCP', 'RLCP', 'RPCL', 'PCRL', 'CPRL'][decoder.getProgressionOrder() + 1];
833
- reversible = decoder.getIsReversible();
834
- blockDimensions = "".concat(decoder.getBlockDimensions().width, " x ").concat(decoder.getBlockDimensions().height);
835
- tileSize = "".concat(decoder.getTileSize().width, " x ").concat(decoder.getTileSize().height);
836
- tileOffset = "".concat(decoder.getTileOffset().x, ", ").concat(decoder.getTileOffset().y);
837
- colorTransform = decoder.getColorSpace();
838
- decodedSize = "".concat(decodedBufferInWASM.length.toLocaleString(), " bytes");
839
- compressionRatio = "".concat((decodedBufferInWASM.length / encodedBufferInWASM.length).toFixed(2), ":1");
840
- encodedImageInfo = {
841
- columns: frameInfo.width,
842
- rows: frameInfo.height,
843
- bitsPerPixel: frameInfo.bitsPerSample,
844
- signed: frameInfo.isSigned,
845
- bytesPerPixel: imageInfo.bytesPerPixel,
846
- componentsPerPixel: frameInfo.componentCount
847
- };
848
- pixelData = getPixelData(frameInfo, decodedBufferInWASM);
849
- encodeOptions = {
850
- imageOffset: imageOffset,
851
- numDecompositions: numDecompositions,
852
- numLayers: numLayers,
853
- progessionOrder: progessionOrder,
854
- reversible: reversible,
855
- blockDimensions: blockDimensions,
856
- tileSize: tileSize,
857
- tileOffset: tileOffset,
858
- colorTransform: colorTransform,
859
- decodedSize: decodedSize,
860
- compressionRatio: compressionRatio
861
- };
862
- return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread({}, imageInfo), {}, {
863
- pixelData: pixelData,
864
- imageInfo: encodedImageInfo,
865
- encodeOptions: encodeOptions
866
- }, encodeOptions), encodedImageInfo));
867
-
868
- case 25:
869
- case "end":
870
- return _context.stop();
871
- }
872
- }
873
- }, _callee);
874
- }));
875
- return _decodeAsync.apply(this, arguments);
876
- }
877
-
878
- function getPixelData(frameInfo, decodedBuffer) {
879
- if (frameInfo.bitsPerSample > 8) {
880
- if (frameInfo.isSigned) {
881
- return new Int16Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength / 2);
882
- }
883
-
884
- return new Uint16Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength / 2);
885
- }
886
-
887
- if (frameInfo.isSigned) {
888
- return new Int8Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength);
889
- }
890
-
891
- return new Uint8Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength);
892
- }
893
-
894
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (decodeAsync);
895
-
896
- /***/ }),
897
-
898
- /***/ "./shared/decoders/decodeJPEGBaseline12Bit-js.ts":
899
- /*!*******************************************************!*\
900
- !*** ./shared/decoders/decodeJPEGBaseline12Bit-js.ts ***!
901
- \*******************************************************/
902
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
903
-
904
- "use strict";
905
- __webpack_require__.r(__webpack_exports__);
906
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
907
- /* harmony export */ "initialize": () => (/* binding */ initialize),
908
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
909
- /* harmony export */ });
910
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
911
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../../node_modules/@babel/runtime/regenerator/index.js");
912
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
913
-
914
-
915
- var local = {
916
- JpegImage: undefined,
917
- decodeConfig: {}
918
- };
919
- function initialize(decodeConfig) {
920
- local.decodeConfig = decodeConfig;
921
-
922
- if (local.JpegImage) {
923
- return Promise.resolve();
924
- }
925
-
926
- return new Promise(function (resolve, reject) {
927
- // @ts-ignore
928
- __webpack_require__.e(/*! import() */ "codecs_jpeg_js").then(__webpack_require__.t.bind(__webpack_require__, /*! ../../../codecs/jpeg */ "../codecs/jpeg.js", 23)).then(function (_ref) {
929
- var JpegImage = _ref.JpegImage;
930
- local.JpegImage = JpegImage;
931
- resolve();
932
- }, reject);
933
- });
934
- }
935
-
936
- function decodeJPEGBaseline12BitAsync(_x, _x2) {
937
- return _decodeJPEGBaseline12BitAsync.apply(this, arguments);
938
- }
939
-
940
- function _decodeJPEGBaseline12BitAsync() {
941
- _decodeJPEGBaseline12BitAsync = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(imageFrame, pixelData) {
942
- var jpeg;
943
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) {
944
- while (1) {
945
- switch (_context.prev = _context.next) {
946
- case 0:
947
- _context.next = 2;
948
- return initialize();
949
-
950
- case 2:
951
- if (!(typeof local.JpegImage === 'undefined')) {
952
- _context.next = 4;
953
- break;
954
- }
955
-
956
- throw new Error('No JPEG Baseline decoder loaded');
957
-
958
- case 4:
959
- jpeg = new local.JpegImage();
960
- jpeg.parse(pixelData); // Do not use the internal jpeg.js color transformation,
961
- // since we will handle this afterwards
962
-
963
- jpeg.colorTransform = false;
964
-
965
- if (!(imageFrame.bitsAllocated === 8)) {
966
- _context.next = 12;
967
- break;
968
- }
969
-
970
- imageFrame.pixelData = jpeg.getData(imageFrame.columns, imageFrame.rows);
971
- return _context.abrupt("return", imageFrame);
972
-
973
- case 12:
974
- if (!(imageFrame.bitsAllocated === 16)) {
975
- _context.next = 15;
976
- break;
977
- }
978
-
979
- imageFrame.pixelData = jpeg.getData16(imageFrame.columns, imageFrame.rows);
980
- return _context.abrupt("return", imageFrame);
981
-
982
- case 15:
983
- case "end":
984
- return _context.stop();
985
- }
986
- }
987
- }, _callee);
988
- }));
989
- return _decodeJPEGBaseline12BitAsync.apply(this, arguments);
990
- }
991
-
992
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (decodeJPEGBaseline12BitAsync);
993
-
994
- /***/ }),
995
-
996
- /***/ "./shared/decoders/decodeJPEGBaseline8Bit.ts":
997
- /*!***************************************************!*\
998
- !*** ./shared/decoders/decodeJPEGBaseline8Bit.ts ***!
999
- \***************************************************/
1000
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1001
-
1002
- "use strict";
1003
- __webpack_require__.r(__webpack_exports__);
1004
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1005
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1006
- /* harmony export */ });
1007
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
1008
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
1009
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../../node_modules/@babel/runtime/regenerator/index.js");
1010
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);
1011
- /* harmony import */ var _cornerstonejs_codec_libjpeg_turbo_8bit_decodewasmjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/codec-libjpeg-turbo-8bit/decodewasmjs */ "../../../node_modules/@cornerstonejs/codec-libjpeg-turbo-8bit/dist/libjpegturbowasm_decode.js");
1012
- /* harmony import */ var _cornerstonejs_codec_libjpeg_turbo_8bit_decodewasmjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_cornerstonejs_codec_libjpeg_turbo_8bit_decodewasmjs__WEBPACK_IMPORTED_MODULE_3__);
1013
- /* harmony import */ var _cornerstonejs_codec_libjpeg_turbo_8bit_decodewasm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/codec-libjpeg-turbo-8bit/decodewasm */ "../../../node_modules/@cornerstonejs/codec-libjpeg-turbo-8bit/dist/libjpegturbowasm_decode.wasm");
1014
-
1015
-
1016
-
1017
-
1018
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1019
-
1020
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1021
-
1022
- // Webpack asset/resource copies this to our output folder
1023
-
1024
-
1025
- var local = {
1026
- codec: undefined,
1027
- decoder: undefined
1028
- };
1029
-
1030
- function initLibjpegTurbo() {
1031
- if (local.codec) {
1032
- return Promise.resolve();
1033
- }
1034
-
1035
- var libjpegTurboModule = _cornerstonejs_codec_libjpeg_turbo_8bit_decodewasmjs__WEBPACK_IMPORTED_MODULE_3___default()({
1036
- locateFile: function locateFile(f) {
1037
- if (f.endsWith('.wasm')) {
1038
- return _cornerstonejs_codec_libjpeg_turbo_8bit_decodewasm__WEBPACK_IMPORTED_MODULE_4__.toString();
1039
- }
1040
-
1041
- return f;
1042
- }
1043
- });
1044
- return new Promise(function (resolve, reject) {
1045
- libjpegTurboModule.then(function (instance) {
1046
- local.codec = instance;
1047
- local.decoder = new instance.JPEGDecoder();
1048
- resolve();
1049
- }, reject);
1050
- });
1051
- } // imageFrame.pixelRepresentation === 1 <-- Signed
1052
-
1053
- /**
1054
- *
1055
- * @param {*} compressedImageFrame
1056
- * @param {object} imageInfo
1057
- * @param {boolean} imageInfo.signed -
1058
- */
1059
-
1060
-
1061
- function decodeAsync(_x, _x2) {
1062
- return _decodeAsync.apply(this, arguments);
1063
- }
1064
-
1065
- function _decodeAsync() {
1066
- _decodeAsync = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(compressedImageFrame, imageInfo) {
1067
- var decoder, encodedBufferInWASM, frameInfo, decodedPixelsInWASM, encodedImageInfo, pixelData, encodeOptions;
1068
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {
1069
- while (1) {
1070
- switch (_context.prev = _context.next) {
1071
- case 0:
1072
- _context.next = 2;
1073
- return initLibjpegTurbo();
1074
-
1075
- case 2:
1076
- decoder = local.decoder; // get pointer to the source/encoded bit stream buffer in WASM memory
1077
- // that can hold the encoded bitstream
1078
-
1079
- encodedBufferInWASM = decoder.getEncodedBuffer(compressedImageFrame.length); // copy the encoded bitstream into WASM memory buffer
1080
-
1081
- encodedBufferInWASM.set(compressedImageFrame); // decode it
1082
-
1083
- decoder.decode(); // get information about the decoded image
1084
-
1085
- frameInfo = decoder.getFrameInfo(); // get the decoded pixels
1086
-
1087
- decodedPixelsInWASM = decoder.getDecodedBuffer();
1088
- encodedImageInfo = {
1089
- columns: frameInfo.width,
1090
- rows: frameInfo.height,
1091
- bitsPerPixel: frameInfo.bitsPerSample,
1092
- signed: imageInfo.signed,
1093
- bytesPerPixel: imageInfo.bytesPerPixel,
1094
- componentsPerPixel: frameInfo.componentCount
1095
- };
1096
- pixelData = getPixelData(frameInfo, decodedPixelsInWASM);
1097
- encodeOptions = {
1098
- frameInfo: frameInfo
1099
- };
1100
- return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread({}, imageInfo), {}, {
1101
- pixelData: pixelData,
1102
- imageInfo: encodedImageInfo,
1103
- encodeOptions: encodeOptions
1104
- }, encodeOptions), encodedImageInfo));
1105
-
1106
- case 12:
1107
- case "end":
1108
- return _context.stop();
1109
- }
1110
- }
1111
- }, _callee);
1112
- }));
1113
- return _decodeAsync.apply(this, arguments);
1114
- }
1115
-
1116
- function getPixelData(frameInfo, decodedBuffer) {
1117
- if (frameInfo.isSigned) {
1118
- return new Int8Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength);
1119
- }
1120
-
1121
- return new Uint8Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength);
1122
- }
1123
-
1124
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (decodeAsync);
1125
-
1126
- /***/ }),
1127
-
1128
- /***/ "./shared/decoders/decodeJPEGLS.ts":
1129
- /*!*****************************************!*\
1130
- !*** ./shared/decoders/decodeJPEGLS.ts ***!
1131
- \*****************************************/
1132
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1133
-
1134
- "use strict";
1135
- __webpack_require__.r(__webpack_exports__);
1136
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1137
- /* harmony export */ "initialize": () => (/* binding */ initialize),
1138
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1139
- /* harmony export */ });
1140
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
1141
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
1142
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../../node_modules/@babel/runtime/regenerator/index.js");
1143
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);
1144
- /* harmony import */ var _cornerstonejs_codec_charls_decodewasmjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/codec-charls/decodewasmjs */ "../../../node_modules/@cornerstonejs/codec-charls/dist/charlswasm_decode.js");
1145
- /* harmony import */ var _cornerstonejs_codec_charls_decodewasmjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_cornerstonejs_codec_charls_decodewasmjs__WEBPACK_IMPORTED_MODULE_3__);
1146
- /* harmony import */ var _cornerstonejs_codec_charls_decodewasm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/codec-charls/decodewasm */ "../../../node_modules/@cornerstonejs/codec-charls/dist/charlswasm_decode.wasm");
1147
-
1148
-
1149
-
1150
-
1151
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1152
-
1153
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1154
-
1155
-
1156
-
1157
- var local = {
1158
- codec: undefined,
1159
- decoder: undefined,
1160
- decodeConfig: {}
1161
- };
1162
-
1163
- function getExceptionMessage(exception) {
1164
- return typeof exception === 'number' ? local.codec.getExceptionMessage(exception) : exception;
1165
- }
1166
-
1167
- function initialize(decodeConfig) {
1168
- local.decodeConfig = decodeConfig;
1169
-
1170
- if (local.codec) {
1171
- return Promise.resolve();
1172
- }
1173
-
1174
- var charlsModule = _cornerstonejs_codec_charls_decodewasmjs__WEBPACK_IMPORTED_MODULE_3___default()({
1175
- locateFile: function locateFile(f) {
1176
- if (f.endsWith('.wasm')) {
1177
- return _cornerstonejs_codec_charls_decodewasm__WEBPACK_IMPORTED_MODULE_4__.toString();
1178
- }
1179
-
1180
- return f;
1181
- }
1182
- });
1183
- return new Promise(function (resolve, reject) {
1184
- charlsModule.then(function (instance) {
1185
- local.codec = instance;
1186
- local.decoder = new instance.JpegLSDecoder();
1187
- resolve();
1188
- }, reject);
1189
- });
1190
- }
1191
- /**
1192
- *
1193
- * @param {*} compressedImageFrame
1194
- * @param {object} imageInfo
1195
- * @param {boolean} imageInfo.signed - (pixelRepresentation === 1)
1196
- */
1197
-
1198
- function decodeAsync(_x, _x2) {
1199
- return _decodeAsync.apply(this, arguments);
1200
- }
1201
-
1202
- function _decodeAsync() {
1203
- _decodeAsync = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().mark(function _callee(compressedImageFrame, imageInfo) {
1204
- var decoder, encodedBufferInWASM, frameInfo, interleaveMode, nearLossless, decodedPixelsInWASM, encodedImageInfo, pixelData, encodeOptions;
1205
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default().wrap(function _callee$(_context) {
1206
- while (1) {
1207
- switch (_context.prev = _context.next) {
1208
- case 0:
1209
- _context.prev = 0;
1210
- console.debug('decodeAsync', compressedImageFrame, imageInfo);
1211
- _context.next = 4;
1212
- return initialize();
1213
-
1214
- case 4:
1215
- decoder = local.decoder; // get pointer to the source/encoded bit stream buffer in WASM memory
1216
- // that can hold the encoded bitstream
1217
-
1218
- encodedBufferInWASM = decoder.getEncodedBuffer(compressedImageFrame.length); // copy the encoded bitstream into WASM memory buffer
1219
-
1220
- encodedBufferInWASM.set(compressedImageFrame); // decode it
1221
-
1222
- decoder.decode(); // get information about the decoded image
1223
-
1224
- frameInfo = decoder.getFrameInfo();
1225
- interleaveMode = decoder.getInterleaveMode();
1226
- nearLossless = decoder.getNearLossless(); // get the decoded pixels
1227
-
1228
- decodedPixelsInWASM = decoder.getDecodedBuffer();
1229
- encodedImageInfo = {
1230
- columns: frameInfo.width,
1231
- rows: frameInfo.height,
1232
- bitsPerPixel: frameInfo.bitsPerSample,
1233
- signed: imageInfo.signed,
1234
- bytesPerPixel: imageInfo.bytesPerPixel,
1235
- componentsPerPixel: frameInfo.componentCount
1236
- };
1237
- pixelData = getPixelData(frameInfo, decodedPixelsInWASM, imageInfo.signed);
1238
- encodeOptions = {
1239
- nearLossless: nearLossless,
1240
- interleaveMode: interleaveMode,
1241
- frameInfo: frameInfo
1242
- }; // local.codec.doLeakCheck();
1243
-
1244
- return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread({}, imageInfo), {}, {
1245
- pixelData: pixelData,
1246
- imageInfo: encodedImageInfo,
1247
- encodeOptions: encodeOptions
1248
- }, encodeOptions), encodedImageInfo));
1249
-
1250
- case 18:
1251
- _context.prev = 18;
1252
- _context.t0 = _context["catch"](0);
1253
- throw getExceptionMessage(_context.t0);
1254
-
1255
- case 21:
1256
- case "end":
1257
- return _context.stop();
1258
- }
1259
- }
1260
- }, _callee, null, [[0, 18]]);
1261
- }));
1262
- return _decodeAsync.apply(this, arguments);
1263
- }
1264
-
1265
- function getPixelData(frameInfo, decodedBuffer, signed) {
1266
- if (frameInfo.bitsPerSample > 8) {
1267
- if (signed) {
1268
- return new Int16Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength / 2);
1269
- }
1270
-
1271
- return new Uint16Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength / 2);
1272
- }
1273
-
1274
- if (signed) {
1275
- return new Int8Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength);
1276
- }
1277
-
1278
- return new Uint8Array(decodedBuffer.buffer, decodedBuffer.byteOffset, decodedBuffer.byteLength);
1279
- }
1280
-
1281
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (decodeAsync);
1282
-
1283
- /***/ }),
1284
-
1285
- /***/ "./shared/decoders/decodeJPEGLossless.ts":
1286
- /*!***********************************************!*\
1287
- !*** ./shared/decoders/decodeJPEGLossless.ts ***!
1288
- \***********************************************/
1289
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1290
-
1291
- "use strict";
1292
- __webpack_require__.r(__webpack_exports__);
1293
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1294
- /* harmony export */ "initialize": () => (/* binding */ initialize),
1295
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1296
- /* harmony export */ });
1297
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
1298
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../../node_modules/@babel/runtime/regenerator/index.js");
1299
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
1300
-
1301
-
1302
- var local = {
1303
- jpeg: undefined,
1304
- decodeConfig: {}
1305
- };
1306
- function initialize(decodeConfig) {
1307
- local.decodeConfig = decodeConfig;
1308
-
1309
- if (local.jpeg) {
1310
- return Promise.resolve();
1311
- }
1312
-
1313
- return new Promise(function (resolve, reject) {
1314
- __webpack_require__.e(/*! import() */ "codecs_jpegLossless_js").then(__webpack_require__.t.bind(__webpack_require__, /*! ../../../codecs/jpegLossless */ "../codecs/jpegLossless.js", 23)).then(function (jpeg) {
1315
- local.jpeg = jpeg;
1316
- resolve();
1317
- }, reject);
1318
- });
1319
- }
1320
-
1321
- function decodeJPEGLossless(_x, _x2) {
1322
- return _decodeJPEGLossless.apply(this, arguments);
1323
- }
1324
-
1325
- function _decodeJPEGLossless() {
1326
- _decodeJPEGLossless = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(imageFrame, pixelData) {
1327
- var byteOutput, buffer, decoder, decompressedData;
1328
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) {
1329
- while (1) {
1330
- switch (_context.prev = _context.next) {
1331
- case 0:
1332
- _context.next = 2;
1333
- return initialize();
1334
-
1335
- case 2:
1336
- if (!(typeof local.jpeg === 'undefined' || typeof local.jpeg.lossless === 'undefined' || typeof local.jpeg.lossless.Decoder === 'undefined')) {
1337
- _context.next = 4;
1338
- break;
1339
- }
1340
-
1341
- throw new Error('No JPEG Lossless decoder loaded');
1342
-
1343
- case 4:
1344
- byteOutput = imageFrame.bitsAllocated <= 8 ? 1 : 2; // console.time('jpeglossless');
1345
-
1346
- buffer = pixelData.buffer;
1347
- decoder = new local.jpeg.lossless.Decoder();
1348
- decompressedData = decoder.decode(buffer, pixelData.byteOffset, pixelData.length, byteOutput); // console.timeEnd('jpeglossless');
1349
-
1350
- if (!(imageFrame.pixelRepresentation === 0)) {
1351
- _context.next = 14;
1352
- break;
1353
- }
1354
-
1355
- if (!(imageFrame.bitsAllocated === 16)) {
1356
- _context.next = 12;
1357
- break;
1358
- }
1359
-
1360
- imageFrame.pixelData = new Uint16Array(decompressedData.buffer);
1361
- return _context.abrupt("return", imageFrame);
1362
-
1363
- case 12:
1364
- // untested!
1365
- imageFrame.pixelData = new Uint8Array(decompressedData.buffer);
1366
- return _context.abrupt("return", imageFrame);
1367
-
1368
- case 14:
1369
- imageFrame.pixelData = new Int16Array(decompressedData.buffer);
1370
- return _context.abrupt("return", imageFrame);
1371
-
1372
- case 16:
1373
- case "end":
1374
- return _context.stop();
1375
- }
1376
- }
1377
- }, _callee);
1378
- }));
1379
- return _decodeJPEGLossless.apply(this, arguments);
1380
- }
1381
-
1382
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (decodeJPEGLossless);
1383
-
1384
- /***/ }),
1385
-
1386
- /***/ "./shared/decoders/decodeLittleEndian.ts":
1387
- /*!***********************************************!*\
1388
- !*** ./shared/decoders/decodeLittleEndian.ts ***!
1389
- \***********************************************/
1390
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1391
-
1392
- "use strict";
1393
- __webpack_require__.r(__webpack_exports__);
1394
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1395
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1396
- /* harmony export */ });
1397
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
1398
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../../node_modules/@babel/runtime/regenerator/index.js");
1399
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
1400
-
1401
-
1402
-
1403
- function decodeLittleEndian(_x, _x2) {
1404
- return _decodeLittleEndian.apply(this, arguments);
1405
- }
1406
-
1407
- function _decodeLittleEndian() {
1408
- _decodeLittleEndian = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(imageFrame, pixelData) {
1409
- var arrayBuffer, offset, length;
1410
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) {
1411
- while (1) {
1412
- switch (_context.prev = _context.next) {
1413
- case 0:
1414
- arrayBuffer = pixelData.buffer;
1415
- offset = pixelData.byteOffset;
1416
- length = pixelData.length;
1417
-
1418
- if (imageFrame.bitsAllocated === 16) {
1419
- // if pixel data is not aligned on even boundary, shift it so we can create the 16 bit array
1420
- // buffers on it
1421
- if (offset % 2) {
1422
- arrayBuffer = arrayBuffer.slice(offset);
1423
- offset = 0;
1424
- }
1425
-
1426
- if (imageFrame.pixelRepresentation === 0) {
1427
- imageFrame.pixelData = new Uint16Array(arrayBuffer, offset, length / 2);
1428
- } else {
1429
- imageFrame.pixelData = new Int16Array(arrayBuffer, offset, length / 2);
1430
- }
1431
- } else if (imageFrame.bitsAllocated === 8 || imageFrame.bitsAllocated === 1) {
1432
- imageFrame.pixelData = pixelData;
1433
- } else if (imageFrame.bitsAllocated === 32) {
1434
- // if pixel data is not aligned on even boundary, shift it
1435
- if (offset % 2) {
1436
- arrayBuffer = arrayBuffer.slice(offset);
1437
- offset = 0;
1438
- }
1439
-
1440
- imageFrame.pixelData = new Float32Array(arrayBuffer, offset, length / 4);
1441
- }
1442
-
1443
- return _context.abrupt("return", imageFrame);
1444
-
1445
- case 5:
1446
- case "end":
1447
- return _context.stop();
1448
- }
1449
- }
1450
- }, _callee);
1451
- }));
1452
- return _decodeLittleEndian.apply(this, arguments);
1453
- }
1454
-
1455
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (decodeLittleEndian);
1456
-
1457
- /***/ }),
1458
-
1459
- /***/ "./shared/decoders/decodeRLE.ts":
1460
- /*!**************************************!*\
1461
- !*** ./shared/decoders/decodeRLE.ts ***!
1462
- \**************************************/
1463
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1464
-
1465
- "use strict";
1466
- __webpack_require__.r(__webpack_exports__);
1467
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1468
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1469
- /* harmony export */ });
1470
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
1471
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../../node_modules/@babel/runtime/regenerator/index.js");
1472
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
1473
-
1474
-
1475
-
1476
- function decodeRLE(_x, _x2) {
1477
- return _decodeRLE.apply(this, arguments);
1478
- }
1479
-
1480
- function _decodeRLE() {
1481
- _decodeRLE = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(imageFrame, pixelData) {
1482
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) {
1483
- while (1) {
1484
- switch (_context.prev = _context.next) {
1485
- case 0:
1486
- if (!(imageFrame.bitsAllocated === 8)) {
1487
- _context.next = 6;
1488
- break;
1489
- }
1490
-
1491
- if (!imageFrame.planarConfiguration) {
1492
- _context.next = 3;
1493
- break;
1494
- }
1495
-
1496
- return _context.abrupt("return", decode8Planar(imageFrame, pixelData));
1497
-
1498
- case 3:
1499
- return _context.abrupt("return", decode8(imageFrame, pixelData));
1500
-
1501
- case 6:
1502
- if (!(imageFrame.bitsAllocated === 16)) {
1503
- _context.next = 8;
1504
- break;
1505
- }
1506
-
1507
- return _context.abrupt("return", decode16(imageFrame, pixelData));
1508
-
1509
- case 8:
1510
- throw new Error('unsupported pixel format for RLE');
1511
-
1512
- case 9:
1513
- case "end":
1514
- return _context.stop();
1515
- }
1516
- }
1517
- }, _callee);
1518
- }));
1519
- return _decodeRLE.apply(this, arguments);
1520
- }
1521
-
1522
- function decode8(imageFrame, pixelData) {
1523
- var frameData = pixelData;
1524
- var frameSize = imageFrame.rows * imageFrame.columns;
1525
- var outFrame = new ArrayBuffer(frameSize * imageFrame.samplesPerPixel);
1526
- var header = new DataView(frameData.buffer, frameData.byteOffset);
1527
- var data = new Int8Array(frameData.buffer, frameData.byteOffset);
1528
- var out = new Int8Array(outFrame);
1529
- var outIndex = 0;
1530
- var numSegments = header.getInt32(0, true);
1531
-
1532
- for (var s = 0; s < numSegments; ++s) {
1533
- outIndex = s;
1534
- var inIndex = header.getInt32((s + 1) * 4, true);
1535
- var maxIndex = header.getInt32((s + 2) * 4, true);
1536
-
1537
- if (maxIndex === 0) {
1538
- maxIndex = frameData.length;
1539
- }
1540
-
1541
- var endOfSegment = frameSize * numSegments;
1542
-
1543
- while (inIndex < maxIndex) {
1544
- var n = data[inIndex++];
1545
-
1546
- if (n >= 0 && n <= 127) {
1547
- // copy n bytes
1548
- for (var i = 0; i < n + 1 && outIndex < endOfSegment; ++i) {
1549
- out[outIndex] = data[inIndex++];
1550
- outIndex += imageFrame.samplesPerPixel;
1551
- }
1552
- } else if (n <= -1 && n >= -127) {
1553
- var value = data[inIndex++]; // run of n bytes
1554
-
1555
- for (var j = 0; j < -n + 1 && outIndex < endOfSegment; ++j) {
1556
- out[outIndex] = value;
1557
- outIndex += imageFrame.samplesPerPixel;
1558
- }
1559
- }
1560
- /* else if (n === -128) {
1561
- } // do nothing */
1562
-
1563
- }
1564
- }
1565
-
1566
- imageFrame.pixelData = new Uint8Array(outFrame);
1567
- return imageFrame;
1568
- }
1569
-
1570
- function decode8Planar(imageFrame, pixelData) {
1571
- var frameData = pixelData;
1572
- var frameSize = imageFrame.rows * imageFrame.columns;
1573
- var outFrame = new ArrayBuffer(frameSize * imageFrame.samplesPerPixel);
1574
- var header = new DataView(frameData.buffer, frameData.byteOffset);
1575
- var data = new Int8Array(frameData.buffer, frameData.byteOffset);
1576
- var out = new Int8Array(outFrame);
1577
- var outIndex = 0;
1578
- var numSegments = header.getInt32(0, true);
1579
-
1580
- for (var s = 0; s < numSegments; ++s) {
1581
- outIndex = s * frameSize;
1582
- var inIndex = header.getInt32((s + 1) * 4, true);
1583
- var maxIndex = header.getInt32((s + 2) * 4, true);
1584
-
1585
- if (maxIndex === 0) {
1586
- maxIndex = frameData.length;
1587
- }
1588
-
1589
- var endOfSegment = frameSize * numSegments;
1590
-
1591
- while (inIndex < maxIndex) {
1592
- var n = data[inIndex++];
1593
-
1594
- if (n >= 0 && n <= 127) {
1595
- // copy n bytes
1596
- for (var i = 0; i < n + 1 && outIndex < endOfSegment; ++i) {
1597
- out[outIndex] = data[inIndex++];
1598
- outIndex++;
1599
- }
1600
- } else if (n <= -1 && n >= -127) {
1601
- var value = data[inIndex++]; // run of n bytes
1602
-
1603
- for (var j = 0; j < -n + 1 && outIndex < endOfSegment; ++j) {
1604
- out[outIndex] = value;
1605
- outIndex++;
1606
- }
1607
- }
1608
- /* else if (n === -128) {
1609
- } // do nothing */
1610
-
1611
- }
1612
- }
1613
-
1614
- imageFrame.pixelData = new Uint8Array(outFrame);
1615
- return imageFrame;
1616
- }
1617
-
1618
- function decode16(imageFrame, pixelData) {
1619
- var frameData = pixelData;
1620
- var frameSize = imageFrame.rows * imageFrame.columns;
1621
- var outFrame = new ArrayBuffer(frameSize * imageFrame.samplesPerPixel * 2);
1622
- var header = new DataView(frameData.buffer, frameData.byteOffset);
1623
- var data = new Int8Array(frameData.buffer, frameData.byteOffset);
1624
- var out = new Int8Array(outFrame);
1625
- var numSegments = header.getInt32(0, true);
1626
-
1627
- for (var s = 0; s < numSegments; ++s) {
1628
- var outIndex = 0;
1629
- var highByte = s === 0 ? 1 : 0;
1630
- var inIndex = header.getInt32((s + 1) * 4, true);
1631
- var maxIndex = header.getInt32((s + 2) * 4, true);
1632
-
1633
- if (maxIndex === 0) {
1634
- maxIndex = frameData.length;
1635
- }
1636
-
1637
- while (inIndex < maxIndex) {
1638
- var n = data[inIndex++];
1639
-
1640
- if (n >= 0 && n <= 127) {
1641
- for (var i = 0; i < n + 1 && outIndex < frameSize; ++i) {
1642
- out[outIndex * 2 + highByte] = data[inIndex++];
1643
- outIndex++;
1644
- }
1645
- } else if (n <= -1 && n >= -127) {
1646
- var value = data[inIndex++];
1647
-
1648
- for (var j = 0; j < -n + 1 && outIndex < frameSize; ++j) {
1649
- out[outIndex * 2 + highByte] = value;
1650
- outIndex++;
1651
- }
1652
- }
1653
- /* else if (n === -128) {
1654
- } // do nothing */
1655
-
1656
- }
1657
- }
1658
-
1659
- if (imageFrame.pixelRepresentation === 0) {
1660
- imageFrame.pixelData = new Uint16Array(outFrame);
1661
- } else {
1662
- imageFrame.pixelData = new Int16Array(outFrame);
1663
- }
1664
-
1665
- return imageFrame;
1666
- }
1667
-
1668
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (decodeRLE);
1669
-
1670
- /***/ }),
1671
-
1672
- /***/ "./shared/getMinMax.ts":
1673
- /*!*****************************!*\
1674
- !*** ./shared/getMinMax.ts ***!
1675
- \*****************************/
1676
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1677
-
1678
- "use strict";
1679
- __webpack_require__.r(__webpack_exports__);
1680
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1681
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1682
- /* harmony export */ });
1683
- /**
1684
- * Calculate the minimum and maximum values in an Array
1685
- *
1686
- * @param {Number[]} storedPixelData
1687
- * @return {{min: Number, max: Number}}
1688
- */
1689
- function getMinMax(storedPixelData) {
1690
- // we always calculate the min max values since they are not always
1691
- // present in DICOM and we don't want to trust them anyway as cornerstone
1692
- // depends on us providing reliable values for these
1693
- var min = storedPixelData[0];
1694
- var max = storedPixelData[0];
1695
- var storedPixel;
1696
- var numPixels = storedPixelData.length;
1697
-
1698
- for (var index = 1; index < numPixels; index++) {
1699
- storedPixel = storedPixelData[index];
1700
- min = Math.min(min, storedPixel);
1701
- max = Math.max(max, storedPixel);
1702
- }
1703
-
1704
- return {
1705
- min: min,
1706
- max: max
1707
- };
1708
- }
1709
-
1710
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getMinMax);
1711
-
1712
- /***/ }),
1713
-
1714
- /***/ "./shared/scaling/scaleArray.ts":
1715
- /*!**************************************!*\
1716
- !*** ./shared/scaling/scaleArray.ts ***!
1717
- \**************************************/
1718
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1719
-
1720
- "use strict";
1721
- __webpack_require__.r(__webpack_exports__);
1722
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1723
- /* harmony export */ "default": () => (/* binding */ scaleArray)
1724
- /* harmony export */ });
1725
- function scaleArray(array, scalingParameters) {
1726
- var arrayLength = array.length;
1727
- var rescaleSlope = scalingParameters.rescaleSlope,
1728
- rescaleIntercept = scalingParameters.rescaleIntercept,
1729
- suvbw = scalingParameters.suvbw;
1730
-
1731
- if (scalingParameters.modality === 'PT') {
1732
- if (typeof suvbw !== 'number') {
1733
- return;
1734
- }
1735
-
1736
- for (var i = 0; i < arrayLength; i++) {
1737
- array[i] = suvbw * (array[i] * rescaleSlope + rescaleIntercept);
1738
- }
1739
- } else {
1740
- for (var _i = 0; _i < arrayLength; _i++) {
1741
- array[_i] = array[_i] * rescaleSlope + rescaleIntercept;
1742
- }
1743
- }
1744
-
1745
- return true;
1746
- }
1747
-
1748
- /***/ }),
1749
-
1750
- /***/ "./webWorker/decodeTask.ts":
1751
- /*!*********************************!*\
1752
- !*** ./webWorker/decodeTask.ts ***!
1753
- \*********************************/
1754
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1755
-
1756
- "use strict";
1757
- __webpack_require__.r(__webpack_exports__);
1758
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1759
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1760
- /* harmony export */ });
1761
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
1762
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../../node_modules/@babel/runtime/regenerator/index.js");
1763
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
1764
- /* harmony import */ var _shared_decoders_decodeJPEG2000__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/decoders/decodeJPEG2000 */ "./shared/decoders/decodeJPEG2000.ts");
1765
- /* harmony import */ var _shared_decoders_decodeJPEGLS__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/decoders/decodeJPEGLS */ "./shared/decoders/decodeJPEGLS.ts");
1766
- /* harmony import */ var _shared_calculateMinMax__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../shared/calculateMinMax */ "./shared/calculateMinMax.ts");
1767
- /* harmony import */ var _shared_decodeImageFrame__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../shared/decodeImageFrame */ "./shared/decodeImageFrame.ts");
1768
-
1769
-
1770
-
1771
-
1772
-
1773
-
1774
- // the configuration object for the decodeTask
1775
- var decodeConfig;
1776
- /**
1777
- * Function to control loading and initializing the codecs
1778
- * @param config
1779
- */
1780
-
1781
- function loadCodecs(config) {
1782
- // Initialize the codecs
1783
- if (config.decodeTask.initializeCodecsOnStartup) {
1784
- (0,_shared_decoders_decodeJPEG2000__WEBPACK_IMPORTED_MODULE_2__.initialize)(config.decodeTask);
1785
- (0,_shared_decoders_decodeJPEGLS__WEBPACK_IMPORTED_MODULE_3__.initialize)(config.decodeTask);
1786
- }
1787
- }
1788
- /**
1789
- * Task initialization function
1790
- */
1791
-
1792
-
1793
- function initialize(config) {
1794
- decodeConfig = config;
1795
- loadCodecs(config);
1796
- }
1797
- /**
1798
- * Task handler function
1799
- */
1800
-
1801
-
1802
- function handler(_x, _x2) {
1803
- return _handler.apply(this, arguments);
1804
- }
1805
-
1806
- function _handler() {
1807
- _handler = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(data, doneCallback) {
1808
- var strict, pixelData, imageFrame;
1809
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) {
1810
- while (1) {
1811
- switch (_context.prev = _context.next) {
1812
- case 0:
1813
- // Load the codecs if they aren't already loaded
1814
- loadCodecs(decodeConfig);
1815
- strict = decodeConfig && decodeConfig.decodeTask && decodeConfig.decodeTask.strict; // convert pixel data from ArrayBuffer to Uint8Array since web workers support passing ArrayBuffers but
1816
- // not typed arrays
1817
-
1818
- pixelData = new Uint8Array(data.data.pixelData);
1819
- _context.next = 5;
1820
- return (0,_shared_decodeImageFrame__WEBPACK_IMPORTED_MODULE_5__["default"])(data.data.imageFrame, data.data.transferSyntax, pixelData, // decodeTask are webworker specific, but decodeConfig are the configs
1821
- // that are passed in from the user. We need to merge them together
1822
- Object.assign(decodeConfig.decodeTask, data.data.decodeConfig), data.data.options);
1823
-
1824
- case 5:
1825
- imageFrame = _context.sent;
1826
-
1827
- if (imageFrame.pixelData) {
1828
- _context.next = 8;
1829
- break;
1830
- }
1831
-
1832
- throw new Error('decodeTask: imageFrame.pixelData is undefined after decoding');
1833
-
1834
- case 8:
1835
- (0,_shared_calculateMinMax__WEBPACK_IMPORTED_MODULE_4__["default"])(imageFrame, strict); // convert from TypedArray to ArrayBuffer since web workers support passing ArrayBuffers but not
1836
- // typed arrays
1837
- // @ts-ignore
1838
-
1839
- imageFrame.pixelData = imageFrame.pixelData.buffer;
1840
- doneCallback === null || doneCallback === void 0 ? void 0 : doneCallback(imageFrame, [imageFrame.pixelData]);
1841
- return _context.abrupt("return", {
1842
- result: imageFrame,
1843
- transferList: [imageFrame.pixelData]
1844
- });
1845
-
1846
- case 12:
1847
- case "end":
1848
- return _context.stop();
1849
- }
1850
- }
1851
- }, _callee);
1852
- }));
1853
- return _handler.apply(this, arguments);
1854
- }
1855
-
1856
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1857
- taskType: 'decodeTask',
1858
- handler: handler,
1859
- initialize: initialize
1860
- });
1861
-
1862
- /***/ }),
1863
-
1864
- /***/ "./webWorker/webWorker.ts":
1865
- /*!********************************!*\
1866
- !*** ./webWorker/webWorker.ts ***!
1867
- \********************************/
1868
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1869
-
1870
- "use strict";
1871
- __webpack_require__.r(__webpack_exports__);
1872
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1873
- /* harmony export */ "registerTaskHandler": () => (/* binding */ registerTaskHandler)
1874
- /* harmony export */ });
1875
- /* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
1876
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../../node_modules/@babel/runtime/regenerator/index.js");
1877
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
1878
-
1879
-
1880
- /// <reference lib="webworker" />
1881
- // an object of task handlers
1882
- var taskHandlers = {}; // Flag to ensure web worker is only initialized once
1883
-
1884
- var initialized = false; // the configuration object passed in when the web worker manager is initialized
1885
-
1886
- var config;
1887
- /**
1888
- * Initialization function that loads additional web workers and initializes them
1889
- * @param data
1890
- */
1891
-
1892
- function initialize(data) {
1893
- // console.log('web worker initialize ', data.workerIndex);
1894
- // prevent initialization from happening more than once
1895
- if (initialized) {
1896
- return;
1897
- } // save the config data
1898
-
1899
-
1900
- config = data.config;
1901
- /**
1902
- * @todo review any
1903
- */
1904
- // Additional web worker tasks can self-register by calling self.registerTaskHandler
1905
-
1906
- self.registerTaskHandler = registerTaskHandler; // load any additional web worker tasks
1907
-
1908
- if (data.config.webWorkerTaskPaths) {
1909
- for (var i = 0; i < data.config.webWorkerTaskPaths.length; i++) {
1910
- self.importScripts(data.config.webWorkerTaskPaths[i]);
1911
- }
1912
- } // initialize each task handler
1913
-
1914
-
1915
- Object.keys(taskHandlers).forEach(function (key) {
1916
- taskHandlers[key].initialize(config.taskConfiguration);
1917
- }); // tell main ui thread that we have completed initialization
1918
-
1919
- self.postMessage({
1920
- taskType: 'initialize',
1921
- status: 'success',
1922
- result: {},
1923
- workerIndex: data.workerIndex
1924
- });
1925
- initialized = true;
1926
- }
1927
- /**
1928
- * Function exposed to web worker tasks to register themselves
1929
- * @param taskHandler
1930
- */
1931
-
1932
-
1933
- function registerTaskHandler(taskHandler) {
1934
- if (taskHandlers[taskHandler.taskType]) {
1935
- console.log('attempt to register duplicate task handler "', taskHandler.taskType, '"');
1936
- return false;
1937
- }
1938
-
1939
- taskHandlers[taskHandler.taskType] = taskHandler;
1940
-
1941
- if (initialized) {
1942
- taskHandler.initialize(config.taskConfiguration);
1943
- }
1944
- }
1945
- /**
1946
- * Function to load a new web worker task with updated configuration
1947
- * @param data
1948
- */
1949
-
1950
- function loadWebWorkerTask(data) {
1951
- config = data.config;
1952
- self.importScripts(data.sourcePath);
1953
- }
1954
- /**
1955
- * Web worker message handler - dispatches messages to the registered task handlers
1956
- * @param msg
1957
- */
1958
-
1959
-
1960
- self.onmessage = /*#__PURE__*/function () {
1961
- var _ref = (0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().mark(function _callee(msg) {
1962
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default().wrap(function _callee$(_context) {
1963
- while (1) {
1964
- switch (_context.prev = _context.next) {
1965
- case 0:
1966
- if (msg.data.taskType) {
1967
- _context.next = 3;
1968
- break;
1969
- }
1970
-
1971
- console.log(msg.data);
1972
- return _context.abrupt("return");
1973
-
1974
- case 3:
1975
- if (!(msg.data.taskType === 'initialize')) {
1976
- _context.next = 6;
1977
- break;
1978
- }
1979
-
1980
- initialize(msg.data);
1981
- return _context.abrupt("return");
1982
-
1983
- case 6:
1984
- if (!(msg.data.taskType === 'loadWebWorkerTask')) {
1985
- _context.next = 9;
1986
- break;
1987
- }
1988
-
1989
- loadWebWorkerTask(msg.data);
1990
- return _context.abrupt("return");
1991
-
1992
- case 9:
1993
- // dispatch the message if there is a handler registered for it
1994
- if (taskHandlers[msg.data.taskType]) {
1995
- try {
1996
- // @ts-ignore
1997
- taskHandlers[msg.data.taskType].handler(msg.data, function (result, transferList) {
1998
- self.postMessage({
1999
- taskType: msg.data.taskType,
2000
- status: 'success',
2001
- result: result,
2002
- workerIndex: msg.data.workerIndex
2003
- }, transferList);
2004
- });
2005
- } catch (error) {
2006
- console.log("task ".concat(msg.data.taskType, " failed - ").concat(error.message), error);
2007
- self.postMessage({
2008
- taskType: msg.data.taskType,
2009
- status: 'failed',
2010
- result: error.message,
2011
- workerIndex: msg.data.workerIndex
2012
- });
2013
- }
2014
- } else {
2015
- // not task handler registered - send a failure message back to ui thread
2016
- console.log('no task handler for ', msg.data.taskType);
2017
- console.log(taskHandlers);
2018
- self.postMessage({
2019
- taskType: msg.data.taskType,
2020
- status: 'failed - no task handler registered',
2021
- workerIndex: msg.data.workerIndex
2022
- });
2023
- }
2024
-
2025
- case 10:
2026
- case "end":
2027
- return _context.stop();
2028
- }
2029
- }
2030
- }, _callee);
2031
- }));
2032
-
2033
- return function (_x) {
2034
- return _ref.apply(this, arguments);
2035
- };
2036
- }();
2037
-
2038
- /***/ }),
2039
-
2040
- /***/ "../../../node_modules/regenerator-runtime/runtime.js":
2041
- /*!************************************************************!*\
2042
- !*** ../../../node_modules/regenerator-runtime/runtime.js ***!
2043
- \************************************************************/
2044
- /***/ ((module) => {
2045
-
2046
- /**
2047
- * Copyright (c) 2014-present, Facebook, Inc.
2048
- *
2049
- * This source code is licensed under the MIT license found in the
2050
- * LICENSE file in the root directory of this source tree.
2051
- */
2052
-
2053
- var runtime = (function (exports) {
2054
- "use strict";
2055
-
2056
- var Op = Object.prototype;
2057
- var hasOwn = Op.hasOwnProperty;
2058
- var undefined; // More compressible than void 0.
2059
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
2060
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
2061
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
2062
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
2063
-
2064
- function define(obj, key, value) {
2065
- Object.defineProperty(obj, key, {
2066
- value: value,
2067
- enumerable: true,
2068
- configurable: true,
2069
- writable: true
2070
- });
2071
- return obj[key];
2072
- }
2073
- try {
2074
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
2075
- define({}, "");
2076
- } catch (err) {
2077
- define = function(obj, key, value) {
2078
- return obj[key] = value;
2079
- };
2080
- }
2081
-
2082
- function wrap(innerFn, outerFn, self, tryLocsList) {
2083
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
2084
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
2085
- var generator = Object.create(protoGenerator.prototype);
2086
- var context = new Context(tryLocsList || []);
2087
-
2088
- // The ._invoke method unifies the implementations of the .next,
2089
- // .throw, and .return methods.
2090
- generator._invoke = makeInvokeMethod(innerFn, self, context);
2091
-
2092
- return generator;
2093
- }
2094
- exports.wrap = wrap;
2095
-
2096
- // Try/catch helper to minimize deoptimizations. Returns a completion
2097
- // record like context.tryEntries[i].completion. This interface could
2098
- // have been (and was previously) designed to take a closure to be
2099
- // invoked without arguments, but in all the cases we care about we
2100
- // already have an existing method we want to call, so there's no need
2101
- // to create a new function object. We can even get away with assuming
2102
- // the method takes exactly one argument, since that happens to be true
2103
- // in every case, so we don't have to touch the arguments object. The
2104
- // only additional allocation required is the completion record, which
2105
- // has a stable shape and so hopefully should be cheap to allocate.
2106
- function tryCatch(fn, obj, arg) {
2107
- try {
2108
- return { type: "normal", arg: fn.call(obj, arg) };
2109
- } catch (err) {
2110
- return { type: "throw", arg: err };
2111
- }
2112
- }
2113
-
2114
- var GenStateSuspendedStart = "suspendedStart";
2115
- var GenStateSuspendedYield = "suspendedYield";
2116
- var GenStateExecuting = "executing";
2117
- var GenStateCompleted = "completed";
2118
-
2119
- // Returning this object from the innerFn has the same effect as
2120
- // breaking out of the dispatch switch statement.
2121
- var ContinueSentinel = {};
2122
-
2123
- // Dummy constructor functions that we use as the .constructor and
2124
- // .constructor.prototype properties for functions that return Generator
2125
- // objects. For full spec compliance, you may wish to configure your
2126
- // minifier not to mangle the names of these two functions.
2127
- function Generator() {}
2128
- function GeneratorFunction() {}
2129
- function GeneratorFunctionPrototype() {}
2130
-
2131
- // This is a polyfill for %IteratorPrototype% for environments that
2132
- // don't natively support it.
2133
- var IteratorPrototype = {};
2134
- define(IteratorPrototype, iteratorSymbol, function () {
2135
- return this;
2136
- });
2137
-
2138
- var getProto = Object.getPrototypeOf;
2139
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
2140
- if (NativeIteratorPrototype &&
2141
- NativeIteratorPrototype !== Op &&
2142
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
2143
- // This environment has a native %IteratorPrototype%; use it instead
2144
- // of the polyfill.
2145
- IteratorPrototype = NativeIteratorPrototype;
2146
- }
2147
-
2148
- var Gp = GeneratorFunctionPrototype.prototype =
2149
- Generator.prototype = Object.create(IteratorPrototype);
2150
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
2151
- define(Gp, "constructor", GeneratorFunctionPrototype);
2152
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
2153
- GeneratorFunction.displayName = define(
2154
- GeneratorFunctionPrototype,
2155
- toStringTagSymbol,
2156
- "GeneratorFunction"
2157
- );
2158
-
2159
- // Helper for defining the .next, .throw, and .return methods of the
2160
- // Iterator interface in terms of a single ._invoke method.
2161
- function defineIteratorMethods(prototype) {
2162
- ["next", "throw", "return"].forEach(function(method) {
2163
- define(prototype, method, function(arg) {
2164
- return this._invoke(method, arg);
2165
- });
2166
- });
2167
- }
2168
-
2169
- exports.isGeneratorFunction = function(genFun) {
2170
- var ctor = typeof genFun === "function" && genFun.constructor;
2171
- return ctor
2172
- ? ctor === GeneratorFunction ||
2173
- // For the native GeneratorFunction constructor, the best we can
2174
- // do is to check its .name property.
2175
- (ctor.displayName || ctor.name) === "GeneratorFunction"
2176
- : false;
2177
- };
2178
-
2179
- exports.mark = function(genFun) {
2180
- if (Object.setPrototypeOf) {
2181
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
2182
- } else {
2183
- genFun.__proto__ = GeneratorFunctionPrototype;
2184
- define(genFun, toStringTagSymbol, "GeneratorFunction");
2185
- }
2186
- genFun.prototype = Object.create(Gp);
2187
- return genFun;
2188
- };
2189
-
2190
- // Within the body of any async function, `await x` is transformed to
2191
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
2192
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
2193
- // meant to be awaited.
2194
- exports.awrap = function(arg) {
2195
- return { __await: arg };
2196
- };
2197
-
2198
- function AsyncIterator(generator, PromiseImpl) {
2199
- function invoke(method, arg, resolve, reject) {
2200
- var record = tryCatch(generator[method], generator, arg);
2201
- if (record.type === "throw") {
2202
- reject(record.arg);
2203
- } else {
2204
- var result = record.arg;
2205
- var value = result.value;
2206
- if (value &&
2207
- typeof value === "object" &&
2208
- hasOwn.call(value, "__await")) {
2209
- return PromiseImpl.resolve(value.__await).then(function(value) {
2210
- invoke("next", value, resolve, reject);
2211
- }, function(err) {
2212
- invoke("throw", err, resolve, reject);
2213
- });
2214
- }
2215
-
2216
- return PromiseImpl.resolve(value).then(function(unwrapped) {
2217
- // When a yielded Promise is resolved, its final value becomes
2218
- // the .value of the Promise<{value,done}> result for the
2219
- // current iteration.
2220
- result.value = unwrapped;
2221
- resolve(result);
2222
- }, function(error) {
2223
- // If a rejected Promise was yielded, throw the rejection back
2224
- // into the async generator function so it can be handled there.
2225
- return invoke("throw", error, resolve, reject);
2226
- });
2227
- }
2228
- }
2229
-
2230
- var previousPromise;
2231
-
2232
- function enqueue(method, arg) {
2233
- function callInvokeWithMethodAndArg() {
2234
- return new PromiseImpl(function(resolve, reject) {
2235
- invoke(method, arg, resolve, reject);
2236
- });
2237
- }
2238
-
2239
- return previousPromise =
2240
- // If enqueue has been called before, then we want to wait until
2241
- // all previous Promises have been resolved before calling invoke,
2242
- // so that results are always delivered in the correct order. If
2243
- // enqueue has not been called before, then it is important to
2244
- // call invoke immediately, without waiting on a callback to fire,
2245
- // so that the async generator function has the opportunity to do
2246
- // any necessary setup in a predictable way. This predictability
2247
- // is why the Promise constructor synchronously invokes its
2248
- // executor callback, and why async functions synchronously
2249
- // execute code before the first await. Since we implement simple
2250
- // async functions in terms of async generators, it is especially
2251
- // important to get this right, even though it requires care.
2252
- previousPromise ? previousPromise.then(
2253
- callInvokeWithMethodAndArg,
2254
- // Avoid propagating failures to Promises returned by later
2255
- // invocations of the iterator.
2256
- callInvokeWithMethodAndArg
2257
- ) : callInvokeWithMethodAndArg();
2258
- }
2259
-
2260
- // Define the unified helper method that is used to implement .next,
2261
- // .throw, and .return (see defineIteratorMethods).
2262
- this._invoke = enqueue;
2263
- }
2264
-
2265
- defineIteratorMethods(AsyncIterator.prototype);
2266
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
2267
- return this;
2268
- });
2269
- exports.AsyncIterator = AsyncIterator;
2270
-
2271
- // Note that simple async functions are implemented on top of
2272
- // AsyncIterator objects; they just return a Promise for the value of
2273
- // the final result produced by the iterator.
2274
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
2275
- if (PromiseImpl === void 0) PromiseImpl = Promise;
2276
-
2277
- var iter = new AsyncIterator(
2278
- wrap(innerFn, outerFn, self, tryLocsList),
2279
- PromiseImpl
2280
- );
2281
-
2282
- return exports.isGeneratorFunction(outerFn)
2283
- ? iter // If outerFn is a generator, return the full iterator.
2284
- : iter.next().then(function(result) {
2285
- return result.done ? result.value : iter.next();
2286
- });
2287
- };
2288
-
2289
- function makeInvokeMethod(innerFn, self, context) {
2290
- var state = GenStateSuspendedStart;
2291
-
2292
- return function invoke(method, arg) {
2293
- if (state === GenStateExecuting) {
2294
- throw new Error("Generator is already running");
2295
- }
2296
-
2297
- if (state === GenStateCompleted) {
2298
- if (method === "throw") {
2299
- throw arg;
2300
- }
2301
-
2302
- // Be forgiving, per 25.3.3.3.3 of the spec:
2303
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
2304
- return doneResult();
2305
- }
2306
-
2307
- context.method = method;
2308
- context.arg = arg;
2309
-
2310
- while (true) {
2311
- var delegate = context.delegate;
2312
- if (delegate) {
2313
- var delegateResult = maybeInvokeDelegate(delegate, context);
2314
- if (delegateResult) {
2315
- if (delegateResult === ContinueSentinel) continue;
2316
- return delegateResult;
2317
- }
2318
- }
2319
-
2320
- if (context.method === "next") {
2321
- // Setting context._sent for legacy support of Babel's
2322
- // function.sent implementation.
2323
- context.sent = context._sent = context.arg;
2324
-
2325
- } else if (context.method === "throw") {
2326
- if (state === GenStateSuspendedStart) {
2327
- state = GenStateCompleted;
2328
- throw context.arg;
2329
- }
2330
-
2331
- context.dispatchException(context.arg);
2332
-
2333
- } else if (context.method === "return") {
2334
- context.abrupt("return", context.arg);
2335
- }
2336
-
2337
- state = GenStateExecuting;
2338
-
2339
- var record = tryCatch(innerFn, self, context);
2340
- if (record.type === "normal") {
2341
- // If an exception is thrown from innerFn, we leave state ===
2342
- // GenStateExecuting and loop back for another invocation.
2343
- state = context.done
2344
- ? GenStateCompleted
2345
- : GenStateSuspendedYield;
2346
-
2347
- if (record.arg === ContinueSentinel) {
2348
- continue;
2349
- }
2350
-
2351
- return {
2352
- value: record.arg,
2353
- done: context.done
2354
- };
2355
-
2356
- } else if (record.type === "throw") {
2357
- state = GenStateCompleted;
2358
- // Dispatch the exception by looping back around to the
2359
- // context.dispatchException(context.arg) call above.
2360
- context.method = "throw";
2361
- context.arg = record.arg;
2362
- }
2363
- }
2364
- };
2365
- }
2366
-
2367
- // Call delegate.iterator[context.method](context.arg) and handle the
2368
- // result, either by returning a { value, done } result from the
2369
- // delegate iterator, or by modifying context.method and context.arg,
2370
- // setting context.delegate to null, and returning the ContinueSentinel.
2371
- function maybeInvokeDelegate(delegate, context) {
2372
- var method = delegate.iterator[context.method];
2373
- if (method === undefined) {
2374
- // A .throw or .return when the delegate iterator has no .throw
2375
- // method always terminates the yield* loop.
2376
- context.delegate = null;
2377
-
2378
- if (context.method === "throw") {
2379
- // Note: ["return"] must be used for ES3 parsing compatibility.
2380
- if (delegate.iterator["return"]) {
2381
- // If the delegate iterator has a return method, give it a
2382
- // chance to clean up.
2383
- context.method = "return";
2384
- context.arg = undefined;
2385
- maybeInvokeDelegate(delegate, context);
2386
-
2387
- if (context.method === "throw") {
2388
- // If maybeInvokeDelegate(context) changed context.method from
2389
- // "return" to "throw", let that override the TypeError below.
2390
- return ContinueSentinel;
2391
- }
2392
- }
2393
-
2394
- context.method = "throw";
2395
- context.arg = new TypeError(
2396
- "The iterator does not provide a 'throw' method");
2397
- }
2398
-
2399
- return ContinueSentinel;
2400
- }
2401
-
2402
- var record = tryCatch(method, delegate.iterator, context.arg);
2403
-
2404
- if (record.type === "throw") {
2405
- context.method = "throw";
2406
- context.arg = record.arg;
2407
- context.delegate = null;
2408
- return ContinueSentinel;
2409
- }
2410
-
2411
- var info = record.arg;
2412
-
2413
- if (! info) {
2414
- context.method = "throw";
2415
- context.arg = new TypeError("iterator result is not an object");
2416
- context.delegate = null;
2417
- return ContinueSentinel;
2418
- }
2419
-
2420
- if (info.done) {
2421
- // Assign the result of the finished delegate to the temporary
2422
- // variable specified by delegate.resultName (see delegateYield).
2423
- context[delegate.resultName] = info.value;
2424
-
2425
- // Resume execution at the desired location (see delegateYield).
2426
- context.next = delegate.nextLoc;
2427
-
2428
- // If context.method was "throw" but the delegate handled the
2429
- // exception, let the outer generator proceed normally. If
2430
- // context.method was "next", forget context.arg since it has been
2431
- // "consumed" by the delegate iterator. If context.method was
2432
- // "return", allow the original .return call to continue in the
2433
- // outer generator.
2434
- if (context.method !== "return") {
2435
- context.method = "next";
2436
- context.arg = undefined;
2437
- }
2438
-
2439
- } else {
2440
- // Re-yield the result returned by the delegate method.
2441
- return info;
2442
- }
2443
-
2444
- // The delegate iterator is finished, so forget it and continue with
2445
- // the outer generator.
2446
- context.delegate = null;
2447
- return ContinueSentinel;
2448
- }
2449
-
2450
- // Define Generator.prototype.{next,throw,return} in terms of the
2451
- // unified ._invoke helper method.
2452
- defineIteratorMethods(Gp);
2453
-
2454
- define(Gp, toStringTagSymbol, "Generator");
2455
-
2456
- // A Generator should always return itself as the iterator object when the
2457
- // @@iterator function is called on it. Some browsers' implementations of the
2458
- // iterator prototype chain incorrectly implement this, causing the Generator
2459
- // object to not be returned from this call. This ensures that doesn't happen.
2460
- // See https://github.com/facebook/regenerator/issues/274 for more details.
2461
- define(Gp, iteratorSymbol, function() {
2462
- return this;
2463
- });
2464
-
2465
- define(Gp, "toString", function() {
2466
- return "[object Generator]";
2467
- });
2468
-
2469
- function pushTryEntry(locs) {
2470
- var entry = { tryLoc: locs[0] };
2471
-
2472
- if (1 in locs) {
2473
- entry.catchLoc = locs[1];
2474
- }
2475
-
2476
- if (2 in locs) {
2477
- entry.finallyLoc = locs[2];
2478
- entry.afterLoc = locs[3];
2479
- }
2480
-
2481
- this.tryEntries.push(entry);
2482
- }
2483
-
2484
- function resetTryEntry(entry) {
2485
- var record = entry.completion || {};
2486
- record.type = "normal";
2487
- delete record.arg;
2488
- entry.completion = record;
2489
- }
2490
-
2491
- function Context(tryLocsList) {
2492
- // The root entry object (effectively a try statement without a catch
2493
- // or a finally block) gives us a place to store values thrown from
2494
- // locations where there is no enclosing try statement.
2495
- this.tryEntries = [{ tryLoc: "root" }];
2496
- tryLocsList.forEach(pushTryEntry, this);
2497
- this.reset(true);
2498
- }
2499
-
2500
- exports.keys = function(object) {
2501
- var keys = [];
2502
- for (var key in object) {
2503
- keys.push(key);
2504
- }
2505
- keys.reverse();
2506
-
2507
- // Rather than returning an object with a next method, we keep
2508
- // things simple and return the next function itself.
2509
- return function next() {
2510
- while (keys.length) {
2511
- var key = keys.pop();
2512
- if (key in object) {
2513
- next.value = key;
2514
- next.done = false;
2515
- return next;
2516
- }
2517
- }
2518
-
2519
- // To avoid creating an additional object, we just hang the .value
2520
- // and .done properties off the next function object itself. This
2521
- // also ensures that the minifier will not anonymize the function.
2522
- next.done = true;
2523
- return next;
2524
- };
2525
- };
2526
-
2527
- function values(iterable) {
2528
- if (iterable) {
2529
- var iteratorMethod = iterable[iteratorSymbol];
2530
- if (iteratorMethod) {
2531
- return iteratorMethod.call(iterable);
2532
- }
2533
-
2534
- if (typeof iterable.next === "function") {
2535
- return iterable;
2536
- }
2537
-
2538
- if (!isNaN(iterable.length)) {
2539
- var i = -1, next = function next() {
2540
- while (++i < iterable.length) {
2541
- if (hasOwn.call(iterable, i)) {
2542
- next.value = iterable[i];
2543
- next.done = false;
2544
- return next;
2545
- }
2546
- }
2547
-
2548
- next.value = undefined;
2549
- next.done = true;
2550
-
2551
- return next;
2552
- };
2553
-
2554
- return next.next = next;
2555
- }
2556
- }
2557
-
2558
- // Return an iterator with no values.
2559
- return { next: doneResult };
2560
- }
2561
- exports.values = values;
2562
-
2563
- function doneResult() {
2564
- return { value: undefined, done: true };
2565
- }
2566
-
2567
- Context.prototype = {
2568
- constructor: Context,
2569
-
2570
- reset: function(skipTempReset) {
2571
- this.prev = 0;
2572
- this.next = 0;
2573
- // Resetting context._sent for legacy support of Babel's
2574
- // function.sent implementation.
2575
- this.sent = this._sent = undefined;
2576
- this.done = false;
2577
- this.delegate = null;
2578
-
2579
- this.method = "next";
2580
- this.arg = undefined;
2581
-
2582
- this.tryEntries.forEach(resetTryEntry);
2583
-
2584
- if (!skipTempReset) {
2585
- for (var name in this) {
2586
- // Not sure about the optimal order of these conditions:
2587
- if (name.charAt(0) === "t" &&
2588
- hasOwn.call(this, name) &&
2589
- !isNaN(+name.slice(1))) {
2590
- this[name] = undefined;
2591
- }
2592
- }
2593
- }
2594
- },
2595
-
2596
- stop: function() {
2597
- this.done = true;
2598
-
2599
- var rootEntry = this.tryEntries[0];
2600
- var rootRecord = rootEntry.completion;
2601
- if (rootRecord.type === "throw") {
2602
- throw rootRecord.arg;
2603
- }
2604
-
2605
- return this.rval;
2606
- },
2607
-
2608
- dispatchException: function(exception) {
2609
- if (this.done) {
2610
- throw exception;
2611
- }
2612
-
2613
- var context = this;
2614
- function handle(loc, caught) {
2615
- record.type = "throw";
2616
- record.arg = exception;
2617
- context.next = loc;
2618
-
2619
- if (caught) {
2620
- // If the dispatched exception was caught by a catch block,
2621
- // then let that catch block handle the exception normally.
2622
- context.method = "next";
2623
- context.arg = undefined;
2624
- }
2625
-
2626
- return !! caught;
2627
- }
2628
-
2629
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2630
- var entry = this.tryEntries[i];
2631
- var record = entry.completion;
2632
-
2633
- if (entry.tryLoc === "root") {
2634
- // Exception thrown outside of any try block that could handle
2635
- // it, so set the completion value of the entire function to
2636
- // throw the exception.
2637
- return handle("end");
2638
- }
2639
-
2640
- if (entry.tryLoc <= this.prev) {
2641
- var hasCatch = hasOwn.call(entry, "catchLoc");
2642
- var hasFinally = hasOwn.call(entry, "finallyLoc");
2643
-
2644
- if (hasCatch && hasFinally) {
2645
- if (this.prev < entry.catchLoc) {
2646
- return handle(entry.catchLoc, true);
2647
- } else if (this.prev < entry.finallyLoc) {
2648
- return handle(entry.finallyLoc);
2649
- }
2650
-
2651
- } else if (hasCatch) {
2652
- if (this.prev < entry.catchLoc) {
2653
- return handle(entry.catchLoc, true);
2654
- }
2655
-
2656
- } else if (hasFinally) {
2657
- if (this.prev < entry.finallyLoc) {
2658
- return handle(entry.finallyLoc);
2659
- }
2660
-
2661
- } else {
2662
- throw new Error("try statement without catch or finally");
2663
- }
2664
- }
2665
- }
2666
- },
2667
-
2668
- abrupt: function(type, arg) {
2669
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2670
- var entry = this.tryEntries[i];
2671
- if (entry.tryLoc <= this.prev &&
2672
- hasOwn.call(entry, "finallyLoc") &&
2673
- this.prev < entry.finallyLoc) {
2674
- var finallyEntry = entry;
2675
- break;
2676
- }
2677
- }
2678
-
2679
- if (finallyEntry &&
2680
- (type === "break" ||
2681
- type === "continue") &&
2682
- finallyEntry.tryLoc <= arg &&
2683
- arg <= finallyEntry.finallyLoc) {
2684
- // Ignore the finally entry if control is not jumping to a
2685
- // location outside the try/catch block.
2686
- finallyEntry = null;
2687
- }
2688
-
2689
- var record = finallyEntry ? finallyEntry.completion : {};
2690
- record.type = type;
2691
- record.arg = arg;
2692
-
2693
- if (finallyEntry) {
2694
- this.method = "next";
2695
- this.next = finallyEntry.finallyLoc;
2696
- return ContinueSentinel;
2697
- }
2698
-
2699
- return this.complete(record);
2700
- },
2701
-
2702
- complete: function(record, afterLoc) {
2703
- if (record.type === "throw") {
2704
- throw record.arg;
2705
- }
2706
-
2707
- if (record.type === "break" ||
2708
- record.type === "continue") {
2709
- this.next = record.arg;
2710
- } else if (record.type === "return") {
2711
- this.rval = this.arg = record.arg;
2712
- this.method = "return";
2713
- this.next = "end";
2714
- } else if (record.type === "normal" && afterLoc) {
2715
- this.next = afterLoc;
2716
- }
2717
-
2718
- return ContinueSentinel;
2719
- },
2720
-
2721
- finish: function(finallyLoc) {
2722
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2723
- var entry = this.tryEntries[i];
2724
- if (entry.finallyLoc === finallyLoc) {
2725
- this.complete(entry.completion, entry.afterLoc);
2726
- resetTryEntry(entry);
2727
- return ContinueSentinel;
2728
- }
2729
- }
2730
- },
2731
-
2732
- "catch": function(tryLoc) {
2733
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2734
- var entry = this.tryEntries[i];
2735
- if (entry.tryLoc === tryLoc) {
2736
- var record = entry.completion;
2737
- if (record.type === "throw") {
2738
- var thrown = record.arg;
2739
- resetTryEntry(entry);
2740
- }
2741
- return thrown;
2742
- }
2743
- }
2744
-
2745
- // The context.catch method must only be called with a location
2746
- // argument that corresponds to a known catch block.
2747
- throw new Error("illegal catch attempt");
2748
- },
2749
-
2750
- delegateYield: function(iterable, resultName, nextLoc) {
2751
- this.delegate = {
2752
- iterator: values(iterable),
2753
- resultName: resultName,
2754
- nextLoc: nextLoc
2755
- };
2756
-
2757
- if (this.method === "next") {
2758
- // Deliberately forget the last sent value so that we don't
2759
- // accidentally pass it on to the delegate.
2760
- this.arg = undefined;
2761
- }
2762
-
2763
- return ContinueSentinel;
2764
- }
2765
- };
2766
-
2767
- // Regardless of whether this script is executing as a CommonJS module
2768
- // or not, return the runtime object so that we can declare the variable
2769
- // regeneratorRuntime in the outer scope, which allows this module to be
2770
- // injected easily by `bin/regenerator --include-runtime script.js`.
2771
- return exports;
2772
-
2773
- }(
2774
- // If this script is executing as a CommonJS module, use module.exports
2775
- // as the regeneratorRuntime namespace. Otherwise create a new empty
2776
- // object. Either way, the resulting object will be used to initialize
2777
- // the regeneratorRuntime variable at the top of this file.
2778
- true ? module.exports : 0
2779
- ));
2780
-
2781
- try {
2782
- regeneratorRuntime = runtime;
2783
- } catch (accidentalStrictMode) {
2784
- // This module should not be running in strict mode, so the above
2785
- // assignment should always work unless something is misconfigured. Just
2786
- // in case runtime.js accidentally runs in strict mode, in modern engines
2787
- // we can explicitly access globalThis. In older engines we can escape
2788
- // strict mode using a global Function call. This could conceivably fail
2789
- // if a Content Security Policy forbids using Function, but in that case
2790
- // the proper solution is to fix the accidental strict mode problem. If
2791
- // you've misconfigured your bundler to force strict mode and applied a
2792
- // CSP to forbid Function, and you're not willing to fix either of those
2793
- // problems, please detail your unique predicament in a GitHub issue.
2794
- if (typeof globalThis === "object") {
2795
- globalThis.regeneratorRuntime = runtime;
2796
- } else {
2797
- Function("r", "regeneratorRuntime = r")(runtime);
2798
- }
2799
- }
2800
-
2801
-
2802
- /***/ }),
2803
-
2804
- /***/ "../../../node_modules/@cornerstonejs/codec-charls/dist/charlswasm_decode.wasm":
2805
- /*!*************************************************************************************!*\
2806
- !*** ../../../node_modules/@cornerstonejs/codec-charls/dist/charlswasm_decode.wasm ***!
2807
- \*************************************************************************************/
2808
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2809
-
2810
- "use strict";
2811
- module.exports = __webpack_require__.p + "5004fdc02f329ce53b69.wasm";
2812
-
2813
- /***/ }),
2814
-
2815
- /***/ "../../../node_modules/@cornerstonejs/codec-libjpeg-turbo-8bit/dist/libjpegturbowasm_decode.wasm":
2816
- /*!*******************************************************************************************************!*\
2817
- !*** ../../../node_modules/@cornerstonejs/codec-libjpeg-turbo-8bit/dist/libjpegturbowasm_decode.wasm ***!
2818
- \*******************************************************************************************************/
2819
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2820
-
2821
- "use strict";
2822
- module.exports = __webpack_require__.p + "c22b37c3488e1d6c3aa4.wasm";
2823
-
2824
- /***/ }),
2825
-
2826
- /***/ "../../../node_modules/@cornerstonejs/codec-openjpeg/dist/openjpegwasm_decode.wasm":
2827
- /*!*****************************************************************************************!*\
2828
- !*** ../../../node_modules/@cornerstonejs/codec-openjpeg/dist/openjpegwasm_decode.wasm ***!
2829
- \*****************************************************************************************/
2830
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2831
-
2832
- "use strict";
2833
- module.exports = __webpack_require__.p + "65916ef3def695744bda.wasm";
2834
-
2835
- /***/ }),
2836
-
2837
- /***/ "../../../node_modules/@cornerstonejs/codec-openjph/dist/openjphjs.wasm":
2838
- /*!******************************************************************************!*\
2839
- !*** ../../../node_modules/@cornerstonejs/codec-openjph/dist/openjphjs.wasm ***!
2840
- \******************************************************************************/
2841
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2842
-
2843
- "use strict";
2844
- module.exports = __webpack_require__.p + "75788f12450d4c5ed494.wasm";
2845
-
2846
- /***/ }),
2847
-
2848
- /***/ "?a97b":
2849
- /*!********************!*\
2850
- !*** fs (ignored) ***!
2851
- \********************/
2852
- /***/ (() => {
2853
-
2854
- /* (ignored) */
2855
-
2856
- /***/ }),
2857
-
2858
- /***/ "?890c":
2859
- /*!**********************!*\
2860
- !*** path (ignored) ***!
2861
- \**********************/
2862
- /***/ (() => {
2863
-
2864
- /* (ignored) */
2865
-
2866
- /***/ }),
2867
-
2868
- /***/ "?acd3":
2869
- /*!********************!*\
2870
- !*** fs (ignored) ***!
2871
- \********************/
2872
- /***/ (() => {
2873
-
2874
- /* (ignored) */
2875
-
2876
- /***/ }),
2877
-
2878
- /***/ "?6bec":
2879
- /*!**********************!*\
2880
- !*** path (ignored) ***!
2881
- \**********************/
2882
- /***/ (() => {
2883
-
2884
- /* (ignored) */
2885
-
2886
- /***/ }),
2887
-
2888
- /***/ "?4441":
2889
- /*!********************!*\
2890
- !*** fs (ignored) ***!
2891
- \********************/
2892
- /***/ (() => {
2893
-
2894
- /* (ignored) */
2895
-
2896
- /***/ }),
2897
-
2898
- /***/ "?9e30":
2899
- /*!**********************!*\
2900
- !*** path (ignored) ***!
2901
- \**********************/
2902
- /***/ (() => {
2903
-
2904
- /* (ignored) */
2905
-
2906
- /***/ }),
2907
-
2908
- /***/ "?32cd":
2909
- /*!********************!*\
2910
- !*** fs (ignored) ***!
2911
- \********************/
2912
- /***/ (() => {
2913
-
2914
- /* (ignored) */
2915
-
2916
- /***/ }),
2917
-
2918
- /***/ "?6c09":
2919
- /*!**********************!*\
2920
- !*** path (ignored) ***!
2921
- \**********************/
2922
- /***/ (() => {
2923
-
2924
- /* (ignored) */
2925
-
2926
- /***/ }),
2927
-
2928
- /***/ "../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js":
2929
- /*!****************************************************************************!*\
2930
- !*** ../../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js ***!
2931
- \****************************************************************************/
2932
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2933
-
2934
- "use strict";
2935
- __webpack_require__.r(__webpack_exports__);
2936
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2937
- /* harmony export */ "default": () => (/* binding */ _asyncToGenerator)
2938
- /* harmony export */ });
2939
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2940
- try {
2941
- var info = gen[key](arg);
2942
- var value = info.value;
2943
- } catch (error) {
2944
- reject(error);
2945
- return;
2946
- }
2947
-
2948
- if (info.done) {
2949
- resolve(value);
2950
- } else {
2951
- Promise.resolve(value).then(_next, _throw);
2952
- }
2953
- }
2954
-
2955
- function _asyncToGenerator(fn) {
2956
- return function () {
2957
- var self = this,
2958
- args = arguments;
2959
- return new Promise(function (resolve, reject) {
2960
- var gen = fn.apply(self, args);
2961
-
2962
- function _next(value) {
2963
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
2964
- }
2965
-
2966
- function _throw(err) {
2967
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
2968
- }
2969
-
2970
- _next(undefined);
2971
- });
2972
- };
2973
- }
2974
-
2975
- /***/ }),
2976
-
2977
- /***/ "../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js":
2978
- /*!**************************************************************************!*\
2979
- !*** ../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
2980
- \**************************************************************************/
2981
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2982
-
2983
- "use strict";
2984
- __webpack_require__.r(__webpack_exports__);
2985
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
2986
- /* harmony export */ "default": () => (/* binding */ _defineProperty)
2987
- /* harmony export */ });
2988
- function _defineProperty(obj, key, value) {
2989
- if (key in obj) {
2990
- Object.defineProperty(obj, key, {
2991
- value: value,
2992
- enumerable: true,
2993
- configurable: true,
2994
- writable: true
2995
- });
2996
- } else {
2997
- obj[key] = value;
2998
- }
2999
-
3000
- return obj;
3001
- }
3002
-
3003
- /***/ })
3004
-
3005
- /******/ });
3006
- /************************************************************************/
3007
- /******/ // The module cache
3008
- /******/ var __webpack_module_cache__ = {};
3009
- /******/
3010
- /******/ // The require function
3011
- /******/ function __webpack_require__(moduleId) {
3012
- /******/ // Check if module is in cache
3013
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
3014
- /******/ if (cachedModule !== undefined) {
3015
- /******/ return cachedModule.exports;
3016
- /******/ }
3017
- /******/ // Create a new module (and put it into the cache)
3018
- /******/ var module = __webpack_module_cache__[moduleId] = {
3019
- /******/ // no module.id needed
3020
- /******/ // no module.loaded needed
3021
- /******/ exports: {}
3022
- /******/ };
3023
- /******/
3024
- /******/ // Execute the module function
3025
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
3026
- /******/
3027
- /******/ // Return the exports of the module
3028
- /******/ return module.exports;
3029
- /******/ }
3030
- /******/
3031
- /******/ // expose the modules object (__webpack_modules__)
3032
- /******/ __webpack_require__.m = __webpack_modules__;
3033
- /******/
3034
- /************************************************************************/
3035
- /******/ /* webpack/runtime/compat get default export */
3036
- /******/ (() => {
3037
- /******/ // getDefaultExport function for compatibility with non-harmony modules
3038
- /******/ __webpack_require__.n = (module) => {
3039
- /******/ var getter = module && module.__esModule ?
3040
- /******/ () => (module['default']) :
3041
- /******/ () => (module);
3042
- /******/ __webpack_require__.d(getter, { a: getter });
3043
- /******/ return getter;
3044
- /******/ };
3045
- /******/ })();
3046
- /******/
3047
- /******/ /* webpack/runtime/create fake namespace object */
3048
- /******/ (() => {
3049
- /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
3050
- /******/ var leafPrototypes;
3051
- /******/ // create a fake namespace object
3052
- /******/ // mode & 1: value is a module id, require it
3053
- /******/ // mode & 2: merge all properties of value into the ns
3054
- /******/ // mode & 4: return value when already ns object
3055
- /******/ // mode & 16: return value when it's Promise-like
3056
- /******/ // mode & 8|1: behave like require
3057
- /******/ __webpack_require__.t = function(value, mode) {
3058
- /******/ if(mode & 1) value = this(value);
3059
- /******/ if(mode & 8) return value;
3060
- /******/ if(typeof value === 'object' && value) {
3061
- /******/ if((mode & 4) && value.__esModule) return value;
3062
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
3063
- /******/ }
3064
- /******/ var ns = Object.create(null);
3065
- /******/ __webpack_require__.r(ns);
3066
- /******/ var def = {};
3067
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
3068
- /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
3069
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
3070
- /******/ }
3071
- /******/ def['default'] = () => (value);
3072
- /******/ __webpack_require__.d(ns, def);
3073
- /******/ return ns;
3074
- /******/ };
3075
- /******/ })();
3076
- /******/
3077
- /******/ /* webpack/runtime/define property getters */
3078
- /******/ (() => {
3079
- /******/ // define getter functions for harmony exports
3080
- /******/ __webpack_require__.d = (exports, definition) => {
3081
- /******/ for(var key in definition) {
3082
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
3083
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
3084
- /******/ }
3085
- /******/ }
3086
- /******/ };
3087
- /******/ })();
3088
- /******/
3089
- /******/ /* webpack/runtime/ensure chunk */
3090
- /******/ (() => {
3091
- /******/ __webpack_require__.f = {};
3092
- /******/ // This file contains only the entry chunk.
3093
- /******/ // The chunk loading function for additional chunks
3094
- /******/ __webpack_require__.e = (chunkId) => {
3095
- /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
3096
- /******/ __webpack_require__.f[key](chunkId, promises);
3097
- /******/ return promises;
3098
- /******/ }, []));
3099
- /******/ };
3100
- /******/ })();
3101
- /******/
3102
- /******/ /* webpack/runtime/get javascript chunk filename */
3103
- /******/ (() => {
3104
- /******/ // This function allow to reference async chunks
3105
- /******/ __webpack_require__.u = (chunkId) => {
3106
- /******/ // return url for filenames based on template
3107
- /******/ return "" + chunkId + ".min.worker.js";
3108
- /******/ };
3109
- /******/ })();
3110
- /******/
3111
- /******/ /* webpack/runtime/global */
3112
- /******/ (() => {
3113
- /******/ __webpack_require__.g = (function() {
3114
- /******/ if (typeof globalThis === 'object') return globalThis;
3115
- /******/ try {
3116
- /******/ return this || new Function('return this')();
3117
- /******/ } catch (e) {
3118
- /******/ if (typeof window === 'object') return window;
3119
- /******/ }
3120
- /******/ })();
3121
- /******/ })();
3122
- /******/
3123
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
3124
- /******/ (() => {
3125
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
3126
- /******/ })();
3127
- /******/
3128
- /******/ /* webpack/runtime/make namespace object */
3129
- /******/ (() => {
3130
- /******/ // define __esModule on exports
3131
- /******/ __webpack_require__.r = (exports) => {
3132
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
3133
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3134
- /******/ }
3135
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
3136
- /******/ };
3137
- /******/ })();
3138
- /******/
3139
- /******/ /* webpack/runtime/publicPath */
3140
- /******/ (() => {
3141
- /******/ var scriptUrl;
3142
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
3143
- /******/ var document = __webpack_require__.g.document;
3144
- /******/ if (!scriptUrl && document) {
3145
- /******/ if (document.currentScript)
3146
- /******/ scriptUrl = document.currentScript.src
3147
- /******/ if (!scriptUrl) {
3148
- /******/ var scripts = document.getElementsByTagName("script");
3149
- /******/ if(scripts.length) scriptUrl = scripts[scripts.length - 1].src
3150
- /******/ }
3151
- /******/ }
3152
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
3153
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
3154
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
3155
- /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
3156
- /******/ __webpack_require__.p = scriptUrl;
3157
- /******/ })();
3158
- /******/
3159
- /******/ /* webpack/runtime/importScripts chunk loading */
3160
- /******/ (() => {
3161
- /******/ // no baseURI
3162
- /******/
3163
- /******/ // object to store loaded chunks
3164
- /******/ // "1" means "already loaded"
3165
- /******/ var installedChunks = {
3166
- /******/ "index.worker": 1
3167
- /******/ };
3168
- /******/
3169
- /******/ // importScripts chunk loading
3170
- /******/ var installChunk = (data) => {
3171
- /******/ var [chunkIds, moreModules, runtime] = data;
3172
- /******/ for(var moduleId in moreModules) {
3173
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
3174
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
3175
- /******/ }
3176
- /******/ }
3177
- /******/ if(runtime) runtime(__webpack_require__);
3178
- /******/ while(chunkIds.length)
3179
- /******/ installedChunks[chunkIds.pop()] = 1;
3180
- /******/ parentChunkLoadingFunction(data);
3181
- /******/ };
3182
- /******/ __webpack_require__.f.i = (chunkId, promises) => {
3183
- /******/ // "1" is the signal for "already loaded"
3184
- /******/ if(!installedChunks[chunkId]) {
3185
- /******/ if(true) { // all chunks have JS
3186
- /******/ importScripts(__webpack_require__.p + __webpack_require__.u(chunkId));
3187
- /******/ }
3188
- /******/ }
3189
- /******/ };
3190
- /******/
3191
- /******/ var chunkLoadingGlobal = self["webpackChunk_name_"] = self["webpackChunk_name_"] || [];
3192
- /******/ var parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);
3193
- /******/ chunkLoadingGlobal.push = installChunk;
3194
- /******/
3195
- /******/ // no HMR
3196
- /******/
3197
- /******/ // no HMR manifest
3198
- /******/ })();
3199
- /******/
3200
- /************************************************************************/
3201
- var __webpack_exports__ = {};
3202
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
3203
- (() => {
3204
- "use strict";
3205
- /*!***********************************************************************************!*\
3206
- !*** ../../../node_modules/babel-loader/lib/index.js!./webWorker/index.worker.ts ***!
3207
- \***********************************************************************************/
3208
- __webpack_require__.r(__webpack_exports__);
3209
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3210
- /* harmony export */ "registerTaskHandler": () => (/* reexport safe */ _webWorker__WEBPACK_IMPORTED_MODULE_0__.registerTaskHandler),
3211
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
3212
- /* harmony export */ });
3213
- /* harmony import */ var _webWorker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./webWorker */ "./webWorker/webWorker.ts");
3214
- /* harmony import */ var _decodeTask__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./decodeTask */ "./webWorker/decodeTask.ts");
3215
-
3216
- // register our task
3217
- // @ts-ignore
3218
-
3219
- (0,_webWorker__WEBPACK_IMPORTED_MODULE_0__.registerTaskHandler)(_decodeTask__WEBPACK_IMPORTED_MODULE_1__["default"]);
3220
- var cornerstoneDICOMImageLoaderWebWorker = {
3221
- registerTaskHandler: _webWorker__WEBPACK_IMPORTED_MODULE_0__.registerTaskHandler
3222
- };
3223
-
3224
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cornerstoneDICOMImageLoaderWebWorker);
3225
- })();
3226
-
3227
- /******/ })()
3228
- ;
1
+ (()=>{var t,e,r={945:(t,e,r)=>{t.exports=r(602)},37:(t,e,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,o,i=void 0!==(t=t||{})?t:{};i.ready=new Promise((function(t,r){e=t,o=r}));var a,s,u,c=Object.assign({},i),f=[],l="object"==typeof window,p="function"==typeof importScripts,h="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,d="";if(h){var v=r(716),y=r(401);d=p?y.dirname(d)+"/":"//",a=(t,e)=>(t=N(t)?new URL(t):y.normalize(t),v.readFileSync(t,e?void 0:"utf8")),u=t=>{var e=a(t,!0);return e.buffer||(e=new Uint8Array(e)),e},s=(t,e,r)=>{t=N(t)?new URL(t):y.normalize(t),v.readFile(t,(function(t,n){t?r(t):e(n.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),f=process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof q))throw t})),process.on("unhandledRejection",(function(t){throw t})),i.inspect=function(){return"[Emscripten Module object]"}}else(l||p)&&(p?d=self.location.href:"undefined"!=typeof document&&document.currentScript&&(d=document.currentScript.src),n&&(d=n),d=0!==d.indexOf("blob:")?d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},p&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)});i.print||console.log.bind(console);var g,m=i.printErr||console.warn.bind(console);Object.assign(i,c),c=null,i.arguments&&(f=i.arguments),i.thisProgram&&i.thisProgram,i.quit&&i.quit,i.wasmBinary&&(g=i.wasmBinary);var w;i.noExitRuntime;"object"!=typeof WebAssembly&&V("no native wasm support detected");var b,P,T,C,$,_,A,k,x,O=!1,j="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function S(t,e){return t?function(t,e,r){for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&j)return j.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var u=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&t[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}(T,t,e):""}function E(t,e,r){return function(t,e,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-o}(t,T,e,r)}function D(t){b=t,i.HEAP8=P=new Int8Array(t),i.HEAP16=C=new Int16Array(t),i.HEAP32=_=new Int32Array(t),i.HEAPU8=T=new Uint8Array(t),i.HEAPU16=$=new Uint16Array(t),i.HEAPU32=A=new Uint32Array(t),i.HEAPF32=k=new Float32Array(t),i.HEAPF64=x=new Float64Array(t)}i.INITIAL_MEMORY;var R,F,W,I=[],U=[],L=[],H=0,M=null,B=null;function V(t){i.onAbort&&i.onAbort(t),m(t="Aborted("+t+")"),O=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw o(e),e}function z(t){return t.startsWith("data:application/octet-stream;base64,")}function N(t){return t.startsWith("file://")}function G(t){try{if(t==F&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function q(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function J(t){for(;t.length>0;)t.shift()(i)}function X(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){A[this.ptr+4>>2]=t},this.get_type=function(){return A[this.ptr+4>>2]},this.set_destructor=function(t){A[this.ptr+8>>2]=t},this.get_destructor=function(){return A[this.ptr+8>>2]},this.set_refcount=function(t){_[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,P[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=P[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,P[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=P[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=_[this.ptr>>2];_[this.ptr>>2]=t+1},this.release_ref=function(){var t=_[this.ptr>>2];return _[this.ptr>>2]=t-1,1===t},this.set_adjusted_ptr=function(t){A[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return A[this.ptr+16>>2]},this.get_exception_ptr=function(){if(De(this.get_type()))return A[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}z(F="charlswasm_decode.wasm")||(W=F,F=i.locateFile?i.locateFile(W,d):d+W);var Y={};function K(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function Z(t){return this.fromWireType(_[t>>2])}var Q={},tt={},et={};function rt(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=48&&e<=57?"_"+t:t}function nt(t,e){return t=rt(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function ot(t,e){var r=nt(e,(function(t){this.name=e,this.message=t;var r=new Error(t).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(t.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 at(t){throw new it(t)}function st(t,e,r){function n(e){var n=r(e);n.length!==t.length&&at("Mismatched type converter count");for(var o=0;o<t.length;++o)ht(t[o],n[o])}t.forEach((function(t){et[t]=e}));var o=new Array(e.length),i=[],a=0;e.forEach(((t,e)=>{tt.hasOwnProperty(t)?o[e]=tt[t]:(i.push(t),Q.hasOwnProperty(t)||(Q[t]=[]),Q[t].push((()=>{o[e]=tt[t],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function ut(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var ct=void 0;function ft(t){for(var e="",r=t;T[r];)e+=ct[T[r++]];return e}var lt=void 0;function pt(t){throw new lt(t)}function ht(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=e.name;if(t||pt('type "'+n+'" must have a positive integer typeid pointer'),tt.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;pt("Cannot register type '"+n+"' twice")}if(tt[t]=e,delete et[t],Q.hasOwnProperty(t)){var o=Q[t];delete Q[t],o.forEach((t=>t()))}}function dt(t){if(!(this instanceof Wt))return!1;if(!(t instanceof Wt))return!1;for(var e=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=t.$$.ptrType.registeredClass,o=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return e===n&&r===o}function vt(t){pt(t.$$.ptrType.registeredClass.name+" instance already deleted")}var yt=!1;function gt(t){}function mt(t){t.count.value-=1,0===t.count.value&&function(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}(t)}function wt(t,e,r){if(e===r)return t;if(void 0===r.baseClass)return null;var n=wt(t,e,r.baseClass);return null===n?null:r.downcast(n)}var bt={};function Pt(){return Object.keys(kt).length}function Tt(){var t=[];for(var e in kt)kt.hasOwnProperty(e)&&t.push(kt[e]);return t}var Ct=[];function $t(){for(;Ct.length;){var t=Ct.pop();t.$$.deleteScheduled=!1,t.delete()}}var _t=void 0;function At(t){_t=t,Ct.length&&_t&&_t($t)}var kt={};function xt(t,e){return e=function(t,e){for(void 0===e&&pt("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}(t,e),kt[e]}function Ot(t,e){return e.ptrType&&e.ptr||at("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&&at("Both smartPtrType and smartPtr must be specified"),e.count={value:1},St(Object.create(t,{$$:{value:e}}))}function jt(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=xt(this.registeredClass,e);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function o(){return this.isSmartPointer?Ot(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Ot(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i,a=this.registeredClass.getActualType(e),s=bt[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=wt(e,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?Ot(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:t}):Ot(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}function St(t){return"undefined"==typeof FinalizationRegistry?(St=t=>t,t):(yt=new FinalizationRegistry((t=>{mt(t.$$)})),St=t=>{var e=t.$$;if(e.smartPtr){var r={$$:e};yt.register(t,r,t)}return t},gt=t=>yt.unregister(t),St(t))}function Et(){if(this.$$.ptr||vt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t,e=St(Object.create(Object.getPrototypeOf(this),{$$:{value:(t=this.$$,{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType})}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function Dt(){this.$$.ptr||vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&pt("Object already scheduled for deletion"),gt(this),mt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Rt(){return!this.$$.ptr}function Ft(){return this.$$.ptr||vt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&pt("Object already scheduled for deletion"),Ct.push(this),1===Ct.length&&_t&&_t($t),this.$$.deleteScheduled=!0,this}function Wt(){}function It(t,e,r){if(void 0===t[e].overloadTable){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||pt("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].overloadTable+")!"),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}}function Ut(t,e,r){i.hasOwnProperty(t)?((void 0===r||void 0!==i[t].overloadTable&&void 0!==i[t].overloadTable[r])&&pt("Cannot register public name '"+t+"' twice"),It(i,t,t),i.hasOwnProperty(r)&&pt("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),i[t].overloadTable[r]=e):(i[t]=e,void 0!==r&&(i[t].numArguments=r))}function Lt(t,e,r,n,o,i,a,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function Ht(t,e,r){for(;e!==r;)e.upcast||pt("Expected null or instance of "+r.name+", got an instance of "+e.name),t=e.upcast(t),e=e.baseClass;return t}function Mt(t,e){if(null===e)return this.isReference&&pt("null is not a valid "+this.name),0;e.$$||pt('Cannot pass "'+fe(e)+'" as a '+this.name),e.$$.ptr||pt("Cannot pass deleted object as a pointer of type "+this.name);var r=e.$$.ptrType.registeredClass;return Ht(e.$$.ptr,r,this.registeredClass)}function Bt(t,e){var r;if(null===e)return this.isReference&&pt("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,r),r):0;e.$$||pt('Cannot pass "'+fe(e)+'" as a '+this.name),e.$$.ptr||pt("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&e.$$.ptrType.isConst&&pt("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);var n=e.$$.ptrType.registeredClass;if(r=Ht(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&pt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:pt("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var o=e.clone();r=this.rawShare(r,ce.toHandle((function(){o.delete()}))),null!==t&&t.push(this.rawDestructor,r)}break;default:pt("Unsupporting sharing policy")}return r}function Vt(t,e){if(null===e)return this.isReference&&pt("null is not a valid "+this.name),0;e.$$||pt('Cannot pass "'+fe(e)+'" as a '+this.name),e.$$.ptr||pt("Cannot pass deleted object as a pointer of type "+this.name),e.$$.ptrType.isConst&&pt("Cannot convert argument of type "+e.$$.ptrType.name+" to parameter type "+this.name);var r=e.$$.ptrType.registeredClass;return Ht(e.$$.ptr,r,this.registeredClass)}function zt(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function Nt(t){this.rawDestructor&&this.rawDestructor(t)}function Gt(t){null!==t&&t.delete()}function qt(t,e,r,n,o,i,a,s,u,c,f){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=f,o||void 0!==e.baseClass?this.toWireType=Bt:n?(this.toWireType=Mt,this.destructorFunction=null):(this.toWireType=Vt,this.destructorFunction=null)}function Jt(t,e,r){i.hasOwnProperty(t)||at("Replacing nonexistant public symbol"),void 0!==i[t].overloadTable&&void 0!==r?i[t].overloadTable[r]=e:(i[t]=e,i[t].argCount=r)}var Xt=[];function Yt(t){var e=Xt[t];return e||(t>=Xt.length&&(Xt.length=t+1),Xt[t]=e=R.get(t)),e}function Kt(t,e,r){return t.includes("j")?function(t,e,r){var n=i["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)}(t,e,r):Yt(e).apply(null,r)}function Zt(t,e){var r,n,o,i=(t=ft(t)).includes("j")?(r=t,n=e,o=[],function(){return o.length=0,Object.assign(o,arguments),Kt(r,n,o)}):Yt(e);return"function"!=typeof i&&pt("unknown function pointer with signature "+t+": "+e),i}var Qt=void 0;function te(t){var e=xe(t),r=ft(e);return Oe(e),r}function ee(t,e){var r=[],n={};throw e.forEach((function t(e){n[e]||tt[e]||(et[e]?et[e].forEach(t):(r.push(e),n[e]=!0))})),new Qt(t+": "+r.map(te).join([", "]))}function re(t,e){for(var r=[],n=0;n<t;n++)r.push(A[e+4*n>>2]);return r}function ne(t,e,r,n,o){var i=e.length;i<2&&pt("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==e[1]&&null!==r,s=!1,u=1;u<e.length;++u)if(null!==e[u]&&void 0===e[u].destructorFunction){s=!0;break}var c="void"!==e[0].name,f="",l="";for(u=0;u<i-2;++u)f+=(0!==u?", ":"")+"arg"+u,l+=(0!==u?", ":"")+"arg"+u+"Wired";var p="return function "+rt(t)+"("+f+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(p+="var destructors = [];\n");var h=s?"destructors":"null",d=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],v=[pt,n,o,K,e[0],e[1]];for(a&&(p+="var thisWired = classParam.toWireType("+h+", this);\n"),u=0;u<i-2;++u)p+="var arg"+u+"Wired = argType"+u+".toWireType("+h+", arg"+u+"); // "+e[u+2].name+"\n",d.push("argType"+u),v.push(e[u+2]);if(a&&(l="thisWired"+(l.length>0?", ":"")+l),p+=(c?"var rv = ":"")+"invoker(fn"+(l.length>0?", ":"")+l+");\n",s)p+="runDestructors(destructors);\n";else for(u=a?1:2;u<e.length;++u){var y=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==e[u].destructorFunction&&(p+=y+"_dtor("+y+"); // "+e[u].name+"\n",d.push(y+"_dtor"),v.push(e[u].destructorFunction))}return c&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",d.push(p),function(t,e){if(!(t instanceof Function))throw new TypeError("new_ called with constructor type "+typeof t+" which is not a function");var r=nt(t.name||"unknownFunctionName",(function(){}));r.prototype=t.prototype;var n=new r,o=t.apply(n,e);return o instanceof Object?o:n}(Function,d).apply(null,v)}var oe=[],ie=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function ae(t){t>4&&0==--ie[t].refcount&&(ie[t]=void 0,oe.push(t))}function se(){for(var t=0,e=5;e<ie.length;++e)void 0!==ie[e]&&++t;return t}function ue(){for(var t=5;t<ie.length;++t)if(void 0!==ie[t])return ie[t];return null}var ce={toValue:t=>(t||pt("Cannot use deleted val. handle = "+t),ie[t].value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=oe.length?oe.pop():ie.length;return ie[e]={refcount:1,value:t},e}}};function fe(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function le(t,e){switch(e){case 2:return function(t){return this.fromWireType(k[t>>2])};case 3:return function(t){return this.fromWireType(x[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function pe(t,e,r){switch(e){case 0:return r?function(t){return P[t]}:function(t){return T[t]};case 1:return r?function(t){return C[t>>1]}:function(t){return $[t>>1]};case 2:return r?function(t){return _[t>>2]}:function(t){return A[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var he="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function de(t,e){for(var r=t,n=r>>1,o=n+e/2;!(n>=o)&&$[n];)++n;if((r=n<<1)-t>32&&he)return he.decode(T.subarray(t,r));for(var i="",a=0;!(a>=e/2);++a){var s=C[t+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function ve(t,e,r){if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=e,o=(r-=2)<2*t.length?r/2:t.length,i=0;i<o;++i){var a=t.charCodeAt(i);C[e>>1]=a,e+=2}return C[e>>1]=0,e-n}function ye(t){return 2*t.length}function ge(t,e){for(var r=0,n="";!(r>=e/4);){var o=_[t+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 me(t,e,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=e,o=n+r-4,i=0;i<t.length;++i){var a=t.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),_[e>>2]=a,(e+=4)+4>o)break}return _[e>>2]=0,e-n}function we(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e}var be={};function Pe(){return"object"==typeof globalThis?globalThis:Function("return this")()}function Te(t,e){var r=tt[t];return void 0===r&&pt(e+" has unknown type "+te(t)),r}var Ce={};function $e(t){try{return w.grow(t-b.byteLength+65535>>>16),D(w.buffer),1}catch(t){}}it=i.InternalError=ot(Error,"InternalError"),function(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);ct=t}(),lt=i.BindingError=ot(Error,"BindingError"),Wt.prototype.isAliasOf=dt,Wt.prototype.clone=Et,Wt.prototype.delete=Dt,Wt.prototype.isDeleted=Rt,Wt.prototype.deleteLater=Ft,i.getInheritedInstanceCount=Pt,i.getLiveInheritedInstances=Tt,i.flushPendingDeletes=$t,i.setDelayFunction=At,qt.prototype.getPointee=zt,qt.prototype.destructor=Nt,qt.prototype.argPackAdvance=8,qt.prototype.readValueFromPointer=Z,qt.prototype.deleteObject=Gt,qt.prototype.fromWireType=jt,Qt=i.UnboundTypeError=ot(Error,"UnboundTypeError"),i.count_emval_handles=se,i.get_first_emval=ue;var _e,Ae={h:function(t,e,r){throw new X(t).init(e,r),t},q:function(t){var e=Y[t];delete Y[t];var r=e.rawConstructor,n=e.rawDestructor,o=e.fields;st([t],o.map((t=>t.getterReturnType)).concat(o.map((t=>t.setterArgumentType))),(t=>{var i={};return o.forEach(((e,r)=>{var n=e.fieldName,a=t[r],s=e.getter,u=e.getterContext,c=t[r+o.length],f=e.setter,l=e.setterContext;i[n]={read:t=>a.fromWireType(s(u,t)),write:(t,e)=>{var r=[];f(l,t,c.toWireType(r,e)),K(r)}}})),[{name:e.name,fromWireType:function(t){var e={};for(var r in i)e[r]=i[r].read(t);return n(t),e},toWireType:function(t,e){for(var o in i)if(!(o in e))throw new TypeError('Missing field: "'+o+'"');var a=r();for(o in i)i[o].write(a,e[o]);return null!==t&&t.push(n,a),a},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:n}]}))},r:function(t,e,r,n,o){},w:function(t,e,r,n,o){var i=ut(r);ht(t,{name:e=ft(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?n:o},argPackAdvance:8,readValueFromPointer:function(t){var n;if(1===r)n=P;else if(2===r)n=C;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+e);n=_}return this.fromWireType(n[t>>i])},destructorFunction:null})},p:function(t,e,r,n,o,i,a,s,u,c,f,l,p){f=ft(f),i=Zt(o,i),s&&(s=Zt(a,s)),c&&(c=Zt(u,c)),p=Zt(l,p);var h=rt(f);Ut(h,(function(){ee("Cannot construct "+f+" due to unbound types",[n])})),st([t,e,r],n?[n]:[],(function(e){var r,o;e=e[0],o=n?(r=e.registeredClass).instancePrototype:Wt.prototype;var a=nt(h,(function(){if(Object.getPrototypeOf(this)!==u)throw new lt("Use 'new' to construct "+f);if(void 0===l.constructor_body)throw new lt(f+" has no accessible constructor");var t=l.constructor_body[arguments.length];if(void 0===t)throw new lt("Tried to invoke ctor of "+f+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(l.constructor_body).toString()+") parameters instead!");return t.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var l=new Lt(f,a,u,p,r,i,s,c),d=new qt(f,l,!0,!1,!1),v=new qt(f+"*",l,!1,!1,!1),y=new qt(f+" const*",l,!1,!0,!1);return bt[t]={pointerType:v,constPointerType:y},Jt(h,a),[d,v,y]}))},o:function(t,e,r,n,o,i){var a;e>0||V(a);var s=re(e,r);o=Zt(n,o),st([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.registeredClass.constructor_body&&(t.registeredClass.constructor_body=[]),void 0!==t.registeredClass.constructor_body[e-1])throw new lt("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.registeredClass.constructor_body[e-1]=()=>{ee("Cannot construct "+t.name+" due to unbound types",s)},st([],s,(function(n){return n.splice(1,0,null),t.registeredClass.constructor_body[e-1]=ne(r,n,null,o,i),[]})),[]}))},c:function(t,e,r,n,o,i,a,s){var u=re(r,n);e=ft(e),i=Zt(o,i),st([],[t],(function(t){var n=(t=t[0]).name+"."+e;function o(){ee("Cannot call "+n+" due to unbound types",u)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&t.registeredClass.pureVirtualFunctions.push(e);var c=t.registeredClass.instancePrototype,f=c[e];return void 0===f||void 0===f.overloadTable&&f.className!==t.name&&f.argCount===r-2?(o.argCount=r-2,o.className=t.name,c[e]=o):(It(c,e,n),c[e].overloadTable[r-2]=o),st([],u,(function(o){var s=ne(n,o,t,i,a);return void 0===c[e].overloadTable?(s.argCount=r-2,c[e]=s):c[e].overloadTable[r-2]=s,[]})),[]}))},v:function(t,e){ht(t,{name:e=ft(e),fromWireType:function(t){var e=ce.toValue(t);return ae(t),e},toWireType:function(t,e){return ce.toHandle(e)},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:null})},k:function(t,e,r){var n=ut(r);ht(t,{name:e=ft(e),fromWireType:function(t){return t},toWireType:function(t,e){return e},argPackAdvance:8,readValueFromPointer:le(e,n),destructorFunction:null})},e:function(t,e,r,n,o,i){var a=re(e,r);t=ft(t),o=Zt(n,o),Ut(t,(function(){ee("Cannot call "+t+" due to unbound types",a)}),e-1),st([],a,(function(r){var n=[r[0],null].concat(r.slice(1));return Jt(t,ne(t,n,null,o,i),e-1),[]}))},b:function(t,e,r,n,o){e=ft(e),-1===o&&(o=4294967295);var i=ut(r),a=t=>t;if(0===n){var s=32-8*r;a=t=>t<<s>>>s}var u=e.includes("unsigned");ht(t,{name:e,fromWireType:a,toWireType:u?function(t,e){return this.name,e>>>0}:function(t,e){return this.name,e},argPackAdvance:8,readValueFromPointer:pe(e,i,0!==n),destructorFunction:null})},a:function(t,e,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(t){var e=A,r=e[t>>=2],o=e[t+1];return new n(b,o,r)}ht(t,{name:r=ft(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},j:function(t,e){var r="std::string"===(e=ft(e));ht(t,{name:e,fromWireType:function(t){var e,n=A[t>>2],o=t+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==T[s]){var u=S(i,s-i);void 0===e?e=u:(e+=String.fromCharCode(0),e+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(T[o+a]);e=c.join("")}return Oe(t),e},toWireType:function(t,e){var n;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var o="string"==typeof e;o||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||pt("Cannot pass non-string to std::string"),n=r&&o?function(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e}(e):e.length;var i=ke(4+n+1),a=i+4;if(A[i>>2]=n,r&&o)E(e,a,n+1);else if(o)for(var s=0;s<n;++s){var u=e.charCodeAt(s);u>255&&(Oe(a),pt("String has UTF-16 code units that do not fit in 8 bits")),T[a+s]=u}else for(s=0;s<n;++s)T[a+s]=e[s];return null!==t&&t.push(Oe,i),i},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:function(t){Oe(t)}})},g:function(t,e,r){var n,o,i,a,s;r=ft(r),2===e?(n=de,o=ve,a=ye,i=()=>$,s=1):4===e&&(n=ge,o=me,a=we,i=()=>A,s=2),ht(t,{name:r,fromWireType:function(t){for(var r,o=A[t>>2],a=i(),u=t+4,c=0;c<=o;++c){var f=t+4+c*e;if(c==o||0==a[f>>s]){var l=n(u,f-u);void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),u=f+e}}return Oe(t),r},toWireType:function(t,n){"string"!=typeof n&&pt("Cannot pass non-string to C++ string type "+r);var i=a(n),u=ke(4+i+e);return A[u>>2]=i>>s,o(n,u+4,i+e),null!==t&&t.push(Oe,u),u},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:function(t){Oe(t)}})},u:function(t,e,r,n,o,i){Y[t]={name:ft(e),rawConstructor:Zt(r,n),rawDestructor:Zt(o,i),fields:[]}},d:function(t,e,r,n,o,i,a,s,u,c){Y[t].fields.push({fieldName:ft(e),getterReturnType:r,getter:Zt(n,o),getterContext:i,setterArgumentType:a,setter:Zt(s,u),setterContext:c})},x:function(t,e){ht(t,{isVoid:!0,name:e=ft(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(t,e){}})},i:ae,m:function(t){return 0===t?ce.toHandle(Pe()):(t=void 0===(r=be[e=t])?ft(e):r,ce.toHandle(Pe()[t]));var e,r},l:function(t){t>4&&(ie[t].refcount+=1)},y:function(t,e,r,n){t=ce.toValue(t);var o=Ce[e];return o||(o=function(t){for(var e="",r=0;r<t;++r)e+=(0!==r?", ":"")+"arg"+r;var n="return function emval_allocator_"+t+"(constructor, argTypes, args) {\n var HEAPU32 = getMemory();\n";for(r=0;r<t;++r)n+="var argType"+r+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+r+"');\nvar arg"+r+" = argType"+r+".readValueFromPointer(args);\nargs += argType"+r+"['argPackAdvance'];\nargTypes += 4;\n";return n+="var obj = new constructor("+e+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle","getMemory",n)(Te,i,ce.toHandle,(()=>A))}(e),Ce[e]=o),o(t,r,n)},n:function(t,e){var r=(t=Te(t,"_emval_take_value")).readValueFromPointer(e);return ce.toHandle(r)},f:function(){V("")},t:function(t,e,r){T.copyWithin(t,e,e+r)},s:function(t){var e,r,n=T.length,o=2147483648;if((t>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,t+100663296),$e(Math.min(o,(e=Math.max(t,a))+((r=65536)-e%r)%r)))return!0}return!1}},ke=(function(){var t={a:Ae};function e(t,e){var r,n=t.exports;i.asm=n,D((w=i.asm.z).buffer),R=i.asm.C,r=i.asm.A,U.unshift(r),function(t){if(H--,i.monitorRunDependencies&&i.monitorRunDependencies(H),0==H&&(null!==M&&(clearInterval(M),M=null),B)){var e=B;B=null,e()}}()}function r(t){e(t.instance)}function n(e){return function(){if(!g&&(l||p)){if("function"==typeof fetch&&!N(F))return fetch(F,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+F+"'";return t.arrayBuffer()})).catch((function(){return G(F)}));if(s)return new Promise((function(t,e){s(F,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return G(F)}))}().then((function(e){return WebAssembly.instantiate(e,t)})).then((function(t){return t})).then(e,(function(t){m("failed to asynchronously prepare wasm: "+t),V(t)}))}if(H++,i.monitorRunDependencies&&i.monitorRunDependencies(H),i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(t){m("Module.instantiateWasm callback failed with error: "+t),o(t)}(g||"function"!=typeof WebAssembly.instantiateStreaming||z(F)||N(F)||h||"function"!=typeof fetch?n(r):fetch(F,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(r,(function(t){return m("wasm streaming compile failed: "+t),m("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.A).apply(null,arguments)},i._malloc=function(){return(ke=i._malloc=i.asm.B).apply(null,arguments)}),xe=i.___getTypeName=function(){return(xe=i.___getTypeName=i.asm.D).apply(null,arguments)},Oe=(i.__embind_initialize_bindings=function(){return(i.__embind_initialize_bindings=i.asm.E).apply(null,arguments)},i._free=function(){return(Oe=i._free=i.asm.F).apply(null,arguments)}),je=i.stackSave=function(){return(je=i.stackSave=i.asm.G).apply(null,arguments)},Se=i.stackRestore=function(){return(Se=i.stackRestore=i.asm.H).apply(null,arguments)},Ee=i.stackAlloc=function(){return(Ee=i.stackAlloc=i.asm.I).apply(null,arguments)},De=i.___cxa_is_pointer_type=function(){return(De=i.___cxa_is_pointer_type=i.asm.J).apply(null,arguments)};function Re(t){function r(){_e||(_e=!0,i.calledRun=!0,O||(J(U),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)t=i.postRun.shift(),L.unshift(t);var t;J(L)}()))}t=t||f,H>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)t=i.preRun.shift(),I.unshift(t);var t;J(I)}(),H>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}if(i.ccall=function(t,e,r,n,o){var a={string:t=>{var e=0;if(null!=t&&0!==t){var r=1+(t.length<<2);E(t,e=Ee(r),r)}return e},array:t=>{var e=Ee(t.length);return function(t,e){P.set(t,e)}(t,e),e}},s=function(t){return i["_"+t]}(t),u=[],c=0;if(n)for(var f=0;f<n.length;f++){var l=a[r[f]];l?(0===c&&(c=je()),u[f]=l(n[f])):u[f]=n[f]}var p=s.apply(null,u);return p=function(t){return 0!==c&&Se(c),function(t){return"string"===e?S(t):"boolean"===e?Boolean(t):t}(t)}(p)},B=function t(){_e||Re(),_e||(B=t)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Re(),t.ready});t.exports=o},851:(t,e,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,o,i=void 0!==(t=t||{})?t:{};i.ready=new Promise((function(t,r){e=t,o=r}));var a,s,u,c=Object.assign({},i),f=[],l="./this.program",p=(t,e)=>{throw e},h="object"==typeof window,d="function"==typeof importScripts,v="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";if(v){var g=r(491),m=r(33);y=d?m.dirname(y)+"/":"//",a=(t,e)=>(t=K(t)?new URL(t):m.normalize(t),g.readFileSync(t,e?void 0:"utf8")),u=t=>{var e=a(t,!0);return e.buffer||(e=new Uint8Array(e)),e},s=(t,e,r)=>{t=K(t)?new URL(t):m.normalize(t),g.readFile(t,(function(t,n){t?r(t):e(n.buffer)}))},process.argv.length>1&&(l=process.argv[1].replace(/\\/g,"/")),f=process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof Q))throw t})),process.on("unhandledRejection",(function(t){throw t})),p=(t,e)=>{if(V())throw process.exitCode=t,e;var r;(r=e)instanceof Q||P("exiting due to exception: "+r),process.exit(t)},i.inspect=function(){return"[Emscripten Module object]"}}else(h||d)&&(d?y=self.location.href:"undefined"!=typeof document&&document.currentScript&&(y=document.currentScript.src),n&&(y=n),y=0!==y.indexOf("blob:")?y.substr(0,y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},d&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)});var w,b=i.print||console.log.bind(console),P=i.printErr||console.warn.bind(console);Object.assign(i,c),c=null,i.arguments&&(f=i.arguments),i.thisProgram&&(l=i.thisProgram),i.quit&&(p=i.quit),i.wasmBinary&&(w=i.wasmBinary);var T,C=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&X("no native wasm support detected");var $,_,A,k,x,O,j,S,E,D=!1,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function F(t,e,r){for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&R)return R.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var u=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&t[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function W(t,e){return t?F(A,t,e):""}function I(t,e,r){return function(t,e,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-o}(t,A,e,r)}function U(t){$=t,i.HEAP8=_=new Int8Array(t),i.HEAP16=k=new Int16Array(t),i.HEAP32=O=new Int32Array(t),i.HEAPU8=A=new Uint8Array(t),i.HEAPU16=x=new Uint16Array(t),i.HEAPU32=j=new Uint32Array(t),i.HEAPF32=S=new Float32Array(t),i.HEAPF64=E=new Float64Array(t)}i.INITIAL_MEMORY;var L,H=[],M=[],B=[];function V(){return C}var z,N,G=0,q=null,J=null;function X(t){i.onAbort&&i.onAbort(t),P(t="Aborted("+t+")"),D=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw o(e),e}function Y(t){return t.startsWith("data:application/octet-stream;base64,")}function K(t){return t.startsWith("file://")}function Z(t){try{if(t==z&&w)return new Uint8Array(w);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){X(t)}}function Q(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function tt(t){for(;t.length>0;)t.shift()(i)}function et(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){j[this.ptr+4>>2]=t},this.get_type=function(){return j[this.ptr+4>>2]},this.set_destructor=function(t){j[this.ptr+8>>2]=t},this.get_destructor=function(){return j[this.ptr+8>>2]},this.set_refcount=function(t){O[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,_[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=_[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,_[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=_[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=O[this.ptr>>2];O[this.ptr>>2]=t+1},this.release_ref=function(){var t=O[this.ptr>>2];return O[this.ptr>>2]=t-1,1===t},this.set_adjusted_ptr=function(t){j[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return j[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Ve(this.get_type()))return j[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}Y(z="libjpegturbowasm_decode.wasm")||(N=z,z=i.locateFile?i.locateFile(N,y):y+N);var rt={};function nt(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function ot(t){return this.fromWireType(O[t>>2])}var it={},at={},st={};function ut(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=48&&e<=57?"_"+t:t}function ct(t,e){return t=ut(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function ft(t,e){var r=ct(e,(function(t){this.name=e,this.message=t;var r=new Error(t).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var lt=void 0;function pt(t){throw new lt(t)}function ht(t,e,r){function n(e){var n=r(e);n.length!==t.length&&pt("Mismatched type converter count");for(var o=0;o<t.length;++o)wt(t[o],n[o])}t.forEach((function(t){st[t]=e}));var o=new Array(e.length),i=[],a=0;e.forEach(((t,e)=>{at.hasOwnProperty(t)?o[e]=at[t]:(i.push(t),it.hasOwnProperty(t)||(it[t]=[]),it[t].push((()=>{o[e]=at[t],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function dt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var vt=void 0;function yt(t){for(var e="",r=t;A[r];)e+=vt[A[r++]];return e}var gt=void 0;function mt(t){throw new gt(t)}function wt(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=e.name;if(t||mt('type "'+n+'" must have a positive integer typeid pointer'),at.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;mt("Cannot register type '"+n+"' twice")}if(at[t]=e,delete st[t],it.hasOwnProperty(t)){var o=it[t];delete it[t],o.forEach((t=>t()))}}function bt(t){if(!(this instanceof Bt))return!1;if(!(t instanceof Bt))return!1;for(var e=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=t.$$.ptrType.registeredClass,o=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return e===n&&r===o}function Pt(t){mt(t.$$.ptrType.registeredClass.name+" instance already deleted")}var Tt=!1;function Ct(t){}function $t(t){t.count.value-=1,0===t.count.value&&function(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}(t)}function _t(t,e,r){if(e===r)return t;if(void 0===r.baseClass)return null;var n=_t(t,e,r.baseClass);return null===n?null:r.downcast(n)}var At={};function kt(){return Object.keys(Dt).length}function xt(){var t=[];for(var e in Dt)Dt.hasOwnProperty(e)&&t.push(Dt[e]);return t}var Ot=[];function jt(){for(;Ot.length;){var t=Ot.pop();t.$$.deleteScheduled=!1,t.delete()}}var St=void 0;function Et(t){St=t,Ot.length&&St&&St(jt)}var Dt={};function Rt(t,e){return e=function(t,e){for(void 0===e&&mt("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}(t,e),Dt[e]}function Ft(t,e){return e.ptrType&&e.ptr||pt("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&&pt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},It(Object.create(t,{$$:{value:e}}))}function Wt(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Rt(this.registeredClass,e);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function o(){return this.isSmartPointer?Ft(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Ft(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i,a=this.registeredClass.getActualType(e),s=At[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=_t(e,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?Ft(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:t}):Ft(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}function It(t){return"undefined"==typeof FinalizationRegistry?(It=t=>t,t):(Tt=new FinalizationRegistry((t=>{$t(t.$$)})),It=t=>{var e=t.$$;if(e.smartPtr){var r={$$:e};Tt.register(t,r,t)}return t},Ct=t=>Tt.unregister(t),It(t))}function Ut(){if(this.$$.ptr||Pt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t,e=It(Object.create(Object.getPrototypeOf(this),{$$:{value:(t=this.$$,{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType})}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function Lt(){this.$$.ptr||Pt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&mt("Object already scheduled for deletion"),Ct(this),$t(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Ht(){return!this.$$.ptr}function Mt(){return this.$$.ptr||Pt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&mt("Object already scheduled for deletion"),Ot.push(this),1===Ot.length&&St&&St(jt),this.$$.deleteScheduled=!0,this}function Bt(){}function Vt(t,e,r){if(void 0===t[e].overloadTable){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||mt("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].overloadTable+")!"),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}}function zt(t,e,r,n,o,i,a,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function Nt(t,e,r){for(;e!==r;)e.upcast||mt("Expected null or instance of "+r.name+", got an instance of "+e.name),t=e.upcast(t),e=e.baseClass;return t}function Gt(t,e){if(null===e)return this.isReference&&mt("null is not a valid "+this.name),0;e.$$||mt('Cannot pass "'+de(e)+'" as a '+this.name),e.$$.ptr||mt("Cannot pass deleted object as a pointer of type "+this.name);var r=e.$$.ptrType.registeredClass;return Nt(e.$$.ptr,r,this.registeredClass)}function qt(t,e){var r;if(null===e)return this.isReference&&mt("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,r),r):0;e.$$||mt('Cannot pass "'+de(e)+'" as a '+this.name),e.$$.ptr||mt("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&e.$$.ptrType.isConst&&mt("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);var n=e.$$.ptrType.registeredClass;if(r=Nt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&mt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:mt("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var o=e.clone();r=this.rawShare(r,he.toHandle((function(){o.delete()}))),null!==t&&t.push(this.rawDestructor,r)}break;default:mt("Unsupporting sharing policy")}return r}function Jt(t,e){if(null===e)return this.isReference&&mt("null is not a valid "+this.name),0;e.$$||mt('Cannot pass "'+de(e)+'" as a '+this.name),e.$$.ptr||mt("Cannot pass deleted object as a pointer of type "+this.name),e.$$.ptrType.isConst&&mt("Cannot convert argument of type "+e.$$.ptrType.name+" to parameter type "+this.name);var r=e.$$.ptrType.registeredClass;return Nt(e.$$.ptr,r,this.registeredClass)}function Xt(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function Yt(t){this.rawDestructor&&this.rawDestructor(t)}function Kt(t){null!==t&&t.delete()}function Zt(t,e,r,n,o,i,a,s,u,c,f){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=f,o||void 0!==e.baseClass?this.toWireType=qt:n?(this.toWireType=Gt,this.destructorFunction=null):(this.toWireType=Jt,this.destructorFunction=null)}var Qt=[];function te(t){var e=Qt[t];return e||(t>=Qt.length&&(Qt.length=t+1),Qt[t]=e=L.get(t)),e}function ee(t,e,r){return t.includes("j")?function(t,e,r){var n=i["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)}(t,e,r):te(e).apply(null,r)}function re(t,e){var r,n,o,i=(t=yt(t)).includes("j")?(r=t,n=e,o=[],function(){return o.length=0,Object.assign(o,arguments),ee(r,n,o)}):te(e);return"function"!=typeof i&&mt("unknown function pointer with signature "+t+": "+e),i}var ne=void 0;function oe(t){var e=Ue(t),r=yt(e);return Ie(e),r}function ie(t,e){var r=[],n={};throw e.forEach((function t(e){n[e]||at[e]||(st[e]?st[e].forEach(t):(r.push(e),n[e]=!0))})),new ne(t+": "+r.map(oe).join([", "]))}function ae(t,e){for(var r=[],n=0;n<t;n++)r.push(j[e+4*n>>2]);return r}function se(t,e,r,n,o){var i=e.length;i<2&&mt("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==e[1]&&null!==r,s=!1,u=1;u<e.length;++u)if(null!==e[u]&&void 0===e[u].destructorFunction){s=!0;break}var c="void"!==e[0].name,f="",l="";for(u=0;u<i-2;++u)f+=(0!==u?", ":"")+"arg"+u,l+=(0!==u?", ":"")+"arg"+u+"Wired";var p="return function "+ut(t)+"("+f+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(p+="var destructors = [];\n");var h=s?"destructors":"null",d=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],v=[mt,n,o,nt,e[0],e[1]];for(a&&(p+="var thisWired = classParam.toWireType("+h+", this);\n"),u=0;u<i-2;++u)p+="var arg"+u+"Wired = argType"+u+".toWireType("+h+", arg"+u+"); // "+e[u+2].name+"\n",d.push("argType"+u),v.push(e[u+2]);if(a&&(l="thisWired"+(l.length>0?", ":"")+l),p+=(c?"var rv = ":"")+"invoker(fn"+(l.length>0?", ":"")+l+");\n",s)p+="runDestructors(destructors);\n";else for(u=a?1:2;u<e.length;++u){var y=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==e[u].destructorFunction&&(p+=y+"_dtor("+y+"); // "+e[u].name+"\n",d.push(y+"_dtor"),v.push(e[u].destructorFunction))}return c&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",d.push(p),function(t,e){if(!(t instanceof Function))throw new TypeError("new_ called with constructor type "+typeof t+" which is not a function");var r=ct(t.name||"unknownFunctionName",(function(){}));r.prototype=t.prototype;var n=new r,o=t.apply(n,e);return o instanceof Object?o:n}(Function,d).apply(null,v)}var ue=[],ce=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function fe(t){t>4&&0==--ce[t].refcount&&(ce[t]=void 0,ue.push(t))}function le(){for(var t=0,e=5;e<ce.length;++e)void 0!==ce[e]&&++t;return t}function pe(){for(var t=5;t<ce.length;++t)if(void 0!==ce[t])return ce[t];return null}var he={toValue:t=>(t||mt("Cannot use deleted val. handle = "+t),ce[t].value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=ue.length?ue.pop():ce.length;return ce[e]={refcount:1,value:t},e}}};function de(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function ve(t,e){switch(e){case 2:return function(t){return this.fromWireType(S[t>>2])};case 3:return function(t){return this.fromWireType(E[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function ye(t,e,r){switch(e){case 0:return r?function(t){return _[t]}:function(t){return A[t]};case 1:return r?function(t){return k[t>>1]}:function(t){return x[t>>1]};case 2:return r?function(t){return O[t>>2]}:function(t){return j[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var ge="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function me(t,e){for(var r=t,n=r>>1,o=n+e/2;!(n>=o)&&x[n];)++n;if((r=n<<1)-t>32&&ge)return ge.decode(A.subarray(t,r));for(var i="",a=0;!(a>=e/2);++a){var s=k[t+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function we(t,e,r){if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=e,o=(r-=2)<2*t.length?r/2:t.length,i=0;i<o;++i){var a=t.charCodeAt(i);k[e>>1]=a,e+=2}return k[e>>1]=0,e-n}function be(t){return 2*t.length}function Pe(t,e){for(var r=0,n="";!(r>=e/4);){var o=O[t+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 Te(t,e,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=e,o=n+r-4,i=0;i<t.length;++i){var a=t.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),O[e>>2]=a,(e+=4)+4>o)break}return O[e>>2]=0,e-n}function Ce(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e}var $e={};function _e(){return"object"==typeof globalThis?globalThis:Function("return this")()}function Ae(t,e){var r=at[t];return void 0===r&&mt(e+" has unknown type "+oe(t)),r}var ke={};function xe(t){try{return T.grow(t-$.byteLength+65535>>>16),U(T.buffer),1}catch(t){}}var Oe={};function je(){if(!je.strings){var t={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",_:l||"./this.program"};for(var e in Oe)void 0===Oe[e]?delete t[e]:t[e]=Oe[e];var r=[];for(var e in t)r.push(e+"="+t[e]);je.strings=r}return je.strings}var Se=function(t,e){var r;r=t,V()||(i.onExit&&i.onExit(r),D=!0),p(r,new Q(r))},Ee=[null,[],[]];function De(t,e){var r=Ee[t];0===e||10===e?((1===t?b:P)(F(r,0)),r.length=0):r.push(e)}lt=i.InternalError=ft(Error,"InternalError"),function(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);vt=t}(),gt=i.BindingError=ft(Error,"BindingError"),Bt.prototype.isAliasOf=bt,Bt.prototype.clone=Ut,Bt.prototype.delete=Lt,Bt.prototype.isDeleted=Ht,Bt.prototype.deleteLater=Mt,i.getInheritedInstanceCount=kt,i.getLiveInheritedInstances=xt,i.flushPendingDeletes=jt,i.setDelayFunction=Et,Zt.prototype.getPointee=Xt,Zt.prototype.destructor=Yt,Zt.prototype.argPackAdvance=8,Zt.prototype.readValueFromPointer=ot,Zt.prototype.deleteObject=Kt,Zt.prototype.fromWireType=Wt,ne=i.UnboundTypeError=ft(Error,"UnboundTypeError"),i.count_emval_handles=le,i.get_first_emval=pe;var Re,Fe={g:function(t,e,r){throw new et(t).init(e,r),t},A:function(t){var e=rt[t];delete rt[t];var r=e.rawConstructor,n=e.rawDestructor,o=e.fields;ht([t],o.map((t=>t.getterReturnType)).concat(o.map((t=>t.setterArgumentType))),(t=>{var i={};return o.forEach(((e,r)=>{var n=e.fieldName,a=t[r],s=e.getter,u=e.getterContext,c=t[r+o.length],f=e.setter,l=e.setterContext;i[n]={read:t=>a.fromWireType(s(u,t)),write:(t,e)=>{var r=[];f(l,t,c.toWireType(r,e)),nt(r)}}})),[{name:e.name,fromWireType:function(t){var e={};for(var r in i)e[r]=i[r].read(t);return n(t),e},toWireType:function(t,e){for(var o in i)if(!(o in e))throw new TypeError('Missing field: "'+o+'"');var a=r();for(o in i)i[o].write(a,e[o]);return null!==t&&t.push(n,a),a},argPackAdvance:8,readValueFromPointer:ot,destructorFunction:n}]}))},w:function(t,e,r,n,o){},F:function(t,e,r,n,o){var i=dt(r);wt(t,{name:e=yt(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?n:o},argPackAdvance:8,readValueFromPointer:function(t){var n;if(1===r)n=_;else if(2===r)n=k;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+e);n=O}return this.fromWireType(n[t>>i])},destructorFunction:null})},u:function(t,e,r,n,o,a,s,u,c,f,l,p,h){l=yt(l),a=re(o,a),u&&(u=re(s,u)),f&&(f=re(c,f)),h=re(p,h);var d=ut(l);!function(t,e,r){i.hasOwnProperty(t)?((void 0===r||void 0!==i[t].overloadTable&&void 0!==i[t].overloadTable[r])&&mt("Cannot register public name '"+t+"' twice"),Vt(i,t,t),i.hasOwnProperty(r)&&mt("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),i[t].overloadTable[r]=e):(i[t]=e,void 0!==r&&(i[t].numArguments=r))}(d,(function(){ie("Cannot construct "+l+" due to unbound types",[n])})),ht([t,e,r],n?[n]:[],(function(e){var r,o;e=e[0],o=n?(r=e.registeredClass).instancePrototype:Bt.prototype;var s=ct(d,(function(){if(Object.getPrototypeOf(this)!==c)throw new gt("Use 'new' to construct "+l);if(void 0===p.constructor_body)throw new gt(l+" has no accessible constructor");var t=p.constructor_body[arguments.length];if(void 0===t)throw new gt("Tried to invoke ctor of "+l+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(p.constructor_body).toString()+") parameters instead!");return t.apply(this,arguments)})),c=Object.create(o,{constructor:{value:s}});s.prototype=c;var p=new zt(l,s,c,h,r,a,u,f),v=new Zt(l,p,!0,!1,!1),y=new Zt(l+"*",p,!1,!1,!1),g=new Zt(l+" const*",p,!1,!0,!1);return At[t]={pointerType:y,constPointerType:g},function(t,e,r){i.hasOwnProperty(t)||pt("Replacing nonexistant public symbol"),void 0!==i[t].overloadTable&&void 0!==r?i[t].overloadTable[r]=e:(i[t]=e,i[t].argCount=r)}(d,s),[v,y,g]}))},t:function(t,e,r,n,o,i){var a;e>0||X(a);var s=ae(e,r);o=re(n,o),ht([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.registeredClass.constructor_body&&(t.registeredClass.constructor_body=[]),void 0!==t.registeredClass.constructor_body[e-1])throw new gt("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.registeredClass.constructor_body[e-1]=()=>{ie("Cannot construct "+t.name+" due to unbound types",s)},ht([],s,(function(n){return n.splice(1,0,null),t.registeredClass.constructor_body[e-1]=se(r,n,null,o,i),[]})),[]}))},c:function(t,e,r,n,o,i,a,s){var u=ae(r,n);e=yt(e),i=re(o,i),ht([],[t],(function(t){var n=(t=t[0]).name+"."+e;function o(){ie("Cannot call "+n+" due to unbound types",u)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&t.registeredClass.pureVirtualFunctions.push(e);var c=t.registeredClass.instancePrototype,f=c[e];return void 0===f||void 0===f.overloadTable&&f.className!==t.name&&f.argCount===r-2?(o.argCount=r-2,o.className=t.name,c[e]=o):(Vt(c,e,n),c[e].overloadTable[r-2]=o),ht([],u,(function(o){var s=se(n,o,t,i,a);return void 0===c[e].overloadTable?(s.argCount=r-2,c[e]=s):c[e].overloadTable[r-2]=s,[]})),[]}))},E:function(t,e){wt(t,{name:e=yt(e),fromWireType:function(t){var e=he.toValue(t);return fe(t),e},toWireType:function(t,e){return he.toHandle(e)},argPackAdvance:8,readValueFromPointer:ot,destructorFunction:null})},m:function(t,e,r){var n=dt(r);wt(t,{name:e=yt(e),fromWireType:function(t){return t},toWireType:function(t,e){return e},argPackAdvance:8,readValueFromPointer:ve(e,n),destructorFunction:null})},b:function(t,e,r,n,o){e=yt(e),-1===o&&(o=4294967295);var i=dt(r),a=t=>t;if(0===n){var s=32-8*r;a=t=>t<<s>>>s}var u=e.includes("unsigned");wt(t,{name:e,fromWireType:a,toWireType:u?function(t,e){return this.name,e>>>0}:function(t,e){return this.name,e},argPackAdvance:8,readValueFromPointer:ye(e,i,0!==n),destructorFunction:null})},a:function(t,e,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(t){var e=j,r=e[t>>=2],o=e[t+1];return new n($,o,r)}wt(t,{name:r=yt(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},l:function(t,e){var r="std::string"===(e=yt(e));wt(t,{name:e,fromWireType:function(t){var e,n=j[t>>2],o=t+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==A[s]){var u=W(i,s-i);void 0===e?e=u:(e+=String.fromCharCode(0),e+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(A[o+a]);e=c.join("")}return Ie(t),e},toWireType:function(t,e){var n;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var o="string"==typeof e;o||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||mt("Cannot pass non-string to std::string"),n=r&&o?function(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e}(e):e.length;var i=We(4+n+1),a=i+4;if(j[i>>2]=n,r&&o)I(e,a,n+1);else if(o)for(var s=0;s<n;++s){var u=e.charCodeAt(s);u>255&&(Ie(a),mt("String has UTF-16 code units that do not fit in 8 bits")),A[a+s]=u}else for(s=0;s<n;++s)A[a+s]=e[s];return null!==t&&t.push(Ie,i),i},argPackAdvance:8,readValueFromPointer:ot,destructorFunction:function(t){Ie(t)}})},h:function(t,e,r){var n,o,i,a,s;r=yt(r),2===e?(n=me,o=we,a=be,i=()=>x,s=1):4===e&&(n=Pe,o=Te,a=Ce,i=()=>j,s=2),wt(t,{name:r,fromWireType:function(t){for(var r,o=j[t>>2],a=i(),u=t+4,c=0;c<=o;++c){var f=t+4+c*e;if(c==o||0==a[f>>s]){var l=n(u,f-u);void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),u=f+e}}return Ie(t),r},toWireType:function(t,n){"string"!=typeof n&&mt("Cannot pass non-string to C++ string type "+r);var i=a(n),u=We(4+i+e);return j[u>>2]=i>>s,o(n,u+4,i+e),null!==t&&t.push(Ie,u),u},argPackAdvance:8,readValueFromPointer:ot,destructorFunction:function(t){Ie(t)}})},J:function(t,e,r,n,o,i){rt[t]={name:yt(e),rawConstructor:re(r,n),rawDestructor:re(o,i),fields:[]}},d:function(t,e,r,n,o,i,a,s,u,c){rt[t].fields.push({fieldName:yt(e),getterReturnType:r,getter:re(n,o),getterContext:i,setterArgumentType:a,setter:re(s,u),setterContext:c})},G:function(t,e){wt(t,{isVoid:!0,name:e=yt(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(t,e){}})},x:function(){throw 1/0},i:fe,r:function(t){return 0===t?he.toHandle(_e()):(t=void 0===(r=$e[e=t])?yt(e):r,he.toHandle(_e()[t]));var e,r},p:function(t){t>4&&(ce[t].refcount+=1)},q:function(t,e,r,n){t=he.toValue(t);var o=ke[e];return o||(o=function(t){for(var e="",r=0;r<t;++r)e+=(0!==r?", ":"")+"arg"+r;var n="return function emval_allocator_"+t+"(constructor, argTypes, args) {\n var HEAPU32 = getMemory();\n";for(r=0;r<t;++r)n+="var argType"+r+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+r+"');\nvar arg"+r+" = argType"+r+".readValueFromPointer(args);\nargs += argType"+r+"['argPackAdvance'];\nargTypes += 4;\n";return n+="var obj = new constructor("+e+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle","getMemory",n)(Ae,i,he.toHandle,(()=>j))}(e),ke[e]=o),o(t,r,n)},s:function(t,e){var r=(t=Ae(t,"_emval_take_value")).readValueFromPointer(e);return he.toHandle(r)},j:function(){X("")},D:function(t,e,r){A.copyWithin(t,e,e+r)},y:function(t){var e,r,n=A.length,o=2147483648;if((t>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,t+100663296),xe(Math.min(o,(e=Math.max(t,a))+((r=65536)-e%r)%r)))return!0}return!1},z:function(t,e){var r=0;return je().forEach((function(n,o){var i=e+r;j[t+4*o>>2]=i,function(t,e,r){for(var n=0;n<t.length;++n)_[e++>>0]=t.charCodeAt(n);r||(_[e>>0]=0)}(n,i),r+=n.length+1})),0},B:function(t,e){var r=je();j[t>>2]=r.length;var n=0;return r.forEach((function(t){n+=t.length+1})),j[e>>2]=n,0},I:Se,C:function(t){return 52},v:function(t,e,r,n,o){return 70},k:function(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=j[e>>2],s=j[e+4>>2];e+=8;for(var u=0;u<s;u++)De(t,A[a+u]);o+=s}return j[n>>2]=o,0},o:function(t,e){var r=He();try{return te(t)(e)}catch(t){if(Me(r),t!==t+0)throw t;Le(1,0)}},n:function(t,e,r){var n=He();try{return te(t)(e,r)}catch(t){if(Me(n),t!==t+0)throw t;Le(1,0)}},H:function(t,e,r,n){var o=He();try{return te(t)(e,r,n)}catch(t){if(Me(o),t!==t+0)throw t;Le(1,0)}},f:function(t,e){var r=He();try{te(t)(e)}catch(t){if(Me(r),t!==t+0)throw t;Le(1,0)}},e:function(t,e,r,n){var o=He();try{te(t)(e,r,n)}catch(t){if(Me(o),t!==t+0)throw t;Le(1,0)}}},We=(function(){var t={a:Fe};function e(t,e){var r,n=t.exports;i.asm=n,U((T=i.asm.K).buffer),L=i.asm.M,r=i.asm.L,M.unshift(r),function(t){if(G--,i.monitorRunDependencies&&i.monitorRunDependencies(G),0==G&&(null!==q&&(clearInterval(q),q=null),J)){var e=J;J=null,e()}}()}function r(t){e(t.instance)}function n(e){return function(){if(!w&&(h||d)){if("function"==typeof fetch&&!K(z))return fetch(z,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+z+"'";return t.arrayBuffer()})).catch((function(){return Z(z)}));if(s)return new Promise((function(t,e){s(z,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return Z(z)}))}().then((function(e){return WebAssembly.instantiate(e,t)})).then((function(t){return t})).then(e,(function(t){P("failed to asynchronously prepare wasm: "+t),X(t)}))}if(G++,i.monitorRunDependencies&&i.monitorRunDependencies(G),i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(t){P("Module.instantiateWasm callback failed with error: "+t),o(t)}(w||"function"!=typeof WebAssembly.instantiateStreaming||Y(z)||K(z)||v||"function"!=typeof fetch?n(r):fetch(z,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(r,(function(t){return P("wasm streaming compile failed: "+t),P("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.L).apply(null,arguments)},i._malloc=function(){return(We=i._malloc=i.asm.N).apply(null,arguments)}),Ie=i._free=function(){return(Ie=i._free=i.asm.O).apply(null,arguments)},Ue=i.___getTypeName=function(){return(Ue=i.___getTypeName=i.asm.P).apply(null,arguments)},Le=(i.__embind_initialize_bindings=function(){return(i.__embind_initialize_bindings=i.asm.Q).apply(null,arguments)},i._setThrew=function(){return(Le=i._setThrew=i.asm.R).apply(null,arguments)}),He=i.stackSave=function(){return(He=i.stackSave=i.asm.S).apply(null,arguments)},Me=i.stackRestore=function(){return(Me=i.stackRestore=i.asm.T).apply(null,arguments)},Be=i.stackAlloc=function(){return(Be=i.stackAlloc=i.asm.U).apply(null,arguments)},Ve=i.___cxa_is_pointer_type=function(){return(Ve=i.___cxa_is_pointer_type=i.asm.V).apply(null,arguments)};function ze(t){function r(){Re||(Re=!0,i.calledRun=!0,D||(tt(M),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)t=i.postRun.shift(),B.unshift(t);var t;tt(B)}()))}t=t||f,G>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)t=i.preRun.shift(),H.unshift(t);var t;tt(H)}(),G>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}if(i.dynCall_jiji=function(){return(i.dynCall_jiji=i.asm.W).apply(null,arguments)},i.ccall=function(t,e,r,n,o){var a={string:t=>{var e=0;if(null!=t&&0!==t){var r=1+(t.length<<2);I(t,e=Be(r),r)}return e},array:t=>{var e=Be(t.length);return function(t,e){_.set(t,e)}(t,e),e}},s=function(t){return i["_"+t]}(t),u=[],c=0;if(n)for(var f=0;f<n.length;f++){var l=a[r[f]];l?(0===c&&(c=He()),u[f]=l(n[f])):u[f]=n[f]}var p=s.apply(null,u);return p=function(t){return 0!==c&&Me(c),function(t){return"string"===e?W(t):"boolean"===e?Boolean(t):t}(t)}(p)},J=function t(){Re||ze(),Re||(J=t)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return ze(),t.ready});t.exports=o},272:(t,e,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,o,i=void 0!==(t=t||{})?t:{};i.ready=new Promise((function(t,r){e=t,o=r}));var a,s,u,c=Object.assign({},i),f=[],l="./this.program",p="object"==typeof window,h="function"==typeof importScripts,d="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,v="";if(d){var y=r(261),g=r(926);v=h?g.dirname(v)+"/":"//",a=(t,e)=>(t=J(t)?new URL(t):g.normalize(t),y.readFileSync(t,e?void 0:"utf8")),u=t=>{var e=a(t,!0);return e.buffer||(e=new Uint8Array(e)),e},s=(t,e,r)=>{t=J(t)?new URL(t):g.normalize(t),y.readFile(t,(function(t,n){t?r(t):e(n.buffer)}))},process.argv.length>1&&(l=process.argv[1].replace(/\\/g,"/")),f=process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof Y))throw t})),process.on("unhandledRejection",(function(t){throw t})),i.inspect=function(){return"[Emscripten Module object]"}}else(p||h)&&(h?v=self.location.href:"undefined"!=typeof document&&document.currentScript&&(v=document.currentScript.src),n&&(v=n),v=0!==v.indexOf("blob:")?v.substr(0,v.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},h&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),s=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)});var m,w=i.print||console.log.bind(console),b=i.printErr||console.warn.bind(console);Object.assign(i,c),c=null,i.arguments&&(f=i.arguments),i.thisProgram&&(l=i.thisProgram),i.quit&&i.quit,i.wasmBinary&&(m=i.wasmBinary);var P;i.noExitRuntime;"object"!=typeof WebAssembly&&G("no native wasm support detected");var T,C,$,_,A,k,x,O,j,S=!1,E="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function D(t,e,r){for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&E)return E.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var u=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&t[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function R(t,e){return t?D($,t,e):""}function F(t,e,r){return function(t,e,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-o}(t,$,e,r)}function W(t){T=t,i.HEAP8=C=new Int8Array(t),i.HEAP16=_=new Int16Array(t),i.HEAP32=k=new Int32Array(t),i.HEAPU8=$=new Uint8Array(t),i.HEAPU16=A=new Uint16Array(t),i.HEAPU32=x=new Uint32Array(t),i.HEAPF32=O=new Float32Array(t),i.HEAPF64=j=new Float64Array(t)}i.INITIAL_MEMORY;var I,U,L,H=[],M=[],B=[],V=0,z=null,N=null;function G(t){i.onAbort&&i.onAbort(t),b(t="Aborted("+t+")"),S=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw o(e),e}function q(t){return t.startsWith("data:application/octet-stream;base64,")}function J(t){return t.startsWith("file://")}function X(t){try{if(t==U&&m)return new Uint8Array(m);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){G(t)}}function Y(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function K(t){for(;t.length>0;)t.shift()(i)}function Z(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){x[this.ptr+4>>2]=t},this.get_type=function(){return x[this.ptr+4>>2]},this.set_destructor=function(t){x[this.ptr+8>>2]=t},this.get_destructor=function(){return x[this.ptr+8>>2]},this.set_refcount=function(t){k[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,C[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=C[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,C[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=C[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=k[this.ptr>>2];k[this.ptr>>2]=t+1},this.release_ref=function(){var t=k[this.ptr>>2];return k[this.ptr>>2]=t-1,1===t},this.set_adjusted_ptr=function(t){x[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return x[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Ue(this.get_type()))return x[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}q(U="openjpegwasm_decode.wasm")||(L=U,U=i.locateFile?i.locateFile(L,v):v+L);var Q={};function tt(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function et(t){return this.fromWireType(k[t>>2])}var rt={},nt={},ot={};function it(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=48&&e<=57?"_"+t:t}function at(t,e){return t=it(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function st(t,e){var r=at(e,(function(t){this.name=e,this.message=t;var r=new Error(t).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var ut=void 0;function ct(t){throw new ut(t)}function ft(t,e,r){function n(e){var n=r(e);n.length!==t.length&&ct("Mismatched type converter count");for(var o=0;o<t.length;++o)yt(t[o],n[o])}t.forEach((function(t){ot[t]=e}));var o=new Array(e.length),i=[],a=0;e.forEach(((t,e)=>{nt.hasOwnProperty(t)?o[e]=nt[t]:(i.push(t),rt.hasOwnProperty(t)||(rt[t]=[]),rt[t].push((()=>{o[e]=nt[t],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function lt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var pt=void 0;function ht(t){for(var e="",r=t;$[r];)e+=pt[$[r++]];return e}var dt=void 0;function vt(t){throw new dt(t)}function yt(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=e.name;if(t||vt('type "'+n+'" must have a positive integer typeid pointer'),nt.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;vt("Cannot register type '"+n+"' twice")}if(nt[t]=e,delete ot[t],rt.hasOwnProperty(t)){var o=rt[t];delete rt[t],o.forEach((t=>t()))}}function gt(t){if(!(this instanceof Lt))return!1;if(!(t instanceof Lt))return!1;for(var e=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=t.$$.ptrType.registeredClass,o=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return e===n&&r===o}function mt(t){vt(t.$$.ptrType.registeredClass.name+" instance already deleted")}var wt=!1;function bt(t){}function Pt(t){t.count.value-=1,0===t.count.value&&function(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}(t)}function Tt(t,e,r){if(e===r)return t;if(void 0===r.baseClass)return null;var n=Tt(t,e,r.baseClass);return null===n?null:r.downcast(n)}var Ct={};function $t(){return Object.keys(jt).length}function _t(){var t=[];for(var e in jt)jt.hasOwnProperty(e)&&t.push(jt[e]);return t}var At=[];function kt(){for(;At.length;){var t=At.pop();t.$$.deleteScheduled=!1,t.delete()}}var xt=void 0;function Ot(t){xt=t,At.length&&xt&&xt(kt)}var jt={};function St(t,e){return e=function(t,e){for(void 0===e&&vt("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}(t,e),jt[e]}function Et(t,e){return e.ptrType&&e.ptr||ct("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&&ct("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Rt(Object.create(t,{$$:{value:e}}))}function Dt(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=St(this.registeredClass,e);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function o(){return this.isSmartPointer?Et(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Et(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i,a=this.registeredClass.getActualType(e),s=Ct[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Tt(e,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?Et(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:t}):Et(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}function Rt(t){return"undefined"==typeof FinalizationRegistry?(Rt=t=>t,t):(wt=new FinalizationRegistry((t=>{Pt(t.$$)})),Rt=t=>{var e=t.$$;if(e.smartPtr){var r={$$:e};wt.register(t,r,t)}return t},bt=t=>wt.unregister(t),Rt(t))}function Ft(){if(this.$$.ptr||mt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t,e=Rt(Object.create(Object.getPrototypeOf(this),{$$:{value:(t=this.$$,{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType})}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function Wt(){this.$$.ptr||mt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&vt("Object already scheduled for deletion"),bt(this),Pt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function It(){return!this.$$.ptr}function Ut(){return this.$$.ptr||mt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&vt("Object already scheduled for deletion"),At.push(this),1===At.length&&xt&&xt(kt),this.$$.deleteScheduled=!0,this}function Lt(){}function Ht(t,e,r){if(void 0===t[e].overloadTable){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||vt("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].overloadTable+")!"),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}}function Mt(t,e,r,n,o,i,a,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function Bt(t,e,r){for(;e!==r;)e.upcast||vt("Expected null or instance of "+r.name+", got an instance of "+e.name),t=e.upcast(t),e=e.baseClass;return t}function Vt(t,e){if(null===e)return this.isReference&&vt("null is not a valid "+this.name),0;e.$$||vt('Cannot pass "'+le(e)+'" as a '+this.name),e.$$.ptr||vt("Cannot pass deleted object as a pointer of type "+this.name);var r=e.$$.ptrType.registeredClass;return Bt(e.$$.ptr,r,this.registeredClass)}function zt(t,e){var r;if(null===e)return this.isReference&&vt("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,r),r):0;e.$$||vt('Cannot pass "'+le(e)+'" as a '+this.name),e.$$.ptr||vt("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&e.$$.ptrType.isConst&&vt("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);var n=e.$$.ptrType.registeredClass;if(r=Bt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&vt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:vt("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var o=e.clone();r=this.rawShare(r,fe.toHandle((function(){o.delete()}))),null!==t&&t.push(this.rawDestructor,r)}break;default:vt("Unsupporting sharing policy")}return r}function Nt(t,e){if(null===e)return this.isReference&&vt("null is not a valid "+this.name),0;e.$$||vt('Cannot pass "'+le(e)+'" as a '+this.name),e.$$.ptr||vt("Cannot pass deleted object as a pointer of type "+this.name),e.$$.ptrType.isConst&&vt("Cannot convert argument of type "+e.$$.ptrType.name+" to parameter type "+this.name);var r=e.$$.ptrType.registeredClass;return Bt(e.$$.ptr,r,this.registeredClass)}function Gt(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function qt(t){this.rawDestructor&&this.rawDestructor(t)}function Jt(t){null!==t&&t.delete()}function Xt(t,e,r,n,o,i,a,s,u,c,f){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=f,o||void 0!==e.baseClass?this.toWireType=zt:n?(this.toWireType=Vt,this.destructorFunction=null):(this.toWireType=Nt,this.destructorFunction=null)}var Yt=[];function Kt(t){var e=Yt[t];return e||(t>=Yt.length&&(Yt.length=t+1),Yt[t]=e=I.get(t)),e}function Zt(t,e,r){return t.includes("j")?function(t,e,r){var n=i["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)}(t,e,r):Kt(e).apply(null,r)}function Qt(t,e){var r,n,o,i=(t=ht(t)).includes("j")?(r=t,n=e,o=[],function(){return o.length=0,Object.assign(o,arguments),Zt(r,n,o)}):Kt(e);return"function"!=typeof i&&vt("unknown function pointer with signature "+t+": "+e),i}var te=void 0;function ee(t){var e=Re(t),r=ht(e);return De(e),r}function re(t,e){var r=[],n={};throw e.forEach((function t(e){n[e]||nt[e]||(ot[e]?ot[e].forEach(t):(r.push(e),n[e]=!0))})),new te(t+": "+r.map(ee).join([", "]))}function ne(t,e){for(var r=[],n=0;n<t;n++)r.push(x[e+4*n>>2]);return r}function oe(t,e,r,n,o){var i=e.length;i<2&&vt("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==e[1]&&null!==r,s=!1,u=1;u<e.length;++u)if(null!==e[u]&&void 0===e[u].destructorFunction){s=!0;break}var c="void"!==e[0].name,f="",l="";for(u=0;u<i-2;++u)f+=(0!==u?", ":"")+"arg"+u,l+=(0!==u?", ":"")+"arg"+u+"Wired";var p="return function "+it(t)+"("+f+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(p+="var destructors = [];\n");var h=s?"destructors":"null",d=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],v=[vt,n,o,tt,e[0],e[1]];for(a&&(p+="var thisWired = classParam.toWireType("+h+", this);\n"),u=0;u<i-2;++u)p+="var arg"+u+"Wired = argType"+u+".toWireType("+h+", arg"+u+"); // "+e[u+2].name+"\n",d.push("argType"+u),v.push(e[u+2]);if(a&&(l="thisWired"+(l.length>0?", ":"")+l),p+=(c?"var rv = ":"")+"invoker(fn"+(l.length>0?", ":"")+l+");\n",s)p+="runDestructors(destructors);\n";else for(u=a?1:2;u<e.length;++u){var y=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==e[u].destructorFunction&&(p+=y+"_dtor("+y+"); // "+e[u].name+"\n",d.push(y+"_dtor"),v.push(e[u].destructorFunction))}return c&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",d.push(p),function(t,e){if(!(t instanceof Function))throw new TypeError("new_ called with constructor type "+typeof t+" which is not a function");var r=at(t.name||"unknownFunctionName",(function(){}));r.prototype=t.prototype;var n=new r,o=t.apply(n,e);return o instanceof Object?o:n}(Function,d).apply(null,v)}var ie=[],ae=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function se(t){t>4&&0==--ae[t].refcount&&(ae[t]=void 0,ie.push(t))}function ue(){for(var t=0,e=5;e<ae.length;++e)void 0!==ae[e]&&++t;return t}function ce(){for(var t=5;t<ae.length;++t)if(void 0!==ae[t])return ae[t];return null}var fe={toValue:t=>(t||vt("Cannot use deleted val. handle = "+t),ae[t].value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=ie.length?ie.pop():ae.length;return ae[e]={refcount:1,value:t},e}}};function le(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function pe(t,e){switch(e){case 2:return function(t){return this.fromWireType(O[t>>2])};case 3:return function(t){return this.fromWireType(j[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function he(t,e,r){switch(e){case 0:return r?function(t){return C[t]}:function(t){return $[t]};case 1:return r?function(t){return _[t>>1]}:function(t){return A[t>>1]};case 2:return r?function(t){return k[t>>2]}:function(t){return x[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var de="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function ve(t,e){for(var r=t,n=r>>1,o=n+e/2;!(n>=o)&&A[n];)++n;if((r=n<<1)-t>32&&de)return de.decode($.subarray(t,r));for(var i="",a=0;!(a>=e/2);++a){var s=_[t+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function ye(t,e,r){if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=e,o=(r-=2)<2*t.length?r/2:t.length,i=0;i<o;++i){var a=t.charCodeAt(i);_[e>>1]=a,e+=2}return _[e>>1]=0,e-n}function ge(t){return 2*t.length}function me(t,e){for(var r=0,n="";!(r>=e/4);){var o=k[t+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 we(t,e,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=e,o=n+r-4,i=0;i<t.length;++i){var a=t.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),k[e>>2]=a,(e+=4)+4>o)break}return k[e>>2]=0,e-n}function be(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e}var Pe={};function Te(){return"object"==typeof globalThis?globalThis:Function("return this")()}function Ce(t,e){var r=nt[t];return void 0===r&&vt(e+" has unknown type "+ee(t)),r}var $e={};function _e(t){try{return P.grow(t-T.byteLength+65535>>>16),W(P.buffer),1}catch(t){}}var Ae={};function ke(){if(!ke.strings){var t={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",_:l||"./this.program"};for(var e in Ae)void 0===Ae[e]?delete t[e]:t[e]=Ae[e];var r=[];for(var e in t)r.push(e+"="+t[e]);ke.strings=r}return ke.strings}var xe=[null,[],[]];function Oe(t,e){var r=xe[t];0===e||10===e?((1===t?w:b)(D(r,0)),r.length=0):r.push(e)}ut=i.InternalError=st(Error,"InternalError"),function(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);pt=t}(),dt=i.BindingError=st(Error,"BindingError"),Lt.prototype.isAliasOf=gt,Lt.prototype.clone=Ft,Lt.prototype.delete=Wt,Lt.prototype.isDeleted=It,Lt.prototype.deleteLater=Ut,i.getInheritedInstanceCount=$t,i.getLiveInheritedInstances=_t,i.flushPendingDeletes=kt,i.setDelayFunction=Ot,Xt.prototype.getPointee=Gt,Xt.prototype.destructor=qt,Xt.prototype.argPackAdvance=8,Xt.prototype.readValueFromPointer=et,Xt.prototype.deleteObject=Jt,Xt.prototype.fromWireType=Dt,te=i.UnboundTypeError=st(Error,"UnboundTypeError"),i.count_emval_handles=ue,i.get_first_emval=ce;var je,Se={D:function(t,e,r){throw new Z(t).init(e,r),t},e:function(t){var e=Q[t];delete Q[t];var r=e.rawConstructor,n=e.rawDestructor,o=e.fields;ft([t],o.map((t=>t.getterReturnType)).concat(o.map((t=>t.setterArgumentType))),(t=>{var i={};return o.forEach(((e,r)=>{var n=e.fieldName,a=t[r],s=e.getter,u=e.getterContext,c=t[r+o.length],f=e.setter,l=e.setterContext;i[n]={read:t=>a.fromWireType(s(u,t)),write:(t,e)=>{var r=[];f(l,t,c.toWireType(r,e)),tt(r)}}})),[{name:e.name,fromWireType:function(t){var e={};for(var r in i)e[r]=i[r].read(t);return n(t),e},toWireType:function(t,e){for(var o in i)if(!(o in e))throw new TypeError('Missing field: "'+o+'"');var a=r();for(o in i)i[o].write(a,e[o]);return null!==t&&t.push(n,a),a},argPackAdvance:8,readValueFromPointer:et,destructorFunction:n}]}))},t:function(t,e,r,n,o){},B:function(t,e,r,n,o){var i=lt(r);yt(t,{name:e=ht(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?n:o},argPackAdvance:8,readValueFromPointer:function(t){var n;if(1===r)n=C;else if(2===r)n=_;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+e);n=k}return this.fromWireType(n[t>>i])},destructorFunction:null})},r:function(t,e,r,n,o,a,s,u,c,f,l,p,h){l=ht(l),a=Qt(o,a),u&&(u=Qt(s,u)),f&&(f=Qt(c,f)),h=Qt(p,h);var d=it(l);!function(t,e,r){i.hasOwnProperty(t)?((void 0===r||void 0!==i[t].overloadTable&&void 0!==i[t].overloadTable[r])&&vt("Cannot register public name '"+t+"' twice"),Ht(i,t,t),i.hasOwnProperty(r)&&vt("Cannot register multiple overloads of a function with the same number of arguments ("+r+")!"),i[t].overloadTable[r]=e):(i[t]=e,void 0!==r&&(i[t].numArguments=r))}(d,(function(){re("Cannot construct "+l+" due to unbound types",[n])})),ft([t,e,r],n?[n]:[],(function(e){var r,o;e=e[0],o=n?(r=e.registeredClass).instancePrototype:Lt.prototype;var s=at(d,(function(){if(Object.getPrototypeOf(this)!==c)throw new dt("Use 'new' to construct "+l);if(void 0===p.constructor_body)throw new dt(l+" has no accessible constructor");var t=p.constructor_body[arguments.length];if(void 0===t)throw new dt("Tried to invoke ctor of "+l+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(p.constructor_body).toString()+") parameters instead!");return t.apply(this,arguments)})),c=Object.create(o,{constructor:{value:s}});s.prototype=c;var p=new Mt(l,s,c,h,r,a,u,f),v=new Xt(l,p,!0,!1,!1),y=new Xt(l+"*",p,!1,!1,!1),g=new Xt(l+" const*",p,!1,!0,!1);return Ct[t]={pointerType:y,constPointerType:g},function(t,e,r){i.hasOwnProperty(t)||ct("Replacing nonexistant public symbol"),void 0!==i[t].overloadTable&&void 0!==r?i[t].overloadTable[r]=e:(i[t]=e,i[t].argCount=r)}(d,s),[v,y,g]}))},q:function(t,e,r,n,o,i){var a;e>0||G(a);var s=ne(e,r);o=Qt(n,o),ft([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.registeredClass.constructor_body&&(t.registeredClass.constructor_body=[]),void 0!==t.registeredClass.constructor_body[e-1])throw new dt("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.registeredClass.constructor_body[e-1]=()=>{re("Cannot construct "+t.name+" due to unbound types",s)},ft([],s,(function(n){return n.splice(1,0,null),t.registeredClass.constructor_body[e-1]=oe(r,n,null,o,i),[]})),[]}))},b:function(t,e,r,n,o,i,a,s){var u=ne(r,n);e=ht(e),i=Qt(o,i),ft([],[t],(function(t){var n=(t=t[0]).name+"."+e;function o(){re("Cannot call "+n+" due to unbound types",u)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&t.registeredClass.pureVirtualFunctions.push(e);var c=t.registeredClass.instancePrototype,f=c[e];return void 0===f||void 0===f.overloadTable&&f.className!==t.name&&f.argCount===r-2?(o.argCount=r-2,o.className=t.name,c[e]=o):(Ht(c,e,n),c[e].overloadTable[r-2]=o),ft([],u,(function(o){var s=oe(n,o,t,i,a);return void 0===c[e].overloadTable?(s.argCount=r-2,c[e]=s):c[e].overloadTable[r-2]=s,[]})),[]}))},A:function(t,e){yt(t,{name:e=ht(e),fromWireType:function(t){var e=fe.toValue(t);return se(t),e},toWireType:function(t,e){return fe.toHandle(e)},argPackAdvance:8,readValueFromPointer:et,destructorFunction:null})},l:function(t,e,r){var n=lt(r);yt(t,{name:e=ht(e),fromWireType:function(t){return t},toWireType:function(t,e){return e},argPackAdvance:8,readValueFromPointer:pe(e,n),destructorFunction:null})},d:function(t,e,r,n,o){e=ht(e),-1===o&&(o=4294967295);var i=lt(r),a=t=>t;if(0===n){var s=32-8*r;a=t=>t<<s>>>s}var u=e.includes("unsigned");yt(t,{name:e,fromWireType:a,toWireType:u?function(t,e){return this.name,e>>>0}:function(t,e){return this.name,e},argPackAdvance:8,readValueFromPointer:he(e,i,0!==n),destructorFunction:null})},a:function(t,e,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(t){var e=x,r=e[t>>=2],o=e[t+1];return new n(T,o,r)}yt(t,{name:r=ht(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},k:function(t,e){var r="std::string"===(e=ht(e));yt(t,{name:e,fromWireType:function(t){var e,n=x[t>>2],o=t+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==$[s]){var u=R(i,s-i);void 0===e?e=u:(e+=String.fromCharCode(0),e+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode($[o+a]);e=c.join("")}return De(t),e},toWireType:function(t,e){var n;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var o="string"==typeof e;o||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||vt("Cannot pass non-string to std::string"),n=r&&o?function(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e}(e):e.length;var i=Ee(4+n+1),a=i+4;if(x[i>>2]=n,r&&o)F(e,a,n+1);else if(o)for(var s=0;s<n;++s){var u=e.charCodeAt(s);u>255&&(De(a),vt("String has UTF-16 code units that do not fit in 8 bits")),$[a+s]=u}else for(s=0;s<n;++s)$[a+s]=e[s];return null!==t&&t.push(De,i),i},argPackAdvance:8,readValueFromPointer:et,destructorFunction:function(t){De(t)}})},f:function(t,e,r){var n,o,i,a,s;r=ht(r),2===e?(n=ve,o=ye,a=ge,i=()=>A,s=1):4===e&&(n=me,o=we,a=be,i=()=>x,s=2),yt(t,{name:r,fromWireType:function(t){for(var r,o=x[t>>2],a=i(),u=t+4,c=0;c<=o;++c){var f=t+4+c*e;if(c==o||0==a[f>>s]){var l=n(u,f-u);void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),u=f+e}}return De(t),r},toWireType:function(t,n){"string"!=typeof n&&vt("Cannot pass non-string to C++ string type "+r);var i=a(n),u=Ee(4+i+e);return x[u>>2]=i>>s,o(n,u+4,i+e),null!==t&&t.push(De,u),u},argPackAdvance:8,readValueFromPointer:et,destructorFunction:function(t){De(t)}})},g:function(t,e,r,n,o,i){Q[t]={name:ht(e),rawConstructor:Qt(r,n),rawDestructor:Qt(o,i),fields:[]}},c:function(t,e,r,n,o,i,a,s,u,c){Q[t].fields.push({fieldName:ht(e),getterReturnType:r,getter:Qt(n,o),getterContext:i,setterArgumentType:a,setter:Qt(s,u),setterContext:c})},C:function(t,e){yt(t,{isVoid:!0,name:e=ht(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(t,e){}})},h:se,o:function(t){return 0===t?fe.toHandle(Te()):(t=void 0===(r=Pe[e=t])?ht(e):r,fe.toHandle(Te()[t]));var e,r},m:function(t){t>4&&(ae[t].refcount+=1)},n:function(t,e,r,n){t=fe.toValue(t);var o=$e[e];return o||(o=function(t){for(var e="",r=0;r<t;++r)e+=(0!==r?", ":"")+"arg"+r;var n="return function emval_allocator_"+t+"(constructor, argTypes, args) {\n var HEAPU32 = getMemory();\n";for(r=0;r<t;++r)n+="var argType"+r+" = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter "+r+"');\nvar arg"+r+" = argType"+r+".readValueFromPointer(args);\nargs += argType"+r+"['argPackAdvance'];\nargTypes += 4;\n";return n+="var obj = new constructor("+e+");\nreturn valueToHandle(obj);\n}\n",new Function("requireRegisteredType","Module","valueToHandle","getMemory",n)(Ce,i,fe.toHandle,(()=>x))}(e),$e[e]=o),o(t,r,n)},p:function(t,e){var r=(t=Ce(t,"_emval_take_value")).readValueFromPointer(e);return fe.toHandle(r)},i:function(){G("")},v:function(){return 2147483648},z:function(t,e,r){$.copyWithin(t,e,e+r)},u:function(t){var e,r,n=$.length,o=2147483648;if((t>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,t+100663296),_e(Math.min(o,(e=Math.max(t,a))+((r=65536)-e%r)%r)))return!0}return!1},w:function(t,e){var r=0;return ke().forEach((function(n,o){var i=e+r;x[t+4*o>>2]=i,function(t,e,r){for(var n=0;n<t.length;++n)C[e++>>0]=t.charCodeAt(n);r||(C[e>>0]=0)}(n,i),r+=n.length+1})),0},x:function(t,e){var r=ke();x[t>>2]=r.length;var n=0;return r.forEach((function(t){n+=t.length+1})),x[e>>2]=n,0},y:function(t){return 52},s:function(t,e,r,n,o){return 70},j:function(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=x[e>>2],s=x[e+4>>2];e+=8;for(var u=0;u<s;u++)Oe(t,$[a+u]);o+=s}return x[n>>2]=o,0}},Ee=(function(){var t={a:Se};function e(t,e){var r,n=t.exports;i.asm=n,W((P=i.asm.E).buffer),I=i.asm.G,r=i.asm.F,M.unshift(r),function(t){if(V--,i.monitorRunDependencies&&i.monitorRunDependencies(V),0==V&&(null!==z&&(clearInterval(z),z=null),N)){var e=N;N=null,e()}}()}function r(t){e(t.instance)}function n(e){return function(){if(!m&&(p||h)){if("function"==typeof fetch&&!J(U))return fetch(U,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+U+"'";return t.arrayBuffer()})).catch((function(){return X(U)}));if(s)return new Promise((function(t,e){s(U,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X(U)}))}().then((function(e){return WebAssembly.instantiate(e,t)})).then((function(t){return t})).then(e,(function(t){b("failed to asynchronously prepare wasm: "+t),G(t)}))}if(V++,i.monitorRunDependencies&&i.monitorRunDependencies(V),i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(t){b("Module.instantiateWasm callback failed with error: "+t),o(t)}(m||"function"!=typeof WebAssembly.instantiateStreaming||q(U)||J(U)||d||"function"!=typeof fetch?n(r):fetch(U,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(r,(function(t){return b("wasm streaming compile failed: "+t),b("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.F).apply(null,arguments)},i._malloc=function(){return(Ee=i._malloc=i.asm.H).apply(null,arguments)}),De=i._free=function(){return(De=i._free=i.asm.I).apply(null,arguments)},Re=i.___getTypeName=function(){return(Re=i.___getTypeName=i.asm.J).apply(null,arguments)},Fe=(i.__embind_initialize_bindings=function(){return(i.__embind_initialize_bindings=i.asm.K).apply(null,arguments)},i.stackSave=function(){return(Fe=i.stackSave=i.asm.L).apply(null,arguments)}),We=i.stackRestore=function(){return(We=i.stackRestore=i.asm.M).apply(null,arguments)},Ie=i.stackAlloc=function(){return(Ie=i.stackAlloc=i.asm.N).apply(null,arguments)},Ue=i.___cxa_is_pointer_type=function(){return(Ue=i.___cxa_is_pointer_type=i.asm.O).apply(null,arguments)};function Le(t){function r(){je||(je=!0,i.calledRun=!0,S||(K(M),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)t=i.postRun.shift(),B.unshift(t);var t;K(B)}()))}t=t||f,V>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)t=i.preRun.shift(),H.unshift(t);var t;K(H)}(),V>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}if(i.dynCall_iji=function(){return(i.dynCall_iji=i.asm.P).apply(null,arguments)},i.dynCall_jji=function(){return(i.dynCall_jji=i.asm.Q).apply(null,arguments)},i.dynCall_iiji=function(){return(i.dynCall_iiji=i.asm.R).apply(null,arguments)},i.dynCall_jiji=function(){return(i.dynCall_jiji=i.asm.S).apply(null,arguments)},i.ccall=function(t,e,r,n,o){var a={string:t=>{var e=0;if(null!=t&&0!==t){var r=1+(t.length<<2);F(t,e=Ie(r),r)}return e},array:t=>{var e=Ie(t.length);return function(t,e){C.set(t,e)}(t,e),e}},s=function(t){return i["_"+t]}(t),u=[],c=0;if(n)for(var f=0;f<n.length;f++){var l=a[r[f]];l?(0===c&&(c=Fe()),u[f]=l(n[f])):u[f]=n[f]}var p=s.apply(null,u);return p=function(t){return 0!==c&&We(c),function(t){return"string"===e?R(t):"boolean"===e?Boolean(t):t}(t)}(p)},N=function t(){je||Le(),je||(N=t)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Le(),t.ready});t.exports=o},430:(t,e,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,o;(t=void 0!==(t=t||{})?t:{}).ready=new Promise((function(t,r){e=t,o=r}));var i,a,s,u=Object.assign({},t),c=[],f="object"==typeof window,l="function"==typeof importScripts,p="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,h="";if(p){var d=r(280),v=r(103);h=l?v.dirname(h)+"/":"//",i=(t,e)=>(t=G(t)?new URL(t):v.normalize(t),d.readFileSync(t,e?void 0:"utf8")),s=t=>{var e=i(t,!0);return e.buffer||(e=new Uint8Array(e)),e},a=(t,e,r)=>{t=G(t)?new URL(t):v.normalize(t),d.readFile(t,(function(t,n){t?r(t):e(n.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),c=process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof J))throw t})),process.on("unhandledRejection",(function(t){throw t})),t.inspect=function(){return"[Emscripten Module object]"}}else(f||l)&&(l?h=self.location.href:"undefined"!=typeof document&&document.currentScript&&(h=document.currentScript.src),n&&(h=n),h=0!==h.indexOf("blob:")?h.substr(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1):"",i=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},l&&(s=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),a=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)});var y,g=t.print||console.log.bind(console),m=t.printErr||console.warn.bind(console);Object.assign(t,u),u=null,t.arguments&&(c=t.arguments),t.thisProgram&&t.thisProgram,t.quit&&t.quit,t.wasmBinary&&(y=t.wasmBinary);var w;t.noExitRuntime;"object"!=typeof WebAssembly&&z("no native wasm support detected");var b,P,T,C,$,_,A,k,x,O=!1,j="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function S(t,e,r){for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&j)return j.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var u=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&t[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function E(t,e){return t?S(T,t,e):""}function D(t,e,r){return function(t,e,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-o}(t,T,e,r)}function R(e){b=e,t.HEAP8=P=new Int8Array(e),t.HEAP16=C=new Int16Array(e),t.HEAP32=_=new Int32Array(e),t.HEAPU8=T=new Uint8Array(e),t.HEAPU16=$=new Uint16Array(e),t.HEAPU32=A=new Uint32Array(e),t.HEAPF32=k=new Float32Array(e),t.HEAPF64=x=new Float64Array(e)}t.INITIAL_MEMORY;var F,W,I,U=[],L=[],H=[],M=0,B=null,V=null;function z(e){t.onAbort&&t.onAbort(e),m(e="Aborted("+e+")"),O=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw o(r),r}function N(t){return t.startsWith("data:application/octet-stream;base64,")}function G(t){return t.startsWith("file://")}function q(t){try{if(t==W&&y)return new Uint8Array(y);if(s)return s(t);throw"both async and sync fetching of the wasm failed"}catch(t){z(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function X(e){for(;e.length>0;)e.shift()(t)}N(W="openjphjs.wasm")||(I=W,W=t.locateFile?t.locateFile(I,h):h+I);var Y=[],K=0,Z=[];function Q(t){var e=Z[t];return e||(t>=Z.length&&(Z.length=t+1),Z[t]=e=F.get(t)),e}function tt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){A[this.ptr+4>>2]=t},this.get_type=function(){return A[this.ptr+4>>2]},this.set_destructor=function(t){A[this.ptr+8>>2]=t},this.get_destructor=function(){return A[this.ptr+8>>2]},this.set_refcount=function(t){_[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,P[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=P[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,P[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=P[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=_[this.ptr>>2];_[this.ptr>>2]=t+1},this.release_ref=function(){var t=_[this.ptr>>2];return _[this.ptr>>2]=t-1,1===t},this.set_adjusted_ptr=function(t){A[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return A[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Ie(this.get_type()))return A[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}var et={};function rt(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function nt(t){return this.fromWireType(_[t>>2])}var ot={},it={},at={};function st(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=48&&e<=57?"_"+t:t}function ut(t,e){return t=st(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function ct(t,e){var r=ut(e,(function(t){this.name=e,this.message=t;var r=new Error(t).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var ft=void 0;function lt(t){throw new ft(t)}function pt(t,e,r){function n(e){var n=r(e);n.length!==t.length&&lt("Mismatched type converter count");for(var o=0;o<t.length;++o)mt(t[o],n[o])}t.forEach((function(t){at[t]=e}));var o=new Array(e.length),i=[],a=0;e.forEach(((t,e)=>{it.hasOwnProperty(t)?o[e]=it[t]:(i.push(t),ot.hasOwnProperty(t)||(ot[t]=[]),ot[t].push((()=>{o[e]=it[t],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function ht(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var dt=void 0;function vt(t){for(var e="",r=t;T[r];)e+=dt[T[r++]];return e}var yt=void 0;function gt(t){throw new yt(t)}function mt(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=e.name;if(t||gt('type "'+n+'" must have a positive integer typeid pointer'),it.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;gt("Cannot register type '"+n+"' twice")}if(it[t]=e,delete at[t],ot.hasOwnProperty(t)){var o=ot[t];delete ot[t],o.forEach((t=>t()))}}function wt(t){if(!(this instanceof Mt))return!1;if(!(t instanceof Mt))return!1;for(var e=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=t.$$.ptrType.registeredClass,o=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return e===n&&r===o}function bt(t){gt(t.$$.ptrType.registeredClass.name+" instance already deleted")}var Pt=!1;function Tt(t){}function Ct(t){t.count.value-=1,0===t.count.value&&function(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}(t)}function $t(t,e,r){if(e===r)return t;if(void 0===r.baseClass)return null;var n=$t(t,e,r.baseClass);return null===n?null:r.downcast(n)}var _t={};function At(){return Object.keys(Et).length}function kt(){var t=[];for(var e in Et)Et.hasOwnProperty(e)&&t.push(Et[e]);return t}var xt=[];function Ot(){for(;xt.length;){var t=xt.pop();t.$$.deleteScheduled=!1,t.delete()}}var jt=void 0;function St(t){jt=t,xt.length&&jt&&jt(Ot)}var Et={};function Dt(t,e){return e=function(t,e){for(void 0===e&&gt("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}(t,e),Et[e]}function Rt(t,e){return e.ptrType&&e.ptr||lt("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&&lt("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Wt(Object.create(t,{$$:{value:e}}))}function Ft(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Dt(this.registeredClass,e);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function o(){return this.isSmartPointer?Rt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Rt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i,a=this.registeredClass.getActualType(e),s=_t[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=$t(e,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?Rt(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:t}):Rt(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}function Wt(t){return"undefined"==typeof FinalizationRegistry?(Wt=t=>t,t):(Pt=new FinalizationRegistry((t=>{Ct(t.$$)})),Wt=t=>{var e=t.$$;if(e.smartPtr){var r={$$:e};Pt.register(t,r,t)}return t},Tt=t=>Pt.unregister(t),Wt(t))}function It(){if(this.$$.ptr||bt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t,e=Wt(Object.create(Object.getPrototypeOf(this),{$$:{value:(t=this.$$,{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType})}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function Ut(){this.$$.ptr||bt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&gt("Object already scheduled for deletion"),Tt(this),Ct(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Lt(){return!this.$$.ptr}function Ht(){return this.$$.ptr||bt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&gt("Object already scheduled for deletion"),xt.push(this),1===xt.length&&jt&&jt(Ot),this.$$.deleteScheduled=!0,this}function Mt(){}function Bt(t,e,r){if(void 0===t[e].overloadTable){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||gt("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].overloadTable+")!"),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}}function Vt(e,r,n){t.hasOwnProperty(e)?((void 0===n||void 0!==t[e].overloadTable&&void 0!==t[e].overloadTable[n])&&gt("Cannot register public name '"+e+"' twice"),Bt(t,e,e),t.hasOwnProperty(n)&&gt("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),t[e].overloadTable[n]=r):(t[e]=r,void 0!==n&&(t[e].numArguments=n))}function zt(t,e,r,n,o,i,a,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function Nt(t,e,r){for(;e!==r;)e.upcast||gt("Expected null or instance of "+r.name+", got an instance of "+e.name),t=e.upcast(t),e=e.baseClass;return t}function Gt(t,e){if(null===e)return this.isReference&&gt("null is not a valid "+this.name),0;e.$$||gt('Cannot pass "'+he(e)+'" as a '+this.name),e.$$.ptr||gt("Cannot pass deleted object as a pointer of type "+this.name);var r=e.$$.ptrType.registeredClass;return Nt(e.$$.ptr,r,this.registeredClass)}function qt(t,e){var r;if(null===e)return this.isReference&&gt("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,r),r):0;e.$$||gt('Cannot pass "'+he(e)+'" as a '+this.name),e.$$.ptr||gt("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&e.$$.ptrType.isConst&&gt("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);var n=e.$$.ptrType.registeredClass;if(r=Nt(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&gt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:gt("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var o=e.clone();r=this.rawShare(r,pe.toHandle((function(){o.delete()}))),null!==t&&t.push(this.rawDestructor,r)}break;default:gt("Unsupporting sharing policy")}return r}function Jt(t,e){if(null===e)return this.isReference&&gt("null is not a valid "+this.name),0;e.$$||gt('Cannot pass "'+he(e)+'" as a '+this.name),e.$$.ptr||gt("Cannot pass deleted object as a pointer of type "+this.name),e.$$.ptrType.isConst&&gt("Cannot convert argument of type "+e.$$.ptrType.name+" to parameter type "+this.name);var r=e.$$.ptrType.registeredClass;return Nt(e.$$.ptr,r,this.registeredClass)}function Xt(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function Yt(t){this.rawDestructor&&this.rawDestructor(t)}function Kt(t){null!==t&&t.delete()}function Zt(t,e,r,n,o,i,a,s,u,c,f){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=f,o||void 0!==e.baseClass?this.toWireType=qt:n?(this.toWireType=Gt,this.destructorFunction=null):(this.toWireType=Jt,this.destructorFunction=null)}function Qt(e,r,n){t.hasOwnProperty(e)||lt("Replacing nonexistant public symbol"),void 0!==t[e].overloadTable&&void 0!==n?t[e].overloadTable[n]=r:(t[e]=r,t[e].argCount=n)}function te(e,r,n){return e.includes("j")?function(e,r,n){var o=t["dynCall_"+e];return n&&n.length?o.apply(null,[r].concat(n)):o.call(null,r)}(e,r,n):Q(r).apply(null,n)}function ee(t,e){var r,n,o,i=(t=vt(t)).includes("j")?(r=t,n=e,o=[],function(){return o.length=0,Object.assign(o,arguments),te(r,n,o)}):Q(e);return"function"!=typeof i&&gt("unknown function pointer with signature "+t+": "+e),i}var re=void 0;function ne(t){var e=Se(t),r=vt(e);return je(e),r}function oe(t,e){var r=[],n={};throw e.forEach((function t(e){n[e]||it[e]||(at[e]?at[e].forEach(t):(r.push(e),n[e]=!0))})),new re(t+": "+r.map(ne).join([", "]))}function ie(t,e){for(var r=[],n=0;n<t;n++)r.push(A[e+4*n>>2]);return r}function ae(t,e,r,n,o){var i=e.length;i<2&&gt("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==e[1]&&null!==r,s=!1,u=1;u<e.length;++u)if(null!==e[u]&&void 0===e[u].destructorFunction){s=!0;break}var c="void"!==e[0].name,f="",l="";for(u=0;u<i-2;++u)f+=(0!==u?", ":"")+"arg"+u,l+=(0!==u?", ":"")+"arg"+u+"Wired";var p="return function "+st(t)+"("+f+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(p+="var destructors = [];\n");var h=s?"destructors":"null",d=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],v=[gt,n,o,rt,e[0],e[1]];for(a&&(p+="var thisWired = classParam.toWireType("+h+", this);\n"),u=0;u<i-2;++u)p+="var arg"+u+"Wired = argType"+u+".toWireType("+h+", arg"+u+"); // "+e[u+2].name+"\n",d.push("argType"+u),v.push(e[u+2]);if(a&&(l="thisWired"+(l.length>0?", ":"")+l),p+=(c?"var rv = ":"")+"invoker(fn"+(l.length>0?", ":"")+l+");\n",s)p+="runDestructors(destructors);\n";else for(u=a?1:2;u<e.length;++u){var y=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==e[u].destructorFunction&&(p+=y+"_dtor("+y+"); // "+e[u].name+"\n",d.push(y+"_dtor"),v.push(e[u].destructorFunction))}return c&&(p+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),p+="}\n",d.push(p),function(t,e){if(!(t instanceof Function))throw new TypeError("new_ called with constructor type "+typeof t+" which is not a function");var r=ut(t.name||"unknownFunctionName",(function(){}));r.prototype=t.prototype;var n=new r,o=t.apply(n,e);return o instanceof Object?o:n}(Function,d).apply(null,v)}var se=[],ue=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function ce(t){t>4&&0==--ue[t].refcount&&(ue[t]=void 0,se.push(t))}function fe(){for(var t=0,e=5;e<ue.length;++e)void 0!==ue[e]&&++t;return t}function le(){for(var t=5;t<ue.length;++t)if(void 0!==ue[t])return ue[t];return null}var pe={toValue:t=>(t||gt("Cannot use deleted val. handle = "+t),ue[t].value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=se.length?se.pop():ue.length;return ue[e]={refcount:1,value:t},e}}};function he(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function de(t,e){switch(e){case 2:return function(t){return this.fromWireType(k[t>>2])};case 3:return function(t){return this.fromWireType(x[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function ve(t,e,r){switch(e){case 0:return r?function(t){return P[t]}:function(t){return T[t]};case 1:return r?function(t){return C[t>>1]}:function(t){return $[t>>1]};case 2:return r?function(t){return _[t>>2]}:function(t){return A[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}var ye="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function ge(t,e){for(var r=t,n=r>>1,o=n+e/2;!(n>=o)&&$[n];)++n;if((r=n<<1)-t>32&&ye)return ye.decode(T.subarray(t,r));for(var i="",a=0;!(a>=e/2);++a){var s=C[t+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function me(t,e,r){if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=e,o=(r-=2)<2*t.length?r/2:t.length,i=0;i<o;++i){var a=t.charCodeAt(i);C[e>>1]=a,e+=2}return C[e>>1]=0,e-n}function we(t){return 2*t.length}function be(t,e){for(var r=0,n="";!(r>=e/4);){var o=_[t+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 Pe(t,e,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=e,o=n+r-4,i=0;i<t.length;++i){var a=t.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),_[e>>2]=a,(e+=4)+4>o)break}return _[e>>2]=0,e-n}function Te(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e}function Ce(t){try{return w.grow(t-b.byteLength+65535>>>16),R(w.buffer),1}catch(t){}}var $e=[null,[],[]];function _e(t,e){var r=$e[t];0===e||10===e?((1===t?g:m)(S(r,0)),r.length=0):r.push(e)}ft=t.InternalError=ct(Error,"InternalError"),function(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);dt=t}(),yt=t.BindingError=ct(Error,"BindingError"),Mt.prototype.isAliasOf=wt,Mt.prototype.clone=It,Mt.prototype.delete=Ut,Mt.prototype.isDeleted=Lt,Mt.prototype.deleteLater=Ht,t.getInheritedInstanceCount=At,t.getLiveInheritedInstances=kt,t.flushPendingDeletes=Ot,t.setDelayFunction=St,Zt.prototype.getPointee=Xt,Zt.prototype.destructor=Yt,Zt.prototype.argPackAdvance=8,Zt.prototype.readValueFromPointer=nt,Zt.prototype.deleteObject=Kt,Zt.prototype.fromWireType=Ft,re=t.UnboundTypeError=ct(Error,"UnboundTypeError"),t.count_emval_handles=fe,t.get_first_emval=le;var Ae,ke={M:function(t){var e=new tt(t);return e.get_caught()||e.set_caught(!0),e.set_rethrown(!1),Y.push(e),function(t){t.add_ref()}(e),e.get_exception_ptr()},v:function(){_setThrew(0),function(t){if(t.release_ref()&&!t.get_rethrown()){var e=t.get_destructor();e&&Q(e)(t.excPtr),Oe(t.excPtr)}}(Y.pop()),K=0},c:function(){var t=K;if(!t)return Ee(0),0;var e=new tt(t);e.set_adjusted_ptr(t);var r=e.get_type();if(!r)return Ee(0),t;for(var n=0;n<arguments.length;n++){var o=arguments[n];if(0===o||o===r)break;var i=e.ptr+16;if(We(o,r,i))return Ee(o),t}return Ee(r),t},j:function(){var t=K;if(!t)return Ee(0),0;var e=new tt(t);e.set_adjusted_ptr(t);var r=e.get_type();if(!r)return Ee(0),t;for(var n=0;n<arguments.length;n++){var o=arguments[n];if(0===o||o===r)break;var i=e.ptr+16;if(We(o,r,i))return Ee(o),t}return Ee(r),t},i:function(t,e,r){throw new tt(t).init(e,r),K=t,t},f:function(t){throw K||(K=t),t},B:function(t){var e=et[t];delete et[t];var r=e.rawConstructor,n=e.rawDestructor,o=e.fields;pt([t],o.map((t=>t.getterReturnType)).concat(o.map((t=>t.setterArgumentType))),(t=>{var i={};return o.forEach(((e,r)=>{var n=e.fieldName,a=t[r],s=e.getter,u=e.getterContext,c=t[r+o.length],f=e.setter,l=e.setterContext;i[n]={read:t=>a.fromWireType(s(u,t)),write:(t,e)=>{var r=[];f(l,t,c.toWireType(r,e)),rt(r)}}})),[{name:e.name,fromWireType:function(t){var e={};for(var r in i)e[r]=i[r].read(t);return n(t),e},toWireType:function(t,e){for(var o in i)if(!(o in e))throw new TypeError('Missing field: "'+o+'"');var a=r();for(o in i)i[o].write(a,e[o]);return null!==t&&t.push(n,a),a},argPackAdvance:8,readValueFromPointer:nt,destructorFunction:n}]}))},E:function(t,e,r,n,o){},J:function(t,e,r,n,o){var i=ht(r);mt(t,{name:e=vt(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?n:o},argPackAdvance:8,readValueFromPointer:function(t){var n;if(1===r)n=P;else if(2===r)n=C;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+e);n=_}return this.fromWireType(n[t>>i])},destructorFunction:null})},z:function(t,e,r,n,o,i,a,s,u,c,f,l,p){f=vt(f),i=ee(o,i),s&&(s=ee(a,s)),c&&(c=ee(u,c)),p=ee(l,p);var h=st(f);Vt(h,(function(){oe("Cannot construct "+f+" due to unbound types",[n])})),pt([t,e,r],n?[n]:[],(function(e){var r,o;e=e[0],o=n?(r=e.registeredClass).instancePrototype:Mt.prototype;var a=ut(h,(function(){if(Object.getPrototypeOf(this)!==u)throw new yt("Use 'new' to construct "+f);if(void 0===l.constructor_body)throw new yt(f+" has no accessible constructor");var t=l.constructor_body[arguments.length];if(void 0===t)throw new yt("Tried to invoke ctor of "+f+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(l.constructor_body).toString()+") parameters instead!");return t.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var l=new zt(f,a,u,p,r,i,s,c),d=new Zt(f,l,!0,!1,!1),v=new Zt(f+"*",l,!1,!1,!1),y=new Zt(f+" const*",l,!1,!0,!1);return _t[t]={pointerType:v,constPointerType:y},Qt(h,a),[d,v,y]}))},y:function(t,e,r,n,o,i){var a;e>0||z(a);var s=ie(e,r);o=ee(n,o),pt([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.registeredClass.constructor_body&&(t.registeredClass.constructor_body=[]),void 0!==t.registeredClass.constructor_body[e-1])throw new yt("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.registeredClass.constructor_body[e-1]=()=>{oe("Cannot construct "+t.name+" due to unbound types",s)},pt([],s,(function(n){return n.splice(1,0,null),t.registeredClass.constructor_body[e-1]=ae(r,n,null,o,i),[]})),[]}))},a:function(t,e,r,n,o,i,a,s){var u=ie(r,n);e=vt(e),i=ee(o,i),pt([],[t],(function(t){var n=(t=t[0]).name+"."+e;function o(){oe("Cannot call "+n+" due to unbound types",u)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&t.registeredClass.pureVirtualFunctions.push(e);var c=t.registeredClass.instancePrototype,f=c[e];return void 0===f||void 0===f.overloadTable&&f.className!==t.name&&f.argCount===r-2?(o.argCount=r-2,o.className=t.name,c[e]=o):(Bt(c,e,n),c[e].overloadTable[r-2]=o),pt([],u,(function(o){var s=ae(n,o,t,i,a);return void 0===c[e].overloadTable?(s.argCount=r-2,c[e]=s):c[e].overloadTable[r-2]=s,[]})),[]}))},I:function(t,e){mt(t,{name:e=vt(e),fromWireType:function(t){var e=pe.toValue(t);return ce(t),e},toWireType:function(t,e){return pe.toHandle(e)},argPackAdvance:8,readValueFromPointer:nt,destructorFunction:null})},u:function(t,e,r){var n=ht(r);mt(t,{name:e=vt(e),fromWireType:function(t){return t},toWireType:function(t,e){return e},argPackAdvance:8,readValueFromPointer:de(e,n),destructorFunction:null})},o:function(t,e,r,n,o,i){var a=ie(e,r);t=vt(t),o=ee(n,o),Vt(t,(function(){oe("Cannot call "+t+" due to unbound types",a)}),e-1),pt([],a,(function(r){var n=[r[0],null].concat(r.slice(1));return Qt(t,ae(t,n,null,o,i),e-1),[]}))},h:function(t,e,r,n,o){e=vt(e),-1===o&&(o=4294967295);var i=ht(r),a=t=>t;if(0===n){var s=32-8*r;a=t=>t<<s>>>s}var u=e.includes("unsigned");mt(t,{name:e,fromWireType:a,toWireType:u?function(t,e){return this.name,e>>>0}:function(t,e){return this.name,e},argPackAdvance:8,readValueFromPointer:ve(e,i,0!==n),destructorFunction:null})},d:function(t,e,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(t){var e=A,r=e[t>>=2],o=e[t+1];return new n(b,o,r)}mt(t,{name:r=vt(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},t:function(t,e){var r="std::string"===(e=vt(e));mt(t,{name:e,fromWireType:function(t){var e,n=A[t>>2],o=t+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==T[s]){var u=E(i,s-i);void 0===e?e=u:(e+=String.fromCharCode(0),e+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(T[o+a]);e=c.join("")}return je(t),e},toWireType:function(t,e){var n;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var o="string"==typeof e;o||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||gt("Cannot pass non-string to std::string"),n=r&&o?function(t){for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e}(e):e.length;var i=xe(4+n+1),a=i+4;if(A[i>>2]=n,r&&o)D(e,a,n+1);else if(o)for(var s=0;s<n;++s){var u=e.charCodeAt(s);u>255&&(je(a),gt("String has UTF-16 code units that do not fit in 8 bits")),T[a+s]=u}else for(s=0;s<n;++s)T[a+s]=e[s];return null!==t&&t.push(je,i),i},argPackAdvance:8,readValueFromPointer:nt,destructorFunction:function(t){je(t)}})},q:function(t,e,r){var n,o,i,a,s;r=vt(r),2===e?(n=ge,o=me,a=we,i=()=>$,s=1):4===e&&(n=be,o=Pe,a=Te,i=()=>A,s=2),mt(t,{name:r,fromWireType:function(t){for(var r,o=A[t>>2],a=i(),u=t+4,c=0;c<=o;++c){var f=t+4+c*e;if(c==o||0==a[f>>s]){var l=n(u,f-u);void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),u=f+e}}return je(t),r},toWireType:function(t,n){"string"!=typeof n&&gt("Cannot pass non-string to C++ string type "+r);var i=a(n),u=xe(4+i+e);return A[u>>2]=i>>s,o(n,u+4,i+e),null!==t&&t.push(je,u),u},argPackAdvance:8,readValueFromPointer:nt,destructorFunction:function(t){je(t)}})},p:function(t,e,r,n,o,i){et[t]={name:vt(e),rawConstructor:ee(r,n),rawDestructor:ee(o,i),fields:[]}},C:function(t,e,r,n,o,i,a,s,u,c){et[t].fields.push({fieldName:vt(e),getterReturnType:r,getter:ee(n,o),getterContext:i,setterArgumentType:a,setter:ee(s,u),setterContext:c})},K:function(t,e){mt(t,{isVoid:!0,name:e=vt(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(t,e){}})},O:ce,P:function(t){t>4&&(ue[t].refcount+=1)},n:function(t,e){var r,n,o;n="_emval_take_value",void 0===(o=it[r=t])&&gt(n+" has unknown type "+ne(r));var i=(t=o).readValueFromPointer(e);return pe.toHandle(i)},r:function(){z("")},H:function(t,e,r){T.copyWithin(t,e,e+r)},F:function(t){var e,r,n=T.length,o=2147483648;if((t>>>=0)>o)return!1;for(var i=1;i<=4;i*=2){var a=n*(1+.2/i);if(a=Math.min(a,t+100663296),Ce(Math.min(o,(e=Math.max(t,a))+((r=65536)-e%r)%r)))return!0}return!1},G:function(t){return 52},D:function(t,e,r,n,o){return 70},s:function(t,e,r,n){for(var o=0,i=0;i<r;i++){var a=A[e>>2],s=A[e+4>>2];e+=8;for(var u=0;u<s;u++)_e(t,T[a+u]);o+=s}return A[n>>2]=o,0},b:function(t,e){var r=De();try{return Q(t)(e)}catch(t){if(Re(r),t!==t+0)throw t;_setThrew(1,0)}},A:function(t,e,r){var n=De();try{return Q(t)(e,r)}catch(t){if(Re(n),t!==t+0)throw t;_setThrew(1,0)}},w:function(t,e,r,n){var o=De();try{return Q(t)(e,r,n)}catch(t){if(Re(o),t!==t+0)throw t;_setThrew(1,0)}},e:function(t,e){var r=De();try{Q(t)(e)}catch(t){if(Re(r),t!==t+0)throw t;_setThrew(1,0)}},k:function(t,e,r){var n=De();try{Q(t)(e,r)}catch(t){if(Re(n),t!==t+0)throw t;_setThrew(1,0)}},l:function(t,e,r,n){var o=De();try{Q(t)(e,r,n)}catch(t){if(Re(o),t!==t+0)throw t;_setThrew(1,0)}},x:function(t,e,r,n,o){var i=De();try{Q(t)(e,r,n,o)}catch(t){if(Re(i),t!==t+0)throw t;_setThrew(1,0)}},L:function(t,e,r,n,o,i,a){var s=De();try{Q(t)(e,r,n,o,i,a)}catch(t){if(Re(s),t!==t+0)throw t;_setThrew(1,0)}},m:function(t,e,r,n,o,i,a,s){var u=De();try{Q(t)(e,r,n,o,i,a,s)}catch(t){if(Re(u),t!==t+0)throw t;_setThrew(1,0)}},g:function(t,e,r,n,o,i,a,s,u,c,f){var l=De();try{Q(t)(e,r,n,o,i,a,s,u,c,f)}catch(t){if(Re(l),t!==t+0)throw t;_setThrew(1,0)}},N:function(t){return t}},xe=(function(){var e={a:ke};function r(e,r){var n,o=e.exports;t.asm=o,R((w=t.asm.Q).buffer),F=t.asm.U,n=t.asm.R,L.unshift(n),function(e){if(M--,t.monitorRunDependencies&&t.monitorRunDependencies(M),0==M&&(null!==B&&(clearInterval(B),B=null),V)){var r=V;V=null,r()}}()}function n(t){r(t.instance)}function i(t){return function(){if(!y&&(f||l)){if("function"==typeof fetch&&!G(W))return fetch(W,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+W+"'";return t.arrayBuffer()})).catch((function(){return q(W)}));if(a)return new Promise((function(t,e){a(W,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return q(W)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(t){return t})).then(t,(function(t){m("failed to asynchronously prepare wasm: "+t),z(t)}))}if(M++,t.monitorRunDependencies&&t.monitorRunDependencies(M),t.instantiateWasm)try{return t.instantiateWasm(e,r)}catch(t){m("Module.instantiateWasm callback failed with error: "+t),o(t)}(y||"function"!=typeof WebAssembly.instantiateStreaming||N(W)||G(W)||p||"function"!=typeof fetch?i(n):fetch(W,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(t){return m("wasm streaming compile failed: "+t),m("falling back to ArrayBuffer instantiation"),i(n)}))}))).catch(o)}(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.R).apply(null,arguments)},t._malloc=function(){return(xe=t._malloc=t.asm.S).apply(null,arguments)}),Oe=t.___cxa_free_exception=function(){return(Oe=t.___cxa_free_exception=t.asm.T).apply(null,arguments)},je=t._free=function(){return(je=t._free=t.asm.V).apply(null,arguments)},Se=t.___getTypeName=function(){return(Se=t.___getTypeName=t.asm.W).apply(null,arguments)},Ee=(t.__embind_initialize_bindings=function(){return(t.__embind_initialize_bindings=t.asm.X).apply(null,arguments)},t.setTempRet0=function(){return(Ee=t.setTempRet0=t.asm.Y).apply(null,arguments)}),De=t.stackSave=function(){return(De=t.stackSave=t.asm.Z).apply(null,arguments)},Re=t.stackRestore=function(){return(Re=t.stackRestore=t.asm._).apply(null,arguments)},Fe=t.stackAlloc=function(){return(Fe=t.stackAlloc=t.asm.$).apply(null,arguments)},We=t.___cxa_can_catch=function(){return(We=t.___cxa_can_catch=t.asm.aa).apply(null,arguments)},Ie=t.___cxa_is_pointer_type=function(){return(Ie=t.___cxa_is_pointer_type=t.asm.ba).apply(null,arguments)};function Ue(r){function n(){Ae||(Ae=!0,t.calledRun=!0,O||(X(L),e(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),function(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)e=t.postRun.shift(),H.unshift(e);var e;X(H)}()))}r=r||c,M>0||(function(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)e=t.preRun.shift(),U.unshift(e);var e;X(U)}(),M>0||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),n()}),1)):n()))}if(t.dynCall_ji=function(){return(t.dynCall_ji=t.asm.ca).apply(null,arguments)},t.dynCall_iiji=function(){return(t.dynCall_iiji=t.asm.da).apply(null,arguments)},t.dynCall_jiji=function(){return(t.dynCall_jiji=t.asm.ea).apply(null,arguments)},t.ccall=function(e,r,n,o,i){var a={string:t=>{var e=0;if(null!=t&&0!==t){var r=1+(t.length<<2);D(t,e=Fe(r),r)}return e},array:t=>{var e=Fe(t.length);return function(t,e){P.set(t,e)}(t,e),e}},s=function(e){return t["_"+e]}(e),u=[],c=0;if(o)for(var f=0;f<o.length;f++){var l=a[n[f]];l?(0===c&&(c=De()),u[f]=l(o[f])):u[f]=o[f]}var p=s.apply(null,u);return p=function(t){return 0!==c&&Re(c),function(t){return"string"===r?E(t):"boolean"===r?Boolean(t):t}(t)}(p)},V=function t(){Ae||Ue(),Ae||(V=t)},t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return Ue(),t.ready});t.exports=o},602:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new x(n||[]);return i._invoke=function(t,e,r){var n=l;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=_(a,r);if(s){if(s===v)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=f(t,e,r);if("normal"===u.type){if(n=r.done?d:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l="suspendedStart",p="suspendedYield",h="executing",d="completed",v={};function y(){}function g(){}function m(){}var w={};u(w,i,(function(){return this}));var b=Object.getPrototypeOf,P=b&&b(b(O([])));P&&P!==r&&n.call(P,i)&&(w=P);var T=m.prototype=y.prototype=Object.create(w);function C(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function $(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function _(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,_(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=f(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function O(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:j}}function j(){return{value:e,done:!0}}return g.prototype=m,u(T,"constructor",m),u(m,"constructor",g),g.displayName=u(m,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,u(t,s,"GeneratorFunction")),t.prototype=Object.create(T),t},t.awrap=function(t){return{__await:t}},C($.prototype),u($.prototype,a,(function(){return this})),t.AsyncIterator=$,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new $(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},C(T),u(T,s,"Generator"),u(T,i,(function(){return this})),u(T,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=O,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(k),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:O(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},69:(t,e,r)=>{"use strict";t.exports=r.p+"5004fdc02f329ce53b69.wasm"},427:(t,e,r)=>{"use strict";t.exports=r.p+"c22b37c3488e1d6c3aa4.wasm"},699:(t,e,r)=>{"use strict";t.exports=r.p+"65916ef3def695744bda.wasm"},813:(t,e,r)=>{"use strict";t.exports=r.p+"75788f12450d4c5ed494.wasm"},716:()=>{},401:()=>{},491:()=>{},33:()=>{},261:()=>{},926:()=>{},280:()=>{},103:()=>{}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return r[t].call(i.exports,i,i.exports,o),i.exports}o.m=r,o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,o.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var i=Object.create(null);o.r(i);var a={};t=t||[null,e({}),e([]),e(e)];for(var s=2&n&&r;"object"==typeof s&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach((t=>a[t]=()=>r[t]));return a.default=()=>r,o.d(i,a),i},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.f={},o.e=t=>Promise.all(Object.keys(o.f).reduce(((e,r)=>(o.f[r](t,e),e)),[])),o.u=t=>t+".min.worker.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;o.g.importScripts&&(t=o.g.location+"");var e=o.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t})(),(()=>{var t={362:1};o.f.i=(e,r)=>{t[e]||importScripts(o.p+o.u(e))};var e=self.webpackChunk_name_=self.webpackChunk_name_||[],r=e.push.bind(e);e.push=e=>{var[n,i,a]=e;for(var s in i)o.o(i,s)&&(o.m[s]=i[s]);for(a&&a(o);n.length;)t[n.pop()]=1;r(e)}})(),(()=>{"use strict";function t(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function e(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=e.apply(r,n);function s(e){t(a,o,i,s,u,"next",e)}function u(e){t(a,o,i,s,u,"throw",e)}s(void 0)}))}}var r,n=o(945),i=o.n(n),a={},s=!1;function u(t){if(!s){if(r=t.config,self.registerTaskHandler=c,t.config.webWorkerTaskPaths)for(var e=0;e<t.config.webWorkerTaskPaths.length;e++)self.importScripts(t.config.webWorkerTaskPaths[e]);Object.keys(a).forEach((function(t){a[t].initialize(r.taskConfiguration)})),self.postMessage({taskType:"initialize",status:"success",result:{},workerIndex:t.workerIndex}),s=!0}}function c(t){if(a[t.taskType])return console.log('attempt to register duplicate task handler "',t.taskType,'"'),!1;a[t.taskType]=t,s&&t.initialize(r.taskConfiguration)}function f(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}self.onmessage=function(){var t=e(i().mark((function t(e){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.data.taskType){t.next=3;break}return console.log(e.data),t.abrupt("return");case 3:if("initialize"!==e.data.taskType){t.next=6;break}return u(e.data),t.abrupt("return");case 6:if("loadWebWorkerTask"!==e.data.taskType){t.next=9;break}return n=e.data,r=n.config,self.importScripts(n.sourcePath),t.abrupt("return");case 9:if(a[e.data.taskType])try{a[e.data.taskType].handler(e.data,(function(t,r){self.postMessage({taskType:e.data.taskType,status:"success",result:t,workerIndex:e.data.workerIndex},r)}))}catch(t){console.log("task ".concat(e.data.taskType," failed - ").concat(t.message),t),self.postMessage({taskType:e.data.taskType,status:"failed",result:t.message,workerIndex:e.data.workerIndex})}else console.log("no task handler for ",e.data.taskType),console.log(a),self.postMessage({taskType:e.data.taskType,status:"failed - no task handler registered",workerIndex:e.data.workerIndex});case 10:case"end":return t.stop()}var n}),t)})));return function(e){return t.apply(this,arguments)}}();var l=o(272),p=o.n(l),h=o(699);function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function v(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var y={codec:void 0,decoder:void 0,decodeConfig:{}};function g(t){if(y.decodeConfig=t,y.codec)return Promise.resolve();var e=p()({locateFile:function(t){return t.endsWith(".wasm")?h.toString():t}});return new Promise((function(t,r){e.then((function(e){y.codec=e,y.decoder=new e.J2KDecoder,t()}),r)}))}function m(){return(m=e(i().mark((function t(e,r){var n,o,a,s,u,c,f,l,p,h,d,m,b,P,T,C,$,_;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g();case 2:return n=y.decoder,(o=n.getEncodedBuffer(e.length)).set(e),n.decode(),a=n.getFrameInfo(),s=n.getDecodedBuffer(),new Uint8Array(s.length).set(s),u="x: ".concat(n.getImageOffset().x,", y: ").concat(n.getImageOffset().y),c=n.getNumDecompositions(),f=n.getNumLayers(),l=["unknown","LRCP","RLCP","RPCL","PCRL","CPRL"][n.getProgressionOrder()+1],p=n.getIsReversible(),h="".concat(n.getBlockDimensions().width," x ").concat(n.getBlockDimensions().height),d="".concat(n.getTileSize().width," x ").concat(n.getTileSize().height),m="".concat(n.getTileOffset().x,", ").concat(n.getTileOffset().y),b=n.getColorSpace(),P="".concat(s.length.toLocaleString()," bytes"),T="".concat((s.length/o.length).toFixed(2),":1"),C={columns:a.width,rows:a.height,bitsPerPixel:a.bitsPerSample,signed:a.isSigned,bytesPerPixel:r.bytesPerPixel,componentsPerPixel:a.componentCount},$=w(a,s),_={imageOffset:u,numDecompositions:c,numLayers:f,progessionOrder:l,reversible:p,blockDimensions:h,tileSize:d,tileOffset:m,colorTransform:b,decodedSize:P,compressionRatio:T},t.abrupt("return",v(v(v({},r),{},{pixelData:$,imageInfo:C,encodeOptions:_},_),C));case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function w(t,e){return t.bitsPerSample>8?t.isSigned?new Int16Array(e.buffer,e.byteOffset,e.byteLength/2):new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2):t.isSigned?new Int8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}const b=function(t,e){return m.apply(this,arguments)};var P=o(37),T=o.n(P),C=o(69);function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var A={codec:void 0,decoder:void 0,decodeConfig:{}};function k(t){return"number"==typeof t?A.codec.getExceptionMessage(t):t}function x(t){if(A.decodeConfig=t,A.codec)return Promise.resolve();var e=T()({locateFile:function(t){return t.endsWith(".wasm")?C.toString():t}});return new Promise((function(t,r){e.then((function(e){A.codec=e,A.decoder=new e.JpegLSDecoder,t()}),r)}))}function O(){return(O=e(i().mark((function t(e,r){var n,o,a,s,u,c,f,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,console.debug("decodeAsync",e,r),t.next=4,x();case 4:return n=A.decoder,n.getEncodedBuffer(e.length).set(e),n.decode(),o=n.getFrameInfo(),a=n.getInterleaveMode(),s=n.getNearLossless(),u=n.getDecodedBuffer(),c={columns:o.width,rows:o.height,bitsPerPixel:o.bitsPerSample,signed:r.signed,bytesPerPixel:r.bytesPerPixel,componentsPerPixel:o.componentCount},f=j(o,u,r.signed),l={nearLossless:s,interleaveMode:a,frameInfo:o},t.abrupt("return",_(_(_({},r),{},{pixelData:f,imageInfo:c,encodeOptions:l},l),c));case 18:throw t.prev=18,t.t0=t.catch(0),k(t.t0);case 21:case"end":return t.stop()}}),t,null,[[0,18]])})))).apply(this,arguments)}function j(t,e,r){return t.bitsPerSample>8?r?new Int16Array(e.buffer,e.byteOffset,e.byteLength/2):new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2):r?new Int8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}const S=function(t,e){return O.apply(this,arguments)};const E=function(t){for(var e,r=t[0],n=t[0],o=t.length,i=1;i<o;i++)e=t[i],r=Math.min(r,e),n=Math.max(n,e);return{min:r,max:n}};function D(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=E(t.pixelData),n=!(R(t.smallestPixelValue)&&R(t.largestPixelValue));!0!==e||n?(t.smallestPixelValue=r.min,t.largestPixelValue=r.max):(t.smallestPixelValue!==r.min&&console.warn("Image smallestPixelValue tag is incorrect. Rendering performance will suffer considerably."),t.largestPixelValue!==r.max&&console.warn("Image largestPixelValue tag is incorrect. Rendering performance will suffer considerably."))}function R(t){return"number"==typeof t}function F(){return(F=e(i().mark((function t(e,r){var n,o,a;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.buffer,o=r.byteOffset,a=r.length,16===e.bitsAllocated?(o%2&&(n=n.slice(o),o=0),0===e.pixelRepresentation?e.pixelData=new Uint16Array(n,o,a/2):e.pixelData=new Int16Array(n,o,a/2)):8===e.bitsAllocated||1===e.bitsAllocated?e.pixelData=r:32===e.bitsAllocated&&(o%2&&(n=n.slice(o),o=0),e.pixelData=new Float32Array(n,o,a/4)),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}const W=function(t,e){return F.apply(this,arguments)};function I(t){return(255&t)<<8|t>>8&255}function U(){return(U=e(i().mark((function t(e,r){var n,o,a,s;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(16===e.bitsAllocated)for(n=r.buffer,o=r.byteOffset,a=r.length,o%2&&(n=n.slice(o),o=0),0===e.pixelRepresentation?e.pixelData=new Uint16Array(n,o,a/2):e.pixelData=new Int16Array(n,o,a/2),s=0;s<e.pixelData.length;s++)e.pixelData[s]=I(e.pixelData[s]);else 8===e.bitsAllocated&&(e.pixelData=r);return t.abrupt("return",e);case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}const L=function(t,e){return U.apply(this,arguments)};function H(){return(H=e(i().mark((function t(e,r){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(8!==e.bitsAllocated){t.next=6;break}if(!e.planarConfiguration){t.next=3;break}return t.abrupt("return",B(e,r));case 3:return t.abrupt("return",M(e,r));case 6:if(16!==e.bitsAllocated){t.next=8;break}return t.abrupt("return",V(e,r));case 8:throw new Error("unsupported pixel format for RLE");case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function M(t,e){for(var r=e,n=t.rows*t.columns,o=new ArrayBuffer(n*t.samplesPerPixel),i=new DataView(r.buffer,r.byteOffset),a=new Int8Array(r.buffer,r.byteOffset),s=new Int8Array(o),u=0,c=i.getInt32(0,!0),f=0;f<c;++f){u=f;var l=i.getInt32(4*(f+1),!0),p=i.getInt32(4*(f+2),!0);0===p&&(p=r.length);for(var h=n*c;l<p;){var d=a[l++];if(d>=0&&d<=127)for(var v=0;v<d+1&&u<h;++v)s[u]=a[l++],u+=t.samplesPerPixel;else if(d<=-1&&d>=-127)for(var y=a[l++],g=0;g<1-d&&u<h;++g)s[u]=y,u+=t.samplesPerPixel}}return t.pixelData=new Uint8Array(o),t}function B(t,e){for(var r=e,n=t.rows*t.columns,o=new ArrayBuffer(n*t.samplesPerPixel),i=new DataView(r.buffer,r.byteOffset),a=new Int8Array(r.buffer,r.byteOffset),s=new Int8Array(o),u=0,c=i.getInt32(0,!0),f=0;f<c;++f){u=f*n;var l=i.getInt32(4*(f+1),!0),p=i.getInt32(4*(f+2),!0);0===p&&(p=r.length);for(var h=n*c;l<p;){var d=a[l++];if(d>=0&&d<=127)for(var v=0;v<d+1&&u<h;++v)s[u]=a[l++],u++;else if(d<=-1&&d>=-127)for(var y=a[l++],g=0;g<1-d&&u<h;++g)s[u]=y,u++}}return t.pixelData=new Uint8Array(o),t}function V(t,e){for(var r=e,n=t.rows*t.columns,o=new ArrayBuffer(n*t.samplesPerPixel*2),i=new DataView(r.buffer,r.byteOffset),a=new Int8Array(r.buffer,r.byteOffset),s=new Int8Array(o),u=i.getInt32(0,!0),c=0;c<u;++c){var f=0,l=0===c?1:0,p=i.getInt32(4*(c+1),!0),h=i.getInt32(4*(c+2),!0);for(0===h&&(h=r.length);p<h;){var d=a[p++];if(d>=0&&d<=127)for(var v=0;v<d+1&&f<n;++v)s[2*f+l]=a[p++],f++;else if(d<=-1&&d>=-127)for(var y=a[p++],g=0;g<1-d&&f<n;++g)s[2*f+l]=y,f++}}return 0===t.pixelRepresentation?t.pixelData=new Uint16Array(o):t.pixelData=new Int16Array(o),t}const z=function(t,e){return H.apply(this,arguments)};var N=o(851),G=o.n(N),q=o(427);function J(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function X(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Y={codec:void 0,decoder:void 0};function K(){if(Y.codec)return Promise.resolve();var t=G()({locateFile:function(t){return t.endsWith(".wasm")?q.toString():t}});return new Promise((function(e,r){t.then((function(t){Y.codec=t,Y.decoder=new t.JPEGDecoder,e()}),r)}))}function Z(){return(Z=e(i().mark((function t(e,r){var n,o,a,s,u,c;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,K();case 2:return n=Y.decoder,n.getEncodedBuffer(e.length).set(e),n.decode(),o=n.getFrameInfo(),a=n.getDecodedBuffer(),s={columns:o.width,rows:o.height,bitsPerPixel:o.bitsPerSample,signed:r.signed,bytesPerPixel:r.bytesPerPixel,componentsPerPixel:o.componentCount},u=Q(o,a),c={frameInfo:o},t.abrupt("return",X(X(X({},r),{},{pixelData:u,imageInfo:s,encodeOptions:c},c),s));case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Q(t,e){return t.isSigned?new Int8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}const tt=function(t,e){return Z.apply(this,arguments)};var et={JpegImage:void 0,decodeConfig:{}};function rt(t){return et.decodeConfig=t,et.JpegImage?Promise.resolve():new Promise((function(t,e){o.e(945).then(o.t.bind(o,54,23)).then((function(e){var r=e.JpegImage;et.JpegImage=r,t()}),e)}))}function nt(){return(nt=e(i().mark((function t(e,r){var n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,rt();case 2:if(void 0!==et.JpegImage){t.next=4;break}throw new Error("No JPEG Baseline decoder loaded");case 4:if((n=new et.JpegImage).parse(r),n.colorTransform=!1,8!==e.bitsAllocated){t.next=12;break}return e.pixelData=n.getData(e.columns,e.rows),t.abrupt("return",e);case 12:if(16!==e.bitsAllocated){t.next=15;break}return e.pixelData=n.getData16(e.columns,e.rows),t.abrupt("return",e);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}const ot=function(t,e){return nt.apply(this,arguments)};var it={jpeg:void 0,decodeConfig:{}};function at(t){return it.decodeConfig=t,it.jpeg?Promise.resolve():new Promise((function(t,e){o.e(610).then(o.t.bind(o,610,23)).then((function(e){it.jpeg=e,t()}),e)}))}function st(){return(st=e(i().mark((function t(e,r){var n,o,a,s;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,at();case 2:if(void 0!==it.jpeg&&void 0!==it.jpeg.lossless&&void 0!==it.jpeg.lossless.Decoder){t.next=4;break}throw new Error("No JPEG Lossless decoder loaded");case 4:if(n=e.bitsAllocated<=8?1:2,o=r.buffer,a=new it.jpeg.lossless.Decoder,s=a.decode(o,r.byteOffset,r.length,n),0!==e.pixelRepresentation){t.next=14;break}if(16!==e.bitsAllocated){t.next=12;break}return e.pixelData=new Uint16Array(s.buffer),t.abrupt("return",e);case 12:return e.pixelData=new Uint8Array(s.buffer),t.abrupt("return",e);case 14:return e.pixelData=new Int16Array(s.buffer),t.abrupt("return",e);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}const ut=function(t,e){return st.apply(this,arguments)};var ct=o(430),ft=o.n(ct),lt=o(813);function pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ht(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var dt={codec:void 0,decoder:void 0,decodeConfig:{}};function vt(t){if(dt.decodeConfig=t,dt.codec)return Promise.resolve();var e=ft()({locateFile:function(t){return t.endsWith(".wasm")?lt:t}});return new Promise((function(t,r){e.then((function(e){dt.codec=e,dt.decoder=new e.HTJ2KDecoder,t()}),r)}))}function yt(){return(yt=e(i().mark((function t(e,r){var n,o,a,s,u,c,f,l,p,h,d,v,y,g,m,w,b,P,T,C,$,_;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,vt();case 2:return n=dt.decoder,(o=n.getEncodedBuffer(e.length)).set(e),n.decode(),a=n.getFrameInfo(),s=n.getDecodedBuffer(),new Uint8Array(s.length).set(s),u="x: ".concat(n.getImageOffset().x,", y: ").concat(n.getImageOffset().y),c=n.getNumDecompositions(),f=n.getNumLayers(),l=["unknown","LRCP","RLCP","RPCL","PCRL","CPRL"][n.getProgressionOrder()+1],p=n.getIsReversible(),h="".concat(n.getBlockDimensions().width," x ").concat(n.getBlockDimensions().height),d="".concat(n.getTileSize().width," x ").concat(n.getTileSize().height),v="".concat(n.getTileOffset().x,", ").concat(n.getTileOffset().y),y="".concat(s.length.toLocaleString()," bytes"),g="".concat((s.length/o.length).toFixed(2),":1"),m={columns:a.width,rows:a.height,bitsPerPixel:a.bitsPerSample,signed:a.isSigned,bytesPerPixel:r.bytesPerPixel,componentsPerPixel:a.componentCount},w=gt(a,s),P=(b=w).buffer,T=b.byteOffset,C=b.byteLength,$=P.slice(T,T+C),w=new w.constructor($),_={imageOffset:u,numDecompositions:c,numLayers:f,progessionOrder:l,reversible:p,blockDimensions:h,tileSize:d,tileOffset:v,decodedSize:y,compressionRatio:g},t.abrupt("return",ht(ht(ht({},r),{},{pixelData:w,imageInfo:m,encodeOptions:_},_),m));case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function gt(t,e){return t.bitsPerSample>8?t.isSigned?new Int16Array(e.buffer,e.byteOffset,e.byteLength/2):new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2):t.isSigned?new Int8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}const mt=function(t,e){return yt.apply(this,arguments)};function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function bt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wt(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Pt(){return Pt=e(i().mark((function t(e,r,n,o,a,s){var u,c,f,l,p;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:u=(new Date).getTime(),c=null,t.t0=r,t.next="1.2.840.10008.1.2"===t.t0||"1.2.840.10008.1.2.1"===t.t0?5:"1.2.840.10008.1.2.2"===t.t0?7:"1.2.840.10008.1.2.1.99"===t.t0?9:"1.2.840.10008.1.2.5"===t.t0?11:"1.2.840.10008.1.2.4.50"===t.t0?13:"1.2.840.10008.1.2.4.51"===t.t0?16:"1.2.840.10008.1.2.4.57"===t.t0?18:"1.2.840.10008.1.2.4.70"===t.t0?20:"1.2.840.10008.1.2.4.80"===t.t0?22:"1.2.840.10008.1.2.4.81"===t.t0?25:"1.2.840.10008.1.2.4.90"===t.t0?28:"1.2.840.10008.1.2.4.91"===t.t0?31:"3.2.840.10008.1.2.4.96"===t.t0?34:37;break;case 5:case 9:return c=W(e,n),t.abrupt("break",38);case 7:return c=L(e,n),t.abrupt("break",38);case 11:return c=z(e,n),t.abrupt("break",38);case 13:return f=bt({},e),c=tt(n,f),t.abrupt("break",38);case 16:return c=ot(e,n),t.abrupt("break",38);case 18:case 20:return c=ut(e,n),t.abrupt("break",38);case 22:return f=bt({signed:1===e.pixelRepresentation,bytesPerPixel:e.bitsAllocated<=8?1:2},e),c=S(n,f),t.abrupt("break",38);case 25:return f=bt({signed:!1,bytesPerPixel:e.bitsAllocated<=8?1:2},e),c=S(n,f),t.abrupt("break",38);case 28:case 31:return f=bt({},e),c=b(n,f),t.abrupt("break",38);case 34:return f=bt({},e),c=mt(n,f),t.abrupt("break",38);case 37:throw new Error("no decoder for transfer syntax ".concat(r));case 38:if(c){t.next=40;break}throw new Error("decodePromise not defined");case 40:return t.next=42,c;case 42:return l=t.sent,p=Tt(l,a,u,o),null==s||s(p),t.abrupt("return",p);case 46:case"end":return t.stop()}}),t)}))),Pt.apply(this,arguments)}function Tt(t,e,r,n){var o=(n||{}).use16BitDataType,i=void 0!==t.pixelRepresentation&&1===t.pixelRepresentation,a=i&&void 0!==t.bitsStored?32-t.bitsStored:void 0;if(i&&void 0!==a)for(var s=0;s<t.pixelData.length;s++)t.pixelData[s]=t.pixelData[s]<<a>>a;var u=t.pixelData;if(t.pixelDataLength=t.pixelData.length,e.targetBuffer){var c,f,l=e.targetBuffer;c=l.offset,f=l.length;var p,h=e.targetBuffer,d=h.arrayBuffer,v=h.type;switch(null==c&&(c=0),null==f&&0!==c?f=t.pixelDataLength-c:null==f&&(f=t.pixelDataLength),v){case"Uint8Array":p=Uint8Array;break;case o&&"Uint16Array":p=Uint16Array;break;case o&&"Int16Array":p=Int16Array;break;case"Float32Array":p=Float32Array;break;default:throw new Error("target array for image does not have a valid type.")}var y,g=t.pixelData;if(f!==g.length)throw new Error("target array for image does not have the same length (".concat(f,") as the decoded image length (").concat(g.length,")."));(y=d?new p(d,c,f):new p(f)).set(g,0),u=y}if(e.preScale.enabled){var m=e.preScale.scalingParameters;if(!m)throw new Error("options.preScale.scalingParameters must be defined if preScale.enabled is true, and scalingParameters cannot be derived from the metadata providers.");var w=m.rescaleSlope,b=m.rescaleIntercept;"number"==typeof w&&"number"==typeof b&&function(t,e){var r=t.length,n=e.rescaleSlope,o=e.rescaleIntercept,i=e.suvbw;if("PT"===e.modality){if("number"!=typeof i)return;for(var a=0;a<r;a++)t[a]=i*(t[a]*n+o)}else for(var s=0;s<r;s++)t[s]=t[s]*n+o;return!0}(u,m)&&(t.preScale=bt(bt({},e.preScale),{},{scaled:!0}))}e.targetBuffer&&(!e.targetBuffer.arrayBuffer||e.targetBuffer.arrayBuffer instanceof ArrayBuffer)&&(t.pixelData=u);var P=(new Date).getTime();return t.decodeTimeInMS=P-r,t}const Ct=function(t,e,r,n,o,i){return Pt.apply(this,arguments)};var $t;function _t(t){t.decodeTask.initializeCodecsOnStartup&&(g(t.decodeTask),x(t.decodeTask))}function At(){return(At=e(i().mark((function t(e,r){var n,o,a;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return _t($t),n=$t&&$t.decodeTask&&$t.decodeTask.strict,o=new Uint8Array(e.data.pixelData),t.next=5,Ct(e.data.imageFrame,e.data.transferSyntax,o,Object.assign($t.decodeTask,e.data.decodeConfig),e.data.options);case 5:if((a=t.sent).pixelData){t.next=8;break}throw new Error("decodeTask: imageFrame.pixelData is undefined after decoding");case 8:return D(a,n),a.pixelData=a.pixelData.buffer,null==r||r(a,[a.pixelData]),t.abrupt("return",{result:a,transferList:[a.pixelData]});case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}const kt={taskType:"decodeTask",handler:function(t,e){return At.apply(this,arguments)},initialize:function(t){$t=t,_t(t)}};c(kt)})()})();
3229
2
  //# sourceMappingURL=index.worker.min.worker.js.map