/*!
 * PSPDFKit for Web 2024.8.0 (https://pspdfkit.com/web)
 * 
 * Copyright (c) 2016-2024 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://pspdfkit.com/acknowledgements/web/
 */
var PSPDFModuleInit=(()=>{var e="undefined"!=typeof document?document.currentScript?.src:void 0;return"undefined"!=typeof __filename&&(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="function"==typeof importScripts,d="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,c=Object.assign({},i),f="./this.program",h=(e,r)=>{throw r},p="";if(d){var m=require("fs"),v=require("path");p=__dirname+"/",a=e=>(e=q(e)?new URL(e):v.normalize(e),m.readFileSync(e)),o=(e,r=!0)=>(e=q(e)?new URL(e):v.normalize(e),new Promise(((t,n)=>{m.readFile(e,r?void 0:"utf8",((e,o)=>{e?n(e):t(r?o.buffer:o)}))}))),!i.thisProgram&&process.argv.length>1&&(f=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),h=(e,r)=>{throw process.exitCode=e,r}}else(l||u)&&(u?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),e&&(p=e),p=p.startsWith("blob:")?"":p.substr(0,p.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=e=>q(e)?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)&&t(n.response),r(n.status)},n.onerror=r,n.send(null)})):fetch(e,{credentials:"same-origin"}).then((e=>e.ok?e.arrayBuffer():Promise.reject(new Error(e.status+" : "+e.url)))));var y,g,w=i.print||console.log.bind(console),E=i.printErr||console.error.bind(console);Object.assign(i,c),c=null,i.arguments&&i.arguments,i.thisProgram&&(f=i.thisProgram),i.quit&&(h=i.quit),i.wasmBinary&&(y=i.wasmBinary);var _,b,k,C,$,P,T,D,F=!1;function S(e,r){e||L(r)}function M(){var e=g.buffer;i.HEAP8=_=new Int8Array(e),i.HEAP16=k=new Int16Array(e),i.HEAPU8=b=new Uint8Array(e),i.HEAPU16=C=new Uint16Array(e),i.HEAP32=$=new Int32Array(e),i.HEAPU32=P=new Uint32Array(e),i.HEAPF32=T=new Float32Array(e),i.HEAPF64=D=new Float64Array(e)}var A=[],j=[],O=[],R=!1;var N=0,z=null,x=null;function U(e){N++,i.monitorRunDependencies?.(N)}function W(e){if(N--,i.monitorRunDependencies?.(N),0==N&&(null!==z&&(clearInterval(z),z=null),x)){var r=x;x=null,r()}}function L(e){i.onAbort?.(e),E(e="Aborted("+e+")"),F=!0,1,e+=". Build with -sASSERTIONS for more info.",R&&Dt();var r=new WebAssembly.RuntimeError(e);throw n(r),r}var I,B,H,V=e=>e.startsWith("data:application/octet-stream;base64,"),q=e=>e.startsWith("file://");function Y(){var e,r="pspdfkit.wasm.wasm";return V(r)?r:(e=r,i.locateFile?i.locateFile(e,p):p+e)}function G(e){if(e==I&&y)return new Uint8Array(y);if(a)return a(e);throw"both async and sync fetching of the wasm failed"}function X(e,r,t){return function(e){return y?Promise.resolve().then((()=>G(e))):o(e).then((e=>new Uint8Array(e)),(()=>G(e)))}(e).then((e=>WebAssembly.instantiate(e,r))).then(t,(e=>{E(`failed to asynchronously prepare wasm: ${e}`),L(e)}))}var J={3119896:()=>"undefined"!=typeof wasmOffsetConverter};function K(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var Z=e=>{for(;e.length>0;)e.shift()(i)},Q=i.noExitRuntime||!0,ee={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=ee.isAbs(e),t="/"===e.substr(-1);return(e=ee.normalizeArray(e.split("/").filter((e=>!!e)),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=ee.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=ee.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===r?e:e.substr(r+1)},join:(...e)=>ee.normalize(e.join("/")),join2:(e,r)=>ee.normalize(e+"/"+r)},re=e=>(re=(()=>{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){}L("initRandomDevice")})())(e),te={resolve:(...e)=>{for(var r="",t=!1,n=e.length-1;n>=-1&&!t;n--){var o=n>=0?e[n]:ye.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";r=o+"/"+r,t=ee.isAbs(o)}return(t?"/":"")+(r=ee.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=te.resolve(e).substr(1),r=te.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("/")}},ne="undefined"!=typeof TextDecoder?new TextDecoder:void 0,oe=(e,r,t)=>{for(var n=r+t,o=r;e[o]&&!(o>=n);)++o;if(o-r>16&&e.buffer&&ne)return ne.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},ae=[],ie=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},se=(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 le(e,r,t){var n=t>0?t:ie(e)+1,o=new Array(n),a=se(e,o,0,o.length);return r&&(o.length=a),o}var ue={ttys:[],init(){},shutdown(){},register(e,r){ue.ttys[e]={input:[],output:[],ops:r},ye.registerDevice(e,ue.stream_ops)},stream_ops:{open(e){var r=ue.ttys[e.node.rdev];if(!r)throw new ye.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 ye.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 ye.ErrnoError(29)}if(void 0===s&&0===a)throw new ye.ErrnoError(6);if(null==s)break;a++,r[t+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,r,t,n,o){if(!e.tty||!e.tty.ops.put_char)throw new ye.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,r[t+a])}catch(e){throw new ye.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!ae.length){var e=null;if(d){var r=Buffer.alloc(256),t=0,n=process.stdin.fd;try{t=m.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");if(!e)return null;ae=le(e,!0)}return ae.shift()})(),put_char(e,r){null===r||10===r?(w(oe(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(w(oe(e.output,0)),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?(E(oe(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},fsync(e){e.output&&e.output.length>0&&(E(oe(e.output,0)),e.output=[])}}},de=e=>{e=((e,r)=>Math.ceil(e/r)*r)(e,65536);var r=Tt(65536,e);return r?((e,r)=>(b.fill(0,e,e+r),e))(r,e):0},ce={ops_table:null,mount:e=>ce.createNode(null,"/",16895,0),createNode(e,r,t,n){if(ye.isBlkdev(t)||ye.isFIFO(t))throw new ye.ErrnoError(63);ce.ops_table||={dir:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,lookup:ce.node_ops.lookup,mknod:ce.node_ops.mknod,rename:ce.node_ops.rename,unlink:ce.node_ops.unlink,rmdir:ce.node_ops.rmdir,readdir:ce.node_ops.readdir,symlink:ce.node_ops.symlink},stream:{llseek:ce.stream_ops.llseek}},file:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:{llseek:ce.stream_ops.llseek,read:ce.stream_ops.read,write:ce.stream_ops.write,allocate:ce.stream_ops.allocate,mmap:ce.stream_ops.mmap,msync:ce.stream_ops.msync}},link:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,readlink:ce.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:ye.chrdev_stream_ops}};var o=ye.createNode(e,r,t,n);return ye.isDir(o.mode)?(o.node_ops=ce.ops_table.dir.node,o.stream_ops=ce.ops_table.dir.stream,o.contents={}):ye.isFile(o.mode)?(o.node_ops=ce.ops_table.file.node,o.stream_ops=ce.ops_table.file.stream,o.usedBytes=0,o.contents=null):ye.isLink(o.mode)?(o.node_ops=ce.ops_table.link.node,o.stream_ops=ce.ops_table.link.stream):ye.isChrdev(o.mode)&&(o.node_ops=ce.ops_table.chrdev.node,o.stream_ops=ce.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[r]=o,e.timestamp=o.timestamp),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=ye.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,ye.isDir(e.mode)?r.size=4096:ye.isFile(e.mode)?r.size=e.usedBytes:ye.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&ce.resizeFileStorage(e,r.size)},lookup(e,r){throw ye.genericErrors[44]},mknod:(e,r,t,n)=>ce.createNode(e,r,t,n),rename(e,r,t){if(ye.isDir(e.mode)){var n;try{n=ye.lookupNode(r,t)}catch(e){}if(n)for(var o in n.contents)throw new ye.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,r.contents[t]=e,r.timestamp=e.parent.timestamp},unlink(e,r){delete e.contents[r],e.timestamp=Date.now()},rmdir(e,r){var t=ye.lookupNode(e,r);for(var n in t.contents)throw new ye.ErrnoError(55);delete e.contents[r],e.timestamp=Date.now()},readdir(e){var r=[".",".."];for(var t of Object.keys(e.contents))r.push(t);return r},symlink(e,r,t){var n=ce.createNode(e,r,41471,0);return n.link=t,n},readlink(e){if(!ye.isLink(e.mode))throw new ye.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.timestamp=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(ce.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&&ye.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new ye.ErrnoError(28);return n},allocate(e,r,t){ce.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap(e,r,t,n,o){if(!ye.isFile(e.node.mode))throw new ye.ErrnoError(43);var a,i,s=e.node.contents;if(2&o||s.buffer!==_.buffer){if((t>0||t+r<s.length)&&(s=s.subarray?s.subarray(t,t+r):Array.prototype.slice.call(s,t,t+r)),i=!0,!(a=de(r)))throw new ye.ErrnoError(48);_.set(s,a)}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(e,r,t,n,o)=>(ce.stream_ops.write(e,r,0,n,t,!1),0)}},fe=(e,r,t,n,o,a)=>{ye.createDataFile(e,r,t,n,o,a)},he=i.preloadPlugins||[],pe=(e,r,t,n,a,i,s,l,u,d)=>{var c=r?te.resolve(ee.join2(e,r)):e;function f(t){function o(t){d?.(),l||fe(e,r,t,n,a,u),i?.(),W()}((e,r,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return he.forEach((a=>{o||a.canHandle(r)&&(a.handle(e,r,t,n),o=!0)})),o})(t,c,o,(()=>{s?.(),W()}))||o(t)}U(),"string"==typeof t?((e,r,t,n)=>{var a=n?"":`al ${e}`;o(e).then((e=>{r(new Uint8Array(e)),a&&W()}),(r=>{if(!t)throw`Loading data file "${e}" failed.`;t()})),a&&U()})(t,f,s):f(t)},me=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},ve={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount(e){S(u),ve.reader||(ve.reader=new FileReaderSync);var r=ve.createNode(null,"/",ve.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]||=ve.createNode(o,n[a],ve.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){ve.createNode(n(e.name),o(e.name),ve.FILE_MODE,0,e,e.lastModifiedDate)})),(e.opts.blobs||[]).forEach((function(e){ve.createNode(n(e.name),o(e.name),ve.FILE_MODE,0,e.data)})),(e.opts.packages||[]).forEach((function(e){e.metadata.files.forEach((function(r){var t=r.filename.substr(1);ve.createNode(n(t),o(t),ve.FILE_MODE,0,e.blob.slice(r.start,r.end))}))})),r},createNode(e,r,t,n,o,a){var i=ye.createNode(e,r,t);return i.mode=t,i.node_ops=ve.node_ops,i.stream_ops=ve.stream_ops,i.timestamp=(a||new Date).getTime(),S(ve.FILE_MODE!==ve.DIR_MODE),t===ve.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.timestamp),mtime:new Date(e.timestamp),ctime:new Date(e.timestamp),blksize:4096,blocks:Math.ceil(e.size/4096)}),setattr(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp)},lookup(e,r){throw new ye.ErrnoError(44)},mknod(e,r,t,n){throw new ye.ErrnoError(63)},rename(e,r,t){throw new ye.ErrnoError(63)},unlink(e,r){throw new ye.ErrnoError(63)},rmdir(e,r){throw new ye.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 ye.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=ve.reader.readAsArrayBuffer(a);return r.set(new Uint8Array(i),t),a.size},write(e,r,t,n,o){throw new ye.ErrnoError(29)},llseek(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&ye.isFile(e.node.mode)&&(n+=e.node.size),n<0)throw new ye.ErrnoError(28);return n}}},ye={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return 0!=(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{constructor(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ye.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n,this.readMode=365,this.writeMode=146}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 ye.isDir(this.mode)}get isDevice(){return ye.isChrdev(this.mode)}},lookupPath(e,r={}){if(!(e=te.resolve(e)))return{path:"",node:null};if((r=Object.assign({follow_mount:!0,recurse_count:0},r)).recurse_count>8)throw new ye.ErrnoError(32);for(var t=e.split("/").filter((e=>!!e)),n=ye.root,o="/",a=0;a<t.length;a++){var i=a===t.length-1;if(i&&r.parent)break;if(n=ye.lookupNode(n,t[a]),o=ee.join2(o,t[a]),ye.isMountpoint(n)&&(!i||i&&r.follow_mount)&&(n=n.mounted.root),!i||r.follow)for(var s=0;ye.isLink(n.mode);){var l=ye.readlink(o);if(o=te.resolve(ee.dirname(o),l),n=ye.lookupPath(o,{recurse_count:r.recurse_count+1}).node,s++>40)throw new ye.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var r;;){if(ye.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)%ye.nameTable.length},hashAddNode(e){var r=ye.hashName(e.parent.id,e.name);e.name_next=ye.nameTable[r],ye.nameTable[r]=e},hashRemoveNode(e){var r=ye.hashName(e.parent.id,e.name);if(ye.nameTable[r]===e)ye.nameTable[r]=e.name_next;else for(var t=ye.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=ye.mayLookup(e);if(t)throw new ye.ErrnoError(t);for(var n=ye.hashName(e.id,r),o=ye.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===r)return o}return ye.lookup(e,r)},createNode(e,r,t,n){var o=new ye.FSNode(e,r,t,n);return ye.hashAddNode(o),o},destroyNode(e){ye.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:(e,r)=>ye.ignorePermissions||(!r.includes("r")||292&e.mode)&&(!r.includes("w")||146&e.mode)&&(!r.includes("x")||73&e.mode)?0:2,mayLookup(e){if(!ye.isDir(e.mode))return 54;var r=ye.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){try{ye.lookupNode(e,r);return 20}catch(e){}return ye.nodePermissions(e,"wx")},mayDelete(e,r,t){var n;try{n=ye.lookupNode(e,r)}catch(e){return e.errno}var o=ye.nodePermissions(e,"wx");if(o)return o;if(t){if(!ye.isDir(n.mode))return 54;if(ye.isRoot(n)||ye.getPath(n)===ye.cwd())return 10}else if(ye.isDir(n.mode))return 31;return 0},mayOpen:(e,r)=>e?ye.isLink(e.mode)?32:ye.isDir(e.mode)&&("r"!==ye.flagsToPermissionString(r)||512&r)?31:ye.nodePermissions(e,ye.flagsToPermissionString(r)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=ye.MAX_OPEN_FDS;e++)if(!ye.streams[e])return e;throw new ye.ErrnoError(33)},getStreamChecked(e){var r=ye.getStream(e);if(!r)throw new ye.ErrnoError(8);return r},getStream:e=>ye.streams[e],createStream:(e,r=-1)=>(e=Object.assign(new ye.FSStream,e),-1==r&&(r=ye.nextfd()),e.fd=r,ye.streams[r]=e,e),closeStream(e){ye.streams[e]=null},dupStream(e,r=-1){var t=ye.createStream(e,r);return t.stream_ops?.dup?.(t),t},chrdev_stream_ops:{open(e){var r=ye.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new ye.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,r)=>e<<8|r,registerDevice(e,r){ye.devices[e]={stream_ops:r}},getDevice:e=>ye.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),ye.syncFSRequests++,ye.syncFSRequests>1&&E(`warning: ${ye.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=ye.getMounts(ye.root.mount),n=0;function o(e){return ye.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&&ye.root)throw new ye.ErrnoError(10);if(!o&&!a){var i=ye.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,ye.isMountpoint(n))throw new ye.ErrnoError(10);if(!ye.isDir(n.mode))throw new ye.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},l=e.mount(s);return l.mount=s,s.root=l,o?ye.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(e){var r=ye.lookupPath(e,{follow_mount:!1});if(!ye.isMountpoint(r.node))throw new ye.ErrnoError(28);var t=r.node,n=t.mounted,o=ye.getMounts(n);Object.keys(ye.nameTable).forEach((e=>{for(var r=ye.nameTable[e];r;){var t=r.name_next;o.includes(r.mount)&&ye.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=ye.lookupPath(e,{parent:!0}).node,o=ee.basename(e);if(!o||"."===o||".."===o)throw new ye.ErrnoError(28);var a=ye.mayCreate(n,o);if(a)throw new ye.ErrnoError(a);if(!n.node_ops.mknod)throw new ye.ErrnoError(63);return n.node_ops.mknod(n,o,r,t)},create:(e,r)=>(r=void 0!==r?r:438,r&=4095,r|=32768,ye.mknod(e,r,0)),mkdir:(e,r)=>(r=void 0!==r?r:511,r&=1023,r|=16384,ye.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{ye.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,r,t)=>(void 0===t&&(t=r,r=438),r|=8192,ye.mknod(e,r,t)),symlink(e,r){if(!te.resolve(e))throw new ye.ErrnoError(44);var t=ye.lookupPath(r,{parent:!0}).node;if(!t)throw new ye.ErrnoError(44);var n=ee.basename(r),o=ye.mayCreate(t,n);if(o)throw new ye.ErrnoError(o);if(!t.node_ops.symlink)throw new ye.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename(e,r){var t,n,o=ee.dirname(e),a=ee.dirname(r),i=ee.basename(e),s=ee.basename(r);if(t=ye.lookupPath(e,{parent:!0}).node,n=ye.lookupPath(r,{parent:!0}).node,!t||!n)throw new ye.ErrnoError(44);if(t.mount!==n.mount)throw new ye.ErrnoError(75);var l,u=ye.lookupNode(t,i),d=te.relative(e,a);if("."!==d.charAt(0))throw new ye.ErrnoError(28);if("."!==(d=te.relative(r,o)).charAt(0))throw new ye.ErrnoError(55);try{l=ye.lookupNode(n,s)}catch(e){}if(u!==l){var c=ye.isDir(u.mode),f=ye.mayDelete(t,i,c);if(f)throw new ye.ErrnoError(f);if(f=l?ye.mayDelete(n,s,c):ye.mayCreate(n,s))throw new ye.ErrnoError(f);if(!t.node_ops.rename)throw new ye.ErrnoError(63);if(ye.isMountpoint(u)||l&&ye.isMountpoint(l))throw new ye.ErrnoError(10);if(n!==t&&(f=ye.nodePermissions(t,"w")))throw new ye.ErrnoError(f);ye.hashRemoveNode(u);try{t.node_ops.rename(u,n,s),u.parent=n}catch(e){throw e}finally{ye.hashAddNode(u)}}},rmdir(e){var r=ye.lookupPath(e,{parent:!0}).node,t=ee.basename(e),n=ye.lookupNode(r,t),o=ye.mayDelete(r,t,!0);if(o)throw new ye.ErrnoError(o);if(!r.node_ops.rmdir)throw new ye.ErrnoError(63);if(ye.isMountpoint(n))throw new ye.ErrnoError(10);r.node_ops.rmdir(r,t),ye.destroyNode(n)},readdir(e){var r=ye.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new ye.ErrnoError(54);return r.node_ops.readdir(r)},unlink(e){var r=ye.lookupPath(e,{parent:!0}).node;if(!r)throw new ye.ErrnoError(44);var t=ee.basename(e),n=ye.lookupNode(r,t),o=ye.mayDelete(r,t,!1);if(o)throw new ye.ErrnoError(o);if(!r.node_ops.unlink)throw new ye.ErrnoError(63);if(ye.isMountpoint(n))throw new ye.ErrnoError(10);r.node_ops.unlink(r,t),ye.destroyNode(n)},readlink(e){var r=ye.lookupPath(e).node;if(!r)throw new ye.ErrnoError(44);if(!r.node_ops.readlink)throw new ye.ErrnoError(28);return te.resolve(ye.getPath(r.parent),r.node_ops.readlink(r))},stat(e,r){var t=ye.lookupPath(e,{follow:!r}).node;if(!t)throw new ye.ErrnoError(44);if(!t.node_ops.getattr)throw new ye.ErrnoError(63);return t.node_ops.getattr(t)},lstat:e=>ye.stat(e,!0),chmod(e,r,t){var n;"string"==typeof e?n=ye.lookupPath(e,{follow:!t}).node:n=e;if(!n.node_ops.setattr)throw new ye.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod(e,r){ye.chmod(e,r,!0)},fchmod(e,r){var t=ye.getStreamChecked(e);ye.chmod(t.node,r)},chown(e,r,t,n){var o;"string"==typeof e?o=ye.lookupPath(e,{follow:!n}).node:o=e;if(!o.node_ops.setattr)throw new ye.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,r,t){ye.chown(e,r,t,!0)},fchown(e,r,t){var n=ye.getStreamChecked(e);ye.chown(n.node,r,t)},truncate(e,r){if(r<0)throw new ye.ErrnoError(28);var t;"string"==typeof e?t=ye.lookupPath(e,{follow:!0}).node:t=e;if(!t.node_ops.setattr)throw new ye.ErrnoError(63);if(ye.isDir(t.mode))throw new ye.ErrnoError(31);if(!ye.isFile(t.mode))throw new ye.ErrnoError(28);var n=ye.nodePermissions(t,"w");if(n)throw new ye.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate(e,r){var t=ye.getStreamChecked(e);if(0==(2097155&t.flags))throw new ye.ErrnoError(28);ye.truncate(t.node,r)},utime(e,r,t){var n=ye.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open(e,r,t){if(""===e)throw new ye.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=void 0===t?438:t)|32768:0,"object"==typeof e)n=e;else{e=ee.normalize(e);try{n=ye.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var o=!1;if(64&r)if(n){if(128&r)throw new ye.ErrnoError(20)}else n=ye.mknod(e,t,0),o=!0;if(!n)throw new ye.ErrnoError(44);if(ye.isChrdev(n.mode)&&(r&=-513),65536&r&&!ye.isDir(n.mode))throw new ye.ErrnoError(54);if(!o){var a=ye.mayOpen(n,r);if(a)throw new ye.ErrnoError(a)}512&r&&!o&&ye.truncate(n,0),r&=-131713;var s=ye.createStream({node:n,path:ye.getPath(n),flags:r,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&r||(ye.readFiles||(ye.readFiles={}),e in ye.readFiles||(ye.readFiles[e]=1)),s},close(e){if(ye.isClosed(e))throw new ye.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ye.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,r,t){if(ye.isClosed(e))throw new ye.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ye.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new ye.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 ye.ErrnoError(28);if(ye.isClosed(e))throw new ye.ErrnoError(8);if(1==(2097155&e.flags))throw new ye.ErrnoError(8);if(ye.isDir(e.node.mode))throw new ye.ErrnoError(31);if(!e.stream_ops.read)throw new ye.ErrnoError(28);var a=void 0!==o;if(a){if(!e.seekable)throw new ye.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 ye.ErrnoError(28);if(ye.isClosed(e))throw new ye.ErrnoError(8);if(0==(2097155&e.flags))throw new ye.ErrnoError(8);if(ye.isDir(e.node.mode))throw new ye.ErrnoError(31);if(!e.stream_ops.write)throw new ye.ErrnoError(28);e.seekable&&1024&e.flags&&ye.llseek(e,0,2);var i=void 0!==o;if(i){if(!e.seekable)throw new ye.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(ye.isClosed(e))throw new ye.ErrnoError(8);if(r<0||t<=0)throw new ye.ErrnoError(28);if(0==(2097155&e.flags))throw new ye.ErrnoError(8);if(!ye.isFile(e.node.mode)&&!ye.isDir(e.node.mode))throw new ye.ErrnoError(43);if(!e.stream_ops.allocate)throw new ye.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap(e,r,t,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new ye.ErrnoError(2);if(1==(2097155&e.flags))throw new ye.ErrnoError(2);if(!e.stream_ops.mmap)throw new ye.ErrnoError(43);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 ye.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=ye.open(e,r.flags),o=ye.stat(e).size,a=new Uint8Array(o);return ye.read(n,a,0,o,0),"utf8"===r.encoding?t=oe(a,0):"binary"===r.encoding&&(t=a),ye.close(n),t},writeFile(e,r,t={}){t.flags=t.flags||577;var n=ye.open(e,t.flags,t.mode);if("string"==typeof r){var o=new Uint8Array(ie(r)+1),a=se(r,o,0,o.length);ye.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");ye.write(n,r,0,r.byteLength,void 0,t.canOwn)}ye.close(n)},cwd:()=>ye.currentPath,chdir(e){var r=ye.lookupPath(e,{follow:!0});if(null===r.node)throw new ye.ErrnoError(44);if(!ye.isDir(r.node.mode))throw new ye.ErrnoError(54);var t=ye.nodePermissions(r.node,"x");if(t)throw new ye.ErrnoError(t);ye.currentPath=r.path},createDefaultDirectories(){ye.mkdir("/tmp"),ye.mkdir("/home"),ye.mkdir("/home/web_user")},createDefaultDevices(){ye.mkdir("/dev"),ye.registerDevice(ye.makedev(1,3),{read:()=>0,write:(e,r,t,n,o)=>n}),ye.mkdev("/dev/null",ye.makedev(1,3)),ue.register(ye.makedev(5,0),ue.default_tty_ops),ue.register(ye.makedev(6,0),ue.default_tty1_ops),ye.mkdev("/dev/tty",ye.makedev(5,0)),ye.mkdev("/dev/tty1",ye.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(0===r&&(r=re(e).byteLength),e[--r]);ye.createDevice("/dev","random",t),ye.createDevice("/dev","urandom",t),ye.mkdir("/dev/shm"),ye.mkdir("/dev/shm/tmp")},createSpecialDirectories(){ye.mkdir("/proc");var e=ye.mkdir("/proc/self");ye.mkdir("/proc/self/fd"),ye.mount({mount(){var r=ye.createNode(e,"fd",16895,73);return r.node_ops={lookup(e,r){var t=+r,n=ye.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},r}},{},"/proc/self/fd")},createStandardStreams(){i.stdin?ye.createDevice("/dev","stdin",i.stdin):ye.symlink("/dev/tty","/dev/stdin"),i.stdout?ye.createDevice("/dev","stdout",null,i.stdout):ye.symlink("/dev/tty","/dev/stdout"),i.stderr?ye.createDevice("/dev","stderr",null,i.stderr):ye.symlink("/dev/tty1","/dev/stderr");ye.open("/dev/stdin",0),ye.open("/dev/stdout",1),ye.open("/dev/stderr",1)},staticInit(){[44].forEach((e=>{ye.genericErrors[e]=new ye.ErrnoError(e),ye.genericErrors[e].stack="<generic error, no stack>"})),ye.nameTable=new Array(4096),ye.mount(ce,{},"/"),ye.createDefaultDirectories(),ye.createDefaultDevices(),ye.createSpecialDirectories(),ye.filesystems={MEMFS:ce,WORKERFS:ve}},init(e,r,t){ye.init.initialized=!0,i.stdin=e||i.stdin,i.stdout=r||i.stdout,i.stderr=t||i.stderr,ye.createStandardStreams()},quit(){ye.init.initialized=!1;for(var e=0;e<ye.streams.length;e++){var r=ye.streams[e];r&&ye.close(r)}},findObject(e,r){var t=ye.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{e=(n=ye.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=ye.lookupPath(e,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=ee.basename(e),n=ye.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:ye.getPath(e);for(var o=r.split("/").reverse();o.length;){var a=o.pop();if(a){var i=ee.join2(e,a);try{ye.mkdir(i)}catch(e){}e=i}}return i},createFile(e,r,t,n,o){var a=ee.join2("string"==typeof e?e:ye.getPath(e),r),i=me(n,o);return ye.create(a,i)},createDataFile(e,r,t,n,o,a){var i=r;e&&(e="string"==typeof e?e:ye.getPath(e),i=r?ee.join2(e,r):e);var s=me(n,o),l=ye.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}ye.chmod(l,146|s);var f=ye.open(l,577);ye.write(f,t,0,t.length,0,a),ye.close(f),ye.chmod(l,s)}},createDevice(e,r,t,n){var o=ee.join2("string"==typeof e?e:ye.getPath(e),r),a=me(!!t,!!n);ye.createDevice.major||(ye.createDevice.major=64);var i=ye.makedev(ye.createDevice.major++,0);return ye.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 ye.ErrnoError(29)}if(void 0===l&&0===i)throw new ye.ErrnoError(6);if(null==l)break;i++,r[n+s]=l}return i&&(e.node.timestamp=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 ye.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),ye.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 ye.ErrnoError(29)}},createLazyFile(e,r,t,n,o){class a{constructor(){this.lengthKnown=!1,this.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||[]):le(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,w("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=ye.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)=>(ye.forceLoadFile(s),r(...e))})),l.read=(e,r,t,n,o)=>(ye.forceLoadFile(s),d(e,r,t,n,o)),l.mmap=(e,r,t,n,o)=>{ye.forceLoadFile(s);var a=de(r);if(!a)throw new ye.ErrnoError(48);return d(e,_,a,r,t),{ptr:a,allocated:!0}},s.stream_ops=l,s}},ge=(e,r)=>e?oe(b,e,r):"",we={DEFAULT_POLLMASK:5,calculateAt(e,r,t){if(ee.isAbs(r))return r;var n;-100===e?n=ye.cwd():n=we.getStreamFromFD(e).path;if(0==r.length){if(!t)throw new ye.ErrnoError(44);return n}return ee.join2(n,r)},doStat(e,r,t){var n=e(r);$[t>>2]=n.dev,$[t+4>>2]=n.mode,P[t+8>>2]=n.nlink,$[t+12>>2]=n.uid,$[t+16>>2]=n.gid,$[t+20>>2]=n.rdev,H=[n.size>>>0,(B=n.size,+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],$[t+24>>2]=H[0],$[t+28>>2]=H[1],$[t+32>>2]=4096,$[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return H=[Math.floor(o/1e3)>>>0,(B=Math.floor(o/1e3),+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],$[t+40>>2]=H[0],$[t+44>>2]=H[1],P[t+48>>2]=o%1e3*1e3,H=[Math.floor(a/1e3)>>>0,(B=Math.floor(a/1e3),+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],$[t+56>>2]=H[0],$[t+60>>2]=H[1],P[t+64>>2]=a%1e3*1e3,H=[Math.floor(i/1e3)>>>0,(B=Math.floor(i/1e3),+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],$[t+72>>2]=H[0],$[t+76>>2]=H[1],P[t+80>>2]=i%1e3*1e3,H=[n.ino>>>0,(B=n.ino,+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],$[t+88>>2]=H[0],$[t+92>>2]=H[1],0},doMsync(e,r,t,n,o){if(!ye.isFile(r.node.mode))throw new ye.ErrnoError(43);if(2&n)return 0;var a=b.slice(e,e+t);ye.msync(r,a,o,t,n)},getStreamFromFD:e=>ye.getStreamChecked(e),varargs:void 0,getStr:e=>ge(e)};function Ee(){var e=$[+we.varargs>>2];return we.varargs+=4,e}var _e=Ee;var be=(e,r)=>r+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*r:NaN;var ke=(e,r,t)=>se(e,b,r,t);var Ce,$e,Pe,Te,De,Fe=(e,r)=>Object.defineProperty(r,"name",{value:e}),Se=[],Me=[],Ae=e=>{throw new Ce(e)},je=()=>Me.length/2-5-Se.length,Oe=e=>(e||Ae("Cannot use deleted val. handle = "+e),Me[e]),Re=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const r=Se.pop()||Me.length;return Me[r]=e,Me[r+1]=1,r}}},Ne=(e,r)=>{var t=Fe(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;b[t];)r+=Pe[b[t++]];return r},xe=()=>Object.keys(Be).length,Ue=()=>{var e=[];for(var r in Be)Be.hasOwnProperty(r)&&e.push(Be[r]);return e},We=[],Le=()=>{for(;We.length;){var e=We.pop();e.$$.deleteScheduled=!1,e.delete()}},Ie=e=>{Te=e,We.length&&Te&&Te(Le)},Be={},He=(e,r)=>{for(void 0===r&&Ae("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r},Ve={},qe=e=>{var r=Ct(e),t=ze(r);return Pt(r),t},Ye=(e,r)=>{var t=Ve[e];return void 0===t&&Ae(`${r} has unknown type ${qe(e)}`),t},Ge=e=>{},Xe=!1,Je=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Ke=(e,r,t)=>{if(r===t)return e;if(void 0===t.baseClass)return null;var n=Ke(e,r,t.baseClass);return null===n?null:t.downcast(n)},Ze={},Qe=e=>{throw new De(e)},er=(e,r)=>(r.ptrType&&r.ptr||Qe("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!==!!r.smartPtr&&Qe("Both smartPtrType and smartPtr must be specified"),r.count={value:1},tr(Object.create(e,{$$:{value:r,writable:!0}})));function rr(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=((e,r)=>(r=He(e,r),Be[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?er(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):er(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(r),s=Ze[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var l=Ke(r,this.registeredClass,a.registeredClass);return null===l?o.call(this):this.isSmartPointer?er(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):er(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}var tr=e=>"undefined"==typeof FinalizationRegistry?(tr=e=>e,e):(Xe=new FinalizationRegistry((e=>{Je(e.$$)})),tr=e=>{var r=e.$$;if(!!r.smartPtr){var t={$$:r};Xe.register(e,t,e)}return e},Ge=e=>Xe.unregister(e),tr(e)),nr={},or=e=>{for(;e.length;){var r=e.pop();e.pop()(r)}};function ar(e){return this.fromWireType(P[e>>2])}var ir={},sr={},lr=(e,r,t)=>{function n(r){var n=t(r);n.length!==e.length&&Qe("Mismatched type converter count");for(var o=0;o<e.length;++o)ur(e[o],n[o])}e.forEach((function(e){sr[e]=r}));var o=new Array(r.length),a=[],i=0;r.forEach(((e,r)=>{Ve.hasOwnProperty(e)?o[r]=Ve[e]:(a.push(e),ir.hasOwnProperty(e)||(ir[e]=[]),ir[e].push((()=>{o[r]=Ve[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)};function ur(e,r,t={}){if(!("argPackAdvance"in r))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,r,t={}){var n=r.name;if(e||Ae(`type "${n}" must have a positive integer typeid pointer`),Ve.hasOwnProperty(e)){if(t.ignoreDuplicateRegistrations)return;Ae(`Cannot register type '${n}' twice`)}if(Ve[e]=r,delete sr[e],ir.hasOwnProperty(e)){var o=ir[e];delete ir[e],o.forEach((e=>e()))}}(e,r,t)}var dr=8,cr=e=>{Ae(e.$$.ptrType.registeredClass.name+" instance already deleted")};function fr(){}var hr=(e,r,t)=>{if(void 0===e[r].overloadTable){var n=e[r];e[r]=function(...n){return e[r].overloadTable.hasOwnProperty(n.length)||Ae(`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}},pr=(e,r,t)=>{i.hasOwnProperty(e)?((void 0===t||void 0!==i[e].overloadTable&&void 0!==i[e].overloadTable[t])&&Ae(`Cannot register public name '${e}' twice`),hr(i,e,e),i.hasOwnProperty(t)&&Ae(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),i[e].overloadTable[t]=r):(i[e]=r,void 0!==t&&(i[e].numArguments=t))};function mr(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 vr=(e,r,t)=>{for(;r!==t;)r.upcast||Ae(`Expected null or instance of ${t.name}, got an instance of ${r.name}`),e=r.upcast(e),r=r.baseClass;return e};function yr(e,r){if(null===r)return this.isReference&&Ae(`null is not a valid ${this.name}`),0;r.$$||Ae(`Cannot pass "${zr(r)}" as a ${this.name}`),r.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`);var t=r.$$.ptrType.registeredClass;return vr(r.$$.ptr,t,this.registeredClass)}function gr(e,r){var t;if(null===r)return this.isReference&&Ae(`null is not a valid ${this.name}`),this.isSmartPointer?(t=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,t),t):0;r&&r.$$||Ae(`Cannot pass "${zr(r)}" as a ${this.name}`),r.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&Ae(`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=vr(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===r.$$.smartPtr&&Ae("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:Ae(`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,Re((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,t)}break;default:Ae("Unsupporting sharing policy")}return t}function wr(e,r){if(null===r)return this.isReference&&Ae(`null is not a valid ${this.name}`),0;r.$$||Ae(`Cannot pass "${zr(r)}" as a ${this.name}`),r.$$.ptr||Ae(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&Ae(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var t=r.$$.ptrType.registeredClass;return vr(r.$$.ptr,t,this.registeredClass)}function Er(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=gr:n?(this.toWireType=yr,this.destructorFunction=null):(this.toWireType=wr,this.destructorFunction=null)}var _r,br,kr=(e,r,t)=>{i.hasOwnProperty(e)||Qe("Replacing nonexistent public symbol"),void 0!==i[e].overloadTable&&void 0!==t?i[e].overloadTable[t]=r:(i[e]=r,i[e].argCount=t)},Cr=e=>_r.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):Cr(r)(...t),Pr=(e,r)=>{var t,n,o=(e=ze(e)).includes("j")?(t=e,n=r,(...e)=>$r(t,n,e)):Cr(r);return"function"!=typeof o&&Ae(`unknown function pointer with signature ${e}: ${r}`),o},Tr=(e,r)=>{var t=[],n={};throw r.forEach((function e(r){n[r]||Ve[r]||(sr[r]?sr[r].forEach(e):(t.push(r),n[r]=!0))})),new br(`${e}: `+t.map(qe).join([", "]))};function Dr(e){for(var r=1;r<e.length;++r)if(null!==e[r]&&void 0===e[r].destructorFunction)return!0;return!1}function Fr(e,r){if(!(e instanceof Function))throw new TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var t=Fe(e.name||"unknownFunctionName",(function(){}));t.prototype=e.prototype;var n=new t,o=e.apply(n,r);return o instanceof Object?o:n}function Sr(e,r,t,n,o,a){var i=r.length;i<2&&Ae("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==r[1]&&null!==t,l=Dr(r),u="void"!==r[0].name,d=[e,Ae,n,o,or,r[0],r[1]],c=0;c<i-2;++c)d.push(r[c+2]);if(!l)for(c=s?1:2;c<r.length;++c)null!==r[c].destructorFunction&&d.push(r[c].destructorFunction);let[f,h]=function(e,r,t,n){for(var o=Dr(e),a=e.length,i="",s="",l=0;l<a-2;++l)i+=(0!==l?", ":"")+"arg"+l,s+=(0!==l?", ":"")+"arg"+l+"Wired";var u=`\n        return function (${i}) {\n        if (arguments.length !== ${a-2}) {\n          throwBindingError('function ' + humanName + ' called with ' + arguments.length + ' arguments, expected ${a-2}');\n        }`;o&&(u+="var destructors = [];\n");var d=o?"destructors":"null",c=["humanName","throwBindingError","invoker","fn","runDestructors","retType","classParam"];for(r&&(u+="var thisWired = classParam['toWireType']("+d+", this);\n"),l=0;l<a-2;++l)u+="var arg"+l+"Wired = argType"+l+"['toWireType']("+d+", arg"+l+");\n",c.push("argType"+l);if(r&&(s="thisWired"+(s.length>0?", ":"")+s),u+=(t||n?"var rv = ":"")+"invoker(fn"+(s.length>0?", ":"")+s+");\n",o)u+="runDestructors(destructors);\n";else for(l=r?1:2;l<e.length;++l){var f=1===l?"thisWired":"arg"+(l-2)+"Wired";null!==e[l].destructorFunction&&(u+=`${f}_dtor(${f});\n`,c.push(`${f}_dtor`))}return t&&(u+="var ret = retType['fromWireType'](rv);\nreturn ret;\n"),[c,u+="}\n"]}(r,s,u,a);f.push(h);var p=Fr(Function,f)(...d);return Fe(e,p)}var Mr=(e,r)=>{for(var t=[],n=0;n<e;n++)t.push(P[r+4*n>>2]);return t},Ar=e=>{const r=(e=e.trim()).indexOf("(");return-1!==r?e.substr(0,r):e},jr=(e,r,t)=>(e instanceof Object||Ae(`${t} with invalid "this": ${e}`),e instanceof r.registeredClass.constructor||Ae(`${t} incompatible with "this" of type ${e.constructor.name}`),e.$$.ptr||Ae(`cannot call emscripten binding method ${t} on deleted object`),vr(e.$$.ptr,e.$$.ptrType.registeredClass,r.registeredClass)),Or=e=>{e>9&&0==--Me[e+1]&&(Me[e]=void 0,Se.push(e))},Rr={name:"emscripten::val",fromWireType:e=>{var r=Oe(e);return Or(e),r},toWireType:(e,r)=>Re(r),argPackAdvance:dr,readValueFromPointer:ar,destructorFunction:null},Nr=e=>ur(e,Rr),zr=e=>{if(null===e)return"null";var r=typeof e;return"object"===r||"array"===r||"function"===r?e.toString():""+e},xr=(e,r)=>{switch(r){case 4:return function(e){return this.fromWireType(T[e>>2])};case 8:return function(e){return this.fromWireType(D[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}},Ur=(e,r,t)=>{switch(r){case 1:return t?e=>_[e]:e=>b[e];case 2:return t?e=>k[e>>1]:e=>C[e>>1];case 4:return t?e=>$[e>>2]:e=>P[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},Wr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Lr=(e,r)=>{for(var t=e,n=t>>1,o=n+r/2;!(n>=o)&&C[n];)++n;if((t=n<<1)-e>32&&Wr)return Wr.decode(b.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},Ir=(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},Br=e=>2*e.length,Hr=(e,r)=>{for(var t=0,n="";!(t>=r/4);){var o=$[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},Vr=(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($[r>>2]=i,(r+=4)+4>o)break}return $[r>>2]=0,r-n},qr=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},Yr=(e,r,t)=>{var n=[],o=e.toWireType(n,t);return n.length&&(P[r>>2]=Re(n)),o},Gr=[],Xr={},Jr=e=>{var r=Xr[e];return void 0===r?ze(e):r},Kr=()=>"object"==typeof globalThis?globalThis:Function("return this")();Reflect.construct;var Zr=e=>e%4==0&&(e%100!=0||e%400==0),Qr=[0,31,60,91,121,152,182,213,244,274,305,335],et=[0,31,59,90,120,151,181,212,243,273,304,334],rt=e=>(Zr(e.getFullYear())?Qr:et)[e.getMonth()]+e.getDate()-1;var tt=e=>Ft(e);var nt,ot=[],at=(e,r,t)=>{var n=((e,r)=>{var t;for(ot.length=0;t=b[e++];){var n=105!=t;r+=(n&=112!=t)&&r%8?4:0,ot.push(112==t?P[r>>2]:105==t?$[r>>2]:D[r>>3]),r+=n?8:4}return ot})(r,t);return J[e](...n)};nt=()=>performance.now();var it=e=>{var r=(e-g.buffer.byteLength+65535)/65536;try{return g.grow(r),M(),1}catch(e){}},st=e=>(L("Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER"),0),lt={},ut=e=>{e.forEach((e=>{var r=st();r&&(lt[r]=e)}))};function dt(){return(new Error).stack.toString()}var ct={},ft=()=>{if(!ft.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",_:f||"./this.program"};for(var r in ct)void 0===ct[r]?delete e[r]:e[r]=ct[r];var t=[];for(var r in e)t.push(`${r}=${e[r]}`);ft.strings=t}return ft.strings};var ht=(e,r)=>{for(var t=0,n=0;n<=r;t+=e[n++]);return t},pt=[31,29,31,30,31,30,31,31,30,31,30,31],mt=[31,28,31,30,31,30,31,31,30,31,30,31],vt=(e,r)=>{for(var t=new Date(e.getTime());r>0;){var n=Zr(t.getFullYear()),o=t.getMonth(),a=(n?pt:mt)[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},yt=e=>parseInt(e),gt=ye.createPath,wt=ye.createLazyFile,Et=ye.createDevice;ye.createPreloadedFile=pe,ye.staticInit(),i.FS_createPath=ye.createPath,i.FS_createDataFile=ye.createDataFile,i.FS_createPreloadedFile=ye.createPreloadedFile,i.FS_unlink=ye.unlink,i.FS_createLazyFile=ye.createLazyFile,i.FS_createDevice=ye.createDevice,Ce=i.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},Me.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=je,$e=i.PureVirtualError=Ne(Error,"PureVirtualError"),(()=>{for(var e=new Array(256),r=0;r<256;++r)e[r]=String.fromCharCode(r);Pe=e})(),i.getInheritedInstanceCount=xe,i.getLiveInheritedInstances=Ue,i.flushPendingDeletes=Le,i.setDelayFunction=Ie,De=i.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Object.assign(fr.prototype,{isAliasOf(e){if(!(this instanceof fr))return!1;if(!(e instanceof fr))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||cr(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,r=tr(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||cr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ae("Object already scheduled for deletion"),Ge(this),Je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||cr(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&Ae("Object already scheduled for deletion"),We.push(this),1===We.length&&Te&&Te(Le),this.$$.deleteScheduled=!0,this}}),Object.assign(Er.prototype,{getPointee(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e},destructor(e){this.rawDestructor?.(e)},argPackAdvance:dr,readValueFromPointer:ar,fromWireType:rr}),br=i.UnboundTypeError=Ne(Error,"UnboundTypeError");var _t,bt={qa:function(){return"undefined"!=typeof wasmOffsetConverter},W:function(e,r,t,n,o){try{for(var a=0,i=r?$[r>>2]:0,s=r?$[r+4>>2]:0,l=t?$[t>>2]:0,u=t?$[t+4>>2]:0,d=n?$[n>>2]:0,c=n?$[n+4>>2]:0,f=0,h=0,p=0,m=0,v=0,y=0,g=(r?$[r>>2]:0)|(t?$[t>>2]:0)|(n?$[n>>2]:0),w=(r?$[r+4>>2]:0)|(t?$[t+4>>2]:0)|(n?$[n+4>>2]:0),E=function(e,r,t,n){return e<32?r&n:t&n},_=0;_<e;_++){var b=1<<_%32;if(E(_,g,w,b)){var k=we.getStreamFromFD(_),C=we.DEFAULT_POLLMASK;if(k.stream_ops.poll){var P=-1;if(o)P=1e3*((r?$[o>>2]:0)+(r?$[o+4>>2]:0)/1e6);C=k.stream_ops.poll(k,P)}1&C&&E(_,i,s,b)&&(_<32?f|=b:h|=b,a++),4&C&&E(_,l,u,b)&&(_<32?p|=b:m|=b,a++),2&C&&E(_,d,c,b)&&(_<32?v|=b:y|=b,a++)}}return r&&($[r>>2]=f,$[r+4>>2]=h),t&&($[t>>2]=p,$[t+4>>2]=m),n&&($[n>>2]=v,$[n+4>>2]=y),a}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},ia:function(e,r){try{return e=we.getStr(e),ye.chmod(e,r),0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},la:function(e,r,t,n){try{if(r=we.getStr(r),r=we.calculateAt(e,r),-8&t)return-28;var o=ye.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&&ye.nodePermissions(o,a)?-2:0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},ja:function(e,r){try{return ye.fchmod(e,r),0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},A:function(e,r,t){we.varargs=t;try{var n=we.getStreamFromFD(e);switch(r){case 0:if((o=Ee())<0)return-28;for(;ye.streams[o];)o++;return ye.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=Ee();return n.flags|=o,0;case 12:o=_e();return k[o+0>>1]=2,0}return-28}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},fa:function(e,r){try{var t=we.getStreamFromFD(e);return we.doStat(ye.stat,t.path,r)}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},Q:function(e,r,t){var n=be(r,t);try{return isNaN(n)?61:(ye.ftruncate(e,n),0)}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},Y:function(e,r,t){try{var n=we.getStreamFromFD(e);n.getdents||=ye.readdir(n.path);for(var o=280,a=0,i=ye.llseek(n,0,1),s=Math.floor(i/o);s<n.getdents.length&&a+o<=t;){var l,u,d=n.getdents[s];if("."===d)l=n.node.id,u=4;else if(".."===d){l=ye.lookupPath(n.path,{parent:!0}).node.id,u=4}else{var c=ye.lookupNode(n.node,d);l=c.id,u=ye.isChrdev(c.mode)?2:ye.isDir(c.mode)?4:ye.isLink(c.mode)?10:8}H=[l>>>0,(B=l,+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],$[r+a>>2]=H[0],$[r+a+4>>2]=H[1],H=[(s+1)*o>>>0,(B=(s+1)*o,+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],$[r+a+8>>2]=H[0],$[r+a+12>>2]=H[1],k[r+a+16>>1]=280,_[r+a+18]=u,ke(d,r+a+19,256),a+=o,s+=1}return ye.llseek(n,s*o,0),a}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},ha:function(e,r,t){we.varargs=t;try{var n=we.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();$[a>>2]=o.c_iflag||0,$[a+4>>2]=o.c_oflag||0,$[a+8>>2]=o.c_cflag||0,$[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=$[a>>2],l=$[a+4>>2],u=$[a+8>>2],d=$[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 $[a>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:a=_e();return ye.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===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},da:function(e,r){try{return e=we.getStr(e),we.doStat(ye.lstat,e,r)}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},Z:function(e,r,t){try{return r=we.getStr(r),r=we.calculateAt(e,r),"/"===(r=ee.normalize(r))[r.length-1]&&(r=r.substr(0,r.length-1)),ye.mkdir(r,t,0),0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},ca:function(e,r,t,n){try{r=we.getStr(r);var o=256&n,a=4096&n;return n&=-6401,r=we.calculateAt(e,r,a),we.doStat(o?ye.lstat:ye.stat,r,t)}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},t:function(e,r,t,n){we.varargs=n;try{r=we.getStr(r),r=we.calculateAt(e,r);var o=n?Ee():0;return ye.open(r,t,o).fd}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},X:function(e,r,t,n){try{return r=we.getStr(r),n=we.getStr(n),r=we.calculateAt(e,r),n=we.calculateAt(t,n),ye.rename(r,n),0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},w:function(e){try{return e=we.getStr(e),ye.rmdir(e),0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},ea:function(e,r){try{return e=we.getStr(e),we.doStat(ye.stat,e,r)}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},x:function(e,r,t){try{return r=we.getStr(r),r=we.calculateAt(e,r),0===t?ye.unlink(r):512===t?ye.rmdir(r):L("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},ma:()=>{L("")},wa:(e,r,t)=>{e=ze(e),r=Ye(r,"wrapper"),t=Oe(t);var n=r.registeredClass,o=n.instancePrototype,a=n.baseClass.instancePrototype,i=n.baseClass.constructor,s=Fe(e,(function(...e){n.baseClass.pureVirtualFunctions.forEach(function(e){if(this[e]===a[e])throw new $e(`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&&Ae("Pass correct 'this' to __construct");var r=i.implement(this,...e);Ge(r);var t,a,s,l=r.$$;r.notifyOnDestruction(),l.preservePointerOnDelete=!0,Object.defineProperties(this,{$$:{value:l}}),tr(this),t=n,a=l.ptr,s=this,a=He(t,a),Be.hasOwnProperty(a)?Ae(`Tried to register registered instance: ${a}`):Be[a]=s},o.__destruct=function(){var e,r;this===o&&Ae("Pass correct 'this' to __destruct"),Ge(this),e=n,r=this.$$.ptr,r=He(e,r),Be.hasOwnProperty(r)?delete Be[r]:Ae(`Tried to unregister unregistered instance: ${r}`)},s.prototype=Object.create(o),Object.assign(s.prototype,t),Re(s)},C:e=>{var r=nr[e];delete nr[e];var t=r.rawConstructor,n=r.rawDestructor,o=r.fields,a=o.map((e=>e.getterReturnType)).concat(o.map((e=>e.setterArgumentType)));lr([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)),or(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:dr,readValueFromPointer:ar,destructorFunction:n}]}))},R:(e,r,t,n,o)=>{},za:(e,r,t,n)=>{ur(e,{name:r=ze(r),fromWireType:function(e){return!!e},toWireType:function(e,r){return r?t:n},argPackAdvance:dr,readValueFromPointer:function(e){return this.fromWireType(b[e])},destructorFunction:null})},i:(e,r,t,n,o,a,i,s,l,u,d,c,f)=>{d=ze(d),a=Pr(o,a),s&&=Pr(i,s),u&&=Pr(l,u),f=Pr(c,f);var h=(e=>{if(void 0===e)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=48&&r<=57?`_${e}`:e})(d);pr(h,(function(){Tr(`Cannot construct ${d} due to unbound types`,[n])})),lr([e,r,t],n?[n]:[],(r=>{var t,o;r=r[0],o=n?(t=r.registeredClass).instancePrototype:fr.prototype;var i=Fe(d,(function(...e){if(Object.getPrototypeOf(this)!==l)throw new Ce("Use 'new' to construct "+d);if(void 0===c.constructor_body)throw new Ce(d+" has no accessible constructor");var r=c.constructor_body[e.length];if(void 0===r)throw new Ce(`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 mr(d,i,l,f,t,a,s,u);c.baseClass&&(c.baseClass.__derivedClasses??=[],c.baseClass.__derivedClasses.push(c));var p=new Er(d,c,!0,!1,!1),m=new Er(d+"*",c,!1,!1,!1),v=new Er(d+" const*",c,!1,!0,!1);return Ze[e]={pointerType:m,constPointerType:v},kr(h,i),[p,m,v]}))},B:(e,r,t,n,o,a,i,s)=>{var l=Mr(t,n);r=ze(r),r=Ar(r),a=Pr(o,a),lr([],[e],(e=>{var n=`${(e=e[0]).name}.${r}`;function o(){Tr(`Cannot call ${n} due to unbound types`,l)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]);var u=e.registeredClass.constructor;return void 0===u[r]?(o.argCount=t-1,u[r]=o):(hr(u,r,n),u[r].overloadTable[t-1]=o),lr([],l,(o=>{var l=[o[0],null].concat(o.slice(1)),d=Sr(n,l,null,a,i,s);if(void 0===u[r].overloadTable?(d.argCount=t-1,u[r]=d):u[r].overloadTable[t-1]=d,e.registeredClass.__derivedClasses)for(const t of e.registeredClass.__derivedClasses)t.constructor.hasOwnProperty(r)||(t.constructor[r]=d);return[]})),[]}))},E:(e,r,t,n,o,a)=>{var i=Mr(r,t);o=Pr(n,o),lr([],[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 Ce(`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]=()=>{Tr(`Cannot construct ${e.name} due to unbound types`,i)},lr([],i,(n=>(n.splice(1,0,null),e.registeredClass.constructor_body[r-1]=Sr(t,n,null,o,a),[]))),[]}))},c:(e,r,t,n,o,a,i,s,l)=>{var u=Mr(t,n);r=ze(r),r=Ar(r),a=Pr(o,a),lr([],[e],(e=>{var n=`${(e=e[0]).name}.${r}`;function o(){Tr(`Cannot call ${n} due to unbound types`,u)}r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(r);var d=e.registeredClass.instancePrototype,c=d[r];return void 0===c||void 0===c.overloadTable&&c.className!==e.name&&c.argCount===t-2?(o.argCount=t-2,o.className=e.name,d[r]=o):(hr(d,r,n),d[r].overloadTable[t-2]=o),lr([],u,(o=>{var s=Sr(n,o,e,a,i,l);return void 0===d[r].overloadTable?(s.argCount=t-2,d[r]=s):d[r].overloadTable[t-2]=s,[]})),[]}))},r:(e,r,t,n,o,a,i,s,l,u)=>{r=ze(r),o=Pr(n,o),lr([],[e],(e=>{var n=`${(e=e[0]).name}.${r}`,d={get(){Tr(`Cannot access ${n} due to unbound types`,[t,i])},enumerable:!0,configurable:!0};return d.set=l?()=>Tr(`Cannot access ${n} due to unbound types`,[t,i]):e=>Ae(n+" is a read-only property"),Object.defineProperty(e.registeredClass.instancePrototype,r,d),lr([],l?[t,i]:[t],(t=>{var i=t[0],d={get(){var r=jr(this,e,n+" getter");return i.fromWireType(o(a,r))},enumerable:!0};if(l){l=Pr(s,l);var c=t[1];d.set=function(r){var t=jr(this,e,n+" setter"),o=[];l(u,t,c.toWireType(o,r)),or(o)}}return Object.defineProperty(e.registeredClass.instancePrototype,r,d),[]})),[]}))},ya:Nr,F:(e,r,t)=>{ur(e,{name:r=ze(r),fromWireType:e=>e,toWireType:(e,r)=>r,argPackAdvance:dr,readValueFromPointer:xr(r,t),destructorFunction:null})},a:(e,r,t,n,o,a,i)=>{var s=Mr(r,t);e=ze(e),e=Ar(e),o=Pr(n,o),pr(e,(function(){Tr(`Cannot call ${e} due to unbound types`,s)}),r-1),lr([],s,(t=>{var n=[t[0],null].concat(t.slice(1));return kr(e,Sr(e,n,null,o,a,i),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");ur(e,{name:r,fromWireType:a,toWireType:s?function(e,r){return this.name,r>>>0}:function(e,r){return this.name,r},argPackAdvance:dr,readValueFromPointer:Ur(r,t,0!==n),destructorFunction:null})},d:(e,r,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(e){var r=P[e>>2],t=P[e+4>>2];return new n(_.buffer,t,r)}ur(e,{name:t=ze(t),fromWireType:o,argPackAdvance:dr,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},H:(e,r)=>{Nr(e)},aa:(e,r,t,n,o,a,i,s,l,u,d,c)=>{t=ze(t),a=Pr(o,a),s=Pr(i,s),u=Pr(l,u),c=Pr(d,c),lr([e],[r],(e=>(e=e[0],[new Er(t,e.registeredClass,!1,!1,!0,e,n,a,s,u,c)])))},G:(e,r)=>{var t="std::string"===(r=ze(r));ur(e,{name:r,fromWireType(e){var r,n=P[e>>2],o=e+4;if(t)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==b[s]){var l=ge(a,s-a);void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),a=s+1}}else{var u=new Array(n);for(i=0;i<n;++i)u[i]=String.fromCharCode(b[o+i]);r=u.join("")}return Pt(e),r},toWireType(e,r){var n;r instanceof ArrayBuffer&&(r=new Uint8Array(r));var o="string"==typeof r;o||r instanceof Uint8Array||r instanceof Uint8ClampedArray||r instanceof Int8Array||Ae("Cannot pass non-string to std::string"),n=t&&o?ie(r):r.length;var a=$t(4+n+1),i=a+4;if(P[a>>2]=n,t&&o)ke(r,i,n+1);else if(o)for(var s=0;s<n;++s){var l=r.charCodeAt(s);l>255&&(Pt(i),Ae("String has UTF-16 code units that do not fit in 8 bits")),b[i+s]=l}else for(s=0;s<n;++s)b[i+s]=r[s];return null!==e&&e.push(Pt,a),a},argPackAdvance:dr,readValueFromPointer:ar,destructorFunction(e){Pt(e)}})},v:(e,r,t)=>{var n,o,a,i;t=ze(t),2===r?(n=Lr,o=Ir,i=Br,a=e=>C[e>>1]):4===r&&(n=Hr,o=Vr,i=qr,a=e=>P[e>>2]),ur(e,{name:t,fromWireType:e=>{for(var t,o=P[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 Pt(e),t},toWireType:(e,n)=>{"string"!=typeof n&&Ae(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),s=$t(4+a+r);return P[s>>2]=a/r,o(n,s+4,a+r),null!==e&&e.push(Pt,s),s},argPackAdvance:dr,readValueFromPointer:ar,destructorFunction(e){Pt(e)}})},xa:(e,r,t,n,o,a)=>{nr[e]={name:ze(r),rawConstructor:Pr(t,n),rawDestructor:Pr(o,a),fields:[]}},D:(e,r,t,n,o,a,i,s,l,u)=>{nr[e].fields.push({fieldName:ze(r),getterReturnType:t,getter:Pr(n,o),getterContext:a,setterArgumentType:i,setter:Pr(s,l),setterContext:u})},Aa:(e,r)=>{ur(e,{isVoid:!0,name:r=ze(r),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,r)=>{}})},oa:e=>{do{var r=P[e>>2],t=P[(e+=4)>>2],n=P[(e+=4)>>2];e+=4;var o=ge(r);ye.createPath("/",ee.dirname(o),!0,!0),ye.createDataFile(o,null,_.subarray(n,n+t),!0,!0,!0)}while(P[e>>2])},ka:()=>1,ga:(e,r,t)=>b.copyWithin(e,r,r+t),n:(e,r,t)=>(e=Oe(e),r=Ye(r,"emval::as"),Yr(r,t,e)),J:(e,r,t,n)=>(e=Gr[e])(null,r=Oe(r),t,n),g:(e,r,t,n,o)=>(e=Gr[e])(r=Oe(r),r[t=Jr(t)],n,o),b:Or,q:e=>0===e?Re(Kr()):(e=Jr(e),Re(Kr()[e])),f:(e,r,t)=>{var n=((e,r)=>{for(var t=new Array(e),n=0;n<e;++n)t[n]=Ye(P[r+4*n>>2],"parameter "+n);return t})(e,r),o=n.shift();e--;var a="return function (obj, func, destructorsRef, args) {\n",i=0,s=[];0===t&&s.push("obj");for(var l=["retType"],u=[o],d=0;d<e;++d)s.push("arg"+d),l.push("argType"+d),u.push(n[d]),a+=`  var arg${d} = argType${d}.readValueFromPointer(args${i?"+"+i:""});\n`,i+=n[d].argPackAdvance;a+=`  var rv = ${1===t?"new func":"func.call"}(${s.join(", ")});\n`,o.isVoid||(l.push("emval_returnValue"),u.push(Yr),a+="  return emval_returnValue(retType, destructorsRef, rv);\n"),a+="};\n",l.push(a);var c,f,h=Fr(Function,l)(...u),p=`methodCaller<(${n.map((e=>e.name)).join(", ")}) => ${o.name}>`;return c=Fe(p,h),f=Gr.length,Gr.push(c),f},ua:e=>(e=Jr(e),Re(i[e])),p:(e,r)=>(e=Oe(e),r=Oe(r),Re(e[r])),s:e=>{e>9&&(Me[e+1]+=1)},o:e=>Re(Jr(e)),e:e=>{var r=Oe(e);or(r),Or(e)},k:(e,r)=>{var t=(e=Ye(e,"_emval_take_value")).readValueFromPointer(r);return Re(t)},u:e=>(e=Oe(e),Re(typeof e)),L:function(e,r,t){var n=be(e,r),o=new Date(1e3*n);$[t>>2]=o.getUTCSeconds(),$[t+4>>2]=o.getUTCMinutes(),$[t+8>>2]=o.getUTCHours(),$[t+12>>2]=o.getUTCDate(),$[t+16>>2]=o.getUTCMonth(),$[t+20>>2]=o.getUTCFullYear()-1900,$[t+24>>2]=o.getUTCDay();var a=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-a)/864e5|0;$[t+28>>2]=i},M:function(e,r,t){var n=be(e,r),o=new Date(1e3*n);$[t>>2]=o.getSeconds(),$[t+4>>2]=o.getMinutes(),$[t+8>>2]=o.getHours(),$[t+12>>2]=o.getDate(),$[t+16>>2]=o.getMonth(),$[t+20>>2]=o.getFullYear()-1900,$[t+24>>2]=o.getDay();var a=0|rt(o);$[t+28>>2]=a,$[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));$[t+32>>2]=u},N:function(e){var r=(()=>{var r=new Date($[e+20>>2]+1900,$[e+16>>2],$[e+12>>2],$[e+8>>2],$[e+4>>2],$[e>>2],0),t=$[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)$[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))}$[e+24>>2]=r.getDay();var d=0|rt(r);$[e+28>>2]=d,$[e>>2]=r.getSeconds(),$[e+4>>2]=r.getMinutes(),$[e+8>>2]=r.getHours(),$[e+12>>2]=r.getDate(),$[e+16>>2]=r.getMonth(),$[e+20>>2]=r.getYear();var c=r.getTime();return isNaN(c)?-1:c/1e3})();return tt((B=r,+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)),r>>>0},I:function(e,r,t,n,o,a,i,s){var l=be(o,a);try{if(isNaN(l))return 61;var u=we.getStreamFromFD(n),d=ye.mmap(u,e,l,r,t),c=d.ptr;return $[i>>2]=d.allocated,P[s>>2]=c,0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},K:function(e,r,t,n,o,a,i){var s=be(a,i);try{var l=we.getStreamFromFD(o);2&t&&we.doMsync(e,l,r,n,s)}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return-e.errno}},O:function(e){var r=(()=>{var r=Date.UTC($[e+20>>2]+1900,$[e+16>>2],$[e+12>>2],$[e+8>>2],$[e+4>>2],$[e>>2],0),t=new Date(r);$[e+24>>2]=t.getUTCDay();var n=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),o=(t.getTime()-n)/864e5|0;return $[e+28>>2]=o,t.getTime()/1e3})();return tt((B=r,+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)),r>>>0},ta:(e,r,t)=>at(e,r,t),l:()=>Date.now(),V:()=>2147483648,j:nt,pa:e=>(L("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"),0),T:e=>{var r=b.length,t=2147483648;if((e>>>=0)>t)return!1;for(var n,o,a=1;a<=4;a*=2){var i=r*(1+.2/a);i=Math.min(i,e+100663296);var s=Math.min(t,(n=Math.max(e,i))+((o=65536)-n%o)%o);if(it(s))return!0}return!1},sa:function(){var e=dt().split("\n");return"Error"==e[0]&&e.shift(),ut(e),lt.last_addr=st(e[3]),lt.last_stack=e,lt.last_addr},ra:(e,r,t)=>{var n;lt.last_addr==e?n=lt.last_stack:("Error"==(n=dt().split("\n"))[0]&&n.shift(),ut(n));for(var o=3;n[o]&&st(n[o])!=e;)++o;for(var a=0;a<t&&n[a+o];++a)$[r+4*a>>2]=st(n[a+o]);return a},_:(e,r)=>{var t=0;return ft().forEach(((n,o)=>{var a=r+t;P[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},$:(e,r)=>{var t=ft();P[e>>2]=t.length;var n=0;return t.forEach((e=>n+=e.length+1)),P[r>>2]=n,0},m:function(e){try{var r=we.getStreamFromFD(e);return ye.close(r),0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return e.errno}},U:function(e,r){try{var t=we.getStreamFromFD(e),n=t.tty?2:ye.isDir(t.mode)?3:ye.isLink(t.mode)?7:4;return _[r]=n,k[r+2>>1]=0,H=[0,(B=0,+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],$[r+8>>2]=H[0],$[r+12>>2]=H[1],H=[0,(B=0,+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],$[r+16>>2]=H[0],$[r+20>>2]=H[1],0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return e.errno}},z:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a<t;a++){var i=P[r>>2],s=P[r+4>>2];r+=8;var l=ye.read(e,_,i,s,n);if(l<0)return-1;if(o+=l,l<s)break;void 0!==n&&(n+=l)}return o})(we.getStreamFromFD(e),r,t);return P[n>>2]=o,0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return e.errno}},P:function(e,r,t,n,o){var a=be(r,t);try{if(isNaN(a))return 61;var i=we.getStreamFromFD(e);return ye.llseek(i,a,n),H=[i.position>>>0,(B=i.position,+Math.abs(B)>=1?B>0?+Math.floor(B/4294967296)>>>0:~~+Math.ceil((B-+(~~B>>>0))/4294967296)>>>0:0)],$[o>>2]=H[0],$[o+4>>2]=H[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return e.errno}},ba:function(e){try{var r=we.getStreamFromFD(e);return r.stream_ops?.fsync?r.stream_ops.fsync(r):0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return e.errno}},y:function(e,r,t,n){try{var o=((e,r,t,n)=>{for(var o=0,a=0;a<t;a++){var i=P[r>>2],s=P[r+4>>2];r+=8;var l=ye.write(e,_,i,s,n);if(l<0)return-1;o+=l,void 0!==n&&(n+=l)}return o})(we.getStreamFromFD(e),r,t);return P[n>>2]=o,0}catch(e){if(void 0===ye||"ErrnoError"!==e.name)throw e;return e.errno}},S:(e,r)=>(re(b.subarray(e,e+r)),0),na:e=>{e,Q||(i.onExit?.(e),F=!0),h(e,new K(e))},va:(e,r,t)=>{for(var n=ge(r),o="\\!@#$^&*()+=-[]/{}|:<>?,.",a=0,i=o.length;a<i;++a)n=n.replace(new RegExp("\\"+o[a],"g"),"\\"+o[a]);var s={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"},l={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)?)"},u=[],d=n.replace(/%(.)/g,((e,r)=>s[r]||e)).replace(/%(.)/g,((e,r)=>{let t=l[r];return t?(u.push(r),`(${t})`):r})).replace(/\s+/g,"\\s*"),c=new RegExp("^"+d,"i").exec(ge(e));if(c){var f,h=function(){function e(e,r,t){return"number"!=typeof e||isNaN(e)?r:e>=r?e<=t?e:t:r}return{year:e($[t+20>>2]+1900,1970,9999),month:e($[t+16>>2],0,11),day:e($[t+12>>2],1,31),hour:e($[t+8>>2],0,23),min:e($[t+4>>2],0,59),sec:e($[t>>2],0,59),gmtoff:0}}(),p=e=>{var r=u.indexOf(e);if(r>=0)return c[r+1]};if((f=p("S"))&&(h.sec=yt(f)),(f=p("M"))&&(h.min=yt(f)),f=p("H"))h.hour=yt(f);else if(f=p("I")){var m=yt(f);(f=p("p"))&&(m+="P"===f.toUpperCase()[0]?12:0),h.hour=m}if(f=p("Y"))h.year=yt(f);else if(f=p("y")){var v=yt(f);(f=p("C"))?v+=100*yt(f):v+=v<69?2e3:1900,h.year=v}if((f=p("m"))?h.month=yt(f)-1:(f=p("b"))&&(h.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}[f.substring(0,3).toUpperCase()]||0),f=p("d"))h.day=yt(f);else if(f=p("j"))for(var y=yt(f),g=Zr(h.year),w=0;w<12;++w){var E=ht(g?pt:mt,w-1);y<=E+(g?pt:mt)[w]&&(h.day=y-E)}else if(f=p("a")){var _=f.substring(0,3).toUpperCase();if(f=p("U")){var b={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6}[_],k=yt(f);P=0===(C=new Date(h.year,0,1)).getDay()?vt(C,b+7*(k-1)):vt(C,7-C.getDay()+b+7*(k-1)),h.day=P.getDate(),h.month=P.getMonth()}else if(f=p("W")){var C,P;b={MON:0,TUE:1,WED:2,THU:3,FRI:4,SAT:5,SUN:6}[_],k=yt(f);P=1===(C=new Date(h.year,0,1)).getDay()?vt(C,b+7*(k-1)):vt(C,7-C.getDay()+1+b+7*(k-1)),h.day=P.getDate(),h.month=P.getMonth()}}if(f=p("z"))if("z"===f.toLowerCase())h.gmtoff=0;else{var T=f.match(/^((?:\-|\+)\d\d):?(\d\d)?/);h.gmtoff=3600*T[1],T[2]&&(h.gmtoff+=h.gmtoff>0?60*T[2]:60*-T[2])}var D=new Date(h.year,h.month,h.day,h.hour,h.min,h.sec,0);return $[t>>2]=D.getSeconds(),$[t+4>>2]=D.getMinutes(),$[t+8>>2]=D.getHours(),$[t+12>>2]=D.getDate(),$[t+16>>2]=D.getMonth(),$[t+20>>2]=D.getFullYear()-1900,$[t+24>>2]=D.getDay(),$[t+28>>2]=ht(Zr(D.getFullYear())?pt:mt,D.getMonth()-1)+D.getDate()-1,$[t+32>>2]=0,$[t+36>>2]=h.gmtoff,e+le(c[0]).length-1}return 0}},kt=function(){var e,r,t,o,a={a:bt};function s(e,r){var t;return kt=e.exports,g=kt.Ba,M(),_r=kt.Ga,t=kt.Ca,j.unshift(t),W(),kt}if(U(),i.instantiateWasm)try{return i.instantiateWasm(a,s)}catch(e){E(`Module.instantiateWasm callback failed with error: ${e}`),n(e)}return I||(I=Y()),(e=y,r=I,t=a,o=function(e){s(e.instance)},e||"function"!=typeof WebAssembly.instantiateStreaming||V(r)||q(r)||d||"function"!=typeof fetch?X(r,t,o):fetch(r,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,t).then(o,(function(e){return E(`wasm streaming compile failed: ${e}`),E("falling back to ArrayBuffer instantiation"),X(r,t,o)}))))).catch(n),{}}(),Ct=e=>(Ct=kt.Da)(e),$t=e=>($t=kt.Ea)(e),Pt=e=>(Pt=kt.Fa)(e),Tt=(e,r)=>(Tt=kt.Ha)(e,r),Dt=()=>(Dt=kt.Ia)(),Ft=e=>(Ft=kt.Ja)(e);i.dynCall_jiji=(e,r,t,n,o)=>(i.dynCall_jiji=kt.Ka)(e,r,t,n,o),i.dynCall_ji=(e,r)=>(i.dynCall_ji=kt.La)(e,r),i.dynCall_viij=(e,r,t,n,o)=>(i.dynCall_viij=kt.Ma)(e,r,t,n,o),i.dynCall_iij=(e,r,t,n)=>(i.dynCall_iij=kt.Na)(e,r,t,n),i.dynCall_iiji=(e,r,t,n,o)=>(i.dynCall_iiji=kt.Oa)(e,r,t,n,o),i.dynCall_jji=(e,r,t,n)=>(i.dynCall_jji=kt.Pa)(e,r,t,n),i.dynCall_iji=(e,r,t,n)=>(i.dynCall_iji=kt.Qa)(e,r,t,n),i.dynCall_viijj=(e,r,t,n,o,a,s)=>(i.dynCall_viijj=kt.Ra)(e,r,t,n,o,a,s),i.dynCall_iiij=(e,r,t,n,o)=>(i.dynCall_iiij=kt.Sa)(e,r,t,n,o),i.dynCall_vij=(e,r,t,n)=>(i.dynCall_vij=kt.Ta)(e,r,t,n),i.dynCall_viiiji=(e,r,t,n,o,a,s)=>(i.dynCall_viiiji=kt.Ua)(e,r,t,n,o,a,s),i.dynCall_viijii=(e,r,t,n,o,a,s)=>(i.dynCall_viijii=kt.Va)(e,r,t,n,o,a,s),i.dynCall_viji=(e,r,t,n,o)=>(i.dynCall_viji=kt.Wa)(e,r,t,n,o),i.dynCall_iiiijij=(e,r,t,n,o,a,s,l,u)=>(i.dynCall_iiiijij=kt.Xa)(e,r,t,n,o,a,s,l,u),i.dynCall_jij=(e,r,t,n)=>(i.dynCall_jij=kt.Ya)(e,r,t,n),i.dynCall_iiiij=(e,r,t,n,o,a)=>(i.dynCall_iiiij=kt.Za)(e,r,t,n,o,a),i.dynCall_iiiiij=(e,r,t,n,o,a,s)=>(i.dynCall_iiiiij=kt._a)(e,r,t,n,o,a,s),i.dynCall_iiiiijj=(e,r,t,n,o,a,s,l,u)=>(i.dynCall_iiiiijj=kt.$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=kt.ab)(e,r,t,n,o,a,s,l,u,d),i.___emscripten_embedded_file_data=167460;function St(){function e(){_t||(_t=!0,i.calledRun=!0,F||(R=!0,i.noFSInit||ye.init.initialized||ye.init(),ye.ignorePermissions=!1,ue.init(),Z(j),t(i),i.onRuntimeInitialized?.(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),O.unshift(e);var e;Z(O)}()))}N>0||(!function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),A.unshift(e);var e;Z(A)}(),N>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),e()}),1)):e()))}if(i.addRunDependency=U,i.removeRunDependency=W,i.FS_createPreloadedFile=pe,i.FS_unlink=e=>ye.unlink(e),i.FS_createPath=gt,i.FS_createDevice=Et,i.FS=ye,i.FS_createDataFile=fe,i.FS_createLazyFile=wt,x=function e(){_t||St(),_t||(x=e)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return St(),s}})();"object"==typeof exports&&"object"==typeof module?module.exports=PSPDFModuleInit:"function"==typeof define&&define.amd&&define([],(()=>PSPDFModuleInit));