var lt=(()=>{var Z=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(Z=Z||__filename),function(Se={}){var i=Se,Pe,Q;i.ready=new Promise((e,a)=>{Pe=e,Q=a}),i.expectedDataFileDownloads||(i.expectedDataFileDownloads=0),i.expectedDataFileDownloads++,function(){if(!(i.ENVIRONMENT_IS_PTHREAD||i.$ww)){var e=function(a){typeof window=="object"?window.encodeURIComponent(window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/"):typeof process>"u"&&typeof location<"u"&&encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/");var t="piper_phonemize.data",r="piper_phonemize.data";typeof i.locateFilePackage=="function"&&!i.locateFile&&(i.locateFile=i.locateFilePackage,L("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)"));var s=i.locateFile?i.locateFile(r,""):r,o=a.remote_package_size;function d(v,f,g,E){if(typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"){require("fs").readFile(v,function(y,b){y?E(y):g(b.buffer)});return}var P=new XMLHttpRequest;P.open("GET",v,!0),P.responseType="arraybuffer",P.onprogress=function(y){var b=v,m=f;if(y.total&&(m=y.total),y.loaded){P.addedTotal?i.dataFileDownloads[b].loaded=y.loaded:(P.addedTotal=!0,i.dataFileDownloads||(i.dataFileDownloads={}),i.dataFileDownloads[b]={loaded:y.loaded,total:m});var c=0,D=0,A=0;for(var R in i.dataFileDownloads){var ce=i.dataFileDownloads[R];c+=ce.total,D+=ce.loaded,A++}c=Math.ceil(c*i.expectedDataFileDownloads/A),i.setStatus&&i.setStatus(`Downloading data... (${D}/${c})`)}else i.dataFileDownloads||i.setStatus&&i.setStatus("Downloading data...")},P.onerror=function(y){throw new Error("NetworkError for: "+v)},P.onload=function(y){if(P.status==200||P.status==304||P.status==206||P.status==0&&P.response){var b=P.response;g(b)}else throw new Error(P.statusText+" : "+P.responseURL)},P.send(null)}function l(v){console.error("package error:",v)}var p=null,h=i.getPreloadedPackage?i.getPreloadedPackage(s,o):null;h||d(s,o,function(v){p?(p(v),p=null):h=v},l);function w(){function v(y,b){if(!y)throw b+new Error().stack}i.FS_createPath("/","espeak-ng-data",!0,!0),i.FS_createPath("/espeak-ng-data","lang",!0,!0),i.FS_createPath("/espeak-ng-data/lang","aav",!0,!0),i.FS_createPath("/espeak-ng-data/lang","art",!0,!0),i.FS_createPath("/espeak-ng-data/lang","azc",!0,!0),i.FS_createPath("/espeak-ng-data/lang","bat",!0,!0),i.FS_createPath("/espeak-ng-data/lang","bnt",!0,!0),i.FS_createPath("/espeak-ng-data/lang","ccs",!0,!0),i.FS_createPath("/espeak-ng-data/lang","cel",!0,!0),i.FS_createPath("/espeak-ng-data/lang","cus",!0,!0),i.FS_createPath("/espeak-ng-data/lang","dra",!0,!0),i.FS_createPath("/espeak-ng-data/lang","esx",!0,!0),i.FS_createPath("/espeak-ng-data/lang","gmq",!0,!0),i.FS_createPath("/espeak-ng-data/lang","gmw",!0,!0),i.FS_createPath("/espeak-ng-data/lang","grk",!0,!0),i.FS_createPath("/espeak-ng-data/lang","inc",!0,!0),i.FS_createPath("/espeak-ng-data/lang","ine",!0,!0),i.FS_createPath("/espeak-ng-data/lang","ira",!0,!0),i.FS_createPath("/espeak-ng-data/lang","iro",!0,!0),i.FS_createPath("/espeak-ng-data/lang","itc",!0,!0),i.FS_createPath("/espeak-ng-data/lang","jpx",!0,!0),i.FS_createPath("/espeak-ng-data/lang","map",!0,!0),i.FS_createPath("/espeak-ng-data/lang","miz",!0,!0),i.FS_createPath("/espeak-ng-data/lang","myn",!0,!0),i.FS_createPath("/espeak-ng-data/lang","poz",!0,!0),i.FS_createPath("/espeak-ng-data/lang","roa",!0,!0),i.FS_createPath("/espeak-ng-data/lang","sai",!0,!0),i.FS_createPath("/espeak-ng-data/lang","sem",!0,!0),i.FS_createPath("/espeak-ng-data/lang","sit",!0,!0),i.FS_createPath("/espeak-ng-data/lang","tai",!0,!0),i.FS_createPath("/espeak-ng-data/lang","trk",!0,!0),i.FS_createPath("/espeak-ng-data/lang","urj",!0,!0),i.FS_createPath("/espeak-ng-data/lang","zle",!0,!0),i.FS_createPath("/espeak-ng-data/lang","zls",!0,!0),i.FS_createPath("/espeak-ng-data/lang","zlw",!0,!0),i.FS_createPath("/espeak-ng-data","mbrola_ph",!0,!0),i.FS_createPath("/espeak-ng-data","voices",!0,!0),i.FS_createPath("/espeak-ng-data/voices","!v",!0,!0),i.FS_createPath("/espeak-ng-data/voices","mb",!0,!0);function f(y,b,m){this.start=y,this.end=b,this.audio=m}f.prototype={requests:{},open:function(y,b){this.name=b,this.requests[b]=this,i.addRunDependency(`fp ${this.name}`)},send:function(){},onload:function(){var y=this.byteArray.subarray(this.start,this.end);this.finish(y)},finish:function(y){var b=this;i.FS_createDataFile(this.name,null,y,!0,!0,!0),i.removeRunDependency(`fp ${b.name}`),this.requests[this.name]=null}};for(var g=a.files,E=0;E{throw a},Me=typeof window=="object",B=typeof importScripts=="function",te=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",j="";function Ze(e){return i.locateFile?i.locateFile(e,j):j+e}var Y,G,ne;if(te){var ue=require("fs"),he=require("path");B?j=he.dirname(j)+"/":j=__dirname+"/",Y=(e,a)=>(e=oe(e)?new URL(e):he.normalize(e),ue.readFileSync(e,a?void 0:"utf8")),ne=e=>{var a=Y(e,!0);return a.buffer||(a=new Uint8Array(a)),a},G=(e,a,t,r=!0)=>{e=oe(e)?new URL(e):he.normalize(e),ue.readFile(e,r?void 0:"utf8",(s,o)=>{s?t(s):a(r?o.buffer:o)})},!i.thisProgram&&process.argv.length>1&&(ee=process.argv[1].replace(/\\/g,"/")),ge=process.argv.slice(2),ae=(e,a)=>{throw process.exitCode=e,a},i.inspect=()=>"[Emscripten Module object]"}else(Me||B)&&(B?j=self.location.href:typeof document<"u"&&document.currentScript&&(j=document.currentScript.src),Z&&(j=Z),j.indexOf("blob:")!==0?j=j.substr(0,j.replace(/[?#].*/,"").lastIndexOf("/")+1):j="",Y=e=>{var a=new XMLHttpRequest;return a.open("GET",e,!1),a.send(null),a.responseText},B&&(ne=e=>{var a=new XMLHttpRequest;return a.open("GET",e,!1),a.responseType="arraybuffer",a.send(null),new Uint8Array(a.response)}),G=(e,a,t)=>{var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=()=>{if(r.status==200||r.status==0&&r.response){a(r.response);return}t()},r.onerror=t,r.send(null)});var ke=i.print||console.log.bind(console),L=i.printErr||console.error.bind(console);Object.assign(i,De),De=null,i.arguments&&(ge=i.arguments),i.thisProgram&&(ee=i.thisProgram),i.quit&&(ae=i.quit);var W;i.wasmBinary&&(W=i.wasmBinary),typeof WebAssembly!="object"&&C("no native wasm support detected");var ze,ve=!1,re;function Qe(e,a){e||C(a)}var x,H,X,k,M;function ea(){var e=ze.buffer;i.HEAP8=x=new Int8Array(e),i.HEAP16=X=new Int16Array(e),i.HEAPU8=H=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAP32=k=new Int32Array(e),i.HEAPU32=M=new Uint32Array(e),i.HEAPF32=new Float32Array(e),i.HEAPF64=new Float64Array(e)}var Ae=[],Re=[],aa=[],xe=[];function ta(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)oa(i.preRun.shift());ie(Ae)}function na(){!i.noFSInit&&!n.init.initialized&&n.init(),n.ignorePermissions=!1,ie(Re)}function ra(){ie(aa)}function sa(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)da(i.postRun.shift());ie(xe)}function oa(e){Ae.unshift(e)}function ia(e){Re.unshift(e)}function da(e){xe.unshift(e)}var O=0,V=null;function se(e){O++,i.monitorRunDependencies&&i.monitorRunDependencies(O)}function K(e){if(O--,i.monitorRunDependencies&&i.monitorRunDependencies(O),O==0&&V){var a=V;V=null,a()}}function C(e){i.onAbort&&i.onAbort(e),e="Aborted("+e+")",L(e),ve=!0,re=1,e+=". Build with -sASSERTIONS for more info.";var a=new WebAssembly.RuntimeError(e);throw Q(a),a}var la="data:application/octet-stream;base64,",je=e=>e.startsWith(la),oe=e=>e.startsWith("file://"),U;U="piper_phonemize.wasm",je(U)||(U=Ze(U));function Le(e){if(e==U&&W)return new Uint8Array(W);if(ne)return ne(e);throw"both async and sync fetching of the wasm failed"}function ma(e){if(!W&&(Me||B)){if(typeof fetch=="function"&&!oe(e))return fetch(e,{credentials:"same-origin"}).then(a=>{if(!a.ok)throw"failed to load wasm binary file at '"+e+"'";return a.arrayBuffer()}).catch(()=>Le(e));if(G)return new Promise((a,t)=>{G(e,r=>a(new Uint8Array(r)),t)})}return Promise.resolve().then(()=>Le(e))}function Ce(e,a,t){return ma(e).then(r=>WebAssembly.instantiate(r,a)).then(r=>r).then(t,r=>{L(`failed to asynchronously prepare wasm: ${r}`),C(r)})}function pa(e,a,t,r){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!je(a)&&!oe(a)&&!te&&typeof fetch=="function"?fetch(a,{credentials:"same-origin"}).then(s=>{var o=WebAssembly.instantiateStreaming(s,t);return o.then(r,function(d){return L(`wasm streaming compile failed: ${d}`),L("falling back to ArrayBuffer instantiation"),Ce(a,t,r)})}):Ce(a,t,r)}function fa(){var e={a:dt};function a(r,s){return T=r.exports,ze=T.w,ea(),ia(T.x),K(),T}se();function t(r){a(r.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(e,a)}catch(r){L(`Module.instantiateWasm callback failed with error: ${r}`),Q(r)}return pa(W,U,e,t).catch(Q),{}}var u,z;function Ne(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ie=e=>{for(;e.length>0;)e.shift()(i)},ca=i.noExitRuntime||!0,Te=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,I=(e,a,t)=>{for(var r=a+t,s=a;e[s]&&!(s>=r);)++s;if(s-a>16&&e.buffer&&Te)return Te.decode(e.subarray(a,s));for(var o="";a>10,56320|h&1023)}}return o},$=(e,a)=>e?I(H,e,a):"",ga=(e,a,t,r)=>{C(`Assertion failed: ${$(e)}, at: `+[a?$(a):"unknown filename",t,r?$(r):"unknown function"])};function ua(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(a){M[this.ptr+4>>2]=a},this.get_type=function(){return M[this.ptr+4>>2]},this.set_destructor=function(a){M[this.ptr+8>>2]=a},this.get_destructor=function(){return M[this.ptr+8>>2]},this.set_caught=function(a){a=a?1:0,x[this.ptr+12>>0]=a},this.get_caught=function(){return x[this.ptr+12>>0]!=0},this.set_rethrown=function(a){a=a?1:0,x[this.ptr+13>>0]=a},this.get_rethrown=function(){return x[this.ptr+13>>0]!=0},this.init=function(a,t){this.set_adjusted_ptr(0),this.set_type(a),this.set_destructor(t)},this.set_adjusted_ptr=function(a){M[this.ptr+16>>2]=a},this.get_adjusted_ptr=function(){return M[this.ptr+16>>2]},this.get_exception_ptr=function(){var a=Xe(this.get_type());if(a)return M[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}var Oe=0,ha=(e,a,t)=>{var r=new ua(e);throw r.init(a,t),Oe=e,Oe},ka=e=>(k[We()>>2]=e,e),S={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var a=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return a.exec(e).slice(1)},normalizeArray:(e,a)=>{for(var t=0,r=e.length-1;r>=0;r--){var s=e[r];s==="."?e.splice(r,1):s===".."?(e.splice(r,1),t++):t&&(e.splice(r,1),t--)}if(a)for(;t;t--)e.unshift("..");return e},normalize:e=>{var a=S.isAbs(e),t=e.substr(-1)==="/";return e=S.normalizeArray(e.split("/").filter(r=>!!r),!a).join("/"),!e&&!a&&(e="."),e&&t&&(e+="/"),(a?"/":"")+e},dirname:e=>{var a=S.splitPath(e),t=a[0],r=a[1];return!t&&!r?".":(r&&(r=r.substr(0,r.length-1)),t+r)},basename:e=>{if(e==="/")return"/";e=S.normalize(e),e=e.replace(/\/$/,"");var a=e.lastIndexOf("/");return a===-1?e:e.substr(a+1)},join:function(){var e=Array.prototype.slice.call(arguments);return S.normalize(e.join("/"))},join2:(e,a)=>S.normalize(e+"/"+a)},va=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return r=>crypto.getRandomValues(r);if(te)try{var e=require("crypto"),a=e.randomFillSync;if(a)return r=>e.randomFillSync(r);var t=e.randomBytes;return r=>(r.set(t(r.byteLength)),r)}catch{}C("initRandomDevice")},qe=e=>(qe=va())(e),N={resolve:function(){for(var e="",a=!1,t=arguments.length-1;t>=-1&&!a;t--){var r=t>=0?arguments[t]:n.cwd();if(typeof r!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e,a=S.isAbs(r)}return e=S.normalizeArray(e.split("/").filter(s=>!!s),!a).join("/"),(a?"/":"")+e||"."},relative:(e,a)=>{e=N.resolve(e).substr(1),a=N.resolve(a).substr(1);function t(h){for(var w=0;w=0&&h[v]==="";v--);return w>v?[]:h.slice(w,v-w+1)}for(var r=t(e.split("/")),s=t(a.split("/")),o=Math.min(r.length,s.length),d=o,l=0;l{for(var a=0,t=0;t=55296&&r<=57343?(a+=4,++t):a+=3}return a},be=(e,a,t,r)=>{if(!(r>0))return 0;for(var s=t,o=t+r-1,d=0;d=55296&&l<=57343){var p=e.charCodeAt(++d);l=65536+((l&1023)<<10)|p&1023}if(l<=127){if(t>=o)break;a[t++]=l}else if(l<=2047){if(t+1>=o)break;a[t++]=192|l>>6,a[t++]=128|l&63}else if(l<=65535){if(t+2>=o)break;a[t++]=224|l>>12,a[t++]=128|l>>6&63,a[t++]=128|l&63}else{if(t+3>=o)break;a[t++]=240|l>>18,a[t++]=128|l>>12&63,a[t++]=128|l>>6&63,a[t++]=128|l&63}}return a[t]=0,t-s};function de(e,a,t){var r=we(e)+1,s=new Array(r),o=be(e,s,0,s.length);return a&&(s.length=o),s}var _a=()=>{if(!_e.length){var e=null;if(te){var a=256,t=Buffer.alloc(a),r=0,s=process.stdin.fd;try{r=ue.readSync(s,t)}catch(o){if(o.toString().includes("EOF"))r=0;else throw o}r>0?e=t.slice(0,r).toString("utf-8"):e=null}else typeof window<"u"&&typeof window.prompt=="function"?(e=window.prompt("Input: "),e!==null&&(e+=` `)):typeof readline=="function"&&(e=readline(),e!==null&&(e+=` `));if(!e)return null;_e=de(e,!0)}return _e.shift()},q={ttys:[],init(){},shutdown(){},register(e,a){q.ttys[e]={input:[],output:[],ops:a},n.registerDevice(e,q.stream_ops)},stream_ops:{open(e){var a=q.ttys[e.node.rdev];if(!a)throw new n.ErrnoError(43);e.tty=a,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,a,t,r,s){if(!e.tty||!e.tty.ops.get_char)throw new n.ErrnoError(60);for(var o=0,d=0;d0&&(ke(I(e.output,0)),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,a,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,a){a===null||a===10?(L(I(e.output,0)),e.output=[]):a!=0&&e.output.push(a)},fsync(e){e.output&&e.output.length>0&&(L(I(e.output,0)),e.output=[])}}},Be=e=>{C()},_={ops_table:null,mount(e){return _.createNode(null,"/",16895,0)},createNode(e,a,t,r){if(n.isBlkdev(t)||n.isFIFO(t))throw new n.ErrnoError(63);_.ops_table||(_.ops_table={dir:{node:{getattr:_.node_ops.getattr,setattr:_.node_ops.setattr,lookup:_.node_ops.lookup,mknod:_.node_ops.mknod,rename:_.node_ops.rename,unlink:_.node_ops.unlink,rmdir:_.node_ops.rmdir,readdir:_.node_ops.readdir,symlink:_.node_ops.symlink},stream:{llseek:_.stream_ops.llseek}},file:{node:{getattr:_.node_ops.getattr,setattr:_.node_ops.setattr},stream:{llseek:_.stream_ops.llseek,read:_.stream_ops.read,write:_.stream_ops.write,allocate:_.stream_ops.allocate,mmap:_.stream_ops.mmap,msync:_.stream_ops.msync}},link:{node:{getattr:_.node_ops.getattr,setattr:_.node_ops.setattr,readlink:_.node_ops.readlink},stream:{}},chrdev:{node:{getattr:_.node_ops.getattr,setattr:_.node_ops.setattr},stream:n.chrdev_stream_ops}});var s=n.createNode(e,a,t,r);return n.isDir(s.mode)?(s.node_ops=_.ops_table.dir.node,s.stream_ops=_.ops_table.dir.stream,s.contents={}):n.isFile(s.mode)?(s.node_ops=_.ops_table.file.node,s.stream_ops=_.ops_table.file.stream,s.usedBytes=0,s.contents=null):n.isLink(s.mode)?(s.node_ops=_.ops_table.link.node,s.stream_ops=_.ops_table.link.stream):n.isChrdev(s.mode)&&(s.node_ops=_.ops_table.chrdev.node,s.stream_ops=_.ops_table.chrdev.stream),s.timestamp=Date.now(),e&&(e.contents[a]=s,e.timestamp=s.timestamp),s},getFileDataAsTypedArray(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage(e,a){var t=e.contents?e.contents.length:0;if(!(t>=a)){var r=1048576;a=Math.max(a,t*(t>>0),t!=0&&(a=Math.max(a,256));var s=e.contents;e.contents=new Uint8Array(a),e.usedBytes>0&&e.contents.set(s.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,a){if(e.usedBytes!=a)if(a==0)e.contents=null,e.usedBytes=0;else{var t=e.contents;e.contents=new Uint8Array(a),t&&e.contents.set(t.subarray(0,Math.min(a,e.usedBytes))),e.usedBytes=a}},node_ops:{getattr(e){var a={};return a.dev=n.isChrdev(e.mode)?e.id:1,a.ino=e.id,a.mode=e.mode,a.nlink=1,a.uid=0,a.gid=0,a.rdev=e.rdev,n.isDir(e.mode)?a.size=4096:n.isFile(e.mode)?a.size=e.usedBytes:n.isLink(e.mode)?a.size=e.link.length:a.size=0,a.atime=new Date(e.timestamp),a.mtime=new Date(e.timestamp),a.ctime=new Date(e.timestamp),a.blksize=4096,a.blocks=Math.ceil(a.size/a.blksize),a},setattr(e,a){a.mode!==void 0&&(e.mode=a.mode),a.timestamp!==void 0&&(e.timestamp=a.timestamp),a.size!==void 0&&_.resizeFileStorage(e,a.size)},lookup(e,a){throw n.genericErrors[44]},mknod(e,a,t,r){return _.createNode(e,a,t,r)},rename(e,a,t){if(n.isDir(e.mode)){var r;try{r=n.lookupNode(a,t)}catch{}if(r)for(var s in r.contents)throw new n.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=t,a.contents[t]=e,a.timestamp=e.parent.timestamp,e.parent=a},unlink(e,a){delete e.contents[a],e.timestamp=Date.now()},rmdir(e,a){var t=n.lookupNode(e,a);for(var r in t.contents)throw new n.ErrnoError(55);delete e.contents[a],e.timestamp=Date.now()},readdir(e){var a=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&a.push(t);return a},symlink(e,a,t){var r=_.createNode(e,a,41471,0);return r.link=t,r},readlink(e){if(!n.isLink(e.mode))throw new n.ErrnoError(28);return e.link}},stream_ops:{read(e,a,t,r,s){var o=e.node.contents;if(s>=e.node.usedBytes)return 0;var d=Math.min(e.node.usedBytes-s,r);if(d>8&&o.subarray)a.set(o.subarray(s,s+d),t);else for(var l=0;l0||t+a{var s=`al ${e}`;G(e,o=>{Qe(o,`Loading data file "${e}" failed (no arrayBuffer).`),a(new Uint8Array(o)),s&&K()},o=>{if(t)t();else throw`Loading data file "${e}" failed.`}),s&&se()},ba=(e,a,t,r,s,o)=>n.createDataFile(e,a,t,r,s,o),ya=i.preloadPlugins||[],Ea=(e,a,t,r)=>{typeof Browser<"u"&&Browser.init();var s=!1;return ya.forEach(o=>{s||o.canHandle(a)&&(o.handle(e,a,t,r),s=!0)}),s},Fa=(e,a,t,r,s,o,d,l,p,h)=>{var w=a?N.resolve(S.join2(e,a)):e;function v(f){function g(E){h&&h(),l||ba(e,a,E,r,s,p),o&&o(),K()}Ea(f,w,g,()=>{d&&d(),K()})||g(f)}se(),typeof t=="string"?wa(t,f=>v(f),d):v(t)},Sa=e=>{var a={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=a[e];if(typeof t>"u")throw new Error(`Unknown file open mode: ${e}`);return t},ye=(e,a)=>{var t=0;return e&&(t|=365),a&&(t|=146),t},n={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,a={}){if(e=N.resolve(e),!e)return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if(a=Object.assign(t,a),a.recurse_count>8)throw new n.ErrnoError(32);for(var r=e.split("/").filter(v=>!!v),s=n.root,o="/",d=0;d40)throw new n.ErrnoError(32)}}return{path:o,node:s}},getPath(e){for(var a;;){if(n.isRoot(e)){var t=e.mount.mountpoint;return a?t[t.length-1]!=="/"?`${t}/${a}`:t+a:t}a=a?`${e.name}/${a}`:e.name,e=e.parent}},hashName(e,a){for(var t=0,r=0;r>>0)%n.nameTable.length},hashAddNode(e){var a=n.hashName(e.parent.id,e.name);e.name_next=n.nameTable[a],n.nameTable[a]=e},hashRemoveNode(e){var a=n.hashName(e.parent.id,e.name);if(n.nameTable[a]===e)n.nameTable[a]=e.name_next;else for(var t=n.nameTable[a];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,a){var t=n.mayLookup(e);if(t)throw new n.ErrnoError(t,e);for(var r=n.hashName(e.id,a),s=n.nameTable[r];s;s=s.name_next){var o=s.name;if(s.parent.id===e.id&&o===a)return s}return n.lookup(e,a)},createNode(e,a,t,r){var s=new n.FSNode(e,a,t,r);return n.hashAddNode(s),s},destroyNode(e){n.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 a=["r","w","rw"][e&3];return e&512&&(a+="w"),a},nodePermissions(e,a){return n.ignorePermissions?0:a.includes("r")&&!(e.mode&292)||a.includes("w")&&!(e.mode&146)||a.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){var a=n.nodePermissions(e,"x");return a||(e.node_ops.lookup?0:2)},mayCreate(e,a){try{var t=n.lookupNode(e,a);return 20}catch{}return n.nodePermissions(e,"wx")},mayDelete(e,a,t){var r;try{r=n.lookupNode(e,a)}catch(o){return o.errno}var s=n.nodePermissions(e,"wx");if(s)return s;if(t){if(!n.isDir(r.mode))return 54;if(n.isRoot(r)||n.getPath(r)===n.cwd())return 10}else if(n.isDir(r.mode))return 31;return 0},mayOpen(e,a){return e?n.isLink(e.mode)?32:n.isDir(e.mode)&&(n.flagsToPermissionString(a)!=="r"||a&512)?31:n.nodePermissions(e,n.flagsToPermissionString(a)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=n.MAX_OPEN_FDS;e++)if(!n.streams[e])return e;throw new n.ErrnoError(33)},getStreamChecked(e){var a=n.getStream(e);if(!a)throw new n.ErrnoError(8);return a},getStream:e=>n.streams[e],createStream(e,a=-1){return n.FSStream||(n.FSStream=function(){this.shared={}},n.FSStream.prototype={},Object.defineProperties(n.FSStream.prototype,{object:{get(){return this.node},set(t){this.node=t}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}},flags:{get(){return this.shared.flags},set(t){this.shared.flags=t}},position:{get(){return this.shared.position},set(t){this.shared.position=t}}})),e=Object.assign(new n.FSStream,e),a==-1&&(a=n.nextfd()),e.fd=a,n.streams[a]=e,e},closeStream(e){n.streams[e]=null},chrdev_stream_ops:{open(e){var a=n.getDevice(e.node.rdev);e.stream_ops=a.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new n.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,a)=>e<<8|a,registerDevice(e,a){n.devices[e]={stream_ops:a}},getDevice:e=>n.devices[e],getMounts(e){for(var a=[],t=[e];t.length;){var r=t.pop();a.push(r),t.push.apply(t,r.mounts)}return a},syncfs(e,a){typeof e=="function"&&(a=e,e=!1),n.syncFSRequests++,n.syncFSRequests>1&&L(`warning: ${n.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=n.getMounts(n.root.mount),r=0;function s(d){return n.syncFSRequests--,a(d)}function o(d){if(d)return o.errored?void 0:(o.errored=!0,s(d));++r>=t.length&&s(null)}t.forEach(d=>{if(!d.type.syncfs)return o(null);d.type.syncfs(d,e,o)})},mount(e,a,t){var r=t==="/",s=!t,o;if(r&&n.root)throw new n.ErrnoError(10);if(!r&&!s){var d=n.lookupPath(t,{follow_mount:!1});if(t=d.path,o=d.node,n.isMountpoint(o))throw new n.ErrnoError(10);if(!n.isDir(o.mode))throw new n.ErrnoError(54)}var l={type:e,opts:a,mountpoint:t,mounts:[]},p=e.mount(l);return p.mount=l,l.root=p,r?n.root=p:o&&(o.mounted=l,o.mount&&o.mount.mounts.push(l)),p},unmount(e){var a=n.lookupPath(e,{follow_mount:!1});if(!n.isMountpoint(a.node))throw new n.ErrnoError(28);var t=a.node,r=t.mounted,s=n.getMounts(r);Object.keys(n.nameTable).forEach(d=>{for(var l=n.nameTable[d];l;){var p=l.name_next;s.includes(l.mount)&&n.destroyNode(l),l=p}}),t.mounted=null;var o=t.mount.mounts.indexOf(r);t.mount.mounts.splice(o,1)},lookup(e,a){return e.node_ops.lookup(e,a)},mknod(e,a,t){var r=n.lookupPath(e,{parent:!0}),s=r.node,o=S.basename(e);if(!o||o==="."||o==="..")throw new n.ErrnoError(28);var d=n.mayCreate(s,o);if(d)throw new n.ErrnoError(d);if(!s.node_ops.mknod)throw new n.ErrnoError(63);return s.node_ops.mknod(s,o,a,t)},create(e,a){return a=a!==void 0?a:438,a&=4095,a|=32768,n.mknod(e,a,0)},mkdir(e,a){return a=a!==void 0?a:511,a&=1023,a|=16384,n.mknod(e,a,0)},mkdirTree(e,a){for(var t=e.split("/"),r="",s=0;s"u"&&(t=a,a=438),a|=8192,n.mknod(e,a,t)},symlink(e,a){if(!N.resolve(e))throw new n.ErrnoError(44);var t=n.lookupPath(a,{parent:!0}),r=t.node;if(!r)throw new n.ErrnoError(44);var s=S.basename(a),o=n.mayCreate(r,s);if(o)throw new n.ErrnoError(o);if(!r.node_ops.symlink)throw new n.ErrnoError(63);return r.node_ops.symlink(r,s,e)},rename(e,a){var t=S.dirname(e),r=S.dirname(a),s=S.basename(e),o=S.basename(a),d,l,p;if(d=n.lookupPath(e,{parent:!0}),l=d.node,d=n.lookupPath(a,{parent:!0}),p=d.node,!l||!p)throw new n.ErrnoError(44);if(l.mount!==p.mount)throw new n.ErrnoError(75);var h=n.lookupNode(l,s),w=N.relative(e,r);if(w.charAt(0)!==".")throw new n.ErrnoError(28);if(w=N.relative(a,t),w.charAt(0)!==".")throw new n.ErrnoError(55);var v;try{v=n.lookupNode(p,o)}catch{}if(h!==v){var f=n.isDir(h.mode),g=n.mayDelete(l,s,f);if(g)throw new n.ErrnoError(g);if(g=v?n.mayDelete(p,o,f):n.mayCreate(p,o),g)throw new n.ErrnoError(g);if(!l.node_ops.rename)throw new n.ErrnoError(63);if(n.isMountpoint(h)||v&&n.isMountpoint(v))throw new n.ErrnoError(10);if(p!==l&&(g=n.nodePermissions(l,"w"),g))throw new n.ErrnoError(g);n.hashRemoveNode(h);try{l.node_ops.rename(h,p,o)}catch(E){throw E}finally{n.hashAddNode(h)}}},rmdir(e){var a=n.lookupPath(e,{parent:!0}),t=a.node,r=S.basename(e),s=n.lookupNode(t,r),o=n.mayDelete(t,r,!0);if(o)throw new n.ErrnoError(o);if(!t.node_ops.rmdir)throw new n.ErrnoError(63);if(n.isMountpoint(s))throw new n.ErrnoError(10);t.node_ops.rmdir(t,r),n.destroyNode(s)},readdir(e){var a=n.lookupPath(e,{follow:!0}),t=a.node;if(!t.node_ops.readdir)throw new n.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var a=n.lookupPath(e,{parent:!0}),t=a.node;if(!t)throw new n.ErrnoError(44);var r=S.basename(e),s=n.lookupNode(t,r),o=n.mayDelete(t,r,!1);if(o)throw new n.ErrnoError(o);if(!t.node_ops.unlink)throw new n.ErrnoError(63);if(n.isMountpoint(s))throw new n.ErrnoError(10);t.node_ops.unlink(t,r),n.destroyNode(s)},readlink(e){var a=n.lookupPath(e),t=a.node;if(!t)throw new n.ErrnoError(44);if(!t.node_ops.readlink)throw new n.ErrnoError(28);return N.resolve(n.getPath(t.parent),t.node_ops.readlink(t))},stat(e,a){var t=n.lookupPath(e,{follow:!a}),r=t.node;if(!r)throw new n.ErrnoError(44);if(!r.node_ops.getattr)throw new n.ErrnoError(63);return r.node_ops.getattr(r)},lstat(e){return n.stat(e,!0)},chmod(e,a,t){var r;if(typeof e=="string"){var s=n.lookupPath(e,{follow:!t});r=s.node}else r=e;if(!r.node_ops.setattr)throw new n.ErrnoError(63);r.node_ops.setattr(r,{mode:a&4095|r.mode&-4096,timestamp:Date.now()})},lchmod(e,a){n.chmod(e,a,!0)},fchmod(e,a){var t=n.getStreamChecked(e);n.chmod(t.node,a)},chown(e,a,t,r){var s;if(typeof e=="string"){var o=n.lookupPath(e,{follow:!r});s=o.node}else s=e;if(!s.node_ops.setattr)throw new n.ErrnoError(63);s.node_ops.setattr(s,{timestamp:Date.now()})},lchown(e,a,t){n.chown(e,a,t,!0)},fchown(e,a,t){var r=n.getStreamChecked(e);n.chown(r.node,a,t)},truncate(e,a){if(a<0)throw new n.ErrnoError(28);var t;if(typeof e=="string"){var r=n.lookupPath(e,{follow:!0});t=r.node}else t=e;if(!t.node_ops.setattr)throw new n.ErrnoError(63);if(n.isDir(t.mode))throw new n.ErrnoError(31);if(!n.isFile(t.mode))throw new n.ErrnoError(28);var s=n.nodePermissions(t,"w");if(s)throw new n.ErrnoError(s);t.node_ops.setattr(t,{size:a,timestamp:Date.now()})},ftruncate(e,a){var t=n.getStreamChecked(e);if(!(t.flags&2097155))throw new n.ErrnoError(28);n.truncate(t.node,a)},utime(e,a,t){var r=n.lookupPath(e,{follow:!0}),s=r.node;s.node_ops.setattr(s,{timestamp:Math.max(a,t)})},open(e,a,t){if(e==="")throw new n.ErrnoError(44);a=typeof a=="string"?Sa(a):a,t=typeof t>"u"?438:t,a&64?t=t&4095|32768:t=0;var r;if(typeof e=="object")r=e;else{e=S.normalize(e);try{var s=n.lookupPath(e,{follow:!(a&131072)});r=s.node}catch{}}var o=!1;if(a&64)if(r){if(a&128)throw new n.ErrnoError(20)}else r=n.mknod(e,t,0),o=!0;if(!r)throw new n.ErrnoError(44);if(n.isChrdev(r.mode)&&(a&=-513),a&65536&&!n.isDir(r.mode))throw new n.ErrnoError(54);if(!o){var d=n.mayOpen(r,a);if(d)throw new n.ErrnoError(d)}a&512&&!o&&n.truncate(r,0),a&=-131713;var l=n.createStream({node:r,path:n.getPath(r),flags:a,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return l.stream_ops.open&&l.stream_ops.open(l),i.logReadFiles&&!(a&1)&&(n.readFiles||(n.readFiles={}),e in n.readFiles||(n.readFiles[e]=1)),l},close(e){if(n.isClosed(e))throw new n.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(a){throw a}finally{n.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,a,t){if(n.isClosed(e))throw new n.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new n.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new n.ErrnoError(28);return e.position=e.stream_ops.llseek(e,a,t),e.ungotten=[],e.position},read(e,a,t,r,s){if(r<0||s<0)throw new n.ErrnoError(28);if(n.isClosed(e))throw new n.ErrnoError(8);if((e.flags&2097155)===1)throw new n.ErrnoError(8);if(n.isDir(e.node.mode))throw new n.ErrnoError(31);if(!e.stream_ops.read)throw new n.ErrnoError(28);var o=typeof s<"u";if(!o)s=e.position;else if(!e.seekable)throw new n.ErrnoError(70);var d=e.stream_ops.read(e,a,t,r,s);return o||(e.position+=d),d},write(e,a,t,r,s,o){if(r<0||s<0)throw new n.ErrnoError(28);if(n.isClosed(e))throw new n.ErrnoError(8);if(!(e.flags&2097155))throw new n.ErrnoError(8);if(n.isDir(e.node.mode))throw new n.ErrnoError(31);if(!e.stream_ops.write)throw new n.ErrnoError(28);e.seekable&&e.flags&1024&&n.llseek(e,0,2);var d=typeof s<"u";if(!d)s=e.position;else if(!e.seekable)throw new n.ErrnoError(70);var l=e.stream_ops.write(e,a,t,r,s,o);return d||(e.position+=l),l},allocate(e,a,t){if(n.isClosed(e))throw new n.ErrnoError(8);if(a<0||t<=0)throw new n.ErrnoError(28);if(!(e.flags&2097155))throw new n.ErrnoError(8);if(!n.isFile(e.node.mode)&&!n.isDir(e.node.mode))throw new n.ErrnoError(43);if(!e.stream_ops.allocate)throw new n.ErrnoError(138);e.stream_ops.allocate(e,a,t)},mmap(e,a,t,r,s){if(r&2&&!(s&2)&&(e.flags&2097155)!==2)throw new n.ErrnoError(2);if((e.flags&2097155)===1)throw new n.ErrnoError(2);if(!e.stream_ops.mmap)throw new n.ErrnoError(43);return e.stream_ops.mmap(e,a,t,r,s)},msync(e,a,t,r,s){return e.stream_ops.msync?e.stream_ops.msync(e,a,t,r,s):0},munmap:e=>0,ioctl(e,a,t){if(!e.stream_ops.ioctl)throw new n.ErrnoError(59);return e.stream_ops.ioctl(e,a,t)},readFile(e,a={}){if(a.flags=a.flags||0,a.encoding=a.encoding||"binary",a.encoding!=="utf8"&&a.encoding!=="binary")throw new Error(`Invalid encoding type "${a.encoding}"`);var t,r=n.open(e,a.flags),s=n.stat(e),o=s.size,d=new Uint8Array(o);return n.read(r,d,0,o,0),a.encoding==="utf8"?t=I(d,0):a.encoding==="binary"&&(t=d),n.close(r),t},writeFile(e,a,t={}){t.flags=t.flags||577;var r=n.open(e,t.flags,t.mode);if(typeof a=="string"){var s=new Uint8Array(we(a)+1),o=be(a,s,0,s.length);n.write(r,s,0,o,void 0,t.canOwn)}else if(ArrayBuffer.isView(a))n.write(r,a,0,a.byteLength,void 0,t.canOwn);else throw new Error("Unsupported data type");n.close(r)},cwd:()=>n.currentPath,chdir(e){var a=n.lookupPath(e,{follow:!0});if(a.node===null)throw new n.ErrnoError(44);if(!n.isDir(a.node.mode))throw new n.ErrnoError(54);var t=n.nodePermissions(a.node,"x");if(t)throw new n.ErrnoError(t);n.currentPath=a.path},createDefaultDirectories(){n.mkdir("/tmp"),n.mkdir("/home"),n.mkdir("/home/web_user")},createDefaultDevices(){n.mkdir("/dev"),n.registerDevice(n.makedev(1,3),{read:()=>0,write:(r,s,o,d,l)=>d}),n.mkdev("/dev/null",n.makedev(1,3)),q.register(n.makedev(5,0),q.default_tty_ops),q.register(n.makedev(6,0),q.default_tty1_ops),n.mkdev("/dev/tty",n.makedev(5,0)),n.mkdev("/dev/tty1",n.makedev(6,0));var e=new Uint8Array(1024),a=0,t=()=>(a===0&&(a=qe(e).byteLength),e[--a]);n.createDevice("/dev","random",t),n.createDevice("/dev","urandom",t),n.mkdir("/dev/shm"),n.mkdir("/dev/shm/tmp")},createSpecialDirectories(){n.mkdir("/proc");var e=n.mkdir("/proc/self");n.mkdir("/proc/self/fd"),n.mount({mount(){var a=n.createNode(e,"fd",16895,73);return a.node_ops={lookup(t,r){var s=+r,o=n.getStreamChecked(s),d={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>o.path}};return d.parent=d,d}},a}},{},"/proc/self/fd")},createStandardStreams(){i.stdin?n.createDevice("/dev","stdin",i.stdin):n.symlink("/dev/tty","/dev/stdin"),i.stdout?n.createDevice("/dev","stdout",null,i.stdout):n.symlink("/dev/tty","/dev/stdout"),i.stderr?n.createDevice("/dev","stderr",null,i.stderr):n.symlink("/dev/tty1","/dev/stderr"),n.open("/dev/stdin",0),n.open("/dev/stdout",1),n.open("/dev/stderr",1)},ensureErrnoError(){n.ErrnoError||(n.ErrnoError=function(e,a){this.name="ErrnoError",this.node=a,this.setErrno=function(t){this.errno=t},this.setErrno(e),this.message="FS error"},n.ErrnoError.prototype=new Error,n.ErrnoError.prototype.constructor=n.ErrnoError,[44].forEach(e=>{n.genericErrors[e]=new n.ErrnoError(e),n.genericErrors[e].stack=""}))},staticInit(){n.ensureErrnoError(),n.nameTable=new Array(4096),n.mount(_,{},"/"),n.createDefaultDirectories(),n.createDefaultDevices(),n.createSpecialDirectories(),n.filesystems={MEMFS:_}},init(e,a,t){n.init.initialized=!0,n.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=a||i.stdout,i.stderr=t||i.stderr,n.createStandardStreams()},quit(){n.init.initialized=!1;for(var e=0;ethis.length-1||f<0)){var g=f%this.chunkSize,E=f/this.chunkSize|0;return this.getter(E)[g]}},o.prototype.setDataGetter=function(f){this.getter=f},o.prototype.cacheLength=function(){var f=new XMLHttpRequest;if(f.open("HEAD",t,!1),f.send(null),!(f.status>=200&&f.status<300||f.status===304))throw new Error("Couldn't load "+t+". Status: "+f.status);var g=Number(f.getResponseHeader("Content-length")),E,P=(E=f.getResponseHeader("Accept-Ranges"))&&E==="bytes",y=(E=f.getResponseHeader("Content-Encoding"))&&E==="gzip",b=1024*1024;P||(b=g);var m=(D,A)=>{if(D>A)throw new Error("invalid range ("+D+", "+A+") or no bytes requested!");if(A>g-1)throw new Error("only "+g+" bytes available! programmer error!");var R=new XMLHttpRequest;if(R.open("GET",t,!1),g!==b&&R.setRequestHeader("Range","bytes="+D+"-"+A),R.responseType="arraybuffer",R.overrideMimeType&&R.overrideMimeType("text/plain; charset=x-user-defined"),R.send(null),!(R.status>=200&&R.status<300||R.status===304))throw new Error("Couldn't load "+t+". Status: "+R.status);return R.response!==void 0?new Uint8Array(R.response||[]):de(R.responseText||"",!0)},c=this;c.setDataGetter(D=>{var A=D*b,R=(D+1)*b-1;if(R=Math.min(R,g-1),typeof c.chunks[D]>"u"&&(c.chunks[D]=m(A,R)),typeof c.chunks[D]>"u")throw new Error("doXHR failed!");return c.chunks[D]}),(y||!g)&&(b=g=1,g=this.getter(0).length,b=g,ke("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=g,this._chunkSize=b,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!B)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var d=new o;Object.defineProperties(d,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var l={isDevice:!1,contents:d}}else var l={isDevice:!1,url:t};var p=n.createFile(e,a,l,r,s);l.contents?p.contents=l.contents:l.url&&(p.contents=null,p.url=l.url),Object.defineProperties(p,{usedBytes:{get:function(){return this.contents.length}}});var h={},w=Object.keys(p.stream_ops);w.forEach(f=>{var g=p.stream_ops[f];h[f]=function(){return n.forceLoadFile(p),g.apply(null,arguments)}});function v(f,g,E,P,y){var b=f.node.contents;if(y>=b.length)return 0;var m=Math.min(b.length-y,P);if(b.slice)for(var c=0;c(n.forceLoadFile(p),v(f,g,E,P,y)),h.mmap=(f,g,E,P,y)=>{n.forceLoadFile(p);var b=Be();if(!b)throw new n.ErrnoError(48);return v(f,x,b,g,E),{ptr:b,allocated:!0}},p.stream_ops=h,p}},F={DEFAULT_POLLMASK:5,calculateAt(e,a,t){if(S.isAbs(a))return a;var r;if(e===-100)r=n.cwd();else{var s=F.getStreamFromFD(e);r=s.path}if(a.length==0){if(!t)throw new n.ErrnoError(44);return r}return S.join2(r,a)},doStat(e,a,t){try{var r=e(a)}catch(l){if(l&&l.node&&S.normalize(a)!==S.normalize(n.getPath(l.node)))return-54;throw l}k[t>>2]=r.dev,k[t+4>>2]=r.mode,M[t+8>>2]=r.nlink,k[t+12>>2]=r.uid,k[t+16>>2]=r.gid,k[t+20>>2]=r.rdev,z=[r.size>>>0,(u=r.size,+Math.abs(u)>=1?u>0?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-+(~~u>>>0))/4294967296)>>>0:0)],k[t+24>>2]=z[0],k[t+28>>2]=z[1],k[t+32>>2]=4096,k[t+36>>2]=r.blocks;var s=r.atime.getTime(),o=r.mtime.getTime(),d=r.ctime.getTime();return z=[Math.floor(s/1e3)>>>0,(u=Math.floor(s/1e3),+Math.abs(u)>=1?u>0?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-+(~~u>>>0))/4294967296)>>>0:0)],k[t+40>>2]=z[0],k[t+44>>2]=z[1],M[t+48>>2]=s%1e3*1e3,z=[Math.floor(o/1e3)>>>0,(u=Math.floor(o/1e3),+Math.abs(u)>=1?u>0?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-+(~~u>>>0))/4294967296)>>>0:0)],k[t+56>>2]=z[0],k[t+60>>2]=z[1],M[t+64>>2]=o%1e3*1e3,z=[Math.floor(d/1e3)>>>0,(u=Math.floor(d/1e3),+Math.abs(u)>=1?u>0?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-+(~~u>>>0))/4294967296)>>>0:0)],k[t+72>>2]=z[0],k[t+76>>2]=z[1],M[t+80>>2]=d%1e3*1e3,z=[r.ino>>>0,(u=r.ino,+Math.abs(u)>=1?u>0?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-+(~~u>>>0))/4294967296)>>>0:0)],k[t+88>>2]=z[0],k[t+92>>2]=z[1],0},doMsync(e,a,t,r,s){if(!n.isFile(a.node.mode))throw new n.ErrnoError(43);if(r&2)return 0;var o=H.slice(e,e+t);n.msync(a,o,s,t,r)},varargs:void 0,get(){var e=k[+F.varargs>>2];return F.varargs+=4,e},getp(){return F.get()},getStr(e){var a=$(e);return a},getStreamFromFD(e){var a=n.getStreamChecked(e);return a}};function Pa(e,a,t){F.varargs=t;try{var r=F.getStreamFromFD(e);switch(a){case 0:{var s=F.get();if(s<0)return-28;for(;n.streams[s];)s++;var o;return o=n.createStream(r,s),o.fd}case 1:case 2:return 0;case 3:return r.flags;case 4:{var s=F.get();return r.flags|=s,0}case 5:{var s=F.getp(),d=0;return X[s+d>>1]=2,0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:return ka(28),-1;default:return-28}}catch(l){if(typeof n>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}var He=(e,a,t)=>be(e,H,a,t);function Da(e,a,t){try{var r=F.getStreamFromFD(e);r.getdents||(r.getdents=n.readdir(r.path));for(var s=280,o=0,d=n.llseek(r,0,1),l=Math.floor(d/s);l>>0,(u=p,+Math.abs(u)>=1?u>0?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-+(~~u>>>0))/4294967296)>>>0:0)],k[a+o>>2]=z[0],k[a+o+4>>2]=z[1],z=[(l+1)*s>>>0,(u=(l+1)*s,+Math.abs(u)>=1?u>0?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-+(~~u>>>0))/4294967296)>>>0:0)],k[a+o+8>>2]=z[0],k[a+o+12>>2]=z[1],X[a+o+16>>1]=280,x[a+o+18>>0]=h,He(w,a+o+19,256),o+=s,l+=1}return n.llseek(r,l*s,0),o}catch(g){if(typeof n>"u"||g.name!=="ErrnoError")throw g;return-g.errno}}function Ma(e,a,t){F.varargs=t;try{var r=F.getStreamFromFD(e);switch(a){case 21509:return r.tty?0:-59;case 21505:{if(!r.tty)return-59;if(r.tty.ops.ioctl_tcgets){var s=r.tty.ops.ioctl_tcgets(r),o=F.getp();k[o>>2]=s.c_iflag||0,k[o+4>>2]=s.c_oflag||0,k[o+8>>2]=s.c_cflag||0,k[o+12>>2]=s.c_lflag||0;for(var d=0;d<32;d++)x[o+d+17>>0]=s.c_cc[d]||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 o=F.getp(),l=k[o>>2],p=k[o+4>>2],h=k[o+8>>2],w=k[o+12>>2],v=[],d=0;d<32;d++)v.push(x[o+d+17>>0]);return r.tty.ops.ioctl_tcsets(r.tty,a,{c_iflag:l,c_oflag:p,c_cflag:h,c_lflag:w,c_cc:v})}return 0}case 21519:{if(!r.tty)return-59;var o=F.getp();return k[o>>2]=0,0}case 21520:return r.tty?-28:-59;case 21531:{var o=F.getp();return n.ioctl(r,a,o)}case 21523:{if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var f=r.tty.ops.ioctl_tiocgwinsz(r.tty),o=F.getp();X[o>>1]=f[0],X[o+2>>1]=f[1]}return 0}case 21524:return r.tty?0:-59;case 21515:return r.tty?0:-59;default:return-28}}catch(g){if(typeof n>"u"||g.name!=="ErrnoError")throw g;return-g.errno}}function za(e,a,t,r){F.varargs=r;try{a=F.getStr(a),a=F.calculateAt(e,a);var s=r?F.get():0;return n.open(a,t,s).fd}catch(o){if(typeof n>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}function Aa(e){try{return e=F.getStr(e),n.rmdir(e),0}catch(a){if(typeof n>"u"||a.name!=="ErrnoError")throw a;return-a.errno}}function Ra(e,a){try{return e=F.getStr(e),F.doStat(n.stat,e,a)}catch(t){if(typeof n>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function xa(e,a,t){try{return a=F.getStr(a),a=F.calculateAt(e,a),t===0?n.unlink(a):t===512?n.rmdir(a):C("Invalid flags passed to unlinkat"),0}catch(r){if(typeof n>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}var ja=!0,La=()=>ja,Ca=()=>{C("")},Na=()=>Date.now(),Ta=(e,a,t)=>H.copyWithin(e,a,a+t),Oa=e=>{C("OOM")},qa=e=>{H.length,Oa()},Ee={},Ba=()=>ee||"./this.program",J=()=>{if(!J.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Ba()};for(var t in Ee)Ee[t]===void 0?delete a[t]:a[t]=Ee[t];var r=[];for(var t in a)r.push(`${t}=${a[t]}`);J.strings=r}return J.strings},Ha=(e,a)=>{for(var t=0;t>0]=e.charCodeAt(t);x[a>>0]=0},Ua=(e,a)=>{var t=0;return J().forEach((r,s)=>{var o=a+t;M[e+s*4>>2]=o,Ha(r,o),t+=r.length+1}),0},Ia=(e,a)=>{var t=J();M[e>>2]=t.length;var r=0;return t.forEach(s=>r+=s.length+1),M[a>>2]=r,0},$a=0,Ya=()=>ca||$a>0,Ga=e=>{re=e,Ya()||(i.onExit&&i.onExit(e),ve=!0),ae(e,new Ne(e))},Ue=(e,a)=>{re=e,Ga(e)},Wa=Ue;function Xa(e){try{var a=F.getStreamFromFD(e);return n.close(a),0}catch(t){if(typeof n>"u"||t.name!=="ErrnoError")throw t;return t.errno}}var Va=(e,a,t,r)=>{for(var s=0,o=0;o>2],l=M[a+4>>2];a+=8;var p=n.read(e,x,d,l,r);if(p<0)return-1;if(s+=p,p>2]=o,0}catch(d){if(typeof n>"u"||d.name!=="ErrnoError")throw d;return d.errno}}var Ja=(e,a)=>a+2097152>>>0<4194305-!!e?(e>>>0)+a*4294967296:NaN;function Za(e,a,t,r,s){var o=Ja(a,t);try{if(isNaN(o))return 61;var d=F.getStreamFromFD(e);return n.llseek(d,o,r),z=[d.position>>>0,(u=d.position,+Math.abs(u)>=1?u>0?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-+(~~u>>>0))/4294967296)>>>0:0)],k[s>>2]=z[0],k[s+4>>2]=z[1],d.getdents&&o===0&&r===0&&(d.getdents=null),0}catch(l){if(typeof n>"u"||l.name!=="ErrnoError")throw l;return l.errno}}var Qa=(e,a,t,r)=>{for(var s=0,o=0;o>2],l=M[a+4>>2];a+=8;var p=n.write(e,x,d,l,r);if(p<0)return-1;s+=p}return s};function et(e,a,t,r){try{var s=F.getStreamFromFD(e),o=Qa(s,a,t);return M[r>>2]=o,0}catch(d){if(typeof n>"u"||d.name!=="ErrnoError")throw d;return d.errno}}var le=e=>e%4===0&&(e%100!==0||e%400===0),at=(e,a)=>{for(var t=0,r=0;r<=a;t+=e[r++]);return t},Ie=[31,29,31,30,31,30,31,31,30,31,30,31],$e=[31,28,31,30,31,30,31,31,30,31,30,31],tt=(e,a)=>{for(var t=new Date(e.getTime());a>0;){var r=le(t.getFullYear()),s=t.getMonth(),o=(r?Ie:$e)[s];if(a>o-t.getDate())a-=o-t.getDate()+1,t.setDate(1),s<11?t.setMonth(s+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1));else return t.setDate(t.getDate()+a),t}return t},nt=(e,a)=>{x.set(e,a)},rt=(e,a,t,r)=>{var s=M[r+40>>2],o={tm_sec:k[r>>2],tm_min:k[r+4>>2],tm_hour:k[r+8>>2],tm_mday:k[r+12>>2],tm_mon:k[r+16>>2],tm_year:k[r+20>>2],tm_wday:k[r+24>>2],tm_yday:k[r+28>>2],tm_isdst:k[r+32>>2],tm_gmtoff:k[r+36>>2],tm_zone:s?$(s):""},d=$(t),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var p in l)d=d.replace(new RegExp(p,"g"),l[p]);var h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],w=["January","February","March","April","May","June","July","August","September","October","November","December"];function v(m,c,D){for(var A=typeof m=="number"?m.toString():m||"";A.length0?1:0}var A;return(A=D(m.getFullYear()-c.getFullYear()))===0&&(A=D(m.getMonth()-c.getMonth()))===0&&(A=D(m.getDate()-c.getDate())),A}function E(m){switch(m.getDay()){case 0:return new Date(m.getFullYear()-1,11,29);case 1:return m;case 2:return new Date(m.getFullYear(),0,3);case 3:return new Date(m.getFullYear(),0,2);case 4:return new Date(m.getFullYear(),0,1);case 5:return new Date(m.getFullYear()-1,11,31);case 6:return new Date(m.getFullYear()-1,11,30)}}function P(m){var c=tt(new Date(m.tm_year+1900,0,1),m.tm_yday),D=new Date(c.getFullYear(),0,4),A=new Date(c.getFullYear()+1,0,4),R=E(D),ce=E(A);return g(R,c)<=0?g(ce,c)<=0?c.getFullYear()+1:c.getFullYear():c.getFullYear()-1}var y={"%a":m=>h[m.tm_wday].substring(0,3),"%A":m=>h[m.tm_wday],"%b":m=>w[m.tm_mon].substring(0,3),"%B":m=>w[m.tm_mon],"%C":m=>{var c=m.tm_year+1900;return f(c/100|0,2)},"%d":m=>f(m.tm_mday,2),"%e":m=>v(m.tm_mday,2," "),"%g":m=>P(m).toString().substring(2),"%G":m=>P(m),"%H":m=>f(m.tm_hour,2),"%I":m=>{var c=m.tm_hour;return c==0?c=12:c>12&&(c-=12),f(c,2)},"%j":m=>f(m.tm_mday+at(le(m.tm_year+1900)?Ie:$e,m.tm_mon-1),3),"%m":m=>f(m.tm_mon+1,2),"%M":m=>f(m.tm_min,2),"%n":()=>` `,"%p":m=>m.tm_hour>=0&&m.tm_hour<12?"AM":"PM","%S":m=>f(m.tm_sec,2),"%t":()=>" ","%u":m=>m.tm_wday||7,"%U":m=>{var c=m.tm_yday+7-m.tm_wday;return f(Math.floor(c/7),2)},"%V":m=>{var c=Math.floor((m.tm_yday+7-(m.tm_wday+6)%7)/7);if((m.tm_wday+371-m.tm_yday-2)%7<=2&&c++,c){if(c==53){var D=(m.tm_wday+371-m.tm_yday)%7;D!=4&&(D!=3||!le(m.tm_year))&&(c=1)}}else{c=52;var A=(m.tm_wday+7-m.tm_yday-1)%7;(A==4||A==5&&le(m.tm_year%400-1))&&c++}return f(c,2)},"%w":m=>m.tm_wday,"%W":m=>{var c=m.tm_yday+7-(m.tm_wday+6)%7;return f(Math.floor(c/7),2)},"%y":m=>(m.tm_year+1900).toString().substring(2),"%Y":m=>m.tm_year+1900,"%z":m=>{var c=m.tm_gmtoff,D=c>=0;return c=Math.abs(c)/60,c=c/60*100+c%60,(D?"+":"-")+("0000"+c).slice(-4)},"%Z":m=>m.tm_zone,"%%":()=>"%"};d=d.replace(/%%/g,"\0\0");for(var p in y)d.includes(p)&&(d=d.replace(new RegExp(p,"g"),y[p](o)));d=d.replace(/\0\0/g,"%");var b=de(d,!1);return b.length>a?0:(nt(b,e),b.length-1)},st=(e,a,t,r,s)=>rt(e,a,t,r),ot=e=>{if(e instanceof Ne||e=="unwind")return re;ae(1,e)},it=e=>{var a=we(e)+1,t=Fe(a);return He(e,t,a),t},Ye=function(e,a,t,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=n.nextInode++,this.name=a,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=r},me=365,pe=146;Object.defineProperties(Ye.prototype,{read:{get:function(){return(this.mode&me)===me},set:function(e){e?this.mode|=me:this.mode&=~me}},write:{get:function(){return(this.mode&pe)===pe},set:function(e){e?this.mode|=pe:this.mode&=~pe}},isFolder:{get:function(){return n.isDir(this.mode)}},isDevice:{get:function(){return n.isChrdev(this.mode)}}}),n.FSNode=Ye,n.createPreloadedFile=Fa,n.staticInit(),i.FS_createPath=n.createPath,i.FS_createDataFile=n.createDataFile,i.FS_createPreloadedFile=n.createPreloadedFile,i.FS_unlink=n.unlink,i.FS_createLazyFile=n.createLazyFile,i.FS_createDevice=n.createDevice;var dt={a:ga,b:ha,e:Pa,r:Da,v:Ma,f:za,p:Aa,o:Ra,q:xa,j:La,h:Ca,g:Na,k:Ta,n:qa,s:Ua,t:Ia,d:Wa,c:Xa,u:Ka,l:Za,i:et,m:st},T=fa(),Ge=i._main=(e,a)=>(Ge=i._main=T.y)(e,a),We=()=>(We=T.z)(),Fe=e=>(Fe=T.B)(e),Xe=e=>(Xe=T.C)(e);i.addRunDependency=se,i.removeRunDependency=K,i.FS_createPath=n.createPath,i.FS_createLazyFile=n.createLazyFile,i.FS_createDevice=n.createDevice,i.callMain=Ve,i.FS_createPreloadedFile=n.createPreloadedFile,i.FS=n,i.FS_createDataFile=n.createDataFile,i.FS_unlink=n.unlink;var fe;V=function e(){fe||Ke(),fe||(V=e)};function Ve(e=[]){var a=Ge;e.unshift(ee);var t=e.length,r=Fe((t+1)*4),s=r;e.forEach(d=>{M[s>>2]=it(d),s+=4}),M[s>>2]=0;try{var o=a(t,r);return Ue(o,!0),o}catch(d){return ot(d)}}function Ke(e=ge){if(O>0||(ta(),O>0))return;function a(){fe||(fe=!0,i.calledRun=!0,!ve&&(na(),ra(),Pe(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Je&&Ve(e),sa()))}i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),a()},1)):a()}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Je=!1;return i.noInitialRun&&(Je=!1),Ke(),Se.ready}})();export{lt as createPiperPhonemize};