pdf.js/external/quickjs/quickjs-eval.js

40 lines
503 KiB
JavaScript
Raw Normal View History

var Module = (function() {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
return (
function(Module) {
Module = Module || {};
var b;b||(b=typeof Module !== 'undefined' ? Module : {});var h,n;b.ready=new Promise(function(a,c){h=a;n=c});var q={},r;for(r in b)b.hasOwnProperty(r)&&(q[r]=b[r]);var t="";"undefined"!==typeof document&&document.currentScript&&(t=document.currentScript.src);_scriptDir&&(t=_scriptDir);0!==t.indexOf("blob:")?t=t.substr(0,t.lastIndexOf("/")+1):t="";var aa=b.print||console.log.bind(console),u=b.printErr||console.warn.bind(console);for(r in q)q.hasOwnProperty(r)&&(b[r]=q[r]);q=null;var v;
b.wasmBinary&&(v=b.wasmBinary);var noExitRuntime;b.noExitRuntime&&(noExitRuntime=b.noExitRuntime);"object"!==typeof WebAssembly&&w("no native wasm support detected");var x,y=!1;function A(a){var c=b["_"+a];c||w("Assertion failed: Cannot call unknown function "+(a+", make sure it is exported"));return c}
function B(a,c,d,e){var f={string:function(l){var p=0;if(null!==l&&void 0!==l&&0!==l){var W=(l.length<<2)+1;p=C(W);D(l,E,p,W)}return p},array:function(l){var p=C(l.length);F.set(l,p);return p}},g=A(a),k=[];a=0;if(e)for(var m=0;m<e.length;m++){var z=f[d[m]];z?(0===a&&(a=G()),k[m]=z(e[m])):k[m]=e[m]}d=g.apply(null,k);d=function(l){return"string"===c?H(l):"boolean"===c?!!l:l}(d);0!==a&&I(a);return d}var J="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;
function ba(a,c,d){var e=c+d;for(d=c;a[d]&&!(d>=e);)++d;if(16<d-c&&a.subarray&&J)return J.decode(a.subarray(c,d));for(e="";c<d;){var f=a[c++];if(f&128){var g=a[c++]&63;if(192==(f&224))e+=String.fromCharCode((f&31)<<6|g);else{var k=a[c++]&63;f=224==(f&240)?(f&15)<<12|g<<6|k:(f&7)<<18|g<<12|k<<6|a[c++]&63;65536>f?e+=String.fromCharCode(f):(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else e+=String.fromCharCode(f)}return e}function H(a){return a?ba(E,a,void 0):""}
function D(a,c,d,e){if(0<e){e=d+e-1;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var k=a.charCodeAt(++f);g=65536+((g&1023)<<10)|k&1023}if(127>=g){if(d>=e)break;c[d++]=g}else{if(2047>=g){if(d+1>=e)break;c[d++]=192|g>>6}else{if(65535>=g){if(d+2>=e)break;c[d++]=224|g>>12}else{if(d+3>=e)break;c[d++]=240|g>>18;c[d++]=128|g>>12&63}c[d++]=128|g>>6&63}c[d++]=128|g&63}}c[d]=0}}
function ca(a){for(var c=0,d=0;d<a.length;++d){var e=a.charCodeAt(d);55296<=e&&57343>=e&&(e=65536+((e&1023)<<10)|a.charCodeAt(++d)&1023);127>=e?++c:c=2047>=e?c+2:65535>=e?c+3:c+4}return c}function da(a){var c=ca(a)+1,d=K(c);d&&D(a,F,d,c);return d}var L,F,E,M,N=b.INITIAL_MEMORY||16777216;b.wasmMemory?x=b.wasmMemory:x=new WebAssembly.Memory({initial:N/65536,maximum:N/65536});x&&(L=x.buffer);N=L.byteLength;var O=L;L=O;b.HEAP8=F=new Int8Array(O);b.HEAP16=new Int16Array(O);b.HEAP32=M=new Int32Array(O);
b.HEAPU8=E=new Uint8Array(O);b.HEAPU16=new Uint16Array(O);b.HEAPU32=new Uint32Array(O);b.HEAPF32=new Float32Array(O);b.HEAPF64=new Float64Array(O);var P,ea=[],fa=[],ha=[],ia=[];function ja(){var a=b.preRun.shift();ea.unshift(a)}var Q=0,R=null,S=null;b.preloadedImages={};b.preloadedAudios={};function w(a){if(b.onAbort)b.onAbort(a);u(a);y=!0;a=new WebAssembly.RuntimeError("abort("+a+"). Build with -s ASSERTIONS=1 for more info.");n(a);throw a;}
function T(a){return String.prototype.startsWith?a.startsWith("data:application/octet-stream;base64,"):0===a.indexOf("data:application/octet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EAogcBcgDzBgFzANYGAXQAnwIBdQCKCQF2AIkJAXcAiAkBeAD4CAF5APcIAXoA9ggJ8wUBAEEBC/YCigThCN4I3QjZCO8I7gjtCJoHwgTMBrAGnwbHCrIDmQqPCoYG8wnXCc8JzQnLCcQJ8QW2Ca4JogmcCd8FjwmHCYUJggn8CM4F9AOiCOcI5Qf+BOMH4wGmB5sHnAjvB/IEsweVB5QHkweRB4wHiAekBvgJmAiXCJYIlQiUCIsFkwiSCJEIkAiPCI4IjQiMCIsIigiJCIgIhwiGCIUI3wOECN8DgwiCCIEIgAjmB9oH2QfYB90HiAX/B/4HwAe/B74HvQe7B7oHuAe3B7YHpQekB6MH3wOhB4sFoAefB54HnQfzB/IH8QfWB9MH0gfRB9AHzwfNB8wHyAfHB8YHxQfEB8MHwgfBB7UHsgewB68HrgetB6wHqgepB6cHmAeXB5YHiwKSB5AHjweOB4sHhweNBYYHhQeEB4MH4gSCB4EH/QaPBfwG0QbQBs8GzgbNBssGygbJBpYFyAbHBrsExgbFBsQGuQTDBsIGwQa6BMAGvwa+Br0GvAa7BroGuQa4BrcGjwO2BrUGtAazBrIGsQauBq0GrAarBqoGqQbtA6gGpwaVBZcFpgalBqMGoQagBp4GnQacBpsGmga1BLQEmQaYB
function la(){try{if(v)return new Uint8Array(v);var a=U;if(T(a))try{var c=ma(a.slice(37)),d=new Uint8Array(c.length);for(a=0;a<c.length;++a)d[a]=c.charCodeAt(a);var e=d}catch(g){throw Error("Converting base64 string to bytes failed.");}else e=void 0;var f=e;if(f)return f;throw"both async and sync fetching of the wasm failed";}catch(g){w(g)}}
function na(){return v||"function"!==typeof fetch?Promise.resolve().then(la):fetch(U,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+U+"'";return a.arrayBuffer()}).catch(function(){return la()})}function V(a){for(;0<a.length;){var c=a.shift();if("function"==typeof c)c(b);else{var d=c.B;"number"===typeof d?void 0===c.A?P.get(d)():P.get(d)(c.A):d(void 0===c.A?null:c.A)}}}function oa(a){var c=ca(a)+1,d=K(c);D(a,E,d,c);return d}function pa(){}
var qa=[null,[],[]];function ra(){function a(k){return(k=k.toTimeString().match(/\(([A-Za-z ]+)\)$/))?k[1]:"GMT"}if(!sa){sa=!0;var c=(new Date).getFullYear(),d=new Date(c,0,1),e=new Date(c,6,1);c=d.getTimezoneOffset();var f=e.getTimezoneOffset(),g=Math.max(c,f);M[ta()>>2]=60*g;M[ua()>>2]=Number(c!=f);d=a(d);e=a(e);d=da(d);e=da(e);f<c?(M[X()>>2]=d,M[X()+4>>2]=e):(M[X()>>2]=e,M[X()+4>>2]=d)}}var sa;
pa=(a,c,d)=>{a=H(a);c=null!==c?JSON.parse(H(c)):[];try{const e=b.externalCall(a,c);return e?oa(e):null}catch(e){return b.HEAPU8[d]=1,oa(e.message)}};
var ma="function"===typeof atob?atob:function(a){var c="",d=0;a=a.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(d++));var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(d++));var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(d++));var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(d++));e=e<<2|f>>4;
f=(f&15)<<4|g>>2;var m=(g&3)<<6|k;c+=String.fromCharCode(e);64!==g&&(c+=String.fromCharCode(f));64!==k&&(c+=String.fromCharCode(m))}while(d<a.length);return c};fa.push({B:function(){va()}});
var wa={b:function(a,c,d,e){w("Assertion failed: "+H(a)+", at: "+[c?H(c):"unknown filename",d,e?H(e):"unknown function"])},c:function(){w()},i:pa,h:function(a,c){a=H(a);let d;try{d=window.JSON.parse(a)}catch(e){d=a}0!==c?window.alert(a):window.console.log("DUMP",d)},f:function(a,c,d){E.copyWithin(a,c,c+d)},g:function(){w("OOM")},e:function(a,c,d,e){for(var f=0,g=0;g<d;g++){for(var k=M[c+8*g>>2],m=M[c+(8*g+4)>>2],z=0;z<m;z++){var l=E[k+z],p=qa[a];0===l||10===l?((1===a?aa:u)(ba(p,0)),p.length=0):p.push(l)}f+=
m}M[e>>2]=f;return 0},d:function(a){var c=Date.now();M[a>>2]=c/1E3|0;M[a+4>>2]=c%1E3*1E3|0;return 0},j:function(a,c){ra();a=new Date(1E3*M[a>>2]);M[c>>2]=a.getSeconds();M[c+4>>2]=a.getMinutes();M[c+8>>2]=a.getHours();M[c+12>>2]=a.getDate();M[c+16>>2]=a.getMonth();M[c+20>>2]=a.getFullYear()-1900;M[c+24>>2]=a.getDay();var d=new Date(a.getFullYear(),0,1);M[c+28>>2]=(a.getTime()-d.getTime())/864E5|0;M[c+36>>2]=-(60*a.getTimezoneOffset());var e=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();d=d.getTimezoneOffset();
a=(e!=d&&a.getTimezoneOffset()==Math.min(d,e))|0;M[c+32>>2]=a;a=M[X()+(a?4:0)>>2];M[c+40>>2]=a;return c},k:function(a){a=H(a);window.console.log(a)},a:x,l:function(a,c,d,e){a=H(a);c=H(c);d=H(d);d=`Quickjs -- ${a}: ${c}\n${d}`;0!==e?window.alert(d):window.console.error(d)}};
(function(){function a(f){b.asm=f.exports;P=b.asm.m;Q--;b.monitorRunDependencies&&b.monitorRunDependencies(Q);0==Q&&(null!==R&&(clearInterval(R),R=null),S&&(f=S,S=null,f()))}function c(f){a(f.instance)}function d(f){return na().then(function(g){return WebAssembly.instantiate(g,e)}).then(f,function(g){u("failed to asynchronously prepare wasm: "+g);w(g)})}var e={a:wa};Q++;b.monitorRunDependencies&&b.monitorRunDependencies(Q);if(b.instantiateWasm)try{return b.instantiateWasm(e,a)}catch(f){return u("Module.instantiateWasm callback failed with error: "+
f),!1}(function(){return v||"function"!==typeof WebAssembly.instantiateStreaming||T(U)||"function"!==typeof fetch?d(c):fetch(U,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(c,function(g){u("wasm streaming compile failed: "+g);u("falling back to ArrayBuffer instantiation");return d(c)})})})().catch(n);return{}})();var va=b.___wasm_call_ctors=function(){return(va=b.___wasm_call_ctors=b.asm.n).apply(null,arguments)};
b._evalInSandbox=function(){return(b._evalInSandbox=b.asm.o).apply(null,arguments)};b._nukeSandbox=function(){return(b._nukeSandbox=b.asm.p).apply(null,arguments)};b._init=function(){return(b._init=b.asm.q).apply(null,arguments)};b._commFun=function(){return(b._commFun=b.asm.r).apply(null,arguments)};b._dumpMemoryUse=function(){return(b._dumpMemoryUse=b.asm.s).apply(null,arguments)};
var K=b._malloc=function(){return(K=b._malloc=b.asm.t).apply(null,arguments)},X=b.__get_tzname=function(){return(X=b.__get_tzname=b.asm.u).apply(null,arguments)},ua=b.__get_daylight=function(){return(ua=b.__get_daylight=b.asm.v).apply(null,arguments)},ta=b.__get_timezone=function(){return(ta=b.__get_timezone=b.asm.w).apply(null,arguments)},G=b.stackSave=function(){return(G=b.stackSave=b.asm.x).apply(null,arguments)},I=b.stackRestore=function(){return(I=b.stackRestore=b.asm.y).apply(null,arguments)},
C=b.stackAlloc=function(){return(C=b.stackAlloc=b.asm.z).apply(null,arguments)};b.ccall=B;b.cwrap=function(a,c,d,e){d=d||[];var f=d.every(function(g){return"number"===g});return"string"!==c&&f&&!e?A(a):function(){return B(a,c,d,arguments,e)}};var Y;S=function xa(){Y||Z();Y||(S=xa)};
function Z(){function a(){if(!Y&&(Y=!0,b.calledRun=!0,!y)){V(fa);V(ha);h(b);if(b.onRuntimeInitialized)b.onRuntimeInitialized();if(b.postRun)for("function"==typeof b.postRun&&(b.postRun=[b.postRun]);b.postRun.length;){var c=b.postRun.shift();ia.unshift(c)}V(ia)}}if(!(0<Q)){if(b.preRun)for("function"==typeof b.preRun&&(b.preRun=[b.preRun]);b.preRun.length;)ja();V(ea);0<Q||(b.setStatus?(b.setStatus("Running..."),setTimeout(function(){setTimeout(function(){b.setStatus("")},1);a()},1)):a())}}b.run=Z;
if(b.preInit)for("function"==typeof b.preInit&&(b.preInit=[b.preInit]);0<b.preInit.length;)b.preInit.pop()();noExitRuntime=!0;Z();
return Module.ready
}
);
})();
export default Module;