/*!
 * Nutrient Web SDK 1.13.0 (https://www.nutrient.io/sdk/web)
 * 
 * Copyright (c) 2016-2026 PSPDFKit GmbH. All rights reserved.
 * 
 * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
 * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
 * This notice may not be removed from this file.
 * 
 * PSPDFKit uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/web-acknowledgements/
 */
var PSPDFModuleInit=(()=>{var e="undefined"!=typeof document?document.currentScript?.src:void 0;return"undefined"!=typeof __filename&&(e=e||__filename),function(r={}){var t,n,o,a,i=r,s=new Promise((e,r)=>{t=e,n=r}),l="object"==typeof window,u="undefined"!=typeof WorkerGlobalScope,d="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&"renderer"!=process.type,c=!l&&!d&&!u,f=Object.assign({},i),h="./this.program",p=(e,r)=>{throw r},m="";if(d){var v=require("fs");require("path");m=__dirname+"/",a=e=>(e=G(e)?new URL(e):e,v.readFileSync(e)),o=async(e,r=!0)=>(e=G(e)?new URL(e):e,v.readFileSync(e,r?void 0:"utf8")),!i.thisProgram&&process.argv.length>1&&(h=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),p=(e,r)=>{throw process.exitCode=e,r}}else c?(a=e=>{if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));let r=read(e,"binary");return M("object"==typeof r),r},o=async e=>a(e),globalThis.clearTimeout??=e=>{},globalThis.setTimeout??=e=>e(),globalThis.arguments||globalThis.scriptArgs,"function"==typeof quit&&(p=(e,r)=>{throw setTimeout(()=>{if(!(r instanceof Z)){let e=r;r&&"object"==typeof r&&r.stack&&(e=[r,r.stack]),g(`exiting due to exception: ${e}`)}quit(e)}),r}),"undefined"!=typeof print&&(globalThis.console??={},console.log=print,console.warn=console.error=globalThis.printErr??print)):(l||u)&&(u?m=self.location.href:"undefined"!=typeof document&&document.currentScript&&(m=document.currentScript.src),e&&(m=e),m=m.startsWith("blob:")?"":m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1),u&&(a=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),o=async e=>{if(G(e))return new Promise((r,t)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t(n.status)},n.onerror=t,n.send(null)});var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)});var y=i.print||console.log.bind(console),g=i.printErr||console.error.bind(console);Object.assign(i,f),f=null,i.arguments&&i.arguments,i.thisProgram&&(h=i.thisProgram);var w,E=i.wasmBinary;"undefined"==typeof atob&&("undefined"!=typeof global&&"undefined"==typeof globalThis&&(globalThis=global),globalThis.atob=function(e){var r,t,n,o,a,i,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",u=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{r=s.indexOf(e.charAt(u++))<<2|(o=s.indexOf(e.charAt(u++)))>>4,t=(15&o)<<4|(a=s.indexOf(e.charAt(u++)))>>2,n=(3&a)<<6|(i=s.indexOf(e.charAt(u++))),l+=String.fromCharCode(r),64!==a&&(l+=String.fromCharCode(t)),64!==i&&(l+=String.fromCharCode(n))}while(u<e.length);return l});var b,_,$,k,C,P,T,D,F,S=!1;function M(e,r){e||B(r)}function A(){var e=w.buffer;i.HEAP8=_=new Int8Array(e),i.HEAP16=k=new Int16Array(e),i.HEAPU8=$=new Uint8Array(e),i.HEAPU16=C=new Uint16Array(e),i.HEAP32=P=new Int32Array(e),i.HEAPU32=T=new Uint32Array(e),i.HEAPF32=D=new Float32Array(e),i.HEAPF64=F=new Float64Array(e)}var j=[],O=[],R=[],x=!1;function N(e){j.unshift(e)}function z(e){R.unshift(e)}var U=0,W=null;function L(e){U++,i.monitorRunDependencies?.(U)}function I(e){if(U--,i.monitorRunDependencies?.(U),0==U&&W){var r=W;W=null,r()}}function B(e){i.onAbort?.(e),g(e="Aborted("+e+")"),S=!0,e+=". Build with -sASSERTIONS for more info.",x&&Mt();var r=new WebAssembly.RuntimeError(e);throw n(r),r}var H,V,Y,q=e=>e.startsWith("data:application/octet-stream;base64,"),G=e=>e.startsWith("file://");function X(){var e,r="nutrient-viewer.wasm.wasm";return q(r)?r:(e=r,i.locateFile?i.locateFile(e,m):m+e)}async function J(e){if(!E)try{var r=await o(e);return new Uint8Array(r)}catch{}return function(e){if(e==H&&E)return new Uint8Array(E);if(a)return a(e);throw"both async and sync fetching of the wasm failed"}(e)}async function K(e,r,t){if(!(e||"function"!=typeof WebAssembly.instantiateStreaming||q(r)||G(r)||d||"function"!=typeof fetch))try{var n=fetch(r,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(n,t)}catch(e){g(`wasm streaming compile failed: ${e}`),g("falling back to ArrayBuffer instantiation")}return async function(e,r){try{var t=await J(e);return await WebAssembly.instantiate(t,r)}catch(e){g(`failed to asynchronously prepare wasm: ${e}`),B(e)}}(r,t)}class Z{name="ExitStatus";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var Q=e=>{for(;e.length>0;)e.shift()(i)},ee=i.noExitRuntime||!0,re={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,r)=>{for(var t=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=re.isAbs(e),t="/"===e.substr(-1);return(e=re.normalizeArray(e.split("/").filter(e=>!!e),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=re.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:e=>{if("/"===e)return"/";var r=(e=(e=re.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:(...e)=>re.normalize(e.join("/")),join2:(e,r)=>re.normalize(e+"/"+r)},te=e=>(te=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(d)try{var e=require("crypto");if(e.randomFillSync)return r=>e.randomFillSync(r);var r=e.randomBytes;return e=>(e.set(r(e.byteLength)),e)}catch(e){}B("initRandomDevice")})())(e),ne={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:we.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=re.isAbs(o)}return(t?"/":"")+(r=re.normalizeArray(r.split("/").filter(e=>!!e),!t).join("/"))||"."},relative:(e,r)=>{function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=ne.resolve(e).substr(1),r=ne.resolve(r).substr(1);for(var n=t(e.split("/")),o=t(r.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},oe="undefined"!=typeof TextDecoder?new TextDecoder:void 0,ae=(e,r=0,t=NaN)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&oe)return oe.decode(e.subarray(r,o));for(var a="";r<o;){var i=e[r++];if(128&i){var s=63&e[r++];if(192!=(224&i)){var l=63&e[r++];if((i=224==(240&i)?(15&i)<<12|s<<6|l:(7&i)<<18|s<<12|l<<6|63&e[r++])<65536)a+=String.fromCharCode(i);else{var u=i-65536;a+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ie=[],se=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++t):r+=3}return r},le=(e,r,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i);if(s<=127){if(t>=a)break;r[t++]=s}else if(s<=2047){if(t+1>=a)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=a)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o};function ue(e,r,t){var n=t>0?t:se(e)+1,o=new Array(n),a=le(e,o,0,o.length);return r&&(o.length=a),o}var de={ttys:[],init(){},shutdown(){},register(e,r){de.ttys[e]={input:[],output:[],ops:r},we.registerDevice(e,de.stream_ops)},stream_ops:{open(e){var r=de.ttys[e.node.rdev];if(!r)throw new we.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,n,o){if(!e.tty||!e.tty.ops.get_char)throw new we.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new we.ErrnoError(29)}if(void 0===s&&0===a)throw new we.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.atime=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new we.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new we.ErrnoError(29)}return n&&(e.node.mtime=e.node.ctime=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!ie.length){var e=null;if(d){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=v.readSync(n,r,0,256)}catch(e){if(!e.toString().includes("EOF"))throw e;t=0}t>0&&(e=r.slice(0,t).toString("utf-8"))}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&(e=readline())&&(e+="\n");if(!e)return null;ie=ue(e,!0)}return ie.shift()})(),put_char(e,r){null===r||10===r?(y(ae(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(y(ae(e.output)),e.output=[])},ioctl_tcgets:e=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(e,r,t)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,r){null===r||10===r?(g(ae(e.output)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(g(ae(e.output)),e.output=[])}}},ce=(e,r)=>Math.ceil(e/r)*r,fe=e=>{e=ce(e,65536);var r=Ft(65536,e);return r&&((e,r)=>{$.fill(0,e,e+r)})(r,e),r},he={ops_table:null,mount:e=>he.createNode(null,"/",16895,0),createNode(e,r,t,n){if(we.isBlkdev(t)||we.isFIFO(t))throw new we.ErrnoError(63);he.ops_table||={dir:{node:{getattr:he.node_ops.getattr,setattr:he.node_ops.setattr,lookup:he.node_ops.lookup,mknod:he.node_ops.mknod,rename:he.node_ops.rename,unlink:he.node_ops.unlink,rmdir:he.node_ops.rmdir,readdir:he.node_ops.readdir,symlink:he.node_ops.symlink},stream:{llseek:he.stream_ops.llseek}},file:{node:{getattr:he.node_ops.getattr,setattr:he.node_ops.setattr},stream:{llseek:he.stream_ops.llseek,read:he.stream_ops.read,write:he.stream_ops.write,allocate:he.stream_ops.allocate,mmap:he.stream_ops.mmap,msync:he.stream_ops.msync}},link:{node:{getattr:he.node_ops.getattr,setattr:he.node_ops.setattr,readlink:he.node_ops.readlink},stream:{}},chrdev:{node:{getattr:he.node_ops.getattr,setattr:he.node_ops.setattr},stream:we.chrdev_stream_ops}};var o=we.createNode(e,r,t,n);return we.isDir(o.mode)?(o.node_ops=he.ops_table.dir.node,o.stream_ops=he.ops_table.dir.stream,o.contents={}):we.isFile(o.mode)?(o.node_ops=he.ops_table.file.node,o.stream_ops=he.ops_table.file.stream,o.usedBytes=0,o.contents=null):we.isLink(o.mode)?(o.node_ops=he.ops_table.link.node,o.stream_ops=he.ops_table.link.stream):we.isChrdev(o.mode)&&(o.node_ops=he.ops_table.chrdev.node,o.stream_ops=he.ops_table.chrdev.stream),o.atime=o.mtime=o.ctime=Date.now(),e&&(e.contents[r]=o,e.atime=e.mtime=e.ctime=o.atime),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)>>>0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,r){if(e.usedBytes!=r)if(0==r)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(r),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=we.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,we.isDir(e.mode)?r.size=4096:we.isFile(e.mode)?r.size=e.usedBytes:we.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of["mode","atime","mtime","ctime"])r[t]&&(e[t]=r[t]);void 0!==r.size&&he.resizeFileStorage(e,r.size)},lookup(e,r){throw he.doesNotExistError},mknod:(e,r,t,n)=>he.createNode(e,r,t,n),rename(e,r,t){var n;try{n=we.lookupNode(r,t)}catch(e){}if(n){if(we.isDir(e.mode))for(var o in n.contents)throw new we.ErrnoError(55);we.hashRemoveNode(n)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=we.lookupNode(e,r);for(var n in t.contents)throw new we.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir:e=>[".","..",...Object.keys(e.contents)],symlink(e,r,t){var n=he.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!we.isLink(e.mode))throw new we.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)r.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)r[t+s]=a[o+s];return i},write(e,r,t,n,o,a){if(r.buffer===_.buffer&&(a=!1),!n)return 0;var i=e.node;if(i.mtime=i.ctime=Date.now(),r.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=r.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=r.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(r.subarray(t,t+n),o),n}if(he.expandFileStorage(i,o+n),i.contents.subarray&&r.subarray)i.contents.set(r.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=r[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&we.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new we.ErrnoError(28);return n},allocate(e,r,t){he.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,o){if(!we.isFile(e.node.mode))throw new we.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||!s||s.buffer!==_.buffer){if(i=!0,!(a=fe(r)))throw new we.ErrnoError(48);s&&((t>0||t+r<s.length)&&(s=s.subarray?s.subarray(t,t+r):Array.prototype.slice.call(s,t,t+r)),_.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,r,t,n,o)=>(he.stream_ops.write(e,r,0,n,t,!1),0)}},pe=(e,r,t,n,o,a)=>{we.createDataFile(e,r,t,n,o,a)},me=i.preloadPlugins||[],ve=(e,r,t,n,a,i,s,l,u,d)=>{var c=r?ne.resolve(re.join2(e,r)):e;function f(t){function o(t){d?.(),l||pe(e,r,t,n,a,u),i?.(),I()}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return me.forEach(a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)}),o})(t,c,o,()=>{s?.(),I()})||o(t)}L(),"string"==typeof t?(async e=>{var r=await o(e);return new Uint8Array(r)})(t).then(f,s):f(t)},ye=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},ge={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount(e){M(u),ge.reader??=new FileReaderSync;var r=ge.createNode(null,"/",ge.DIR_MODE,0),t={};function n(e){for(var n=e.split("/"),o=r,a=0;a<n.length-1;a++){var i=n.slice(0,a+1).join("/");t[i]||=ge.createNode(o,n[a],ge.DIR_MODE,0),o=t[i]}return o}function o(e){var r=e.split("/");return r[r.length-1]}return Array.prototype.forEach.call(e.opts.files||[],function(e){ge.createNode(n(e.name),o(e.name),ge.FILE_MODE,0,e,e.lastModifiedDate)}),(e.opts.blobs||[]).forEach(e=>{ge.createNode(n(e.name),o(e.name),ge.FILE_MODE,0,e.data)}),(e.opts.packages||[]).forEach(e=>{e.metadata.files.forEach(r=>{var t=r.filename.substr(1);ge.createNode(n(t),o(t),ge.FILE_MODE,0,e.blob.slice(r.start,r.end))})}),r},createNode(e,r,t,n,o,a){var i=we.createNode(e,r,t);return i.mode=t,i.node_ops=ge.node_ops,i.stream_ops=ge.stream_ops,i.atime=i.mtime=i.ctime=(a||new Date).getTime(),M(ge.FILE_MODE!==ge.DIR_MODE),t===ge.FILE_MODE?(i.size=o.size,i.contents=o):(i.size=4096,i.contents={}),e&&(e.contents[r]=i),i},node_ops:{getattr:e=>({dev:1,ino:e.id,mode:e.mode,nlink:1,uid:0,gid:0,rdev:0,size:e.size,atime:new Date(e.atime),mtime:new Date(e.mtime),ctime:new Date(e.ctime),blksize:4096,blocks:Math.ceil(e.size/4096)}),setattr(e,r){for(const t of["mode","atime","mtime","ctime"])r[t]&&(e[t]=r[t])},lookup(e,r){throw new we.ErrnoError(44)},mknod(e,r,t,n){throw new we.ErrnoError(63)},rename(e,r,t){throw new we.ErrnoError(63)},unlink(e,r){throw new we.ErrnoError(63)},rmdir(e,r){throw new we.ErrnoError(63)},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){throw new we.ErrnoError(63)}},stream_ops:{read(e,r,t,n,o){if(o>=e.node.size)return 0;var a=e.node.contents.slice(o,o+n),i=ge.reader.readAsArrayBuffer(a);return r.set(new Uint8Array(i),t),a.size},write(e,r,t,n,o){throw new we.ErrnoError(29)},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&we.isFile(e.node.mode)&&(n+=e.node.size),n<0)throw new we.ErrnoError(28);return n}}},we={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{name="ErrnoError";constructor(e){this.errno=e}},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.id=we.nextInode++,this.name=r,this.mode=t,this.rdev=n,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return we.isDir(this.mode)}get isDevice(){return we.isChrdev(this.mode)}},lookupPath(e,r={}){if(!e)return{path:"",node:null};r.follow_mount??=!0,re.isAbs(e)||(e=we.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var n=e.split("/").filter(e=>!!e&&"."!==e),o=we.root,a="/",i=0;i<n.length;i++){var s=i===n.length-1;if(s&&r.parent)break;if(".."!==n[i]){a=re.join2(a,n[i]);try{o=we.lookupNode(o,n[i])}catch(e){if(44===e?.errno&&s&&r.noent_okay)return{path:a};throw e}if(!we.isMountpoint(o)||s&&!r.follow_mount||(o=o.mounted.root),we.isLink(o.mode)&&(!s||r.follow)){if(!o.node_ops.readlink)throw new we.ErrnoError(52);var l=o.node_ops.readlink(o);re.isAbs(l)||(l=re.dirname(a)+"/"+l),e=l+"/"+n.slice(i+1).join("/");continue e}}else a=re.dirname(a),o=o.parent}return{path:a,node:o}}throw new we.ErrnoError(32)},getPath(e){for(var r;;){if(we.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%we.nameTable.length},hashAddNode(e){var r=we.hashName(e.parent.id,e.name);e.name_next=we.nameTable[r],we.nameTable[r]=e},hashRemoveNode(e){var r=we.hashName(e.parent.id,e.name);if(we.nameTable[r]===e)we.nameTable[r]=e.name_next;else for(var t=we.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=we.mayLookup(e);if(t)throw new we.ErrnoError(t);for(var n=we.hashName(e.id,r),o=we.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return we.lookup(e,r)},createNode(e,r,t,n){var o=new we.FSNode(e,r,t,n);return we.hashAddNode(o),o},destroyNode(e){we.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>we.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup(e){if(!we.isDir(e.mode))return 54;var r=we.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){if(!we.isDir(e.mode))return 54;try{we.lookupNode(e,r);return 20}catch(e){}return we.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=we.lookupNode(e,r)}catch(e){return e.errno}var o=we.nodePermissions(e,"wx");if(o)return o;if(t){if(!we.isDir(n.mode))return 54;if(we.isRoot(n)||we.getPath(n)===we.cwd())return 10}else if(we.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?we.isLink(e.mode)?32:we.isDir(e.mode)&&("r"!==we.flagsToPermissionString(r)||512&r)?31:we.nodePermissions(e,we.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=we.MAX_OPEN_FDS;e++)if(!we.streams[e])return e;throw new we.ErrnoError(33)},getStreamChecked(e){var r=we.getStream(e);if(!r)throw new we.ErrnoError(8);return r},getStream:e=>we.streams[e],createStream:(e,r=-1)=>(e=Object.assign(new we.FSStream,e),-1==r&&(r=we.nextfd()),e.fd=r,we.streams[r]=e,e),closeStream(e){we.streams[e]=null},dupStream(e,r=-1){var t=we.createStream(e,r);return t.stream_ops?.dup?.(t),t},chrdev_stream_ops:{open(e){var r=we.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new we.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){we.devices[e]={stream_ops:r}},getDevice:e=>we.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push(...n.mounts)}return r},syncfs(e,r){"function"==typeof e&&(r=e,e=!1),we.syncFSRequests++,we.syncFSRequests>1&&g(`warning: ${we.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=we.getMounts(we.root.mount),n=0;function o(e){return we.syncFSRequests--,r(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=t.length&&o(null)}t.forEach(r=>{if(!r.type.syncfs)return a(null);r.type.syncfs(r,e,a)})},mount(e,r,t){var n,o="/"===t,a=!t;if(o&&we.root)throw new we.ErrnoError(10);if(!o&&!a){var i=we.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,we.isMountpoint(n))throw new we.ErrnoError(10);if(!we.isDir(n.mode))throw new we.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,o?we.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(e){var r=we.lookupPath(e,{follow_mount:!1});if(!we.isMountpoint(r.node))throw new we.ErrnoError(28);var t=r.node,n=t.mounted,o=we.getMounts(n);Object.keys(we.nameTable).forEach(e=>{for(var r=we.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&we.destroyNode(r),r=t}}),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(e,r)=>e.node_ops.lookup(e,r),mknod(e,r,t){var n=we.lookupPath(e,{parent:!0}).node,o=re.basename(e);if(!o||"."===o||".."===o)throw new we.ErrnoError(28);var a=we.mayCreate(n,o);if(a)throw new we.ErrnoError(a);if(!n.node_ops.mknod)throw new we.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},statfs(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:we.nextInode,ffree:we.nextInode-1,fsid:42,flags:2,namelen:255},t=we.lookupPath(e,{follow:!0}).node;return t?.node_ops.statfs&&Object.assign(r,t.node_ops.statfs(t.mount.opts.root)),r},create:(e,r=438)=>(r&=4095,r|=32768,we.mknod(e,r,0)),mkdir:(e,r=511)=>(r&=1023,r|=16384,we.mknod(e,r,0)),mkdirTree(e,r){for(var t=e.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{we.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,we.mknod(e,r,t)),symlink(e,r){if(!ne.resolve(e))throw new we.ErrnoError(44);var t=we.lookupPath(r,{parent:!0}).node;if(!t)throw new we.ErrnoError(44);var n=re.basename(r),o=we.mayCreate(t,n);if(o)throw new we.ErrnoError(o);if(!t.node_ops.symlink)throw new we.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=re.dirname(e),a=re.dirname(r),i=re.basename(e),s=re.basename(r);if(t=we.lookupPath(e,{parent:!0}).node,n=we.lookupPath(r,{parent:!0}).node,!t||!n)throw new we.ErrnoError(44);if(t.mount!==n.mount)throw new we.ErrnoError(75);var l,u=we.lookupNode(t,i),d=ne.relative(e,a);if("."!==d.charAt(0))throw new we.ErrnoError(28);if("."!==(d=ne.relative(r,o)).charAt(0))throw new we.ErrnoError(55);try{l=we.lookupNode(n,s)}catch(e){}if(u!==l){var c=we.isDir(u.mode),f=we.mayDelete(t,i,c);if(f)throw new we.ErrnoError(f);if(f=l?we.mayDelete(n,s,c):we.mayCreate(n,s))throw new we.ErrnoError(f);if(!t.node_ops.rename)throw new we.ErrnoError(63);if(we.isMountpoint(u)||l&&we.isMountpoint(l))throw new we.ErrnoError(10);if(n!==t&&(f=we.nodePermissions(t,"w")))throw new we.ErrnoError(f);we.hashRemoveNode(u);try{t.node_ops.rename(u,n,s),u.parent=n}catch(e){throw e}finally{we.hashAddNode(u)}}},rmdir(e){var r=we.lookupPath(e,{parent:!0}).node,t=re.basename(e),n=we.lookupNode(r,t),o=we.mayDelete(r,t,!0);if(o)throw new we.ErrnoError(o);if(!r.node_ops.rmdir)throw new we.ErrnoError(63);if(we.isMountpoint(n))throw new we.ErrnoError(10);r.node_ops.rmdir(r,t),we.destroyNode(n)},readdir(e){var r=we.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new we.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=we.lookupPath(e,{parent:!0}).node;if(!r)throw new we.ErrnoError(44);var t=re.basename(e),n=we.lookupNode(r,t),o=we.mayDelete(r,t,!1);if(o)throw new we.ErrnoError(o);if(!r.node_ops.unlink)throw new we.ErrnoError(63);if(we.isMountpoint(n))throw new we.ErrnoError(10);r.node_ops.unlink(r,t),we.destroyNode(n)},readlink(e){var r=we.lookupPath(e).node;if(!r)throw new we.ErrnoError(44);if(!r.node_ops.readlink)throw new we.ErrnoError(28);return r.node_ops.readlink(r)},stat(e,r){var t=we.lookupPath(e,{follow:!r}).node;if(!t)throw new we.ErrnoError(44);if(!t.node_ops.getattr)throw new we.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>we.stat(e,!0),chmod(e,r,t){var n;"string"==typeof e?n=we.lookupPath(e,{follow:!t}).node:n=e;if(!n.node_ops.setattr)throw new we.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,ctime:Date.now()})},lchmod(e,r){we.chmod(e,r,!0)},fchmod(e,r){var t=we.getStreamChecked(e);we.chmod(t.node,r)},chown(e,r,t,n){var o;"string"==typeof e?o=we.lookupPath(e,{follow:!n}).node:o=e;if(!o.node_ops.setattr)throw new we.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){we.chown(e,r,t,!0)},fchown(e,r,t){var n=we.getStreamChecked(e);we.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new we.ErrnoError(28);var t;"string"==typeof e?t=we.lookupPath(e,{follow:!0}).node:t=e;if(!t.node_ops.setattr)throw new we.ErrnoError(63);if(we.isDir(t.mode))throw new we.ErrnoError(31);if(!we.isFile(t.mode))throw new we.ErrnoError(28);var n=we.nodePermissions(t,"w");if(n)throw new we.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=we.getStreamChecked(e);if(!(2097155&t.flags))throw new we.ErrnoError(28);we.truncate(t.node,r)},utime(e,r,t){var n=we.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{atime:r,mtime:t})},open(e,r,t=438){if(""===e)throw new we.ErrnoError(44);var n;if(t=64&(r="string"==typeof r?(e=>{var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(void 0===r)throw new Error(`Unknown file open mode: ${e}`);return r})(r):r)?4095&t|32768:0,"object"==typeof e)n=e;else{var o=we.lookupPath(e,{follow:!(131072&r),noent_okay:!0});n=o.node,e=o.path}var a=!1;if(64&r)if(n){if(128&r)throw new we.ErrnoError(20)}else n=we.mknod(e,t,0),a=!0;if(!n)throw new we.ErrnoError(44);if(we.isChrdev(n.mode)&&(r&=-513),65536&r&&!we.isDir(n.mode))throw new we.ErrnoError(54);if(!a){var s=we.mayOpen(n,r);if(s)throw new we.ErrnoError(s)}512&r&&!a&&we.truncate(n,0),r&=-131713;var l=we.createStream({node:n,path:we.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),!i.logReadFiles||1&r||e in we.readFiles||(we.readFiles[e]=1),l},close(e){if(we.isClosed(e))throw new we.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{we.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(we.isClosed(e))throw new we.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new we.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new we.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,n,o){if(n<0||o<0)throw new we.ErrnoError(28);if(we.isClosed(e))throw new we.ErrnoError(8);if(1==(2097155&e.flags))throw new we.ErrnoError(8);if(we.isDir(e.node.mode))throw new we.ErrnoError(31);if(!e.stream_ops.read)throw new we.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new we.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,r,t,n,o);return a||(e.position+=i),i},write(e,r,t,n,o,a){if(n<0||o<0)throw new we.ErrnoError(28);if(we.isClosed(e))throw new we.ErrnoError(8);if(!(2097155&e.flags))throw new we.ErrnoError(8);if(we.isDir(e.node.mode))throw new we.ErrnoError(31);if(!e.stream_ops.write)throw new we.ErrnoError(28);e.seekable&&1024&e.flags&&we.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new we.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,r,t,n,o,a);return i||(e.position+=s),s},allocate(e,r,t){if(we.isClosed(e))throw new we.ErrnoError(8);if(r<0||t<=0)throw new we.ErrnoError(28);if(!(2097155&e.flags))throw new we.ErrnoError(8);if(!we.isFile(e.node.mode)&&!we.isDir(e.node.mode))throw new we.ErrnoError(43);if(!e.stream_ops.allocate)throw new we.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&e.flags))throw new we.ErrnoError(2);if(1==(2097155&e.flags))throw new we.ErrnoError(2);if(!e.stream_ops.mmap)throw new we.ErrnoError(43);if(!r)throw new we.ErrnoError(28);return e.stream_ops.mmap(e,r,t,n,o)},msync:(e,r,t,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,o):0,ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new we.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error(`Invalid encoding type "${r.encoding}"`);var t,n=we.open(e,r.flags),o=we.stat(e).size,a=new Uint8Array(o);return we.read(n,a,0,o,0),"utf8"===r.encoding?t=ae(a):"binary"===r.encoding&&(t=a),we.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=we.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(se(r)+1),a=le(r,o,0,o.length);we.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");we.write(n,r,0,r.byteLength,void 0,t.canOwn)}we.close(n)},cwd:()=>we.currentPath,chdir(e){var r=we.lookupPath(e,{follow:!0});if(null===r.node)throw new we.ErrnoError(44);if(!we.isDir(r.node.mode))throw new we.ErrnoError(54);var t=we.nodePermissions(r.node,"x");if(t)throw new we.ErrnoError(t);we.currentPath=r.path},createDefaultDirectories(){we.mkdir("/tmp"),we.mkdir("/home"),we.mkdir("/home/web_user")},createDefaultDevices(){we.mkdir("/dev"),we.registerDevice(we.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n,llseek:()=>0}),we.mkdev("/dev/null",we.makedev(1,3)),de.register(we.makedev(5,0),de.default_tty_ops),de.register(we.makedev(6,0),de.default_tty1_ops),we.mkdev("/dev/tty",we.makedev(5,0)),we.mkdev("/dev/tty1",we.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=te(e).byteLength),e[--r]);we.createDevice("/dev","random",t),we.createDevice("/dev","urandom",t),we.mkdir("/dev/shm"),we.mkdir("/dev/shm/tmp")},createSpecialDirectories(){we.mkdir("/proc");var e=we.mkdir("/proc/self");we.mkdir("/proc/self/fd"),we.mount({mount(){var r=we.createNode(e,"fd",16895,73);return r.stream_ops={llseek:he.stream_ops.llseek},r.node_ops={lookup(e,r){var t=+r,n=we.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path},id:t+1};return o.parent=o,o},readdir:()=>Array.from(we.streams.entries()).filter(([e,r])=>r).map(([e,r])=>e.toString())},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?we.createDevice("/dev","stdin",e):we.symlink("/dev/tty","/dev/stdin"),r?we.createDevice("/dev","stdout",null,r):we.symlink("/dev/tty","/dev/stdout"),t?we.createDevice("/dev","stderr",null,t):we.symlink("/dev/tty1","/dev/stderr");we.open("/dev/stdin",0),we.open("/dev/stdout",1),we.open("/dev/stderr",1)},staticInit(){we.nameTable=new Array(4096),we.mount(he,{},"/"),we.createDefaultDirectories(),we.createDefaultDevices(),we.createSpecialDirectories(),we.filesystems={MEMFS:he,WORKERFS:ge}},init(e,r,t){we.initialized=!0,e??=i.stdin,r??=i.stdout,t??=i.stderr,we.createStandardStreams(e,r,t)},quit(){we.initialized=!1;for(var e=0;e<we.streams.length;e++){var r=we.streams[e];r&&we.close(r)}},findObject(e,r){var t=we.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=we.lookupPath(e,{follow:!r})).path}catch(e){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=we.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=re.basename(e),n=we.lookupPath(e,{follow:!r}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(e){t.error=e.errno}return t},createPath(e,r,t,n){e="string"==typeof e?e:we.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=re.join2(e,a);try{we.mkdir(i)}catch(e){}e=i}}return i},createFile(e,r,t,n,o){var a=re.join2("string"==typeof e?e:we.getPath(e),r),i=ye(n,o);return we.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:we.getPath(e),i=r?re.join2(e,r):e);var s=ye(n,o),l=we.create(i,s);if(t){if("string"==typeof t){for(var u=new Array(t.length),d=0,c=t.length;d<c;++d)u[d]=t.charCodeAt(d);t=u}we.chmod(l,146|s);var f=we.open(l,577);we.write(f,t,0,t.length,0,a),we.close(f),we.chmod(l,s)}},createDevice(e,r,t,n){var o=re.join2("string"==typeof e?e:we.getPath(e),r),a=ye(!!t,!!n);we.createDevice.major??=64;var i=we.makedev(we.createDevice.major++,0);return we.registerDevice(i,{open(e){e.seekable=!1},close(e){n?.buffer?.length&&n(10)},read(e,r,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=t()}catch(e){throw new we.ErrnoError(29)}if(void 0===l&&0===i)throw new we.ErrnoError(6);if(null==l)break;i++,r[n+s]=l}return i&&(e.node.atime=Date.now()),i},write(e,r,t,o,a){for(var i=0;i<o;i++)try{n(r[t+i])}catch(e){throw new we.ErrnoError(29)}return o&&(e.node.mtime=e.node.ctime=Date.now()),i}}),we.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{e.contents=a(e.url),e.usedBytes=e.contents.length}catch(e){throw new we.ErrnoError(29)}},createLazyFile(e,r,t,n,o){class a{lengthKnown=!1;chunks=[];get(e){if(!(e>this.length-1||e<0)){var r=e%this.chunkSize,t=e/this.chunkSize|0;return this.getter(t)[r]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),o=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,a=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,i=1048576;o||(i=n);var s=this;s.setDataGetter(e=>{var r=e*i,o=(e+1)*i-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=((e,r)=>{if(e>r)throw new Error("invalid range ("+e+", "+r+") or no bytes requested!");if(r>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",t,!1),n!==i&&o.setRequestHeader("Range","bytes="+e+"-"+r),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+t+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ue(o.responseText||"",!0)})(r,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]}),!a&&n||(i=n=1,n=this.getter(0).length,i=n,y("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=i,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if("undefined"!=typeof XMLHttpRequest){if(!u)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,contents:new a}}else i={isDevice:!1,url:t};var s=we.createFile(e,r,i,n,o);i.contents?s.contents=i.contents:i.url&&(s.contents=null,s.url=i.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var l={};function d(e,r,t,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)r[t+s]=a[o+s];else for(s=0;s<i;s++)r[t+s]=a.get(o+s);return i}return Object.keys(s.stream_ops).forEach(e=>{var r=s.stream_ops[e];l[e]=(...e)=>(we.forceLoadFile(s),r(...e))}),l.read=(e,r,t,n,o)=>(we.forceLoadFile(s),d(e,r,t,n,o)),l.mmap=(e,r,t,n,o)=>{we.forceLoadFile(s);var a=fe(r);if(!a)throw new we.ErrnoError(48);return d(e,_,a,r,t),{ptr:a,allocated:!0}},s.stream_ops=l,s}},Ee=(e,r)=>e?ae($,e,r):"",be={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(re.isAbs(r))return r;var n;-100===e?n=we.cwd():n=be.getStreamFromFD(e).path;if(0==r.length){if(!t)throw new we.ErrnoError(44);return n}return n+"/"+r},doStat(e,r,t){var n=e(r);P[t>>2]=n.dev,P[t+4>>2]=n.mode,T[t+8>>2]=n.nlink,P[t+12>>2]=n.uid,P[t+16>>2]=n.gid,P[t+20>>2]=n.rdev,Y=[n.size>>>0,(V=n.size,+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],P[t+24>>2]=Y[0],P[t+28>>2]=Y[1],P[t+32>>2]=4096,P[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return Y=[Math.floor(o/1e3)>>>0,(V=Math.floor(o/1e3),+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],P[t+40>>2]=Y[0],P[t+44>>2]=Y[1],T[t+48>>2]=o%1e3*1e3*1e3,Y=[Math.floor(a/1e3)>>>0,(V=Math.floor(a/1e3),+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],P[t+56>>2]=Y[0],P[t+60>>2]=Y[1],T[t+64>>2]=a%1e3*1e3*1e3,Y=[Math.floor(i/1e3)>>>0,(V=Math.floor(i/1e3),+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],P[t+72>>2]=Y[0],P[t+76>>2]=Y[1],T[t+80>>2]=i%1e3*1e3*1e3,Y=[n.ino>>>0,(V=n.ino,+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],P[t+88>>2]=Y[0],P[t+92>>2]=Y[1],0},doMsync(e,r,t,n,o){if(!we.isFile(r.node.mode))throw new we.ErrnoError(43);if(2&n)return 0;var a=$.slice(e,e+t);we.msync(r,a,o,t,n)},getStreamFromFD:e=>we.getStreamChecked(e),varargs:void 0,getStr:e=>Ee(e)};var _e=()=>{var e=P[+be.varargs>>2];return be.varargs+=4,e},$e=_e;var ke=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN;var Ce=(e,r,t)=>le(e,$,r,t);var Pe,Te,De,Fe,Se=(e,r)=>Object.defineProperty(r,"name",{value:e}),Me=[],Ae=[],je=e=>{throw new Pe(e)},Oe=()=>Ae.length/2-5-Me.length,Re=e=>(e||je("Cannot use deleted val. handle = "+e),Ae[e]),xe=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=Me.pop()||Ae.length;return Ae[r]=e,Ae[r+1]=1,r}}},Ne=(e,r)=>{var t=Se(r,function(e){this.name=r,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},t},ze=e=>{for(var r="",t=e;$[t];)r+=De[$[t++]];return r},Ue={},We=(e,r)=>{for(void 0===r&&je("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},Le={},Ie=e=>{var r=Pt(e),t=ze(r);return Dt(r),t},Be=(e,r)=>{var t=Le[e];return void 0===t&&je(`${r} has unknown type ${Ie(e)}`),t},He=e=>{},Ve=!1,Ye=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},qe=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=qe(e,r,t.baseClass);return null===n?null:t.downcast(n)},Ge={},Xe=e=>{throw new Fe(e)},Je=(e,r)=>(r.ptrType&&r.ptr||Xe("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!==!!r.smartPtr&&Xe("Both smartPtrType and smartPtr must be specified"),r.count={value:1},Ze(Object.create(e,{$$:{value:r,writable:!0}})));function Ke(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=((e,r)=>(r=We(e,r),Ue[r]))(this.registeredClass,r);if(void 0!==t){if(0===t.$$.count.value)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var n=t.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?Je(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):Je(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(r),s=Ge[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var l=qe(r,this.registeredClass,a.registeredClass);return null===l?o.call(this):this.isSmartPointer?Je(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):Je(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}var Ze=e=>"undefined"==typeof FinalizationRegistry?(Ze=e=>e,e):(Ve=new FinalizationRegistry(e=>{Ye(e.$$)}),Ze=e=>{var r=e.$$;if(!!r.smartPtr){var t={$$:r};Ve.register(e,t,e)}return e},He=e=>Ve.unregister(e),Ze(e)),Qe={},er=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function rr(e){return this.fromWireType(T[e>>2])}var tr={},nr={},or=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&Xe("Mismatched type converter count");for(var o=0;o<e.length;++o)ar(e[o],n[o])}e.forEach(e=>nr[e]=r);var o=new Array(r.length),a=[],i=0;r.forEach((e,r)=>{Le.hasOwnProperty(e)?o[r]=Le[e]:(a.push(e),tr.hasOwnProperty(e)||(tr[e]=[]),tr[e].push(()=>{o[r]=Le[e],++i===a.length&&n(o)}))}),0===a.length&&n(o)};function ar(e,r,t={}){return function(e,r,t={}){var n=r.name;if(e||je(`type "${n}" must have a positive integer typeid pointer`),Le.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;je(`Cannot register type '${n}' twice`)}if(Le[e]=r,delete nr[e],tr.hasOwnProperty(e)){var o=tr[e];delete tr[e],o.forEach(e=>e())}}(e,r,t)}var ir=8,sr=e=>{je(e.$$.ptrType.registeredClass.name+" instance already deleted")},lr=[];function ur(){}var dr=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(...n){return e[r].overloadTable.hasOwnProperty(n.length)||je(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${e[r].overloadTable})!`),e[r].overloadTable[n.length].apply(this,n)},e[r].overloadTable=[],e[r].overloadTable[n.argCount]=n}},cr=(e,r,t)=>{i.hasOwnProperty(e)?((void 0===t||void 0!==i[e].overloadTable&&void 0!==i[e].overloadTable[t])&&je(`Cannot register public name '${e}' twice`),dr(i,e,e),i[e].overloadTable.hasOwnProperty(t)&&je(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),i[e].overloadTable[t]=r):(i[e]=r,i[e].argCount=t)};function fr(e,r,t,n,o,a,i,s){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var hr=(e,r,t)=>{for(;r!==t;)r.upcast||je(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function pr(e,r){if(null===r)return this.isReference&&je(`null is not a valid ${this.name}`),0;r.$$||je(`Cannot pass "${Mr(r)}" as a ${this.name}`),r.$$.ptr||je(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return hr(r.$$.ptr,t,this.registeredClass)}function mr(e,r){var t;if(null===r)return this.isReference&&je(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r&&r.$$||je(`Cannot pass "${Mr(r)}" as a ${this.name}`),r.$$.ptr||je(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&je(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(t=hr(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&je("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:je(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,xe(()=>o.delete())),null!==e&&e.push(this.rawDestructor,t)}break;default:je("Unsupporting sharing policy")}return t}function vr(e,r){if(null===r)return this.isReference&&je(`null is not a valid ${this.name}`),0;r.$$||je(`Cannot pass "${Mr(r)}" as a ${this.name}`),r.$$.ptr||je(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&je(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return hr(r.$$.ptr,t,this.registeredClass)}function yr(e,r,t,n,o,a,i,s,l,u,d){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=l,this.rawShare=u,this.rawDestructor=d,o||void 0!==r.baseClass?this.toWireType=mr:n?(this.toWireType=pr,this.destructorFunction=null):(this.toWireType=vr,this.destructorFunction=null)}var gr,wr,Er=(e,r,t)=>{i.hasOwnProperty(e)||Xe("Replacing nonexistent public symbol"),void 0!==i[e].overloadTable&&void 0!==t?i[e].overloadTable[t]=r:(i[e]=r,i[e].argCount=t)},br=e=>gr.get(e),_r=(e,r,t=[])=>e.includes("j")?((e,r,t)=>(e=e.replace(/p/g,"i"),(0,i["dynCall_"+e])(r,...t)))(e,r,t):br(r)(...t),$r=(e,r)=>{var t,n,o=(e=ze(e)).includes("j")?(t=e,n=r,(...e)=>_r(t,n,e)):br(r);return"function"!=typeof o&&je(`unknown function pointer with signature ${e}: ${r}`),o},kr=(e,r)=>{var t=[],n={};throw r.forEach(function e(r){n[r]||Le[r]||(nr[r]?nr[r].forEach(e):(t.push(r),n[r]=!0))}),new wr(`${e}: `+t.map(Ie).join([", "]))};function Cr(e,r,t,n,o,a){var i=r.length;i<2&&je("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==r[1]&&null!==t,l=function(e){for(var r=1;r<e.length;++r)if(null!==e[r]&&void 0===e[r].destructorFunction)return!0;return!1}(r),u="void"!==r[0].name,d=i-2,c=new Array(d),f=[],h=[];return Se(e,function(...e){var t;h.length=0,f.length=s?2:1,f[0]=o,s&&(t=r[1].toWireType(h,this),f[1]=t);for(var a=0;a<d;++a)c[a]=r[a+2].toWireType(h,e[a]),f.push(c[a]);return function(e){if(l)er(h);else for(var n=s?1:2;n<r.length;n++){var o=1===n?t:c[n-2];null!==r[n].destructorFunction&&r[n].destructorFunction(o)}if(u)return r[0].fromWireType(e)}(n(...f))})}var Pr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(T[r+4*n>>2]);return t},Tr=e=>{const r=(e=e.trim()).indexOf("(");return-1!==r?e.substr(0,r):e},Dr=(e,r,t)=>(e instanceof Object||je(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||je(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||je(`cannot call emscripten binding method ${t} on deleted object`),hr(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),Fr=e=>{e>9&&0===--Ae[e+1]&&(Ae[e]=void 0,Me.push(e))},Sr={name:"emscripten::val",fromWireType:e=>{var r=Re(e);return Fr(e),r},toWireType:(e,r)=>xe(r),argPackAdvance:ir,readValueFromPointer:rr,destructorFunction:null},Mr=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},Ar=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(D[e>>2])};case 8:return function(e){return this.fromWireType(F[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},jr=(e,r,t)=>{switch(r){case 1:return t?e=>_[e]:e=>$[e];case 2:return t?e=>k[e>>1]:e=>C[e>>1];case 4:return t?e=>P[e>>2]:e=>T[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Or=Object.assign({optional:!0},Sr),Rr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,xr=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&C[n];)++n;if((t=n<<1)-e>32&&Rr)return Rr.decode($.subarray(e,t));for(var a="",i=0;!(i>=r/2);++i){var s=k[e+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},Nr=(e,r,t)=>{if(t??=2147483647,t<2)return 0;for(var n=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a<o;++a){var i=e.charCodeAt(a);k[r>>1]=i,r+=2}return k[r>>1]=0,r-n},zr=e=>2*e.length,Ur=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=P[e+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Wr=(e,r,t)=>{if(t??=2147483647,t<4)return 0;for(var n=r,o=n+t-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343)i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a);if(P[r>>2]=i,(r+=4)+4>o)break}return P[r>>2]=0,r-n},Lr=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&++t,r+=4}return r},Ir=0,Br=(e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(T[r>>2]=xe(n)),o},Hr=[],Vr={},Yr=e=>{var r=Vr[e];return void 0===r?ze(e):r},qr=()=>{if("object"==typeof globalThis)return globalThis;function e(e){e.$$$embind_global$$$=e;var r="object"==typeof $$$embind_global$$$&&e.$$$embind_global$$$==e;return r||delete e.$$$embind_global$$$,r}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof global&&e(global)?$$$embind_global$$$=global:"object"==typeof self&&e(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},Gr=Reflect.construct;var Xr=e=>e%4==0&&(e%100!=0||e%400==0),Jr=[0,31,60,91,121,152,182,213,244,274,305,335],Kr=[0,31,59,90,120,151,181,212,243,273,304,334],Zr=e=>(Xr(e.getFullYear())?Jr:Kr)[e.getMonth()]+e.getDate()-1;var Qr=e=>At(e);var et={},rt=e=>{if(e instanceof Z||"unwind"==e)return b;p(1,e)},tt=()=>ee||Ir>0,nt=e=>{b=e,tt()||(i.onExit?.(e),S=!0),p(e,new Z(e))},ot=(e,r)=>{b=e,nt(e)},at=e=>{if(!S)try{e(),(()=>{if(!tt())try{ot(b)}catch(e){rt(e)}})()}catch(e){rt(e)}},it=()=>performance.now(),st=()=>Date.now();var lt=e=>{var r=(e-w.buffer.byteLength+65535)/65536|0;try{return w.grow(r),A(),1}catch(e){}},ut=e=>(B("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),dt={},ct=e=>{e.forEach(e=>{var r=ut();r&&(dt[r]=e)})},ft=()=>(new Error).stack.toString(),ht={},pt=()=>{if(!pt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:h||"./this.program"};for(var r in ht)void 0===ht[r]?delete e[r]:e[r]=ht[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);pt.strings=t}return pt.strings};var mt=(e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t},vt=[31,29,31,30,31,30,31,31,30,31,30,31],yt=[31,28,31,30,31,30,31,31,30,31,30,31],gt=(e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=Xr(t.getFullYear()),o=t.getMonth(),a=(n?vt:yt)[o];if(!(r>a-t.getDate()))return t.setDate(t.getDate()+r),t;r-=a-t.getDate()+1,t.setDate(1),o<11?t.setMonth(o+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t},wt=e=>parseInt(e),Et=we.createPath,bt=we.createLazyFile,_t=we.createDevice;we.createPreloadedFile=ve,we.staticInit(),i.FS_createPath=we.createPath,i.FS_createDataFile=we.createDataFile,i.FS_createPreloadedFile=we.createPreloadedFile,i.FS_unlink=we.unlink,i.FS_createLazyFile=we.createLazyFile,i.FS_createDevice=we.createDevice,he.doesNotExistError=new we.ErrnoError(44),he.doesNotExistError.stack="<generic error, no stack>",Pe=i.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Ae.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=Oe,Te=i.PureVirtualError=Ne(Error,"PureVirtualError"),(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);De=e})(),Fe=i.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(ur.prototype,{isAliasOf(e){if(!(this instanceof ur))return!1;if(!(e instanceof ur))return!1;var r=this.$$.ptrType.registeredClass,t=this.$$.ptr;e.$$=e.$$;for(var n=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return r===n&&t===o},clone(){if(this.$$.ptr||sr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=Ze(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return r.$$.count.value+=1,r.$$.deleteScheduled=!1,r},delete(){this.$$.ptr||sr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&je("Object already scheduled for deletion"),He(this),Ye(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||sr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&je("Object already scheduled for deletion"),lr.push(this),lr.length,this.$$.deleteScheduled=!0,this}}),Object.assign(yr.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:ir,readValueFromPointer:rr,fromWireType:Ke}),wr=i.UnboundTypeError=Ne(Error,"UnboundTypeError");var $t,kt={la:function(e,r){try{return e=be.getStr(e),we.chmod(e,r),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},na:function(e,r,t,n){try{if(r=be.getStr(r),r=be.calculateAt(e,r),-8&t)return-28;var o=we.lookupPath(r,{follow:!0}).node;if(!o)return-44;var a="";return 4&t&&(a+="r"),2&t&&(a+="w"),1&t&&(a+="x"),a&&we.nodePermissions(o,a)?-2:0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},ma:function(e,r){try{return we.fchmod(e,r),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},C:function(e,r,t){be.varargs=t;try{var n=be.getStreamFromFD(e);switch(r){case 0:if((o=_e())<0)return-28;for(;we.streams[o];)o++;return we.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=_e();return n.flags|=o,0;case 12:o=$e();return k[o+0>>1]=2,0}return-28}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},ia:function(e,r){try{var t=be.getStreamFromFD(e);return be.doStat(we.stat,t.path,r)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},R:function(e,r,t){var n=ke(r,t);try{return isNaN(n)?61:(we.ftruncate(e,n),0)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},$:function(e,r,t){try{var n=be.getStreamFromFD(e);n.getdents||=we.readdir(n.path);for(var o=280,a=0,i=we.llseek(n,0,1),s=Math.floor(i/o),l=Math.min(n.getdents.length,s+Math.floor(t/o)),u=s;u<l;u++){var d,c,f=n.getdents[u];if("."===f)d=n.node.id,c=4;else if(".."===f){d=we.lookupPath(n.path,{parent:!0}).node.id,c=4}else{var h;try{h=we.lookupNode(n.node,f)}catch(e){if(28===e?.errno)continue;throw e}d=h.id,c=we.isChrdev(h.mode)?2:we.isDir(h.mode)?4:we.isLink(h.mode)?10:8}Y=[d>>>0,(V=d,+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],P[r+a>>2]=Y[0],P[r+a+4>>2]=Y[1],Y=[(u+1)*o>>>0,(V=(u+1)*o,+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],P[r+a+8>>2]=Y[0],P[r+a+12>>2]=Y[1],k[r+a+16>>1]=280,_[r+a+18]=c,Ce(f,r+a+19,256),a+=o}return we.llseek(n,u*o,0),a}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},ka:function(e,r,t){be.varargs=t;try{var n=be.getStreamFromFD(e);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=$e();P[a>>2]=o.c_iflag||0,P[a+4>>2]=o.c_oflag||0,P[a+8>>2]=o.c_cflag||0,P[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)_[a+i+17]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=$e();var s=P[a>>2],l=P[a+4>>2],u=P[a+8>>2],d=P[a+12>>2],c=[];for(i=0;i<32;i++)c.push(_[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,r,{c_iflag:s,c_oflag:l,c_cflag:u,c_lflag:d,c_cc:c})}return 0;case 21519:if(!n.tty)return-59;a=$e();return P[a>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:a=$e();return we.ioctl(n,r,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=$e();k[a>>1]=f[0],k[a+2>>1]=f[1]}return 0;default:return-28}}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},ga:function(e,r){try{return e=be.getStr(e),be.doStat(we.lstat,e,r)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},ba:function(e,r,t){try{return r=be.getStr(r),r=be.calculateAt(e,r),we.mkdir(r,t,0),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},fa:function(e,r,t,n){try{r=be.getStr(r);var o=256&n,a=4096&n;return n&=-6401,r=be.calculateAt(e,r,a),be.doStat(o?we.lstat:we.stat,r,t)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},u:function(e,r,t,n){be.varargs=n;try{r=be.getStr(r),r=be.calculateAt(e,r);var o=n?_e():0;return we.open(r,t,o).fd}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},_:function(e,r,t,n){try{return r=be.getStr(r),n=be.getStr(n),r=be.calculateAt(e,r),n=be.calculateAt(t,n),we.rename(r,n),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},y:function(e){try{return e=be.getStr(e),we.rmdir(e),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},ha:function(e,r){try{return e=be.getStr(e),be.doStat(we.stat,e,r)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},z:function(e,r,t){try{return r=be.getStr(r),r=be.calculateAt(e,r),0===t?we.unlink(r):512===t?we.rmdir(r):B("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},oa:()=>B(""),va:(e,r,t)=>{e=ze(e),r=Be(r,"wrapper"),t=Re(t);var n=r.registeredClass,o=n.instancePrototype,a=n.baseClass.instancePrototype,i=n.baseClass.constructor,s=Se(e,function(...e){n.baseClass.pureVirtualFunctions.forEach(function(e){if(this[e]===a[e])throw new Te(`Pure virtual function ${e} must be implemented in JavaScript`)}.bind(this)),Object.defineProperty(this,"__parent",{value:o}),this.__construct(...e)});return o.__construct=function(...e){this===o&&je("Pass correct 'this' to __construct");var r=i.implement(this,...e);He(r);var t,a,s,l=r.$$;r.notifyOnDestruction(),l.preservePointerOnDelete=!0,Object.defineProperties(this,{$$:{value:l}}),Ze(this),t=n,a=l.ptr,s=this,a=We(t,a),Ue.hasOwnProperty(a)?je(`Tried to register registered instance: ${a}`):Ue[a]=s},o.__destruct=function(){var e,r;this===o&&je("Pass correct 'this' to __destruct"),He(this),e=n,r=this.$$.ptr,r=We(e,r),Ue.hasOwnProperty(r)?delete Ue[r]:je(`Tried to unregister unregistered instance: ${r}`)},s.prototype=Object.create(o),Object.assign(s.prototype,t),xe(s)},m:e=>{var r=Qe[e];delete Qe[e];var t=r.rawConstructor,n=r.rawDestructor,o=r.fields,a=o.map(e=>e.getterReturnType).concat(o.map(e=>e.setterArgumentType));or([e],a,e=>{var a={};return o.forEach((r,t)=>{var n=r.fieldName,i=e[t],s=r.getter,l=r.getterContext,u=e[t+o.length],d=r.setter,c=r.setterContext;a[n]={read:e=>i.fromWireType(s(l,e)),write:(e,r)=>{var t=[];d(c,e,u.toWireType(t,r)),er(t)}}}),[{name:r.name,fromWireType:e=>{var r={};for(var t in a)r[t]=a[t].read(e);return n(e),r},toWireType:(e,r)=>{for(var o in a)if(!(o in r))throw new TypeError(`Missing field: "${o}"`);var i=t();for(o in a)a[o].write(i,r[o]);return null!==e&&e.push(n,i),i},argPackAdvance:ir,readValueFromPointer:rr,destructorFunction:n}]})},T:(e,r,t,n,o)=>{},ya:(e,r,t,n)=>{ar(e,{name:r=ze(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:ir,readValueFromPointer:function(e){return this.fromWireType($[e])},destructorFunction:null})},j:(e,r,t,n,o,a,i,s,l,u,d,c,f)=>{d=ze(d),a=$r(o,a),s&&=$r(i,s),u&&=$r(l,u),f=$r(c,f);var h=(e=>{var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(d);cr(h,function(){kr(`Cannot construct ${d} due to unbound types`,[n])}),or([e,r,t],n?[n]:[],r=>{var t,o;r=r[0],o=n?(t=r.registeredClass).instancePrototype:ur.prototype;var i=Se(d,function(...e){if(Object.getPrototypeOf(this)!==l)throw new Pe("Use 'new' to construct "+d);if(void 0===c.constructor_body)throw new Pe(d+" has no accessible constructor");var r=c.constructor_body[e.length];if(void 0===r)throw new Pe(`Tried to invoke ctor of ${d} with invalid number of parameters (${e.length}) - expected (${Object.keys(c.constructor_body).toString()}) parameters instead!`);return r.apply(this,e)}),l=Object.create(o,{constructor:{value:i}});i.prototype=l;var c=new fr(d,i,l,f,t,a,s,u);c.baseClass&&(c.baseClass.__derivedClasses??=[],c.baseClass.__derivedClasses.push(c));var p=new yr(d,c,!0,!1,!1),m=new yr(d+"*",c,!1,!1,!1),v=new yr(d+" const*",c,!1,!0,!1);return Ge[e]={pointerType:m,constPointerType:v},Er(h,i),[p,m,v]})},F:(e,r,t,n,o,a,i,s,l)=>{var u=Pr(t,n);r=ze(r),r=Tr(r),a=$r(o,a),or([],[e],e=>{var n=`${(e=e[0]).name}.${r}`;function o(){kr(`Cannot call ${n} due to unbound types`,u)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var s=e.registeredClass.constructor;return void 0===s[r]?(o.argCount=t-1,s[r]=o):(dr(s,r,n),s[r].overloadTable[t-1]=o),or([],u,o=>{var l=[o[0],null].concat(o.slice(1)),u=Cr(n,l,null,a,i);if(void 0===s[r].overloadTable?(u.argCount=t-1,s[r]=u):s[r].overloadTable[t-1]=u,e.registeredClass.__derivedClasses)for(const t of e.registeredClass.__derivedClasses)t.constructor.hasOwnProperty(r)||(t.constructor[r]=u);return[]}),[]})},G:(e,r,t,n,o,a)=>{var i=Pr(r,t);o=$r(n,o),or([],[e],e=>{var t=`constructor ${(e=e[0]).name}`;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[r-1])throw new Pe(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${e.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return e.registeredClass.constructor_body[r-1]=()=>{kr(`Cannot construct ${e.name} due to unbound types`,i)},or([],i,n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=Cr(t,n,null,o,a),[])),[]})},b:(e,r,t,n,o,a,i,s,l,u)=>{var d=Pr(t,n);r=ze(r),r=Tr(r),a=$r(o,a),or([],[e],e=>{var n=`${(e=e[0]).name}.${r}`;function o(){kr(`Cannot call ${n} due to unbound types`,d)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(r);var l=e.registeredClass.instancePrototype,u=l[r];return void 0===u||void 0===u.overloadTable&&u.className!==e.name&&u.argCount===t-2?(o.argCount=t-2,o.className=e.name,l[r]=o):(dr(l,r,n),l[r].overloadTable[t-2]=o),or([],d,o=>{var s=Cr(n,o,e,a,i);return void 0===l[r].overloadTable?(s.argCount=t-2,l[r]=s):l[r].overloadTable[t-2]=s,[]}),[]})},s:(e,r,t,n,o,a,i,s,l,u)=>{r=ze(r),o=$r(n,o),or([],[e],e=>{var n=`${(e=e[0]).name}.${r}`,d={get(){kr(`Cannot access ${n} due to unbound types`,[t,i])},enumerable:!0,configurable:!0};return d.set=l?()=>kr(`Cannot access ${n} due to unbound types`,[t,i]):e=>je(n+" is a read-only property"),Object.defineProperty(e.registeredClass.instancePrototype,r,d),or([],l?[t,i]:[t],t=>{var i=t[0],d={get(){var r=Dr(this,e,n+" getter");return i.fromWireType(o(a,r))},enumerable:!0};if(l){l=$r(s,l);var c=t[1];d.set=function(r){var t=Dr(this,e,n+" setter"),o=[];l(u,t,c.toWireType(o,r)),er(o)}}return Object.defineProperty(e.registeredClass.instancePrototype,r,d),[]}),[]})},wa:e=>ar(e,Sr),H:(e,r,t)=>{ar(e,{name:r=ze(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:ir,readValueFromPointer:Ar(r,t),destructorFunction:null})},d:(e,r,t,n,o,a,i,s)=>{var l=Pr(r,t);e=ze(e),e=Tr(e),o=$r(n,o),cr(e,function(){kr(`Cannot call ${e} due to unbound types`,l)},r-1),or([],l,t=>{var n=[t[0],null].concat(t.slice(1));return Er(e,Cr(e,n,null,o,a),r-1),[]})},h:(e,r,t,n,o)=>{r=ze(r),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*t;a=e=>e<<i>>>i}var s=r.includes("unsigned");ar(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return this.name,r>>>0}:function(e,r){return this.name,r},argPackAdvance:ir,readValueFromPointer:jr(r,t,0!==n),destructorFunction:null})},c:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(e){var r=T[e>>2],t=T[e+4>>2];return new n(_.buffer,t,r)}ar(e,{name:t=ze(t),fromWireType:o,argPackAdvance:ir,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},I:(e,r)=>{ar(e,Or)},aa:(e,r,t,n,o,a,i,s,l,u,d,c)=>{t=ze(t),a=$r(o,a),s=$r(i,s),u=$r(l,u),c=$r(d,c),or([e],[r],e=>(e=e[0],[new yr(t,e.registeredClass,!1,!1,!0,e,n,a,s,u,c)]))},xa:(e,r)=>{r=ze(r);ar(e,{name:r,fromWireType(e){for(var r,t=T[e>>2],n=e+4,o=n,a=0;a<=t;++a){var i=n+a;if(a==t||0==$[i]){var s=Ee(o,i-o);void 0===r?r=s:(r+=String.fromCharCode(0),r+=s),o=i+1}}return Dt(e),r},toWireType(e,r){var t;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var n="string"==typeof r;n||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||je("Cannot pass non-string to std::string"),t=n?se(r):r.length;var o=Tt(4+t+1),a=o+4;if(T[o>>2]=t,n)Ce(r,a,t+1);else if(n)for(var i=0;i<t;++i){var s=r.charCodeAt(i);s>255&&(Dt(a),je("String has UTF-16 code units that do not fit in 8 bits")),$[a+i]=s}else for(i=0;i<t;++i)$[a+i]=r[i];return null!==e&&e.push(Dt,o),o},argPackAdvance:ir,readValueFromPointer:rr,destructorFunction(e){Dt(e)}})},x:(e,r,t)=>{var n,o,a,i;t=ze(t),2===r?(n=xr,o=Nr,i=zr,a=e=>C[e>>1]):4===r&&(n=Ur,o=Wr,i=Lr,a=e=>T[e>>2]),ar(e,{name:t,fromWireType:e=>{for(var t,o=T[e>>2],i=e+4,s=0;s<=o;++s){var l=e+4+s*r;if(s==o||0==a(l)){var u=n(i,l-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=l+r}}return Dt(e),t},toWireType:(e,n)=>{"string"!=typeof n&&je(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),s=Tt(4+a+r);return T[s>>2]=a/r,o(n,s+4,a+r),null!==e&&e.push(Dt,s),s},argPackAdvance:ir,readValueFromPointer:rr,destructorFunction(e){Dt(e)}})},w:(e,r,t,n,o,a)=>{Qe[e]={name:ze(r),rawConstructor:$r(t,n),rawDestructor:$r(o,a),fields:[]}},i:(e,r,t,n,o,a,i,s,l,u)=>{Qe[e].fields.push({fieldName:ze(r),getterReturnType:t,getter:$r(n,o),getterContext:a,setterArgumentType:i,setter:$r(s,l),setterContext:u})},za:(e,r)=>{ar(e,{isVoid:!0,name:r=ze(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},qa:e=>{do{var r=T[e>>2],t=T[(e+=4)>>2],n=T[(e+=4)>>2];e+=4;var o=Ee(r);we.createPath("/",re.dirname(o),!0,!0),we.createDataFile(o,null,_.subarray(n,n+t),!0,!0,!0)}while(T[e>>2])},ja:(e,r,t)=>$.copyWithin(e,r,r+t),U:()=>{ee=!1,Ir=0},o:(e,r,t)=>(e=Re(e),r=Be(r,"emval::as"),Br(r,t,e)),J:(e,r,t,n)=>(e=Hr[e])(null,r=Re(r),t,n),g:(e,r,t,n,o)=>(e=Hr[e])(r=Re(r),r[t=Yr(t)],n,o),a:Fr,r:e=>0===e?xe(qr()):(e=Yr(e),xe(qr()[e])),f:(e,r,t)=>{var n=((e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=Be(T[r+4*n>>2],"parameter "+n);return t})(e,r),o=n.shift();e--;var a,i,s=new Array(e),l=`methodCaller<(${n.map(e=>e.name).join(", ")}) => ${o.name}>`;return a=Se(l,(r,a,i,l)=>{for(var u=0,d=0;d<e;++d)s[d]=n[d].readValueFromPointer(l+u),u+=n[d].argPackAdvance;var c=1===t?Gr(a,s):a.apply(r,s);return Br(o,i,c)}),i=Hr.length,Hr.push(a),i},ta:e=>(e=Yr(e),xe(i[e])),q:(e,r)=>(e=Re(e),r=Re(r),xe(e[r])),t:e=>{e>9&&(Ae[e+1]+=1)},p:e=>xe(Yr(e)),e:e=>{var r=Re(e);er(r),Fr(e)},l:(e,r)=>{var t=(e=Be(e,"_emval_take_value")).readValueFromPointer(r);return xe(t)},v:e=>(e=Re(e),xe(typeof e)),M:function(e,r,t){var n=ke(e,r),o=new Date(1e3*n);P[t>>2]=o.getUTCSeconds(),P[t+4>>2]=o.getUTCMinutes(),P[t+8>>2]=o.getUTCHours(),P[t+12>>2]=o.getUTCDate(),P[t+16>>2]=o.getUTCMonth(),P[t+20>>2]=o.getUTCFullYear()-1900,P[t+24>>2]=o.getUTCDay();var a=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-a)/864e5|0;P[t+28>>2]=i},N:function(e,r,t){var n=ke(e,r),o=new Date(1e3*n);P[t>>2]=o.getSeconds(),P[t+4>>2]=o.getMinutes(),P[t+8>>2]=o.getHours(),P[t+12>>2]=o.getDate(),P[t+16>>2]=o.getMonth(),P[t+20>>2]=o.getFullYear()-1900,P[t+24>>2]=o.getDay();var a=0|Zr(o);P[t+28>>2]=a,P[t+36>>2]=-60*o.getTimezoneOffset();var i=new Date(o.getFullYear(),0,1),s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),l=i.getTimezoneOffset(),u=0|(s!=l&&o.getTimezoneOffset()==Math.min(l,s));P[t+32>>2]=u},O:function(e){var r=(()=>{var r=new Date(P[e+20>>2]+1900,P[e+16>>2],P[e+12>>2],P[e+8>>2],P[e+4>>2],P[e>>2],0),t=P[e+32>>2],n=r.getTimezoneOffset(),o=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=Math.min(i,a);if(t<0)P[e+32>>2]=Number(a!=i&&s==n);else if(t>0!=(s==n)){var l=Math.max(i,a),u=t>0?s:l;r.setTime(r.getTime()+6e4*(u-n))}P[e+24>>2]=r.getDay();var d=0|Zr(r);P[e+28>>2]=d,P[e>>2]=r.getSeconds(),P[e+4>>2]=r.getMinutes(),P[e+8>>2]=r.getHours(),P[e+12>>2]=r.getDate(),P[e+16>>2]=r.getMonth(),P[e+20>>2]=r.getYear();var c=r.getTime();return isNaN(c)?-1:c/1e3})();return Qr((V=r,+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)),r>>>0},K:function(e,r,t,n,o,a,i,s){var l=ke(o,a);try{if(isNaN(l))return 61;var u=be.getStreamFromFD(n),d=we.mmap(u,e,l,r,t),c=d.ptr;return P[i>>2]=d.allocated,T[s>>2]=c,0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},L:function(e,r,t,n,o,a,i){var s=ke(a,i);try{var l=be.getStreamFromFD(o);2&t&&be.doMsync(e,l,r,n,s)}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return-e.errno}},V:(e,r)=>{if(et[e]&&(clearTimeout(et[e].id),delete et[e]),!r)return 0;var t=setTimeout(()=>{delete et[e],at(()=>St(e,it()))},r);return et[e]={id:t,timeout_ms:r},0},P:function(e){var r=(()=>{var r=Date.UTC(P[e+20>>2]+1900,P[e+16>>2],P[e+12>>2],P[e+8>>2],P[e+4>>2],P[e>>2],0),t=new Date(r);P[e+24>>2]=t.getUTCDay();var n=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),o=(t.getTime()-n)/864e5|0;return P[e+28>>2]=o,t.getTime()/1e3})();return Qr((V=r,+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)),r>>>0},S:function(e,r,t,n){var o,a;if(ke(r,t),!((o=e)>=0&&o<=3))return 28;a=0===e?st():it();var i=Math.round(1e3*a*1e3);return Y=[i>>>0,(V=i,+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],P[n>>2]=Y[0],P[n+4>>2]=Y[1],0},D:st,Z:()=>2147483648,k:it,ra:e=>(B("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0),X:e=>{var r=$.length,t=2147483648;if((e>>>=0)>t)return!1;for(var n=1;n<=4;n*=2){var o=r*(1+.2/n);o=Math.min(o,e+100663296);var a=Math.min(t,ce(Math.max(e,o),65536));if(lt(a))return!0}return!1},E:()=>{var e=ft().split("\n");return"Error"==e[0]&&e.shift(),ct(e),dt.last_addr=ut(e[3]),dt.last_stack=e,dt.last_addr},sa:(e,r,t)=>{var n;dt.last_addr==e?n=dt.last_stack:("Error"==(n=ft().split("\n"))[0]&&n.shift(),ct(n));for(var o=3;n[o]&&ut(n[o])!=e;)++o;for(var a=0;a<t&&n[a+o];++a)P[r+4*a>>2]=ut(n[a+o]);return a},ca:(e,r)=>{var t=0;return pt().forEach((n,o)=>{var a=r+t;T[e+4*o>>2]=a,((e,r)=>{for(var t=0;t<e.length;++t)_[r++]=e.charCodeAt(t);_[r]=0})(n,a),t+=n.length+1}),0},da:(e,r)=>{var t=pt();T[e>>2]=t.length;var n=0;return t.forEach(e=>n+=e.length+1),T[r>>2]=n,0},n:function(e){try{var r=be.getStreamFromFD(e);return we.close(r),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},Y:function(e,r){try{var t=be.getStreamFromFD(e),n=t.tty?2:we.isDir(t.mode)?3:we.isLink(t.mode)?7:4;return _[r]=n,k[r+2>>1]=0,Y=[0,(V=0,+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],P[r+8>>2]=Y[0],P[r+12>>2]=Y[1],Y=[0,(V=0,+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],P[r+16>>2]=Y[0],P[r+20>>2]=Y[1],0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},B:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a<t;a++){var i=T[r>>2],s=T[r+4>>2];r+=8;var l=we.read(e,_,i,s,n);if(l<0)return-1;if(o+=l,l<s)break;void 0!==n&&(n+=l)}return o})(be.getStreamFromFD(e),r,t);return T[n>>2]=o,0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},Q:function(e,r,t,n,o){var a=ke(r,t);try{if(isNaN(a))return 61;var i=be.getStreamFromFD(e);return we.llseek(i,a,n),Y=[i.position>>>0,(V=i.position,+Math.abs(V)>=1?V>0?+Math.floor(V/4294967296)>>>0:~~+Math.ceil((V-+(~~V>>>0))/4294967296)>>>0:0)],P[o>>2]=Y[0],P[o+4>>2]=Y[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},ea:function(e){try{var r=be.getStreamFromFD(e);return r.stream_ops?.fsync?r.stream_ops.fsync(r):0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},A:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a<t;a++){var i=T[r>>2],s=T[r+4>>2];r+=8;var l=we.write(e,_,i,s,n);if(l<0)return-1;if(o+=l,l<s)break;void 0!==n&&(n+=l)}return o})(be.getStreamFromFD(e),r,t);return T[n>>2]=o,0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},pa:nt,W:function(e,r){try{return te($.subarray(e,e+r)),0}catch(e){if(void 0===we||"ErrnoError"!==e.name)throw e;return e.errno}},ua:(e,r,t)=>{for(var n=Ee(r),o="\\!@#$^&*()+=-[]/{}|:<>?,.",a=0;a<25;++a)n=n.replace(new RegExp("\\"+o[a],"g"),"\\"+o[a]);var i={A:"%a",B:"%b",c:"%a %b %d %H:%M:%S %Y",D:"%m\\/%d\\/%y",e:"%d",F:"%Y-%m-%d",h:"%b",R:"%H\\:%M",r:"%I\\:%M\\:%S\\s%p",T:"%H\\:%M\\:%S",x:"%m\\/%d\\/(?:%y|%Y)",X:"%H\\:%M\\:%S"},s={a:"(?:Sun(?:day)?)|(?:Mon(?:day)?)|(?:Tue(?:sday)?)|(?:Wed(?:nesday)?)|(?:Thu(?:rsday)?)|(?:Fri(?:day)?)|(?:Sat(?:urday)?)",b:"(?:Jan(?:uary)?)|(?:Feb(?:ruary)?)|(?:Mar(?:ch)?)|(?:Apr(?:il)?)|May|(?:Jun(?:e)?)|(?:Jul(?:y)?)|(?:Aug(?:ust)?)|(?:Sep(?:tember)?)|(?:Oct(?:ober)?)|(?:Nov(?:ember)?)|(?:Dec(?:ember)?)",C:"\\d\\d",d:"0[1-9]|[1-9](?!\\d)|1\\d|2\\d|30|31",H:"\\d(?!\\d)|[0,1]\\d|20|21|22|23",I:"\\d(?!\\d)|0\\d|10|11|12",j:"00[1-9]|0?[1-9](?!\\d)|0?[1-9]\\d(?!\\d)|[1,2]\\d\\d|3[0-6]\\d",m:"0[1-9]|[1-9](?!\\d)|10|11|12",M:"0\\d|\\d(?!\\d)|[1-5]\\d",n:" ",p:"AM|am|PM|pm|A\\.M\\.|a\\.m\\.|P\\.M\\.|p\\.m\\.",S:"0\\d|\\d(?!\\d)|[1-5]\\d|60",U:"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53",W:"0\\d|\\d(?!\\d)|[1-4]\\d|50|51|52|53",w:"[0-6]",y:"\\d\\d",Y:"\\d\\d\\d\\d",t:" ",z:"Z|(?:[\\+\\-]\\d\\d:?(?:\\d\\d)?)"},l=[],u=n.replace(/%(.)/g,(e,r)=>i[r]||e).replace(/%(.)/g,(e,r)=>{let t=s[r];return t?(l.push(r),`(${t})`):r}).replace(/\s+/g,"\\s*"),d=new RegExp("^"+u,"i").exec(Ee(e));if(d){var c,f=function(){function e(e,r,t){return"number"!=typeof e||isNaN(e)?r:e>=r?e<=t?e:t:r}return{year:e(P[t+20>>2]+1900,1970,9999),month:e(P[t+16>>2],0,11),day:e(P[t+12>>2],1,31),hour:e(P[t+8>>2],0,23),min:e(P[t+4>>2],0,59),sec:e(P[t>>2],0,59),gmtoff:0}}(),h=e=>{var r=l.indexOf(e);if(r>=0)return d[r+1]};if((c=h("S"))&&(f.sec=wt(c)),(c=h("M"))&&(f.min=wt(c)),c=h("H"))f.hour=wt(c);else if(c=h("I")){var p=wt(c);(c=h("p"))&&(p+="P"===c.toUpperCase()[0]?12:0),f.hour=p}if(c=h("Y"))f.year=wt(c);else if(c=h("y")){var m=wt(c);(c=h("C"))?m+=100*wt(c):m+=m<69?2e3:1900,f.year=m}if((c=h("m"))?f.month=wt(c)-1:(c=h("b"))&&(f.month={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11}[c.substring(0,3).toUpperCase()]||0),c=h("d"))f.day=wt(c);else if(c=h("j"))for(var v=wt(c),y=Xr(f.year),g=0;g<12;++g){var w=mt(y?vt:yt,g-1);v<=w+(y?vt:yt)[g]&&(f.day=v-w)}else if(c=h("a")){var E=c.substring(0,3).toUpperCase();if(c=h("U")){var b={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6}[E],_=wt(c);k=0===($=new Date(f.year,0,1)).getDay()?gt($,b+7*(_-1)):gt($,7-$.getDay()+b+7*(_-1)),f.day=k.getDate(),f.month=k.getMonth()}else if(c=h("W")){var $,k;b={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6}[E],_=wt(c);k=1===($=new Date(f.year,0,1)).getDay()?gt($,b+7*(_-1)):gt($,7-$.getDay()+1+b+7*(_-1)),f.day=k.getDate(),f.month=k.getMonth()}}if(c=h("z"))if("z"===c.toLowerCase())f.gmtoff=0;else{var C=c.match(/^((?:\-|\+)\d\d):?(\d\d)?/);f.gmtoff=3600*C[1],C[2]&&(f.gmtoff+=f.gmtoff>0?60*C[2]:60*-C[2])}var T=new Date(f.year,f.month,f.day,f.hour,f.min,f.sec,0);return P[t>>2]=T.getSeconds(),P[t+4>>2]=T.getMinutes(),P[t+8>>2]=T.getHours(),P[t+12>>2]=T.getDate(),P[t+16>>2]=T.getMonth(),P[t+20>>2]=T.getFullYear()-1900,P[t+24>>2]=T.getDay(),P[t+28>>2]=mt(Xr(T.getFullYear())?vt:yt,T.getMonth()-1)+T.getDate()-1,P[t+32>>2]=0,P[t+36>>2]=f.gmtoff,e+ue(d[0]).length-1}return 0}};!async function(){function e(e,r){var t;return $t=e.exports,w=$t.Aa,A(),gr=$t.Fa,t=$t.Ba,O.unshift(t),I(),$t}L();var r={a:kt};if(i.instantiateWasm)try{return i.instantiateWasm(r,e)}catch(e){g(`Module.instantiateWasm callback failed with error: ${e}`),n(e)}H??=X();try{var t=await K(E,H,r);return function(r){e(r.instance)}(t),t}catch(e){return void n(e)}}();var Ct,Pt=e=>(Pt=$t.Ca)(e),Tt=e=>(Tt=$t.Da)(e),Dt=e=>(Dt=$t.Ea)(e),Ft=(e,r)=>(Ft=$t.Ga)(e,r),St=(e,r)=>(St=$t.Ha)(e,r),Mt=()=>(Mt=$t.Ia)(),At=e=>(At=$t.Ja)(e);i.dynCall_vij=(e,r,t,n)=>(i.dynCall_vij=$t.Ka)(e,r,t,n),i.dynCall_jiji=(e,r,t,n,o)=>(i.dynCall_jiji=$t.La)(e,r,t,n,o),i.dynCall_ji=(e,r)=>(i.dynCall_ji=$t.Ma)(e,r),i.dynCall_viij=(e,r,t,n,o)=>(i.dynCall_viij=$t.Na)(e,r,t,n,o),i.dynCall_iij=(e,r,t,n)=>(i.dynCall_iij=$t.Oa)(e,r,t,n),i.dynCall_iiji=(e,r,t,n,o)=>(i.dynCall_iiji=$t.Pa)(e,r,t,n,o),i.dynCall_jji=(e,r,t,n)=>(i.dynCall_jji=$t.Qa)(e,r,t,n),i.dynCall_iji=(e,r,t,n)=>(i.dynCall_iji=$t.Ra)(e,r,t,n),i.dynCall_viijj=(e,r,t,n,o,a,s)=>(i.dynCall_viijj=$t.Sa)(e,r,t,n,o,a,s),i.dynCall_iiij=(e,r,t,n,o)=>(i.dynCall_iiij=$t.Ta)(e,r,t,n,o),i.dynCall_viiiji=(e,r,t,n,o,a,s)=>(i.dynCall_viiiji=$t.Ua)(e,r,t,n,o,a,s),i.dynCall_viijii=(e,r,t,n,o,a,s)=>(i.dynCall_viijii=$t.Va)(e,r,t,n,o,a,s),i.dynCall_viji=(e,r,t,n,o)=>(i.dynCall_viji=$t.Wa)(e,r,t,n,o),i.dynCall_iiiijij=(e,r,t,n,o,a,s,l,u)=>(i.dynCall_iiiijij=$t.Xa)(e,r,t,n,o,a,s,l,u),i.dynCall_jij=(e,r,t,n)=>(i.dynCall_jij=$t.Ya)(e,r,t,n),i.dynCall_iiiij=(e,r,t,n,o,a)=>(i.dynCall_iiiij=$t.Za)(e,r,t,n,o,a),i.dynCall_iiiiij=(e,r,t,n,o,a,s)=>(i.dynCall_iiiiij=$t._a)(e,r,t,n,o,a,s),i.dynCall_iiiiijj=(e,r,t,n,o,a,s,l,u)=>(i.dynCall_iiiiijj=$t.$a)(e,r,t,n,o,a,s,l,u),i.dynCall_iiiiiijj=(e,r,t,n,o,a,s,l,u,d)=>(i.dynCall_iiiiiijj=$t.ab)(e,r,t,n,o,a,s,l,u,d),i.___emscripten_embedded_file_data=168424;function jt(){function e(){Ct||(Ct=!0,i.calledRun=!0,S||(x=!0,i.noFSInit||we.initialized||we.init(),we.ignorePermissions=!1,de.init(),Q(O),t(i),i.onRuntimeInitialized?.(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)z(i.postRun.shift());Q(R)}()))}U>0||(!function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)N(i.preRun.shift());Q(j)}(),U>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>i.setStatus(""),1),e()},1)):e()))}if(i.addRunDependency=L,i.removeRunDependency=I,i.FS_createPreloadedFile=ve,i.FS_unlink=e=>we.unlink(e),i.FS_createPath=Et,i.FS_createDevice=_t,i.FS=we,i.FS_createDataFile=pe,i.FS_createLazyFile=bt,W=function e(){Ct||jt(),Ct||(W=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return jt(),s}})();"object"==typeof exports&&"object"==typeof module?(module.exports=PSPDFModuleInit,module.exports.default=PSPDFModuleInit):"function"==typeof define&&define.amd&&define([],()=>PSPDFModuleInit);