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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
593 KiB
JavaScript
Raw Normal View History

var Module = (() => {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
return (
function(moduleArg = {}) {
var d=moduleArg,k,n;d.ready=new Promise((a,b)=>{k=a;n=b});var p=Object.assign({},d),q="";"undefined"!=typeof document&&document.currentScript&&(q=document.currentScript.src);_scriptDir&&(q=_scriptDir);q.startsWith("blob:")?q="":q=q.substr(0,q.replace(/[?#].*/,"").lastIndexOf("/")+1);var aa=d.print||console.log.bind(console),u=d.printErr||console.error.bind(console);Object.assign(d,p);p=null;var v;d.wasmBinary&&(v=d.wasmBinary);"object"!=typeof WebAssembly&&w("no native wasm support detected");
var x,y=!1,z,A,B,C;function D(){var a=x.buffer;d.HEAP8=z=new Int8Array(a);d.HEAP16=new Int16Array(a);d.HEAPU8=A=new Uint8Array(a);d.HEAPU16=new Uint16Array(a);d.HEAP32=B=new Int32Array(a);d.HEAPU32=C=new Uint32Array(a);d.HEAPF32=new Float32Array(a);d.HEAPF64=new Float64Array(a)}var E=[],F=[],G=[];function ba(){var a=d.preRun.shift();E.unshift(a)}var H=0,I=null,J=null;
function w(a){d.onAbort?.(a);a="Aborted("+a+")";u(a);y=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");n(a);throw a;}var K=a=>a.startsWith("data:application/octet-stream;base64,"),L;L="data:application/octet-stream;base64,AGFzbQEAAAABzgZtYAJ/fwBgA39/fwF/YAR/fn9/AX5gAn9/AX9gBX9+f39/AX5gAX8Bf2ADf39/AGAEf39/fwF/YAJ/fgF+YAF/AGABfAF8YAV/f39/fwF/YAJ/fgBgAn9+AX9gAn9/AX5gA39/fgF/YAN/fn8BfmAGf35/f39/AX5gA39+fwBgA39+fwF/YAZ/f39/f38Bf2AEf39/fwBgBn9+fn9/fwF+YAR/f35/AX9gA39+fgF+YAN/f38BfmADf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gfRB9AHzwfOB4gDzQfMB8sHygfJB8gHxwfGB8UHxAfDB8IHwQfAB/EDvwe+B64F7QO9B7wH1QS5B7gHtwe2B7UHtAezB7IHsQewB9ME0gSvB64HrQesB6sHqgepB6gHpwemB6UHpAejB6IHoQegB58HnQecB5sHmgeZB5gHlweWB5UHkweSB5EHkAePB44HjQeLB4oHiQeIB4cHhgeFB4QHgweCB4EHiQmICY0JgAeACZUJkwmcBJAJjAmaBM4CwAiCCfsI+Qj/BooJgQn6CJQJkgmPCZMCoQOWCYMJjgn+Bv0G/Ab7BvoG+Qb3BvYG9Qb0BvMG8
function ca(){var a=L;return Promise.resolve().then(()=>{if(a==L&&v)var b=new Uint8Array(v);else{if(K(a)){b=atob(a.slice(37));for(var c=new Uint8Array(b.length),e=0;e<b.length;++e)c[e]=b.charCodeAt(e);b=c}else b=void 0;if(!b)throw"both async and sync fetching of the wasm failed";}return b})}function da(a,b){return ca().then(c=>WebAssembly.instantiate(c,a)).then(c=>c).then(b,c=>{u(`failed to asynchronously prepare wasm: ${c}`);w(c)})}function ea(a,b){return da(a,b)}
var N=a=>{for(;0<a.length;)a.shift()(d)},O="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,P=(a,b)=>{for(var c=b+NaN,e=b;a[e]&&!(e>=c);)++e;if(16<e-b&&a.buffer&&O)return O.decode(a.subarray(b,e));for(c="";b<e;){var f=a[b++];if(f&128){var g=a[b++]&63;if(192==(f&224))c+=String.fromCharCode((f&31)<<6|g);else{var l=a[b++]&63;f=224==(f&240)?(f&15)<<12|g<<6|l:(f&7)<<18|g<<12|l<<6|a[b++]&63;65536>f?c+=String.fromCharCode(f):(f-=65536,c+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else c+=
String.fromCharCode(f)}return c},fa=[0,31,60,91,121,152,182,213,244,274,305,335],ha=[0,31,59,90,120,151,181,212,243,273,304,334],Q=a=>{for(var b=0,c=0;c<a.length;++c){var e=a.charCodeAt(c);127>=e?b++:2047>=e?b+=2:55296<=e&&57343>=e?(b+=4,++c):b+=3}return b},R=(a,b,c)=>{var e=A;if(0<c){c=b+c-1;for(var f=0;f<a.length;++f){var g=a.charCodeAt(f);if(55296<=g&&57343>=g){var l=a.charCodeAt(++f);g=65536+((g&1023)<<10)|l&1023}if(127>=g){if(b>=c)break;e[b++]=g}else{if(2047>=g){if(b+1>=c)break;e[b++]=192|g>>
6}else{if(65535>=g){if(b+2>=c)break;e[b++]=224|g>>12}else{if(b+3>=c)break;e[b++]=240|g>>18;e[b++]=128|g>>12&63}e[b++]=128|g>>6&63}e[b++]=128|g&63}}e[b]=0}},T=a=>{var b=Q(a)+1,c=S(b);c&&R(a,c,b);return c};function U(){}
var ia=[null,[],[]],ka=(a,b,c,e)=>{var f={string:h=>{var r=0;if(null!==h&&void 0!==h&&0!==h){r=Q(h)+1;var Y=V(r);R(h,Y,r);r=Y}return r},array:h=>{var r=V(h.length);z.set(h,r);return r}};a=d["_"+a];var g=[],l=0;if(e)for(var m=0;m<e.length;m++){var t=f[c[m]];t?(0===l&&(l=W()),g[m]=t(e[m])):g[m]=e[m]}c=a.apply(null,g);return c=function(h){0!==l&&ja(l);return"string"===b?h?P(A,h):"":"boolean"===b?!!h:h}(c)};
U=(a,b,c)=>{a=a?P(A,a):"";b=null!==b?JSON.parse(b?P(A,b):""):[];try{const e=d.externalCall(a,b);return e?T(e):null}catch(e){return d.HEAPU8[c]=1,T(e.message)}};
var la={a:(a,b,c,e)=>{w(`Assertion failed: ${a?P(A,a):""}, at: `+[b?b?P(A,b):"":"unknown filename",c,e?e?P(A,e):"":"unknown function"])},i:function(a,b,c){a=new Date(1E3*(b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN));B[c>>2]=a.getSeconds();B[c+4>>2]=a.getMinutes();B[c+8>>2]=a.getHours();B[c+12>>2]=a.getDate();B[c+16>>2]=a.getMonth();B[c+20>>2]=a.getFullYear()-1900;B[c+24>>2]=a.getDay();b=a.getFullYear();B[c+28>>2]=(0!==b%4||0===b%100&&0!==b%400?ha:fa)[a.getMonth()]+a.getDate()-1|0;B[c+36>>
2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();B[c+32>>2]=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0},d:(a,b,c)=>{function e(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}var f=(new Date).getFullYear(),g=new Date(f,0,1),l=new Date(f,6,1);f=g.getTimezoneOffset();var m=l.getTimezoneOffset();C[a>>2]=60*Math.max(f,m);B[b>>2]=Number(f!=m);a=e(g);b=e(l);a=T(a);b=T(b);m<f?(C[c>>2]=a,
C[c+4>>2]=b):(C[c>>2]=b,C[c+4>>2]=a)},b:()=>{w("")},g:U,f:function(a,b){a=a?P(A,a):"";let c;try{c=window.JSON.parse(a)}catch(e){c=a}0!==b?window.alert(a):window.console.log("DUMP",c)},e:()=>Date.now(),j:a=>{var b=A.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var e=b*(1+.2/c);e=Math.min(e,a+100663296);var f=Math;e=Math.max(a,e);a:{f=(f.min.call(f,2147483648,e+(65536-e%65536)%65536)-x.buffer.byteLength+65535)/65536;try{x.grow(f);D();var g=1;break a}catch(l){}g=void 0}if(g)return!0}return!1},
c:(a,b,c,e)=>{for(var f=0,g=0;g<c;g++){var l=C[b>>2],m=C[b+4>>2];b+=8;for(var t=0;t<m;t++){var h=A[l+t],r=ia[a];0===h||10===h?((1===a?aa:u)(P(r,0)),r.length=0):r.push(h)}f+=m}C[e>>2]=f;return 0},k:function(a){a=a?P(A,a):"";window.console.log(a)},h:function(a){a=a?P(A,a):"";return Date.parse(a)},l:function(a,b,c,e){a=a?P(A,a):"";b=b?P(A,b):"";c=c?P(A,c):"";c=`Quickjs -- ${a}: ${b}\n${c}`;0!==e?window.alert(c):window.console.error(c)}},X=function(){function a(c){X=c.exports;x=X.m;D();F.unshift(X.n);
H--;d.monitorRunDependencies?.(H);0==H&&(null!==I&&(clearInterval(I),I=null),J&&(c=J,J=null,c()));return X}var b={a:la};H++;d.monitorRunDependencies?.(H);if(d.instantiateWasm)try{return d.instantiateWasm(b,a)}catch(c){u(`Module.instantiateWasm callback failed with error: ${c}`),n(c)}ea(b,function(c){a(c.instance)}).catch(n);return{}}();d._evalInSandbox=(a,b)=>(d._evalInSandbox=X.o)(a,b);d._nukeSandbox=()=>(d._nukeSandbox=X.p)();d._init=(a,b)=>(d._init=X.q)(a,b);
d._commFun=(a,b)=>(d._commFun=X.r)(a,b);d._dumpMemoryUse=()=>(d._dumpMemoryUse=X.s)();var S=a=>(S=X.t)(a);d._free=a=>(d._free=X.u)(a);var W=()=>(W=X.w)(),ja=a=>(ja=X.x)(a),V=a=>(V=X.y)(a);d.ccall=ka;d.cwrap=(a,b,c,e)=>{var f=!c||c.every(g=>"number"===g||"boolean"===g);return"string"!==b&&f&&!e?d["_"+a]:function(){return ka(a,b,c,arguments,e)}};d.stringToNewUTF8=T;var Z;J=function ma(){Z||na();Z||(J=ma)};
function na(){function a(){if(!Z&&(Z=!0,d.calledRun=!0,!y)){N(F);k(d);if(d.onRuntimeInitialized)d.onRuntimeInitialized();if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;){var b=d.postRun.shift();G.unshift(b)}N(G)}}if(!(0<H)){if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)ba();N(E);0<H||(d.setStatus?(d.setStatus("Running..."),setTimeout(function(){setTimeout(function(){d.setStatus("")},1);a()},1)):a())}}
if(d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);0<d.preInit.length;)d.preInit.pop()();na();
return moduleArg.ready
}
);
})();
export default Module;