| 1234567891011121314 |
- (function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=o(((e,t)=>{t.exports={}})),u=c(o(((e,t)=>{var n=(()=>{var e=typeof document<`u`?document.currentScript?.src:void 0;return typeof __filename<`u`&&(e||=__filename),(function(t={}){var n,r=t,i,a,o=new Promise((e,t)=>{i=e,a=t}),s=typeof window==`object`,c=typeof importScripts==`function`,u=typeof process==`object`&&typeof process.versions==`object`&&typeof process.versions.node==`string`&&process.type!=`renderer`,d=Object.assign({},r),f=`./this.program`,p=(e,t)=>{throw t},m=``;function h(e){return r.locateFile?r.locateFile(e,m):m+e}var g,_;if(u){var ee=l(),te=l();m=__dirname+`/`,_=e=>(e=Te(e)?new URL(e):te.normalize(e),ee.readFileSync(e)),g=(e,t=!0)=>(e=Te(e)?new URL(e):te.normalize(e),new Promise((n,r)=>{ee.readFile(e,t?void 0:`utf8`,(e,i)=>{e?r(e):n(t?i.buffer:i)})})),!r.thisProgram&&process.argv.length>1&&(f=process.argv[1].replace(/\\/g,`/`)),process.argv.slice(2),p=(e,t)=>{throw process.exitCode=e,t}}else (s||c)&&(c?m=self.location.href:typeof document<`u`&&document.currentScript&&(m=document.currentScript.src),e&&(m=e),m=m.startsWith(`blob:`)?``:m.substr(0,m.replace(/[?#].*/,``).lastIndexOf(`/`)+1),c&&(_=e=>{var t=new XMLHttpRequest;return t.open(`GET`,e,!1),t.responseType=`arraybuffer`,t.send(null),new Uint8Array(t.response)}),g=e=>Te(e)?new Promise((t,n)=>{var r=new XMLHttpRequest;r.open(`GET`,e,!0),r.responseType=`arraybuffer`,r.onload=()=>{if(r.status==200||r.status==0&&r.response){t(r.response);return}n(r.status)},r.onerror=n,r.send(null)}):fetch(e,{credentials:`same-origin`}).then(e=>e.ok?e.arrayBuffer():Promise.reject(Error(e.status+` : `+e.url))));var ne=r.print||console.log.bind(console),v=r.printErr||console.error.bind(console);Object.assign(r,d),d=null,r.arguments&&r.arguments,r.thisProgram&&(f=r.thisProgram);var re=r.wasmBinary,y,ie=!1;function ae(e,t){e||O(t)}var b,x,S,C,w,T,oe,se;function ce(){var e=y.buffer;r.HEAP8=b=new Int8Array(e),r.HEAP16=S=new Int16Array(e),r.HEAPU8=x=new Uint8Array(e),r.HEAPU16=C=new Uint16Array(e),r.HEAP32=w=new Int32Array(e),r.HEAPU32=T=new Uint32Array(e),r.HEAPF32=oe=new Float32Array(e),r.HEAPF64=se=new Float64Array(e)}var le=[],ue=[],de=[],fe=!1;function pe(){var e=r.preRun;e&&(typeof e==`function`&&(e=[e]),e.forEach(ge)),Fe(le)}function me(){fe=!0,!r.noFSInit&&!I.initialized&&I.init(),I.ignorePermissions=!1,P.init(),Fe(ue)}function he(){var e=r.postRun;e&&(typeof e==`function`&&(e=[e]),e.forEach(ve)),Fe(de)}function ge(e){le.unshift(e)}function _e(e){ue.unshift(e)}function ve(e){de.unshift(e)}var E=0,ye=null,D=null;function be(e){return e}function xe(e){E++,r.monitorRunDependencies?.(E)}function Se(e){if(E--,r.monitorRunDependencies?.(E),E==0&&(ye!==null&&(clearInterval(ye),ye=null),D)){var t=D;D=null,t()}}function O(e){r.onAbort?.(e),e=`Aborted(`+e+`)`,v(e),ie=!0,e+=`. Build with -sASSERTIONS for more info.`,fe&&Er();var t=new WebAssembly.RuntimeError(e);throw a(t),t}var Ce=`data:application/octet-stream;base64,`,we=e=>e.startsWith(Ce),Te=e=>e.startsWith(`file://`);function Ee(){var e=`occt-import-js.wasm`;return we(e)?e:h(e)}var De;function Oe(e){if(e==De&&re)return new Uint8Array(re);if(_)return _(e);throw`both async and sync fetching of the wasm failed`}function ke(e){return re?Promise.resolve().then(()=>Oe(e)):g(e).then(e=>new Uint8Array(e),()=>Oe(e))}function Ae(e,t,n){return ke(e).then(e=>WebAssembly.instantiate(e,t)).then(n,e=>{v(`failed to asynchronously prepare wasm: ${e}`),O(e)})}function je(e,t,n,r){return!e&&typeof WebAssembly.instantiateStreaming==`function`&&!we(t)&&!Te(t)&&!u&&typeof fetch==`function`?fetch(t,{credentials:`same-origin`}).then(e=>WebAssembly.instantiateStreaming(e,n).then(r,function(e){return v(`wasm streaming compile failed: ${e}`),v(`falling back to ArrayBuffer instantiation`),Ae(t,n,r)})):Ae(t,n,r)}function Me(){return{a:br}}function Ne(){var e=Me();function t(e,t){return Q=e.exports,y=Q._,ce(),Wt=Q.ba,_e(Q.$),Se(`wasm-instantiate`),Q}xe(`wasm-instantiate`);function n(e){t(e.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(e,t)}catch(e){v(`Module.instantiateWasm callback failed with error: ${e}`),a(e)}return De??=Ee(),je(re,De,e,n).catch(a),{}}var k,A;function Pe(e){this.name=`ExitStatus`,this.message=`Program terminated with exit(${e})`,this.status=e}var Fe=e=>{e.forEach(e=>e(r))},Ie=r.noExitRuntime||!0,j={isAbs:e=>e.charAt(0)===`/`,splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];i===`.`?e.splice(r,1):i===`..`?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift(`..`);return e},normalize:e=>{var t=j.isAbs(e),n=e.substr(-1)===`/`;return e=j.normalizeArray(e.split(`/`).filter(e=>!!e),!t).join(`/`),!e&&!t&&(e=`.`),e&&n&&(e+=`/`),(t?`/`:``)+e},dirname:e=>{var t=j.splitPath(e),n=t[0],r=t[1];return!n&&!r?`.`:(r&&=r.substr(0,r.length-1),n+r)},basename:e=>{if(e===`/`)return`/`;e=j.normalize(e),e=e.replace(/\/$/,``);var t=e.lastIndexOf(`/`);return t===-1?e:e.substr(t+1)},join:(...e)=>j.normalize(e.join(`/`)),join2:(e,t)=>j.normalize(e+`/`+t)},Le=()=>{if(typeof crypto==`object`&&typeof crypto.getRandomValues==`function`)return e=>crypto.getRandomValues(e);if(u)try{var e=l();if(e.randomFillSync)return t=>e.randomFillSync(t);var t=e.randomBytes;return e=>(e.set(t(e.byteLength)),e)}catch{}O(`initRandomDevice`)},Re=e=>(Re=Le())(e),M={resolve:(...e)=>{for(var t=``,n=!1,r=e.length-1;r>=-1&&!n;r--){var i=r>=0?e[r]:I.cwd();if(typeof i!=`string`)throw TypeError(`Arguments to path.resolve must be strings`);if(!i)return``;t=i+`/`+t,n=j.isAbs(i)}return t=j.normalizeArray(t.split(`/`).filter(e=>!!e),!n).join(`/`),(n?`/`:``)+t||`.`},relative:(e,t)=>{e=M.resolve(e).substr(1),t=M.resolve(t).substr(1);function n(e){for(var t=0;t<e.length&&e[t]===``;t++);for(var n=e.length-1;n>=0&&e[n]===``;n--);return t>n?[]:e.slice(t,n-t+1)}for(var r=n(e.split(`/`)),i=n(t.split(`/`)),a=Math.min(r.length,i.length),o=a,s=0;s<a;s++)if(r[s]!==i[s]){o=s;break}for(var c=[],s=o;s<r.length;s++)c.push(`..`);return c=c.concat(i.slice(o)),c.join(`/`)}},ze=typeof TextDecoder<`u`?new TextDecoder:void 0,N=(e,t=0,n=NaN)=>{for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&ze)return ze.decode(e.subarray(t,i));for(var a=``;t<i;){var o=e[t++];if(!(o&128)){a+=String.fromCharCode(o);continue}var s=e[t++]&63;if((o&224)==192){a+=String.fromCharCode((o&31)<<6|s);continue}var c=e[t++]&63;if(o=(o&240)==224?(o&15)<<12|s<<6|c:(o&7)<<18|s<<12|c<<6|e[t++]&63,o<65536)a+=String.fromCharCode(o);else{var l=o-65536;a+=String.fromCharCode(55296|l>>10,56320|l&1023)}}return a},Be=[],Ve=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},He=(e,t,n,r)=>{if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<e.length;++o){var s=e.charCodeAt(o);if(s>=55296&&s<=57343){var c=e.charCodeAt(++o);s=65536+((s&1023)<<10)|c&1023}if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63}}return t[n]=0,n-i};function Ue(e,t,n){var r=n>0?n:Ve(e)+1,i=Array(r),a=He(e,i,0,i.length);return t&&(i.length=a),i}var We=()=>{if(!Be.length){var e=null;if(u){var t=256,n=Buffer.alloc(t),r=0,i=process.stdin.fd;try{r=ee.readSync(i,n,0,t)}catch(e){if(e.toString().includes(`EOF`))r=0;else throw e}r>0&&(e=n.slice(0,r).toString(`utf-8`))}else typeof window<`u`&&typeof window.prompt==`function`&&(e=window.prompt(`Input: `),e!==null&&(e+=`
- `));if(!e)return null;Be=Ue(e,!0)}return Be.shift()},P={ttys:[],init(){},shutdown(){},register(e,t){P.ttys[e]={input:[],output:[],ops:t},I.registerDevice(e,P.stream_ops)},stream_ops:{open(e){var t=P.ttys[e.node.rdev];if(!t)throw new I.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,i){if(!e.tty||!e.tty.ops.get_char)throw new I.ErrnoError(60);for(var a=0,o=0;o<r;o++){var s;try{s=e.tty.ops.get_char(e.tty)}catch{throw new I.ErrnoError(29)}if(s===void 0&&a===0)throw new I.ErrnoError(6);if(s==null)break;a++,t[n+o]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,t,n,r,i){if(!e.tty||!e.tty.ops.put_char)throw new I.ErrnoError(60);try{for(var a=0;a<r;a++)e.tty.ops.put_char(e.tty,t[n+a])}catch{throw new I.ErrnoError(29)}return r&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char(e){return We()},put_char(e,t){t===null||t===10?(ne(N(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(ne(N(e.output)),e.output=[])},ioctl_tcgets(e){return{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,t,n){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(v(N(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(v(N(e.output)),e.output=[])}}},Ge=(e,t)=>{x.fill(0,e,e+t)},Ke=(e,t)=>Math.ceil(e/t)*t,qe=e=>{e=Ke(e,65536);var t=Tr(65536,e);return t&&Ge(t,e),t},F={ops_table:null,mount(e){return F.createNode(null,`/`,16895,0)},createNode(e,t,n,r){if(I.isBlkdev(n)||I.isFIFO(n))throw new I.ErrnoError(63);F.ops_table||={dir:{node:{getattr:F.node_ops.getattr,setattr:F.node_ops.setattr,lookup:F.node_ops.lookup,mknod:F.node_ops.mknod,rename:F.node_ops.rename,unlink:F.node_ops.unlink,rmdir:F.node_ops.rmdir,readdir:F.node_ops.readdir,symlink:F.node_ops.symlink},stream:{llseek:F.stream_ops.llseek}},file:{node:{getattr:F.node_ops.getattr,setattr:F.node_ops.setattr},stream:{llseek:F.stream_ops.llseek,read:F.stream_ops.read,write:F.stream_ops.write,allocate:F.stream_ops.allocate,mmap:F.stream_ops.mmap,msync:F.stream_ops.msync}},link:{node:{getattr:F.node_ops.getattr,setattr:F.node_ops.setattr,readlink:F.node_ops.readlink},stream:{}},chrdev:{node:{getattr:F.node_ops.getattr,setattr:F.node_ops.setattr},stream:I.chrdev_stream_ops}};var i=I.createNode(e,t,n,r);return I.isDir(i.mode)?(i.node_ops=F.ops_table.dir.node,i.stream_ops=F.ops_table.dir.stream,i.contents={}):I.isFile(i.mode)?(i.node_ops=F.ops_table.file.node,i.stream_ops=F.ops_table.file.stream,i.usedBytes=0,i.contents=null):I.isLink(i.mode)?(i.node_ops=F.ops_table.link.node,i.stream_ops=F.ops_table.link.stream):I.isChrdev(i.mode)&&(i.node_ops=F.ops_table.chrdev.node,i.stream_ops=F.ops_table.chrdev.stream),i.timestamp=Date.now(),e&&(e.contents[t]=i,e.timestamp=i.timestamp),i},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array},expandFileStorage(e,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){t=Math.max(t,n*(n<1024*1024?2:1.125)>>>0),n!=0&&(t=Math.max(t,256));var r=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(r.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=I.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,I.isDir(e.mode)?t.size=4096:I.isFile(e.mode)?t.size=e.usedBytes:I.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&F.resizeFileStorage(e,t.size)},lookup(e,t){throw I.genericErrors[44]},mknod(e,t,n,r){return F.createNode(e,t,n,r)},rename(e,t,n){if(I.isDir(e.mode)){var r;try{r=I.lookupNode(t,n)}catch{}if(r)for(var i in r.contents)throw new I.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){for(var n in I.lookupNode(e,t).contents)throw new I.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[`.`,`..`];for(var n of Object.keys(e.contents))t.push(n);return t},symlink(e,t,n){var r=F.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!I.isLink(e.mode))throw new I.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,r,i){var a=e.node.contents;if(i>=e.node.usedBytes)return 0;var o=Math.min(e.node.usedBytes-i,r);if(o>8&&a.subarray)t.set(a.subarray(i,i+o),n);else for(var s=0;s<o;s++)t[n+s]=a[i+s];return o},write(e,t,n,r,i,a){if(t.buffer===b.buffer&&(a=!1),!r)return 0;var o=e.node;if(o.timestamp=Date.now(),t.subarray&&(!o.contents||o.contents.subarray)){if(a)return o.contents=t.subarray(n,n+r),o.usedBytes=r,r;if(o.usedBytes===0&&i===0)return o.contents=t.slice(n,n+r),o.usedBytes=r,r;if(i+r<=o.usedBytes)return o.contents.set(t.subarray(n,n+r),i),r}if(F.expandFileStorage(o,i+r),o.contents.subarray&&t.subarray)o.contents.set(t.subarray(n,n+r),i);else for(var s=0;s<r;s++)o.contents[i+s]=t[n+s];return o.usedBytes=Math.max(o.usedBytes,i+r),r},llseek(e,t,n){var r=t;if(n===1?r+=e.position:n===2&&I.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new I.ErrnoError(28);return r},allocate(e,t,n){F.expandFileStorage(e.node,t+n),e.node.usedBytes=Math.max(e.node.usedBytes,t+n)},mmap(e,t,n,r,i){if(!I.isFile(e.node.mode))throw new I.ErrnoError(43);var a,o,s=e.node.contents;if(!(i&2)&&s&&s.buffer===b.buffer)o=!1,a=s.byteOffset;else{if(o=!0,a=qe(t),!a)throw new I.ErrnoError(48);s&&((n>0||n+t<s.length)&&(s=s.subarray?s.subarray(n,n+t):Array.prototype.slice.call(s,n,n+t)),b.set(s,a))}return{ptr:a,allocated:o}},msync(e,t,n,r,i){return F.stream_ops.write(e,t,0,r,n,!1),0}}},Je=(e,t,n,r)=>{var i=r?``:be(`al ${e}`);g(e).then(e=>{t(new Uint8Array(e)),i&&Se(i)},t=>{if(n)n();else throw`Loading data file "${e}" failed.`}),i&&xe(i)},Ye=(e,t,n,r,i,a)=>{I.createDataFile(e,t,n,r,i,a)},Xe=r.preloadPlugins||[],Ze=(e,t,n,r)=>{typeof Browser<`u`&&Browser.init();var i=!1;return Xe.forEach(a=>{i||a.canHandle(t)&&(a.handle(e,t,n,r),i=!0)}),i},Qe=(e,t,n,r,i,a,o,s,c,l)=>{var u=t?M.resolve(j.join2(e,t)):e,d=be(`cp ${u}`);function f(n){function f(n){l?.(),s||Ye(e,t,n,r,i,c),a?.(),Se(d)}Ze(n,u,f,()=>{o?.(),Se(d)})||f(n)}xe(d),typeof n==`string`?Je(n,f,o):f(n)},$e=e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if(t===void 0)throw Error(`Unknown file open mode: ${e}`);return t},et=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},I={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,readFiles:{},FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!=1}get isWrite(){return(this.flags&2097155)!=0}get isAppend(){return this.flags&1024}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,t,n,r){e||=this,this.parent=e,this.mount=e.mount,this.mounted=null,this.id=I.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r,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 I.isDir(this.mode)}get isDevice(){return I.isChrdev(this.mode)}},lookupPath(e,t={}){if(e=M.resolve(e),!e)return{path:``,node:null};if(t=Object.assign({follow_mount:!0,recurse_count:0},t),t.recurse_count>8)throw new I.ErrnoError(32);for(var n=e.split(`/`).filter(e=>!!e),r=I.root,i=`/`,a=0;a<n.length;a++){var o=a===n.length-1;if(o&&t.parent)break;if(r=I.lookupNode(r,n[a]),i=j.join2(i,n[a]),I.isMountpoint(r)&&(!o||o&&t.follow_mount)&&(r=r.mounted.root),!o||t.follow)for(var s=0;I.isLink(r.mode);){var c=I.readlink(i);if(i=M.resolve(j.dirname(i),c),r=I.lookupPath(i,{recurse_count:t.recurse_count+1}).node,s++>40)throw new I.ErrnoError(32)}}return{path:i,node:r}},getPath(e){for(var t;;){if(I.isRoot(e)){var n=e.mount.mountpoint;return t?n[n.length-1]===`/`?n+t:`${n}/${t}`:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%I.nameTable.length},hashAddNode(e){var t=I.hashName(e.parent.id,e.name);e.name_next=I.nameTable[t],I.nameTable[t]=e},hashRemoveNode(e){var t=I.hashName(e.parent.id,e.name);if(I.nameTable[t]===e)I.nameTable[t]=e.name_next;else for(var n=I.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=I.mayLookup(e);if(n)throw new I.ErrnoError(n);for(var r=I.hashName(e.id,t),i=I.nameTable[r];i;i=i.name_next){var a=i.name;if(i.parent.id===e.id&&a===t)return i}return I.lookup(e,t)},createNode(e,t,n,r){var i=new I.FSNode(e,t,n,r);return I.hashAddNode(i),i},destroyNode(e){I.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)==32768},isDir(e){return(e&61440)==16384},isLink(e){return(e&61440)==40960},isChrdev(e){return(e&61440)==8192},isBlkdev(e){return(e&61440)==24576},isFIFO(e){return(e&61440)==4096},isSocket(e){return(e&49152)==49152},flagsToPermissionString(e){var t=[`r`,`w`,`rw`][e&3];return e&512&&(t+=`w`),t},nodePermissions(e,t){return I.ignorePermissions?0:t.includes(`r`)&&!(e.mode&292)||t.includes(`w`)&&!(e.mode&146)||t.includes(`x`)&&!(e.mode&73)?2:0},mayLookup(e){return I.isDir(e.mode)?I.nodePermissions(e,`x`)||(e.node_ops.lookup?0:2):54},mayCreate(e,t){try{return I.lookupNode(e,t),20}catch{}return I.nodePermissions(e,`wx`)},mayDelete(e,t,n){var r;try{r=I.lookupNode(e,t)}catch(e){return e.errno}var i=I.nodePermissions(e,`wx`);if(i)return i;if(n){if(!I.isDir(r.mode))return 54;if(I.isRoot(r)||I.getPath(r)===I.cwd())return 10}else if(I.isDir(r.mode))return 31;return 0},mayOpen(e,t){return e?I.isLink(e.mode)?32:I.isDir(e.mode)&&(I.flagsToPermissionString(t)!==`r`||t&512)?31:I.nodePermissions(e,I.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=I.MAX_OPEN_FDS;e++)if(!I.streams[e])return e;throw new I.ErrnoError(33)},getStreamChecked(e){var t=I.getStream(e);if(!t)throw new I.ErrnoError(8);return t},getStream:e=>I.streams[e],createStream(e,t=-1){return e=Object.assign(new I.FSStream,e),t==-1&&(t=I.nextfd()),e.fd=t,I.streams[t]=e,e},closeStream(e){I.streams[e]=null},dupStream(e,t=-1){var n=I.createStream(e,t);return n.stream_ops?.dup?.(n),n},chrdev_stream_ops:{open(e){e.stream_ops=I.getDevice(e.node.rdev).stream_ops,e.stream_ops.open?.(e)},llseek(){throw new I.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){I.devices[e]={stream_ops:t}},getDevice:e=>I.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push(...r.mounts)}return t},syncfs(e,t){typeof e==`function`&&(t=e,e=!1),I.syncFSRequests++,I.syncFSRequests>1&&v(`warning: ${I.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=I.getMounts(I.root.mount),r=0;function i(e){return I.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,i(e));++r>=n.length&&i(null)}n.forEach(t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,e,a)})},mount(e,t,n){var r=n===`/`,i=!n,a;if(r&&I.root)throw new I.ErrnoError(10);if(!r&&!i){var o=I.lookupPath(n,{follow_mount:!1});if(n=o.path,a=o.node,I.isMountpoint(a))throw new I.ErrnoError(10);if(!I.isDir(a.mode))throw new I.ErrnoError(54)}var s={type:e,opts:t,mountpoint:n,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,r?I.root=c:a&&(a.mounted=s,a.mount&&a.mount.mounts.push(s)),c},unmount(e){var t=I.lookupPath(e,{follow_mount:!1});if(!I.isMountpoint(t.node))throw new I.ErrnoError(28);var n=t.node,r=n.mounted,i=I.getMounts(r);Object.keys(I.nameTable).forEach(e=>{for(var t=I.nameTable[e];t;){var n=t.name_next;i.includes(t.mount)&&I.destroyNode(t),t=n}}),n.mounted=null;var a=n.mount.mounts.indexOf(r);n.mount.mounts.splice(a,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,n){var r=I.lookupPath(e,{parent:!0}).node,i=j.basename(e);if(!i||i===`.`||i===`..`)throw new I.ErrnoError(28);var a=I.mayCreate(r,i);if(a)throw new I.ErrnoError(a);if(!r.node_ops.mknod)throw new I.ErrnoError(63);return r.node_ops.mknod(r,i,t,n)},create(e,t){return t=t===void 0?438:t,t&=4095,t|=32768,I.mknod(e,t,0)},mkdir(e,t){return t=t===void 0?511:t,t&=1023,t|=16384,I.mknod(e,t,0)},mkdirTree(e,t){for(var n=e.split(`/`),r=``,i=0;i<n.length;++i)if(n[i]){r+=`/`+n[i];try{I.mkdir(r,t)}catch(e){if(e.errno!=20)throw e}}},mkdev(e,t,n){return n===void 0&&(n=t,t=438),t|=8192,I.mknod(e,t,n)},symlink(e,t){if(!M.resolve(e))throw new I.ErrnoError(44);var n=I.lookupPath(t,{parent:!0}).node;if(!n)throw new I.ErrnoError(44);var r=j.basename(t),i=I.mayCreate(n,r);if(i)throw new I.ErrnoError(i);if(!n.node_ops.symlink)throw new I.ErrnoError(63);return n.node_ops.symlink(n,r,e)},rename(e,t){var n=j.dirname(e),r=j.dirname(t),i=j.basename(e),a=j.basename(t),o=I.lookupPath(e,{parent:!0}),s=o.node,c;if(o=I.lookupPath(t,{parent:!0}),c=o.node,!s||!c)throw new I.ErrnoError(44);if(s.mount!==c.mount)throw new I.ErrnoError(75);var l=I.lookupNode(s,i),u=M.relative(e,r);if(u.charAt(0)!==`.`)throw new I.ErrnoError(28);if(u=M.relative(t,n),u.charAt(0)!==`.`)throw new I.ErrnoError(55);var d;try{d=I.lookupNode(c,a)}catch{}if(l!==d){var f=I.isDir(l.mode),p=I.mayDelete(s,i,f);if(p||(p=d?I.mayDelete(c,a,f):I.mayCreate(c,a),p))throw new I.ErrnoError(p);if(!s.node_ops.rename)throw new I.ErrnoError(63);if(I.isMountpoint(l)||d&&I.isMountpoint(d))throw new I.ErrnoError(10);if(c!==s&&(p=I.nodePermissions(s,`w`),p))throw new I.ErrnoError(p);I.hashRemoveNode(l);try{s.node_ops.rename(l,c,a),l.parent=c}catch(e){throw e}finally{I.hashAddNode(l)}}},rmdir(e){var t=I.lookupPath(e,{parent:!0}).node,n=j.basename(e),r=I.lookupNode(t,n),i=I.mayDelete(t,n,!0);if(i)throw new I.ErrnoError(i);if(!t.node_ops.rmdir)throw new I.ErrnoError(63);if(I.isMountpoint(r))throw new I.ErrnoError(10);t.node_ops.rmdir(t,n),I.destroyNode(r)},readdir(e){var t=I.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new I.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=I.lookupPath(e,{parent:!0}).node;if(!t)throw new I.ErrnoError(44);var n=j.basename(e),r=I.lookupNode(t,n),i=I.mayDelete(t,n,!1);if(i)throw new I.ErrnoError(i);if(!t.node_ops.unlink)throw new I.ErrnoError(63);if(I.isMountpoint(r))throw new I.ErrnoError(10);t.node_ops.unlink(t,n),I.destroyNode(r)},readlink(e){var t=I.lookupPath(e).node;if(!t)throw new I.ErrnoError(44);if(!t.node_ops.readlink)throw new I.ErrnoError(28);return M.resolve(I.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var n=I.lookupPath(e,{follow:!t}).node;if(!n)throw new I.ErrnoError(44);if(!n.node_ops.getattr)throw new I.ErrnoError(63);return n.node_ops.getattr(n)},lstat(e){return I.stat(e,!0)},chmod(e,t,n){var r=typeof e==`string`?I.lookupPath(e,{follow:!n}).node:e;if(!r.node_ops.setattr)throw new I.ErrnoError(63);r.node_ops.setattr(r,{mode:t&4095|r.mode&-4096,timestamp:Date.now()})},lchmod(e,t){I.chmod(e,t,!0)},fchmod(e,t){var n=I.getStreamChecked(e);I.chmod(n.node,t)},chown(e,t,n,r){var i=typeof e==`string`?I.lookupPath(e,{follow:!r}).node:e;if(!i.node_ops.setattr)throw new I.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Date.now()})},lchown(e,t,n){I.chown(e,t,n,!0)},fchown(e,t,n){var r=I.getStreamChecked(e);I.chown(r.node,t,n)},truncate(e,t){if(t<0)throw new I.ErrnoError(28);var n=typeof e==`string`?I.lookupPath(e,{follow:!0}).node:e;if(!n.node_ops.setattr)throw new I.ErrnoError(63);if(I.isDir(n.mode))throw new I.ErrnoError(31);if(!I.isFile(n.mode))throw new I.ErrnoError(28);var r=I.nodePermissions(n,`w`);if(r)throw new I.ErrnoError(r);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate(e,t){var n=I.getStreamChecked(e);if(!(n.flags&2097155))throw new I.ErrnoError(28);I.truncate(n.node,t)},utime(e,t,n){var r=I.lookupPath(e,{follow:!0}).node;r.node_ops.setattr(r,{timestamp:Math.max(t,n)})},open(e,t,n){if(e===``)throw new I.ErrnoError(44);t=typeof t==`string`?$e(t):t,t&64?(n=n===void 0?438:n,n=n&4095|32768):n=0;var i;if(typeof e==`object`)i=e;else{e=j.normalize(e);try{i=I.lookupPath(e,{follow:!(t&131072)}).node}catch{}}var a=!1;if(t&64)if(i){if(t&128)throw new I.ErrnoError(20)}else i=I.mknod(e,n,0),a=!0;if(!i)throw new I.ErrnoError(44);if(I.isChrdev(i.mode)&&(t&=-513),t&65536&&!I.isDir(i.mode))throw new I.ErrnoError(54);if(!a){var o=I.mayOpen(i,t);if(o)throw new I.ErrnoError(o)}t&512&&!a&&I.truncate(i,0),t&=-131713;var s=I.createStream({node:i,path:I.getPath(i),flags:t,seekable:!0,position:0,stream_ops:i.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),r.logReadFiles&&!(t&1)&&(e in I.readFiles||(I.readFiles[e]=1)),s},close(e){if(I.isClosed(e))throw new I.ErrnoError(8);e.getdents&&=null;try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{I.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,n){if(I.isClosed(e))throw new I.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new I.ErrnoError(70);if(n!=0&&n!=1&&n!=2)throw new I.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,i){if(r<0||i<0)throw new I.ErrnoError(28);if(I.isClosed(e)||(e.flags&2097155)==1)throw new I.ErrnoError(8);if(I.isDir(e.node.mode))throw new I.ErrnoError(31);if(!e.stream_ops.read)throw new I.ErrnoError(28);var a=i!==void 0;if(!a)i=e.position;else if(!e.seekable)throw new I.ErrnoError(70);var o=e.stream_ops.read(e,t,n,r,i);return a||(e.position+=o),o},write(e,t,n,r,i,a){if(r<0||i<0)throw new I.ErrnoError(28);if(I.isClosed(e)||!(e.flags&2097155))throw new I.ErrnoError(8);if(I.isDir(e.node.mode))throw new I.ErrnoError(31);if(!e.stream_ops.write)throw new I.ErrnoError(28);e.seekable&&e.flags&1024&&I.llseek(e,0,2);var o=i!==void 0;if(!o)i=e.position;else if(!e.seekable)throw new I.ErrnoError(70);var s=e.stream_ops.write(e,t,n,r,i,a);return o||(e.position+=s),s},allocate(e,t,n){if(I.isClosed(e))throw new I.ErrnoError(8);if(t<0||n<=0)throw new I.ErrnoError(28);if(!(e.flags&2097155))throw new I.ErrnoError(8);if(!I.isFile(e.node.mode)&&!I.isDir(e.node.mode))throw new I.ErrnoError(43);if(!e.stream_ops.allocate)throw new I.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap(e,t,n,r,i){if(r&2&&!(i&2)&&(e.flags&2097155)!=2||(e.flags&2097155)==1)throw new I.ErrnoError(2);if(!e.stream_ops.mmap)throw new I.ErrnoError(43);if(!t)throw new I.ErrnoError(28);return e.stream_ops.mmap(e,t,n,r,i)},msync(e,t,n,r,i){return e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,i):0},ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new I.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||`binary`,t.encoding!==`utf8`&&t.encoding!==`binary`)throw Error(`Invalid encoding type "${t.encoding}"`);var n,r=I.open(e,t.flags),i=I.stat(e).size,a=new Uint8Array(i);return I.read(r,a,0,i,0),t.encoding===`utf8`?n=N(a):t.encoding===`binary`&&(n=a),I.close(r),n},writeFile(e,t,n={}){n.flags=n.flags||577;var r=I.open(e,n.flags,n.mode);if(typeof t==`string`){var i=new Uint8Array(Ve(t)+1),a=He(t,i,0,i.length);I.write(r,i,0,a,void 0,n.canOwn)}else if(ArrayBuffer.isView(t))I.write(r,t,0,t.byteLength,void 0,n.canOwn);else throw Error(`Unsupported data type`);I.close(r)},cwd:()=>I.currentPath,chdir(e){var t=I.lookupPath(e,{follow:!0});if(t.node===null)throw new I.ErrnoError(44);if(!I.isDir(t.node.mode))throw new I.ErrnoError(54);var n=I.nodePermissions(t.node,`x`);if(n)throw new I.ErrnoError(n);I.currentPath=t.path},createDefaultDirectories(){I.mkdir(`/tmp`),I.mkdir(`/home`),I.mkdir(`/home/web_user`)},createDefaultDevices(){I.mkdir(`/dev`),I.registerDevice(I.makedev(1,3),{read:()=>0,write:(e,t,n,r,i)=>r}),I.mkdev(`/dev/null`,I.makedev(1,3)),P.register(I.makedev(5,0),P.default_tty_ops),P.register(I.makedev(6,0),P.default_tty1_ops),I.mkdev(`/dev/tty`,I.makedev(5,0)),I.mkdev(`/dev/tty1`,I.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(t===0&&(t=Re(e).byteLength),e[--t]);I.createDevice(`/dev`,`random`,n),I.createDevice(`/dev`,`urandom`,n),I.mkdir(`/dev/shm`),I.mkdir(`/dev/shm/tmp`)},createSpecialDirectories(){I.mkdir(`/proc`);var e=I.mkdir(`/proc/self`);I.mkdir(`/proc/self/fd`),I.mount({mount(){var t=I.createNode(e,`fd`,16895,73);return t.node_ops={lookup(e,t){var n=+t,r=I.getStreamChecked(n),i={parent:null,mount:{mountpoint:`fake`},node_ops:{readlink:()=>r.path}};return i.parent=i,i}},t}},{},`/proc/self/fd`)},createStandardStreams(e,t,n){e?I.createDevice(`/dev`,`stdin`,e):I.symlink(`/dev/tty`,`/dev/stdin`),t?I.createDevice(`/dev`,`stdout`,null,t):I.symlink(`/dev/tty`,`/dev/stdout`),n?I.createDevice(`/dev`,`stderr`,null,n):I.symlink(`/dev/tty1`,`/dev/stderr`),I.open(`/dev/stdin`,0),I.open(`/dev/stdout`,1),I.open(`/dev/stderr`,1)},staticInit(){[44].forEach(e=>{I.genericErrors[e]=new I.ErrnoError(e),I.genericErrors[e].stack=`<generic error, no stack>`}),I.nameTable=Array(4096),I.mount(F,{},`/`),I.createDefaultDirectories(),I.createDefaultDevices(),I.createSpecialDirectories(),I.filesystems={MEMFS:F}},init(e,t,n){I.initialized=!0,e??=r.stdin,t??=r.stdout,n??=r.stderr,I.createStandardStreams(e,t,n)},quit(){I.initialized=!1;for(var e=0;e<I.streams.length;e++){var t=I.streams[e];t&&I.close(t)}},findObject(e,t){var n=I.analyzePath(e,t);return n.exists?n.object:null},analyzePath(e,t){try{var n=I.lookupPath(e,{follow:!t});e=n.path}catch{}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=I.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=j.basename(e),n=I.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot=n.path===`/`}catch(e){r.error=e.errno}return r},createPath(e,t,n,r){e=typeof e==`string`?e:I.getPath(e);for(var i=t.split(`/`).reverse();i.length;){var a=i.pop();if(a){var o=j.join2(e,a);try{I.mkdir(o)}catch{}e=o}}return o},createFile(e,t,n,r,i){var a=j.join2(typeof e==`string`?e:I.getPath(e),t),o=et(r,i);return I.create(a,o)},createDataFile(e,t,n,r,i,a){var o=t;e&&(e=typeof e==`string`?e:I.getPath(e),o=t?j.join2(e,t):e);var s=et(r,i),c=I.create(o,s);if(n){if(typeof n==`string`){for(var l=Array(n.length),u=0,d=n.length;u<d;++u)l[u]=n.charCodeAt(u);n=l}I.chmod(c,s|146);var f=I.open(c,577);I.write(f,n,0,n.length,0,a),I.close(f),I.chmod(c,s)}},createDevice(e,t,n,r){var i=j.join2(typeof e==`string`?e:I.getPath(e),t),a=et(!!n,!!r);I.createDevice.major??=64;var o=I.makedev(I.createDevice.major++,0);return I.registerDevice(o,{open(e){e.seekable=!1},close(e){r?.buffer?.length&&r(10)},read(e,t,r,i,a){for(var o=0,s=0;s<i;s++){var c;try{c=n()}catch{throw new I.ErrnoError(29)}if(c===void 0&&o===0)throw new I.ErrnoError(6);if(c==null)break;o++,t[r+s]=c}return o&&(e.node.timestamp=Date.now()),o},write(e,t,n,i,a){for(var o=0;o<i;o++)try{r(t[n+o])}catch{throw new I.ErrnoError(29)}return i&&(e.node.timestamp=Date.now()),o}}),I.mkdev(i,a,o)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<`u`)throw 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=_(e.url),e.usedBytes=e.contents.length}catch{throw new I.ErrnoError(29)}},createLazyFile(e,t,n,r,i){class a{constructor(){this.lengthKnown=!1,this.chunks=[]}get(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,n=e/this.chunkSize|0;return this.getter(n)[t]}}setDataGetter(e){this.getter=e}cacheLength(){var e=new XMLHttpRequest;if(e.open(`HEAD`,n,!1),e.send(null),!(e.status>=200&&e.status<300||e.status===304))throw Error(`Couldn't load `+n+`. Status: `+e.status);var t=Number(e.getResponseHeader(`Content-length`)),r,i=(r=e.getResponseHeader(`Accept-Ranges`))&&r===`bytes`,a=(r=e.getResponseHeader(`Content-Encoding`))&&r===`gzip`,o=1024*1024;i||(o=t);var s=(e,r)=>{if(e>r)throw Error(`invalid range (`+e+`, `+r+`) or no bytes requested!`);if(r>t-1)throw Error(`only `+t+` bytes available! programmer error!`);var i=new XMLHttpRequest;if(i.open(`GET`,n,!1),t!==o&&i.setRequestHeader(`Range`,`bytes=`+e+`-`+r),i.responseType=`arraybuffer`,i.overrideMimeType&&i.overrideMimeType(`text/plain; charset=x-user-defined`),i.send(null),!(i.status>=200&&i.status<300||i.status===304))throw Error(`Couldn't load `+n+`. Status: `+i.status);return i.response===void 0?Ue(i.responseText||``,!0):new Uint8Array(i.response||[])},c=this;c.setDataGetter(e=>{var n=e*o,r=(e+1)*o-1;if(r=Math.min(r,t-1),c.chunks[e]===void 0&&(c.chunks[e]=s(n,r)),c.chunks[e]===void 0)throw Error(`doXHR failed!`);return c.chunks[e]}),(a||!t)&&(o=t=1,t=this.getter(0).length,o=t,ne(`LazyFiles on gzip forces download of the whole file when length is accessed`)),this._length=t,this._chunkSize=o,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<`u`){if(!c)throw`Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc`;var o={isDevice:!1,contents:new a}}else var o={isDevice:!1,url:n};var s=I.createFile(e,t,o,r,i);o.contents?s.contents=o.contents:o.url&&(s.contents=null,s.url=o.url),Object.defineProperties(s,{usedBytes:{get:function(){return this.contents.length}}});var l={};Object.keys(s.stream_ops).forEach(e=>{var t=s.stream_ops[e];l[e]=(...e)=>(I.forceLoadFile(s),t(...e))});function u(e,t,n,r,i){var a=e.node.contents;if(i>=a.length)return 0;var o=Math.min(a.length-i,r);if(a.slice)for(var s=0;s<o;s++)t[n+s]=a[i+s];else for(var s=0;s<o;s++)t[n+s]=a.get(i+s);return o}return l.read=(e,t,n,r,i)=>(I.forceLoadFile(s),u(e,t,n,r,i)),l.mmap=(e,t,n,r,i)=>{I.forceLoadFile(s);var a=qe(t);if(!a)throw new I.ErrnoError(48);return u(e,b,a,t,n),{ptr:a,allocated:!0}},s.stream_ops=l,s}},tt=(e,t)=>e?N(x,e,t):``,L={DEFAULT_POLLMASK:5,calculateAt(e,t,n){if(j.isAbs(t))return t;var r=e===-100?I.cwd():L.getStreamFromFD(e).path;if(t.length==0){if(!n)throw new I.ErrnoError(44);return r}return j.join2(r,t)},doStat(e,t,n){var r=e(t);w[n>>2]=r.dev,w[n+4>>2]=r.mode,T[n+8>>2]=r.nlink,w[n+12>>2]=r.uid,w[n+16>>2]=r.gid,w[n+20>>2]=r.rdev,A=[r.size>>>0,(k=r.size,+Math.abs(k)>=1?k>0?Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],w[n+24>>2]=A[0],w[n+28>>2]=A[1],w[n+32>>2]=4096,w[n+36>>2]=r.blocks;var i=r.atime.getTime(),a=r.mtime.getTime(),o=r.ctime.getTime();return A=[Math.floor(i/1e3)>>>0,(k=Math.floor(i/1e3),+Math.abs(k)>=1?k>0?Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],w[n+40>>2]=A[0],w[n+44>>2]=A[1],T[n+48>>2]=i%1e3*1e3*1e3,A=[Math.floor(a/1e3)>>>0,(k=Math.floor(a/1e3),+Math.abs(k)>=1?k>0?Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],w[n+56>>2]=A[0],w[n+60>>2]=A[1],T[n+64>>2]=a%1e3*1e3*1e3,A=[Math.floor(o/1e3)>>>0,(k=Math.floor(o/1e3),+Math.abs(k)>=1?k>0?Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],w[n+72>>2]=A[0],w[n+76>>2]=A[1],T[n+80>>2]=o%1e3*1e3*1e3,A=[r.ino>>>0,(k=r.ino,+Math.abs(k)>=1?k>0?Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],w[n+88>>2]=A[0],w[n+92>>2]=A[1],0},doMsync(e,t,n,r,i){if(!I.isFile(t.node.mode))throw new I.ErrnoError(43);if(r&2)return 0;var a=x.slice(e,e+n);I.msync(t,a,i,n,r)},getStreamFromFD(e){return I.getStreamChecked(e)},varargs:void 0,getStr(e){return tt(e)}};function nt(e,t){try{return e=L.getStr(e),I.chmod(e,t),0}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}function rt(e,t,n,r){try{if(t=L.getStr(t),t=L.calculateAt(e,t),n&-8)return-28;var i=I.lookupPath(t,{follow:!0}).node;if(!i)return-44;var a=``;return n&4&&(a+=`r`),n&2&&(a+=`w`),n&1&&(a+=`x`),a&&I.nodePermissions(i,a)?-2:0}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}function R(){var e=w[L.varargs>>2];return L.varargs+=4,e}var z=R;function it(e,t,n){L.varargs=n;try{var r=L.getStreamFromFD(e);switch(t){case 0:var i=R();if(i<0)return-28;for(;I.streams[i];)i++;return I.dupStream(r,i).fd;case 1:case 2:return 0;case 3:return r.flags;case 4:var i=R();return r.flags|=i,0;case 12:var i=z(),a=0;return S[i+a>>1]=2,0;case 13:case 14:return 0}return-28}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}function at(e,t){try{var n=L.getStreamFromFD(e);return L.doStat(I.stat,n.path,t)}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}function ot(e,t,n){L.varargs=n;try{var r=L.getStreamFromFD(e);switch(t){case 21509:return r.tty?0:-59;case 21505:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcgets){var i=r.tty.ops.ioctl_tcgets(r),a=z();w[a>>2]=i.c_iflag||0,w[a+4>>2]=i.c_oflag||0,w[a+8>>2]=i.c_cflag||0,w[a+12>>2]=i.c_lflag||0;for(var o=0;o<32;o++)b[a+o+17]=i.c_cc[o]||0;return 0}return 0;case 21510:case 21511:case 21512:return r.tty?0:-59;case 21506:case 21507:case 21508:if(!r.tty)return-59;if(r.tty.ops.ioctl_tcsets){for(var a=z(),s=w[a>>2],c=w[a+4>>2],l=w[a+8>>2],u=w[a+12>>2],d=[],o=0;o<32;o++)d.push(b[a+o+17]);return r.tty.ops.ioctl_tcsets(r.tty,t,{c_iflag:s,c_oflag:c,c_cflag:l,c_lflag:u,c_cc:d})}return 0;case 21519:if(!r.tty)return-59;var a=z();return w[a>>2]=0,0;case 21520:return r.tty?-28:-59;case 21531:var a=z();return I.ioctl(r,t,a);case 21523:if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var f=r.tty.ops.ioctl_tiocgwinsz(r.tty),a=z();S[a>>1]=f[0],S[a+2>>1]=f[1]}return 0;case 21524:return r.tty?0:-59;case 21515:return r.tty?0:-59;default:return-28}}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}function st(e,t){try{return e=L.getStr(e),L.doStat(I.lstat,e,t)}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}function ct(e,t,n,r){try{t=L.getStr(t);var i=r&256,a=r&4096;return r&=-6401,t=L.calculateAt(e,t,a),L.doStat(i?I.lstat:I.stat,t,n)}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}function lt(e,t,n,r){L.varargs=r;try{t=L.getStr(t),t=L.calculateAt(e,t);var i=r?R():0;return I.open(t,n,i).fd}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}function ut(e){try{return e=L.getStr(e),I.rmdir(e),0}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}function dt(e,t){try{return e=L.getStr(e),L.doStat(I.stat,e,t)}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}function ft(e,t,n){try{return t=L.getStr(t),t=L.calculateAt(e,t),n===0?I.unlink(t):n===512?I.rmdir(t):O(`Invalid flags passed to unlinkat`),0}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}var pt=()=>{O(``)},mt=(e,t,n,r,i)=>{},ht=()=>{for(var e=Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);gt=e},gt,B=e=>{for(var t=``,n=e;x[n];)t+=gt[x[n++]];return t},V={},H={},U={},_t,W=e=>{throw new _t(e)},vt,yt=e=>{throw new vt(e)},bt=(e,t,n)=>{e.forEach(e=>U[e]=t);function r(t){var r=n(t);r.length!==e.length&&yt(`Mismatched type converter count`);for(var i=0;i<e.length;++i)G(e[i],r[i])}var i=Array(t.length),a=[],o=0;t.forEach((e,t)=>{H.hasOwnProperty(e)?i[t]=H[e]:(a.push(e),V.hasOwnProperty(e)||(V[e]=[]),V[e].push(()=>{i[t]=H[e],++o,o===a.length&&r(i)}))}),a.length===0&&r(i)};function xt(e,t,n={}){var r=t.name;if(e||W(`type "${r}" must have a positive integer typeid pointer`),H.hasOwnProperty(e)){if(n.ignoreDuplicateRegistrations)return;W(`Cannot register type '${r}' twice`)}if(H[e]=t,delete U[e],V.hasOwnProperty(e)){var i=V[e];delete V[e],i.forEach(e=>e())}}function G(e,t,n={}){return xt(e,t,n)}var K=8,St=(e,t,n,r)=>{t=B(t),G(e,{name:t,fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:r},argPackAdvance:K,readValueFromPointer:function(e){return this.fromWireType(x[e])},destructorFunction:null})},Ct=[],q=[],wt=e=>{e>9&&--q[e+1]===0&&(q[e]=void 0,Ct.push(e))},Tt=()=>q.length/2-5-Ct.length,Et=()=>{q.push(0,1,void 0,1,null,1,!0,1,!1,1),r.count_emval_handles=Tt},J={toValue:e=>(e||W(`Cannot use deleted val. handle = `+e),q[e]),toHandle:e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let t=Ct.pop()||q.length;return q[t]=e,q[t+1]=1,t}}}};function Dt(e){return this.fromWireType(T[e>>2])}var Ot={name:`emscripten::val`,fromWireType:e=>{var t=J.toValue(e);return wt(e),t},toWireType:(e,t)=>J.toHandle(t),argPackAdvance:K,readValueFromPointer:Dt,destructorFunction:null},kt=e=>G(e,Ot),At=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType(oe[e>>2])};case 8:return function(e){return this.fromWireType(se[e>>3])};default:throw TypeError(`invalid float width (${t}): ${e}`)}},jt=(e,t,n)=>{t=B(t),G(e,{name:t,fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:K,readValueFromPointer:At(t,n),destructorFunction:null})},Mt=(e,t)=>Object.defineProperty(t,"name",{value:e}),Nt=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function Pt(e){for(var t=1;t<e.length;++t)if(e[t]!==null&&e[t].destructorFunction===void 0)return!0;return!1}function Ft(e,t){if(!(e instanceof Function))throw TypeError(`new_ called with constructor type ${typeof e} which is not a function`);var n=Mt(e.name||`unknownFunctionName`,function(){});n.prototype=e.prototype;var r=new n,i=e.apply(r,t);return i instanceof Object?i:r}function It(e,t,n,r){var i=Pt(e),a=e.length-2,o=[],s=[`fn`];t&&s.push(`thisWired`);for(var c=0;c<a;++c)o.push(`arg${c}`),s.push(`arg${c}Wired`);o=o.join(`,`),s=s.join(`,`);var l=`return function (${o}) {\n`;i&&(l+=`var destructors = [];
- `);var u=i?`destructors`:`null`,d=[`humanName`,`throwBindingError`,`invoker`,`fn`,`runDestructors`,`retType`,`classParam`];t&&(l+=`var thisWired = classParam['toWireType'](${u}, this);\n`);for(var c=0;c<a;++c)l+=`var arg${c}Wired = argType${c}['toWireType'](${u}, arg${c});\n`,d.push(`argType${c}`);if(l+=(n||r?`var rv = `:``)+`invoker(${s});\n`,i)l+=`runDestructors(destructors);
- `;else for(var c=t?1:2;c<e.length;++c){var f=c===1?`thisWired`:`arg`+(c-2)+`Wired`;e[c].destructorFunction!==null&&(l+=`${f}_dtor(${f});\n`,d.push(`${f}_dtor`))}return n&&(l+=`var ret = retType['fromWireType'](rv);
- return ret;
- `),l+=`}
- `,[d,l]}function Lt(e,t,n,r,i,a){var o=t.length;o<2&&W(`argTypes array size mismatch! Must at least get return value and 'this' types!`);for(var s=t[1]!==null&&n!==null,c=Pt(t),l=t[0].name!==`void`,u=[e,W,r,i,Nt,t[0],t[1]],d=0;d<o-2;++d)u.push(t[d+2]);if(!c)for(var d=s?1:2;d<t.length;++d)t[d].destructorFunction!==null&&u.push(t[d].destructorFunction);let[f,p]=It(t,s,l,a);return f.push(p),Mt(e,Ft(Function,f)(...u))}var Rt=(e,t,n)=>{if(e[t].overloadTable===void 0){var r=e[t];e[t]=function(...r){return e[t].overloadTable.hasOwnProperty(r.length)||W(`Function '${n}' called with an invalid number of arguments (${r.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[r.length].apply(this,r)},e[t].overloadTable=[],e[t].overloadTable[r.argCount]=r}},zt=(e,t,n)=>{r.hasOwnProperty(e)?((n===void 0||r[e].overloadTable!==void 0&&r[e].overloadTable[n]!==void 0)&&W(`Cannot register public name '${e}' twice`),Rt(r,e,e),r.hasOwnProperty(n)&&W(`Cannot register multiple overloads of a function with the same number of arguments (${n})!`),r[e].overloadTable[n]=t):(r[e]=t,n!==void 0&&(r[e].numArguments=n))},Bt=(e,t)=>{for(var n=[],r=0;r<e;r++)n.push(T[t+r*4>>2]);return n},Vt=(e,t,n)=>{r.hasOwnProperty(e)||yt(`Replacing nonexistent public symbol`),r[e].overloadTable!==void 0&&n!==void 0?r[e].overloadTable[n]=t:(r[e]=t,r[e].argCount=n)},Ht=(e,t,n)=>{e=e.replace(/p/g,`i`);var i=r[`dynCall_`+e];return i(t,...n)},Ut=[],Wt,Gt=e=>{var t=Ut[e];return t||(e>=Ut.length&&(Ut.length=e+1),Ut[e]=t=Wt.get(e)),t},Kt=(e,t,n=[])=>e.includes(`j`)?Ht(e,t,n):Gt(t)(...n),qt=(e,t)=>(...n)=>Kt(e,t,n),Jt=(e,t)=>{e=B(e);function n(){return e.includes(`j`)?qt(e,t):Gt(t)}var r=n();return typeof r!=`function`&&W(`unknown function pointer with signature ${e}: ${t}`),r},Yt=(e,t)=>{var n=Mt(t,function(e){this.name=t,this.message=e;var n=Error(e).stack;n!==void 0&&(this.stack=this.toString()+`
- `+n.replace(/^Error(:[^\n]*)?\n/,``))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},n},Xt,Zt=e=>{var t=Sr(e),n=B(t);return $(t),n},Qt=(e,t)=>{var n=[],r={};function i(e){if(!r[e]&&!H[e]){if(U[e]){U[e].forEach(i);return}n.push(e),r[e]=!0}}throw t.forEach(i),new Xt(`${e}: `+n.map(Zt).join([`, `]))},$t=e=>{e=e.trim();let t=e.indexOf(`(`);return t===-1?e:e.substr(0,t)},en=(e,t,n,r,i,a,o,s)=>{var c=Bt(t,n);e=B(e),e=$t(e),i=Jt(r,i),zt(e,function(){Qt(`Cannot call ${e} due to unbound types`,c)},t-1),bt([],c,n=>{var r=[n[0],null].concat(n.slice(1));return Vt(e,Lt(e,r,null,i,a,o),t-1),[]})},tn=(e,t,n)=>{switch(t){case 1:return n?e=>b[e]:e=>x[e];case 2:return n?e=>S[e>>1]:e=>C[e>>1];case 4:return n?e=>w[e>>2]:e=>T[e>>2];default:throw TypeError(`invalid integer width (${t}): ${e}`)}},nn=(e,t,n,r,i)=>{t=B(t),i===-1&&(i=4294967295);var a=e=>e;if(r===0){var o=32-8*n;a=e=>e<<o>>>o}var s=t.includes(`unsigned`)?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t};G(e,{name:t,fromWireType:a,toWireType:s,argPackAdvance:K,readValueFromPointer:tn(t,n,r!==0),destructorFunction:null})},rn=(e,t,n)=>{var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function i(e){var t=T[e>>2],n=T[e+4>>2];return new r(b.buffer,n,t)}n=B(n),G(e,{name:n,fromWireType:i,argPackAdvance:K,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},Y=(e,t,n)=>He(e,x,t,n),an=(e,t)=>{t=B(t);var n=t===`std::string`;G(e,{name:t,fromWireType(e){var t=T[e>>2],r=e+4,i;if(n)for(var a=r,o=0;o<=t;++o){var s=r+o;if(o==t||x[s]==0){var c=s-a,l=tt(a,c);i===void 0?i=l:(i+=`\0`,i+=l),a=s+1}}else{for(var u=Array(t),o=0;o<t;++o)u[o]=String.fromCharCode(x[r+o]);i=u.join(``)}return $(e),i},toWireType(e,t){t instanceof ArrayBuffer&&(t=new Uint8Array(t));var r,i=typeof t==`string`;i||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||W(`Cannot pass non-string to std::string`),r=n&&i?Ve(t):t.length;var a=Cr(4+r+1),o=a+4;if(T[a>>2]=r,n&&i)Y(t,o,r+1);else if(i)for(var s=0;s<r;++s){var c=t.charCodeAt(s);c>255&&($(o),W(`String has UTF-16 code units that do not fit in 8 bits`)),x[o+s]=c}else for(var s=0;s<r;++s)x[o+s]=t[s];return e!==null&&e.push($,a),a},argPackAdvance:K,readValueFromPointer:Dt,destructorFunction(e){$(e)}})},on=typeof TextDecoder<`u`?new TextDecoder(`utf-16le`):void 0,sn=(e,t)=>{for(var n=e,r=n>>1,i=r+t/2;!(r>=i)&&C[r];)++r;if(n=r<<1,n-e>32&&on)return on.decode(x.subarray(e,n));for(var a=``,o=0;!(o>=t/2);++o){var s=S[e+o*2>>1];if(s==0)break;a+=String.fromCharCode(s)}return a},cn=(e,t,n)=>{if(n??=2147483647,n<2)return 0;n-=2;for(var r=t,i=n<e.length*2?n/2:e.length,a=0;a<i;++a){var o=e.charCodeAt(a);S[t>>1]=o,t+=2}return S[t>>1]=0,t-r},ln=e=>e.length*2,un=(e,t)=>{for(var n=0,r=``;!(n>=t/4);){var i=w[e+n*4>>2];if(i==0)break;if(++n,i>=65536){var a=i-65536;r+=String.fromCharCode(55296|a>>10,56320|a&1023)}else r+=String.fromCharCode(i)}return r},dn=(e,t,n)=>{if(n??=2147483647,n<4)return 0;for(var r=t,i=r+n-4,a=0;a<e.length;++a){var o=e.charCodeAt(a);if(o>=55296&&o<=57343){var s=e.charCodeAt(++a);o=65536+((o&1023)<<10)|s&1023}if(w[t>>2]=o,t+=4,t+4>i)break}return w[t>>2]=0,t-r},fn=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r>=55296&&r<=57343&&++n,t+=4}return t},pn=(e,t,n)=>{n=B(n);var r,i,a,o;t===2?(r=sn,i=cn,o=ln,a=e=>C[e>>1]):t===4&&(r=un,i=dn,o=fn,a=e=>T[e>>2]),G(e,{name:n,fromWireType:e=>{for(var n=T[e>>2],i,o=e+4,s=0;s<=n;++s){var c=e+4+s*t;if(s==n||a(c)==0){var l=c-o,u=r(o,l);i===void 0?i=u:(i+=`\0`,i+=u),o=c+t}}return $(e),i},toWireType:(e,r)=>{typeof r!=`string`&&W(`Cannot pass non-string to C++ string type ${n}`);var a=o(r),s=Cr(4+a+t);return T[s>>2]=a/t,i(r,s+4,a+t),e!==null&&e.push($,s),s},argPackAdvance:K,readValueFromPointer:Dt,destructorFunction(e){$(e)}})},mn=(e,t)=>{t=B(t),G(e,{isVoid:!0,name:t,argPackAdvance:0,fromWireType:()=>void 0,toWireType:(e,t)=>void 0})},hn=1,gn=()=>hn,_n=e=>{for(var t=e.split(`.`),n=0;n<4;n++){var r=Number(t[n]);if(isNaN(r))return null;t[n]=r}return(t[0]|t[1]<<8|t[2]<<16|t[3]<<24)>>>0},vn=e=>parseInt(e),yn=e=>{var t,n,r,i,a=/^((?=.*::)(?!.*::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})$/i,o=[];if(!a.test(e))return null;if(e===`::`)return[0,0,0,0,0,0,0,0];for(e=e.startsWith(`::`)?e.replace(`::`,`Z:`):e.replace(`::`,`:Z:`),e.indexOf(`.`)>0?(e=e.replace(RegExp(`[.]`,`g`),`:`),t=e.split(`:`),t[t.length-4]=vn(t[t.length-4])+vn(t[t.length-3])*256,t[t.length-3]=vn(t[t.length-2])+vn(t[t.length-1])*256,t=t.slice(0,t.length-2)):t=e.split(`:`),r=0,i=0,n=0;n<t.length;n++)if(typeof t[n]==`string`)if(t[n]===`Z`){for(i=0;i<8-t.length+1;i++)o[n+i]=0;r=i-1}else o[n+r]=wr(parseInt(t[n],16));else o[n+r]=t[n];return[o[1]<<16|o[0],o[3]<<16|o[2],o[5]<<16|o[4],o[7]<<16|o[6]]},X={address_map:{id:1,addrs:{},names:{}},lookup_name(e){var t=_n(e);if(t!==null||(t=yn(e),t!==null))return e;var n;if(X.address_map.addrs[e])n=X.address_map.addrs[e];else{var r=X.address_map.id++;ae(r<65535,`exceeded max address mappings of 65535`),n=`172.29.`+(r&255)+`.`+(r&65280),X.address_map.names[n]=e,X.address_map.addrs[e]=n}return n},lookup_addr(e){return X.address_map.names[e]?X.address_map.names[e]:null}},bn=e=>{var t=tt(e);return _n(X.lookup_name(t))},xn=(e,t,n)=>x.copyWithin(e,t,t+n),Sn=(e,t)=>{var n=H[e];return n===void 0&&W(`${t} has unknown type ${Zt(e)}`),n},Cn=(e,t,n)=>{var r=[],i=e.toWireType(r,n);return r.length&&(T[t>>2]=J.toHandle(r)),i},wn=(e,t,n)=>(e=J.toValue(e),t=Sn(t,`emval::as`),Cn(t,n,e)),Tn={},En=e=>{var t=Tn[e];return t===void 0?B(e):t},Dn=[],On=(e,t,n,r,i)=>(e=Dn[e],t=J.toValue(t),n=En(n),e(t,t[n],r,i)),kn=()=>typeof globalThis==`object`?globalThis:function(){return Function}()(`return this`)(),An=e=>e===0?J.toHandle(kn()):(e=En(e),J.toHandle(kn()[e])),jn=e=>{var t=Dn.length;return Dn.push(e),t},Mn=(e,t)=>{for(var n=Array(e),r=0;r<e;++r)n[r]=Sn(T[t+r*4>>2],`parameter `+r);return n},Nn=(e,t,n)=>{var r=Mn(e,t),i=r.shift();e--;var a=`return function (obj, func, destructorsRef, args) {
- `,o=0,s=[];n===0&&s.push(`obj`);for(var c=[`retType`],l=[i],u=0;u<e;++u)s.push(`arg`+u),c.push(`argType`+u),l.push(r[u]),a+=` var arg${u} = argType${u}.readValueFromPointer(args${o?`+`+o:``});\n`,o+=r[u].argPackAdvance;a+=` var rv = ${n===1?`new func`:`func.call`}(${s.join(`, `)});\n`,i.isVoid||(c.push(`emval_returnValue`),l.push(Cn),a+=` return emval_returnValue(retType, destructorsRef, rv);
- `),a+=`};
- `,c.push(a);var d=Ft(Function,c)(...l);return jn(Mt(`methodCaller<(${r.map(e=>e.name).join(`, `)}) => ${i.name}>`,d))},Pn=(e,t)=>(e=J.toValue(e),t=J.toValue(t),J.toHandle(e[t])),Fn=e=>{e>9&&(q[e+1]+=1)},In=()=>J.toHandle([]),Ln=e=>J.toHandle(En(e)),Rn=()=>J.toHandle({}),zn=e=>{Nt(J.toValue(e)),wt(e)},Bn=(e,t,n)=>{e=J.toValue(e),t=J.toValue(t),n=J.toValue(n),e[t]=n},Vn=(e,t)=>{e=Sn(e,`_emval_take_value`);var n=e.readValueFromPointer(t);return J.toHandle(n)},Hn=e=>e%4==0&&(e%100!=0||e%400==0),Un=[0,31,60,91,121,152,182,213,244,274,305,335],Wn=[0,31,59,90,120,151,181,212,243,273,304,334],Gn=e=>(Hn(e.getFullYear())?Un:Wn)[e.getMonth()]+e.getDate()-1,Kn=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+t*4294967296:NaN;function qn(e,t,n){var r=Kn(e,t),i=new Date(r*1e3);w[n>>2]=i.getSeconds(),w[n+4>>2]=i.getMinutes(),w[n+8>>2]=i.getHours(),w[n+12>>2]=i.getDate(),w[n+16>>2]=i.getMonth(),w[n+20>>2]=i.getFullYear()-1900,w[n+24>>2]=i.getDay();var a=Gn(i)|0;w[n+28>>2]=a,w[n+36>>2]=-(i.getTimezoneOffset()*60);var o=new Date(i.getFullYear(),0,1),s=new Date(i.getFullYear(),6,1).getTimezoneOffset(),c=o.getTimezoneOffset(),l=(s!=c&&i.getTimezoneOffset()==Math.min(c,s))|0;w[n+32>>2]=l}function Jn(e,t,n,r,i,a,o){var s=Kn(a,o);try{var c=L.getStreamFromFD(i);n&2&&L.doMsync(e,c,t,r,s)}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return-e.errno}}var Yn=(e,t,n,r)=>{var i=new Date().getFullYear(),a=new Date(i,0,1),o=new Date(i,6,1),s=a.getTimezoneOffset(),c=o.getTimezoneOffset(),l=Math.max(s,c);T[e>>2]=l*60,w[t>>2]=Number(s!=c);var u=e=>{var t=e>=0?`-`:`+`,n=Math.abs(e);return`UTC${t}${String(Math.floor(n/60)).padStart(2,`0`)}${String(n%60).padStart(2,`0`)}`},d=u(s),f=u(c);c<s?(Y(d,n,17),Y(f,r,17)):(Y(d,r,17),Y(f,n,17))},Xn=()=>Date.now();function Zn(){return Error().stack.toString()}var Qn=e=>{Qn.shown||={},Qn.shown[e]||(Qn.shown[e]=1,u&&(e=`warning: `+e),v(e))};function $n(e){var t=Zn(),n=t.lastIndexOf(`_emscripten_log`),r=t.lastIndexOf(`_emscripten_get_callstack`),i=t.indexOf(`
- `,Math.max(n,r))+1;t=t.slice(i),e&8&&typeof emscripten_source_map>`u`&&(Qn(`Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.`),e^=8,e|=16);var a=t.split(`
- `);t=``;var o=RegExp(`\\s*(.*?)@(.*?):([0-9]+):([0-9]+)`),s=RegExp(`\\s*(.*?)@(.*):(.*)(:(.*))?`),c=RegExp(`\\s*at (.*?) \\((.*):(.*):(.*)\\)`);for(var l in a){var u=a[l],d=``,f=``,p=0,m=0,h=c.exec(u);if(h&&h.length==5)d=h[1],f=h[2],p=h[3],m=h[4];else if(h=o.exec(u)||s.exec(u),h&&h.length>=4)d=h[1],f=h[2],p=h[3],m=h[4]|0;else{t+=u+`
- `;continue}var g=!1;if(e&8){var _=emscripten_source_map.originalPositionFor({line:p,column:m});g=_?.source,g&&(e&64&&(_.source=_.source.substring(_.source.replace(/\\/g,`/`).lastIndexOf(`/`)+1)),t+=` at ${d} (${_.source}:${_.line}:${_.column})\n`)}(e&16||!g)&&(e&64&&(f=f.substring(f.replace(/\\/g,`/`).lastIndexOf(`/`)+1)),t+=(g?` = ${d}`:` at ${d}`)+` (${f}:${p}:${m})\n`)}return t=t.replace(/\s+$/,``),t}function er(e,t,n){var r=$n(e);return!t||n<=0?Ve(r)+1:Y(r,t,n)+1}var tr=()=>2147483648,nr=()=>tr(),rr=e=>{var t=(e-y.buffer.byteLength+65535)/65536|0;try{return y.grow(t),ce(),1}catch{}},ir=e=>{var t=x.length;e>>>=0;var n=tr();if(e>n)return!1;for(var r=1;r<=4;r*=2){var i=t*(1+.2/r);if(i=Math.min(i,e+100663296),rr(Math.min(n,Ke(Math.max(e,i),65536))))return!0}return!1},ar={},or=()=>f||`./this.program`,Z=()=>{if(!Z.strings){var e={USER:`web_user`,LOGNAME:`web_user`,PATH:`/`,PWD:`/`,HOME:`/home/web_user`,LANG:(typeof navigator==`object`&&navigator.languages&&navigator.languages[0]||`C`).replace(`-`,`_`)+`.UTF-8`,_:or()};for(var t in ar)ar[t]===void 0?delete e[t]:e[t]=ar[t];var n=[];for(var t in e)n.push(`${t}=${e[t]}`);Z.strings=n}return Z.strings},sr=(e,t)=>{for(var n=0;n<e.length;++n)b[t++]=e.charCodeAt(n);b[t]=0},cr=(e,t)=>{var n=0;return Z().forEach((r,i)=>{var a=t+n;T[e+i*4>>2]=a,sr(r,a),n+=r.length+1}),0},lr=(e,t)=>{var n=Z();T[e>>2]=n.length;var r=0;return n.forEach(e=>r+=e.length+1),T[t>>2]=r,0},ur=0,dr=()=>Ie||ur>0,fr=e=>{dr()||(r.onExit?.(e),ie=!0),p(e,new Pe(e))},pr=(e,t)=>{fr(e)};function mr(e){try{var t=L.getStreamFromFD(e);return I.close(t),0}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return e.errno}}var hr=(e,t,n,r)=>{for(var i=0,a=0;a<n;a++){var o=T[t>>2],s=T[t+4>>2];t+=8;var c=I.read(e,b,o,s,r);if(c<0)return-1;if(i+=c,c<s)break;r!==void 0&&(r+=c)}return i};function gr(e,t,n,r){try{var i=hr(L.getStreamFromFD(e),t,n);return T[r>>2]=i,0}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return e.errno}}function _r(e,t,n,r,i){var a=Kn(t,n);try{if(isNaN(a))return 61;var o=L.getStreamFromFD(e);return I.llseek(o,a,r),A=[o.position>>>0,(k=o.position,+Math.abs(k)>=1?k>0?Math.floor(k/4294967296)>>>0:~~+Math.ceil((k-+(~~k>>>0))/4294967296)>>>0:0)],w[i>>2]=A[0],w[i+4>>2]=A[1],o.getdents&&a===0&&r===0&&(o.getdents=null),0}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return e.errno}}var vr=(e,t,n,r)=>{for(var i=0,a=0;a<n;a++){var o=T[t>>2],s=T[t+4>>2];t+=8;var c=I.write(e,b,o,s,r);if(c<0)return-1;if(i+=c,c<s)break;r!==void 0&&(r+=c)}return i};function yr(e,t,n,r){try{var i=vr(L.getStreamFromFD(e),t,n);return T[r>>2]=i,0}catch(e){if(I===void 0||e.name!==`ErrnoError`)throw e;return e.errno}}I.createPreloadedFile=Qe,I.staticInit(),ht(),_t=r.BindingError=class extends Error{constructor(e){super(e),this.name=`BindingError`}},vt=r.InternalError=class extends Error{constructor(e){super(e),this.name=`InternalError`}},Et(),Xt=r.UnboundTypeError=Yt(Error,`UnboundTypeError`);var br={M:nt,N:rt,h:it,I:at,Q:ot,F:st,G:ct,j:lt,B:ut,H:dt,C:ft,A:pt,w:mt,V:St,U:kt,n:jt,f:en,b:nn,a:rn,m:an,i:pn,W:mn,J:gn,x:bn,L:xn,e:wn,q:On,T:wt,u:An,p:Nn,k:Pn,Y:Fn,X:In,r:Ln,Z:Rn,o:zn,c:Bn,d:Vn,t:qn,s:Jn,O:Yn,K:Xn,R:er,z:nr,y:ir,D:cr,E:lr,S:pr,g:mr,P:gr,v:_r,l:yr},Q=Ne(),xr=()=>(xr=Q.$)(),Sr=e=>(Sr=Q.aa)(e),Cr=e=>(Cr=Q.ca)(e),$=e=>($=Q.da)(e),wr=e=>(wr=Q.ea)(e),Tr=(e,t)=>(Tr=Q.fa)(e,t),Er=()=>(Er=Q.ga)(),Dr=r.dynCall_viijii=(e,t,n,i,a,o,s)=>(Dr=r.dynCall_viijii=Q.ha)(e,t,n,i,a,o,s),Or=r.dynCall_viiiiji=(e,t,n,i,a,o,s,c)=>(Or=r.dynCall_viiiiji=Q.ia)(e,t,n,i,a,o,s,c),kr=r.dynCall_jiji=(e,t,n,i,a)=>(kr=r.dynCall_jiji=Q.ja)(e,t,n,i,a),Ar=r.dynCall_iiiiij=(e,t,n,i,a,o,s)=>(Ar=r.dynCall_iiiiij=Q.ka)(e,t,n,i,a,o,s),jr=r.dynCall_iiiiijj=(e,t,n,i,a,o,s,c,l)=>(jr=r.dynCall_iiiiijj=Q.la)(e,t,n,i,a,o,s,c,l),Mr=r.dynCall_iiiiiijj=(e,t,n,i,a,o,s,c,l,u)=>(Mr=r.dynCall_iiiiiijj=Q.ma)(e,t,n,i,a,o,s,c,l,u),Nr,Pr;D=function e(){Nr||Fr(),Nr||(D=e)};function Fr(){if(E>0||!Pr&&(Pr=1,pe(),E>0))return;function e(){Nr||(Nr=1,r.calledRun=1,!ie&&(me(),i(r),r.onRuntimeInitialized?.(),he()))}r.setStatus?(r.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>r.setStatus(``),1),e()},1)):e()}if(r.preInit)for(typeof r.preInit==`function`&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return Fr(),n=o,n})})();typeof e==`object`&&typeof t==`object`?t.exports=n:typeof define==`function`&&define.amd&&define([],()=>n)}))(),1),d=`/assets/occt-import-js-BhHfLpto.wasm`;let f=null;function p(){return f||=(0,u.default)({locateFile:()=>d}).catch(e=>{throw f=null,e}),f}self.onmessage=async e=>{let{id:t}=e.data;try{let n=(await p()).ReadStepFile(new Uint8Array(e.data.buffer),null);if(!n.success||n.meshes.length===0){self.postMessage({id:t,ok:!1,reason:`no-meshes`});return}let r=n.meshes.map(e=>({positions:new Float32Array(e.attributes.position.array),normals:e.attributes.normal?new Float32Array(e.attributes.normal.array):null,indices:e.index?new Uint32Array(e.index.array):null,color:e.color??null})),i=r.flatMap(e=>{let t=[e.positions.buffer];return e.normals&&t.push(e.normals.buffer),e.indices&&t.push(e.indices.buffer),t});self.postMessage({id:t,ok:!0,meshes:r},i)}catch{self.postMessage({id:t,ok:!1,reason:`error`})}}})();
|