-
Notifications
You must be signed in to change notification settings - Fork 3
/
kth.js
4 lines (4 loc) · 43.4 KB
/
kth.js
1
2
3
4
(()=>{
function GROWABLE_HEAP_I8(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAP8}function GROWABLE_HEAP_U8(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAPU8}function GROWABLE_HEAP_I32(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAP32}function GROWABLE_HEAP_U32(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAPU32}function GROWABLE_HEAP_F64(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}return HEAPF64}"use strict";var Module=typeof Module!="undefined"?Module:{};!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.kth=t():e.__KTH_MODULE__=t()}(globalThis,()=>(()=>{"use strict";var e={490:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Kth=void 0;const o=r(760),n=r(33);class s{static getLibconfig(){const e=o.LibConfig.getLibconfig(),t={logLibrary:e.log_library,useLibmdbx:e.use_libmdbx,version:e.version,microarchitectureId:e.microarchitecture_id,currency:e.currency,mempool:e.mempool,dbReadonly:e.db_readonly,debugMode:e.debug_mode};return(0,n.free)(e),t}}t.Kth=s,t.default=s},644:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentAddress=void 0;const o=r(760),n=r(33);class s{static fromNative(e,t=!1){const r=new s(e.encodedCashaddr(!1),!1,!1);return t&&(0,n.free)(e),r}static fromString(e){const t=new o.PaymentAddressNative(e);if(!t.isValid())return void(0,n.free)(t);const r=s.fromNative(t);return(0,n.free)(t),r}static isValid(e){const t=new o.PaymentAddressNative(e),r=t.isValid();return(0,n.free)(t),r}constructor(e,t=!1,r=!1){this.addressStr=e,this.tokenAware=t,this.legacy=r}toNative(){return new o.PaymentAddressNative(this.addressStr)}get hash(){const e=this.toNative(),t=e.hash20();return(0,n.free)(e),t}get version(){const e=this.toNative(),t=e.version();return(0,n.free)(e),t}encoded(){if(this.tokenAware){const e=this.toNative(),t=e.encodedCashaddr(!1);return(0,n.free)(e),t}return this.addressStr}encodedCashAddr(){const e=this.toNative(),t=e.encodedCashaddr(!1);return(0,n.free)(e),t}encodedCashTokens(){const e=this.toNative(),t=e.encodedCashaddr(!0);return(0,n.free)(e),t}encodedLegacy(){const e=this.toNative(),t=e.encodedLegacy();return(0,n.free)(e),t}}t.PaymentAddress=s,t.default=s},354:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FETCH_WITH_SHARED_ARRAY_BUFFER=t.IS_WEB_WORKER=t.IS_NODE_WORKER=t.IS_NODE_MAIN_THREAD=t.IS_WEB_MAIN_THREAD=t.IS_WORKER=void 0,t.IS_WORKER="function"==typeof globalThis.importScripts,t.IS_WEB_MAIN_THREAD="object"==typeof window,t.IS_NODE_MAIN_THREAD=!t.IS_WEB_MAIN_THREAD&&!t.IS_WORKER,t.IS_NODE_WORKER=t.IS_WORKER&&"function"==typeof globalThis.require,t.IS_WEB_WORKER=t.IS_WORKER&&!t.IS_NODE_WORKER;const r=!!/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/.exec(globalThis?.navigator?.userAgent);t.FETCH_WITH_SHARED_ARRAY_BUFFER=r},183:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.malloc=t.free=t.PaymentAddress=t.Kth=t.loadWasm=void 0;const o=r(490);t.Kth=o.default;const n=r(644);t.PaymentAddress=n.default;const s=r(50);t.loadWasm=s.default;const i=r(33);Object.defineProperty(t,"free",{enumerable:!0,get:function(){return i.free}}),Object.defineProperty(t,"malloc",{enumerable:!0,get:function(){return i.malloc}}),t.default={loadWasm:s.default,Kth:o.default,PaymentAddress:n.default,free:i.free,malloc:i.malloc}},344:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.stringToBytes=t.mapParallel=t.mapSeries=t.copyObject=t.isStringPair=t.isArrayArrayDate=t.isArrayDate=t.isDate=t.isArrayArrayString=t.isArrayString=void 0;const o=r(50),n=new RegExp("^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9](.[0-9]+)?(Z|([+-])?(((2[0-3]|[01][0-9])[0-5][0-9])|((2[0-3]|[01][0-9]):[0-5][0-9])))?$");function s(e){return null!=e&&n.test(e)}t.isArrayString=function(e){return e.length>0&&"string"==typeof e.find(e=>null!=e)},t.isArrayArrayString=function(e){if(e.length>0){const t=e.find(e=>e.length>0);return null!=t&&"string"==typeof t[0]}return!1},t.isDate=s,t.isArrayDate=function(e){return e.length>0&&s(e.find(e=>null!=e))},t.isArrayArrayDate=function(e){if(e.length>0){const t=e.find(e=>null!=e&&e.length>0&&null!=e.find(e=>null!=e));return null!=t&&s(t.find(e=>null!=e))}return!1},t.isStringPair=function(e){return null!=e&&"object"==typeof e&&2===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]},t.copyObject=function(e,t){const r={};return t.forEach(t=>r[t]=e[t]),r},t.mapSeries=async function(e,t){const r=[];for(let o=0;o<e.length;o++)r[o]=await t(e[o],o,e);return r},t.mapParallel=async function(e,t,r){t=Math.max(1,Math.min(t,e.length));const o=[];let n=0;const s=Array(t).fill(0).map(async()=>(async()=>{for(;n<e.length;){const t=n++,s=e[t];o[t]=await r(s,t,e)}})());return await Promise.all(s),o},t.stringToBytes=function(e){const t=/(\d+(?:\.\d+)?)\s?(k|m|g|t)?b?/i.exec(e);return null==t?0:parseInt(t[1],10)*(null!=t[2]?Math.pow(1024,{k:1,m:2,g:3,t:4}[t[2].toLowerCase()]):1)},o.default.promise.then(()=>{})},613:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});const s=r(354),i=r(344);if(s.IS_WORKER)Module=globalThis.Module;else if(s.IS_WEB_MAIN_THREAD){const e=(0,i.stringToBytes)("16MB"),t=(0,i.stringToBytes)("128MB");for(let r=(0,i.stringToBytes)("4GB");r>0;r-=t)try{Module.wasmMemory=new WebAssembly.Memory({initial:Math.floor(e/65536),maximum:Math.floor(r/65536),shared:!0});break}catch(e){}if(null==Module.wasmMemory)throw new Error("Couldn't allocate WebAssembly memory.")}const a=new Promise(e=>{Module.__resolveFilePaths=e});if(s.IS_WEB_MAIN_THREAD){const e=globalThis.fetch;globalThis.fetch=async(t,r)=>t.includes("kth.wasm")?(await a,globalThis.fetch=e,e(Module.locateFile("kth.wasm"),r)):e(t,r)}else if(s.IS_NODE_MAIN_THREAD){const e=getBinaryPromise;getBinaryPromise=async t=>(await a,e(Module.locateFile(t))),a.then(()=>{PThread.allocateUnusedWorker=()=>{const e=new Worker(Module.locateFile("kth.worker.js"),{eval:!0});PThread.unusedWorkers.push(e)}})}const l=r(183);n(r(183),t),t.default=l.default},760:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentAddressNative=t.Hash=t.ShortHash=t.LibConfig=void 0;const o=r(554),n=r(63),s=Symbol("ptr"),i=(Symbol("derivedClass"),["bitcoin","bitcoin_cash","litecoin"]),a=["boost","spdlog","binlog"];class l{static _create(e){const t=Object.create(this.prototype);return t[s]=e,t}get log_library(){return a[_kth_wasm_0(this[s])]}get use_libmdbx(){return!!_kth_wasm_1(this[s])}get version(){return(0,n.UTF8ToString)(_kth_wasm_2(this[s])>>>0)}get microarchitecture_id(){return(0,n.UTF8ToString)(_kth_wasm_3(this[s])>>>0)}get currency(){return i[_kth_wasm_4(this[s])]}get mempool(){return!!_kth_wasm_5(this[s])}get db_readonly(){return!!_kth_wasm_6(this[s])}get debug_mode(){return!!_kth_wasm_7(this[s])}_destructor(){_kth_wasm_8(this[s])}static getLibconfig(){return l._create(_kth_wasm_9()>>>0)}}t.LibConfig=l;class c{static _create(e){const t=Object.create(this.prototype);return t[s]=e,t}get hash(){return _kth_wasm_10(this[s])>>>0}_destructor(){_kth_wasm_11(this[s])}}t.ShortHash=c;class d{static _create(e){const t=Object.create(this.prototype);return t[s]=e,t}get hash(){return _kth_wasm_12(this[s])>>>0}_destructor(){_kth_wasm_13(this[s])}}t.Hash=d,t.PaymentAddressNative=class{static _create(e){const t=Object.create(this.prototype);return t[s]=e,t}_destructor(){_kth_wasm_14(this[s])}constructor(e,t){(0,o.clearStack)(),this[s]="string"==typeof e?_kth_wasm_15_0((0,o.allocateUTF8String)(e))>>>0:_kth_wasm_15_1(e[s],t)>>>0}encodedLegacy(){return(0,n.UTF8ToString)(_kth_wasm_16(this[s])>>>0)}encodedCashaddr(e){return(0,n.UTF8ToString)(_kth_wasm_17(this[s],e)>>>0)}hash20(){return c._create(_kth_wasm_18(this[s])>>>0)}hash32(){return d._create(_kth_wasm_19(this[s])>>>0)}version(){return _kth_wasm_20(this[s])}isValid(){return!!_kth_wasm_21(this[s])}}},50:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const o=r(354),n=r(643);var s;let i;!function(e){e[e.unloaded=0]="unloaded",e[e.loading=1]="loading",e[e.loaded=2]="loaded"}(s||(s={}));const a=new Promise(e=>i=e),l={};function c(e,t){if(c.status!==s.unloaded)return c.promise;if(Module.mainScriptUrlOrBlob=t??"kth.js",l["kth.wasm"]=e??"kth.wasm",o.IS_WEB_MAIN_THREAD&&"string"==typeof Module.mainScriptUrlOrBlob){const e=new URL(Module.mainScriptUrlOrBlob,location.href).toString();Module.mainScriptUrlOrBlob=e}if(o.IS_WEB_MAIN_THREAD){const e=new Blob([n.default],{type:"application/javascript"});l["kth.worker.js"]=URL.createObjectURL(e)}else o.IS_NODE_MAIN_THREAD&&(l["kth.worker.js"]=n.default);function r(){c.status=s.loaded,i()}return o.IS_WEB_MAIN_THREAD?window.addEventListener("_kthWasmLoaded",r):o.IS_NODE_MAIN_THREAD&&(globalThis._kthWasmLoaded=r),c.status=s.loading,Module.__resolveFilePaths(),a}Module.locateFile=e=>l[e]??e,c.promise=a,c.status=s.unloaded,t.default=c},33:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buffer=t.free=t.malloc=void 0;const r=Symbol("custom_malloc_sym");function o(){return GROWABLE_HEAP_U8().buffer}t.buffer=o,t.malloc=function(e,t){const n=t*e.BYTES_PER_ELEMENT,s=Module._malloc(n)>>>0,i=new e(o(),s,t);return i[r]=!0,i.ptr=s,i},t.free=function(e){"number"==typeof e?Module._free(e):!0===e[r]?Module._free(e.ptr):e._destructor()}},554:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.allocateUTF8String=t.clearStack=void 0;const o=r(50),n=r(63),s={reset(){this._usedBytes=0,this._toFree.forEach(e=>Module._free(e)),this._toFree.length=0},alloc(e){if(e>5120){const t=Module._malloc(e)>>>0;return this._toFree.push(t),t}if(this._usedBytes+e>this._size){const t=this._usedBytes+e+10240,r=Module._malloc(t)>>>0;0!==this._ptr&&this._toFree.push(this._ptr),this._ptr=r,this._usedBytes=0,this._size=t}const t=this._ptr+this._usedBytes;return this._usedBytes+=e,t},_ptr:0,_usedBytes:0,_size:0,_toFree:new Array};o.default.promise.then(()=>s.alloc(0)),t.clearStack=function(){s.reset()},t.allocateUTF8String=function(e){const t=3*e.length+10,r=s.alloc(t);return(0,n.StringToUTF8)(e,r,t),r}},63:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringToUTF8=t.UTF8ToString=void 0;const r=new TextDecoder("utf8"),o=new TextEncoder,n=new Array(128).fill("").map((e,t)=>String.fromCodePoint(t));t.UTF8ToString=function(e,t){return 0===e?"":(null==t&&(t=Module._strlen(e)),0===t?"":t>30?r.decode(GROWABLE_HEAP_U8().slice(e,e+t)):function(e,t){const r=GROWABLE_HEAP_U8(),o=e+t;let s,i,a,l="";for(;e<o;)s=r[e++],s<=127?l+=n[s]:(i=r[e++],a=s<=223?(31&s)<<6|63&i:s<=239?(15&s)<<12|(63&i)<<6|63&r[e++]:(7&s)<<18|(63&i)<<12|(63&r[e++])<<6|63&r[e++],l+=String.fromCodePoint(a));return l}(e,t))},t.StringToUTF8=function(e,t,r){const n=GROWABLE_HEAP_U8();if(e.length<100)return stringToUTF8Array(e,n,t,r);{let s=o.encode(e);return s.length>r&&(s=s.subarray(0,r)),n.set(s,t),n[t+Math.min(s.length,r-1)]=0,s.length}}},643:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=`"use strict";var Module={};var ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string";if(ENVIRONMENT_IS_NODE){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",data=>onmessage({data:data}));var fs=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:f=>(0,eval)(fs.readFileSync(f,"utf8")+"//# sourceURL="+f),postMessage:msg=>parentPort.postMessage(msg),performance:global.performance||{now:Date.now}})}var initializedJS=false;function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");if(ENVIRONMENT_IS_NODE){fs.writeSync(2,text+"\
");return}console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=(info,receiveInstance)=>{var module=Module["wasmModule"];Module["wasmModule"]=null;var instance=new WebAssembly.Instance(module,info);return receiveInstance(instance)};self.onunhandledrejection=e=>{throw e.reason??e};function handleMessage(e){try{if(e.data.cmd==="load"){let messageQueue=[];self.onmessage=e=>messageQueue.push(e);self.startWorker=instance=>{postMessage({"cmd":"loaded"});for(let msg of messageQueue){handleMessage(msg)}self.onmessage=handleMessage};Module["wasmModule"]=e.data.wasmModule;for(const handler of e.data.handlers){Module[handler]=(...args)=>{postMessage({cmd:"callHandler",handler:handler,args:args})}}Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob=="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}}else if(e.data.cmd==="run"){Module["__emscripten_thread_init"](e.data.pthread_ptr,0,0,1);Module["__emscripten_thread_mailbox_await"](e.data.pthread_ptr);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInitTLS();if(!initializedJS){initializedJS=true}try{Module["invokeEntryPoint"](e.data.start_routine,e.data.arg)}catch(ex){if(ex!="unwind"){throw ex}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="checkMailbox"){if(initializedJS){Module["checkMailbox"]()}}else if(e.data.cmd){err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){if(Module["__emscripten_thread_crashed"]){Module["__emscripten_thread_crashed"]()}throw ex}}self.onmessage=handleMessage;`}},t={};return function r(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={exports:{}};return e[o].call(s.exports,s,s.exports,r),s.exports}(613)})());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 ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;if(ENVIRONMENT_IS_NODE){var fs=require("fs");var nodePath=require("path");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,binary=true)=>{filename=isFileURI(filename)?new URL(filename):nodePath.normalize(filename);fs.readFile(filename,binary?undefined:"utf8",(err,data)=>{if(err)onerror(err);else onload(binary?data.buffer:data)})};if(!Module["thisProgram"]&&process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}arguments_=process.argv.slice(2);if(typeof module!="undefined"){}process.on("uncaughtException",ex=>{if(ex!=="unwind"&&!(ex instanceof ExitStatus)&&!(ex.context instanceof ExitStatus)){throw ex}});quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow};Module["inspect"]=()=>"[Emscripten Module object]";let nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}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(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1)}else{scriptDirectory=""}if(!ENVIRONMENT_IS_NODE){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{}if(ENVIRONMENT_IS_NODE){if(typeof performance=="undefined"){global.performance=require("perf_hooks").performance}}var defaultPrint=console.log.bind(console);var defaultPrintErr=console.error.bind(console);if(ENVIRONMENT_IS_NODE){defaultPrint=(...args)=>fs.writeSync(1,args.join(" ")+"\n");defaultPrintErr=(...args)=>fs.writeSync(2,args.join(" ")+"\n")}var err=defaultPrintErr;Object.assign(Module,moduleOverrides);moduleOverrides=null;var wasmBinary;var noExitRuntime=true;if(typeof WebAssembly!="object"){abort("no native wasm support detected")}var wasmMemory;var wasmExports;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort(text)}}var HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAP64,HEAPU64,HEAPF64;function updateMemoryViews(){var b=wasmMemory.buffer;Module["HEAP8"]=HEAP8=new Int8Array(b);Module["HEAP16"]=HEAP16=new Int16Array(b);Module["HEAP32"]=HEAP32=new Int32Array(b);Module["HEAPU8"]=HEAPU8=new Uint8Array(b);Module["HEAPU16"]=HEAPU16=new Uint16Array(b);Module["HEAPU32"]=HEAPU32=new Uint32Array(b);Module["HEAPF32"]=HEAPF32=new Float32Array(b);Module["HEAPF64"]=HEAPF64=new Float64Array(b);Module["HEAP64"]=HEAP64=new BigInt64Array(b);Module["HEAPU64"]=HEAPU64=new BigUint64Array(b)}var INITIAL_MEMORY=16777216;assert(INITIAL_MEMORY>=1048576,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+INITIAL_MEMORY+"! (STACK_SIZE="+1048576+")");if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":4294967296/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){err("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)")}throw Error("bad memory")}}}updateMemoryViews();INITIAL_MEMORY=wasmMemory.buffer.byteLength;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeKeepaliveCounter=0;function keepRuntimeAlive(){return noExitRuntime||runtimeKeepaliveCounter>0}function preRun(){callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++}function removeRunDependency(id){runDependencies--;if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}function abort(what){what="Aborted("+what+")";err(what);ABORT=true;EXITSTATUS=1;what+=". Build with -sASSERTIONS for more info.";if(runtimeInitialized){___trap()}var e=new WebAssembly.RuntimeError(what);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="kth.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinarySync(file){if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(binaryFile){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{if(!response["ok"]){throw"failed to load wasm binary file at '"+binaryFile+"'"}return response["arrayBuffer"]()}).catch(()=>getBinarySync(binaryFile))}}return Promise.resolve().then(()=>getBinarySync(binaryFile))}function instantiateArrayBuffer(binaryFile,imports,receiver){return getBinaryPromise(binaryFile).then(binary=>WebAssembly.instantiate(binary,imports)).then(instance=>instance).then(receiver,reason=>{err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(binary,binaryFile,imports,callback){if(!binary&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(binaryFile)&&!ENVIRONMENT_IS_NODE&&typeof fetch=="function"){return fetch(binaryFile,{credentials:"same-origin"}).then(response=>{var result=WebAssembly.instantiateStreaming(response,imports);return result.then(callback,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(binaryFile,imports,callback)})})}return instantiateArrayBuffer(binaryFile,imports,callback)}function createWasm(){var info={"a":wasmImports};function receiveInstance(instance,module){var exports=instance.exports;exports=applySignatureConversions(exports);wasmExports=exports;registerTLSInit(wasmExports["V"]);wasmTable=wasmExports["R"];addOnInit(wasmExports["s"]);wasmModule=module;removeRunDependency("wasm-instantiate");return exports}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync(wasmBinary,wasmBinaryFile,info,receiveInstantiationResult);return{}}var ASM_CONSTS={3096:()=>{if(typeof window!=="undefined"){window.dispatchEvent(new CustomEvent("_kthWasmLoaded"))}else{globalThis._kthWasmLoaded&&globalThis._kthWasmLoaded()}}};function ExitStatus(status){this.name="ExitStatus";this.message=`Program terminated with exit(${status})`;this.status=status}var terminateWorker=function(worker){worker.terminate();worker.onmessage=e=>{}};function killThread(pthread_ptr){var worker=PThread.pthreads[pthread_ptr];delete PThread.pthreads[pthread_ptr];terminateWorker(worker);__emscripten_thread_free_data(pthread_ptr);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);worker.pthread_ptr=0}function cancelThread(pthread_ptr){var worker=PThread.pthreads[pthread_ptr];worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){var worker=PThread.pthreads[pthread_ptr];assert(worker);PThread.returnWorkerToPool(worker)}function spawnThread(threadParams){var worker=PThread.getNewWorker();if(!worker){return 6}PThread.runningWorkers.push(worker);PThread.pthreads[threadParams.pthread_ptr]=worker;worker.pthread_ptr=threadParams.pthread_ptr;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"pthread_ptr":threadParams.pthread_ptr};if(ENVIRONMENT_IS_NODE){worker.unref()}worker.postMessage(msg,threadParams.transferList);return 0}var UTF8Decoder=new TextDecoder("utf8");var UTF8ToString=(ptr,maxBytesToRead)=>{ptr>>>=0;if(!ptr)return"";var maxPtr=ptr+maxBytesToRead;for(var end=ptr;!(end>=maxPtr)&&GROWABLE_HEAP_U8()[end>>>0];)++end;return UTF8Decoder.decode(GROWABLE_HEAP_U8().slice(ptr,end))};var SYSCALLS={varargs:undefined,get(){SYSCALLS.varargs+=4;var ret=GROWABLE_HEAP_I32()[SYSCALLS.varargs-4>>>2];return ret},getStr(ptr){var ret=UTF8ToString(ptr);return ret}};function _proc_exit(code){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(1,1,code);EXITSTATUS=code;if(!keepRuntimeAlive()){PThread.terminateAllThreads();ABORT=true}quit_(code,new ExitStatus(code))}var exitJS=(status,implicit)=>{EXITSTATUS=status;if(ENVIRONMENT_IS_PTHREAD){exitOnMainThread(status);throw"unwind"}_proc_exit(status)};var _exit=exitJS;var handleException=e=>{if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS}quit_(1,e)};var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init:function(){if(ENVIRONMENT_IS_PTHREAD){PThread.initWorker()}else{PThread.initMainThread()}},initMainThread:function(){addOnPreRun(()=>{addRunDependency("loading-workers");PThread.loadWasmModuleToAllWorkers(()=>removeRunDependency("loading-workers"))})},initWorker:function(){noExitRuntime=false},setExitStatus:function(status){EXITSTATUS=status},terminateAllThreads__deps:["$terminateWorker"],terminateAllThreads:function(){for(var worker of PThread.runningWorkers){terminateWorker(worker)}for(var worker of PThread.unusedWorkers){terminateWorker(worker)}PThread.unusedWorkers=[];PThread.runningWorkers=[];PThread.pthreads=[]},returnWorkerToPool:function(worker){var pthread_ptr=worker.pthread_ptr;delete PThread.pthreads[pthread_ptr];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);worker.pthread_ptr=0;__emscripten_thread_free_data(pthread_ptr)},receiveObjectTransfer:function(data){},threadInitTLS:function(){PThread.tlsInitFunctions.forEach(f=>f())},loadWasmModuleToWorker:worker=>new Promise(onFinishedLoading=>{worker.onmessage=e=>{var d=e["data"];var cmd=d["cmd"];if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var targetWorker=PThread.pthreads[d.targetThread];if(targetWorker){targetWorker.postMessage(d,d["transferList"])}else{err('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}return}if(cmd==="checkMailbox"){checkMailbox()}else if(cmd==="spawnThread"){spawnThread(d)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;onFinishedLoading(worker)}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(d.target==="setimmediate"){worker.postMessage(d)}else if(cmd==="callHandler"){Module[d["handler"]](...d["args"])}else if(cmd){err("worker sent an unknown command "+cmd)}};worker.onerror=e=>{var message="worker sent an error!";err(message+" "+e.filename+":"+e.lineno+": "+e.message);throw e};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(e){worker.onerror(e)})}var handlers=[];var knownHandlers=[];for(var handler of knownHandlers){if(Module.hasOwnProperty(handler)){handlers.push(handler)}}worker.postMessage({"cmd":"load","handlers":handlers,"urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})}),loadWasmModuleToAllWorkers:function(onMaybeReady){onMaybeReady()},allocateUnusedWorker:function(){var worker;var pthreadMainJs=locateFile("kth.worker.js");worker=new Worker(pthreadMainJs);PThread.unusedWorkers.push(worker)},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()}};Module["PThread"]=PThread;var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};function establishStackSpace(){var pthread_ptr=_pthread_self();var stackHigh=GROWABLE_HEAP_I32()[pthread_ptr+52>>>2];var stackSize=GROWABLE_HEAP_I32()[pthread_ptr+56>>>2];var stackLow=stackHigh-stackSize;_emscripten_stack_set_limits(stackHigh,stackLow);stackRestore(stackHigh)}Module["establishStackSpace"]=establishStackSpace;function exitOnMainThread(returnCode){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(2,0,returnCode);_exit(returnCode)}var wasmTableMirror=[];var 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 invokeEntryPoint(ptr,arg){var result=getWasmTableEntry(ptr)(arg);function finish(result){if(keepRuntimeAlive()){PThread.setExitStatus(result)}else{__emscripten_thread_exit(result)}}finish(result)}Module["invokeEntryPoint"]=invokeEntryPoint;function registerTLSInit(tlsInitFunc){PThread.tlsInitFunctions.push(tlsInitFunc)}var MAX_INT53=9007199254740992;var MIN_INT53=-9007199254740992;function bigintToI53Checked(num){return num<MIN_INT53||num>MAX_INT53?NaN:Number(num)}function ___emscripten_init_main_thread_js(tb){tb=bigintToI53Checked(tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1,!ENVIRONMENT_IS_WEB,1048576,false);PThread.threadInitTLS()}function ___emscripten_thread_cleanup(thread){thread=bigintToI53Checked(thread);if(!ENVIRONMENT_IS_PTHREAD)cleanupThread(thread);else postMessage({"cmd":"cleanupThread","thread":thread})}var maybeExit=()=>{if(!keepRuntimeAlive()){try{if(ENVIRONMENT_IS_PTHREAD)__emscripten_thread_exit(EXITSTATUS);else _exit(EXITSTATUS)}catch(e){handleException(e)}}};var callUserCallback=func=>{if(ABORT){return}try{func();maybeExit()}catch(e){handleException(e)}};function __emscripten_thread_mailbox_await(pthread_ptr){pthread_ptr=bigintToI53Checked(pthread_ptr);if(typeof Atomics.waitAsync==="function"){var wait=Atomics.waitAsync(GROWABLE_HEAP_I32(),pthread_ptr>>2,pthread_ptr);wait.value.then(checkMailbox);var waitingAsync=pthread_ptr+128;Atomics.store(GROWABLE_HEAP_I32(),waitingAsync>>2,1)}}Module["__emscripten_thread_mailbox_await"]=__emscripten_thread_mailbox_await;var checkMailbox=function(){var pthread_ptr=_pthread_self();if(pthread_ptr){__emscripten_thread_mailbox_await(pthread_ptr);callUserCallback(()=>__emscripten_check_mailbox())}};Module["checkMailbox"]=checkMailbox;var __emscripten_notify_mailbox_postmessage=function(targetThreadId,currThreadId,mainThreadId){targetThreadId=bigintToI53Checked(targetThreadId);currThreadId=bigintToI53Checked(currThreadId);mainThreadId=bigintToI53Checked(mainThreadId);if(targetThreadId==currThreadId){setTimeout(()=>checkMailbox())}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"checkMailbox"})}else{var worker=PThread.pthreads[targetThreadId];if(!worker){return}worker.postMessage({"cmd":"checkMailbox"})}};function __emscripten_set_offscreencanvas_size(target,width,height){target=bigintToI53Checked(target);return-1}function __emscripten_thread_set_strongref(thread){thread=bigintToI53Checked(thread);if(ENVIRONMENT_IS_NODE){PThread.pthreads[thread].ref()}}var _abort=()=>{abort("")};var readEmAsmArgsArray=[];var readEmAsmArgs=(sigPtr,buf)=>{readEmAsmArgsArray.length=0;var ch;buf>>=2;while(ch=GROWABLE_HEAP_U8()[sigPtr++>>>0]){buf+=ch!=105&buf;readEmAsmArgsArray.push(ch==105?GROWABLE_HEAP_I32()[buf>>>0]:(ch==106?HEAP64:GROWABLE_HEAP_F64())[buf++>>1]);++buf}return readEmAsmArgsArray};var withStackSave=f=>{var stack=stackSave();var ret=f();stackRestore(stack);return ret};var proxyToMainThread=function(index,sync){var numCallArgs=arguments.length-2;var outerArgs=arguments;return withStackSave(()=>{var serializedNumCallArgs=numCallArgs*2;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i<numCallArgs;i++){var arg=outerArgs[2+i];if(typeof arg=="bigint"){HEAP64[b+2*i]=1n;HEAP64[b+2*i+1]=arg}else{HEAP64[b+2*i]=0n;GROWABLE_HEAP_F64()[b+2*i+1>>>0]=arg}}return __emscripten_run_in_main_runtime_thread_js(index,serializedNumCallArgs,args,sync)})};var runMainThreadEmAsm=(code,sigPtr,argbuf,sync)=>{var args=readEmAsmArgs(sigPtr,argbuf);if(ENVIRONMENT_IS_PTHREAD){return proxyToMainThread.apply(null,[-1-code,sync].concat(args))}return ASM_CONSTS[code].apply(null,args)};function _emscripten_asm_const_async_on_main_thread(code,sigPtr,argbuf){code=bigintToI53Checked(code);sigPtr=bigintToI53Checked(sigPtr);argbuf=bigintToI53Checked(argbuf);return runMainThreadEmAsm(code,sigPtr,argbuf,0)}var runtimeKeepalivePush=()=>{runtimeKeepaliveCounter+=1};var _emscripten_exit_with_live_runtime=()=>{runtimeKeepalivePush();throw"unwind"};var getHeapMax=()=>4294901760;var _emscripten_get_heap_max=()=>BigInt(getHeapMax());var _emscripten_get_now;_emscripten_get_now=()=>performance.timeOrigin+performance.now();function _emscripten_num_logical_cores(){if(ENVIRONMENT_IS_NODE)return require("os").cpus().length;return navigator["hardwareConcurrency"]}var emscripten_receive_on_main_thread_js_callArgs=[];function _emscripten_receive_on_main_thread_js(index,callingThread,numCallArgs,args){callingThread=bigintToI53Checked(callingThread);args=bigintToI53Checked(args);PThread.currentProxiedOperationCallerThread=callingThread;numCallArgs/=2;emscripten_receive_on_main_thread_js_callArgs.length=numCallArgs;var b=args>>3;for(var i=0;i<numCallArgs;i++){if(HEAP64[b+2*i]){emscripten_receive_on_main_thread_js_callArgs[i]=HEAP64[b+2*i+1]}else{emscripten_receive_on_main_thread_js_callArgs[i]=GROWABLE_HEAP_F64()[b+2*i+1>>>0]}}var isEmAsmConst=index<0;var func=!isEmAsmConst?proxiedFunctionTable[index]:ASM_CONSTS[-index-1];return func.apply(null,emscripten_receive_on_main_thread_js_callArgs)}var growMemory=size=>{var b=wasmMemory.buffer;var pages=size-b.byteLength+65535>>>16;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};function _emscripten_resize_heap(requestedSize){requestedSize=bigintToI53Checked(requestedSize);var oldSize=GROWABLE_HEAP_U8().length;if(requestedSize<=oldSize){return false}var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}var 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=growMemory(newSize);if(replacement){return true}}return false}var ENV={};var getExecutableName=()=>thisProgram||"./this.program";var 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};var stringToAscii=(str,buffer)=>{for(var i=0;i<str.length;++i){GROWABLE_HEAP_I8()[buffer++>>>0]=str.charCodeAt(i)}GROWABLE_HEAP_I8()[buffer>>>0]=0};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(3,1,__environ,environ_buf);__environ=bigintToI53Checked(__environ);environ_buf=bigintToI53Checked(environ_buf);var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;GROWABLE_HEAP_U32()[__environ+i*4>>>2]=ptr;stringToAscii(string,ptr);bufSize+=string.length+1});return 0}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(4,1,penviron_count,penviron_buf_size);penviron_count=bigintToI53Checked(penviron_count);penviron_buf_size=bigintToI53Checked(penviron_buf_size);var strings=getEnvStrings();GROWABLE_HEAP_U32()[penviron_count>>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});GROWABLE_HEAP_U32()[penviron_buf_size>>>2]=bufSize;return 0}var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{outIdx>>>=0;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++>>>0]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++>>>0]=192|u>>6;heap[outIdx++>>>0]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++>>>0]=224|u>>12;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++>>>0]=240|u>>18;heap[outIdx++>>>0]=128|u>>12&63;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63}}heap[outIdx>>>0]=0;return outIdx-startIdx};var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,GROWABLE_HEAP_U8(),outPtr,maxBytesToWrite);PThread.init();var proxiedFunctionTable=[null,_proc_exit,exitOnMainThread,_environ_get,_environ_sizes_get];var wasmImports={e:___emscripten_init_main_thread_js,l:___emscripten_thread_cleanup,f:__emscripten_notify_mailbox_postmessage,q:__emscripten_set_offscreencanvas_size,d:__emscripten_thread_mailbox_await,g:__emscripten_thread_set_strongref,j:_abort,r:_emscripten_asm_const_async_on_main_thread,c:_emscripten_exit_with_live_runtime,h:_emscripten_get_heap_max,b:_emscripten_get_now,i:_emscripten_num_logical_cores,p:_emscripten_receive_on_main_thread_js,o:_emscripten_resize_heap,m:_environ_get,n:_environ_sizes_get,k:_exit,a:wasmMemory};var asm=createWasm();var ___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports["s"])();var _kth_wasm_0=Module["_kth_wasm_0"]=a0=>(_kth_wasm_0=Module["_kth_wasm_0"]=wasmExports["t"])(a0);var _kth_wasm_1=Module["_kth_wasm_1"]=a0=>(_kth_wasm_1=Module["_kth_wasm_1"]=wasmExports["u"])(a0);var _kth_wasm_2=Module["_kth_wasm_2"]=a0=>(_kth_wasm_2=Module["_kth_wasm_2"]=wasmExports["v"])(a0);var _kth_wasm_3=Module["_kth_wasm_3"]=a0=>(_kth_wasm_3=Module["_kth_wasm_3"]=wasmExports["w"])(a0);var _kth_wasm_4=Module["_kth_wasm_4"]=a0=>(_kth_wasm_4=Module["_kth_wasm_4"]=wasmExports["x"])(a0);var _kth_wasm_5=Module["_kth_wasm_5"]=a0=>(_kth_wasm_5=Module["_kth_wasm_5"]=wasmExports["y"])(a0);var _kth_wasm_6=Module["_kth_wasm_6"]=a0=>(_kth_wasm_6=Module["_kth_wasm_6"]=wasmExports["z"])(a0);var _kth_wasm_7=Module["_kth_wasm_7"]=a0=>(_kth_wasm_7=Module["_kth_wasm_7"]=wasmExports["A"])(a0);var _kth_wasm_8=Module["_kth_wasm_8"]=a0=>(_kth_wasm_8=Module["_kth_wasm_8"]=wasmExports["B"])(a0);var _kth_wasm_9=Module["_kth_wasm_9"]=()=>(_kth_wasm_9=Module["_kth_wasm_9"]=wasmExports["C"])();var _kth_wasm_10=Module["_kth_wasm_10"]=a0=>(_kth_wasm_10=Module["_kth_wasm_10"]=wasmExports["D"])(a0);var _kth_wasm_11=Module["_kth_wasm_11"]=a0=>(_kth_wasm_11=Module["_kth_wasm_11"]=wasmExports["E"])(a0);var _kth_wasm_12=Module["_kth_wasm_12"]=a0=>(_kth_wasm_12=Module["_kth_wasm_12"]=wasmExports["F"])(a0);var _kth_wasm_13=Module["_kth_wasm_13"]=a0=>(_kth_wasm_13=Module["_kth_wasm_13"]=wasmExports["G"])(a0);var _kth_wasm_14=Module["_kth_wasm_14"]=a0=>(_kth_wasm_14=Module["_kth_wasm_14"]=wasmExports["H"])(a0);var _kth_wasm_15_0=Module["_kth_wasm_15_0"]=a0=>(_kth_wasm_15_0=Module["_kth_wasm_15_0"]=wasmExports["I"])(a0);var _kth_wasm_15_1=Module["_kth_wasm_15_1"]=(a0,a1)=>(_kth_wasm_15_1=Module["_kth_wasm_15_1"]=wasmExports["J"])(a0,a1);var _kth_wasm_16=Module["_kth_wasm_16"]=a0=>(_kth_wasm_16=Module["_kth_wasm_16"]=wasmExports["K"])(a0);var _kth_wasm_17=Module["_kth_wasm_17"]=(a0,a1)=>(_kth_wasm_17=Module["_kth_wasm_17"]=wasmExports["L"])(a0,a1);var _kth_wasm_18=Module["_kth_wasm_18"]=a0=>(_kth_wasm_18=Module["_kth_wasm_18"]=wasmExports["M"])(a0);var _kth_wasm_19=Module["_kth_wasm_19"]=a0=>(_kth_wasm_19=Module["_kth_wasm_19"]=wasmExports["N"])(a0);var _kth_wasm_20=Module["_kth_wasm_20"]=a0=>(_kth_wasm_20=Module["_kth_wasm_20"]=wasmExports["O"])(a0);var _kth_wasm_21=Module["_kth_wasm_21"]=a0=>(_kth_wasm_21=Module["_kth_wasm_21"]=wasmExports["P"])(a0);var _main=Module["_main"]=(a0,a1)=>(_main=Module["_main"]=wasmExports["Q"])(a0,a1);var _malloc=Module["_malloc"]=a0=>(_malloc=Module["_malloc"]=wasmExports["S"])(a0);var _strlen=Module["_strlen"]=a0=>(_strlen=Module["_strlen"]=wasmExports["T"])(a0);var _free=Module["_free"]=a0=>(_free=Module["_free"]=wasmExports["U"])(a0);var __emscripten_tls_init=Module["__emscripten_tls_init"]=()=>(__emscripten_tls_init=Module["__emscripten_tls_init"]=wasmExports["V"])();var _pthread_self=Module["_pthread_self"]=()=>(_pthread_self=Module["_pthread_self"]=wasmExports["W"])();var __emscripten_thread_init=Module["__emscripten_thread_init"]=(a0,a1,a2,a3,a4,a5)=>(__emscripten_thread_init=Module["__emscripten_thread_init"]=wasmExports["X"])(a0,a1,a2,a3,a4,a5);var __emscripten_thread_crashed=Module["__emscripten_thread_crashed"]=()=>(__emscripten_thread_crashed=Module["__emscripten_thread_crashed"]=wasmExports["Y"])();var _emscripten_main_runtime_thread_id=()=>(_emscripten_main_runtime_thread_id=wasmExports["emscripten_main_runtime_thread_id"])();var _emscripten_main_thread_process_queued_calls=()=>(_emscripten_main_thread_process_queued_calls=wasmExports["emscripten_main_thread_process_queued_calls"])();var __emscripten_run_in_main_runtime_thread_js=(a0,a1,a2,a3)=>(__emscripten_run_in_main_runtime_thread_js=wasmExports["Z"])(a0,a1,a2,a3);var _emscripten_dispatch_to_thread_=(a0,a1,a2,a3,a4)=>(_emscripten_dispatch_to_thread_=wasmExports["emscripten_dispatch_to_thread_"])(a0,a1,a2,a3,a4);var __emscripten_thread_free_data=a0=>(__emscripten_thread_free_data=wasmExports["_"])(a0);var __emscripten_thread_exit=Module["__emscripten_thread_exit"]=a0=>(__emscripten_thread_exit=Module["__emscripten_thread_exit"]=wasmExports["$"])(a0);var __emscripten_check_mailbox=Module["__emscripten_check_mailbox"]=()=>(__emscripten_check_mailbox=Module["__emscripten_check_mailbox"]=wasmExports["aa"])();var ___trap=()=>(___trap=wasmExports["ba"])();var _emscripten_stack_set_limits=(a0,a1)=>(_emscripten_stack_set_limits=wasmExports["ca"])(a0,a1);var stackSave=()=>(stackSave=wasmExports["da"])();var stackRestore=a0=>(stackRestore=wasmExports["ea"])(a0);var stackAlloc=a0=>(stackAlloc=wasmExports["fa"])(a0);function applySignatureConversions(exports){exports=Object.assign({},exports);var makeWrapper_pp=f=>a0=>f(a0)>>>0;var makeWrapper_p=f=>()=>f()>>>0;exports["malloc"]=makeWrapper_pp(exports["malloc"]);exports["pthread_self"]=makeWrapper_p(exports["pthread_self"]);exports["stackSave"]=makeWrapper_p(exports["stackSave"]);exports["stackAlloc"]=makeWrapper_pp(exports["stackAlloc"]);return exports}Module["keepRuntimeAlive"]=keepRuntimeAlive;Module["wasmMemory"]=wasmMemory;Module["stringToUTF8"]=stringToUTF8;Module["ExitStatus"]=ExitStatus;var calledRun;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(){var entryFunction=_main;var argc=0;var argv=0;try{var ret=entryFunction(argc,argv);exitJS(ret,true);return ret}catch(e){return handleException(e)}}function run(){if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();startWorker(Module);return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(shouldRunNow)callMain();postRun()}{doRun()}}var shouldRunNow=true;run();
})()