-
Notifications
You must be signed in to change notification settings - Fork 2
/
SQLiteOnline.js
1 lines (1 loc) · 51.1 KB
/
SQLiteOnline.js
1
var createDb,db,sqlModuleReady,initSqlJsPromise=void 0,initSqlJs=function(e){return initSqlJsPromise||(initSqlJsPromise=new Promise((n,t)=>{var r,i=void 0!==e?e:{},o=i.onAbort;i.onAbort=function(e){t(new Error(e)),o&&o(e)},i.postRun=i.postRun||[],i.postRun.push(function(){n(i)}),module=void 0,r||(r=void 0!==i?i:{});var a=function(){var e,n=$n(4),t={},i=function(){function e(e,n){this.jb=e,this.db=n,this.qb=1,this.Hb=[]}return e.prototype.bind=function(e){if(!this.jb)throw"Statement closed";return this.reset(),Array.isArray(e)?this.cc(e):this.dc(e)},e.prototype.step=function(){var e;if(!this.jb)throw"Statement closed";switch(this.qb=1,e=w(this.jb)){case t.Zb:return!0;case t.DONE:return!1;default:return this.db.handleError(e)}},e.prototype.kc=function(e){return null==e&&(e=this.qb++),g(this.jb,e)},e.prototype.lc=function(e){return null==e&&(e=this.qb++),_(this.jb,e)},e.prototype.getBlob=function(e){var n;null==e&&(e=this.qb++);var t=q(this.jb,e),r=k(this.jb,e),i=new Uint8Array(t);for(e=n=0;0<=t?n<t:n>t;e=0<=t?++n:--n)i[e]=N[r+e];return i},e.prototype.get=function(e){var n,r;null!=e&&this.bind(e)&&this.step();var i=[];for(e=n=0,r=v(this.jb);0<=r?n<r:n>r;e=0<=r?++n:--n)switch(A(this.jb,e)){case t.Yb:case t.FLOAT:i.push(this.kc(e));break;case t.$b:i.push(this.lc(e));break;case t.Xb:i.push(this.getBlob(e));break;default:i.push(null)}return i},e.prototype.getColumnNames=function(){var e,n,t=[],r=e=0;for(n=v(this.jb);0<=n?e<n:e>n;r=0<=n?++e:--e)t.push(O(this.jb,r));return t},e.prototype.getAsObject=function(e){var n,t,r=this.get(e),i=this.getColumnNames(),o={};for(e=n=0,t=i.length;n<t;e=++n){o[i[e]]=r[e]}return o},e.prototype.run=function(e){return null!=e&&this.bind(e),this.step(),this.reset()},e.prototype.hc=function(e,n){var t;null==n&&(n=this.qb++),e=Wn(e),this.Hb.push(t=z(e)),this.db.handleError(b(this.jb,n,t,e.length-1,0))},e.prototype.bc=function(e,n){var t;null==n&&(n=this.qb++),this.Hb.push(t=z(e)),this.db.handleError(h(this.jb,n,t,e.length,0))},e.prototype.fc=function(e,n){null==n&&(n=this.qb++),this.db.handleError((e===(0|e)?p:d)(this.jb,n,e))},e.prototype.ec=function(e){null==e&&(e=this.qb++),h(this.jb,e,0,0,0)},e.prototype.Ob=function(e,n){switch(null==n&&(n=this.qb++),typeof e){case"string":this.hc(e,n);break;case"number":case"boolean":this.fc(e+0,n);break;case"object":if(null===e)this.ec(n);else{if(null==e.length)throw"Wrong API use : tried to bind a value of an unknown type ("+e+").";this.bc(e,n)}}},e.prototype.dc=function(e){var n;for(n in e){var t=e[n],r=m(this.jb,n);0!==r&&this.Ob(t,r)}return!0},e.prototype.cc=function(e){var n,t,r=n=0;for(t=e.length;n<t;r=++n){var i=e[r];this.Ob(i,r+1)}return!0},e.prototype.reset=function(){return this.freemem(),T(this.jb)===t.Bb&&M(this.jb)===t.Bb},e.prototype.freemem=function(){for(var e;e=this.Hb.pop();)Qn(e);return null},e.prototype.free=function(){this.freemem();var e=R(this.jb)===t.Bb;return delete this.db.Fb[this.jb],this.jb=X,e},e}(),o=function(){function e(e){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),null!=e){var t=this.filename,r=t?Ae("/",t):"/";if(r=un(r,4095&(void 0!==(t=An(!0,!0))?t:438)|32768,0),e){if("string"==typeof e){for(var i=Array(e.length),o=0,u=e.length;o<u;++o)i[o]=e.charCodeAt(o);e=i}pn(r,146|t),kn(i=yn(r,"w"),e,0,e.length,0,void 0),vn(i),pn(r,t)}}this.handleError(a(this.filename,n)),this.db=E(n,"i32"),K(this.db),this.Fb={},this.rb={}}return e.prototype.run=function(e,t){if(!this.db)throw"Database closed";if(t){e=this.prepare(e,t);try{e.step()}finally{e.free()}}else this.handleError(s(this.db,e,0,0,n));return this},e.prototype.exec=function(e){var t;if(!this.db)throw"Database closed";var r=nt();try{var o=V(e)+1,a=$n(o);G(e,N,a,o);var u=a,s=$n(4);for(t=[];E(u,"i8")!==X;){D(n),D(s),this.handleError(l(this.db,u,-1,n,s));var c=E(n,"i32");if(u=E(s,"i32"),c!==X){var f=null,b=new i(c,this);try{for(;b.step();)null===f&&(f={columns:b.getColumnNames(),values:[]},t.push(f)),f.values.push(b.get())}finally{b.free()}}}return t}finally{et(r)}},e.prototype.each=function(e,n,t,r){"function"==typeof n&&(r=t,t=n,n=void 0),e=this.prepare(e,n);try{for(;e.step();)t(e.getAsObject())}finally{e.free()}if("function"==typeof r)return r()},e.prototype.prepare=function(e,t){if(D(n),this.handleError(f(this.db,e,-1,n,X)),(e=E(n,"i32"))===X)throw"Nothing to prepare";var r=new i(e,this);return null!=t&&r.bind(t),this.Fb[e]=r},e.prototype.export=function(){var e,t=this.Fb;for(i in t){var r=t[i];r.free()}for(i in r=this.rb)t=r[i],x[t-S]=null;this.rb={},this.handleError(u(this.db)),r=this.filename;var i=i={encoding:"binary"};if(i.flags=i.flags||"r",i.encoding=i.encoding||"binary","utf8"!==i.encoding&&"binary"!==i.encoding)throw Error('Invalid encoding type "'+i.encoding+'"');t=yn(r,i.flags),r=hn(r).size;var o=new Uint8Array(r);return _n(t,o,0,r,0),"utf8"===i.encoding?e=H(o,0):"binary"===i.encoding&&(e=o),vn(t),this.handleError(a(this.filename,n)),this.db=E(n,"i32"),e},e.prototype.close=function(){var e,n=this.Fb;for(e in n){var t=n[e];t.free()}for(e in t=this.rb)n=t[e],x[n-S]=null;return this.rb={},this.handleError(u(this.db)),ln("/"+this.filename),this.db=null},e.prototype.handleError=function(e){if(e===t.Bb)return null;throw e=y(this.db),setTimeout(function(){throw new Error(e)}),new Error(e)},e.prototype.getRowsModified=function(){return c(this.db)},e.prototype.create_function=function(e,n){e in this.rb&&(x[this.rb[e]-S]=null,delete this.rb[e]);var r=function(e){for(var n=0;64>n;n++)if(!x[n])return x[n]=e,S+n;throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."}(function(e,t,r){var i,o,a=[];for(i=o=0;0<=t?o<t:o>t;i=0<=t?++o:--o){var u=E(r+4*i,"i32"),s=P(u);i=(i=function(){switch(!1){case 1!==s:case 2!==s:return I;case 3!==s:return C;case 4!==s:return function(e){var n,t,r=F(e),i=U(e);for(e=new Uint8Array(r),n=t=0;0<=r?t<r:t>r;n=0<=r?++t:--t)e[n]=N[i+n];return e};default:return function(){return null}}}())(u),a.push(i)}try{var c=n.apply(null,a)}catch(n){return void Y(e,c=n,-1)}switch(typeof c){case"boolean":Q(e,c?1:0);break;case"number":L(e,c);break;case"string":B(e,c,-1,-1);break;case"object":null===c?W(e):null!=c.length?(t=z(c),J(e,t,c.length,-1),Qn(t)):Y(e,"Wrong API use : tried to return a value of an unknown type ("+c+").",-1);break;default:W(e)}});return this.rb[e]=r,this.handleError(j(this.db,e,n.length,t.ac,0,r,0,0,0)),this},e}(),a=r.cwrap("sqlite3_open","number",["string","number"]),u=r.cwrap("sqlite3_close_v2","number",["number"]),s=r.cwrap("sqlite3_exec","number",["number","string","number","number","number"]);r.cwrap("sqlite3_free","",["number"]);var c=r.cwrap("sqlite3_changes","number",["number"]),f=r.cwrap("sqlite3_prepare_v2","number",["number","string","number","number","number"]),l=r.cwrap("sqlite3_prepare_v2","number",["number","number","number","number","number"]),b=r.cwrap("sqlite3_bind_text","number",["number","number","number","number","number"]),h=r.cwrap("sqlite3_bind_blob","number",["number","number","number","number","number"]),d=r.cwrap("sqlite3_bind_double","number",["number","number","number"]),p=r.cwrap("sqlite3_bind_int","number",["number","number","number"]),m=r.cwrap("sqlite3_bind_parameter_index","number",["number","string"]),w=r.cwrap("sqlite3_step","number",["number"]),y=r.cwrap("sqlite3_errmsg","string",["number"]),v=r.cwrap("sqlite3_data_count","number",["number"]),g=r.cwrap("sqlite3_column_double","number",["number","number"]),_=r.cwrap("sqlite3_column_text","string",["number","number"]),k=r.cwrap("sqlite3_column_blob","number",["number","number"]),q=r.cwrap("sqlite3_column_bytes","number",["number","number"]),A=r.cwrap("sqlite3_column_type","number",["number","number"]),O=r.cwrap("sqlite3_column_name","string",["number","number"]),M=r.cwrap("sqlite3_reset","number",["number"]),T=r.cwrap("sqlite3_clear_bindings","number",["number"]),R=r.cwrap("sqlite3_finalize","number",["number"]),j=r.cwrap("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),P=r.cwrap("sqlite3_value_type","number",["number"]),F=r.cwrap("sqlite3_value_bytes","number",["number"]),C=r.cwrap("sqlite3_value_text","string",["number"]);r.cwrap("sqlite3_value_int","number",["number"]);var U=r.cwrap("sqlite3_value_blob","number",["number"]),I=r.cwrap("sqlite3_value_double","number",["number"]),L=r.cwrap("sqlite3_result_double","",["number","number"]),W=r.cwrap("sqlite3_result_null","",["number"]),B=r.cwrap("sqlite3_result_text","",["number","string","number","number"]),J=r.cwrap("sqlite3_result_blob","",["number","number","number","number"]),Q=r.cwrap("sqlite3_result_int","",["number","number"]);r.cwrap("sqlite3_result_int64","",["number","number"]);var Y=r.cwrap("sqlite3_result_error","",["number","string","number"]),K=r.cwrap("RegisterExtensionFunctions","number",["number"]);for(e in this.SQL={Database:o},this.SQL)r[e]=this.SQL[e];var X=0;t.Bb=0,t.Ac=1,t.Dc=2,t.Nc=3,t.uc=4,t.wc=5,t.Gc=6,t.NOMEM=7,t.Qc=8,t.Ec=9,t.Fc=10,t.zc=11,t.NOTFOUND=12,t.Cc=13,t.xc=14,t.Oc=15,t.EMPTY=16,t.Rc=17,t.Sc=18,t.yc=19,t.Hc=20,t.Ic=21,t.Jc=22,t.vc=23,t.Bc=24,t.Pc=25,t.Kc=26,t.Lc=27,t.Tc=28,t.Zb=100,t.DONE=101,t.Yb=1,t.FLOAT=2,t.$b=3,t.Xb=4,t.Mc=5,t.ac=1}.bind(this);r.onRuntimeInitialized=a;var u,s={};for(u in r)r.hasOwnProperty(u)&&(s[u]=r[u]);var c,f,l,b="./this.program",h=!1,d=!1;h="object"==typeof window,d="function"==typeof importScripts,c=(f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node)&&!h&&!d,l=!h&&!c&&!d;var p,m,w,y,v="";c?(v=__dirname+"/",p=function(e,n){return w||(w=require("fs")),y||(y=require("path")),e=y.normalize(e),e=w.readFileSync(e),n?e:e.toString()},m=function(e){return(e=p(e,!0)).buffer||(e=new Uint8Array(e)),T(e.buffer),e},1<process.argv.length&&(b=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),"undefined"!=typeof module&&(module.exports=r),process.on("unhandledRejection",rt),r.inspect=function(){return"[Emscripten Module object]"}):l?("undefined"!=typeof read&&(p=function(e){return read(e)}),m=function(e){return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(T("object"==typeof(e=read(e,"binary"))),e)},"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(h||d)&&(d?v=self.location.href:document.currentScript&&(v=document.currentScript.src),v=0!==v.indexOf("blob:")?v.substr(0,v.lastIndexOf("/")+1):"",p=function(e){var n=new XMLHttpRequest;return n.open("GET",e,!1),n.send(null),n.responseText},d&&(m=function(e){var n=new XMLHttpRequest;return n.open("GET",e,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}));var g=r.print||console.log.bind(console),_=r.printErr||console.warn.bind(console);for(u in s)s.hasOwnProperty(u)&&(r[u]=s[u]);function k(e){var n=I[K>>2];return(e=n+e+15&-16)>Cn()&&rt(),I[K>>2]=e,n}s=null,r.thisProgram&&(b=r.thisProgram);var q,A={"f64-rem":function(e,n){return e%n},debugger:function(){}},S=1,x=Array(64);function D(e){var n="i32";switch("*"===n.charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":N[e>>0]=0;break;case"i16":U[e>>1]=0;break;case"i32":I[e>>2]=0;break;case"i64":de=[0,(he=0,1<=+oe(he)?0<he?(0|se(+ue(he/4294967296),4294967295))>>>0:~~+ae((he-+(~~he>>>0))/4294967296)>>>0:0)],I[e>>2]=de[0],I[e+4>>2]=de[1];break;case"float":L[e>>2]=0;break;case"double":W[e>>3]=0;break;default:rt("invalid type for setValue: "+n)}}function E(e,n){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":return N[e>>0];case"i16":return U[e>>1];case"i32":case"i64":return I[e>>2];case"float":return L[e>>2];case"double":return W[e>>3];default:rt("invalid type for getValue: "+n)}return null}r.wasmBinary&&(q=r.wasmBinary),"object"!=typeof WebAssembly&&_("no native wasm support detected");var O,M=!1;function T(e,n){e||rt("Assertion failed: "+n)}function R(e){var n=r["_"+e];return T(n,"Cannot call unknown function "+e+", make sure it is exported"),n}var j=0,P=3;function z(e){var n=j;if("number"==typeof e)var t=!0,r=e;else t=!1,r=e.length;if(n=n==P?i:[Yn,$n,k][n](Math.max(r,1)),t){var i=n;for(T(0==(3&n)),e=n+(-4&r);i<e;i+=4)I[i>>2]=0;for(e=n+r;i<e;)N[i++>>0]=0;return n}return e.subarray||e.slice?C.set(e,n):C.set(new Uint8Array(e),n),n}var F,N,C,U,I,L,W,B="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function H(e,n,t){var r=n+t;for(t=n;e[t]&&!(t>=r);)++t;if(16<t-n&&e.subarray&&B)return B.decode(e.subarray(n,t));for(r="";n<t;){var i=e[n++];if(128&i){var o=63&e[n++];if(192==(224&i))r+=String.fromCharCode((31&i)<<6|o);else{var a=63&e[n++];65536>(i=224==(240&i)?(15&i)<<12|o<<6|a:(7&i)<<18|o<<12|a<<6|63&e[n++])?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else r+=String.fromCharCode(i)}return r}function J(e){return e?H(C,e,void 0):""}function G(e,n,t,r){if(!(0<r))return 0;var i=t;r=t+r-1;for(var o=0;o<e.length;++o){var a=e.charCodeAt(o);if(55296<=a&&57343>=a)a=65536+((1023&a)<<10)|1023&e.charCodeAt(++o);if(127>=a){if(t>=r)break;n[t++]=a}else{if(2047>=a){if(t+1>=r)break;n[t++]=192|a>>6}else{if(65535>=a){if(t+2>=r)break;n[t++]=224|a>>12}else{if(t+3>=r)break;n[t++]=240|a>>18,n[t++]=128|a>>12&63}n[t++]=128|a>>6&63}n[t++]=128|63&a}}return n[t]=0,t-i}function V(e){for(var n=0,t=0;t<e.length;++t){var r=e.charCodeAt(t);55296<=r&&57343>=r&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++t)),127>=r?++n:n=2047>=r?n+2:65535>=r?n+3:n+4}return n}function Q(e){return 0<e%65536&&(e+=65536-e%65536),e}function Y(e){F=e,r.HEAP8=N=new Int8Array(e),r.HEAP16=U=new Int16Array(e),r.HEAP32=I=new Int32Array(e),r.HEAPU8=C=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=new Uint32Array(e),r.HEAPF32=L=new Float32Array(e),r.HEAPF64=W=new Float64Array(e)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var K=60304,X=r.TOTAL_MEMORY||16777216;function Z(e){for(;0<e.length;){var n=e.shift();if("function"==typeof n)n();else{var t=n.jc;"number"==typeof t?void 0===n.Ib?r.dynCall_v(t):r.dynCall_vi(t,n.Ib):t(void 0===n.Ib?null:n.Ib)}}}(O=r.wasmMemory?r.wasmMemory:new WebAssembly.Memory({initial:X/65536}))&&(F=O.buffer),X=F.byteLength,Y(F),I[K>>2]=5303216;var $=[],ee=[],ne=[],te=[],re=!1;function ie(){var e=r.preRun.shift();$.unshift(e)}var oe=Math.abs,ae=Math.ceil,ue=Math.floor,se=Math.min,ce=0,fe=null,le=null;function be(){var e=pe;return String.prototype.startsWith?e.startsWith("data:application/octet-stream;base64,"):0===e.indexOf("data:application/octet-stream;base64,")}r.preloadedImages={},r.preloadedAudios={};var he,de,pe="SQLiteOnline.wasm";if(!be()){var me=pe;pe=r.locateFile?r.locateFile(me,v):v+me}function we(){try{if(q)return new Uint8Array(q);if(m)return m(pe);throw"both async and sync fetching of the wasm failed"}catch(e){rt(e)}}function ye(e){function n(e){r.asm=e.exports,ce--,r.monitorRunDependencies&&r.monitorRunDependencies(ce),0==ce&&(null!==fe&&(clearInterval(fe),fe=null),le&&(e=le,le=null,e()))}function t(e){n(e.instance)}function i(e){return(q||!h&&!d||"function"!=typeof fetch?new Promise(function(e){e(we())}):fetch(pe,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+pe+"'";return e.arrayBuffer()}).catch(function(){return we()})).then(function(e){return WebAssembly.instantiate(e,o)}).then(e,function(e){_("failed to asynchronously prepare wasm: "+e),rt(e)})}var o={env:e,wasi_unstable:e,global:{NaN:NaN,Infinity:1/0},"global.Math":Math,asm2wasm:A};if(ce++,r.monitorRunDependencies&&r.monitorRunDependencies(ce),r.instantiateWasm)try{return r.instantiateWasm(o,n)}catch(e){return _("Module.instantiateWasm callback failed with error: "+e),!1}return function(){if(q||"function"!=typeof WebAssembly.instantiateStreaming||be()||"function"!=typeof fetch)return i(t);fetch(pe,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,o).then(t,function(e){_("wasm streaming compile failed: "+e),_("falling back to ArrayBuffer instantiation"),i(t)})})}(),{}}r.asm=function(e,n){return n.memory=O,n.table=new WebAssembly.Table({initial:2688,maximum:2688,element:"anyfunc"}),n.__memory_base=1024,n.__table_base=0,ye(n)},ee.push({jc:function(){Hn()}});var ve={};function ge(e,n){for(var t=0,r=e.length-1;0<=r;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),t++):t&&(e.splice(r,1),t--)}if(n)for(;t;t--)e.unshift("..");return e}function _e(e){var n="/"===e.charAt(0),t="/"===e.substr(-1);return(e=ge(e.split("/").filter(function(e){return!!e}),!n).join("/"))||n||(e="."),e&&t&&(e+="/"),(n?"/":"")+e}function ke(e){var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=n[0],n=n[1],e||n?(n&&(n=n.substr(0,n.length-1)),e+n):"."}function qe(e){if("/"===e)return"/";var n=e.lastIndexOf("/");return-1===n?e:e.substr(n+1)}function Ae(e,n){return _e(e+"/"+n)}function Se(e){return r.___errno_location&&(I[r.___errno_location()>>2]=e),e}function xe(){for(var e="",n=!1,t=arguments.length-1;-1<=t&&!n;t--){if("string"!=typeof(n=0<=t?arguments[t]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,n="/"===n.charAt(0)}return(n?"/":"")+(e=ge(e.split("/").filter(function(e){return!!e}),!n).join("/"))||"."}var De=[];function Ee(e,n){De[e]={input:[],output:[],yb:n},on(e,Oe)}var Oe={open:function(e){var n=De[e.node.rdev];if(!n)throw new Le(19);e.tty=n,e.seekable=!1},close:function(e){e.tty.yb.flush(e.tty)},flush:function(e){e.tty.yb.flush(e.tty)},read:function(e,n,t,r){if(!e.tty||!e.tty.yb.Vb)throw new Le(6);for(var i=0,o=0;o<r;o++){try{var a=e.tty.yb.Vb(e.tty)}catch(e){throw new Le(5)}if(void 0===a&&0===i)throw new Le(11);if(null==a)break;i++,n[t+o]=a}return i&&(e.node.timestamp=Date.now()),i},write:function(e,n,t,r){if(!e.tty||!e.tty.yb.Lb)throw new Le(6);try{for(var i=0;i<r;i++)e.tty.yb.Lb(e.tty,n[t+i])}catch(e){throw new Le(5)}return r&&(e.node.timestamp=Date.now()),i}},Me={Vb:function(e){if(!e.input.length){var n=null;if(c){var t=Buffer.ub?Buffer.ub(256):new Buffer(256),r=0,i=process.stdin.fd;if("win32"!=process.platform){var o=!1;try{i=In.openSync("/dev/stdin","r"),o=!0}catch(e){}}try{r=In.readSync(i,t,0,256,null)}catch(e){if(-1==e.toString().indexOf("EOF"))throw e;r=0}o&&In.closeSync(i),n=0<r?t.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(n=window.prompt("Input: "))&&(n+="\n"):"function"==typeof readline&&(null!==(n=readline())&&(n+="\n"));if(!n)return null;e.input=Wn(n,!0)}return e.input.shift()},Lb:function(e,n){null===n||10===n?(g(H(e.output,0)),e.output=[]):0!=n&&e.output.push(n)},flush:function(e){e.output&&0<e.output.length&&(g(H(e.output,0)),e.output=[])}},Te={Lb:function(e,n){null===n||10===n?(_(H(e.output,0)),e.output=[]):0!=n&&e.output.push(n)},flush:function(e){e.output&&0<e.output.length&&(_(H(e.output,0)),e.output=[])}},Re={pb:null,mb:function(){return Re.createNode(null,"/",16895,0)},createNode:function(e,n,t,r){if(24576==(61440&t)||4096==(61440&t))throw new Le(1);return Re.pb||(Re.pb={dir:{node:{ob:Re.fb.ob,lb:Re.fb.lb,lookup:Re.fb.lookup,zb:Re.fb.zb,rename:Re.fb.rename,unlink:Re.fb.unlink,rmdir:Re.fb.rmdir,readdir:Re.fb.readdir,symlink:Re.fb.symlink},stream:{sb:Re.ib.sb}},file:{node:{ob:Re.fb.ob,lb:Re.fb.lb},stream:{sb:Re.ib.sb,read:Re.ib.read,write:Re.ib.write,Nb:Re.ib.Nb,Db:Re.ib.Db,Eb:Re.ib.Eb}},link:{node:{ob:Re.fb.ob,lb:Re.fb.lb,readlink:Re.fb.readlink},stream:{}},Qb:{node:{ob:Re.fb.ob,lb:Re.fb.lb},stream:rn}}),Ye((t=Qe(e,n,t,r)).mode)?(t.fb=Re.pb.dir.node,t.ib=Re.pb.dir.stream,t.gb={}):32768==(61440&t.mode)?(t.fb=Re.pb.file.node,t.ib=Re.pb.file.stream,t.kb=0,t.gb=null):40960==(61440&t.mode)?(t.fb=Re.pb.link.node,t.ib=Re.pb.link.stream):8192==(61440&t.mode)&&(t.fb=Re.pb.Qb.node,t.ib=Re.pb.Qb.stream),t.timestamp=Date.now(),e&&(e.gb[n]=t),t},Uc:function(e){if(e.gb&&e.gb.subarray){for(var n=[],t=0;t<e.kb;++t)n.push(e.gb[t]);return n}return e.gb},Vc:function(e){return e.gb?e.gb.subarray?e.gb.subarray(0,e.kb):new Uint8Array(e.gb):new Uint8Array},Rb:function(e,n){var t=e.gb?e.gb.length:0;t>=n||(n=Math.max(n,t*(1048576>t?2:1.125)|0),0!=t&&(n=Math.max(n,256)),t=e.gb,e.gb=new Uint8Array(n),0<e.kb&&e.gb.set(t.subarray(0,e.kb),0))},qc:function(e,n){if(e.kb!=n)if(0==n)e.gb=null,e.kb=0;else{if(!e.gb||e.gb.subarray){var t=e.gb;e.gb=new Uint8Array(new ArrayBuffer(n)),t&&e.gb.set(t.subarray(0,Math.min(n,e.kb)))}else if(e.gb||(e.gb=[]),e.gb.length>n)e.gb.length=n;else for(;e.gb.length<n;)e.gb.push(0);e.kb=n}},fb:{ob:function(e){var n={};return n.dev=8192==(61440&e.mode)?e.id:1,n.ino=e.id,n.mode=e.mode,n.nlink=1,n.uid=0,n.gid=0,n.rdev=e.rdev,Ye(e.mode)?n.size=4096:32768==(61440&e.mode)?n.size=e.kb:40960==(61440&e.mode)?n.size=e.link.length:n.size=0,n.atime=new Date(e.timestamp),n.mtime=new Date(e.timestamp),n.ctime=new Date(e.timestamp),n.tb=4096,n.blocks=Math.ceil(n.size/n.tb),n},lb:function(e,n){void 0!==n.mode&&(e.mode=n.mode),void 0!==n.timestamp&&(e.timestamp=n.timestamp),void 0!==n.size&&Re.qc(e,n.size)},lookup:function(){throw We[2]},zb:function(e,n,t,r){return Re.createNode(e,n,t,r)},rename:function(e,n,t){if(Ye(e.mode)){try{var r=Ve(n,t)}catch(e){}if(r)for(var i in r.gb)throw new Le(39)}delete e.parent.gb[e.name],e.name=t,n.gb[t]=e,e.parent=n},unlink:function(e,n){delete e.gb[n]},rmdir:function(e,n){var t,r=Ve(e,n);for(t in r.gb)throw new Le(39);delete e.gb[n]},readdir:function(e){var n,t=[".",".."];for(n in e.gb)e.gb.hasOwnProperty(n)&&t.push(n);return t},symlink:function(e,n,t){return(e=Re.createNode(e,n,41471,0)).link=t,e},readlink:function(e){if(40960!=(61440&e.mode))throw new Le(22);return e.link}},ib:{read:function(e,n,t,r,i){var o=e.node.gb;if(i>=e.node.kb)return 0;if(8<(e=Math.min(e.node.kb-i,r))&&o.subarray)n.set(o.subarray(i,i+e),t);else for(r=0;r<e;r++)n[t+r]=o[i+r];return e},write:function(e,n,t,r,i,o){if(o=!1,!r)return 0;if((e=e.node).timestamp=Date.now(),n.subarray&&(!e.gb||e.gb.subarray)){if(o)return e.gb=n.subarray(t,t+r),e.kb=r;if(0===e.kb&&0===i)return e.gb=new Uint8Array(n.subarray(t,t+r)),e.kb=r;if(i+r<=e.kb)return e.gb.set(n.subarray(t,t+r),i),r}if(Re.Rb(e,i+r),e.gb.subarray&&n.subarray)e.gb.set(n.subarray(t,t+r),i);else for(o=0;o<r;o++)e.gb[i+o]=n[t+o];return e.kb=Math.max(e.kb,i+r),r},sb:function(e,n,t){if(1===t?n+=e.position:2===t&&32768==(61440&e.node.mode)&&(n+=e.node.kb),0>n)throw new Le(22);return n},Nb:function(e,n,t){Re.Rb(e.node,n+t),e.node.kb=Math.max(e.node.kb,n+t)},Db:function(e,n,t,r,i,o,a){if(32768!=(61440&e.node.mode))throw new Le(19);if(t=e.node.gb,2&a||t.buffer!==n&&t.buffer!==n.buffer){if((0<i||i+r<e.node.kb)&&(t=t.subarray?t.subarray(i,i+r):Array.prototype.slice.call(t,i,i+r)),e=!0,i=n.buffer==N.buffer,!(r=Yn(r)))throw new Le(12);(i?N:n).set(t,r)}else e=!1,r=t.byteOffset;return{pc:r,Gb:e}},Eb:function(e,n,t,r,i){if(32768!=(61440&e.node.mode))throw new Le(19);return 2&i?0:(Re.ib.write(e,n,0,r,t,!1),0)}}},je={Cb:!1,sc:function(){je.Cb=!!process.platform.match(/^win/);var e=process.binding("constants");e.fs&&(e=e.fs),je.Sb={1024:e.O_APPEND,64:e.O_CREAT,128:e.O_EXCL,0:e.O_RDONLY,2:e.O_RDWR,4096:e.O_SYNC,512:e.O_TRUNC,1:e.O_WRONLY}},Pb:function(e){return Buffer.alloc?Buffer.from(e):new Buffer(e)},mb:function(e){return T(f),je.createNode(null,"/",je.Ub(e.Kb.root),0)},createNode:function(e,n,t){if(!Ye(t)&&32768!=(61440&t)&&40960!=(61440&t))throw new Le(22);return(e=Qe(e,n,t)).fb=je.fb,e.ib=je.ib,e},Ub:function(e){try{var n=In.lstatSync(e);je.Cb&&(n.mode=n.mode|(292&n.mode)>>2)}catch(e){if(!e.code)throw e;throw new Le(-e.hb)}return n.mode},nb:function(e){for(var n=[];e.parent!==e;)n.push(e.name),e=e.parent;return n.push(e.mb.Kb.root),n.reverse(),function(){return _e(Array.prototype.slice.call(arguments,0).join("/"))}.apply(null,n)},ic:function(e){e&=-2656257;var n,t=0;for(n in je.Sb)e&n&&(t|=je.Sb[n],e^=n);if(e)throw new Le(22);return t},fb:{ob:function(e){e=je.nb(e);try{var n=In.lstatSync(e)}catch(e){if(!e.code)throw e;throw new Le(-e.hb)}return je.Cb&&!n.tb&&(n.tb=4096),je.Cb&&!n.blocks&&(n.blocks=(n.size+n.tb-1)/n.tb|0),{dev:n.dev,ino:n.ino,mode:n.mode,nlink:n.nlink,uid:n.uid,gid:n.gid,rdev:n.rdev,size:n.size,atime:n.atime,mtime:n.mtime,ctime:n.ctime,tb:n.tb,blocks:n.blocks}},lb:function(e,n){var t=je.nb(e);try{void 0!==n.mode&&(In.chmodSync(t,n.mode),e.mode=n.mode),void 0!==n.size&&In.truncateSync(t,n.size)}catch(e){if(!e.code)throw e;throw new Le(-e.hb)}},lookup:function(e,n){var t=Ae(je.nb(e),n);return t=je.Ub(t),je.createNode(e,n,t)},zb:function(e,n,t,r){e=je.createNode(e,n,t,r),n=je.nb(e);try{Ye(e.mode)?In.mkdirSync(n,e.mode):In.writeFileSync(n,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new Le(-e.hb)}return e},rename:function(e,n,t){e=je.nb(e),n=Ae(je.nb(n),t);try{In.renameSync(e,n)}catch(e){if(!e.code)throw e;throw new Le(-e.hb)}},unlink:function(e,n){e=Ae(je.nb(e),n);try{In.unlinkSync(e)}catch(e){if(!e.code)throw e;throw new Le(-e.hb)}},rmdir:function(e,n){e=Ae(je.nb(e),n);try{In.rmdirSync(e)}catch(e){if(!e.code)throw e;throw new Le(-e.hb)}},readdir:function(e){e=je.nb(e);try{return In.readdirSync(e)}catch(e){if(!e.code)throw e;throw new Le(-e.hb)}},symlink:function(e,n,t){e=Ae(je.nb(e),n);try{In.symlinkSync(t,e)}catch(e){if(!e.code)throw e;throw new Le(-e.hb)}},readlink:function(e){var n=je.nb(e);try{return n=In.readlinkSync(n),n=Ln.relative(Ln.resolve(e.mb.Kb.root),n)}catch(e){if(!e.code)throw e;throw new Le(-e.hb)}}},ib:{open:function(e){var n=je.nb(e.node);try{32768==(61440&e.node.mode)&&(e.Ab=In.openSync(n,je.ic(e.flags)))}catch(e){if(!e.code)throw e;throw new Le(-e.hb)}},close:function(e){try{32768==(61440&e.node.mode)&&e.Ab&&In.closeSync(e.Ab)}catch(e){if(!e.code)throw e;throw new Le(-e.hb)}},read:function(e,n,t,r,i){if(0===r)return 0;try{return In.readSync(e.Ab,je.Pb(n.buffer),t,r,i)}catch(e){throw new Le(-e.hb)}},write:function(e,n,t,r,i){try{return In.writeSync(e.Ab,je.Pb(n.buffer),t,r,i)}catch(e){throw new Le(-e.hb)}},sb:function(e,n,t){if(1===t)n+=e.position;else if(2===t&&32768==(61440&e.node.mode))try{n+=In.fstatSync(e.Ab).size}catch(e){throw new Le(-e.hb)}if(0>n)throw new Le(22);return n}}},Pe=null,ze={},Fe=[],Ne=1,Ce=null,Ue=!0,Ie={},Le=null,We={};function Be(e,n){if(n=n||{},!(e=xe("/",e)))return{path:"",node:null};var t,r={Tb:!0,Mb:0};for(t in r)void 0===n[t]&&(n[t]=r[t]);if(8<n.Mb)throw new Le(40);e=ge(e.split("/").filter(function(e){return!!e}),!1);var i=Pe;for(r="/",t=0;t<e.length;t++){var o=t===e.length-1;if(o&&n.parent)break;if(i=Ve(i,e[t]),r=Ae(r,e[t]),i.wb&&(!o||o&&n.Tb)&&(i=i.wb.root),!o||n.vb)for(o=0;40960==(61440&i.mode);)if(i=bn(r),i=Be(r=xe(ke(r),i),{Mb:n.Mb}).node,40<o++)throw new Le(40)}return{path:r,node:i}}function He(e){for(var n;;){if(e===e.parent)return e=e.mb.Wb,n?"/"!==e[e.length-1]?e+"/"+n:e+n:e;n=n?e.name+"/"+n:e.name,e=e.parent}}function Je(e,n){for(var t=0,r=0;r<n.length;r++)t=(t<<5)-t+n.charCodeAt(r)|0;return(e+t>>>0)%Ce.length}function Ge(e){var n=Je(e.parent.id,e.name);if(Ce[n]===e)Ce[n]=e.xb;else for(n=Ce[n];n;){if(n.xb===e){n.xb=e.xb;break}n=n.xb}}function Ve(e,n){var t;if(t=(t=Ze(e,"x"))?t:e.fb.lookup?0:13)throw new Le(t,e);for(t=Ce[Je(e.id,n)];t;t=t.xb){var r=t.name;if(t.parent.id===e.id&&r===n)return t}return e.fb.lookup(e,n)}function Qe(e,n,t,r){return Dn||((Dn=function(e,n,t,r){e||(e=this),this.parent=e,this.mb=e.mb,this.wb=null,this.id=Ne++,this.name=n,this.mode=t,this.fb={},this.ib={},this.rdev=r}).prototype={},Object.defineProperties(Dn.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}}})),function(e){var n=Je(e.parent.id,e.name);e.xb=Ce[n],Ce[n]=e}(e=new Dn(e,n,t,r)),e}function Ye(e){return 16384==(61440&e)}var Ke={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Xe(e){var n=["r","w","rw"][3&e];return 512&e&&(n+="w"),n}function Ze(e,n){return Ue?0:(-1===n.indexOf("r")||292&e.mode)&&(-1===n.indexOf("w")||146&e.mode)&&(-1===n.indexOf("x")||73&e.mode)?0:13}function $e(e,n){try{return Ve(e,n),17}catch(e){}return Ze(e,"wx")}function en(e,n,t){try{var r=Ve(e,n)}catch(e){return e.hb}if(e=Ze(e,"wx"))return e;if(t){if(!Ye(r.mode))return 20;if(r===r.parent||"/"===He(r))return 16}else if(Ye(r.mode))return 21;return 0}function nn(e,n){En||((En=function(){}).prototype={},Object.defineProperties(En.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}}}));var t,r=new En;for(t in e)r[t]=e[t];return e=r,n=function(e){for(e=e||0;e<=4096;e++)if(!Fe[e])return e;throw new Le(24)}(n),e.fd=n,Fe[n]=e}var tn,rn={open:function(e){e.ib=ze[e.node.rdev].ib,e.ib.open&&e.ib.open(e)},sb:function(){throw new Le(29)}};function on(e,n){ze[e]={ib:n}}function an(e,n){var t="/"===n,r=!n;if(t&&Pe)throw new Le(16);if(!t&&!r){var i=Be(n,{Tb:!1});if(n=i.path,(i=i.node).wb)throw new Le(16);if(!Ye(i.mode))throw new Le(20)}n={type:e,Kb:{},Wb:n,oc:[]},(e=e.mb(n)).mb=n,n.root=e,t?Pe=e:i&&(i.wb=n,i.mb&&i.mb.oc.push(n))}function un(e,n,t){var r=Be(e,{parent:!0}).node;if(!(e=qe(e))||"."===e||".."===e)throw new Le(22);var i=$e(r,e);if(i)throw new Le(i);if(!r.fb.zb)throw new Le(1);return r.fb.zb(r,e,n,t)}function sn(e,n){un(e,1023&(void 0!==n?n:511)|16384,0)}function cn(e,n,t){void 0===t&&(t=n,n=438),un(e,8192|n,t)}function fn(e,n){if(!xe(e))throw new Le(2);var t=Be(n,{parent:!0}).node;if(!t)throw new Le(2);var r=$e(t,n=qe(n));if(r)throw new Le(r);if(!t.fb.symlink)throw new Le(1);t.fb.symlink(t,n,e)}function ln(e){var n=Be(e,{parent:!0}).node,t=qe(e),r=Ve(n,t),i=en(n,t,!1);if(i)throw new Le(i);if(!n.fb.unlink)throw new Le(1);if(r.wb)throw new Le(16);try{Ie.willDeletePath&&Ie.willDeletePath(e)}catch(n){console.log("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+n.message)}n.fb.unlink(n,t),Ge(r);try{Ie.onDeletePath&&Ie.onDeletePath(e)}catch(n){console.log("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+n.message)}}function bn(e){if(!(e=Be(e).node))throw new Le(2);if(!e.fb.readlink)throw new Le(22);return xe(He(e.parent),e.fb.readlink(e))}function hn(e,n){if(!(e=Be(e,{vb:!n}).node))throw new Le(2);if(!e.fb.ob)throw new Le(1);return e.fb.ob(e)}function dn(e){return hn(e,!0)}function pn(e,n){var t;if(!(t="string"==typeof e?Be(e,{vb:!0}).node:e).fb.lb)throw new Le(1);t.fb.lb(t,{mode:4095&n|-4096&t.mode,timestamp:Date.now()})}function mn(e){var n;if(!(n="string"==typeof e?Be(e,{vb:!0}).node:e).fb.lb)throw new Le(1);n.fb.lb(n,{timestamp:Date.now()})}function wn(e,n){if(0>n)throw new Le(22);var t;if(!(t="string"==typeof e?Be(e,{vb:!0}).node:e).fb.lb)throw new Le(1);if(Ye(t.mode))throw new Le(21);if(32768!=(61440&t.mode))throw new Le(22);if(e=Ze(t,"w"))throw new Le(e);t.fb.lb(t,{size:n,timestamp:Date.now()})}function yn(e,n,t,i){if(""===e)throw new Le(2);if("string"==typeof n){var o=Ke[n];if(void 0===o)throw Error("Unknown file open mode: "+n);n=o}if(t=64&n?4095&(void 0===t?438:t)|32768:0,"object"==typeof e)var a=e;else{e=_e(e);try{a=Be(e,{vb:!(131072&n)}).node}catch(e){}}if(o=!1,64&n)if(a){if(128&n)throw new Le(17)}else a=un(e,t,0),o=!0;if(!a)throw new Le(2);if(8192==(61440&a.mode)&&(n&=-513),65536&n&&!Ye(a.mode))throw new Le(20);if(!o&&(t=a?40960==(61440&a.mode)?40:Ye(a.mode)&&("r"!==Xe(n)||512&n)?21:Ze(a,Xe(n)):2))throw new Le(t);512&n&&wn(a,0),n&=-641,(i=nn({node:a,path:He(a),flags:n,seekable:!0,position:0,ib:a.ib,tc:[],error:!1},i)).ib.open&&i.ib.open(i),!r.logReadFiles||1&n||(On||(On={}),e in On||(On[e]=1,console.log("FS.trackingDelegate error on read file: "+e)));try{Ie.onOpenFile&&(a=0,1!=(2097155&n)&&(a|=1),0!=(2097155&n)&&(a|=2),Ie.onOpenFile(e,a))}catch(n){console.log("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+n.message)}return i}function vn(e){if(null===e.fd)throw new Le(9);e.Jb&&(e.Jb=null);try{e.ib.close&&e.ib.close(e)}catch(e){throw e}finally{Fe[e.fd]=null}e.fd=null}function gn(e,n,t){if(null===e.fd)throw new Le(9);if(!e.seekable||!e.ib.sb)throw new Le(29);if(0!=t&&1!=t&&2!=t)throw new Le(22);e.position=e.ib.sb(e,n,t),e.tc=[]}function _n(e,n,t,r,i){if(0>r||0>i)throw new Le(22);if(null===e.fd)throw new Le(9);if(1==(2097155&e.flags))throw new Le(9);if(Ye(e.node.mode))throw new Le(21);if(!e.ib.read)throw new Le(22);var o=void 0!==i;if(o){if(!e.seekable)throw new Le(29)}else i=e.position;return n=e.ib.read(e,n,t,r,i),o||(e.position+=n),n}function kn(e,n,t,r,i,o){if(0>r||0>i)throw new Le(22);if(null===e.fd)throw new Le(9);if(0==(2097155&e.flags))throw new Le(9);if(Ye(e.node.mode))throw new Le(21);if(!e.ib.write)throw new Le(22);1024&e.flags&&gn(e,0,2);var a=void 0!==i;if(a){if(!e.seekable)throw new Le(29)}else i=e.position;n=e.ib.write(e,n,t,r,i,o),a||(e.position+=n);try{e.path&&Ie.onWriteToFile&&Ie.onWriteToFile(e.path)}catch(n){console.log("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+n.message)}return n}function qn(){Le||((Le=function(e,n){this.node=n,this.rc=function(e){this.hb=e},this.rc(e),this.message="FS error"}).prototype=Error(),Le.prototype.constructor=Le,[2].forEach(function(e){We[e]=new Le(e),We[e].stack="<generic error, no stack>"}))}function An(e,n){var t=0;return e&&(t|=365),n&&(t|=146),t}function Sn(e,n,t){e=Ae("/dev",e);var r=An(!!n,!!t);xn||(xn=64);var i=xn++<<8|0;on(i,{open:function(e){e.seekable=!1},close:function(){t&&t.buffer&&t.buffer.length&&t(10)},read:function(e,t,r,i){for(var o=0,a=0;a<i;a++){try{var u=n()}catch(e){throw new Le(5)}if(void 0===u&&0===o)throw new Le(11);if(null==u)break;o++,t[r+a]=u}return o&&(e.node.timestamp=Date.now()),o},write:function(e,n,r,i){for(var o=0;o<i;o++)try{t(n[r+o])}catch(e){throw new Le(5)}return i&&(e.node.timestamp=Date.now()),o}}),cn(e,r,i)}var xn,Dn,En,On,Mn={},Tn={};function Rn(e,n,t){try{var r=e(n)}catch(e){if(e&&e.node&&_e(n)!==_e(He(e.node)))return-20;throw e}return I[t>>2]=r.dev,I[t+4>>2]=0,I[t+8>>2]=r.ino,I[t+12>>2]=r.mode,I[t+16>>2]=r.nlink,I[t+20>>2]=r.uid,I[t+24>>2]=r.gid,I[t+28>>2]=r.rdev,I[t+32>>2]=0,de=[r.size>>>0,(he=r.size,1<=+oe(he)?0<he?(0|se(+ue(he/4294967296),4294967295))>>>0:~~+ae((he-+(~~he>>>0))/4294967296)>>>0:0)],I[t+40>>2]=de[0],I[t+44>>2]=de[1],I[t+48>>2]=4096,I[t+52>>2]=r.blocks,I[t+56>>2]=r.atime.getTime()/1e3|0,I[t+60>>2]=0,I[t+64>>2]=r.mtime.getTime()/1e3|0,I[t+68>>2]=0,I[t+72>>2]=r.ctime.getTime()/1e3|0,I[t+76>>2]=0,de=[r.ino>>>0,(he=r.ino,1<=+oe(he)?0<he?(0|se(+ue(he/4294967296),4294967295))>>>0:~~+ae((he-+(~~he>>>0))/4294967296)>>>0:0)],I[t+80>>2]=de[0],I[t+84>>2]=de[1],0}var jn,Pn=0;function zn(){return I[(Pn+=4)-4>>2]}function Fn(){return J(zn())}function Nn(){var e=Fe[zn()];if(!e)throw new Le(9);return e}function Cn(){return N.length}function Un(e){if(e/=1e3,(h||d)&&self.performance&&self.performance.now)for(var n=self.performance.now();self.performance.now()-n<e;);else for(n=Date.now();Date.now()-n<e;);return 0}if(G("GMT",C,60208,4),r._usleep=Un,qn(),Ce=Array(4096),an(Re,"/"),sn("/tmp"),sn("/home"),sn("/home/web_user"),function(){if(sn("/dev"),on(259,{read:function(){return 0},write:function(e,n,t,r){return r}}),cn("/dev/null",259),Ee(1280,Me),Ee(1536,Te),cn("/dev/tty",1280),cn("/dev/tty1",1536),"object"==typeof crypto&&"function"==typeof crypto.getRandomValues)var e=new Uint8Array(1),n=function(){return crypto.getRandomValues(e),e[0]};else if(c)try{var t=require("crypto");n=function(){return t.randomBytes(1)[0]}}catch(e){}n||(n=function(){rt("random_device")}),Sn("random",n),Sn("urandom",n),sn("/dev/shm"),sn("/dev/shm/tmp")}(),sn("/proc"),sn("/proc/self"),sn("/proc/self/fd"),an({mb:function(){var e=Qe("/proc/self","fd",16895,73);return e.fb={lookup:function(e,n){var t=Fe[+n];if(!t)throw new Le(9);return(e={parent:null,mb:{Wb:"fake"},fb:{readlink:function(){return t.path}}}).parent=e}},e}},"/proc/self/fd"),f){var In=require("fs"),Ln=require("path");je.sc()}function Wn(e,n){var t=Array(V(e)+1);return e=G(e,t,0,t.length),n&&(t.length=e),t}var Bn=r.asm({},{n:rt,l:function(e){return x[e]()},i:function(e,n){return x[e](n)},h:function(e,n,t){return x[e](n,t)},g:function(e,n,t,r){return x[e](n,t,r)},f:function(e,n,t,r,i){return x[e](n,t,r,i)},e:function(e,n,t,r,i,o){return x[e](n,t,r,i,o)},d:function(e,n,t,r,i,o,a){return x[e](n,t,r,i,o,a)},C:function(e,n,t,r,i,o,a){return x[e](n,t,r,i,o,a)},B:function(e,n,t,r,i){return x[e](n,t,r,i)},A:function(e,n,t){return x[e](n,t)},z:function(e,n,t,r){return x[e](n,t,r)},y:function(e,n,t,r,i){return x[e](n,t,r,i)},c:function(e,n){x[e](n)},b:function(e,n,t){x[e](n,t)},k:function(e,n,t,r){x[e](n,t,r)},j:function(e,n,t,r,i){x[e](n,t,r,i)},x:function(e,n,t,r,i,o){x[e](n,t,r,i,o)},w:function(e,n,t,r){x[e](n,t,r)},v:function(e,n,t,r){x[e](n,t,r)},m:function(e,n,t,r){rt("Assertion failed: "+J(e)+", at: "+[n?J(n):"unknown filename",t,r?J(r):"unknown function"])},ha:function e(n){if(e.ub)var t=I[n>>2],r=I[t>>2];else e.ub=!0,ve.USER=ve.LOGNAME="web_user",ve.PATH="/",ve.PWD="/",ve.HOME="/home/web_user",ve.LANG=("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",ve._=b,r=re?Yn(1024):k(1024),t=re?Yn(256):k(256),I[t>>2]=r,I[n>>2]=t;n=[];var i,o=0;for(i in ve)if("string"==typeof ve[i]){var a=i+"="+ve[i];n.push(a),o+=a.length}if(1024<o)throw Error("Environment size exceeded TOTAL_ENV_SIZE!");for(i=0;i<n.length;i++){o=a=n[i];for(var u=r,s=0;s<o.length;++s)N[u++>>0]=o.charCodeAt(s);N[u>>0]=0,I[t+4*i>>2]=r,r+=a.length+1}I[t+4*n.length>>2]=0},u:Se,ga:function(e,n){Pn=n;try{return ln(Fn()),0}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},fa:function(e,n){Pn=n;try{var t=Nn();return t.ib&&t.ib.fsync?-t.ib.fsync(t):0}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},ea:function(e,n){Pn=n;try{var t=Nn(),r=zn(),i=zn(),o=zn(),a=zn();return-9007199254740992>=(e=4294967296*r+(i>>>0))||9007199254740992<=e?-75:(gn(t,e,a),de=[t.position>>>0,(he=t.position,1<=+oe(he)?0<he?(0|se(+ue(he/4294967296),4294967295))>>>0:~~+ae((he-+(~~he>>>0))/4294967296)>>>0:0)],I[o>>2]=de[0],I[o+4>>2]=de[1],t.Jb&&0===e&&0===a&&(t.Jb=null),0)}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},da:function(e,n){Pn=n;try{return pn(Fn(),zn()),0}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},ca:function(e,n){Pn=n;try{var t=zn(),r=zn();return 0===r?-22:r<V("/")+1?-34:(G("/",C,t,r),t)}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},ba:function(e,n){Pn=n;try{var t=zn(),r=zn(),i=zn(),o=zn(),a=zn();e:{var u=zn();if(u<<=12,e=!1,0!=(16&o)&&0!=t%16384)var s=-22;else{if(0!=(32&o)){var c=Kn(16384,r);if(!c){s=-12;break e}Xn(c,0,r),e=!0}else{var f=Fe[a];if(!f){s=-9;break e}if(n=C,0!=(2&i)&&0==(2&o)&&2!=(2097155&f.flags))throw new Le(13);if(1==(2097155&f.flags))throw new Le(13);if(!f.ib.Db)throw new Le(19);var l=f.ib.Db(f,n,t,r,u,i,o);c=l.pc,e=l.Gb}Tn[c]={nc:c,mc:r,Gb:e,fd:a,flags:o},s=c}}return s}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},aa:function(e,n){Pn=n;try{var t=zn();zn();var r=zn();zn();var i=Fe[t];if(!i)throw new Le(9);if(0==(2097155&i.flags))throw new Le(22);return wn(i.node,r),0}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},t:function(e,n){Pn=n;try{return Rn(hn,Fn(),zn())}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},$:function(e,n){Pn=n;try{return Rn(dn,Fn(),zn())}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},_:function(e,n){Pn=n;try{var t=Nn(),r=zn();return Rn(hn,t.path,r)}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},Z:function(e,n){return Pn=n,42},Y:function(e,n){return Pn=n,0},X:function(e,n){Pn=n;try{var t=zn();zn(),zn();var r=Fe[t];if(!r)throw new Le(9);return mn(r.node),0}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},W:function(e,n){Pn=n;try{var t=Fn();return zn(),zn(),mn(t),0}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},o:function(e,n){Pn=n;try{var t=Nn();switch(zn()){case 0:var r=zn();return 0>r?-22:yn(t.path,t.flags,0,r).fd;case 1:case 2:return 0;case 3:return t.flags;case 4:return r=zn(),t.flags|=r,0;case 12:return r=zn(),U[r+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-22;case 9:return Se(22),-1;default:return-22}}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},V:function(e,n){Pn=n;try{var t=Nn(),r=zn(),i=zn();return _n(t,N,r,i)}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},U:function(e,n){Pn=n;try{var t,r=Fn(),i=zn();if(-8&i)var o=-22;else(t=Be(r,{vb:!0}).node)?(e="",4&i&&(e+="r"),2&i&&(e+="w"),1&i&&(e+="x"),o=e&&Ze(t,e)?-13:0):o=-2;return o}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},T:function(e,n){Pn=n;try{var t=Fn(),r=zn();return"/"===(e=_e(e=t))[e.length-1]&&(e=e.substr(0,e.length-1)),sn(e,r),0}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},S:function(e,n){Pn=n;try{var t=Nn(),r=zn(),i=zn();return kn(t,N,r,i)}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},R:function(e,n){Pn=n;try{var t=Fn(),r=Be(t,{parent:!0}).node,i=qe(t),o=Ve(r,i),a=en(r,i,!0);if(a)throw new Le(a);if(!r.fb.rmdir)throw new Le(1);if(o.wb)throw new Le(16);try{Ie.willDeletePath&&Ie.willDeletePath(t)}catch(e){console.log("FS.trackingDelegate['willDeletePath']('"+t+"') threw an exception: "+e.message)}r.fb.rmdir(r,i),Ge(o);try{Ie.onDeletePath&&Ie.onDeletePath(t)}catch(e){console.log("FS.trackingDelegate['onDeletePath']('"+t+"') threw an exception: "+e.message)}return 0}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},Q:function(e,n){Pn=n;try{return yn(Fn(),zn(),zn()).fd}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},s:function(e,n){Pn=n;try{return vn(Nn()),0}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},P:function(e,n){Pn=n;try{var t=Fn(),r=zn(),i=zn();if(0>=i)var o=-22;else{var a=bn(t),u=Math.min(i,V(a)),s=N[r+u];G(a,C,r,i+1),N[r+u]=s,o=u}return o}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},O:function(e,n){Pn=n;try{var t=zn(),r=zn();if(-1===t||0===r)var i=-22;else{var o=Tn[t];if(o&&r===o.mc){var a=Fe[o.fd],u=o.flags,s=new Uint8Array(C.subarray(t,t+r));a&&a.ib.Eb&&a.ib.Eb(a,s,0,r,u),Tn[t]=null,o.Gb&&Qn(o.nc)}i=0}return i}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},N:function(e,n){Pn=n;try{var t=zn(),r=zn(),i=Fe[t];if(!i)throw new Le(9);return pn(i.node,r),0}catch(e){return void 0!==Mn&&e instanceof Le||rt(e),-e.hb}},M:Cn,L:function(e,n,t){C.set(C.subarray(n,n+t),e)},K:function(e){if(2147418112<e)return!1;for(var n=Math.max(Cn(),16777216);n<e;)n=536870912>=n?Q(2*n):Math.min(Q((3*n+2147483648)/4),2147418112);e:{try{O.grow(n-F.byteLength+65535>>16),Y(O.buffer);var t=1;break e}catch(e){}t=void 0}return!!t},r:function e(n){if(0===n)return 0;if(n=J(n),!ve.hasOwnProperty(n))return 0;e.ub&&Qn(e.ub);var t=V(n=ve[n])+1,r=Yn(t);return r&&G(n,N,r,t),e.ub=r,e.ub},q:function(e){var n=Date.now();return I[e>>2]=n/1e3|0,I[e+4>>2]=n%1e3*1e3|0,0},J:function(e){return Math.log(e)/Math.LN10},p:function(){rt("trap!")},I:function(e){!function(){function e(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}if(!jn){jn=!0,I[Gn()>>2]=60*(new Date).getTimezoneOffset();var n=new Date(2e3,0,1),t=new Date(2e3,6,1);I[Jn()>>2]=Number(n.getTimezoneOffset()!=t.getTimezoneOffset());var r=e(n),i=e(t);r=z(Wn(r)),i=z(Wn(i)),t.getTimezoneOffset()<n.getTimezoneOffset()?(I[Vn()>>2]=r,I[Vn()+4>>2]=i):(I[Vn()>>2]=i,I[Vn()+4>>2]=r)}}(),e=new Date(1e3*I[e>>2]),I[15040]=e.getSeconds(),I[15041]=e.getMinutes(),I[15042]=e.getHours(),I[15043]=e.getDate(),I[15044]=e.getMonth(),I[15045]=e.getFullYear()-1900,I[15046]=e.getDay();var n=new Date(e.getFullYear(),0,1);I[15047]=(e.getTime()-n.getTime())/864e5|0,I[15049]=-60*e.getTimezoneOffset();var t=new Date(2e3,6,1).getTimezoneOffset();return e=0|(t!=(n=n.getTimezoneOffset())&&e.getTimezoneOffset()==Math.min(n,t)),I[15048]=e,e=I[Vn()+(e?4:0)>>2],I[15050]=e,60160},H:function(e,n){if(0===e)return Se(22),-1;var t=I[e>>2];return 0>(e=I[e+4>>2])||999999999<e||0>t?(Se(22),-1):(0!==n&&(I[n>>2]=0,I[n+4>>2]=0),Un(1e6*t+e/1e3))},G:function(e){switch(e){case 30:return 16384;case 85:return 131068;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return Se(22),-1},F:function(e){var n=Date.now()/1e3|0;return e&&(I[e>>2]=n),n},E:function(e,n){if(n){var t=1e3*I[n+8>>2];t+=I[n+12>>2]/1e3}else t=Date.now();e=J(e);try{n=t;var i=Be(e,{vb:!0}).node;return i.fb.lb(i,{timestamp:Math.max(n,t)}),0}catch(n){if(!((e=n)instanceof Le)){e+=" : ";e:{if(!(i=Error()).stack){try{throw Error(0)}catch(e){i=e}if(!i.stack){i="(no stack trace available)";break e}}i=i.stack.toString()}throw r.extraStackTrace&&(i+="\n"+r.extraStackTrace()),i=function(e){return e.replace(/\b__Z[\w\d_]+/g,function(e){return e==e?e:e+" ["+e+"]"})}(i),e+i}return Se(e.hb),-1}},D:function(){rt("OOM")},a:K},F);r.asm=Bn,r._RegisterExtensionFunctions=function(){return r.asm.ia.apply(null,arguments)};var Hn=r.___emscripten_environ_constructor=function(){return r.asm.ja.apply(null,arguments)};r.___errno_location=function(){return r.asm.ka.apply(null,arguments)};var Jn=r.__get_daylight=function(){return r.asm.la.apply(null,arguments)},Gn=r.__get_timezone=function(){return r.asm.ma.apply(null,arguments)},Vn=r.__get_tzname=function(){return r.asm.na.apply(null,arguments)},Qn=r._free=function(){return r.asm.oa.apply(null,arguments)},Yn=r._malloc=function(){return r.asm.pa.apply(null,arguments)},Kn=r._memalign=function(){return r.asm.qa.apply(null,arguments)},Xn=r._memset=function(){return r.asm.ra.apply(null,arguments)};r._sqlite3_bind_blob=function(){return r.asm.sa.apply(null,arguments)},r._sqlite3_bind_double=function(){return r.asm.ta.apply(null,arguments)},r._sqlite3_bind_int=function(){return r.asm.ua.apply(null,arguments)},r._sqlite3_bind_parameter_index=function(){return r.asm.va.apply(null,arguments)},r._sqlite3_bind_text=function(){return r.asm.wa.apply(null,arguments)},r._sqlite3_changes=function(){return r.asm.xa.apply(null,arguments)},r._sqlite3_clear_bindings=function(){return r.asm.ya.apply(null,arguments)},r._sqlite3_close_v2=function(){return r.asm.za.apply(null,arguments)},r._sqlite3_column_blob=function(){return r.asm.Aa.apply(null,arguments)},r._sqlite3_column_bytes=function(){return r.asm.Ba.apply(null,arguments)},r._sqlite3_column_double=function(){return r.asm.Ca.apply(null,arguments)},r._sqlite3_column_name=function(){return r.asm.Da.apply(null,arguments)},r._sqlite3_column_text=function(){return r.asm.Ea.apply(null,arguments)},r._sqlite3_column_type=function(){return r.asm.Fa.apply(null,arguments)},r._sqlite3_create_function_v2=function(){return r.asm.Ga.apply(null,arguments)},r._sqlite3_data_count=function(){return r.asm.Ha.apply(null,arguments)},r._sqlite3_errmsg=function(){return r.asm.Ia.apply(null,arguments)},r._sqlite3_exec=function(){return r.asm.Ja.apply(null,arguments)},r._sqlite3_finalize=function(){return r.asm.Ka.apply(null,arguments)},r._sqlite3_free=function(){return r.asm.La.apply(null,arguments)},r._sqlite3_open=function(){return r.asm.Ma.apply(null,arguments)},r._sqlite3_prepare_v2=function(){return r.asm.Na.apply(null,arguments)},r._sqlite3_reset=function(){return r.asm.Oa.apply(null,arguments)},r._sqlite3_result_blob=function(){return r.asm.Pa.apply(null,arguments)},r._sqlite3_result_double=function(){return r.asm.Qa.apply(null,arguments)},r._sqlite3_result_error=function(){return r.asm.Ra.apply(null,arguments)},r._sqlite3_result_int=function(){return r.asm.Sa.apply(null,arguments)},r._sqlite3_result_int64=function(){return r.asm.Ta.apply(null,arguments)},r._sqlite3_result_null=function(){return r.asm.Ua.apply(null,arguments)},r._sqlite3_result_text=function(){return r.asm.Va.apply(null,arguments)},r._sqlite3_step=function(){return r.asm.Wa.apply(null,arguments)},r._sqlite3_value_blob=function(){return r.asm.Xa.apply(null,arguments)},r._sqlite3_value_bytes=function(){return r.asm.Ya.apply(null,arguments)},r._sqlite3_value_double=function(){return r.asm.Za.apply(null,arguments)},r._sqlite3_value_int=function(){return r.asm._a.apply(null,arguments)},r._sqlite3_value_text=function(){return r.asm.$a.apply(null,arguments)},r._sqlite3_value_type=function(){return r.asm.ab.apply(null,arguments)};var Zn,$n=r.stackAlloc=function(){return r.asm.cb.apply(null,arguments)},et=r.stackRestore=function(){return r.asm.db.apply(null,arguments)},nt=r.stackSave=function(){return r.asm.eb.apply(null,arguments)};function tt(){function e(){if(!Zn&&(Zn=!0,!M)){if(re=!0,r.noFSInit||tn||(tn=!0,qn(),r.stdin=r.stdin,r.stdout=r.stdout,r.stderr=r.stderr,r.stdin?Sn("stdin",r.stdin):fn("/dev/tty","/dev/stdin"),r.stdout?Sn("stdout",null,r.stdout):fn("/dev/tty","/dev/stdout"),r.stderr?Sn("stderr",null,r.stderr):fn("/dev/tty1","/dev/stderr"),yn("/dev/stdin","r"),yn("/dev/stdout","w"),yn("/dev/stderr","w")),Z(ee),Ue=!1,Z(ne),r.onRuntimeInitialized&&r.onRuntimeInitialized(),r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;){var e=r.postRun.shift();te.unshift(e)}Z(te)}}if(!(0<ce)){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)ie();Z($),0<ce||(r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),e()},1)):e())}}function rt(e){throw r.onAbort&&r.onAbort(e),g(e),_(e),M=!0,"abort("+e+"). Build with -s ASSERTIONS=1 for more info."}if(r.dynCall_vi=function(){return r.asm.bb.apply(null,arguments)},r.asm=Bn,r.cwrap=function(e,n,t,r){var i=(t=t||[]).every(function(e){return"number"===e});return"string"!==n&&i&&!r?R(e):function(){return function(e,n,t,r){var i={string:function(e){var n=0;if(null!=e&&0!==e){var t=1+(e.length<<2);n=$n(t),G(e,C,n,t)}return n},array:function(e){var n=$n(e.length);return N.set(e,n),n}},o=R(e),a=[];if(e=0,r)for(var u=0;u<r.length;u++){var s=i[t[u]];s?(0===e&&(e=nt()),a[u]=s(r[u])):a[u]=r[u]}return t=function(e){return"string"===n?J(e):"boolean"===n?!!e:e}(t=o.apply(null,a)),0!==e&&et(e),t}(e,n,t,arguments)}},r.stackSave=nt,r.stackRestore=et,r.stackAlloc=$n,le=function e(){Zn||tt(),Zn||(le=e)},r.run=tt,r.abort=rt,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();return tt(),i}))};"object"==typeof exports&&"object"==typeof module?(module.exports=initSqlJs,module.exports.default=initSqlJs):"function"==typeof define&&define.amd?define([],function(){return initSqlJs}):"object"==typeof exports&&(exports.Module=initSqlJs),"function"==typeof importScripts&&(db=null,createDb=function(e){return null!=db&&db.close(),db=new SQL.Database(e)},sqlModuleReady=initSqlJs(),self.onmessage=function(e){return sqlModuleReady.then(function(){var n,t,r,i,o;switch(null!=(r=e.data)?r.action:void 0){case"open":return n=r.buffer,createDb(n?new Uint8Array(n):void 0),postMessage({id:r.id,ready:!0});case"exec":if(null===db&&createDb(),!r.sql)throw"exec: Missing query string";return postMessage({id:r.id,results:db.exec(r.sql)});case"each":return null===db&&createDb(),t=function(e){return postMessage({id:r.id,row:e,finished:!1})},i=function(){return postMessage({id:r.id,finished:!0})},db.each(r.sql,r.params,t,i);case"export":n=db.export(),o={id:r.id,buffer:n};try{return postMessage(o,[o])}catch(e){return e,postMessage(o)}break;case"close":return null!=db?db.close():void 0;default:throw new"Invalid action : "+(null!=r?r.action:void 0)}})});