| 61 | typeof a?a:S.Ja(a),b):a;e=S.ib(e,f);f=S.create(a,e);if(d){if("string"===typeof d){a=Array(d.length);b=0;for(var k=d.length;b<k;++b)a[b]=d.charCodeAt(b);d=a}S.chmod(f,e|146);a=S.open(f,"w");S.write(a,d,0,d.length,0,h);S.close(a);S.chmod(f,e)}return f},Ia:function(a,b,d,e){a=Q("string"===typeof a?a:S.Ja(a),b);b=S.ib(!!d,!!e);S.Ia.Ab||(S.Ia.Ab=64);var f=S.Qa(S.Ia.Ab++,0);S.Hb(f,{open:function(h){h.seekable=!1},close:function(){e&&e.buffer&&e.buffer.length&&e(10)},read:function(h,k,l,q){for(var n=0,t= |
| 62 | 0;t<q;t++){try{var w=d()}catch(C){throw new S.ra(29);}if(void 0===w&&0===n)throw new S.ra(6);if(null===w||void 0===w)break;n++;k[l+t]=w}n&&(h.node.timestamp=Date.now());return n},write:function(h,k,l,q){for(var n=0;n<q;n++)try{e(k[l+n])}catch(t){throw new S.ra(29);}q&&(h.node.timestamp=Date.now());return n}});return S.mb(a,b,f)},Vb:function(a,b,d){a=Q("string"===typeof a?a:S.Ja(a),b);return S.symlink(d,a)},cc:function(a){if(a.yb||a.Nc||a.link||a.sa)return!0;var b=!0;if("undefined"!==typeof XMLHttpRequest)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."); |
| 63 | if(r)try{a.sa=db(r(a.url),!0),a.za=a.sa.length}catch(d){b=!1}else throw Error("Cannot load without read() or XMLHttpRequest.");b||Ya(29);return b},Ub:function(a,b,d,e,f){function h(){this.zb=!1;this.Ea=[]}h.prototype.get=function(n){if(!(n>this.length-1||0>n)){var t=n%this.chunkSize;return this.fc(n/this.chunkSize|0)[t]}};h.prototype.fb=function(n){this.fc=n};h.prototype.Rb=function(){var n=new XMLHttpRequest;n.open("HEAD",d,!1);n.send(null);if(!(200<=n.status&&300>n.status||304===n.status))throw Error("Couldn't load "+ |
| 64 | d+". Status: "+n.status);var t=Number(n.getResponseHeader("Content-length")),w,C=(w=n.getResponseHeader("Accept-Ranges"))&&"bytes"===w;n=(w=n.getResponseHeader("Content-Encoding"))&&"gzip"===w;var B=1048576;C||(B=t);var A=this;A.fb(function(I){var J=I*B,aa=(I+1)*B-1;aa=Math.min(aa,t-1);if("undefined"===typeof A.Ea[I]){var bc=A.Ea;if(J>aa)throw Error("invalid range ("+J+", "+aa+") or no bytes requested!");if(aa>t-1)throw Error("only "+t+" bytes available! programmer error!");var E=new XMLHttpRequest; |
| 65 | E.open("GET",d,!1);t!==B&&E.setRequestHeader("Range","bytes="+J+"-"+aa);"undefined"!=typeof Uint8Array&&(E.responseType="arraybuffer");E.overrideMimeType&&E.overrideMimeType("text/plain; charset=x-user-defined");E.send(null);if(!(200<=E.status&&300>E.status||304===E.status))throw Error("Couldn't load "+d+". Status: "+E.status);J=void 0!==E.response?new Uint8Array(E.response||[]):db(E.responseText||"",!0);bc[I]=J}if("undefined"===typeof A.Ea[I])throw Error("doXHR failed!");return A.Ea[I]});if(n||!t)B= |
| 66 | t=1,B=t=this.fc(0).length,ka("LazyFiles on gzip forces download of the whole file when length is accessed");this.wc=t;this.vc=B;this.zb=!0};if("undefined"!==typeof XMLHttpRequest){if(!m)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var k=new h;Object.defineProperties(k,{length:{get:function(){this.zb||this.Rb();return this.wc}},chunkSize:{get:function(){this.zb||this.Rb();return this.vc}}});k={yb:!1,sa:k}}else k={yb:!1,url:d}; |