PageSourceSearch

https://www.dingdangbox.com/_nuxt/CGInAIUG.js

js dingdangbox.com collected 2026-10-02 01:29:02 UTC 200,803 bytes, 3 lines download raw bytes

1var ir=Object.defineProperty;var Rt=se=>{throw TypeError(se)};var or=(se,Z,fe)=>Z in se?ir(se,Z,{enumerable:!0,configurable:!0,writable:!0,value:fe}):se[Z]=fe;var Nt=(se,Z,fe)=>or(se,typeof Z!="symbol"?Z+"":Z,fe),ht=(se,Z,fe)=>Z.has(se)||Rt("Cannot "+fe);var Y=(se,Z,fe)=>(ht(se,Z,"read from private field"),fe?fe.call(se):Z.get(se)),Ae=(se,Z,fe)=>Z.has(se)?Rt("Cannot add the same private member more than once"):Z instanceof WeakSet?Z.add(se):Z.set(se,fe),Te=(se,Z,fe,i)=>(ht(se,Z,"write to private field"),i?i.call(se,fe):Z.set(se,fe),fe),it=(se,Z,fe)=>(ht(se,Z,"access private method"),fe);import"./DAup7qnY.js";var jt=(()=>{var se=import.meta.url;return function(Z={}){var fe,i=Z,ye,ve,ke=new Promise((e,t)=>{ye=e,ve=t}),Ne=typeof window=="object",Oe=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";const Pe=globalThis.sqlite3InitModuleState||Object.assign(Object.create(null),{debugModule:()=>{}});delete globalThis.sqlite3InitModuleState,Pe.debugModule("globalThis.location =",globalThis.location);var $e=Object.assign({},i),ne="./this.program",qe="";function Le(e){return i.locateFile?i.locateFile(e,qe):qe+e}var Me,We;(Ne||Oe)&&(Oe?qe=self.location.href:typeof document<"u"&&document.currentScript&&(qe=document.currentScript.src),se&&(qe=se),qe.startsWith("blob:")?qe="":qe=qe.substr(0,qe.replace(/[?#].*/,"").lastIndexOf("/")+1),Oe&&(We=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Me=e=>fetch(e,{credentials:"same-origin"}).then(t=>t.ok?t.arrayBuffer():Promise.reject(new Error(t.status+" : "+t.url))));var Ke=i.print||console.log.bind(console),je=i.printErr||console.error.bind(console);Object.assign(i,$e),$e=null,i.arguments&&i.arguments,i.thisProgram&&(ne=i.thisProgram);var et=i.wasmBinary,Be,gt=!1,Se,Qe,Je,de,we,Ce;function qt(){var e=Be.buffer;i.HEAP8=Se=new Int8Array(e),i.HEAP16=Je=new Int16Array(e),i.HEAPU8=Qe=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAP32=de=new Int32Array(e),i.HEAPU32=we=new Uint32Array(e),i.HEAPF32=new Float32Array(e),i.HEAPF64=new Float64Array(e),i.HEAP64=Ce=new BigInt64Array(e),i.HEAPU64=new BigUint64Array(e)}if(i.wasmMemory)Be=i.wasmMemory;else{var Mt=i.INITIAL_MEMORY||16777216;Be=new WebAssembly.Memory({initial:Mt/65536,maximum:32768})}qt();var bt=[],yt=[],wt=[];function Bt(){var e=i.preRun;e&&(typeof e=="function"&&(e=[e]),e.forEach(Wt)),_t(bt)}function Ut(){!i.noFSInit&&!a.initialized&&a.init(),a.ignorePermissions=!1,_t(yt)}function zt(){var e=i.postRun;e&&(typeof e=="function"&&(e=[e]),e.forEach(Ht)),_t(wt)}function Wt(e){bt.unshift(e)}function Qt(e){yt.unshift(e)}function Ht(e){wt.unshift(e)}var Ue=0,Xe=null;function ar(e){return e}function lt(e){var t;Ue++,(t=i.monitorRunDependencies)==null||t.call(i,Ue)}function tt(e){var n;if(Ue--,(n=i.monitorRunDependencies)==null||n.call(i,Ue),Ue==0&&Xe){var t=Xe;Xe=null,t()}}function at(e){var n;(n=i.onAbort)==null||n.call(i,e),e="Aborted("+e+")",je(e),gt=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw ve(t),t}var Vt="data:application/octet-stream;base64,",Et=e=>e.startsWith(Vt);function Gt(){if(i.locateFile){var e="sqlite3.wasm";return Et(e)?e:Le(e)}return new URL(""+new URL("sqlite3.WT1HU0S9.wasm",import.meta.url).href,import.meta.url).href}var ct;function vt(e){if(e==ct&&et)return new Uint8Array(et);if(We)return We(e);throw"both async and sync fetching of the wasm failed"}function $t(e){return et?Promise.resolve().then(()=>vt(e)):Me(e).then(t=>new Uint8Array(t),()=>vt(e))}function xt(e,t,n){return $t(e).then(r=>WebAssembly.instantiate(r,t)).then(n,r=>{je(`failed to asynchronously prepare wasm: ${r}`),at(r)})}function Kt(e,t,n,r){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!Et(t)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(s=>{var o=WebAssembly.instantiateStreaming(s,n);return o.then(r,function(d){return je(`wasm streaming compile failed: ${d}`),je("falling back to ArrayBuffer instantiation"),xt(t,n,r)})}):xt(t,n,r)}function Jt(){return{env:Ot,wasi_snapshot_preview1:Ot}}function Xt(){var e=Jt();function t(r,s){return m=r.exports,Qt(m.__wasm_call_ctors),tt(),m}lt();function n(r){t(r.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(r){je(`Module.instantiateWasm callback failed with error: ${r}`),ve(r)}
vendor: 4,587 bytes, lines 1-2
1return ct??(ct=Gt()),Kt(et,ct,e,n).catch(ve),{}}var _t=e=>{e.forEach(t=>t(i))};i.noExitRuntime;var ge={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return t.exec(e).slice(1)},normalizeArray:(e,t)=>{for(var n=0,r=e.length-1;r>=0;r--){var s=e[r];s==="."?e.splice(r,1):s===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n;n--)e.unshift("..");return e},normalize:e=>{var t=ge.isAbs(e),n=e.substr(-1)==="/";return e=ge.normalizeArray(e.split("/").filter(r=>!!r),!t).join("/"),!e&&!t&&(e="."),e&&n&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=ge.splitPath(e),n=t[0],r=t[1];return!n&&!r?".":(r&&(r=r.substr(0,r.length-1)),n+r)},basename:e=>{if(e==="/")return"/";e=ge.normalize(e),e=e.replace(/\/$/,"");var t=e.lastIndexOf("/");return t===-1?e:e.substr(t+1)},join:(...e)=>ge.normalize(e.join("/")),join2:(e,t)=>ge.normalize(e+"/"+t)},Yt=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return e=>crypto.getRandomValues(e);at("initRandomDevice")},St=e=>(St=Yt())(e),De={resolve:(...e)=>{for(var t="",n=!1,r=e.length-1;r>=-1&&!n;r--){var s=r>=0?e[r]:a.cwd();if(typeof s!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!s)return"";t=s+"/"+t,n=ge.isAbs(s)}return t=ge.normalizeArray(t.split("/").filter(o=>!!o),!n).join("/"),(n?"/":"")+t||"."},relative:(e,t)=>{e=De.resolve(e).substr(1),t=De.resolve(t).substr(1);function n(C){for(var Q=0;Q<C.length&&C[Q]==="";Q++);for(var V=C.length-1;V>=0&&C[V]==="";V--);return Q>V?[]:C.slice(Q,V-Q+1)}for(var r=n(e.split("/")),s=n(t.split("/")),o=Math.min(r.length,s.length),d=o,q=0;q<o;q++)if(r[q]!==s[q]){d=q;break}for(var L=[],q=d;q<r.length;q++)L.push("..");return L=L.concat(s.slice(d)),L.join("/")}},At=typeof TextDecoder<"u"?new TextDecoder:void 0,He=(e,t=0,n=NaN)=>{for(var r=t+n,s=t;e[s]&&!(s>=r);)++s;if(s-t>16&&e.buffer&&At)return At.decode(e.subarray(t,s));for(var o="";t<s;){var d=e[t++];if(!(d&128)){o+=String.fromCharCode(d);continue}var q=e[t++]&63;if((d&224)==192){o+=String.fromCharCode((d&31)<<6|q);continue}var L=e[t++]&63;if((d&240)==224?d=(d&15)<<12|q<<6|L:d=(d&7)<<18|q<<12|L<<6|e[t++]&63,d<65536)o+=String.fromCharCode(d);else{var C=d-65536;o+=String.fromCharCode(55296|C>>10,56320|C&1023)}}return o},ut=[],nt=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t},ft=(e,t,n,r)=>{if(!(r>0))return 0;for(var s=n,o=n+r-1,d=0;d<e.length;++d){var q=e.charCodeAt(d);if(q>=55296&&q<=57343){var L=e.charCodeAt(++d);q=65536+((q&1023)<<10)|L&1023}if(q<=127){if(n>=o)break;t[n++]=q}else if(q<=2047){if(n+1>=o)break;t[n++]=192|q>>6,t[n++]=128|q&63}else if(q<=65535){if(n+2>=o)break;t[n++]=224|q>>12,t[n++]=128|q>>6&63,t[n++]=128|q&63}else{if(n+3>=o)break;t[n++]=240|q>>18,t[n++]=128|q>>12&63,t[n++]=128|q>>6&63,t[n++]=128|q&63}}return t[n]=0,n-s};function It(e,t,n){var r=nt(e)+1,s=new Array(r),o=ft(e,s,0,s.length);return s.length=o,s}var Zt=()=>{if(!ut.length){var e=null;if(typeof window<"u"&&typeof window.prompt=="function"&&(e=window.prompt("Input: "),e!==null&&(e+=`
2`)),!e)return null;ut=It(e)}return ut.shift()},ze={ttys:[],init(){},shutdown(){},register(e,t){ze.ttys[e]={input:[],output:[],ops:t},a.registerDevice(e,ze.stream_ops)},stream_ops:{open(e){var t=ze.ttys[e.node.rdev];if(!t)throw new a.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,n,r,s){if(!e.tty||!e.tty.ops.get_char)throw new a.ErrnoError(60);for(var o=0,d=0;d<r;d++){var q;try{q=e.tty.ops.get_char(e.tty)}catch{throw new a.ErrnoError(29)}if(q===void 0&&o===0)throw new a.ErrnoError(6);if(q==null)break;o++,t[n+d]=q}return o&&(e.node.timestamp=Date.now()),o},write(e,t,n,r,s){if(!e.tty||!e.tty.ops.put_char)throw new a.ErrnoError(60);try{for(var o=0;o<r;o++)e.tty.ops.put_char(e.tty,t[n+o])}catch{throw new a.ErrnoError(29)}return r&&(e.node.timestamp=Date.now()),o}},default_tty_ops:{get_char(e){return Zt()},put_char(e,t){t===null||t===10?(Ke(He(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(Ke(He(e.output)),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,t,n){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,t){t===null||t===10?(je(He(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(je(He(e.output)),e.output=[])}}},en=(e,t)=>{Qe.fill(0,e,e+t)},kt=(e,t)=>
vendor: 23,234 bytes, line 2
2Math.ceil(e/t)*t,Tt=e=>{e=kt(e,65536);var t=Pt(65536,e);return t&&en(t,e),t},le={ops_table:null,mount(e){return le.createNode(null,"/",16895,0)},createNode(e,t,n,r){if(a.isBlkdev(n)||a.isFIFO(n))throw new a.ErrnoError(63);le.ops_table||(le.ops_table={dir:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr,lookup:le.node_ops.lookup,mknod:le.node_ops.mknod,rename:le.node_ops.rename,unlink:le.node_ops.unlink,rmdir:le.node_ops.rmdir,readdir:le.node_ops.readdir,symlink:le.node_ops.symlink},stream:{llseek:le.stream_ops.llseek}},file:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr},stream:{llseek:le.stream_ops.llseek,read:le.stream_ops.read,write:le.stream_ops.write,allocate:le.stream_ops.allocate,mmap:le.stream_ops.mmap,msync:le.stream_ops.msync}},link:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr,readlink:le.node_ops.readlink},stream:{}},chrdev:{node:{getattr:le.node_ops.getattr,setattr:le.node_ops.setattr},stream:a.chrdev_stream_ops}});var s=a.createNode(e,t,n,r);return a.isDir(s.mode)?(s.node_ops=le.ops_table.dir.node,s.stream_ops=le.ops_table.dir.stream,s.contents={}):a.isFile(s.mode)?(s.node_ops=le.ops_table.file.node,s.stream_ops=le.ops_table.file.stream,s.usedBytes=0,s.contents=null):a.isLink(s.mode)?(s.node_ops=le.ops_table.link.node,s.stream_ops=le.ops_table.link.stream):a.isChrdev(s.mode)&&(s.node_ops=le.ops_table.chrdev.node,s.stream_ops=le.ops_table.chrdev.stream),s.timestamp=Date.now(),e&&(e.contents[t]=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,t){var n=e.contents?e.contents.length:0;if(!(n>=t)){var r=1024*1024;t=Math.max(t,n*(n<r?2:1.125)>>>0),n!=0&&(t=Math.max(t,256));var s=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(s.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(t==0)e.contents=null,e.usedBytes=0;else{var n=e.contents;e.contents=new Uint8Array(t),n&&e.contents.set(n.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=a.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,a.isDir(e.mode)?t.size=4096:a.isFile(e.mode)?t.size=e.usedBytes:a.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){t.mode!==void 0&&(e.mode=t.mode),t.timestamp!==void 0&&(e.timestamp=t.timestamp),t.size!==void 0&&le.resizeFileStorage(e,t.size)},lookup(e,t){throw a.genericErrors[44]},mknod(e,t,n,r){return le.createNode(e,t,n,r)},rename(e,t,n){if(a.isDir(e.mode)){var r;try{r=a.lookupNode(t,n)}catch{}if(r)for(var s in r.contents)throw new a.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=n,t.contents[n]=e,t.timestamp=e.parent.timestamp},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var n=a.lookupNode(e,t);for(var r in n.contents)throw new a.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var n of Object.keys(e.contents))t.push(n);return t},symlink(e,t,n){var r=le.createNode(e,t,41471,0);return r.link=n,r},readlink(e){if(!a.isLink(e.mode))throw new a.ErrnoError(28);return e.link}},stream_ops:{read(e,t,n,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)t.set(o.subarray(s,s+d),n);else for(var q=0;q<d;q++)t[n+q]=o[s+q];return d},write(e,t,n,r,s,o){if(t.buffer===Se.buffer&&(o=!1),!r)return 0;var d=e.node;if(d.timestamp=Date.now(),t.subarray&&(!d.contents||d.contents.subarray)){if(o)return d.contents=t.subarray(n,n+r),d.usedBytes=r,r;if(d.usedBytes===0&&s===0)return d.contents=t.slice(n,n+r),d.usedBytes=r,r;if(s+r<=d.usedBytes)return d.contents.set(t.subarray(n,n+r),s),r}if(le.expandFileStorage(d,s+r),d.contents.subarray&&t.subarray)d.contents.set(t.subarray(n,n+r),s);else for(var q=0;q<r;q++)d.contents[s+q]=t[n+q];return d.usedBytes=Math.max(d.usedBytes,s+r),r},llseek(e,t,n){var r=t;if(n===1?r+=e.position:n===2&&a.isFile(e.node.mode)&&(r+=e.node.usedBytes),r<0)throw new a.ErrnoError(28);return r},allocate(e,t,n){le.expandFileStorage(e.node,t+n),e.node.usedBytes=Math.max(e.node.usedBytes,t+n)},mmap(e,t,n,r,s){if(!a.isFile(e.node.mode))throw new a.ErrnoError(43);var o,d,q=e.node.contents;if(!(s&2)&&q&&q.buffer===Se.buffer)d=!1,o=q.byteOffset;else{if(d=!0,o=Tt(t),!o)throw new a.ErrnoError(48);q&&((n>0||n+t<q.length)&&(q.subarray?q=q.subarray(n,n+t):q=Array.prototype.slice.call(q,n,n+t)),Se.set(q,o))}return{ptr:o,allocated:d}},msync(e,t,n,r,s){return le.stream_ops.write(e,t,0,r,n,!1),0}}},tn=(e,t,n,r)=>{var s=`al ${e}`;Me(e).then(o=>{t(new Uint8Array(o)),s&&tt()},o=>{if(n)n();else throw`Loading data file "${e}" failed.`}),s&&lt()},nn=(e,t,n,r,s,o)=>{a.createDataFile(e,t,n,r,s,o)},rn=i.preloadPlugins||[],sn=(e,t,n,r)=>{typeof Browser<"u"&&Browser.init();var s=!1;return rn.forEach(o=>{s||o.canHandle(t)&&(o.handle(e,t,n,r),s=!0)}),s},on=(e,t,n,r,s,o,d,q,L,C)=>{var Q=t?De.resolve(ge.join2(e,t)):e;function V(P){function I(N){C==null||C(),q||nn(e,t,N,r,s,L),o==null||o(),tt()}sn(P,Q,I,()=>{d==null||d(),tt()})||I(P)}lt(),typeof n=="string"?tn(n,V,d):V(n)},ln=e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},n=t[e];if(typeof n>"u")throw new Error(`Unknown file open mode: ${e}`);return n},dt=(e,t)=>{var n=0;return e&&(n|=365),t&&(n|=146),n},a={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{constructor(e){this.name="ErrnoError",this.errno=e}},genericErrors:{},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{constructor(){this.shared={}}get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{constructor(e,t,n,r){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=a.nextInode++,this.name=t,this.mode=n,this.node_ops={},this.stream_ops={},this.rdev=r,this.readMode=365,this.writeMode=146}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return a.isDir(this.mode)}get isDevice(){return a.isChrdev(this.mode)}},lookupPath(e,t={}){if(e=De.resolve(e),!e)return{path:"",node:null};var n={follow_mount:!0,recurse_count:0};if(t=Object.assign(n,t),t.recurse_count>8)throw new a.ErrnoError(32);for(var r=e.split("/").filter(V=>!!V),s=a.root,o="/",d=0;d<r.length;d++){var q=d===r.length-1;if(q&&t.parent)break;if(s=a.lookupNode(s,r[d]),o=ge.join2(o,r[d]),a.isMountpoint(s)&&(!q||q&&t.follow_mount)&&(s=s.mounted.root),!q||t.follow)for(var L=0;a.isLink(s.mode);){var C=a.readlink(o);o=De.resolve(ge.dirname(o),C);var Q=a.lookupPath(o,{recurse_count:t.recurse_count+1});if(s=Q.node,L++>40)throw new a.ErrnoError(32)}}return{path:o,node:s}},getPath(e){for(var t;;){if(a.isRoot(e)){var n=e.mount.mountpoint;return t?n[n.length-1]!=="/"?`${n}/${t}`:n+t:n}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%a.nameTable.length},hashAddNode(e){var t=a.hashName(e.parent.id,e.name);e.name_next=a.nameTable[t],a.nameTable[t]=e},hashRemoveNode(e){var t=a.hashName(e.parent.id,e.name);if(a.nameTable[t]===e)a.nameTable[t]=e.name_next;else for(var n=a.nameTable[t];n;){if(n.name_next===e){n.name_next=e.name_next;break}n=n.name_next}},lookupNode(e,t){var n=a.mayLookup(e);if(n)throw new a.ErrnoError(n);for(var r=a.hashName(e.id,t),s=a.nameTable[r];s;s=s.name_next){var o=s.name;if(s.parent.id===e.id&&o===t)return s}return a.lookup(e,t)},createNode(e,t,n,r){var s=new a.FSNode(e,t,n,r);return a.hashAddNode(s),s},destroyNode(e){a.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 t=["r","w","rw"][e&3];return e&512&&(t+="w"),t},nodePermissions(e,t){return a.ignorePermissions?0:t.includes("r")&&!(e.mode&292)||t.includes("w")&&!(e.mode&146)||t.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!a.isDir(e.mode))return 54;var t=a.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{var n=a.lookupNode(e,t);return 20}catch{}return a.nodePermissions(e,"wx")},mayDelete(e,t,n){var r;try{r=a.lookupNode(e,t)}catch(o){return o.errno}var s=a.nodePermissions(e,"wx");if(s)return s;if(n){if(!a.isDir(r.mode))return 54;if(a.isRoot(r)||a.getPath(r)===a.cwd())return 10}else if(a.isDir(r.mode))return 31;return 0},mayOpen(e,t){return e?a.isLink(e.mode)?32:a.isDir(e.mode)&&(a.flagsToPermissionString(t)!=="r"||t&512)?31:a.nodePermissions(e,a.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=a.MAX_OPEN_FDS;e++)if(!a.streams[e])return e;throw new a.ErrnoError(33)},getStreamChecked(e){var t=a.getStream(e);if(!t)throw new a.ErrnoError(8);return t},getStream:e=>a.streams[e],createStream(e,t=-1){return e=Object.assign(new a.FSStream,e),t==-1&&(t=a.nextfd()),e.fd=t,a.streams[t]=e,e},closeStream(e){a.streams[e]=null},dupStream(e,t=-1){var r,s;var n=a.createStream(e,t);return(s=(r=n.stream_ops)==null?void 0:r.dup)==null||s.call(r,n),n},chrdev_stream_ops:{open(e){var n,r;var t=a.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,(r=(n=e.stream_ops).open)==null||r.call(n,e)},llseek(){throw new a.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,t)=>e<<8|t,registerDevice(e,t){a.devices[e]={stream_ops:t}},getDevice:e=>a.devices[e],getMounts(e){for(var t=[],n=[e];n.length;){var r=n.pop();t.push(r),n.push(...r.mounts)}return t},syncfs(e,t){typeof e=="function"&&(t=e,e=!1),a.syncFSRequests++,a.syncFSRequests>1&&je(`warning: ${a.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var n=a.getMounts(a.root.mount),r=0;function s(d){return a.syncFSRequests--,t(d)}function o(d){if(d)return o.errored?void 0:(o.errored=!0,s(d));++r>=n.length&&s(null)}n.forEach(d=>{if(!d.type.syncfs)return o(null);d.type.syncfs(d,e,o)})},mount(e,t,n){var r=n==="/",s=!n,o;if(r&&a.root)throw new a.ErrnoError(10);if(!r&&!s){var d=a.lookupPath(n,{follow_mount:!1});if(n=d.path,o=d.node,a.isMountpoint(o))throw new a.ErrnoError(10);if(!a.isDir(o.mode))throw new a.ErrnoError(54)}var q={type:e,opts:t,mountpoint:n,mounts:[]},L=e.mount(q);return L.mount=q,q.root=L,r?a.root=L:o&&(o.mounted=q,o.mount&&o.mount.mounts.push(q)),L},unmount(e){var t=a.lookupPath(e,{follow_mount:!1});if(!a.isMountpoint(t.node))throw new a.ErrnoError(28);var n=t.node,r=n.mounted,s=a.getMounts(r);Object.keys(a.nameTable).forEach(d=>{for(var q=a.nameTable[d];q;){var L=q.name_next;s.includes(q.mount)&&a.destroyNode(q),q=L}}),n.mounted=null;var o=n.mount.mounts.indexOf(r);n.mount.mounts.splice(o,1)},lookup(e,t){return e.node_ops.lookup(e,t)},mknod(e,t,n){var r=a.lookupPath(e,{parent:!0}),s=r.node,o=ge.basename(e);if(!o||o==="."||o==="..")throw new a.ErrnoError(28);var d=a.mayCreate(s,o);if(d)throw new a.ErrnoError(d);if(!s.node_ops.mknod)throw new a.ErrnoError(63);return s.node_ops.mknod(s,o,t,n)},create(e,t){return t=t!==void 0?t:438,t&=4095,t|=32768,a.mknod(e,t,0)},mkdir(e,t){return t=t!==void 0?t:511,t&=1023,t|=16384,a.mknod(e,t,0)},mkdirTree(e,t){for(var n=e.split("/"),r="",s=0;s<n.length;++s)if(n[s]){r+="/"+n[s];try{a.mkdir(r,t)}catch(o){if(o.errno!=20)throw o}}},mkdev(e,t,n){return typeof n>"u"&&(n=t,t=438),t|=8192,a.mknod(e,t,n)},symlink(e,t){if(!De.resolve(e))throw new a.ErrnoError(44);var n=a.lookupPath(t,{parent:!0}),r=n.node;if(!r)throw new a.ErrnoError(44);var s=ge.basename(t),o=a.mayCreate(r,s);if(o)throw new a.ErrnoError(o);if(!r.node_ops.symlink)throw new a.ErrnoError(63);return r.node_ops.symlink(r,s,e)},rename(e,t){var n=ge.dirname(e),r=ge.dirname(t),s=ge.basename(e),o=ge.basename(t),d,q,L;if(d=a.lookupPath(e,{parent:!0}),q=d.node,d=a.lookupPath(t,{parent:!0}),L=d.node,!q||!L)throw new a.ErrnoError(44);if(q.mount!==L.mount)throw new a.ErrnoError(75);var C=a.lookupNode(q,s),Q=De.relative(e,r);if(Q.charAt(0)!==".")throw new a.ErrnoError(28);if(Q=De.relative(t,n),Q.charAt(0)!==".")throw new a.ErrnoError(55);var V;try{V=a.lookupNode(L,o)}catch{}if(C!==V){var P=a.isDir(C.mode),I=a.mayDelete(q,s,P);if(I)throw new a.ErrnoError(I);if(I=V?a.mayDelete(L,o,P):a.mayCreate(L,o),I)throw new a.ErrnoError(I);if(!q.node_ops.rename)throw new a.ErrnoError(63);if(a.isMountpoint(C)||V&&a.isMountpoint(V))throw new a.ErrnoError(10);if(L!==q&&(I=a.nodePermissions(q,"w"),I))throw new a.ErrnoError(I);a.hashRemoveNode(C);try{q.node_ops.rename(C,L,o),C.parent=L}catch(N){throw N}finally{a.hashAddNode(C)}}},rmdir(e){var t=a.lookupPath(e,{parent:!0}),n=t.node,r=ge.basename(e),s=a.lookupNode(n,r),o=a.mayDelete(n,r,!0);if(o)throw new a.ErrnoError(o);if(!n.node_ops.rmdir)throw new a.ErrnoError(63);if(a.isMountpoint(s))throw new a.ErrnoError(10);n.node_ops.rmdir(n,r),a.destroyNode(s)},readdir(e){var t=a.lookupPath(e,{follow:!0}),n=t.node;if(!n.node_ops.readdir)throw new a.ErrnoError(54);return n.node_ops.readdir(n)},unlink(e){var t=a.lookupPath(e,{parent:!0}),n=t.node;if(!n)throw new a.ErrnoError(44);var r=ge.basename(e),s=a.lookupNode(n,r),o=a.mayDelete(n,r,!1);if(o)throw new a.ErrnoError(o);if(!n.node_ops.unlink)throw new a.ErrnoError(63);if(a.isMountpoint(s))throw new a.ErrnoError(10);n.node_ops.unlink(n,r),a.destroyNode(s)},readlink(e){var t=a.lookupPath(e),n=t.node;if(!n)throw new a.ErrnoError(44);if(!n.node_ops.readlink)throw new a.ErrnoError(28);return De.resolve(a.getPath(n.parent),n.node_ops.readlink(n))},stat(e,t){var n=a.lookupPath(e,{follow:!t}),r=n.node;if(!r)throw new a.ErrnoError(44);if(!r.node_ops.getattr)throw new a.ErrnoError(63);return r.node_ops.getattr(r)},lstat(e){return a.stat(e,!0)},chmod(e,t,n){var r;if(typeof e=="string"){var s=a.lookupPath(e,{follow:!n});r=s.node}else r=e;if(!r.node_ops.setattr)throw new a.ErrnoError(63);r.node_ops.setattr(r,{mode:t&4095|r.mode&-4096,timestamp:Date.now()})},lchmod(e,t){a.chmod(e,t,!0)},fchmod(e,t){var n=a.getStreamChecked(e);a.chmod(n.node,t)},chown(e,t,n,r){var s;if(typeof e=="string"){var o=a.lookupPath(e,{follow:!r});s=o.node}else s=e;if(!s.node_ops.setattr)throw new a.ErrnoError(63);s.node_ops.setattr(s,{timestamp:Date.now()})},lchown(e,t,n){a.chown(e,t,n,!0)},fchown(e,t,n){var r=a.getStreamChecked(e);a.chown(r.node,t,n)},truncate(e,t){if(t<0)throw new a.ErrnoError(28);var n;if(typeof e=="string"){var r=a.lookupPath(e,{follow:!0});n=r.node}else n=e;if(!n.node_ops.setattr)throw new a.ErrnoError(63);if(a.isDir(n.mode))throw new a.ErrnoError(31);if(!a.isFile(n.mode))throw new a.ErrnoError(28);var s=a.nodePermissions(n,"w");if(s)throw new a.ErrnoError(s);n.node_ops.setattr(n,{size:t,timestamp:Date.now()})},ftruncate(e,t){var n=a.getStreamChecked(e);if((n.flags&2097155)===0)throw new a.ErrnoError(28);a.truncate(n.node,t)},utime(e,t,n){var r=a.lookupPath(e,{follow:!0}),s=r.node;s.node_ops.setattr(s,{timestamp:Math.max(t,n)})},open(e,t,n){if(e==="")throw new a.ErrnoError(44);t=typeof t=="string"?ln(t):t,t&64?(n=typeof n>"u"?438:n,n=n&4095|32768):n=0;var r;if(typeof e=="object")r=e;else{e=ge.normalize(e);try{var s=a.lookupPath(e,{follow:!(t&131072)});r=s.node}catch{}}var o=!1;if(t&64)if(r){if(t&128)throw new a.ErrnoError(20)}else r=a.mknod(e,n,0),o=!0;if(!r)throw new a.ErrnoError(44);if(a.isChrdev(r.mode)&&(t&=-513),t&65536&&!a.isDir(r.mode))throw new a.ErrnoError(54);if(!o){var d=a.mayOpen(r,t);if(d)throw new a.ErrnoError(d)}t&512&&!o&&a.truncate(r,0),t&=-131713;var q=a.createStream({node:r,path:a.getPath(r),flags:t,seekable:!0,position:0,stream_ops:r.stream_ops,ungotten:[],error:!1});return q.stream_ops.open&&q.stream_ops.open(q),i.logReadFiles&&!(t&1)&&(e in a.readFiles||(a.readFiles[e]=1)),q},close(e){if(a.isClosed(e))throw new a.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(t){throw t}finally{a.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,t,n){if(a.isClosed(e))throw new a.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new a.ErrnoError(70);if(n!=0&&n!=1&&n!=2)throw new a.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,n),e.ungotten=[],e.position},read(e,t,n,r,s){if(r<0||s<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if((e.flags&2097155)===1)throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.read)throw new a.ErrnoError(28);var o=typeof s<"u";if(!o)s=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var d=e.stream_ops.read(e,t,n,r,s);return o||(e.position+=d),d},write(e,t,n,r,s,o){if(r<0||s<0)throw new a.ErrnoError(28);if(a.isClosed(e))throw new a.ErrnoError(8);if((e.flags&2097155)===0)throw new a.ErrnoError(8);if(a.isDir(e.node.mode))throw new a.ErrnoError(31);if(!e.stream_ops.write)throw new a.ErrnoError(28);e.seekable&&e.flags&1024&&a.llseek(e,0,2);var d=typeof s<"u";if(!d)s=e.position;else if(!e.seekable)throw new a.ErrnoError(70);var q=e.stream_ops.write(e,t,n,r,s,o);return d||(e.position+=q),q},allocate(e,t,n){if(a.isClosed(e))throw new a.ErrnoError(8);if(t<0||n<=0)throw new a.ErrnoError(28);if((e.flags&2097155)===0)throw new a.ErrnoError(8);if(!a.isFile(e.node.mode)&&!a.isDir(e.node.mode))throw new a.ErrnoError(43);if(!e.stream_ops.allocate)throw new a.ErrnoError(138);e.stream_ops.allocate(e,t,n)},mmap(e,t,n,r,s){if((r&2)!==0&&(s&2)===0&&(e.flags&2097155)!==2)throw new a.ErrnoError(2);if((e.flags&2097155)===1)throw new a.ErrnoError(2);if(!e.stream_ops.mmap)throw new a.ErrnoError(43);if(!t)throw new a.ErrnoError(28);return e.stream_ops.mmap(e,t,n,r,s)},msync(e,t,n,r,s){return e.stream_ops.msync?e.stream_ops.msync(e,t,n,r,s):0},ioctl(e,t,n){if(!e.stream_ops.ioctl)throw new a.ErrnoError(59);return e.stream_ops.ioctl(e,t,n)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary",t.encoding!=="utf8"&&t.encoding!=="binary")throw new Error(`Invalid encoding type "${t.encoding}"`);var n,r=a.open(e,t.flags),s=a.stat(e),o=s.size,d=new Uint8Array(o);return a.read(r,d,0,o,0),t.encoding==="utf8"?n=He(d):t.encoding==="binary"&&(n=d),a.close(r),n},writeFile(e,t,n={}){n.flags=n.flags||577;var r=a.open(e,n.flags,n.mode);if(typeof t=="string"){var s=new Uint8Array(nt(t)+1),o=ft(t,s,0,s.length);a.write(r,s,0,o,void 0,n.canOwn)}else if(ArrayBuffer.isView(t))a.write(r,t,0,t.byteLength,void 0,n.canOwn);else throw new Error("Unsupported data type");a.close(r)},cwd:()=>a.currentPath,chdir(e){var t=a.lookupPath(e,{follow:!0});if(t.node===null)throw new a.ErrnoError(44);if(!a.isDir(t.node.mode))throw new a.ErrnoError(54);var n=a.nodePermissions(t.node,"x");if(n)throw new a.ErrnoError(n);a.currentPath=t.path},createDefaultDirectories(){a.mkdir("/tmp"),a.mkdir("/home"),a.mkdir("/home/web_user")},createDefaultDevices(){a.mkdir("/dev"),a.registerDevice(a.makedev(1,3),{read:()=>0,write:(r,s,o,d,q)=>d}),a.mkdev("/dev/null",a.makedev(1,3)),ze.register(a.makedev(5,0),ze.default_tty_ops),ze.register(a.makedev(6,0),ze.default_tty1_ops),a.mkdev("/dev/tty",a.makedev(5,0)),a.mkdev("/dev/tty1",a.makedev(6,0));var e=new Uint8Array(1024),t=0,n=()=>(t===0&&(t=St(e).byteLength),e[--t]);a.createDevice("/dev","random",n),a.createDevice("/dev","urandom",n),a.mkdir("/dev/shm"),a.mkdir("/dev/shm/tmp")},createSpecialDirectories(){a.mkdir("/proc");var e=a.mkdir("/proc/self");a.mkdir("/proc/self/fd"),a.mount({mount(){var t=a.createNode(e,"fd",16895,73);return t.node_ops={lookup(n,r){var s=+r,o=a.getStreamChecked(s),d={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>o.path}};return d.parent=d,d}},t}},{},"/proc/self/fd")},createStandardStreams(e,t,n){e?a.createDevice("/dev","stdin",e):a.symlink("/dev/tty","/dev/stdin"),t?a.createDevice("/dev","stdout",null,t):a.symlink("/dev/tty","/dev/stdout"),n?a.createDevice("/dev","stderr",null,n):a.symlink("/dev/tty1","/dev/stderr"),a.open("/dev/stdin",0),a.open("/dev/stdout",1),a.open("/dev/stderr",1)},staticInit(){[44].forEach(e=>{a.genericErrors[e]=new a.ErrnoError(e),a.genericErrors[e].stack="<generic error, no stack>"}),a.nameTable=new Array(4096),a.mount(le,{},"/"),a.createDefaultDirectories(),a.createDefaultDevices(),a.createSpecialDirectories(),a.filesystems={MEMFS:le}},init(e,t,n){a.initialized=!0,e??(e=i.stdin),t??(t=i.stdout),n??(n=i.stderr),a.createStandardStreams(e,t,n)},quit(){a.initialized=!1;for(var e=0;e<a.streams.length;e++){var t=a.streams[e];t&&a.close(t)}},findObject(e,t){var n=a.analyzePath(e,t);return n.exists?n.object:null},analyzePath(e,t){try{var n=a.lookupPath(e,{follow:!t});e=n.path}catch{}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=a.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ge.basename(e),n=a.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot=n.path==="/"}catch(s){r.error=s.errno}return r},createPath(e,t,n,r){e=typeof e=="string"?e:a.getPath(e);for(var s=t.split("/").reverse();s.length;){var o=s.pop();if(o){var d=ge.join2(e,o);try{a.mkdir(d)}catch{}e=d}}return d},createFile(e,t,n,r,s){var o=ge.join2(typeof e=="string"?e:a.getPath(e),t),d=dt(r,s);return a.create(o,d)},createDataFile(e,t,n,r,s,o){var d=t;e&&(e=typeof e=="string"?e:a.getPath(e),d=t?ge.join2(e,t):e);var q=dt(r,s),L=a.create(d,q);if(n){if(typeof n=="string"){for(var C=new Array(n.length),Q=0,V=n.length;Q<V;++Q)C[Q]=n.charCodeAt(Q);n=C}a.chmod(L,q|146);var P=a.open(L,577);a.write(P,n,0,n.length,0,o),a.close(P),a.chmod(L,q)}},createDevice(e,t,n,r){var q;var s=ge.join2(typeof e=="string"?e:a.getPath(e),t),o=dt(!!n,!!r);(q=a.createDevice).major??(q.major=64);var d=a.makedev(a.createDevice.major++,0);return a.registerDevice(d,{open(L){L.seekable=!1},close(L){var C;(C=r==null?void 0:r.buffer)!=null&&C.length&&r(10)},read(L,C,Q,V,P){for(var I=0,N=0;N<V;N++){var w;try{w=n()}catch{throw new a.ErrnoError(29)}if(w===void 0&&I===0)throw new a.ErrnoError(6);if(w==null)break;I++,C[Q+N]=w}return I&&(L.node.timestamp=Date.now()),I},write(L,C,Q,V,P){for(var I=0;I<V;I++)try{r(C[Q+I])}catch{throw new a.ErrnoError(29)}return V&&(L.node.timestamp=Date.now()),I}}),a.mkdev(s,o,d)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(typeof XMLHttpRequest<"u")throw new 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.");try{e.contents=We(e.url),e.usedBytes=e.contents.length}catch{throw new a.ErrnoError(29)}}
vendor: 10,638 bytes, line 2
2,createLazyFile(e,t,n,r,s){class o{constructor(){this.lengthKnown=!1,this.chunks=[]}get(I){if(!(I>this.length-1||I<0)){var N=I%this.chunkSize,w=I/this.chunkSize|0;return this.getter(w)[N]}}setDataGetter(I){this.getter=I}cacheLength(){var I=new XMLHttpRequest;if(I.open("HEAD",n,!1),I.send(null),!(I.status>=200&&I.status<300||I.status===304))throw new Error("Couldn't load "+n+". Status: "+I.status);var N=Number(I.getResponseHeader("Content-length")),w,x=(w=I.getResponseHeader("Accept-Ranges"))&&w==="bytes",T=(w=I.getResponseHeader("Content-Encoding"))&&w==="gzip",F=1024*1024;x||(F=N);var D=(j,H)=>{if(j>H)throw new Error("invalid range ("+j+", "+H+") or no bytes requested!");if(H>N-1)throw new Error("only "+N+" bytes available! programmer error!");var c=new XMLHttpRequest;if(c.open("GET",n,!1),N!==F&&c.setRequestHeader("Range","bytes="+j+"-"+H),c.responseType="arraybuffer",c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined"),c.send(null),!(c.status>=200&&c.status<300||c.status===304))throw new Error("Couldn't load "+n+". Status: "+c.status);return c.response!==void 0?new Uint8Array(c.response||[]):It(c.responseText||"")},A=this;A.setDataGetter(j=>{var H=j*F,c=(j+1)*F-1;if(c=Math.min(c,N-1),typeof A.chunks[j]>"u"&&(A.chunks[j]=D(H,c)),typeof A.chunks[j]>"u")throw new Error("doXHR failed!");return A.chunks[j]}),(T||!N)&&(F=N=1,N=this.getter(0).length,F=N,Ke("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=N,this._chunkSize=F,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(typeof XMLHttpRequest<"u"){if(!Oe)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var d=new o,q={isDevice:!1,contents:d}}else var q={isDevice:!1,url:n};var L=a.createFile(e,t,q,r,s);q.contents?L.contents=q.contents:q.url&&(L.contents=null,L.url=q.url),Object.defineProperties(L,{usedBytes:{get:function(){return this.contents.length}}});var C={},Q=Object.keys(L.stream_ops);Q.forEach(P=>{var I=L.stream_ops[P];C[P]=(...N)=>(a.forceLoadFile(L),I(...N))});function V(P,I,N,w,x){var T=P.node.contents;if(x>=T.length)return 0;var F=Math.min(T.length-x,w);if(T.slice)for(var D=0;D<F;D++)I[N+D]=T[x+D];else for(var D=0;D<F;D++)I[N+D]=T.get(x+D);return F}return C.read=(P,I,N,w,x)=>(a.forceLoadFile(L),V(P,I,N,w,x)),C.mmap=(P,I,N,w,x)=>{a.forceLoadFile(L);var T=Tt(I);if(!T)throw new a.ErrnoError(48);return V(P,Se,T,I,N),{ptr:T,allocated:!0}},L.stream_ops=C,L}},an=(e,t)=>e?He(Qe,e,t):"",_e={DEFAULT_POLLMASK:5,calculateAt(e,t,n){if(ge.isAbs(t))return t;var r;if(e===-100)r=a.cwd();else{var s=_e.getStreamFromFD(e);r=s.path}if(t.length==0){if(!n)throw new a.ErrnoError(44);return r}return ge.join2(r,t)},doStat(e,t,n){var r=e(t);de[n>>2]=r.dev,de[n+4>>2]=r.mode,we[n+8>>2]=r.nlink,de[n+12>>2]=r.uid,de[n+16>>2]=r.gid,de[n+20>>2]=r.rdev,Ce[n+24>>3]=BigInt(r.size),de[n+32>>2]=4096,de[n+36>>2]=r.blocks;var s=r.atime.getTime(),o=r.mtime.getTime(),d=r.ctime.getTime();return Ce[n+40>>3]=BigInt(Math.floor(s/1e3)),we[n+48>>2]=s%1e3*1e3*1e3,Ce[n+56>>3]=BigInt(Math.floor(o/1e3)),we[n+64>>2]=o%1e3*1e3*1e3,Ce[n+72>>3]=BigInt(Math.floor(d/1e3)),we[n+80>>2]=d%1e3*1e3*1e3,Ce[n+88>>3]=BigInt(r.ino),0},doMsync(e,t,n,r,s){if(!a.isFile(t.node.mode))throw new a.ErrnoError(43);if(r&2)return 0;var o=Qe.slice(e,e+n);a.msync(t,o,s,n,r)},getStreamFromFD(e){var t=a.getStreamChecked(e);return t},varargs:void 0,getStr(e){var t=an(e);return t}};function cn(e,t){try{return e=_e.getStr(e),a.chmod(e,t),0}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}function _n(e,t,n,r){try{if(t=_e.getStr(t),t=_e.calculateAt(e,t),n&-8)return-28;var s=a.lookupPath(t,{follow:!0}),o=s.node;if(!o)return-44;var d="";return n&4&&(d+="r"),n&2&&(d+="w"),n&1&&(d+="x"),d&&a.nodePermissions(o,d)?-2:0}catch(q){if(typeof a>"u"||q.name!=="ErrnoError")throw q;return-q.errno}}function un(e,t){try{return a.fchmod(e,t),0}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}function fn(e,t,n){try{return a.fchown(e,t,n),0}catch(r){if(typeof a>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function rt(){var e=de[+_e.varargs>>2];return _e.varargs+=4,e}var Ve=rt;function dn(e,t,n){_e.varargs=n;try{var r=_e.getStreamFromFD(e);switch(t){case 0:{var s=rt();if(s<0)return-28;for(;a.streams[s];)s++;var o;return o=a.dupStream(r,s),o.fd}case 1:case 2:return 0;case 3:return r.flags;case 4:{var s=rt();return r.flags|=s,0}case 12:{var s=Ve(),d=0;return Je[s+d>>1]=2,0}case 13:case 14:return 0}return-28}catch(q){if(typeof a>"u"||q.name!=="ErrnoError")throw q;return-q.errno}}function pn(e,t){try{var n=_e.getStreamFromFD(e);return _e.doStat(a.stat,n.path,t)}catch(r){if(typeof a>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}var mn=9007199254740992,hn=-9007199254740992,Ye=e=>e<hn||e>mn?NaN:Number(e);function gn(e,t){t=Ye(t);try{return isNaN(t)?61:(a.ftruncate(e,t),0)}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}var Ge=(e,t,n)=>ft(e,Qe,t,n);function qn(e,t){try{if(t===0)return-28;var n=a.cwd(),r=nt(n)+1;return t<r?-68:(Ge(n,e,t),r)}catch(s){if(typeof a>"u"||s.name!=="ErrnoError")throw s;return-s.errno}}function bn(e,t,n){_e.varargs=n;try{var r=_e.getStreamFromFD(e);switch(t){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=Ve();de[o>>2]=s.c_iflag||0,de[o+4>>2]=s.c_oflag||0,de[o+8>>2]=s.c_cflag||0,de[o+12>>2]=s.c_lflag||0;for(var d=0;d<32;d++)Se[o+d+17]=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=Ve(),q=de[o>>2],L=de[o+4>>2],C=de[o+8>>2],Q=de[o+12>>2],V=[],d=0;d<32;d++)V.push(Se[o+d+17]);return r.tty.ops.ioctl_tcsets(r.tty,t,{c_iflag:q,c_oflag:L,c_cflag:C,c_lflag:Q,c_cc:V})}return 0}case 21519:{if(!r.tty)return-59;var o=Ve();return de[o>>2]=0,0}case 21520:return r.tty?-28:-59;case 21531:{var o=Ve();return a.ioctl(r,t,o)}case 21523:{if(!r.tty)return-59;if(r.tty.ops.ioctl_tiocgwinsz){var P=r.tty.ops.ioctl_tiocgwinsz(r.tty),o=Ve();Je[o>>1]=P[0],Je[o+2>>1]=P[1]}return 0}case 21524:return r.tty?0:-59;case 21515:return r.tty?0:-59;default:return-28}}catch(I){if(typeof a>"u"||I.name!=="ErrnoError")throw I;return-I.errno}}function yn(e,t){try{return e=_e.getStr(e),_e.doStat(a.lstat,e,t)}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}function wn(e,t,n){try{return t=_e.getStr(t),t=_e.calculateAt(e,t),t=ge.normalize(t),t[t.length-1]==="/"&&(t=t.substr(0,t.length-1)),a.mkdir(t,n,0),0}catch(r){if(typeof a>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function En(e,t,n,r){try{t=_e.getStr(t);var s=r&256,o=r&4096;return r=r&-6401,t=_e.calculateAt(e,t,o),_e.doStat(s?a.lstat:a.stat,t,n)}catch(d){if(typeof a>"u"||d.name!=="ErrnoError")throw d;return-d.errno}}function vn(e,t,n,r){_e.varargs=r;try{t=_e.getStr(t),t=_e.calculateAt(e,t);var s=r?rt():0;return a.open(t,n,s).fd}catch(o){if(typeof a>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}function xn(e,t,n,r){try{if(t=_e.getStr(t),t=_e.calculateAt(e,t),r<=0)return-28;var s=a.readlink(t),o=Math.min(r,nt(s)),d=Se[n+o];return Ge(s,n,r+1),Se[n+o]=d,o}catch(q){if(typeof a>"u"||q.name!=="ErrnoError")throw q;return-q.errno}}function Sn(e){try{return e=_e.getStr(e),a.rmdir(e),0}catch(t){if(typeof a>"u"||t.name!=="ErrnoError")throw t;return-t.errno}}function An(e,t){try{return e=_e.getStr(e),_e.doStat(a.stat,e,t)}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return-n.errno}}function In(e,t,n){try{return t=_e.getStr(t),t=_e.calculateAt(e,t),n===0?a.unlink(t):n===512?a.rmdir(t):at("Invalid flags passed to unlinkat"),0}catch(r){if(typeof a>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}var Ft=e=>we[e>>2]+de[e+4>>2]*4294967296;function kn(e,t,n,r){try{t=_e.getStr(t),t=_e.calculateAt(e,t,!0);var s=Date.now(),o,d;if(!n)o=s,d=s;else{var q=Ft(n),L=de[n+8>>2];L==1073741823?o=s:L==1073741822?o=-1:o=q*1e3+L/(1e3*1e3),n+=16,q=Ft(n),L=de[n+8>>2],L==1073741823?d=s:L==1073741822?d=-1:d=q*1e3+L/(1e3*1e3)}return(d!=-1||o!=-1)&&a.utime(t,o,d),0}catch(C){if(typeof a>"u"||C.name!=="ErrnoError")throw C;return-C.errno}}var Tn=1,Fn=()=>Tn,On=e=>e%4===0&&(e%100!==0||e%400===0),Pn=[0,31,60,91,121,152,182,213,244,274,305,335],Ln=[0,31,59,90,120,151,181,212,243,273,304,334],Cn=e=>{var t=On(e.getFullYear()),n=t?Pn:Ln,r=n[e.getMonth()]+e.getDate()-1;return r};function Dn(e,t){e=Ye(e);var n=new Date(e*1e3);de[t>>2]=n.getSeconds(),de[t+4>>2]=n.getMinutes(),de[t+8>>2]=n.getHours(),de[t+12>>2]=n.getDate(),de[t+16>>2]=n.getMonth(),de[t+20>>2]=n.getFullYear()-1900,de[t+24>>2]=n.getDay();var r=Cn(n)|0;de[t+28>>2]=r,de[t+36>>2]=-(n.getTimezoneOffset()*60);var s=new Date(n.getFullYear(),0,1),o=new Date(n.getFullYear(),6,1).getTimezoneOffset(),d=s.getTimezoneOffset(),q=(o!=d&&n.getTimezoneOffset()==Math.min(d,o))|0;de[t+32>>2]=q}function Rn(e,t,n,r,s,o,d){s=Ye(s);try{if(isNaN(s))return 61;var q=_e.getStreamFromFD(r),L=a.mmap(q,e,s,t,n),C=L.ptr;return de[o>>2]=L.allocated,we[d>>2]=C,0}catch(Q){if(typeof a>"u"||Q.name!=="ErrnoError")throw Q;return-Q.errno}}function Nn(e,t,n,r,s,o){o=Ye(o);try{var d=_e.getStreamFromFD(s);n&2&&_e.doMsync(e,d,t,r,o)}catch(q){if(typeof a>"u"||q.name!=="ErrnoError")throw q;return-q.errno}}var jn=(e,t,n,r)=>{var s=new Date().getFullYear(),o=new Date(s,0,1),d=new Date(s,6,1),q=o.getTimezoneOffset(),L=d.getTimezoneOffset(),C=Math.max(q,L);we[e>>2]=C*60,de[t>>2]=+(q!=L);var Q=I=>{var N=I>=0?"-":"+",w=Math.abs(I),x=String(Math.floor(w/60)).padStart(2,"0"),T=String(w%60).padStart(2,"0");return`UTC${N}${x}${T}`},V=Q(q),P=Q(L);L<q?(Ge(V,n,17),Ge(P,r,17)):(Ge(V,r,17),Ge(P,n,17))},Mn=()=>Date.now(),Bn=()=>performance.now(),Un=()=>2147483648,zn=e=>{var t=Be.buffer,n=(e-t.byteLength+65535)/65536|0;try{return Be.grow(n),qt(),1}catch{}},Wn=e=>{var t=Qe.length;e>>>=0;var n=Un();if(e>n)return!1;for(var r=1;r<=4;r*=2){var s=t*(1+.2/r);s=Math.min(s,e+100663296);var o=Math.min(n,kt(Math.max(e,s),65536)),d=zn(o);if(d)return!0}return!1},pt={},Qn=()=>ne||"./this.program",Ze=()=>{if(!Ze.strings){var e=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Qn()};for(var n in pt)pt[n]===void 0?delete t[n]:t[n]=pt[n];var r=[];for(var n in t)r.push(`${n}=${t[n]}`);Ze.strings=r}return Ze.strings},Hn=(e,t)=>{for(var n=0;n<e.length;++n)Se[t++]=e.charCodeAt(n);Se[t]=0},Vn=(e,t)=>{var n=0;
2return Ze().forEach((r,s)=>{var o=t+n;we[e+s*4>>2]=o,Hn(r,o),n+=r.length+1}),0},Gn=(e,t)=>{var n=Ze();we[e>>2]=n.length;var r=0;return n.forEach(s=>r+=s.length+1),we[t>>2]=r,0};function $n(e){try{var t=_e.getStreamFromFD(e);return a.close(t),0}catch(n){if(typeof a>"u"||n.name!=="ErrnoError")throw n;return n.errno}}function Kn(e,t){try{var n=0,r=0,s=0,o=_e.getStreamFromFD(e),d=o.tty?2:a.isDir(o.mode)?3:a.isLink(o.mode)?7:4;return Se[t]=d,Je[t+2>>1]=s,Ce[t+8>>3]=BigInt(n),Ce[t+16>>3]=BigInt(r),0}catch(q){if(typeof a>"u"||q.name!=="ErrnoError")throw q;return q.errno}}var Jn=(e,t,n,r)=>{for(var s=0,o=0;o<n;o++){var d=we[t>>2],q=we[t+4>>2];t+=8;var L=a.read(e,Se,d,q,r);if(L<0)return-1;if(s+=L,L<q)break}return s};function Xn(e,t,n,r){try{var s=_e.getStreamFromFD(e),o=Jn(s,t,n);return we[r>>2]=o,0}catch(d){if(typeof a>"u"||d.name!=="ErrnoError")throw d;return d.errno}}function Yn(e,t,n,r){t=Ye(t);try{if(isNaN(t))return 61;var s=_e.getStreamFromFD(e);return a.llseek(s,t,n),Ce[r>>3]=BigInt(s.position),s.getdents&&t===0&&n===0&&(s.getdents=null),0}catch(o){if(typeof a>"u"||o.name!=="ErrnoError")throw o;return o.errno}}function Zn(e){var n;try{var t=_e.getStreamFromFD(e);return(n=t.stream_ops)!=null&&n.fsync?t.stream_ops.fsync(t):0}catch(r){if(typeof a>"u"||r.name!=="ErrnoError")throw r;return r.errno}}var er=(e,t,n,r)=>{for(var s=0,o=0;o<n;o++){var d=we[t>>2],q=we[t+4>>2];t+=8;var L=a.write(e,Se,d,q,r);if(L<0)return-1;if(s+=L,L<q)break}return s};function tr(e,t,n,r){try{var s=_e.getStreamFromFD(e),o=er(s,t,n);return we[r>>2]=o,0}catch(d){if(typeof a>"u"||d.name!=="ErrnoError")throw d;return d.errno}}a.createPreloadedFile=on,a.staticInit();var Ot={__syscall_chmod:cn,__syscall_faccessat:_n,__syscall_fchmod:un,__syscall_fchown32:fn,__syscall_fcntl64:dn,__syscall_fstat64:pn,__syscall_ftruncate64:gn,__syscall_getcwd:qn,__syscall_ioctl:bn,__syscall_lstat64:yn,__syscall_mkdirat:wn,__syscall_newfstatat:En,__syscall_open
vendor: 19,770 bytes, line 2
2at:vn,__syscall_readlinkat:xn,__syscall_rmdir:Sn,__syscall_stat64:An,__syscall_unlinkat:In,__syscall_utimensat:kn,_emscripten_get_now_is_monotonic:Fn,_localtime_js:Dn,_mmap_js:Rn,_munmap_js:Nn,_tzset_js:jn,emscripten_date_now:Mn,emscripten_get_now:Bn,emscripten_resize_heap:Wn,environ_get:Vn,environ_sizes_get:Gn,fd_close:$n,fd_fdstat_get:Kn,fd_read:Xn,fd_seek:Yn,fd_sync:Zn,fd_write:tr,memory:Be},m=Xt();i._sqlite3_status64=(e,t,n,r)=>(i._sqlite3_status64=m.sqlite3_status64)(e,t,n,r),i._sqlite3_status=(e,t,n,r)=>(i._sqlite3_status=m.sqlite3_status)(e,t,n,r),i._sqlite3_db_status=(e,t,n,r,s)=>(i._sqlite3_db_status=m.sqlite3_db_status)(e,t,n,r,s),i._sqlite3_msize=e=>(i._sqlite3_msize=m.sqlite3_msize)(e),i._sqlite3_vfs_find=e=>(i._sqlite3_vfs_find=m.sqlite3_vfs_find)(e),i._sqlite3_initialize=()=>(i._sqlite3_initialize=m.sqlite3_initialize)(),i._sqlite3_malloc=e=>(i._sqlite3_malloc=m.sqlite3_malloc)(e),i._sqlite3_free=e=>(i._sqlite3_free=m.sqlite3_free)(e),i._sqlite3_vfs_register=(e,t)=>(i._sqlite3_vfs_register=m.sqlite3_vfs_register)(e,t),i._sqlite3_vfs_unregister=e=>(i._sqlite3_vfs_unregister=m.sqlite3_vfs_unregister)(e),i._sqlite3_malloc64=e=>(i._sqlite3_malloc64=m.sqlite3_malloc64)(e),i._sqlite3_realloc=(e,t)=>(i._sqlite3_realloc=m.sqlite3_realloc)(e,t),i._sqlite3_realloc64=(e,t)=>(i._sqlite3_realloc64=m.sqlite3_realloc64)(e,t),i._sqlite3_value_text=e=>(i._sqlite3_value_text=m.sqlite3_value_text)(e),i._sqlite3_randomness=(e,t)=>(i._sqlite3_randomness=m.sqlite3_randomness)(e,t),i._sqlite3_stricmp=(e,t)=>(i._sqlite3_stricmp=m.sqlite3_stricmp)(e,t),i._sqlite3_strnicmp=(e,t,n)=>(i._sqlite3_strnicmp=m.sqlite3_strnicmp)(e,t,n),i._sqlite3_uri_parameter=(e,t)=>(i._sqlite3_uri_parameter=m.sqlite3_uri_parameter)(e,t),i._sqlite3_uri_boolean=(e,t,n)=>(i._sqlite3_uri_boolean=m.sqlite3_uri_boolean)(e,t,n),i._sqlite3_serialize=(e,t,n,r)=>(i._sqlite3_serialize=m.sqlite3_serialize)(e,t,n,r),i._sqlite3_prepare_v2=(e,t,n,r,s)=>(i._sqlite3_prepare_v2=m.sqlite3_prepare_v2)(e,t,n,r,s),i._sqlite3_step=e=>(i._sqlite3_step=m.sqlite3_step)(e),i._sqlite3_column_int64=(e,t)=>(i._sqlite3_column_int64=m.sqlite3_column_int64)(e,t),i._sqlite3_reset=e=>(i._sqlite3_reset=m.sqlite3_reset)(e),i._sqlite3_exec=(e,t,n,r,s)=>(i._sqlite3_exec=m.sqlite3_exec)(e,t,n,r,s),i._sqlite3_column_int=(e,t)=>(i._sqlite3_column_int=m.sqlite3_column_int)(e,t),i._sqlite3_finalize=e=>(i._sqlite3_finalize=m.sqlite3_finalize)(e),i._sqlite3_file_control=(e,t,n,r)=>(i._sqlite3_file_control=m.sqlite3_file_control)(e,t,n,r),i._sqlite3_column_name=(e,t)=>(i._sqlite3_column_name=m.sqlite3_column_name)(e,t),i._sqlite3_column_text=(e,t)=>(i._sqlite3_column_text=m.sqlite3_column_text)(e,t),i._sqlite3_column_type=(e,t)=>(i._sqlite3_column_type=m.sqlite3_column_type)(e,t),i._sqlite3_errmsg=e=>(i._sqlite3_errmsg=m.sqlite3_errmsg)(e),i._sqlite3_deserialize=(e,t,n,r,s,o)=>(i._sqlite3_deserialize=m.sqlite3_deserialize)(e,t,n,r,s,o),i._sqlite3_clear_bindings=e=>(i._sqlite3_clear_bindings=m.sqlite3_clear_bindings)(e),i._sqlite3_value_blob=e=>(i._sqlite3_value_blob=m.sqlite3_value_blob)(e),i._sqlite3_value_bytes=e=>(i._sqlite3_value_bytes=m.sqlite3_value_bytes)(e),i._sqlite3_value_double=e=>(i._sqlite3_value_double=m.sqlite3_value_double)(e),i._sqlite3_value_int=e=>(i._sqlite3_value_int=m.sqlite3_value_int)(e),i._sqlite3_value_int64=e=>(i._sqlite3_value_int64=m.sqlite3_value_int64)(e),i._sqlite3_value_subtype=e=>(i._sqlite3_value_subtype=m.sqlite3_value_subtype)(e),i._sqlite3_value_pointer=(e,t)=>(i._sqlite3_value_pointer=m.sqlite3_value_pointer)(e,t),i._sqlite3_value_type=e=>(i._sqlite3_value_type=m.sqlite3_value_type)(e),i._sqlite3_value_nochange=e=>(i._sqlite3_value_nochange=m.sqlite3_value_nochange)(e),i._sqlite3_value_frombind=e=>(i._sqlite3_value_frombind=m.sqlite3_value_frombind)(e),i._sqlite3_value_dup=e=>(i._sqlite3_value_dup=m.sqlite3_value_dup)(e),i._sqlite3_value_free=e=>(i._sqlite3_value_free=m.sqlite3_value_free)(e),i._sqlite3_result_blob=(e,t,n,r)=>(i._sqlite3_result_blob=m.sqlite3_result_blob)(e,t,n,r),i._sqlite3_result_error_toobig=e=>(i._sqlite3_result_error_toobig=m.sqlite3_result_error_toobig)(e),i._sqlite3_result_error_nomem=e=>(i._sqlite3_result_error_nomem=m.sqlite3_result_error_nomem)(e),i._sqlite3_result_double=(e,t)=>(i._sqlite3_result_double=m.sqlite3_result_double)(e,t),i._sqlite3_result_error=(e,t,n)=>(i._sqlite3_result_error=m.sqlite3_result_error)(e,t,n),i._sqlite3_result_int=(e,t)=>(i._sqlite3_result_int=m.sqlite3_result_int)(e,t),i._sqlite3_result_int64=(e,t)=>(i._sqlite3_result_int64=m.sqlite3_result_int64)(e,t),i._sqlite3_result_null=e=>(i._sqlite3_result_null=m.sqlite3_result_null)(e),i._sqlite3_result_pointer=(e,t,n,r)=>(i._sqlite3_result_pointer=m.sqlite3_result_pointer)(e,t,n,r),i._sqlite3_result_subtype=(e,t)=>(i._sqlite3_result_subtype=m.sqlite3_result_subtype)(e,t),i._sqlite3_result_text=(e,t,n,r)=>(i._sqlite3_result_text=m.sqlite3_result_text)(e,t,n,r),i._sqlite3_result_zeroblob=(e,t)=>(i._sqlite3_result_zeroblob=m.sqlite3_result_zeroblob)(e,t),i._sqlite3_result_zeroblob64=(e,t)=>(i._sqlite3_result_zeroblob64=m.sqlite3_result_zeroblob64)(e,t),i._sqlite3_result_error_code=(e,t)=>(i._sqlite3_result_error_code=m.sqlite3_result_error_code)(e,t),i._sqlite3_user_data=e=>(i._sqlite3_user_data=m.sqlite3_user_data)(e),i._sqlite3_context_db_handle=e=>(i._sqlite3_context_db_handle=m.sqlite3_context_db_handle)(e),i._sqlite3_vtab_nochange=e=>(i._sqlite3_vtab_nochange=m.sqlite3_vtab_nochange)(e),i._sqlite3_vtab_in_first=(e,t)=>(i._sqlite3_vtab_in_first=m.sqlite3_vtab_in_first)(e,t),i._sqlite3_vtab_in_next=(e,t)=>(i._sqlite3_vtab_in_next=m.sqlite3_vtab_in_next)(e,t),i._sqlite3_aggregate_context=(e,t)=>(i._sqlite3_aggregate_context=m.sqlite3_aggregate_context)(e,t),i._sqlite3_get_auxdata=(e,t)=>(i._sqlite3_get_auxdata=m.sqlite3_get_auxdata)(e,t),i._sqlite3_set_auxdata=(e,t,n,r)=>(i._sqlite3_set_auxdata=m.sqlite3_set_auxdata)(e,t,n,r),i._sqlite3_column_count=e=>(i._sqlite3_column_count=m.sqlite3_column_count)(e),i._sqlite3_data_count=e=>(i._sqlite3_data_count=m.sqlite3_data_count)(e),i._sqlite3_column_blob=(e,t)=>(i._sqlite3_column_blob=m.sqlite3_column_blob)(e,t),i._sqlite3_column_bytes=(e,t)=>(i._sqlite3_column_bytes=m.sqlite3_column_bytes)(e,t),i._sqlite3_column_double=(e,t)=>(i._sqlite3_column_double=m.sqlite3_column_double)(e,t),i._sqlite3_column_value=(e,t)=>(i._sqlite3_column_value=m.sqlite3_column_value)(e,t),i._sqlite3_column_decltype=(e,t)=>(i._sqlite3_column_decltype=m.sqlite3_column_decltype)(e,t),i._sqlite3_bind_blob=(e,t,n,r,s)=>(i._sqlite3_bind_blob=m.sqlite3_bind_blob)(e,t,n,r,s),i._sqlite3_bind_double=(e,t,n)=>(i._sqlite3_bind_double=m.sqlite3_bind_double)(e,t,n),i._sqlite3_bind_int=(e,t,n)=>(i._sqlite3_bind_int=m.sqlite3_bind_int)(e,t,n),i._sqlite3_bind_int64=(e,t,n)=>(i._sqlite3_bind_int64=m.sqlite3_bind_int64)(e,t,n),i._sqlite3_bind_null=(e,t)=>(i._sqlite3_bind_null=m.sqlite3_bind_null)(e,t),i._sqlite3_bind_pointer=(e,t,n,r,s)=>(i._sqlite3_bind_pointer=m.sqlite3_bind_pointer)(e,t,n,r,s),i._sqlite3_bind_text=(e,t,n,r,s)=>(i._sqlite3_bind_text=m.sqlite3_bind_text)(e,t,n,r,s),i._sqlite3_bind_parameter_count=e=>(i._sqlite3_bind_parameter_count=m.sqlite3_bind_parameter_count)(e),i._sqlite3_bind_parameter_name=(e,t)=>(i._sqlite3_bind_parameter_name=m.sqlite3_bind_parameter_name)(e,t),i._sqlite3_bind_parameter_index=(e,t)=>(i._sqlite3_bind_parameter_index=m.sqlite3_bind_parameter_index)(e,t),i._sqlite3_db_handle=e=>(i._sqlite3_db_handle=m.sqlite3_db_handle)(e),i._sqlite3_stmt_readonly=e=>(i._sqlite3_stmt_readonly=m.sqlite3_stmt_readonly)(e),i._sqlite3_stmt_isexplain=e=>(i._sqlite3_stmt_isexplain=m.sqlite3_stmt_isexplain)(e),i._sqlite3_stmt_explain=(e,t)=>(i._sqlite3_stmt_explain=m.sqlite3_stmt_explain)(e,t),i._sqlite3_stmt_busy=e=>(i._sqlite3_stmt_busy=m.sqlite3_stmt_busy)(e),i._sqlite3_stmt_status=(e,t,n)=>(i._sqlite3_stmt_status=m.sqlite3_stmt_status)(e,t,n),i._sqlite3_sql=e=>(i._sqlite3_sql=m.sqlite3_sql)(e),i._sqlite3_expanded_sql=e=>(i._sqlite3_expanded_sql=m.sqlite3_expanded_sql)(e),i._sqlite3_preupdate_old=(e,t,n)=>(i._sqlite3_preupdate_old=m.sqlite3_preupdate_old)(e,t,n),i._sqlite3_preupdate_count=e=>(i._sqlite3_preupdate_count=m.sqlite3_preupdate_count)(e),i._sqlite3_preupdate_depth=e=>(i._sqlite3_preupdate_depth=m.sqlite3_preupdate_depth)(e),i._sqlite3_preupdate_blobwrite=e=>(i._sqlite3_preupdate_blobwrite=m.sqlite3_preupdate_blobwrite)(e),i._sqlite3_preupdate_new=(e,t,n)=>(i._sqlite3_preupdate_new=m.sqlite3_preupdate_new)(e,t,n),i._sqlite3_value_numeric_type=e=>(i._sqlite3_value_numeric_type=m.sqlite3_value_numeric_type)(e),i._sqlite3_set_authorizer=(e,t,n)=>(i._sqlite3_set_authorizer=m.sqlite3_set_authorizer)(e,t,n),i._sqlite3_strglob=(e,t)=>(i._sqlite3_strglob=m.sqlite3_strglob)(e,t),i._sqlite3_strlike=(e,t,n)=>(i._sqlite3_strlike=m.sqlite3_strlike)(e,t,n),i._sqlite3_auto_extension=e=>(i._sqlite3_auto_extension=m.sqlite3_auto_extension)(e),i._sqlite3_cancel_auto_extension=e=>(i._sqlite3_cancel_auto_extension=m.sqlite3_cancel_auto_extension)(e),i._sqlite3_reset_auto_extension=()=>(i._sqlite3_reset_auto_extension=m.sqlite3_reset_auto_extension)(),i._sqlite3_prepare_v3=(e,t,n,r,s,o)=>(i._sqlite3_prepare_v3=m.sqlite3_prepare_v3)(e,t,n,r,s,o),i._sqlite3_create_module=(e,t,n,r)=>(i._sqlite3_create_module=m.sqlite3_create_module)(e,t,n,r),i._sqlite3_create_module_v2=(e,t,n,r,s)=>(i._sqlite3_create_module_v2=m.sqlite3_create_module_v2)(e,t,n,r,s),i._sqlite3_drop_modules=(e,t)=>(i._sqlite3_drop_modules=m.sqlite3_drop_modules)(e,t),i._sqlite3_declare_vtab=(e,t)=>(i._sqlite3_declare_vtab=m.sqlite3_declare_vtab)(e,t),i._sqlite3_vtab_on_conflict=e=>(i._sqlite3_vtab_on_conflict=m.sqlite3_vtab_on_conflict)(e),i._sqlite3_vtab_collation=(e,t)=>(i._sqlite3_vtab_collation=m.sqlite3_vtab_collation)(e,t),i._sqlite3_vtab_in=(e,t,n)=>(i._sqlite3_vtab_in=m.sqlite3_vtab_in)(e,t,n),i._sqlite3_vtab_rhs_value=(e,t,n)=>(i._sqlite3_vtab_rhs_value=m.sqlite3_vtab_rhs_value)(e,t,n),i._sqlite3_vtab_distinct=e=>(i._sqlite3_vtab_distinct=m.sqlite3_vtab_distinct)(e),i._sqlite3_keyword_name=(e,t,n)=>(i._sqlite3_keyword_name=m.sqlite3_keyword_name)(e,t,n),i._sqlite3_keyword_count=()=>(i._sqlite3_keyword_count=m.sqlite3_keyword_count)(),i._sqlite3_keyword_check=(e,t)=>(i._sqlite3_keyword_check=m.sqlite3_keyword_check)(e,t),i._sqlite3_complete=e=>(i._sqlite3_complete=m.sqlite3_complete)(e),i._sqlite3_libversion=()=>(i._sqlite3_libversion=m.sqlite3_libversion)(),i._sqlite3_libversion_number=()=>(i._sqlite3_libversion_number=m.sqlite3_libversion_number)(),i._sqlite3_shutdown=()=>(i._sqlite3_shutdown=m.sqlite3_shutdown)(),i._sqlite3_last_insert_rowid=e=>(i._sqlite3_last_insert_rowid=m.sqlite3_last_insert_rowid)(e),i._sqlite3_set_last_insert_rowid=(e,t)=>(i._sqlite3_set_last_insert_rowid=m.sqlite3_set_last_insert_rowid)(e,t),i._sqlite3_changes64=e=>(i._sqlite3_changes64=m.sqlite3_changes64)(e),i._sqlite3_changes=e=>(i._sqlite3_changes=m.sqlite3_changes)(e),i._sqlite3_total_changes64=e=>(i._sqlite3_total_changes64=m.sqlite3_total_changes64)(e),i._sqlite3_total_changes=e=>(i._sqlite3_total_changes=m.sqlite3_total_changes)(e),i._sqlite3_txn_state=(e,t)=>(i._sqlite3_txn_state=m.sqlite3_txn_state)(e,t),i._sqlite3_close_v2=e=>(i._sqlite3_close_v2=m.sqlite3_close_v2)(e),i._sqlite3_busy_handler=(e,t,n)=>(i._sqlite3_busy_handler=m.sqlite3_busy_handler)(e,t,n),i._sqlite3_progress_handler=(e,t,n,r)=>(i._sqlite3_progress_handler=m.sqlite3_progress_handler)(e,t,n,r),i._sqlite3_busy_timeout=(e,t)=>(i._sqlite3_busy_timeout=m.sqlite3_busy_timeout)(e,t),i._sqlite3_interrupt=e=>(i._sqlite3_interrupt=m.sqlite3_interrupt)(e),i._sqlite3_is_interrupted=e=>(i._sqlite3_is_interrupted=m.sqlite3_is_interrupted)(e),i._sqlite3_create_function=(e,t,n,r,s,o,d,q)=>(i._sqlite3_create_function=m.sqlite3_create_function)(e,t,n,r,s,o,d,q),i._sqlite3_create_function_v2=(e,t,n,r,s,o,d,q,L)=>(i._sqlite3_create_function_v2=m.sqlite3_create_function_v2)(e,t,n,r,s,o,d,q,L),i._sqlite3_create_window_function=(e,t,n,r,s,o,d,q,L,C)=>(i._sqlite3_create_window_function=m.sqlite3_create_window_function)(e,t,n,r,s,o,d,q,L,C),i._sqlite3_overload_function=(e,t,n)=>(i._sqlite3_overload_function=m.sqlite3_overload_function)(e,t,n),i._sqlite3_trace_v2=(e,t,n,r)=>(i._sqlite3_trace_v2=m.sqlite3_trace_v2)(e,t,n,r),i._sqlite3_commit_hook=(e,t,n)=>(i._sqlite3_commit_hook=m.sqlite3_commit_hook)(e,t,n),i._sqlite3_update_hook=(e,t,n)=>(i._sqlite3_update_hook=m.sqlite3_update_hook)(e,t,n),i._sqlite3_rollback_hook=(e,t,n)=>(i._sqlite3_rollback_hook=m.sqlite3_rollback_hook)(e,t,n),i._sqlite3_preupdate_hook=(e,t,n)=>(i._sqlite3_preupdate_hook=m.sqlite3_preupdate_hook)(e,t,n),i._sqlite3_error_offset=e=>(i._sqlite3_error_offset=m.sqlite3_error_offset)(e),i._sqlite3_errcode=e=>(i._sqlite3_errcode=m.sqlite3_errcode)(e),i._sqlite3_extended_errcode=e=>(i._sqlite3_extended_errcode=m.sqlite3_extended_errcode)(e),i._sqlite3_errstr=e=>(i._sqlite3_errstr=m.sqlite3_errstr)(e),i._sqlite3_limit=(e,t,n)=>(i._sqlite3_limit=m.sqlite3_limit)(e,t,n),i._sqlite3_open=(e,t)=>(i._sqlite3_open=m.sqlite3_open)(e,t),i._sqlite3_open_v2=(e,t,n,r)=>(i._sqlite3_open_v2=m.sqlite3_open_v2)(e,t,n,r),i._sqlite3_create_collation=(e,t,n,r,s)=>(i._sqlite3_create_collation=m.sqlite3_create_collation)(e,t,n,r,s),i._sqlite3_create_collation_v2=(e,t,n,r,s,o)=>(i._sqlite3_create_collation_v2=m.sqlite3_create_collation_v2)(e,t,n,r,s,o),i._sqlite3_collation_needed=(e,t,n)=>(i._sqlite3_collation_needed=m.sqlite3_collation_needed)(e,t,n),i._sqlite3_get_autocommit=e=>(i._sqlite3_get_autocommit=m.sqlite3_get_autocommit)(e),i._sqlite3_table_column_metadata=(e,t,n,r,s,o,d,q,L)=>(i._sqlite3_table_column_metadata=m.sqlite3_table_column_metadata)(e,t,n,r,s,o,d,q,L),i._sqlite3_extended_result_codes=(e,t)=>(i._sqlite3_extended_result_codes=m.sqlite3_extended_result_codes)(e,t),i._sqlite3_uri_key=(e,t)=>(i._sqlite3_uri_key=m.sqlite3_uri_key)(e,t),i._sqlite3_uri_int64=(e,t,n)=>(i._sqlite3_uri_int64=m.sqlite3_uri_int64)(e,t,n),i._sqlite3_db_name=(e,t)=>(i._sqlite3_db_name=m.sqlite3_db_name)(e,t),i._sqlite3_db_filename=(e,t)=>(i._sqlite3_db_filename=m.sqlite3_db_filename)(e,t),i._sqlite3_db_readonly=(e,t)=>(i._sqlite3_db_readonly=m.sqlite3_db_readonly)(e,t),i._sqlite3_compileoption_used=e=>(i._sqlite3_compileoption_used=m.sqlite3_compileoption_used)(e),i._sqlite3_compileoption_get=e=>(i._sqlite3_compileoption_get=m.sqlite3_compileoption_get)(e),i._sqlite3session_diff=(e,t,n,r)=>(i._sqlite3session_diff=m.sqlite3session_diff)(e,t,n,r),i._sqlite3session_attach=(e,t)=>(i._sqlite3session_attach=m.sqlite3session_attach)(e,t),i._sqlite3session_create=(e,t,n)=>(i._sqlite3session_create=m.sqlite3session_create)(e,t,n),i._sqlite3session_delete=e=>(i._sqlite3session_delete=m.sqlite3session_delete)(e),i._sqlite3session_table_filter=(e,t,n)=>(i._sqlite3session_table_filter=m.sqlite3session_table_filter)(e,t,n),i._sqlite3session_changeset=(e,t,n)=>(i._sqlite3session_changeset=m.sqlite3session_changeset)(e,t,n),i._sqlite3session_changeset_strm=(e,t,n)=>(i._sqlite3session_changeset_strm=m.sqlite3session_changeset_strm)(e,t,n),i._sqlite3session_patchset_strm=(e,t,n)=>(i._sqlite3session_patchset_strm=m.sqlite3session_patchset_strm)(e,t,n),i._sqlite3session_patchset=(e,t,n)=>(i._sqlite3session_patchset=m.sqlite3session_patchset)(e,t,n),i._sqlite3session_enable=(e,t)=>(i._sqlite3session_enable=m.sqlite3session_enable)(e,t),i._sqlite3session_indirect=(e,t)=>(i._sqlite3session_indirect=m.sqlite3session_indirect)(e,t),i._sqlite3session_isempty=e=>(i._sqlite3session_isempty=m.sqlite3session_isempty)(e),i._sqlite3session_memory_used=e=>(i._sqlite3session_memory_used=m.sqlite3session_memory_used)(e),i._sqlite3session_object_config=(e,t,n)=>(i._sqlite3session_object_config=m.sqlite3session_object_config)(e,t,n),i._sqlite3session_changeset_size=e=>(i._sqlite3session_changeset_size=m.sqlite3session_changeset_size)(e),i._sqlite3changeset_start=(e,t,n)=>(i._sqlite3changeset_start=m.sqlite3changeset_start)(e,t,n),i._sqlite3changeset_start_v2=(e,t,n,r)=>(i._sqlite3changeset_start_v2=m.sqlite3changeset_start_v2)(e,t,n,r),i._sqlite3changeset_start_strm=(e,t,n)=>(i._sqlite3changeset_start_strm=m.sqlite3changeset_start_strm)(e,t,n),i._sqlite3changeset_start_v2_strm=(e,t,n,r)=>(i._sqlite3changeset_start_v2_strm=m.sqlite3changeset_start_v2_strm)(e,t,n,r),i._sqlite3changeset_next=e=>(i._sqlite3changeset_next=m.sqlite3changeset_next)(e),i._sqlite3changeset_op=(e,t,n,r,s)=>(i._sqlite3changeset_op=m.sqlite3changeset_op)(e,t,n,r,s),i._sqlite3changeset_pk=(e,t,n)=>(i._sqlite3changeset_pk=m.sqlite3changeset_pk)(e,t,n),i._sqlite3changeset_old=(e,t,n)=>(i._sqlite3changeset_old=m.sqlite3changeset_old)(e,t,n),i._sqlite3changeset_new=(e,t,n)=>(i._sqlite3changeset_new=m.sqlite3changeset_new)(e,t,n),i._sqlite3changeset_conflict=(e,t,n)=>(i._sqlite3changeset_conflict=m.sqlite3changeset_conflict)(e,t,n),i._sqlite3changeset_fk_conflicts=(e,t)=>(i._sqlite3changeset_fk_conflicts=m.sqlite3changeset_fk_conflicts)(e,t),i._sqlite3changeset_finalize=e=>(i._sqlite3changeset_finalize=m.sqlite3changeset_finalize)(e),i._sqlite3changeset_invert=(e,t,n,r)=>(i._sqlite3changeset_invert=m.sqlite3changeset_invert)(e,t,n,r),i._sqlite3changeset_invert_strm=(e,t,n,r)=>(i._sqlite3changeset_invert_strm=m.sqlite3changeset_invert_strm)(e,t,n,r),i._sqlite3changeset_apply_v2=(e,t,n,r,s,o,d,q,L)=>(i._sqlite3changeset_apply_v2=m.sqlite3changeset_apply_v2)(e,t,n,r,s,o,d,q,L),i._sqlite3changeset_apply=(e,t,n,r,s,o)=>(i._sqlite3changeset_apply=m.sqlite3changeset_apply)(e,t,n,r,s,o),i._sqlite3changeset_apply_v2_strm=(e,t,n,r,s,o,d,q,L)=>(i._sqlite3changeset_apply_v2_strm=m.sqlite3changeset_apply_v2_strm)(e,t,n,r,s,o,d,q,L),i._sqlite3changeset_apply_strm=(e,t,n,r,s,o)=>(i._sqlite3changeset_apply_strm=m.sqlite3changeset_apply_strm)(e,t,n,r,s,o),i._sqlite3changegroup_new=e=>(i._sqlite3changegroup_new=m.sqlite3changegroup_new)(e),i._sqlite3changegroup_add=(e,t,n)=>(i._sqlite3changegroup_add=m.sqlite3changegroup_add)(e,t,n),i._sqlite3changegroup_output=(e,t,n)=>(i._sqlite3changegroup_output=m.sqlite3changegroup_output)(e,t,n),i._sqlite3changegroup_add_strm=(e,t,n)=>(i._sqlite3changegroup_add_strm=m.sqlite3changegroup_add_strm)(e,t,n),i._sqlite3changegroup_output_strm=(e,t,n)=>(i._sqlite3changegroup_output_strm=m.sqlite3changegroup_output_strm)(e,t,n),i._sqlite3changegroup_delete=e=>(i._sqlite3changegroup_delete=m.sqlite3changegroup_delete)(e),i._sqlite3changeset_concat=(e,t,n,r,s,o)=>(i._sqlite3changeset_concat=m.sqlite3changeset_concat)(e,t,n,r,s,o),i._sqlite3changeset_concat_strm=(e,t,n,r,s,o)=>(i._sqlite3changeset_concat_strm=m.sqlite3changeset_concat_strm)(e,t,n,r,s,o),i._sqlite3session_config=(e,t)=>(i._sqlite3session_config=m.sqlite3session_config)(e,t),i._sqlite3_sourceid=()=>(i._sqlite3_sourceid=m.sqlite3_sourceid)(),i._sqlite3__wasm_pstack_ptr=()=>(i._sqlite3__wasm_pstack_ptr=m.sqlite3__wasm_pstack_ptr)(),i._sqlite3__wasm_pstack_restore=e=>(i._sqlite3__wasm_pstack_restore=m.sqlite3__wasm_pstack_restore)(e),i._sqlite3__wasm_pstack_alloc=e=>(i._sqlite3__wasm_pstack_alloc=m.sqlite3__wasm_pstack_alloc)(e),i._sqlite3__wasm_pstack_remaining=()=>(i._sqlite3__wasm_pstack_remaining=m.sqlite3__wasm_pstack_remaining)(),i._sqlite3__wasm_pstack_quota=()=>(i._sqlite3__wasm_pstack_quota=m.sqlite3__wasm_pstack_quota)(),i._sqlite3__wasm_db_error=(e,t,n)=>(i._sqlite3__wasm_db_error=m.sqlite3__wasm_db_error)(e,t,n),i._sqlite3__wasm_test_struct=e=>(i._sqlite3__wasm_test_struct=m.sqlite3__wasm_test_struct)(e),i._sqlite3__wasm_enum_json=()=>(i._sqlite3__wasm_enum_json=m.sqlite3__wasm_enum_json)(),i._sqlite3__wasm_vfs_unlink=(e,t)=>(i._sqlite3__wasm_vfs_unlink=m.sqlite3__wasm_vfs_unlink)(e,t),i._sqlite3__wasm_db_vfs=(e,t)=>(i._sqlite3__wasm_db_vfs=m.sqlite3__wasm_db_vfs)(e,t),i._sqlite3__wasm_db_reset=e=>(i._sqlite3__wasm_db_reset=m.sqlite3__wasm_db_reset)(e),i._sqlite3__wasm_db_export_
2chunked=(e,t)=>(i._sqlite3__wasm_db_export_chunked=m.sqlite3__wasm_db_export_chunked)(e,t),i._sqlite3__wasm_db_serialize=(e,t,n,r,s)=>(i._sqlite3__wasm_db_serialize=m.sqlite3__wasm_db_serialize)(e,t,n,r,s),i._sqlite3__wasm_vfs_create_file=(e,t,n,r)=>(i._sqlite3__wasm_vfs_create_file=m.sqlite3__wasm_vfs_create_file)(e,t,n,r),i._sqlite3__wasm_posix_create_file=(e,t,n)=>(i._sqlite3__wasm_posix_create_file=m.sqlite3__wasm_posix_create_file)(e,t,n),i._sqlite3__wasm_kvvfsMakeKeyOnPstack=(e,t)=>(i._sqlite3__wasm_kvvfsMakeKeyOnPstack=m.sqlite3__wasm_kvvfsMakeKeyOnPstack)(e,t),i._sqlite3__wasm_kvvfs_methods=()=>(i._sqlite3__wasm_kvvfs_methods=m.sqlite3__wasm_kvvfs_methods)(),i._sqlite3__wasm_vtab_config=(e,t,n)=>(i._sqlite3__wasm_vtab_config=m.sqlite3__wasm_vtab_config)(e,t,n),i._sqlite3__wasm_db_config_ip=(e,t,n,r)=>(i._sqlite3__wasm_db_config_ip=m.sqlite3__wasm_db_config_ip)(e,t,n,r),i._sqlite3__wasm_db_config_pii=(e,t,n,r,s)=>(i._sqlite3__wasm_db_config_pii=m.sqlite3__wasm_db_config_pii)(e,t,n,r,s),i._sqlite3__wasm_db_config_s=(e,t,n)=>(i._sqlite3__wasm_db_config_s=m.sqlite3__wasm_db_config_s)(e,t,n),i._sqlite3__wasm_config_i=(e,t)=>(i._sqlite3__wasm_config_i=m.sqlite3__wasm_config_i)(e,t),i._sqlite3__wasm_config_ii=(e,t,n)=>(i._sqlite3__wasm_config_ii=m.sqlite3__wasm_config_ii)(e,t,n),i._sqlite3__wasm_config_j=(e,t)=>(i._sqlite3__wasm_config_j=m.sqlite3__wasm_config_j)(e,t),i._sqlite3__wasm_qfmt_token=(e,t)=>(i._sqlite3__wasm_qfmt_token=m.sqlite3__wasm_qfmt_token)(e,t),i._sqlite3__wasm_init_wasmfs=e=>(i._sqlite3__wasm_init_wasmfs=m.sqlite3__wasm_init_wasmfs)(e),i._sqlite3__wasm_test_intptr=e=>(i._sqlite3__wasm_test_intptr=m.sqlite3__wasm_test_intptr)(e),i._sqlite3__wasm_test_voidptr=e=>(i._sqlite3__wasm_test_voidptr=m.sqlite3__wasm_test_voidptr)(e),i._sqlite3__wasm_test_int64_max=()=>(i._sqlite3__wasm_test_int64_max=m.sqlite3__wasm_test_int64_max)(),i._sqlite3__wasm_test_int64_min=()=>(i._sqlite3__wasm_test_int64_min=m.sqlite3__wasm_test_int64_min)(),i._sqlite3__wasm_test_int64_times2=e=>(i._sqlite3__wasm_test_int64_times2=m.sqlite3__wasm_test_int64_times2)(e),i._sqlite3__wasm_test_int64_minmax=(e,t)=>(i._sqlite3__wasm_test_int64_minmax=m.sqlite3__wasm_test_int64_minmax)(e,t),i._sqlite3__wasm_test_int64ptr=e=>(i._sqlite3__wasm_test_int64ptr=m.sqlite3__wasm_test_int64ptr)(e),i._sqlite3__wasm_test_stack_overflow=e=>(i._sqlite3__wasm_test_stack_overflow=m.sqlite3__wasm_test_stack_overflow)(e),i._sqlite3__wasm_test_str_hello=e=>(i._sqlite3__wasm_test_str_hello=m.sqlite3__wasm_test_str_hello)(e),i._sqlite3__wasm_SQLTester_strglob=(e,t)=>(i._sqlite3__wasm_SQLTester_strglob=m.sqlite3__wasm_SQLTester_strglob)(e,t),i._malloc=e=>(i._malloc=m.malloc)(e),i._free=e=>(i._free=m.free)(e),i._realloc=(e,t)=>(i._realloc=m.realloc)(e,t);var Pt=(e,t)=>(Pt=m.emscripten_builtin_memalign)(e,t);i.wasmMemory=Be;var st,Lt;Xe=function e(){st||Ct(),st||(Xe=e)};function Ct(){if(Ue>0||!Lt&&(Lt=1,Bt(),Ue>0))return;function e(){var t;st||(st=1,i.calledRun=1,!gt&&(Ut(),ye(i),(t=i.onRuntimeInitialized)==null||t.call(i),zt()))}i.setStatus?(i.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>i.setStatus(""),1),e()},1)):e()}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Ct(),i.runSQLite3PostLoadInit=function(e){if(globalThis.sqlite3ApiBootstrap=function t(n=globalThis.sqlite3ApiConfig||t.defaultConfig){if(t.sqlite3)return(t.sqlite3.config||console).warn("sqlite3ApiBootstrap() called multiple times.","Config and external initializers are ignored on calls after the first."),t.sqlite3;const r=Object.assign(Object.create(null),{exports:void 0,memory:void 0,bigIntEnabled:typeof i<"u"&&i.HEAPU64?!0:!!globalThis.BigInt64Array,debug:console.debug.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),log:console.log.bind(console),wasmfsOpfsDir:"/opfs",useStdAlloc:!1},n||{});Object.assign(r,{allocExportName:r.useStdAlloc?"malloc":"sqlite3_malloc",deallocExportName:r.useStdAlloc?"free":"sqlite3_free",reallocExportName:r.useStdAlloc?"realloc":"sqlite3_realloc"},r),["exports","memory","wasmfsOpfsDir"].forEach(l=>{typeof r[l]=="function"&&(r[l]=r[l]())}),delete globalThis.sqlite3ApiConfig,delete t.defaultConfig;const s=Object.create(null),o=Object.create(null),d=l=>s.sqlite3_js_rc_str&&s.sqlite3_js_rc_str(l)||"Unknown result code #"+l,q=l=>typeof l=="number"&&l===(l|0);
2class L extends Error{constructor(..._){let b;if(_.length)if(q(_[0]))if(b=_[0],_.length===1)super(d(_[0]));else{const y=d(b);typeof _[1]=="object"?super(y,_[1]):(_[0]=y+":",super(_.join(" ")))}else _.length===2&&typeof _[1]=="object"?super(..._):super(_.join(" "));this.resultCode=b||s.SQLITE_ERROR,this.name="SQLite3Error"}}L.toss=(...l)=>{throw new L(...l)};const C=L.toss;r.wasmfsOpfsDir&&!/^\/[^/]+$/.test(r.wasmfsOpfsDir)&&C("config.wasmfsOpfsDir must be falsy or in the form '/dir-name'.");const Q=l=>typeof l!="bigint"&&l===(l|0)&&l<=2147483647&&l>=-2147483648,V=function l(_){return l._max||(l._max=BigInt("0x7fffffffffffffff"),l._min=~l._max),_>=l._min&&_<=l._max},P=l=>l>=-0x7fffffffn-1n&&l<=0x7fffffffn,I=function l(_){return l._min||(l._min=Number.MIN_SAFE_INTEGER,l._max=Number.MAX_SAFE_INTEGER),_>=l._min&&_<=l._max},N=l=>l&&l.constructor&&Q(l.constructor.BYTES_PER_ELEMENT)?l:!1,w=typeof SharedArrayBuffer>"u"?function(){}:SharedArrayBuffer,x=l=>l.buffer instanceof w,T=(l,_,b)=>x(l)?l.slice(_,b):l.subarray(_,b),F=l=>l&&(l instanceof Uint8Array||l instanceof Int8Array||l instanceof ArrayBuffer),D=l=>l&&(l instanceof Uint8Array||l instanceof Int8Array||l instanceof ArrayBuffer),A=l=>F(l)||C("Value is not of a supported TypedArray type."),j=new TextDecoder("utf-8"),H=function(l,_,b){return j.decode(T(l,_,b))},c=function(l){return D(l)?H(l instanceof ArrayBuffer?new Uint8Array(l):l):Array.isArray(l)?l.join(""):(o.isPtr(l)&&(l=o.cstrToJs(l)),l)};class g extends Error{constructor(..._){_.length===2&&typeof _[1]=="object"?super(..._):_.length?super(_.join(" ")):super("Allocation failed."),this.resultCode=s.SQLITE_NOMEM,this.name="WasmAllocError"}}g.toss=(...l)=>{throw new g(...l)},Object.assign(s,{sqlite3_bind_blob:void 0,sqlite3_bind_text:void 0,sqlite3_create_function_v2:(l,_,b,y,U,J,te,oe,re)=>{},sqlite3_create_function:(l,_,b,y,U,J,te,oe)=>{},sqlite3_create_window_function:(l,_,b,y,U,J,te,oe,re,ie)=>{},sqlite3_prepare_v3:(l,_,b,y,U,J)=>{},sqlite3_prepare_v2:(l,_,b,y,U)=>{},sqlite3_exec:(l,_,b,y,U)=>{},sqlite3_randomness:(l,_)=>{}});const E={affirmBindableTypedArray:A,flexibleString:c,bigIntFits32:P,bigIntFits64:V,bigIntFitsDouble:I,isBindableTypedArray:F,isInt32:Q,isSQLableTypedArray:D,isTypedArray:N,typedArrayToString:H,isUIThread:()=>globalThis.window===globalThis&&!!globalThis.document,isSharedTypedArray:x,toss:function(...l){throw new Error(l.join(" "))},toss3:C,typedArrayPart:T,affirmDbHeader:function(l){l instanceof ArrayBuffer&&(l=new Uint8Array(l));const _="SQLite format 3";_.length>l.byteLength&&C("Input does not contain an SQLite3 database header.");for(let b=0;b<_.length;++b)_.charCodeAt(b)!==l[b]&&C("Input does not contain an SQLite3 database header.")},affirmIsDb:function(l){l instanceof ArrayBuffer&&(l=new Uint8Array(l));const _=l.byteLength;(_<512||_%512!==0)&&C("Byte array size",_,"is invalid for an SQLite3 db."),E.affirmDbHeader(l)}};Object.assign(o,{ptrSizeof:r.wasmPtrSizeof||4,ptrIR:r.wasmPtrIR||"i32",bigIntEnabled:!!r.bigIntEnabled,exports:r.exports||C("Missing API config.exports (WASM module exports)."),memory:r.memory||r.exports.memory||C("API config object requires a WebAssembly.Memory object","in either config.exports.memory (exported)","or config.memory (imported)."),alloc:void 0,realloc:void 0,dealloc:void 0}),o.allocFromTypedArray=function(l){l instanceof ArrayBuffer&&(l=new Uint8Array(l)),A(l);const _=o.alloc(l.byteLength||1);return o.heapForSize(l.constructor).set(l.byteLength?l:[0],_),_};{const l=r.allocExportName,_=r.deallocExportName,b=r.reallocExportName;for(const y of[l,_,b])o.exports[y]instanceof Function||C("Missing required exports[",y,"] function.");o.alloc=function y(U){return y.impl(U)||g.toss("Failed to allocate",U," bytes.")},o.alloc.impl=o.exports[l],o.realloc=function y(U,J){const te=y.impl(U,J);return J?te||g.toss("Failed to reallocate",J," bytes."):0},o.realloc.impl=o.exports[b],o.dealloc=o.exports[_]}o.compileOptionUsed=function l(_){if(arguments.length){if(Array.isArray(_)){const b={};return _.forEach(y=>{b[y]=s.sqlite3_compileoption_used(y)}),b}else if(typeof _=="object")return Object.keys(_).forEach(b=>{_[b]=s.sqlite3_compileoption_used(b)}),_}else{if(l._result)return l._result;
2l._opt||(l._rx=/^([^=]+)=(.+)/,l._rxInt=/^-?\d+$/,l._opt=function(te,oe){const re=l._rx.exec(te);oe[0]=re?re[1]:te,oe[1]=re?l._rxInt.test(re[2])?+re[2]:re[2]:!0});const b={},y=[0,0];let U=0,J;for(;J=s.sqlite3_compileoption_get(U++);)l._opt(J,y),b[y[0]]=y[1];return l._result=b}return typeof _=="string"?!!s.sqlite3_compileoption_used(_):!1},o.pstack=Object.assign(Object.create(null),{restore:o.exports.sqlite3__wasm_pstack_restore,alloc:function(l){return typeof l=="string"&&!(l=o.sizeofIR(l))&&g.toss("Invalid value for pstack.alloc(",arguments[0],")"),o.exports.sqlite3__wasm_pstack_alloc(l)||g.toss("Could not allocate",l,"bytes from the pstack.")},allocChunks:function(l,_){typeof _=="string"&&!(_=o.sizeofIR(_))&&g.toss("Invalid size value for allocChunks(",arguments[1],")");const b=o.pstack.alloc(l*_),y=[];let U=0,J=0;for(;U<l;++U,J+=_)y.push(b+J);return y},allocPtr:(l=1,_=!0)=>l===1?o.pstack.alloc(_?8:o.ptrSizeof):o.pstack.allocChunks(l,_?8:o.ptrSizeof),call:function(l){const _=o.pstack.pointer;try{return l(h)}finally{o.pstack.restore(_)}}}),Object.defineProperties(o.pstack,{pointer:{configurable:!1,iterable:!0,writeable:!1,get:o.exports.sqlite3__wasm_pstack_ptr},quota:{configurable:!1,iterable:!0,writeable:!1,get:o.exports.sqlite3__wasm_pstack_quota},remaining:{configurable:!1,iterable:!0,writeable:!1,get:o.exports.sqlite3__wasm_pstack_remaining}}),s.sqlite3_randomness=(...l)=>{if(l.length===1&&E.isTypedArray(l[0])&&l[0].BYTES_PER_ELEMENT===1){const _=l[0];if(_.byteLength===0)return o.exports.sqlite3_randomness(0,0),_;const b=o.pstack.pointer;try{let y=_.byteLength,U=0;const J=o.exports.sqlite3_randomness,te=o.heap8u(),oe=y<512?y:512,re=o.pstack.alloc(oe);do{const ie=y>oe?oe:y;J(ie,re),_.set(T(te,re,re+ie),U),y-=ie,U+=ie}while(y>0)}catch(y){console.error("Highly unexpected (and ignored!) exception in sqlite3_randomness():",y)}finally{o.pstack.restore(b)}return _}o.exports.sqlite3_randomness(...l)};let z;if(s.sqlite3_wasmfs_opfs_dir=function(){if(z!==void 0)return z;const l=r.wasmfsOpfsDir;if(!l||!globalThis.FileSystemHandle||!globalThis.FileSystemDirectoryHandle||!globalThis.FileSystemFileHandle)return z="";try{return l&&o.xCallWrapped("sqlite3__wasm_init_wasmfs","i32",["string"],l)===0?z=l:z=""}catch{return z=""}},s.sqlite3_wasmfs_filename_is_persistent=function(l){const _=s.sqlite3_wasmfs_opfs_dir();return _&&l?l.startsWith(_+"/"):!1},s.sqlite3_js_db_uses_vfs=function(l,_,b=0){try{const y=s.sqlite3_vfs_find(_);return y?l?y===s.sqlite3_js_db_vfs(l,b)?y:!1:y===s.sqlite3_vfs_find(0)?y:!1:!1}catch{return!1}},s.sqlite3_js_vfs_list=function(){const l=[];let _=s.sqlite3_vfs_find(0);for(;_;){const b=new s.sqlite3_vfs(_);l.push(o.cstrToJs(b.$zName)),_=b.$pNext,b.dispose()}return l},s.sqlite3_js_db_export=function(l,_=0){l=o.xWrap.testConvertArg("sqlite3*",l),l||C("Invalid sqlite3* argument."),o.bigIntEnabled||C("BigInt64 support is not enabled.");const b=o.scopedAllocPush();let y;try{const U=o.scopedAlloc(8+o.ptrSizeof),J=U+8,te=_?o.isPtr(_)?_:o.scopedAllocCString(""+_):0;let oe=o.exports.sqlite3__wasm_db_serialize(l,te,J,U,0);oe&&C("Database serialization failed with code",h.capi.sqlite3_js_rc_str(oe)),y=o.peekPtr(J);const re=o.peek(U,"i64");return oe=re?o.heap8u().slice(y,y+Number(re)):new Uint8Array,oe}finally{y&&o.exports.sqlite3_free(y),o.scopedAllocPop(b)}},s.sqlite3_js_db_vfs=(l,_=0)=>E.sqlite3__wasm_db_vfs(l,_),s.sqlite3_js_aggregate_context=(l,_)=>s.sqlite3_aggregate_context(l,_)||(_?g.toss("Cannot allocate",_,"bytes for sqlite3_aggregate_context()"):0),s.sqlite3_js_posix_create_file=function(l,_,b){let y;_&&o.isPtr(_)?y=_:_ instanceof ArrayBuffer||_ instanceof Uint8Array?(y=o.allocFromTypedArray(_),(arguments.length<3||!E.isInt32(b)||b<0)&&(b=_.byteLength)):L.toss("Invalid 2nd argument for sqlite3_js_posix_create_file().");try{(!E.isInt32(b)||b<0)&&L.toss("Invalid 3rd argument for sqlite3_js_posix_create_file().");const U=E.sqlite3__wasm_posix_create_file(l,y,b);U&&L.toss("Creation of file failed with sqlite3 result code",s.sqlite3_js_rc_str(U))}finally{o.dealloc(y)}},s.sqlite3_js_vfs_create_file=function(l,_,b,y){r.warn("sqlite3_js_vfs_create_file() is deprecated and","should be avoided because it can lead to C-level crashes.","See its documentation for alternative options.");let U;b?(o.isPtr(b)?U=b:b instanceof ArrayBuffer&&(b=new Uint8Array(b)),b instanceof Uint8Array?(U=o.allocFromTypedArray(b),(arguments.length<4||!E.isInt32(y)||y<0)&&(y=b.byteLength)):L.toss("Invalid 3rd argument type for sqlite3_js_vfs_create_file().")):U=0,(!E.isInt32(y)||y<0)&&(o.dealloc(U),L.toss("Invalid 4th argument for sqlite3_js_vfs_create_file()."));try{const J=E.sqlite3__wasm_vfs_create_file(l,_,U,y);J&&L.toss("Creation of file failed with sqlite3 result code",s.sqlite3_js_rc_str(J))}finally{o.dealloc(U)}},s.sqlite3_js_sql_to_string=l=>{if(typeof l=="string")return l;const _=c(v);return _===v?void 0:_},E.isUIThread()){const l=function(_){const b=Object.create(null);return b.prefix="kvvfs-"+_,b.stores=[],(_==="session"||_==="")&&b.stores.push(globalThis.sessionStorage),(_==="local"||_==="")&&b.stores.push(globalThis.localStorage),b};s.sqlite3_js_kvvfs_clear=function(_=""){let b=0;const y=l(_);
2return y.stores.forEach(U=>{const J=[];let te;for(te=0;te<U.length;++te){const oe=U.key(te);oe.startsWith(y.prefix)&&J.push(oe)}J.forEach(oe=>U.removeItem(oe)),b+=J.length}),b},s.sqlite3_js_kvvfs_size=function(_=""){let b=0;const y=l(_);return y.stores.forEach(U=>{let J;for(J=0;J<U.length;++J){const te=U.key(J);te.startsWith(y.prefix)&&(b+=te.length,b+=U.getItem(te).length)}}),b*2}}s.sqlite3_db_config=(function(l,_,...b){switch(_){case s.SQLITE_DBCONFIG_ENABLE_FKEY:case s.SQLITE_DBCONFIG_ENABLE_TRIGGER:case s.SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER:case s.SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION:case s.SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE:case s.SQLITE_DBCONFIG_ENABLE_QPSG:case s.SQLITE_DBCONFIG_TRIGGER_EQP:case s.SQLITE_DBCONFIG_RESET_DATABASE:case s.SQLITE_DBCONFIG_DEFENSIVE:case s.SQLITE_DBCONFIG_WRITABLE_SCHEMA:case s.SQLITE_DBCONFIG_LEGACY_ALTER_TABLE:case s.SQLITE_DBCONFIG_DQS_DML:case s.SQLITE_DBCONFIG_DQS_DDL:case s.SQLITE_DBCONFIG_ENABLE_VIEW:case s.SQLITE_DBCONFIG_LEGACY_FILE_FORMAT:case s.SQLITE_DBCONFIG_TRUSTED_SCHEMA:case s.SQLITE_DBCONFIG_STMT_SCANSTATUS:case s.SQLITE_DBCONFIG_REVERSE_SCANORDER:case s.SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE:case s.SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE:case s.SQLITE_DBCONFIG_ENABLE_COMMENTS:return this.ip||(this.ip=o.xWrap("sqlite3__wasm_db_config_ip","int",["sqlite3*","int","int","*"])),this.ip(l,_,b[0],b[1]||0);case s.SQLITE_DBCONFIG_LOOKASIDE:return this.pii||(this.pii=o.xWrap("sqlite3__wasm_db_config_pii","int",["sqlite3*","int","*","int","int"])),this.pii(l,_,b[0],b[1],b[2]);case s.SQLITE_DBCONFIG_MAINDBNAME:return this.s||(this.s=o.xWrap("sqlite3__wasm_db_config_s","int",["sqlite3*","int","string:static"])),this.s(l,_,b[0]);default:return s.SQLITE_MISUSE}}).bind(Object.create(null)),s.sqlite3_value_to_js=function(l,_=!0){let b;const y=s.sqlite3_value_type(l);switch(y){case s.SQLITE_INTEGER:o.bigIntEnabled?(b=s.sqlite3_value_int64(l),E.bigIntFitsDouble(b)&&(b=Number(b))):b=s.sqlite3_value_double(l);break;case s.SQLITE_FLOAT:b=s.sqlite3_value_double(l);break;case s.SQLITE_TEXT:b=s.sqlite3_value_text(l);break;case s.SQLITE_BLOB:{const U=s.sqlite3_value_bytes(l),J=s.sqlite3_value_blob(l);U&&!J&&h.WasmAllocError.toss("Cannot allocate memory for blob argument of",U,"byte(s)"),b=U?o.heap8u().slice(J,J+Number(U)):null;break}case s.SQLITE_NULL:b=null;break;default:_&&C(s.SQLITE_MISMATCH,"Unhandled sqlite3_value_type():",y),b=void 0}return b},s.sqlite3_values_to_js=function(l,_,b=!0){let y;const U=[];for(y=0;y<l;++y)U.push(s.sqlite3_value_to_js(o.peekPtr(_+o.ptrSizeof*y),b));return U},s.sqlite3_result_error_js=function(l,_){_ instanceof g?s.sqlite3_result_error_nomem(l):s.sqlite3_result_error(l,""+_,-1)},s.sqlite3_result_js=function(l,_){if(_ instanceof Error){s.sqlite3_result_error_js(l,_);return}try{switch(typeof _){case"undefined":break;case"boolean":s.sqlite3_result_int(l,_?1:0);break;case"bigint":E.bigIntFits32(_)?s.sqlite3_result_int(l,Number(_)):E.bigIntFitsDouble(_)?s.sqlite3_result_double(l,Number(_)):o.bigIntEnabled?E.bigIntFits64(_)?s.sqlite3_result_int64(l,_):C("BigInt value",_.toString(),"is too BigInt for int64."):C("BigInt value",_.toString(),"is too BigInt.");break;case"number":{let b;E.isInt32(_)?b=s.sqlite3_result_int:o.bigIntEnabled&&Number.isInteger(_)&&E.bigIntFits64(BigInt(_))?b=s.sqlite3_result_int64:b=s.sqlite3_result_double,b(l,_);break}case"string":{const[b,y]=o.allocCString(_,!0);s.sqlite3_result_text(l,b,y,s.SQLITE_WASM_DEALLOC);break}case"object":if(_===null){s.sqlite3_result_null(l);break}else if(E.isBindableTypedArray(_)){const b=o.allocFromTypedArray(_);s.sqlite3_result_blob(l,b,_.byteLength,s.SQLITE_WASM_DEALLOC);break}default:C("Don't not how to handle this UDF result value:",typeof _,_)}}catch(b){s.sqlite3_result_error_js(l,b)}},s.sqlite3_column_js=function(l,_,b=!0){const y=s.sqlite3_column_value(l,_);return y===0?void 0:s.sqlite3_value_to_js(y,b)};const u=(function(l,_,b){b=s[b],this.ptr?o.pokePtr(this.ptr,0):this.ptr=o.allocPtr();const y=b(l,_,this.ptr);if(y)return L.toss(y,arguments[2]+"() failed with code "+y);const U=o.peekPtr(this.ptr);return U?s.sqlite3_value_to_js(U,!0):void 0}).bind(Object.create(null));s.sqlite3_preupdate_new_js=(l,_)=>u(l,_,"sqlite3_preupdate_new"),s.sqlite3_preupdate_old_js=(l,_)=>u(l,_,"sqlite3_preupdate_old"),s.sqlite3changeset_new_js=(l,_)=>u(l,_,"sqlite3changeset_new"),s.sqlite3changeset_old_js=(l,_)=>u(l,_,"sqlite3changeset_old");const h={WasmAllocError:g,SQLite3Error:L,capi:s,util:E,wasm:o,config:r,version:Object.create(null),client:void 0,asyncPostInit:async function l(){if(l.isReady instanceof Promise)return l.isReady;
2let _=t.initializersAsync;delete t.initializersAsync;const b=async()=>(h.__isUnderTest||(delete h.util,delete h.StructBinder),h),y=J=>{throw r.error("an async sqlite3 initializer failed:",J),J};if(!_||!_.length)return l.isReady=b().catch(y);_=_.map(J=>J instanceof Function?async te=>J(h):J),_.push(b);let U=Promise.resolve(h);for(;_.length;)U=U.then(_.shift());return l.isReady=U.catch(y)},scriptInfo:void 0};try{t.initializers.forEach(l=>{l(h)})}catch(l){throw console.error("sqlite3 bootstrap initializer threw:",l),l}return delete t.initializers,t.sqlite3=h,h},globalThis.sqlite3ApiBootstrap.initializers=[],globalThis.sqlite3ApiBootstrap.initializersAsync=[],globalThis.sqlite3ApiBootstrap.defaultConfig=Object.create(null),globalThis.sqlite3ApiBootstrap.sqlite3=void 0,globalThis.WhWasmUtilInstaller=function(t){t.bigIntEnabled===void 0&&(t.bigIntEnabled=!!globalThis.BigInt64Array);const n=(...c)=>{throw new Error(c.join(" "))};t.exports||Object.defineProperty(t,"exports",{enumerable:!0,configurable:!0,get:()=>t.instance&&t.instance.exports});const r=t.pointerIR||"i32",s=t.ptrSizeof=r==="i32"?4:r==="i64"?8:n("Unhandled ptrSizeof:",r),o=Object.create(null);o.heapSize=0,o.memory=null,o.freeFuncIndexes=[],o.scopedAlloc=[],o.utf8Decoder=new TextDecoder,o.utf8Encoder=new TextEncoder("utf-8"),t.sizeofIR=c=>{switch(c){case"i8":return 1;case"i16":return 2;case"i32":case"f32":case"float":return 4;case"i64":case"f64":case"double":return 8;case"*":return s;default:return(""+c).endsWith("*")?s:void 0}};const d=function(){if(!o.memory)o.memory=t.memory instanceof WebAssembly.Memory?t.memory:t.exports.memory;else if(o.heapSize===o.memory.buffer.byteLength)return o;const c=o.memory.buffer;return o.HEAP8=new Int8Array(c),o.HEAP8U=new Uint8Array(c),o.HEAP16=new Int16Array(c),o.HEAP16U=new Uint16Array(c),o.HEAP32=new Int32Array(c),o.HEAP32U=new Uint32Array(c),t.bigIntEnabled&&(o.HEAP64=new BigInt64Array(c),o.HEAP64U=new BigUint64Array(c)),o.HEAP32F=new Float32Array(c),o.HEAP64F=new Float64Array(c),o.heapSize=c.byteLength,o};t.heap8=()=>d().HEAP8,t.heap8u=()=>d().HEAP8U,t.heap16=()=>d().HEAP16,t.heap16u=()=>d().HEAP16U,t.heap32=()=>d().HEAP32,t.heap32u=()=>d().HEAP32U,t.heapForSize=function(c,g=!0){const E=o.memory&&o.heapSize===o.memory.buffer.byteLength?o:d();switch(c){case Int8Array:return E.HEAP8;case Uint8Array:return E.HEAP8U;case Int16Array:return E.HEAP16;case Uint16Array:return E.HEAP16U;case Int32Array:return E.HEAP32;case Uint32Array:return E.HEAP32U;case 8:return g?E.HEAP8U:E.HEAP8;case 16:return g?E.HEAP16U:E.HEAP16;case 32:return g?E.HEAP32U:E.HEAP32;case 64:if(E.HEAP64)return g?E.HEAP64U:E.HEAP64;break;default:if(t.bigIntEnabled){if(c===globalThis.BigUint64Array)return E.HEAP64U;if(c===globalThis.BigInt64Array)return E.HEAP64;break}}n("Invalid heapForSize() size: expecting 8, 16, 32,","or (if BigInt is enabled) 64.")},t.functionTable=function(){return t.exports.__indirect_function_table},t.functionEntry=function(c){const g=t.functionTable();return c<g.length?g.get(c):void 0},t.jsFuncToWasm=function c(g,E){if(c._||(c._={sigTypes:Object.assign(Object.create(null),{i:"i32",p:"i32",P:"i32",s:"i32",j:"i64",f:"f32",d:"f64"}),typeCodes:Object.assign(Object.create(null),{f64:124,f32:125,i64:126,i32:127}),uleb128Encode:function(h,l,_){_<128?h[l](_):h[l](_%128|128,_>>7)},rxJSig:/^(\w)\((\w*)\)$/,sigParams:function(h){const l=c._.rxJSig.exec(h);return l?l[2]:h.substr(1)},letterType:h=>c._.sigTypes[h]||n("Invalid signature letter:",h),pushSigType:(h,l)=>h.push(c._.typeCodes[c._.letterType(l)])}),typeof g=="string"){const h=E;E=g,g=h}const z=c._.sigParams(E),u=[1,96];c._.uleb128Encode(u,"push",z.length);for(const h of z)c._.pushSigType(u,h);return E[0]==="v"?u.push(0):(u.push(1),c._.pushSigType(u,E[0])),c._.uleb128Encode(u,"unshift",u.length),u.unshift(0,97,115,109,1,0,0,0,1),u.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array(u)),{e:{f:g}}).exports.f};const q=function(g,E,z){if(z&&!o.scopedAlloc.length&&n("No scopedAllocPush() scope is active."),typeof g=="string"){const _=E;E=g,g=_}
2(typeof E!="string"||!(g instanceof Function))&&n("Invalid arguments: expecting (function,signature) or (signature,function).");const u=t.functionTable(),h=u.length;let l;for(;o.freeFuncIndexes.length&&(l=o.freeFuncIndexes.pop(),u.get(l));){l=null;continue}l||(l=h,u.grow(1));try{return u.set(l,g),z&&o.scopedAlloc[o.scopedAlloc.length-1].push(l),l}catch(_){if(!(_ instanceof TypeError))throw l===h&&o.freeFuncIndexes.push(h),_}try{const _=t.jsFuncToWasm(g,E);u.set(l,_),z&&o.scopedAlloc[o.scopedAlloc.length-1].push(l)}catch(_){throw l===h&&o.freeFuncIndexes.push(h),_}return l};t.installFunction=(c,g)=>q(c,g,!1),t.scopedInstallFunction=(c,g)=>q(c,g,!0),t.uninstallFunction=function(c){if(!c&&c!==0)return;const g=o.freeFuncIndexes,E=t.functionTable();g.push(c);const z=E.get(c);return E.set(c,null),z},t.peek=function(g,E="i8"){E.endsWith("*")&&(E=r);const z=o.memory&&o.heapSize===o.memory.buffer.byteLength?o:d(),u=Array.isArray(g)?[]:void 0;let h;do{switch(u&&(g=arguments[0].shift()),E){case"i1":case"i8":h=z.HEAP8[g>>0];break;case"i16":h=z.HEAP16[g>>1];break;case"i32":h=z.HEAP32[g>>2];break;case"float":case"f32":h=z.HEAP32F[g>>2];break;case"double":case"f64":h=Number(z.HEAP64F[g>>3]);break;case"i64":if(t.bigIntEnabled){h=BigInt(z.HEAP64[g>>3]);break}default:n("Invalid type for peek():",E)}u&&u.push(h)}while(u&&arguments[0].length);return u||h},t.poke=function(c,g,E="i8"){E.endsWith("*")&&(E=r);const z=o.memory&&o.heapSize===o.memory.buffer.byteLength?o:d();for(const u of Array.isArray(c)?c:[c])switch(E){case"i1":case"i8":z.HEAP8[u>>0]=g;continue;case"i16":z.HEAP16[u>>1]=g;continue;case"i32":z.HEAP32[u>>2]=g;continue;case"float":case"f32":z.HEAP32F[u>>2]=g;continue;case"double":case"f64":z.HEAP64F[u>>3]=g;continue;case"i64":if(z.HEAP64){z.HEAP64[u>>3]=BigInt(g);continue}default:n("Invalid type for poke(): "+E)}return this},t.peekPtr=(...c)=>t.peek(c.length===1?c[0]:c,r),t.pokePtr=(c,g=0)=>t.poke(c,g,r),t.peek8=(...c)=>t.peek(c.length===1?c[0]:c,"i8"),t.poke8=(c,g)=>t.poke(c,g,"i8"),t.peek16=(...c)=>t.peek(c.length===1?c[0]:c,"i16"),t.poke16=(c,g)=>t.poke(c,g,"i16"),t.peek32=(...c)=>t.peek(c.length===1?c[0]:c,"i32"),t.poke32=(c,g)=>t.poke(c,g,"i32"),t.peek64=(...c)=>t.peek(c.length===1?c[0]:c,"i64"),t.poke64=(c,g)=>t.poke(c,g,"i64"),t.peek32f=(...c)=>t.peek(c.length===1?c[0]:c,"f32"),t.poke32f=(c,g)=>t.poke(c,g,"f32"),t.peek64f=(...c)=>t.peek(c.length===1?c[0]:c,"f64"),t.poke64f=(c,g)=>t.poke(c,g,"f64"),t.getMemValue=t.peek,t.getPtrValue=t.peekPtr,t.setMemValue=t.poke,t.setPtrValue=t.pokePtr,t.isPtr32=c=>typeof c=="number"&&c===(c|0)&&c>=0,t.isPtr=t.isPtr32,t.cstrlen=function(c){if(!c||!t.isPtr(c))return null;const g=d().HEAP8U;let E=c;for(;g[E]!==0;++E);return E-c};const L=typeof SharedArrayBuffer>"u"?function(){}:SharedArrayBuffer,C=function(c,g,E){return o.utf8Decoder.decode(c.buffer instanceof L?c.slice(g,E):c.subarray(g,E))};t.cstrToJs=function(c){const g=t.cstrlen(c);return g?C(d().HEAP8U,c,c+g):g===null?g:""},t.jstrlen=function(c){if(typeof c!="string")return null;const g=c.length;let E=0;for(let z=0;z<g;++z){let u=c.charCodeAt(z);u>=55296&&u<=57343&&(u=65536+((u&1023)<<10)|c.charCodeAt(++z)&1023),u<=127?++E:u<=2047?E+=2:u<=65535?E+=3:E+=4}return E},t.jstrcpy=function(c,g,E=0,z=-1,u=!0){if((!g||!(g instanceof Int8Array)&&!(g instanceof Uint8Array))&&n("jstrcpy() target must be an Int8Array or Uint8Array."),z<0&&(z=g.length-E),!(z>0)||!(E>=0))return 0;let h=0,l=c.length;const _=E,b=E+z-(u?1:0);for(;h<l&&E<b;++h){let y=c.charCodeAt(h);if(y>=55296&&y<=57343&&(y=65536+((y&1023)<<10)|c.charCodeAt(++h)&1023),y<=127){if(E>=b)break;g[E++]=y}else if(y<=2047){if(E+1>=b)break;g[E++]=192|y>>6,g[E++]=128|y&63}else if(y<=65535){if(E+2>=b)break;g[E++]=224|y>>12,g[E++]=128|y>>6&63,g[E++]=128|y&63}else{if(E+3>=b)break;g[E++]=240|y>>18,g[E++]=128|y>>12&63,g[E++]=128|y>>6&63,g[E++]=128|y&63}}return u&&(g[E++]=0),E-_},t.cstrncpy=function(c,g,E){if((!c||!g)&&n("cstrncpy() does not accept NULL strings."),E<0)E=t.cstrlen(strPtr)+1;else if(!(E>0))return 0;const z=t.heap8u();let u=0,h;for(;u<E&&(h=z[g+u]);++u)z[c+u]=h;return u<E&&(z[c+u++]=0),u},t.jstrToUintArray=(c,g=!1)=>o.utf8Encoder.encode(g?c+"\0":c);const Q=(c,g)=>{(!(c.alloc instanceof Function)||!(c.dealloc instanceof Function))&&n("Object is missing alloc() and/or dealloc() function(s)","required by",g+"().")},V=function(c,g,E,z){if(Q(t,z),typeof c!="string")return null;{const u=o.utf8Encoder.encode(c),h=E(u.length+1),l=d().HEAP8U;return l.set(u,h),l[h+u.length]=0,g?[h,u.length]:h}};t.allocCString=(c,g=!1)=>V(c,g,t.alloc,"allocCString()"),t.scopedAllocPush=function(){Q(t,"scopedAllocPush");const c=[];return o.scopedAlloc.push(c),c},t.scopedAllocPop=function(c){Q(t,"scopedAllocPop");const g=arguments.length?o.scopedAlloc.indexOf(c):o.scopedAlloc.length-1;g<0&&n("Invalid state object for scopedAllocPop()."),arguments.length===0&&(c=o.scopedAlloc[g]),o.scopedAlloc.splice(g,1);for(let E;E=c.pop();)t.functionEntry(E)?t.uninstallFunction(E):t.dealloc(E)},t.scopedAlloc=function(c){o.scopedAlloc.length||n("No scopedAllocPush() scope is active.");const g=t.alloc(c);return o.scopedAlloc[o.scopedAlloc.length-1].push(g),g},Object.defineProperty(t.scopedAlloc,"level",{configurable:!1,enumerable:!1,get:()=>o.scopedAlloc.length,set:()=>n("The 'active' property is read-only.")}),t.scopedAllocCString=(c,g=!1)=>V(c,g,t.scopedAlloc,"scopedAllocCString()");const P=function(c,g){const E=t[c?"scopedAlloc":"alloc"]((g.length+1)*t.ptrSizeof);let z=0;return g.forEach(u=>{t.pokePtr(E+t.ptrSizeof*z++,t[c?"scopedAllocCString":"allocCString"](""+u))}),t.pokePtr(E+t.ptrSizeof*z,0),E};t.scopedAllocMainArgv=c=>P(!0,c),t.allocMainArgv=c=>P(!1,c),t.cArgvToJs=(c,g)=>{const E=[];for(let z=0;z<c;++z){const u=t.peekPtr(g+t.ptrSizeof*z);E.push(u?t.cstrToJs(u):null)}return E},t.scopedAllocCall=function(c){t.scopedAllocPush();try{return c()}finally{t.scopedAllocPop()}};const I=function(c,g,E){Q(t,E);const z=g?"i64":r;let u=t[E](c*(g?8:s));if(t.poke(u,0,z),c===1)return u;const h=[u];for(let l=1;l<c;++l)u+=g?8:s,h[l]=u,t.poke(u,0,z);return h};t.allocPtr=(c=1,g=!0)=>I(c,g,"alloc"),t.scopedAllocPtr=(c=1,g=!0)=>I(c,g,"scopedAlloc"),t.xGet=function(c){return t.exports[c]||n("Cannot find exported symbol:",c)};const N=(c,g)=>n(c+"() requires",g,"argument(s).");t.xCall=function(c,...g){const E=c instanceof Function?c:t.xGet(c);return E instanceof Function||n("Exported symbol",c,"is not a function."),E.length!==g.length&&N(E===c?E.name:c,E.length),arguments.length===2&&Array.isArray(arguments[1])?E.apply(null,arguments[1]):E.apply(null,g)},o.xWrap=Object.create(null),o.xWrap.convert=Object.create(null),o.xWrap.convert.arg=new Map,o.xWrap.convert.result=new Map;const w=o.xWrap.convert.arg,x=o.xWrap.convert.result;t.bigIntEnabled&&w.set("i64",c=>BigInt(c));const T=r==="i32"?c=>c|0:c=>BigInt(c)|BigInt(0);w.set("i32",T).set("i16",c=>(c|0)&65535).set("i8",c=>(c|0)&255).set("f32",c=>Number(c).valueOf()).set("float",w.get("f32")).set("f64",w.get("f32")).set("double",w.get("f64")).set("int",w.get("i32")).set("null",c=>c).set(null,w.get("null")).set("**",T).set("*",T),x.set("*",T).set("pointer",T).set("number",c=>Number(c)).set("void",c=>{}).set("null",c=>c).set(null,x.get("null"));{const c=["i8","i16","i32","int","f32","float","f64","double"];t.bigIntEnabled&&c.push("i64");const g=w.get(r);for(const E of c)w.set(E+"*",g),x.set(E+"*",g),x.set(E,w.get(E)||n("Missing arg converter:",E))}const F=function(c){return typeof c=="string"?t.scopedAllocCString(c):c?T(c):null};w.set("string",F).set("utf8",F).set("pointer",F),x.set("string",c=>t.cstrToJs(c)).set("utf8",x.get("string")).set("string:dealloc",c=>{try{return c?t.cstrToJs(c):null}finally{t.dealloc(c)}}).set("utf8:dealloc",x.get("string:dealloc")).set("json",c=>JSON.parse(t.cstrToJs(c))).set("json:dealloc",c=>{try{return c?JSON.parse(t.cstrToJs(c)):null}finally{t.dealloc(c)}});const D=class{constructor(c){this.name=c.name||"unnamed adapter"}
2convertArg(c,g,E){n("AbstractArgAdapter must be subclassed.")}};w.FuncPtrAdapter=class Re extends D{constructor(g){super(g),w.FuncPtrAdapter.warnOnUse&&console.warn("xArg.FuncPtrAdapter is an internal-only API","and is not intended to be invoked from","client-level code. Invoked with:",g),this.name=g.name||"unnamed",this.signature=g.signature,g.contextKey instanceof Function&&(this.contextKey=g.contextKey,g.bindScope||(g.bindScope="context")),this.bindScope=g.bindScope||n("FuncPtrAdapter options requires a bindScope (explicit or implied)."),Re.bindScopes.indexOf(g.bindScope)<0&&n("Invalid options.bindScope ("+g.bindMod+") for FuncPtrAdapter. Expecting one of: ("+Re.bindScopes.join(", ")+")"),this.isTransient=this.bindScope==="transient",this.isContext=this.bindScope==="context",this.isPermanent=this.bindScope==="permanent",this.singleton=this.bindScope==="singleton"?[]:void 0,this.callProxy=g.callProxy instanceof Function?g.callProxy:void 0}contextKey(g,E){return this}contextMap(g){const E=this.__cmap||(this.__cmap=new Map);let z=E.get(g);return z===void 0&&E.set(g,z=[]),z}convertArg(g,E,z){let u=this.singleton;if(!u&&this.isContext&&(u=this.contextMap(this.contextKey(E,z))),u&&u[0]===g)return u[1];if(g instanceof Function){this.callProxy&&(g=this.callProxy(g));const h=q(g,this.signature,this.isTransient);if(Re.debugFuncInstall&&Re.debugOut("FuncPtrAdapter installed",this,this.contextKey(E,z),"@"+h,g),u){if(u[1]){Re.debugFuncInstall&&Re.debugOut("FuncPtrAdapter uninstalling",this,this.contextKey(E,z),"@"+u[1],g);try{o.scopedAlloc[o.scopedAlloc.length-1].push(u[1])}catch{}}u[0]=g,u[1]=h}return h}else if(t.isPtr(g)||g===null||g===void 0){if(u&&u[1]&&u[1]!==g){Re.debugFuncInstall&&Re.debugOut("FuncPtrAdapter uninstalling",this,this.contextKey(E,z),"@"+u[1],g);try{o.scopedAlloc[o.scopedAlloc.length-1].push(u[1])}catch{}u[0]=u[1]=g|0}return g||0}else throw new TypeError("Invalid FuncPtrAdapter argument type. Expecting a function pointer or a "+(this.name?this.name+" ":"")+"function matching signature "+this.signature+".")}},w.FuncPtrAdapter.warnOnUse=!1,w.FuncPtrAdapter.debugFuncInstall=!1,w.FuncPtrAdapter.debugOut=console.debug.bind(console),w.FuncPtrAdapter.bindScopes=["transient","context","singleton","permanent"];const A=c=>w.get(c)||n("Argument adapter not found:",c),j=c=>x.get(c)||n("Result adapter not found:",c);o.xWrap.convertArg=(c,...g)=>A(c)(...g),o.xWrap.convertArgNoCheck=(c,...g)=>w.get(c)(...g),o.xWrap.convertResult=(c,g)=>c===null?g:c?j(c)(g):void 0,o.xWrap.convertResultNoCheck=(c,g)=>c===null?g:c?x.get(c)(g):void 0,t.xWrap=function(c,g,...E){arguments.length===3&&Array.isArray(arguments[2])&&(E=arguments[2]),t.isPtr(c)&&(c=t.functionEntry(c)||n("Function pointer not found in WASM function table."));const z=c instanceof Function,u=z?c:t.xGet(c);if(z&&(c=u.name||"unnamed function"),E.length!==u.length&&N(c,u.length),g===null&&u.length===0)return u;g!=null&&j(g);for(const l of E)l instanceof D?w.set(l,(..._)=>l.convertArg(..._)):A(l);const h=o.xWrap;return u.length===0?(...l)=>l.length?N(c,u.length):h.convertResult(g,u.call(null)):function(...l){l.length!==u.length&&N(c,u.length);const _=t.scopedAllocPush();try{let b=0;for(;b<l.length;++b)l[b]=h.convertArgNoCheck(E[b],l[b],l,b);return h.convertResultNoCheck(g,u.apply(null,l))}finally{t.scopedAllocPop(_)}}};const H=function(c,g,E,z,u,h){if(typeof E=="string"){if(g===1)return h.get(E);if(g===2){if(z)z instanceof Function||n(u,"requires a function argument.");else return h.delete(E),c;return h.set(E,z),c}}n("Invalid arguments to",u)};return t.xWrap.resultAdapter=function c(g,E){return H(c,arguments.length,g,E,"resultAdapter()",x)},t.xWrap.argAdapter=function c(g,E){return H(c,arguments.length,g,E,"argAdapter()",w)},t.xWrap.FuncPtrAdapter=w.FuncPtrAdapter,t.xCallWrapped=function(c,g,E,...z){return Array.isArray(arguments[3])&&(z=arguments[3]),t.xWrap(c,g,E||[]).apply(null,z||[])},t.xWrap.testConvertArg=o.xWrap.convertArg,t.xWrap.testConvertResult=o.xWrap.convertResult,t},globalThis.WhWasmUtilInstaller.yawl=(function(t){const n=()=>fetch(t.uri,{credentials:"same-origin"}),r=this,s=function(d){if(t.wasmUtilTarget){const q=(...C)=>{throw new Error(C.join(" "))},L=t.wasmUtilTarget;if(L.module=d.module,L.instance=d.instance,L.instance.exports.memory||(L.memory=t.imports&&t.imports.env&&t.imports.env.memory||q("Missing 'memory' object!")),!L.alloc&&d.instance.exports.malloc){const C=d.instance.exports;
2L.alloc=function(Q){return C.malloc(Q)||q("Allocation of",Q,"bytes failed.")},L.dealloc=function(Q){C.free(Q)}}r(L)}return t.onload&&t.onload(d,t),d};return WebAssembly.instantiateStreaming?function(){return WebAssembly.instantiateStreaming(n(),t.imports||{}).then(s)}:function(){return n().then(q=>q.arrayBuffer()).then(q=>WebAssembly.instantiate(q,t.imports||{})).then(s)}}).bind(globalThis.WhWasmUtilInstaller),globalThis.Jaccwabyt=function t(n){const r=(...f)=>{throw new Error(f.join(" "))};!(n.heap instanceof WebAssembly.Memory)&&!(n.heap instanceof Function)&&r("config.heap must be WebAssembly.Memory instance or a function."),["alloc","dealloc"].forEach(function(f){n[f]instanceof Function||r("Config option '"+f+"' must be a function.")});const s=t,o=n.heap instanceof Function?n.heap:()=>new Uint8Array(n.heap.buffer),d=n.alloc,q=n.dealloc,L=n.log||console.log.bind(console),C=n.memberPrefix||"",Q=n.memberSuffix||"",V=n.bigIntEnabled===void 0?!!globalThis.BigInt64Array:!!n.bigIntEnabled,P=globalThis.BigInt,I=globalThis.BigInt64Array,N=n.ptrSizeof||4,w=n.ptrIR||"i32";s.debugFlags||(s.__makeDebugFlags=function(f=null){f&&f.__flags&&(f=f.__flags);const S=function k(R){return arguments.length===0?k.__flags:(R<0?(delete k.__flags.getter,delete k.__flags.setter,delete k.__flags.alloc,delete k.__flags.dealloc):(k.__flags.getter=(1&R)!==0,k.__flags.setter=(2&R)!==0,k.__flags.alloc=(4&R)!==0,k.__flags.dealloc=(8&R)!==0),k._flags)};return Object.defineProperty(S,"__flags",{iterable:!1,writable:!1,value:Object.create(f)}),f||S(0),S},s.debugFlags=s.__makeDebugFlags());const x=function(){const f=new ArrayBuffer(2);return new DataView(f).setInt16(0,256,!0),new Int16Array(f)[0]===256}(),T=f=>f[1]==="(",F=f=>f==="P",D=f=>T(f)?"p":f[0],A=function(f){switch(D(f)){case"c":case"C":return"i8";case"i":return"i32";case"p":case"P":case"s":return w;case"j":return"i64";case"f":return"float";case"d":return"double"}r("Unhandled signature IR:",f)},j=I?()=>!0:()=>r("BigInt64Array is not available."),H=function(f){switch(D(f)){case"p":case"P":case"s":{switch(N){case 4:return"getInt32";case 8:return j()&&"getBigInt64"}break}case"i":return"getInt32";case"c":return"getInt8";case"C":return"getUint8";case"j":return j()&&"getBigInt64";case"f":return"getFloat32";case"d":return"getFloat64"}r("Unhandled DataView getter for signature:",f)},c=function(f){switch(D(f)){case"p":case"P":case"s":{switch(N){case 4:return"setInt32";case 8:return j()&&"setBigInt64"}break}case"i":return"setInt32";case"c":return"setInt8";case"C":return"setUint8";case"j":return j()&&"setBigInt64";case"f":return"setFloat32";case"d":return"setFloat64"}r("Unhandled DataView setter for signature:",f)},g=function(f){switch(D(f)){case"i":case"f":case"c":case"C":case"d":return Number;case"j":return j()&&P;case"p":case"P":case"s":switch(N){case 4:return Number;case 8:return j()&&P}break}r("Unhandled DataView set wrapper for signature:",f)},E=(f,S)=>f+"::"+S,z=function(f,S){return()=>r(E(f,S),"is read-only.")},u=new WeakMap,h="(pointer-is-external)",l=function(f,S,k){if(k||(k=u.get(S)),k){if(u.delete(S),Array.isArray(S.ondispose)){let R;for(;R=S.ondispose.shift();)try{R instanceof Function?R.call(S):R instanceof G?R.dispose():typeof R=="number"&&q(R)}catch($){console.warn("ondispose() for",f.structName,"@",k,"threw. NOT propagating it.",$)}}else if(S.ondispose instanceof Function)try{S.ondispose()}catch(R){console.warn("ondispose() for",f.structName,"@",k,"threw. NOT propagating it.",R)}delete S.ondispose,f.debugFlags.__flags.dealloc&&L("debug.dealloc:",S[h]?"EXTERNAL":"",f.structName,"instance:",f.structInfo.sizeof,"bytes @"+k),S[h]||q(k)}},_=f=>({configurable:!1,writable:!1,iterable:!1,value:f}),b=function(f,S,k){let R=!k;k?Object.defineProperty(S,h,_(k)):(k=d(f.structInfo.sizeof),k||r("Allocation of",f.structName,"structure failed."));try{f.debugFlags.__flags.alloc&&L("debug.alloc:",R?"":"EXTERNAL",f.structName,"instance:",f.structInfo.sizeof,"bytes @"+k),R&&o().fill(0,k,k+f.structInfo.sizeof),u.set(S,k)}catch($){throw l(f,S,k),$}},y=function(){const f=this.pointer;return f?new Uint8Array(o().slice(f,f+this.structInfo.sizeof)):null},J=_(f=>C+f+Q),te=function(f,S,k=!0){let R=f.members[S];if(!R&&(C||Q)){for(const $ of Object.values(f.members))if($.key===S){R=$;break}!R&&k&&r(E(f.name,S),"is not a mapped struct member.")}return R},oe=function f(S,k,R=!1){f._||(f._=ee=>ee.replace(/[^vipPsjrdcC]/g,"").replace(/[pPscC]/g,"i"));const $=te(S.structInfo,k,!0);return R?f._($.signature):$.signature},re={configurable:!1,enumerable:!1,get:function(){return u.get(this)},set:()=>r("Cannot assign the 'pointer' property of a struct.")},ie=_(function(){const f=[];for(const S of Object.keys(this.structInfo.members))f.push(this.memberKey(S));return f}),ae=new TextDecoder("utf-8"),ue=new TextEncoder,me=typeof SharedArrayBuffer>"u"?function(){}:SharedArrayBuffer,he=function(f,S,k){return ae.decode(f.buffer instanceof me?f.slice(S,k):f.subarray(S,k))},Ee=function(f,S,k=!1){const R=te(f.structInfo,S,k);return R&&R.signature.length===1&&R.signature[0]==="s"?R:!1},be=function(f){f.signature!=="s"&&r("Invalid member type signature for C-string value:",JSON.stringify(f))},O=function(S,k){const R=te(S.structInfo,k,!0);be(R);const $=S[R.key];if(!$)return null;let ee=$;const ce=o();for(;ce[ee]!==0;++ee);return $===ee?"":he(ce,$,ee)},M=function(f,...S){f.ondispose?Array.isArray(f.ondispose)||(f.ondispose=[f.ondispose]):f.ondispose=[],f.ondispose.push(...S)},W=function(f){const S=ue.encode(f),k=d(S.length+1);k||r("Allocation error while duplicating string:",f);const R=o();return R.set(S,k),R[k+S.length]=0,k},K=function(f,S,k){const R=te(f.structInfo,S,!0);be(R);const $=W(k);return f[R.key]=$,M(f,$),f},G=function(S,k){arguments[2]!==_&&r("Do not call the StructType constructor","from client-level code."),Object.defineProperties(this,{structName:_(S),structInfo:_(k)})};G.prototype=Object.create(null,{dispose:_(function(){l(this.constructor,this)}),lookupMember:_(function(f,S=!0){return te(this.structInfo,f,S)}),memberToJsString:_(function(f){return O(this,f)}),memberIsString:_(function(f,S=!0){return Ee(this,f,S)}),memberKey:J,memberKeys:ie,memberSignature:_(function(f,S=!1){return oe(this,f,S)}),memoryDump:_(y),pointer:re,setMemberCString:_(function(f,S){return K(this,f,S)})}),Object.assign(G.prototype,{addOnDispose:function(...f){return M(this,...f),this}}),Object.defineProperties(G,{allocCString:_(W),isA:_(f=>f instanceof G),hasExternalPointer:_(f=>
2f instanceof G&&!!f[h]),memberKey:J});const X=f=>Number.isFinite(f)||f instanceof(P||Number),B=function f(S,k,R){if(!f._){f._={getters:{},setters:{},sw:{}};const xe=["i","c","C","p","P","s","f","d","v()"];V&&xe.push("j"),xe.forEach(function(Fe){f._.getters[Fe]=H(Fe),f._.setters[Fe]=c(Fe),f._.sw[Fe]=g(Fe)});const nr=/^[ipPsjfdcC]$/,rr=/^[vipPsjfdcC]\([ipPsjfdcC]*\)$/;f.sigCheck=function(Fe,sr,Dt,mt){Object.prototype.hasOwnProperty.call(Fe,Dt)&&r(Fe.structName,"already has a property named",Dt+"."),nr.test(mt)||rr.test(mt)||r("Malformed signature for",E(Fe.structName,sr)+":",mt)}}const $=S.memberKey(k);f.sigCheck(S.prototype,k,$,R.signature),R.key=$,R.name=k;const ee=D(R.signature),ce=E(S.prototype.structName,$),pe=S.prototype.debugFlags.__flags,Ie=Object.create(null);Ie.configurable=!1,Ie.enumerable=!1,Ie.get=function(){pe.getter&&L("debug.getter:",f._.getters[ee],"for",A(ee),ce,"@",this.pointer,"+",R.offset,"sz",R.sizeof);let xe=new DataView(o().buffer,this.pointer+R.offset,R.sizeof)[f._.getters[ee]](0,x);return pe.getter&&L("debug.getter:",ce,"result =",xe),xe},R.readOnly?Ie.set=z(S.prototype.structName,$):Ie.set=function(xe){if(pe.setter&&L("debug.setter:",f._.setters[ee],"for",A(ee),ce,"@",this.pointer,"+",R.offset,"sz",R.sizeof,xe),this.pointer||r("Cannot set struct property on disposed instance."),xe===null)xe=0;else for(;!X(xe);){if(F(R.signature)&&xe instanceof G){xe=xe.pointer||0,pe.setter&&L("debug.setter:",ce,"resolved to",xe);break}r("Invalid value for pointer-type",ce+".")}new DataView(o().buffer,this.pointer+R.offset,R.sizeof)[f._.setters[ee]](0,f._.sw[ee](xe),x)},Object.defineProperty(S.prototype,$,Ie)},p=function f(S,k){arguments.length===1?(k=S,S=k.name):k.name||(k.name=S),S||r("Struct name is required.");let R=!1;Object.keys(k.members).forEach(ce=>{const pe=k.members[ce];pe.sizeof?pe.sizeof===1?pe.signature==="c"||pe.signature==="C"||r("Unexpected sizeof==1 member",E(k.name,ce),"with signature",pe.signature):(pe.sizeof%4!==0&&(console.warn("Invalid struct member description =",pe,"from",k),r(S,"member",ce,"sizeof is not aligned. sizeof="+pe.sizeof)),pe.offset%4!==0&&(console.warn("Invalid struct member description =",pe,"from",k),r(S,"member",ce,"offset is not aligned. offset="+pe.offset))):r(S,"member",ce,"is missing sizeof."),(!R||R.offset<pe.offset)&&(R=pe)}),R?k.sizeof<R.offset+R.sizeof&&r("Invalid struct config:",S,"max member offset ("+R.offset+") ","extends past end of struct (sizeof="+k.sizeof+")."):r("No member property descriptions found.");const $=_(s.__makeDebugFlags(f.debugFlags)),ee=function ce(pe){this instanceof ce?arguments.length?((pe!==(pe|0)||pe<=0)&&r("Invalid pointer value for",S,"constructor."),b(ce,this,pe)):b(ce,this):r("The",S,"constructor may only be called via 'new'.")};return Object.defineProperties(ee,{debugFlags:$,isA:_(ce=>ce instanceof ee),memberKey:J,memberKeys:ie,methodInfoForKey:_(function(ce){}),structInfo:_(k),structName:_(S)}),ee.prototype=new G(S,k,_),Object.defineProperties(ee.prototype,{debugFlags:$,constructor:_(ee)}),Object.keys(k.members).forEach(ce=>B(ee,ce,k.members[ce])),ee};return p.StructType=G,p.config=n,p.allocCString=W,p.debugFlags||(p.debugFlags=s.__makeDebugFlags(s.debugFlags)),p},globalThis.sqlite3ApiBootstrap.initializers.push(function(t){const n=(...w)=>{throw new Error(w.join(" "))};t.SQLite3Error.toss;const r=t.capi,s=t.wasm,o=t.util;if(globalThis.WhWasmUtilInstaller(s),delete globalThis.WhWasmUtilInstaller,s.bindingSignatures=[["sqlite3_aggregate_context","void*","sqlite3_context*","int"],["sqlite3_bind_double","int","sqlite3_stmt*","int","f64"],["sqlite3_bind_int","int","sqlite3_stmt*","int","int"],["sqlite3_bind_null",void 0,"sqlite3_stmt*","int"],["sqlite3_bind_parameter_count","int","sqlite3_stmt*"],["sqlite3_bind_parameter_index","int","sqlite3_stmt*","string"],["sqlite3_bind_parameter_name","string","sqlite3_stmt*","int"],["sqlite3_bind_pointer","int","sqlite3_stmt*","int","*","string:static","*"],["sqlite3_busy_handler","int",["sqlite3*",new s.xWrap.FuncPtrAdapter({signature:"i(pi)",contextKey:(w,x)=>w[0]}),"*"]],["sqlite3_busy_timeout","int","sqlite3*","int"],["sqlite3_changes","int","sqlite3*"],["sqlite3_clear_bindings","int","sqlite3_stmt*"],["sqlite3_collation_needed","int","sqlite3*","*","*"],["sqlite3_column_blob","*","sqlite3_stmt*","int"],["sqlite3_column_bytes","int","sqlite3_stmt*","int"],["sqlite3_column_count","int","sqlite3_stmt*"],["sqlite3_column_decltype","string","sqlite3_stmt*","int"],["sqlite3_column_double","f64","sqlite3_stmt*","int"],["sqlite3_column_int","int","sqlite3_stmt*","int"],["sqlite3_column_name","string","sqlite3_stmt*","int"],["sqlite3_column_text","string","sqlite3_stmt*","int"],["sqlite3_column_type","int","sqlite3_stmt*","int"],["sqlite3_column_value","sqlite3_value*","sqlite3_stmt*","int"],["sqlite3_commit_hook","void*",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"sqlite3_commit_hook",signature:"i(p)",contextKey:w=>w[0]}),"*"]],["sqlite3_compileoption_get","string","int"],["sqlite3_compileoption_used","int","string"],["sqlite3_complete","
2int","string:flexible"],["sqlite3_context_db_handle","sqlite3*","sqlite3_context*"],["sqlite3_data_count","int","sqlite3_stmt*"],["sqlite3_db_filename","string","sqlite3*","string"],["sqlite3_db_handle","sqlite3*","sqlite3_stmt*"],["sqlite3_db_name","string","sqlite3*","int"],["sqlite3_db_readonly","int","sqlite3*","string"],["sqlite3_db_status","int","sqlite3*","int","*","*","int"],["sqlite3_errcode","int","sqlite3*"],["sqlite3_errmsg","string","sqlite3*"],["sqlite3_error_offset","int","sqlite3*"],["sqlite3_errstr","string","int"],["sqlite3_exec","int",["sqlite3*","string:flexible",new s.xWrap.FuncPtrAdapter({signature:"i(pipp)",bindScope:"transient",callProxy:w=>{let x;return(T,F,D,A)=>{try{const j=s.cArgvToJs(F,D);return x||(x=s.cArgvToJs(F,A)),w(j,x)|0}catch(j){return j.resultCode||r.SQLITE_ERROR}}}}),"*","**"]],["sqlite3_expanded_sql","string","sqlite3_stmt*"],["sqlite3_extended_errcode","int","sqlite3*"],["sqlite3_extended_result_codes","int","sqlite3*","int"],["sqlite3_file_control","int","sqlite3*","string","int","*"],["sqlite3_finalize","int","sqlite3_stmt*"],["sqlite3_free",void 0,"*"],["sqlite3_get_autocommit","int","sqlite3*"],["sqlite3_get_auxdata","*","sqlite3_context*","int"],["sqlite3_initialize",void 0],["sqlite3_interrupt",void 0,"sqlite3*"],["sqlite3_is_interrupted","int","sqlite3*"],["sqlite3_keyword_count","int"],["sqlite3_keyword_name","int",["int","**","*"]],["sqlite3_keyword_check","int",["string","int"]],["sqlite3_libversion","string"],["sqlite3_libversion_number","int"],["sqlite3_limit","int",["sqlite3*","int","int"]],["sqlite3_malloc","*","int"],["sqlite3_open","int","string","*"],["sqlite3_open_v2","int","string","*","int","string"],["sqlite3_realloc","*","*","int"],["sqlite3_reset","int","sqlite3_stmt*"],["sqlite3_result_blob",void 0,"sqlite3_context*","*","int","*"],["sqlite3_result_double",void 0,"sqlite3_context*","f64"],["sqlite3_result_error",void 0,"sqlite3_context*","string","int"],["sqlite3_result_error_code",void 0,"sqlite3_context*","int"],["sqlite3_result_error_nomem",void 0,"sqlite3_context*"],["sqlite3_result_error_toobig",void 0,"sqlite3_context*"],["sqlite3_result_int",void 0,"sqlite3_context*","int"],["sqlite3_result_null",void 0,"sqlite3_context*"],["sqlite3_result_pointer",void 0,"sqlite3_context*","*","string:static","*"],["sqlite3_result_subtype",void 0,"sqlite3_value*","int"],["sqlite3_result_text",void 0,"sqlite3_context*","string","int","*"],["sqlite3_result_zeroblob",void 0,"sqlite3_context*","int"],["sqlite3_rollback_hook","void*",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"sqlite3_rollback_hook",signature:"v(p)",contextKey:w=>w[0]}),"*"]],["sqlite3_set_auxdata",void 0,["sqlite3_context*","int","*","*"]],["sqlite3_shutdown",void 0],["sqlite3_sourceid","string"],["sqlite3_sql","string","sqlite3_stmt*"],["sqlite3_status","int","int","*","*","int"],["sqlite3_step","int","sqlite3_stmt*"],["sqlite3_stmt_busy","int","sqlite3_stmt*"],["sqlite3_stmt_readonly","int","sqlite3_stmt*"],["sqlite3_stmt_status","int","sqlite3_stmt*","int","int"],["sqlite3_strglob","int","string","string"],["sqlite3_stricmp","int","string","string"],["sqlite3_strlike","int","string","string","int"],["sqlite3_strnicmp","int","string","string","int"],["sqlite3_table_column_metadata","int","sqlite3*","string","string","string","**","**","*","*","*"],["sqlite3_total_changes","int","sqlite3*"],["sqlite3_trace_v2","int",["sqlite3*","int",new s.xWrap.FuncPtrAdapter({name:"sqlite3_trace_v2::callback",signature:"i(ippp)",contextKey:(w,x)=>w[0]}),"*"]],["sqlite3_txn_state","int",["sqlite3*","string"]],["sqlite3_uri_boolean","int","sqlite3_filename","string","int"],["sqlite3_uri_key","string","sqlite3_filename","int"],["sqlite3_uri_parameter","string","sqlite3_filename","string"],["sqlite3_user_data","void*","sqlite3_context*"],["sqlite3_value_blob","*","sqlite3_value*"],["sqlite3_value_bytes","int","sqlite3_value*"],["sqlite3_value_double","f64","sqlite3_value*"],["sqlite3_value_dup","sqlite3_value*","sqlite3_value*"],["sqlite3_value_free",void 0,"sqlite3_value*"],["sqlite3_value_frombind","int","sqlite3_value*"],["sqlite3_value_int","int","sqlite3_value*"],["sqlite3_value_nochange","int","sqlite3_value*"],["sqlite3_value_numeric_type","int","sqlite3_value*"],["sqlite3_value_pointer","*","sqlite3_value*","string:static"],["sqlite3_value_subtype","int","sqlite3_value*"],["sqlite3_value_text","string","sqlite3_value*"],["sqlite3_value_type","int","sqlite3_value*"],["sqlite3_vfs_find","*","string"],["sqlite3_vfs_register","int","sqlite3_vfs*","int"],["sqlite3_vfs_unregister","int","sqlite3_vfs*"]],s.exports.sqlite3_progress_handler&&s.bindingSignatures.push(["sqlite3_progress_handler",void 0,["sqlite3*","int",new s.xWrap.FuncPtrAdapter({name:"xProgressHandler",signature:"i(p)",bindScope:"context",contextKey:(w,x)=>w[0]}),"*"]]),s.exports.sqlite3_stmt_explain&&s.bindingSignatures.push(["sqlite3_stmt_explain","int","sqlite3_stmt*","int"],["sqlite3_stmt_isexplain","int","sqlite3_stmt*"]),s.exports.sqlite3_set_authorizer&&s.bindingSignatures.push(["sqlite3_set_authorizer","int",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"sqlite3_set_authorizer::xAuth",signature:"i(pissss)",contextKey:(w,x)=>
2w[0],callProxy:w=>(x,T,F,D,A,j)=>{try{return F=F&&s.cstrToJs(F),D=D&&s.cstrToJs(D),A=A&&s.cstrToJs(A),j=j&&s.cstrToJs(j),w(x,T,F,D,A,j)||0}catch(H){return H.resultCode||r.SQLITE_ERROR}}}),"*"]]),s.bindingSignatures.int64=[["sqlite3_bind_int64","int",["sqlite3_stmt*","int","i64"]],["sqlite3_changes64","i64",["sqlite3*"]],["sqlite3_column_int64","i64",["sqlite3_stmt*","int"]],["sqlite3_deserialize","int","sqlite3*","string","*","i64","i64","int"],["sqlite3_last_insert_rowid","i64",["sqlite3*"]],["sqlite3_malloc64","*","i64"],["sqlite3_msize","i64","*"],["sqlite3_overload_function","int",["sqlite3*","string","int"]],["sqlite3_realloc64","*","*","i64"],["sqlite3_result_int64",void 0,"*","i64"],["sqlite3_result_zeroblob64","int","*","i64"],["sqlite3_serialize","*","sqlite3*","string","*","int"],["sqlite3_set_last_insert_rowid",void 0,["sqlite3*","i64"]],["sqlite3_status64","int","int","*","*","int"],["sqlite3_total_changes64","i64",["sqlite3*"]],["sqlite3_update_hook","*",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"sqlite3_update_hook",signature:"v(iippj)",contextKey:w=>
2w[0],callProxy:w=>(x,T,F,D,A)=>{w(x,T,s.cstrToJs(F),s.cstrToJs(D),A)}}),"*"]],["sqlite3_uri_int64","i64",["sqlite3_filename","string","i64"]],["sqlite3_value_int64","i64","sqlite3_value*"]],s.bigIntEnabled&&s.exports.sqlite3_declare_vtab&&s.bindingSignatures.int64.push(["sqlite3_create_module","int",["sqlite3*","string","sqlite3_module*","*"]],["sqlite3_create_module_v2","int",["sqlite3*","string","sqlite3_module*","*","*"]],["sqlite3_declare_vtab","int",["sqlite3*","string:flexible"]],["sqlite3_drop_modules","int",["sqlite3*","**"]],["sqlite3_vtab_collation","string","sqlite3_index_info*","int"],["sqlite3_vtab_distinct","int","sqlite3_index_info*"],["sqlite3_vtab_in","int","sqlite3_index_info*","int","int"],["sqlite3_vtab_in_first","int","sqlite3_value*","**"],["sqlite3_vtab_in_next","int","sqlite3_value*","**"],["sqlite3_vtab_nochange","int","sqlite3_context*"],["sqlite3_vtab_on_conflict","int","sqlite3*"],["sqlite3_vtab_rhs_value","int","sqlite3_index_info*","int","**"]),s.bigIntEnabled&&s.exports.sqlite3_preupdate_hook&&s.bindingSignatures.int64.push(["sqlite3_preupdate_blobwrite","int","sqlite3*"],["sqlite3_preupdate_count","int","sqlite3*"],["sqlite3_preupdate_depth","int","sqlite3*"],["sqlite3_preupdate_hook","*",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"sqlite3_preupdate_hook",signature:"v(ppippjj)",contextKey:w=>
2w[0],callProxy:w=>(x,T,F,D,A,j,H)=>{w(x,T,F,s.cstrToJs(D),s.cstrToJs(A),j,H)}}),"*"]],["sqlite3_preupdate_new","int",["sqlite3*","int","**"]],["sqlite3_preupdate_old","int",["sqlite3*","int","**"]]),s.bigIntEnabled&&s.exports.sqlite3changegroup_add&&s.exports.sqlite3session_create&&s.exports.sqlite3_preupdate_hook){const w={signature:"i(ps)",callProxy:x=>(T,F)=>{try{return x(T,s.cstrToJs(F))|0}catch(D){return D.resultCode||r.SQLITE_ERROR}}};s.bindingSignatures.int64.push(["sqlite3changegroup_add","int",["sqlite3_changegroup*","int","void*"]],["sqlite3changegroup_add_strm","int",["sqlite3_changegroup*",new s.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3changegroup_delete",void 0,["sqlite3_changegroup*"]],["sqlite3changegroup_new","int",["**"]],["sqlite3changegroup_output","int",["sqlite3_changegroup*","int*","**"]],["sqlite3changegroup_output_strm","int",["sqlite3_changegroup*",new s.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply","int",["sqlite3*","int","void*",new s.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...w}),new s.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply_strm","int",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new s.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...w}),new s.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*"]],["sqlite3changeset_apply_v2","int",["sqlite3*","int","void*",new s.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...w}),new s.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*","**","int*","int"]],["sqlite3changeset_apply_v2_strm","int",["sqlite3*",new s.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new s.xWrap.FuncPtrAdapter({name:"xFilter",bindScope:"transient",...w}),new s.xWrap.FuncPtrAdapter({name:"xConflict",signature:"i(pip)",bindScope:"transient"}),"void*","**","int*","int"]],["sqlite3changeset_concat","int",["int","void*","int","void*","int*","**"]],["sqlite3changeset_concat_strm","int",[new s.xWrap.FuncPtrAdapter({name:"xInputA",signature:"i(ppp)",bindScope:"transient"}),"void*",new s.xWrap.FuncPtrAdapter({name:"xInputB",signature:"i(ppp)",bindScope:"transient"}),"void*",new s.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_conflict","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_finalize","int",["sqlite3_changeset_iter*"]],["sqlite3changeset_fk_conflicts","int",["sqlite3_changeset_iter*","int*"]],["sqlite3changeset_invert","int",["int","void*","int*","**"]],["sqlite3changeset_invert_strm","int",[new s.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*",new s.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppi)",bindScope:"transient"}),"void*"]],["sqlite3changeset_new","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_next","int",["sqlite3_changeset_iter*"]],["sqlite3changeset_old","int",["sqlite3_changeset_iter*","int","**"]],["sqlite3changeset_op","int",["sqlite3_changeset_iter*","**","int*","int*","int*"]],["sqlite3changeset_pk","int",["sqlite3_changeset_iter*","**","int*"]],["sqlite3changeset_start","int",["**","int","*"]],["sqlite3changeset_start_strm","int",["**",new s.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3changeset_start_v2","int",["**","int","*","int"]],["sqlite3changeset_start_v2_strm","int",["**",new s.xWrap.FuncPtrAdapter({name:"xInput",signature:"i(ppp)",bindScope:"transient"}),"void*","int"]],["sqlite3session_attach","int",["sqlite3_session*","string"]],["sqlite3session_changeset","int",["sqlite3_session*","int*","**"]],["sqlite3session_changeset_size","i64",["sqlite3_session*"]],["sqlite3session_changeset_strm","int",["sqlite3_session*",new s.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3session_config","int",["int","void*"]],["sqlite3session_create","int",["sqlite3*","string","**"]],["sqlite3session_diff","int",["sqlite3_session*","string","string","**"]],["sqlite3session_enable","int",["sqlite3_session*","int"]],["sqlite3session_indirect","int",["sqlite3_session*","int"]],["sqlite3session_isempty","int",["sqlite3_session*"]],["sqlite3session_memory_used","i64",["sqlite3_session*"]],["sqlite3session_object_config","int",["sqlite3_session*","int","void*"]],["sqlite3session_patchset","int",["sqlite3_session*","*","**"]],["sqlite3session_patchset_strm","int",["sqlite3_session*",new s.xWrap.FuncPtrAdapter({name:"xOutput",signature:"i(ppp)",bindScope:"transient"}),"void*"]],["sqlite3session_table_filter",void 0,["sqlite3_session*",new s.xWrap.FuncPtrAdapter({name:"xFilter",...w,contextKey:(x,T)=>x[0]}),"*"]])}s.bindingSignatures.wasmInternal=[["sqlite3__wasm_db_reset","int","sqlite3*"],["sqlite3__wasm_db_vfs","sqlite3_vfs*","sqlite3*","string"],["sqlite3__wasm_vfs_create_file","int","sqlite3_vfs*","string","*","int"],["sqlite3__wasm_posix_create_file","int","string","*","int"],["sqlite3__wasm_vfs_unlink","int","sqlite3_vfs*","string"],["sqlite3__wasm_qfmt_token","string:dealloc","string","int"]],t.StructBinder=globalThis.Jaccwabyt({heap:s.heap8u,alloc:s.alloc,dealloc:s.dealloc,bigIntEnabled:s.bigIntEnabled,memberPrefix:"$"}),delete globalThis.Jaccwabyt;{const w=s.xWrap.argAdapter("string");s.xWrap.argAdapter("string:flexible",A=>w(o.flexibleString(A))),s.xWrap.argAdapter("string:static",(function(A){return s.isPtr(A)?A:(A=""+A,this[A]||(this[A]=s.allocCString(A)))}).bind(Object.create(null)));const x=s.xWrap.argAdapter("*"),T=function(){};s.xWrap.argAdapter("sqlite3_filename",x)("sqlite3_context*",x)("sqlite3_value*",x)("void*",x)("sqlite3_changegroup*",x)("sqlite3_changeset_iter*",x)("sqlite3_session*",x)("sqlite3_stmt*",A=>{var j;return x(A instanceof(((j=t==null?void 0:t.oo1)==null?void 0:j.Stmt)||T)?A.pointer:A)})("sqlite3*",A=>{var j;return x(A instanceof(((j=t==null?void 0:t.oo1)==null?void 0:j.DB)||T)?A.pointer:A)})("sqlite3_vfs*",A=>typeof A=="string"?r.sqlite3_vfs_find(A)||t.SQLite3Error.toss(r.SQLITE_NOTFOUND,"Unknown sqlite3_vfs name:",A):x(A instanceof(r.sqlite3_vfs||T)?A.pointer:A)),s.exports.sqlite3_declare_vtab&&s.xWrap.argAdapter("sqlite3_index_info*",A=>x(A instanceof(r.sqlite3_index_info||T)?A.pointer:A))("sqlite3_module*",A=>x(A instanceof(r.sqlite3_module||T)?A.pointer:A));const F=s.xWrap.resultAdapter("*");s.xWrap.resultAdapter("sqlite3*",F)("sqlite3_context*",F)("sqlite3_stmt*",F)("sqlite3_value*",F)("sqlite3_vfs*",F)("void*",F),s.exports.sqlite3_step.length===0&&(s.xWrap.doArgcCheck=!1,t.config.warn("Disabling sqlite3.wasm.xWrap.doArgcCheck due to environmental quirks."));for(const A of s.bindingSignatures)r[A[0]]=s.xWrap.apply(null,A);for(const A of s.bindingSignatures.wasmInternal)o[A[0]]=s.xWrap.apply(null,A);const D=function(A){return()=>n(A+"() is unavailable due to lack","of BigInt support in this build.")};for(const A of s.bindingSignatures.int64)r[A[0]]=s.bigIntEnabled?s.xWrap.apply(null,A):D(A[0]);if(delete s.bindingSignatures,s.exports.sqlite3__wasm_db_error){const A=s.xWrap("sqlite3__wasm_db_error","int","sqlite3*","int","string");o.sqlite3__wasm_db_error=function(j,H,c){return H instanceof t.WasmAllocError?(H=r.SQLITE_NOMEM,c=0):H instanceof Error&&(c=c||""+H,H=H.resultCode||r.SQLITE_ERROR),j?A(j,H,c):H}}else o.sqlite3__wasm_db_error=function(A,j,H){return console.warn("sqlite3__wasm_db_error() is not exported.",arguments),j}}{const w=s.xCall("sqlite3__wasm_enum_json");w||n("Maintenance required: increase sqlite3__wasm_enum_json()'s","static buffer size!"),s.ctype=JSON.parse(s.cstrToJs(w));const x=["access","authorizer","blobFinalizers","changeset","config","dataTypes","dbConfig","dbStatus","encodings","fcntl","flock","ioCap","limits","openFlags","prepareFlags","resultCodes","sqlite3Status","stmtStatus","syncFlags","trace","txnState","udfFlags","version"];s.bigIntEnabled&&x.push("serialize","session","vtab");
2for(const D of x)for(const A of Object.entries(s.ctype[D]))r[A[0]]=A[1];s.functionEntry(r.SQLITE_WASM_DEALLOC)||n("Internal error: cannot resolve exported function","entry SQLITE_WASM_DEALLOC (=="+r.SQLITE_WASM_DEALLOC+").");const T=Object.create(null);for(const D of["resultCodes"])for(const A of Object.entries(s.ctype[D]))T[A[1]]=A[0];r.sqlite3_js_rc_str=D=>T[D];const F=Object.assign(Object.create(null),{WasmTestStruct:!0,sqlite3_kvvfs_methods:!o.isUIThread(),sqlite3_index_info:!s.bigIntEnabled,sqlite3_index_constraint:!s.bigIntEnabled,sqlite3_index_orderby:!s.bigIntEnabled,sqlite3_index_constraint_usage:!s.bigIntEnabled});for(const D of s.ctype.structs)F[D.name]||(r[D.name]=t.StructBinder(D));if(r.sqlite3_index_info){for(const D of["sqlite3_index_constraint","sqlite3_index_orderby","sqlite3_index_constraint_usage"])r.sqlite3_index_info[D]=r[D],delete r[D];r.sqlite3_vtab_config=s.xWrap("sqlite3__wasm_vtab_config","int",["sqlite3*","int","int"])}}const d=(w,x,T)=>o.sqlite3__wasm_db_error(w,r.SQLITE_MISUSE,x+"() requires "+T+" argument"+(T===1?"":"s")+"."),q=w=>o.sqlite3__wasm_db_error(w,r.SQLITE_FORMAT,"SQLITE_UTF8 is the only supported encoding."),L=w=>s.xWrap.argAdapter("sqlite3*")(w),C=w=>s.isPtr(w)?s.cstrToJs(w):w,Q=(function(w,x){w=L(w);let T=this.dbMap.get(w);if(x)!T&&x>0&&this.dbMap.set(w,T=Object.create(null));else return this.dbMap.delete(w),T;return T}).bind(Object.assign(Object.create(null),{dbMap:new Map}));Q.addCollation=function(w,x){const T=Q(w,1);T.collation||(T.collation=new Set),T.collation.add(C(x).toLowerCase())},Q._addUDF=function(w,x,T,F){x=C(x).toLowerCase();let D=F.get(x);D||F.set(x,D=new Set),D.add(T<0?-1:T)},Q.addFunction=function(w,x,T){const F=Q(w,1);F.udf||(F.udf=new Map),this._addUDF(w,x,T,F.udf)},s.exports.sqlite3_create_window_function&&(Q.addWindowFunc=function(w,x,T){const F=Q(w,1);F.wudf||(F.wudf=new Map),this._addUDF(w,x,T,F.wudf)}),Q.cleanup=function(w){w=L(w);const x=[w];for(const D of["sqlite3_busy_handler","sqlite3_commit_hook","sqlite3_preupdate_hook","sqlite3_progress_handler","sqlite3_rollback_hook","sqlite3_set_authorizer","sqlite3_trace_v2","sqlite3_update_hook"]){const A=s.exports[D];if(A){x.length=A.length;try{r[D](...x)}catch(j){t.config.warn("close-time call of",D+"(",x,") threw:",j)}}}const T=Q(w,0);if(!T)return;if(T.collation){for(const D of T.collation)try{r.sqlite3_create_collation_v2(w,D,r.SQLITE_UTF8,0,0,0)}catch{}delete T.collation}let F;for(F=0;F<2;++F){const D=F?T.wudf:T.udf;if(!D)continue;const A=F?r.sqlite3_create_window_function:r.sqlite3_create_function_v2;for(const j of D){const H=j[0],c=j[1],g=[w,H,0,r.SQLITE_UTF8,0,0,0,0,0];F&&g.push(0);for(const E of c)try{g[2]=E,A.apply(null,g)}catch{}c.clear()}D.clear()}delete T.udf,delete T.wudf};{const w=s.xWrap("sqlite3_close_v2","int","sqlite3*");r.sqlite3_close_v2=function(x){if(arguments.length!==1)return d(x,"sqlite3_close_v2",1);if(x)try{Q.cleanup(x)}catch{}return w(x)}}if(r.sqlite3session_create){const w=s.xWrap("sqlite3session_delete",void 0,["sqlite3_session*"]);r.sqlite3session_delete=function(x){if(arguments.length!==1)return d(pDb,"sqlite3session_delete",1);x&&r.sqlite3session_table_filter(x,0,0),w(x)}}{const w=(T,F)=>"argv["+F+"]:"+T[0]+":"+s.cstrToJs(T[1]).toLowerCase(),x=s.xWrap("sqlite3_create_collation_v2","int",["sqlite3*","string","int","*",new s.xWrap.FuncPtrAdapter({name:"xCompare",signature:"i(pipip)",contextKey:w}),new s.xWrap.FuncPtrAdapter({name:"xDestroy",signature:"v(p)",contextKey:w})]);r.sqlite3_create_collation_v2=function(T,F,D,A,j,H){if(arguments.length!==6)return d(T,"sqlite3_create_collation_v2",6);if((D&15)===0)D|=r.SQLITE_UTF8;else if(r.SQLITE_UTF8!==(D&15))return q(T);try{const c=x(T,F,D,A,j,H);return c===0&&j instanceof Function&&Q.addCollation(T,F),c}catch(c){return o.sqlite3__wasm_db_error(T,c)}},r.sqlite3_create_collation=(T,F,D,A,j)=>arguments.length===5?r.sqlite3_create_collation_v2(T,F,D,A,j,0):d(T,"sqlite3_create_collation",5)}{const w=function(D,A){return D[0]+":"+(D[2]<0?-1:D[2])+":"+A+":"+s.cstrToJs(D[1]).toLowerCase()},x=Object.assign(Object.create(null),{xInverseAndStep:{signature:"v(pip)",contextKey:w,callProxy:D=>(A,j,H)=>
2{try{D(A,...r.sqlite3_values_to_js(j,H))}catch(c){r.sqlite3_result_error_js(A,c)}}},xFinalAndValue:{signature:"v(p)",contextKey:w,callProxy:D=>A=>{try{r.sqlite3_result_js(A,D(A))}catch(j){r.sqlite3_result_error_js(A,j)}}},xFunc:{signature:"v(pip)",contextKey:w,callProxy:D=>(A,j,H)=>{try{r.sqlite3_result_js(A,D(A,...r.sqlite3_values_to_js(j,H)))}catch(c){r.sqlite3_result_error_js(A,c)}}},xDestroy:{signature:"v(p)",contextKey:w,callProxy:D=>A=>{try{D(A)}catch(j){console.error("UDF xDestroy method threw:",j)}}}}),T=s.xWrap("sqlite3_create_function_v2","int",["sqlite3*","string","int","int","*",new s.xWrap.FuncPtrAdapter({name:"xFunc",...x.xFunc}),new s.xWrap.FuncPtrAdapter({name:"xStep",...x.xInverseAndStep}),new s.xWrap.FuncPtrAdapter({name:"xFinal",...x.xFinalAndValue}),new s.xWrap.FuncPtrAdapter({name:"xDestroy",...x.xDestroy})]),F=s.exports.sqlite3_create_window_function?s.xWrap("sqlite3_create_window_function","int",["sqlite3*","string","int","int","*",new s.xWrap.FuncPtrAdapter({name:"xStep",...x.xInverseAndStep}),new s.xWrap.FuncPtrAdapter({name:"xFinal",...x.xFinalAndValue}),new s.xWrap.FuncPtrAdapter({name:"xValue",...x.xFinalAndValue}),new s.xWrap.FuncPtrAdapter({name:"xInverse",...x.xInverseAndStep}),new s.xWrap.FuncPtrAdapter({name:"xDestroy",...x.xDestroy})]):void 0;r.sqlite3_create_function_v2=function D(A,j,H,c,g,E,z,u,h){if(D.length!==arguments.length)return d(A,"sqlite3_create_function_v2",D.length);if((c&15)===0)c|=r.SQLITE_UTF8;else if(r.SQLITE_UTF8!==(c&15))return q(A);try{const l=T(A,j,H,c,g,E,z,u,h);return l===0&&(E instanceof Function||z instanceof Function||u instanceof Function||h instanceof Function)&&Q.addFunction(A,j,H),l}catch(l){return console.error("sqlite3_create_function_v2() setup threw:",l),o.sqlite3__wasm_db_error(A,l,"Creation of UDF threw: "+l)}},r.sqlite3_create_function=function D(A,j,H,c,g,E,z,u){return D.length===arguments.length?r.sqlite3_create_function_v2(A,j,H,c,g,E,z,u,0):d(A,"sqlite3_create_function",D.length)},F?r.sqlite3_create_window_function=function D(A,j,H,c,g,E,z,u,h,l){if(D.length!==arguments.length)return d(A,"sqlite3_create_window_function",D.length);if((c&15)===0)c|=r.SQLITE_UTF8;else if(r.SQLITE_UTF8!==(c&15))return q(A);try{const _=F(A,j,H,c,g,E,z,u,h,l);return _===0&&(E instanceof Function||z instanceof Function||u instanceof Function||h instanceof Function||l instanceof Function)&&Q.addWindowFunc(A,j,H),_}catch(_){return console.error("sqlite3_create_window_function() setup threw:",_),o.sqlite3__wasm_db_error(A,_,"Creation of UDF threw: "+_)}}:delete r.sqlite3_create_window_function,r.sqlite3_create_function_v2.udfSetResult=r.sqlite3_create_function.udfSetResult=r.sqlite3_result_js,r.sqlite3_create_window_function&&(r.sqlite3_create_window_function.udfSetResult=r.sqlite3_result_js),r.sqlite3_create_function_v2.udfConvertArgs=r.sqlite3_create_function.udfConvertArgs=r.sqlite3_values_to_js,r.sqlite3_create_window_function&&(r.sqlite3_create_window_function.udfConvertArgs=r.sqlite3_values_to_js),r.sqlite3_create_function_v2.udfSetError=r.sqlite3_create_function.udfSetError=r.sqlite3_result_error_js,r.sqlite3_create_window_function&&(r.sqlite3_create_window_function.udfSetError=r.sqlite3_result_error_js)}{const w=(T,F)=>(typeof T=="string"?F=-1:o.isSQLableTypedArray(T)?(F=T.byteLength,T=o.typedArrayToString(T instanceof ArrayBuffer?new Uint8Array(T):T)):Array.isArray(T)&&(T=T.join(""),F=-1),[T,F]),x={basic:s.xWrap("sqlite3_prepare_v3","int",["sqlite3*","string","int","int","**","**"]),full:s.xWrap("sqlite3_prepare_v3","int",["sqlite3*","*","int","int","**","**"])};r.sqlite3_prepare_v3=function T(F,D,A,j,H,c){if(T.length!==arguments.length)return d(F,"sqlite3_prepare_v3",T.length);const[g,E]=w(D,A);switch(typeof g){case"string":return x.basic(F,g,E,j,H,null);case"number":return x.full(F,g,E,j,H,c);default:return o.sqlite3__wasm_db_error(F,r.SQLITE_MISUSE,"Invalid SQL argument type for sqlite3_prepare_v2/v3().")}},r.sqlite3_prepare_v2=function T(F,D,A,j,H){return T.length===arguments.length?r.sqlite3_prepare_v3(F,D,A,0,j,H):d(F,"sqlite3_prepare_v2",T.length)}}{const w=s.xWrap("sqlite3_bind_text","int",["sqlite3_stmt*","int","string","int","*"]),x=s.xWrap("sqlite3_bind_blob","int",["sqlite3_stmt*","int","*","int","*"]);r.sqlite3_bind_text=function T(F,D,A,j,H){if(T.length!==arguments.length)return d(r.sqlite3_db_handle(F),"sqlite3_bind_text",T.length);if(s.isPtr(A)||A===null)return w(F,D,A,j,H);A instanceof ArrayBuffer?A=new Uint8Array(A):Array.isArray(pMem)&&(A=pMem.join(""));let c,g;try{if(o.isSQLableTypedArray(A))c=s.allocFromTypedArray(A),g=A.byteLength;else if(typeof A=="string")[c,g]=s.allocCString(A);else return o.sqlite3__wasm_db_error(r.sqlite3_db_handle(F),r.SQLITE_MISUSE,"Invalid 3rd argument type for sqlite3_bind_text().");return w(F,D,c,g,r.SQLITE_WASM_DEALLOC)}catch(E){return s.dealloc(c),o.sqlite3__wasm_db_error(r.sqlite3_db_handle(F),E)}},r.sqlite3_bind_blob=function T(F,D,A,j,H){if(T.length!==arguments.length)return d(r.sqlite3_db_handle(F),"sqlite3_bind_blob",T.length);if(s.isPtr(A)||A===null)return x(F,D,A,j,H);A instanceof ArrayBuffer?A=new Uint8Array(A):Array.isArray(A)&&(A=A.join(""));let c,g;try{if(o.isBindableTypedArray(A))c=s.allocFromTypedArray(A),g=j>=0?j:A.byteLength;else if(typeof A=="string")[c,g]=s.allocCString(A);else return o.sqlite3__wasm_db_error(r.sqlite3_db_handle(F),r.SQLITE_MISUSE,"Invalid 3rd argument type for sqlite3_bind_blob().");return x(F,D,c,g,r.SQLITE_WASM_DEALLOC)}catch(E){return s.dealloc(c),o.sqlite3__wasm_db_error(r.sqlite3_db_handle(F),E)}}}r.sqlite3_config=function(w,...x){if(arguments.length<2)return r.SQLITE_MISUSE;
2switch(w){case r.SQLITE_CONFIG_COVERING_INDEX_SCAN:case r.SQLITE_CONFIG_MEMSTATUS:case r.SQLITE_CONFIG_SMALL_MALLOC:case r.SQLITE_CONFIG_SORTERREF_SIZE:case r.SQLITE_CONFIG_STMTJRNL_SPILL:case r.SQLITE_CONFIG_URI:return s.exports.sqlite3__wasm_config_i(w,x[0]);case r.SQLITE_CONFIG_LOOKASIDE:return s.exports.sqlite3__wasm_config_ii(w,x[0],x[1]);case r.SQLITE_CONFIG_MEMDB_MAXSIZE:return s.exports.sqlite3__wasm_config_j(w,x[0]);case r.SQLITE_CONFIG_GETMALLOC:case r.SQLITE_CONFIG_GETMUTEX:case r.SQLITE_CONFIG_GETPCACHE2:case r.SQLITE_CONFIG_GETPCACHE:case r.SQLITE_CONFIG_HEAP:case r.SQLITE_CONFIG_LOG:case r.SQLITE_CONFIG_MALLOC:case r.SQLITE_CONFIG_MMAP_SIZE:case r.SQLITE_CONFIG_MULTITHREAD:case r.SQLITE_CONFIG_MUTEX:case r.SQLITE_CONFIG_PAGECACHE:case r.SQLITE_CONFIG_PCACHE2:case r.SQLITE_CONFIG_PCACHE:case r.SQLITE_CONFIG_PCACHE_HDRSZ:case r.SQLITE_CONFIG_PMASZ:case r.SQLITE_CONFIG_SERIALIZED:case r.SQLITE_CONFIG_SINGLETHREAD:case r.SQLITE_CONFIG_SQLLOG:case r.SQLITE_CONFIG_WIN32_HEAPSIZE:default:return r.SQLITE_NOTFOUND}};{const w=new Set;r.sqlite3_auto_extension=function(x){if(x instanceof Function)x=s.installFunction("i(ppp)",x);else if(arguments.length!==1||!s.isPtr(x))return r.SQLITE_MISUSE;const T=s.exports.sqlite3_auto_extension(x);return x!==arguments[0]&&(T===0?w.add(x):s.uninstallFunction(x)),T},r.sqlite3_cancel_auto_extension=function(x){return!x||arguments.length!==1||!s.isPtr(x)?0:s.exports.sqlite3_cancel_auto_extension(x)},r.sqlite3_reset_auto_extension=function(){s.exports.sqlite3_reset_auto_extension();for(const x of w)s.uninstallFunction(x);w.clear()}}const V=r.sqlite3_vfs_find("kvvfs");if(V)if(o.isUIThread()){const w=new r.sqlite3_kvvfs_methods(s.exports.sqlite3__wasm_kvvfs_methods());delete r.sqlite3_kvvfs_methods;const x=s.exports.sqlite3__wasm_kvvfsMakeKeyOnPstack,T=s.pstack,F=A=>s.peek(A)===115?sessionStorage:localStorage,D={xRead:(A,j,H,c)=>{const g=T.pointer,E=s.scopedAllocPush();try{const z=x(A,j);if(!z)return-3;const u=s.cstrToJs(z),h=F(A).getItem(u);if(!h)return-1;const l=h.length;if(c<=0)return l;if(c===1)return s.poke(H,0),l;const _=s.scopedAllocCString(h);return c>l+1&&(c=l+1),s.heap8u().copyWithin(H,_,_+c-1),s.poke(H+c-1,0),c-1}catch(z){return console.error("kvstorageRead()",z),-2}finally{T.restore(g),s.scopedAllocPop(E)}},xWrite:(A,j,H)=>{const c=T.pointer;try{const g=x(A,j);if(!g)return 1;const E=s.cstrToJs(g);return F(A).setItem(E,s.cstrToJs(H)),0}catch(g){return console.error("kvstorageWrite()",g),r.SQLITE_IOERR}finally{T.restore(c)}},xDelete:(A,j)=>{const H=T.pointer;try{const c=x(A,j);return c?(F(A).removeItem(s.cstrToJs(c)),0):1}catch(c){return console.error("kvstorageDelete()",c),r.SQLITE_IOERR}finally{T.restore(H)}}};for(const A of Object.keys(D))w[w.memberKey(A)]=s.installFunction(w.memberSignature(A),D[A])}else r.sqlite3_vfs_unregister(V);s.xWrap.FuncPtrAdapter.warnOnUse=!0;const P=t.StructBinder,I=function w(x,T,F,D=w.installMethodArgcCheck){if(x instanceof P.StructType?!(F instanceof Function)&&!s.isPtr(F)&&n("Usage errror: expecting a Function or WASM pointer to one."):n("Usage error: target object is-not-a StructType."),arguments.length===1)return(c,g)=>w(x,c,g,D);w.argcProxy||(w.argcProxy=function(c,g,E,z){return function(...u){return E.length!==arguments.length&&n("Argument mismatch for",c.structInfo.name+"::"+g+": Native signature is:",z),E.apply(this,u)}},w.removeFuncList=function(){this.ondispose.__removeFuncList&&(this.ondispose.__removeFuncList.forEach((c,g)=>{if(typeof c=="number")try{s.uninstallFunction(c)}catch{}}),delete this.ondispose.__removeFuncList)});const A=x.memberSignature(T);A.length<2&&n("Member",T,"does not have a function pointer signature:",A);const j=x.memberKey(T),H=D&&!s.isPtr(F)?w.argcProxy(x,j,F,A):F;if(s.isPtr(H))H&&!s.functionEntry(H)&&n("Pointer",H,"is not a WASM function table entry."),x[j]=H;else{const c=s.installFunction(H,x.memberSignature(T,!0));x[j]=c,(!x.ondispose||!x.ondispose.__removeFuncList)&&(x.addOnDispose("ondispose.__removeFuncList handler",w.removeFuncList),x.ondispose.__removeFuncList=[]),x.ondispose.__removeFuncList.push(j,c)}return(c,g)=>w(x,c,g,D)};I.installMethodArgcCheck=!1;const N=function(w,x,T=I.installMethodArgcCheck){const F=new Map;for(const D of Object.keys(x)){const A=x[D],j=F.get(A);if(j){const H=w.memberKey(D);w[H]=w[w.memberKey(j)]}else I(w,D,A,T),F.set(A,D)}return w};P.StructType.prototype.installMethod=function(x,T,F=I.installMethodArgcCheck){return arguments.length<3&&x&&typeof x=="object"?N(this,...arguments):I(this,...arguments)},P.StructType.prototype.installMethods=function(w,x=I.installMethodArgcCheck){return N(this,w,x)}}
2),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){t.version={libVersion:"3.49.1",libVersionNumber:3049001,sourceId:"2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70",downloadVersion:3490100}}),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){const n=(...u)=>{throw new t.SQLite3Error(...u)},r=t.capi,s=t.wasm,o=t.util,d=new WeakMap,q=new WeakMap,L=(u,h,l)=>{const _=Object.getOwnPropertyDescriptor(u,h);return _?_.value:l},C=function(u,h){return h&&(u instanceof I&&(u=u.pointer),n(h,"sqlite3 result code",h+":",u?r.sqlite3_errmsg(u):r.sqlite3_errstr(h))),arguments[0]},Q=s.installFunction("i(ippp)",(function(u,h,l,_){r.SQLITE_TRACE_STMT===u&&console.log("SQL TRACE #"+ ++this.counter+" via sqlite3@"+h+":",s.cstrToJs(_))}).bind({counter:0})),V=Object.create(null),P=function u(...h){if(!u._name2vfs){u._name2vfs=Object.create(null);const ie=typeof importScripts=="function"?ae=>n("The VFS for",ae,"is only available in the main window thread."):!1;u._name2vfs[":localStorage:"]={vfs:"kvvfs",filename:ie||(()=>"local")},u._name2vfs[":sessionStorage:"]={vfs:"kvvfs",filename:ie||(()=>"session")}}const l=u.normalizeArgs(...h);let _=l.filename,b=l.vfs,y=l.flags;(typeof _!="string"&&typeof _!="number"||typeof y!="string"||b&&typeof b!="string"&&typeof b!="number")&&(t.config.error("Invalid DB ctor args",l,arguments),n("Invalid arguments for DB constructor."));let U=typeof _=="number"?s.cstrToJs(_):_;const J=u._name2vfs[U];J&&(b=J.vfs,_=U=J.filename(U));let te,oe=0;y.indexOf("c")>=0&&(oe|=r.SQLITE_OPEN_CREATE|r.SQLITE_OPEN_READWRITE),y.indexOf("w")>=0&&(oe|=r.SQLITE_OPEN_READWRITE),oe===0&&(oe|=r.SQLITE_OPEN_READONLY),oe|=r.SQLITE_OPEN_EXRESCODE;const re=s.pstack.pointer;try{const ie=s.pstack.allocPtr();let ae=r.sqlite3_open_v2(_,ie,oe,b||0);te=s.peekPtr(ie),C(te,ae),r.sqlite3_extended_result_codes(te,1),y.indexOf("t")>=0&&r.sqlite3_trace_v2(te,r.SQLITE_TRACE_STMT,Q,te)}catch(ie){throw te&&r.sqlite3_close_v2(te),ie}finally{s.pstack.restore(re)}this.filename=U,d.set(this,te),q.set(this,Object.create(null));try{const ie=r.sqlite3_js_db_vfs(te)||n("Internal error: cannot get VFS for new db handle."),ae=V[ie];ae&&(ae instanceof Function?ae(this,t):C(te,r.sqlite3_exec(te,ae,0,0,0)))}catch(ie){throw this.close(),ie}};P.setVfsPostOpenCallback=function(u,h){h instanceof Function||n("dbCtorHelper.setVfsPostOpenCallback() should not be used with a non-function argument.",arguments),V[u]=h},P.normalizeArgs=function(u=":memory:",h="c",l=null){const _={};return arguments.length===1&&arguments[0]&&typeof arguments[0]=="object"?(Object.assign(_,arguments[0]),_.flags===void 0&&(_.flags="c"),_.vfs===void 0&&(_.vfs=null),_.filename===void 0&&(_.filename=":memory:")):(_.filename=u,_.flags=h,_.vfs=l),_};const I=function(...u){P.apply(this,u)};I.dbCtorHelper=P;const N={null:1,number:2,string:3,boolean:4,blob:5};N.undefined==N.null,s.bigIntEnabled&&(N.bigint=N.number);const w=function(){N!==arguments[2]&&n(r.SQLITE_MISUSE,"Do not call the Stmt constructor directly. Use DB.prepare()."),this.db=arguments[0],d.set(this,arguments[1]),this.parameterCount=r.sqlite3_bind_parameter_count(this.pointer)},x=function(u){return u.pointer||n("DB has been closed."),u},T=function(u,h){return(h!==(h|0)||h<0||h>=u.columnCount)&&n("Column index",h,"is out of range."),u},F=function(u,h){const l=Object.create(null);switch(l.opt=Object.create(null),h.length){case 1:typeof h[0]=="string"||o.isSQLableTypedArray(h[0])||Array.isArray(h[0])?l.sql=h[0]:h[0]&&typeof h[0]=="object"&&(l.opt=h[0],l.sql=l.opt.sql);break;case 2:l.sql=h[0],l.opt=h[1];break;default:n("Invalid argument count for exec().")}l.sql=o.flexibleString(l.sql),typeof l.sql!="string"&&n("Missing SQL argument or unsupported SQL value type.");const _=l.opt;switch(_.returnValue){case"resultRows":_.resultRows||(_.resultRows=[]),l.returnVal=()=>_.resultRows;break;case"saveSql":_.saveSql||(_.saveSql=[]),l.returnVal=()=>_.saveSql;break;case void 0:case"this":l.returnVal=()=>u;break;default:n("Invalid returnValue value:",_.returnValue)}if(!_.callback&&!_.returnValue&&_.rowMode!==void 0&&(_.resultRows||(_.resultRows=[]),l.returnVal=()=>_.resultRows),_.callback||_.resultRows)switch(_.rowMode===void 0?"array":_.rowMode){case"object":l.cbArg=(b,y)=>{y.columnNames||(y.columnNames=b.getColumnNames([]));const U=b.get([]),J=Object.create(null);for(const te in y.columnNames)J[y.columnNames[te]]=U[te];return J};break;case"array":l.cbArg=b=>b.get([]);break;
2case"stmt":Array.isArray(_.resultRows)&&n("exec(): invalid rowMode for a resultRows array: must","be one of 'array', 'object',","a result column number, or column name reference."),l.cbArg=b=>b;break;default:if(o.isInt32(_.rowMode)){l.cbArg=b=>b.get(_.rowMode);break}else if(typeof _.rowMode=="string"&&_.rowMode.length>1&&_.rowMode[0]==="$"){const b=_.rowMode.substr(1);l.cbArg=y=>{const U=y.get(Object.create(null))[b];return U===void 0?n(r.SQLITE_NOTFOUND,"exec(): unknown result column:",b):U};break}n("Invalid rowMode:",_.rowMode)}return l},D=(u,h,l,..._)=>{const b=u.prepare(h);try{const y=b.bind(l).step()?b.get(..._):void 0;return b.reset(),y}finally{b.finalize()}},A=(u,h,l,_)=>u.exec({sql:h,bind:l,rowMode:_,returnValue:"resultRows"});I.checkRc=(u,h)=>C(u,h),I.prototype={isOpen:function(){return!!this.pointer},affirmOpen:function(){return x(this)},close:function(){if(this.pointer){if(this.onclose&&this.onclose.before instanceof Function)try{this.onclose.before(this)}catch{}const u=this.pointer;if(Object.keys(q.get(this)).forEach((h,l)=>{if(l&&l.pointer)try{l.finalize()}catch{}}),d.delete(this),q.delete(this),r.sqlite3_close_v2(u),this.onclose&&this.onclose.after instanceof Function)try{this.onclose.after(this)}catch{}delete this.filename}},changes:function(u=!1,h=!1){const l=x(this).pointer;return u?h?r.sqlite3_total_changes64(l):r.sqlite3_total_changes(l):h?r.sqlite3_changes64(l):r.sqlite3_changes(l)},dbFilename:function(u="main"){return r.sqlite3_db_filename(x(this).pointer,u)},dbName:function(u=0){return r.sqlite3_db_name(x(this).pointer,u)},dbVfsName:function(u=0){let h;const l=r.sqlite3_js_db_vfs(x(this).pointer,u);if(l){const _=new r.sqlite3_vfs(l);try{h=s.cstrToJs(_.$zName)}finally{_.dispose()}}return h},prepare:function(u){x(this);const h=s.pstack.pointer;let l,_;try{l=s.pstack.alloc(8),I.checkRc(this,r.sqlite3_prepare_v2(this.pointer,u,-1,l,null)),_=s.peekPtr(l)}finally{s.pstack.restore(h)}_||n("Cannot prepare empty SQL.");const b=new w(this,_,N);return q.get(this)[_]=b,b},exec:function(){x(this);const u=F(this,arguments);if(!u.sql)return n("exec() requires an SQL string.");const h=u.opt,l=h.callback,_=Array.isArray(h.resultRows)?h.resultRows:void 0;let b,y=h.bind,U=!!(u.cbArg||h.columnNames||_);const J=s.scopedAllocPush(),te=Array.isArray(h.saveSql)?h.saveSql:void 0;try{const oe=o.isSQLableTypedArray(u.sql);let re=oe?u.sql.byteLength:s.jstrlen(u.sql);const ie=s.scopedAlloc(2*s.ptrSizeof+(re+1)),ae=ie+s.ptrSizeof;let ue=ae+s.ptrSizeof;const me=ue+re;for(oe?s.heap8().set(u.sql,ue):s.jstrcpy(u.sql,s.heap8(),ue,re,!1),s.poke(ue+re,0);ue&&s.peek(ue,"i8");){s.pokePtr([ie,ae],0),I.checkRc(this,r.sqlite3_prepare_v3(this.pointer,ue,re,0,ie,ae));const he=s.peekPtr(ie);if(ue=s.peekPtr(ae),re=me-ue,!!he){if(te&&te.push(r.sqlite3_sql(he).trim()),b=new w(this,he,N),y&&b.parameterCount&&(b.bind(y),y=null),U&&b.columnCount){let Ee=Array.isArray(h.columnNames)?0:1;if(U=!1,u.cbArg||_){const be=Object.create(null);for(;b.step();b._lockedByExec=!1){Ee++===0&&b.getColumnNames(be.columnNames=h.columnNames||[]),b._lockedByExec=!0;const O=u.cbArg(b,be);if(_&&_.push(O),l&&l.call(h,O,b)===!1)break}b._lockedByExec=!1}Ee===0&&b.getColumnNames(h.columnNames)}else b.step();b.reset().finalize(),b=null}}}finally{s.scopedAllocPop(J),b&&(delete b._lockedByExec,b.finalize())}return u.returnVal()},createFunction:function(h,l,_){const b=be=>be instanceof Function;switch(arguments.length){case 1:_=h,h=_.name,l=_.xFunc||0;break;case 2:b(l)||(_=l,l=_.xFunc||0);break}_||(_={}),typeof h!="string"&&n("Invalid arguments: missing function name.");let y=_.xStep||0,U=_.xFinal||0;const J=_.xValue||0,te=_.xInverse||0;let oe;b(l)?(oe=!1,(b(y)||b(U))&&n("Ambiguous arguments: scalar or aggregate?"),y=U=null):b(y)?(b(U)||n("Missing xFinal() callback for aggregate or window UDF."),l=null):b(U)?n("Missing xStep() callback for aggregate or window UDF."):n("Missing function-type properties."),oe===!1?(b(J)||b(te))&&n("xValue and xInverse are not permitted for non-window UDFs."):b(J)?(b(te)||n("xInverse must be provided if xValue is."),oe=!0):b(te)&&n("xValue must be provided if xInverse is.");const re=_.pApp;re!=null&&(typeof re!="number"||!o.isInt32(re))&&n("Invalid value for pApp property. Must be a legal WASM pointer value.");const ie=_.xDestroy||0;ie&&!b(ie)&&n("xDestroy property must be a function.");let ae=0;L(_,"deterministic")&&(ae|=r.SQLITE_DETERMINISTIC),L(_,"directOnly")&&(ae|=r.SQLITE_DIRECTONLY),L(_,"innocuous")&&(ae|=r.SQLITE_INNOCUOUS),h=h.toLowerCase();const ue=l||y,me=L(_,"arity"),he=typeof me=="number"?me:ue.length?ue.length-1:0;let Ee;return oe?Ee=r.sqlite3_create_window_function(this.pointer,h,he,r.SQLITE_UTF8|ae,re||0,y,U,J,te,ie):Ee=r.sqlite3_create_function_v2(this.pointer,h,he,r.SQLITE_UTF8|ae,re||0,l,y,U,ie),I.checkRc(this,Ee),this},selectValue:function(u,h,l){return D(this,u,h,0,l)},selectValues:function(u,h,l){const _=this.prepare(u),b=[];try{for(_.bind(h);_.step();)b.push(_.get(0,l));_.reset()}finally{_.finalize()}return b},selectArray:function(u,h){return D(this,u,h,[])},selectObject:function(u,h){return D(this,u,h,{})},selectArrays:function(u,h){return A(this,u,h,"array")},selectObjects:function(u,h){return A(this,u,h,"object")},openStatementCount:function(){return this.pointer?Object.keys(q.get(this)).length:0},transaction:function(u){let h="BEGIN";arguments.length>1&&(/[^a-zA-Z]/.test(arguments[0])&&n(r.SQLITE_MISUSE,"Invalid argument for BEGIN qualifier."),h+=" "+arguments[0],u=arguments[1]),x(this).exec(h);try{const l=u(this);return this.exec("COMMIT"),l}catch(l){throw this.exec("ROLLBACK"),l}},savepoint:function(u){x(this).exec("SAVEPOINT oo1");try{const h=u(this);return this.exec("RELEASE oo1"),h}catch(h){throw this.exec("ROLLBACK to SAVEPOINT oo1; RELEASE SAVEPOINT oo1"),h}},checkRc:function(u){return C(this,u)}};const j=function(u){return u.pointer||n("Stmt has been closed."),u},H=function(u){let h=N[u==null?"null":typeof u];switch(h){case N.boolean:case N.null:case N.number:case N.string:return h;case N.bigint:if(s.bigIntEnabled)return h;default:return o.isBindableTypedArray(u)?N.blob:void 0}},c=function(u){return H(u)||n("Unsupported bind() argument type:",typeof u)},g=function(u,h){const l=typeof h=="number"?h:r.sqlite3_bind_parameter_index(u.pointer,h);return l===0||!o.isInt32(l)?n("Invalid bind() parameter name: "+h):(l<1||l>u.parameterCount)&&n("Bind index",h,"is out of range."),l},E=function(u,h){return u._lockedByExec&&n("Operation is illegal when statement is locked:",h),u},z=function u(h,l,_,b){E(j(h),"bind()"),u._||(u._tooBigInt=U=>n("BigInt value is too big to store without precision loss:",U),u._={string:function(U,J,te,oe){const[re,ie]=s.allocCString(te,!0);return(oe?r.sqlite3_bind_blob:r.sqlite3_bind_text)(U.pointer,J,re,ie,r.SQLITE_WASM_DEALLOC)}}),c(b),l=g(h,l);let y=0;switch(b==null?N.null:_){case N.null:y=r.sqlite3_bind_null(h.pointer,l);break;case N.string:y=u._.string(h,l,b,!1);break;case N.number:{let U;o.isInt32(b)?U=r.sqlite3_bind_int:typeof b=="bigint"?o.bigIntFits64(b)?s.bigIntEnabled?U=r.sqlite3_bind_int64:o.bigIntFitsDouble(b)?(b=Number(b),U=r.sqlite3_bind_double):u._tooBigInt(b):u._tooBigInt(b):(b=Number(b),s.bigIntEnabled&&Number.isInteger(b)?U=r.sqlite3_bind_int64:U=r.sqlite3_bind_double),y=U(h.pointer,l,b);break}case N.boolean:y=r.sqlite3_bind_int(h.pointer,l,b?1:0);break;case N.blob:{if(typeof b=="string"){y=u._.string(h,l,b,!0);break}else b instanceof ArrayBuffer?b=new Uint8Array(b):o.isBindableTypedArray(b)||n("Binding a value as a blob requires","that it be a string, Uint8Array, Int8Array, or ArrayBuffer.");const U=s.alloc(b.byteLength||1);s.heap8().set(b.byteLength?b:[0],U),y=r.sqlite3_bind_blob(h.pointer,l,U,b.byteLength,r.SQLITE_WASM_DEALLOC);break}default:t.config.warn("Unsupported bind() argument type:",b),n("Unsupported bind() argument type: "+typeof b)}return y&&I.checkRc(h.db.pointer,y),h._mayGet=!1,h};w.prototype={finalize:function(){if(this.pointer){E(this,"finalize()");const u=r.sqlite3_finalize(this.pointer);return delete q.get(this.db)[this.pointer],d.delete(this),delete this._mayGet,delete this.parameterCount,delete this._lockedByExec,delete this.db,u}},clearBindings:function(){return E(j(this),"clearBindings()"),r.sqlite3_clear_bindings(this.pointer),this._mayGet=!1,this},reset:function(u){E(this,"reset()"),u&&this.clearBindings();const h=r.sqlite3_reset(j(this).pointer);return this._mayGet=!1,C(this.db,h),this},bind:function(){j(this);let u,h;switch(arguments.length){case 1:u=1,h=arguments[0];break;case 2:u=arguments[0],h=arguments[1];break;default:n("Invalid bind() arguments.")}return h===void 0?this:(this.parameterCount||n("This statement has no bindable parameters."),this._mayGet=!1,h===null?z(this,u,N.null,h):Array.isArray(h)?(arguments.length!==1&&n("When binding an array, an index argument is not permitted."),h.forEach((l,_)=>z(this,_+1,c(l),l)),this):(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),typeof h=="object"&&!o.isBindableTypedArray(h)?(arguments.length!==1&&n("When binding an object, an index argument is not permitted."),Object.keys(h).forEac
2h(l=>z(this,l,c(h[l]),h[l])),this):z(this,u,c(h),h)))},bindAsBlob:function(u,h){j(this),arguments.length===1&&(h=u,u=1);const l=c(h);return N.string!==l&&N.blob!==l&&N.null!==l&&n("Invalid value type for bindAsBlob()"),z(this,u,N.blob,h)},step:function(){E(this,"step()");const u=r.sqlite3_step(j(this).pointer);switch(u){case r.SQLITE_DONE:return this._mayGet=!1;case r.SQLITE_ROW:return this._mayGet=!0;default:this._mayGet=!1,t.config.warn("sqlite3_step() rc=",u,r.sqlite3_js_rc_str(u),"SQL =",r.sqlite3_sql(this.pointer)),I.checkRc(this.db.pointer,u)}},stepReset:function(){return this.step(),this.reset()},stepFinalize:function(){try{const u=this.step();return this.reset(),u}finally{try{this.finalize()}catch{}}},get:function(u,h){if(j(this)._mayGet||n("Stmt.step() has not (recently) returned true."),Array.isArray(u)){let l=0;const _=this.columnCount;for(;l<_;)u[l]=this.get(l++);return u}else if(u&&typeof u=="object"){let l=0;const _=this.columnCount;for(;l<_;)u[r.sqlite3_column_name(this.pointer,l)]=this.get(l++);return u}switch(T(this,u),h===void 0?r.sqlite3_column_type(this.pointer,u):h){case r.SQLITE_NULL:return null;case r.SQLITE_INTEGER:if(s.bigIntEnabled){const l=r.sqlite3_column_int64(this.pointer,u);return l>=Number.MIN_SAFE_INTEGER&&l<=Number.MAX_SAFE_INTEGER?Number(l).valueOf():l}else{const l=r.sqlite3_column_double(this.pointer,u);return(l>Number.MAX_SAFE_INTEGER||l<Number.MIN_SAFE_INTEGER)&&n("Integer is out of range for JS integer range: "+l),o.isInt32(l)?l|0:l}case r.SQLITE_FLOAT:return r.sqlite3_column_double(this.pointer,u);case r.SQLITE_TEXT:return r.sqlite3_column_text(this.pointer,u);case r.SQLITE_BLOB:{const l=r.sqlite3_column_bytes(this.pointer,u),_=r.sqlite3_column_blob(this.pointer,u),b=new Uint8Array(l);return l&&b.set(s.heap8u().slice(_,_+l),0),l&&this.db._blobXfer instanceof Array&&this.db._blobXfer.push(b.buffer),b}default:n("Don't know how to translate","type of result column #"+u+".")}n("Not reached.")},getInt:function(u){return this.get(u,r.SQLITE_INTEGER)},getFloat:function(u){return this.get(u,r.SQLITE_FLOAT)},getString:function(u){return this.get(u,r.SQLITE_TEXT)},getBlob:function(u){return this.get(u,r.SQLITE_BLOB)},getJSON:function(u){const h=this.get(u,r.SQLITE_STRING);return h===null?h:JSON.parse(h)},getColumnName:function(u){return r.sqlite3_column_name(T(j(this),u).pointer,u)},getColumnNames:function(u=[]){T(j(this),0);const h=this.columnCount;for(let l=0;l<h;++l)u.push(r.sqlite3_column_name(this.pointer,l));return u},getParamIndex:function(u){return j(this).parameterCount?r.sqlite3_bind_parameter_index(this.pointer,u):void 0},getParamName:function(u){return j(this).parameterCount?r.sqlite3_bind_parameter_name(this.pointer,u):void 0},isBusy:function(){return r.sqlite3_stmt_busy(j(this))!==0},isReadOnly:function(){return r.sqlite3_stmt_readonly(j(this))!==0}};{const u={enumerable:!0,get:function(){return d.get(this)},set:()=>n("The pointer property is read-only.")};Object.defineProperty(w.prototype,"pointer",u),Object.defineProperty(I.prototype,"pointer",u)}if(Object.defineProperty(w.prototype,"columnCount",{enumerable:!1,get:function(){return r.sqlite3_column_count(this.pointer)},set:()=>n("The columnCount property is read-only.")}),t.oo1={DB:I,Stmt:w},o.isUIThread()){t.oo1.JsStorageDb=function(h="session"){const l=P.normalizeArgs(...arguments);h=l.filename,h!=="session"&&h!=="local"&&n("JsStorageDb db name must be one of 'session' or 'local'."),l.vfs="kvvfs",P.call(this,l)};const u=t.oo1.JsStorageDb;u.prototype=Object.create(I.prototype),u.clearStorage=r.sqlite3_js_kvvfs_clear,u.prototype.clearStorage=function(){return u.clearStorage(x(this).filename)},u.storageSize=r.sqlite3_js_kvvfs_size,u.prototype.storageSize=function(){return u.storageSize(x(this).filename)}}}),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){const n=t.util;t.initWorker1API=(function(){const r=(...P)=>{throw new Error(P.join(" "))};globalThis.WorkerGlobalScope instanceof Function||r("initWorker1API() must be run from a Worker thread.");const s=this.sqlite3||r("Missing this.sqlite3 object."),o=s.oo1.DB,d=function(P){let I=q.idMap.get(P);return I||(I="db#"+ ++q.idSeq+"@"+P.pointer,q.idMap.set(P,I),I)},q={dbList:[],idSeq:0,idMap:new WeakMap,xfer:[],open:function(P){const I=new o(P);return this.dbs[d(I)]=I,this.dbList.indexOf(I)<0&&this.dbList.push(I),I},close:function(P,I){if(P){delete this.dbs[d(P)];const N=P.filename,w=n.sqlite3__wasm_db_vfs(P.pointer,0);P.close();const x=this.dbList.indexOf(P);x>=0&&this.dbList.splice(x,1),I&&N&&w&&n.sqlite3__wasm_vfs_unlink(w,N)}},post:function(P,I){I&&I.length?(globalThis.postMessage(P,Array.from(I)),I.length=0):globalThis.postMessage(P)},dbs:Object.create(null),getDb:function(P,I=!0){return this.dbs[P]||(I?r("Unknown (or closed) DB ID:",P):void 0)}},L=function(P=q.dbList[0]){return P&&P.pointer?P:r("DB is not opened.")},C=function(P,I=!0){const N=q.getDb(P.dbId,!1)||q.dbList[0];return I?L(N):N},Q=function(){return q.dbList[0]&&d(q.dbList[0])},V={open:function(P){const I=Object.create(null),N=P.args||Object.create(null);N.simulateError&&r("Throwing because of simulateError flag.");const w=Object.create(null);I.vfs=N.vfs,I.filename=N.filename||"";const x=q.open(I);return w.filename=x.filename,w.persistent=!!s.capi.sqlite3_js_db_uses_vfs(x.pointer,"opfs"),w.dbId=d(x),w.vfs=x.dbVfsName(),w},close:function(P){const I=C(P,!1),N={filename:I&&I.filename};if(I){const w=P.args&&typeof P.args=="object"?!!P.args.unlink:!1;q.close(I,w)}return N},exec:function(P){const I=typeof P.args=="string"?{sql:P.args}:P.args||Object.create(null);I.rowMode==="stmt"?r("Invalid rowMode for 'exec': stmt mode","does not work in the Worker API."):I.sql||r("'exec' requires input SQL.");const N=C(P);
2(I.callback||Array.isArray(I.resultRows))&&(N._blobXfer=q.xfer);const w=I.callback;let x=0;const T=!!I.columnNames;typeof w=="string"&&(T||(I.columnNames=[]),I.callback=function(F,D){q.post({type:w,columnNames:I.columnNames,rowNumber:++x,row:F},q.xfer)});try{const F=I.countChanges?N.changes(!0,I.countChanges===64):void 0;N.exec(I),F!==void 0&&(I.changeCount=N.changes(!0,I.countChanges===64)-F),I.callback instanceof Function&&(I.callback=w,q.post({type:w,columnNames:I.columnNames,rowNumber:null,row:void 0}))}finally{delete N._blobXfer,I.callback&&(I.callback=w)}return I},"config-get":function(){const P=Object.create(null),I=s.config;return["bigIntEnabled"].forEach(function(N){Object.getOwnPropertyDescriptor(I,N)&&(P[N]=I[N])}),P.version=s.version,P.vfsList=s.capi.sqlite3_js_vfs_list(),P},export:function(P){const I=C(P),N={byteArray:s.capi.sqlite3_js_db_export(I.pointer),filename:I.filename,mimetype:"application/x-sqlite3"};return q.xfer.push(N.byteArray.buffer),N},toss:function(P){r("Testing worker exception")}};globalThis.onmessage=async function(P){P=P.data;let I,N=P.dbId,w=P.type;const x=performance.now();try{V.hasOwnProperty(w)&&V[w]instanceof Function?I=await V[w](P):r("Unknown db worker message type:",P.type)}catch(T){w="error",I={operation:P.type,message:T.message,errorClass:T.name,input:P},T.stack&&(I.stack=typeof T.stack=="string"?T.stack.split(/\n\s*/):T.stack)}N||(N=I.dbId||Q()),q.post({type:w,dbId:N,messageId:P.messageId,workerReceivedTime:x,workerRespondTime:performance.now(),departureTime:P.departureTime,result:I},q.xfer)},globalThis.postMessage({type:"sqlite3-api",result:"worker1-ready"})}).bind({sqlite3:t})}),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){const n=t.wasm,r=t.capi,s=t.util.toss3,o=Object.create(null);t.vfs=o,r.sqlite3_vfs.prototype.registerVfs=function(d=!1){this instanceof t.capi.sqlite3_vfs||s("Expecting a sqlite3_vfs-type argument.");const q=r.sqlite3_vfs_register(this,d?1:0);return q&&s("sqlite3_vfs_register(",this,") failed with rc",q),this.pointer!==r.sqlite3_vfs_find(this.$zName)&&s("BUG: sqlite3_vfs_find(vfs.$zName) failed for just-installed VFS",this),this},o.installVfs=function(d){let q=0;const L=["io","vfs"];for(const C of L){const Q=d[C];Q&&(++q,Q.struct.installMethods(Q.methods,!!Q.applyArgcCheck),C==="vfs"&&(!Q.struct.$zName&&typeof Q.name=="string"&&Q.struct.addOnDispose(Q.struct.$zName=n.allocCString(Q.name)),Q.struct.registerVfs(!!Q.asDefault)))}return q||s("Misuse: installVfs() options object requires at least","one of:",L),this}}),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){if(!t.wasm.exports.sqlite3_declare_vtab)return;const n=t.wasm,r=t.capi,s=t.util.toss3,o=Object.create(null);t.vtab=o;const d=r.sqlite3_index_info;d.prototype.nthConstraint=function(C,Q=!1){if(C<0||C>=this.$nConstraint)return!1;const V=this.$aConstraint+d.sqlite3_index_constraint.structInfo.sizeof*C;return Q?V:new d.sqlite3_index_constraint(V)},d.prototype.nthConstraintUsage=function(C,Q=!1){if(C<0||C>=this.$nConstraint)return!1;const V=this.$aConstraintUsage+d.sqlite3_index_constraint_usage.structInfo.sizeof*C;return Q?V:new d.sqlite3_index_constraint_usage(V)},d.prototype.nthOrderBy=function(C,Q=!1){if(C<0||C>=this.$nOrderBy)return!1;const V=this.$aOrderBy+d.sqlite3_index_orderby.structInfo.sizeof*C;return Q?V:new d.sqlite3_index_orderby(V)};const q=function(C,Q){return(function(V,P=!1){if(arguments.length===0&&(V=new Q),V instanceof Q)return this.set(V.pointer,V),V;n.isPtr(V)||t.SQLite3Error.toss("Invalid argument to",C+"()");let I=this.get(V);return P&&this.delete(V),I}).bind(new Map)},L=function(C,Q){const V=q(C,Q);return Object.assign(Object.create(null),{StructType:Q,create:P=>{const I=V();return n.pokePtr(P,I.pointer),I},get:P=>V(P),unget:P=>V(P,!0),dispose:P=>{const I=V(P,!0);I&&I.dispose()}})};o.xVtab=L("xVtab",r.sqlite3_vtab),o.xCursor=L("xCursor",r.sqlite3_vtab_cursor),o.xIndexInfo=C=>new r.sqlite3_index_info(C),o.xError=function C(Q,V,P){if(C.errorReporter instanceof Function)try{C.errorReporter("sqlite3_module::"+Q+"(): "+V.message)}catch{}let I;return V instanceof t.WasmAllocError?I=r.SQLITE_NOMEM:arguments.length>2?I=P:V instanceof t.SQLite3Error&&(I=V.resultCode),I||r.SQLITE_ERROR},o.xError.errorReporter=console.error.bind(console),o.xRowid=(C,Q)=>n.poke(C,Q,"i64"),o.setupModule=function(C){let Q=!1;const V=this instanceof r.sqlite3_module?this:C.struct||(Q=new r.sqlite3_module);try{const P=C.methods||s("Missing 'methods' object.");for(const I of Object.entries({xConnect:"xCreate",xDisconnect:"xDestroy"})){const N=I[0],w=I[1];P[N]===!0?P[N]=P[w]:P[w]===!0&&(P[w]=P[N])}if(C.catchExceptions){const I=function(x,T){return["xConnect","xCreate"].indexOf(x)>=0?function(F,D,A,j,H,c){try{return T(...arguments)||0}catch(g){return g instanceof t.WasmAllocError||(n.dealloc(n.peekPtr(c)),n.pokePtr(c,n.allocCString(g.message))),o.xError(x,g)}}:function(...F){try{return T(...F)||0}catch(D){return o.xError(x,D)}}},N=["xCreate","xConnect","xBestIndex","xDisconnect","xDestroy","xOpen","xClose","xFilter","xNext","xEof","xColumn","xRowid","xUpdate","xBegin","xSync","xCommit","xRollback","xFindFunction","xRename","xSavepoint","xRelease","xRollbackTo","xShadowName"],w=Object.create(null);for(const x of N){const T=P[x];if(T instanceof Function)x==="xConnect"&&P.xCreate===T?w[x]=P.xCreate:
2x==="xCreate"&&P.xConnect===T?w[x]=P.xConnect:w[x]=I(x,T);else continue}V.installMethods(w,!1)}else V.installMethods(P,!!C.applyArgcCheck);if(V.$iVersion===0){let I;typeof C.iVersion=="number"?I=C.iVersion:V.$xShadowName?I=3:V.$xSavePoint||V.$xRelease||V.$xRollbackTo?I=2:I=1,V.$iVersion=I}}catch(P){throw Q&&Q.dispose(),P}return V},r.sqlite3_module.prototype.setupModule=function(C){return o.setupModule.call(this,C)}}),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){const n=function r(s){var q;if(!globalThis.SharedArrayBuffer||!globalThis.Atomics)return Promise.reject(new Error("Cannot install OPFS: Missing SharedArrayBuffer and/or Atomics. The server must emit the COOP/COEP response headers to enable those. See https://sqlite.org/wasm/doc/trunk/persistence.md#coop-coep"));if(typeof WorkerGlobalScope>"u")return Promise.reject(new Error("The OPFS sqlite3_vfs cannot run in the main thread because it requires Atomics.wait()."));if(!globalThis.FileSystemHandle||!globalThis.FileSystemDirectoryHandle||!globalThis.FileSystemFileHandle||!globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle||!((q=navigator==null?void 0:navigator.storage)!=null&&q.getDirectory))return Promise.reject(new Error("Missing required OPFS APIs."));(!s||typeof s!="object")&&(s=Object.create(null));const o=new URL(globalThis.location.href).searchParams;return o.has("opfs-disable")?Promise.resolve(t):(s.verbose===void 0&&(s.verbose=o.has("opfs-verbose")?+o.get("opfs-verbose")||2:1),s.sanityChecks===void 0&&(s.sanityChecks=o.has("opfs-sanity-check")),s.proxyUri===void 0&&(s.proxyUri=r.defaultProxyUri),typeof s.proxyUri=="function"&&(s.proxyUri=s.proxyUri()),new Promise(function(L,C){const Q=[t.config.error,t.config.warn,t.config.log],V=(O,...M)=>{s.verbose>O&&Q[O]("OPFS syncer:",...M)},P=(...O)=>V(2,...O),I=(...O)=>V(1,...O),N=(...O)=>V(0,...O),w=t.util.toss,x=t.capi,T=t.util,F=t.wasm,D=x.sqlite3_vfs,A=x.sqlite3_file,j=x.sqlite3_io_methods,H=Object.create(null),c=()=>{var O;return globalThis.FileSystemHandle&&globalThis.FileSystemDirectoryHandle&&globalThis.FileSystemFileHandle&&globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle&&((O=navigator==null?void 0:navigator.storage)==null?void 0:O.getDirectory)};H.metrics={dump:function(){let O,M=0,W=0,K=0;for(O in y.opIds){const G=U[O];M+=G.count,W+=G.time,K+=G.wait,G.avgTime=G.count&&G.time?G.time/G.count:0,G.avgWait=G.count&&G.wait?G.wait/G.count:0}t.config.log(globalThis.location.href,"metrics for",globalThis.location.href,":",U,`
3Total of`,M,"op(s) for",W,"ms (incl. "+K+" ms of waiting on the async side)"),t.config.log("Serialization metrics:",U.s11n),l.postMessage({type:"opfs-async-metrics"})},reset:function(){let O;const M=K=>K.count=K.time=K.wait=0;for(O in y.opIds)M(U[O]=Object.create(null));let W=U.s11n=Object.create(null);W=W.serialize=Object.create(null),W.count=W.time=0,W=U.s11n.deserialize=Object.create(null),W.count=W.time=0}};const g=new j,E=new D().addOnDispose(()=>g.dispose());let z;const u=O=>(z=!0,E.dispose(),C(O)),h=()=>(z=!1,L(t)),l=new Worker(new URL(""+new URL("sqlite3-opfs-async-proxy-DZdsd1Kz.js",import.meta.url).href,import.meta.url));setTimeout(()=>{z===void 0&&u(new Error("Timeout while waiting for OPFS async proxy worker."))},4e3),l._originalOnError=l.onerror,l.onerror=function(O){N("Error initializing OPFS asyncer:",O),u(new Error("Loading OPFS async Worker failed for unknown reasons."))};const _=x.sqlite3_vfs_find(null),b=_?new D(_):null;g.$iVersion=1,E.$iVersion=2,E.$szOsFile=x.sqlite3_file.structInfo.sizeof,E.$mxPathname=1024,E.$zName=F.allocCString("opfs"),E.$xDlOpen=E.$xDlError=E.$xDlSym=E.$xDlClose=null,E.addOnDispose("$zName",E.$zName,"cleanup default VFS wrapper",()=>b?b.dispose():null);const y=Object.create(null);y.verbose=s.verbose,y.littleEndian=(()=>{const O=new ArrayBuffer(2);return new DataView(O).setInt16(0,256,!0),new Int16Array(O)[0]===256})(),y.asyncIdleWaitTime=150,y.asyncS11nExceptions=1,y.fileBufferSize=1024*64,y.sabS11nOffset=y.fileBufferSize,y.sabS11nSize=E.$mxPathname*2,y.sabIO=new SharedArrayBuffer(y.fileBufferSize+y.sabS11nSize),y.opIds=Object.create(null);const U=Object.create(null);{let O=0;y.opIds.whichOp=O++,y.opIds.rc=O++,y.opIds.xAccess=O++,y.opIds.xClose=O++,y.opIds.xDelete=O++,y.opIds.xDeleteNoWait=O++,y.opIds.xFileSize=O++,y.opIds.xLock=O++,y.opIds.xOpen=O++,y.opIds.xRead=O++,y.opIds.xSleep=O++,y.opIds.xSync=O++,y.opIds.xTruncate=O
3++,y.opIds.xUnlock=O++,y.opIds.xWrite=O++,y.opIds.mkdir=O++,y.opIds["opfs-async-metrics"]=O++,y.opIds["opfs-async-shutdown"]=O++,y.opIds.retry=O++,y.sabOP=new SharedArrayBuffer(O*4),H.metrics.reset()}y.sq3Codes=Object.create(null),["SQLITE_ACCESS_EXISTS","SQLITE_ACCESS_READWRITE","SQLITE_BUSY","SQLITE_CANTOPEN","SQLITE_ERROR","SQLITE_IOERR","SQLITE_IOERR_ACCESS","SQLITE_IOERR_CLOSE","SQLITE_IOERR_DELETE","SQLITE_IOERR_FSYNC","SQLITE_IOERR_LOCK","SQLITE_IOERR_READ","SQLITE_IOERR_SHORT_READ","SQLITE_IOERR_TRUNCATE","SQLITE_IOERR_UNLOCK","SQLITE_IOERR_WRITE","SQLITE_LOCK_EXCLUSIVE","SQLITE_LOCK_NONE","SQLITE_LOCK_PENDING","SQLITE_LOCK_RESERVED","SQLITE_LOCK_SHARED","SQLITE_LOCKED","SQLITE_MISUSE","SQLITE_NOTFOUND","SQLITE_OPEN_CREATE","SQLITE_OPEN_DELETEONCLOSE","SQLITE_OPEN_MAIN_DB","SQLITE_OPEN_READONLY"].forEach(O=>{(y.sq3Codes[O]=x[O])===void 0&&w("Maintenance required: not found:",O)}),y.opfsFlags=Object.assign(Object.create(null),{OPFS_UNLOCK_ASAP:1,OPFS_UNLINK_BEFORE_OPEN:2,defaultUnlockAsap:!1});const J=(O,...M)=>{const W=y.opIds[O]||w("Invalid op ID:",O);y.s11n.serialize(...M),Atomics.store(y.sabOPView,y.opIds.rc,-1),Atomics.store(y.sabOPView,y.opIds.whichOp,W),Atomics.notify(y.sabOPView,y.opIds.whichOp);const K=performance.now();for(;Atomics.wait(y.sabOPView,y.opIds.rc,-1)!=="not-equal";);const G=Atomics.load(y.sabOPView,y.opIds.rc);if(U[O].wait+=performance.now()-K,G&&y.asyncS11nExceptions){const X=y.s11n.deserialize();X&&N(O+"() async error:",...X)}return G};H.debug={asyncShutdown:()=>{I("Shutting down OPFS async listener. The OPFS VFS will no longer work."),J("opfs-async-shutdown")},asyncRestart:()=>{I("Attempting to restart OPFS VFS async listener. Might work, might not."),l.postMessage({type:"opfs-async-restart"})}};const te=()=>{if(y.s11n)return y.s11n;const O=new TextDecoder,M=new TextEncoder("utf-8"),W=new Uint8Array(y.sabIO,y.sabS11nOffset,y.sabS11nSize),K=new DataView(y.sabIO,y.sabS11nOffset,y.sabS11nSize);y.s11n=Object.create(null);const G=Object.create(null);G.number={id:1,size:8,getter:"getFloat64",setter:"setFloat64"},G.bigint={id:2,size:8,getter:"getBigInt64",setter:"setBigInt64"},G.boolean={id:3,size:4,getter:"getInt32",setter:"setInt32"},G.string={id:4};const X=p=>G[typeof p]||w("Maintenance required: this value type cannot be serialized.",p),B=p=>{switch(p){case G.number.id:return G.number;case G.bigint.id:return G.bigint;case G.boolean.id:return G.boolean;case G.string.id:return G.string;default:w("Invalid type ID:",p)}};return y.s11n.deserialize=function(p=!1){++U.s11n.deserialize.count;const f=performance.now(),S=W[0],k=S?[]:null;if(S){const R=[];let $=1,ee,ce,pe;for(ee=0;ee<S;++ee,++$)R.push(B(W[$]));for(ee=0;ee<S;++ee){const Ie=R[ee];Ie.getter?(pe=K[Ie.getter]($,y.littleEndian),$+=Ie.size):(ce=K.getInt32($,y.littleEndian),$+=4,pe=O.decode(W.slice($,$+ce)),$+=ce),k.push(pe)}}return p&&(W[0]=0),U.s11n.deserialize.time+=performance.now()-f,k},y.s11n.serialize=function(...p){const f=performance.now();if(++U.s11n.serialize.count,p.length){const S=[];let k=0,R=1;for(W[0]=p.length&255;k<p.length;++k,++R)S.push(X(p[k])),W[R]=S[k].id;for(k=0;k<p.length;++k){const $=S[k];if($.setter)K[$.setter](R,p[k],y.littleEndian),R+=$.size;else{const ee=M.encode(p[k]);K.setInt32(R,ee.byteLength,y.littleEndian),R+=4,W.set(ee,R),R+=ee.byteLength}}}else W[0]=0;U.s11n.serialize.time+=performance.now()-f},y.s11n},oe=function O(M=16){O._chars||(O._chars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012346789",O._n=O._chars.length);const W=[];let K=0;for(;K<M;++K){const G=Math.random()*(O._n*64)%O._n|0;W[K]=O._chars[G]}return W.join("")},re=Object.create(null),ie=Object.create(null);ie.op=void 0,ie.start=void 0;const ae=O=>{ie.start=performance.now(),ie.op=O,++U[O].count},ue=()=>U[ie.op].time+=performance.now()-ie.start,me={xCheckReservedLock:function(O,M){return F.poke(M,0,"i32"),0},xClose:function(O){ae("xClose");let M=0;const W=re[O];return W&&(delete re[O],M=J("xClose",O),W.sq3File&&W.sq3File.dispose()),ue(),M},xDeviceCharacteristics:function(O){return x.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN},xFileControl:function(O,M,W){return x.SQLITE_NOTFOUND},xFileSize:function(O,M){ae("xFileSize");let W=J("xFileSize",O);if(W==0)try{const K=y.s11n.deserialize()[0];F.poke(M,K,"i64")}catch(K){N("Unexpected error reading xFileSize() result:",K),W=y.sq3Codes.SQLITE_IOERR}return ue(),W},xLock:function(O,M){ae("xLock");const W=re[O];let K=0;return W.lockType?W.lockType=M:(K=J("xLock",O,M),K===0&&(W.lockType=M)),ue(),K},xRead:function(O,M,W,K){ae("xRead");const G=re[O];let X;try{X=J("xRead",O,W,Number(K)),(X===0||x.SQLITE_IOERR_SHORT_READ===X)&&F.heap8u().set(G.sabView.subarray(0,W),M)}catch(B){N("xRead(",arguments,") failed:",B,G),X=x.SQLITE_IOERR_READ}return ue(),X},xSync:function(O,M){ae("xSync"),++U.xSync.count;const W=J("xSync",O,M);return ue(),W},xTruncate:function(O,M){ae("xTruncate");const W=J("xTruncate",O,Number(M));return ue(),W},xUnlock:function(O,M){ae("xUnlock");const W=re[O];let K=0;return x.SQLITE_LOCK_NONE===M&&W.lockType&&(K=J("xUnlock",O,M)),K===0&&(W.lockType=M),ue(),K},xWrite:function(O,M,W,K){ae("xWrite");const G=re[O];let X;try{G.sabView.set(F.heap8u().subarray(M,M+W)),X=J("xWrite",O,W,Number(K))}catch(B){N("xWrite(",arguments,") failed:",B,G),X=x.SQLITE_IOERR_WRITE}return ue(),X}}
3,he={xAccess:function(O,M,W,K){ae("xAccess");const G=J("xAccess",F.cstrToJs(M));return F.poke(K,G?0:1,"i32"),ue(),0},xCurrentTime:function(O,M){return F.poke(M,24405875e-1+new Date().getTime()/864e5,"double"),0},xCurrentTimeInt64:function(O,M){return F.poke(M,24405875e-1*864e5+new Date().getTime(),"i64"),0},xDelete:function(O,M,W){ae("xDelete");const K=J("xDelete",F.cstrToJs(M),W,!1);return ue(),K},xFullPathname:function(O,M,W,K){return F.cstrncpy(K,M,W)<W?0:x.SQLITE_CANTOPEN},xGetLastError:function(O,M,W){return I("OPFS xGetLastError() has nothing sensible to return."),0},xOpen:function(M,W,K,G,X){ae("xOpen");let B=0;W===0?W=oe():F.isPtr(W)&&(x.sqlite3_uri_boolean(W,"opfs-unlock-asap",0)&&(B|=y.opfsFlags.OPFS_UNLOCK_ASAP),x.sqlite3_uri_boolean(W,"delete-before-open",0)&&(B|=y.opfsFlags.OPFS_UNLINK_BEFORE_OPEN),W=F.cstrToJs(W));const p=Object.create(null);p.fid=K,p.filename=W,p.sab=new SharedArrayBuffer(y.fileBufferSize),p.flags=G,p.readOnly=!(t.SQLITE_OPEN_CREATE&G)&&!!(G&x.SQLITE_OPEN_READONLY);const f=J("xOpen",K,W,G,B);return f||(p.readOnly&&F.poke(X,x.SQLITE_OPEN_READONLY,"i32"),re[K]=p,p.sabView=y.sabFileBufView,p.sq3File=new A(K),p.sq3File.$pMethods=g.pointer,p.lockType=x.SQLITE_LOCK_NONE),ue(),f}};b&&(E.$xRandomness=b.$xRandomness,E.$xSleep=b.$xSleep),E.$xRandomness||(he.xRandomness=function(O,M,W){const K=F.heap8u();let G=0;for(;G<M;++G)K[W+G]=Math.random()*255e3&255;return G}),E.$xSleep||(he.xSleep=function(O,M){return Atomics.wait(y.sabOPView,y.opIds.xSleep,0,M),0}),H.getResolvedPath=function(O,M){const W=new URL(O,"file://irrelevant").pathname;return M?W.split("/").filter(K=>!!K):W},H.getDirForFilename=async function(M,W=!1){const K=H.getResolvedPath(M,!0),G=K.pop();let X=H.rootDirectory;for(const B of K)B&&(X=await X.getDirectoryHandle(B,{create:!!W}));
3return[X,G]},H.mkdir=async function(O){try{return await H.getDirForFilename(O+"/filepart",!0),!0}catch{return!1}},H.entryExists=async function(O){try{const[M,W]=await H.getDirForFilename(O);return await M.getFileHandle(W),!0}catch{return!1}},H.randomFilename=oe,H.treeList=async function(){const O=async function W(K,G){G.name=K.name,G.dirs=[],G.files=[];for await(const X of K.values())if(X.kind==="directory"){const B=Object.create(null);G.dirs.push(B),await W(X,B)}else G.files.push(X.name)},M=Object.create(null);return await O(H.rootDirectory,M),M},H.rmfr=async function(){const O=H.rootDirectory,M={recurse:!0};for await(const W of O.values())O.removeEntry(W.name,M)},H.unlink=async function(O,M=!1,W=!1){try{const[K,G]=await H.getDirForFilename(O,!1);return await K.removeEntry(G,{recursive:M}),!0}catch(K){if(W)throw new Error("unlink(",arguments[0],") failed: "+K.message,{cause:K});return!1}},H.traverse=async function(O){const M={recursive:!0,directory:H.rootDirectory};typeof O=="function"&&(O={callback:O}),O=Object.assign(M,O||{}),async function K(G,X){for await(const B of G.values()){if(O.callback(B,G,X)===!1)return!1;if(O.recursive&&B.kind==="directory"&&await K(B,X+1)===!1)break}}(O.directory,0)};const Ee=async function(O,M){const[W,K]=await H.getDirForFilename(O,!0);let X=await(await W.getFileHandle(K,{create:!0})).createSyncAccessHandle(),B=0,p,f=!1;try{for(X.truncate(0);(p=await M())!==void 0;)p instanceof ArrayBuffer&&(p=new Uint8Array(p)),B===0&&p.byteLength>=15&&(T.affirmDbHeader(p),f=!0),X.write(p,{at:B}),B+=p.byteLength;if((B<512||B%512!==0)&&w("Input size",B,"is not correct for an SQLite database."),!f){const S=new Uint8Array(20);X.read(S,{at:0}),T.affirmDbHeader(S)}return X.write(new Uint8Array([1,1]),{at:18}),B}catch(S){throw await X.close(),X=void 0,await W.removeEntry(K).catch(()=>{}),S}finally{X&&await X.close()}};if(H.importDb=async function(O,M){if(M instanceof Function)return Ee(O,M);M instanceof ArrayBuffer&&(M=new Uint8Array(M)),T.affirmIsDb(M);const W=M.byteLength,[K,G]=await H.getDirForFilename(O,!0);let X,B=0;try{return X=await(await K.getFileHandle(G,{create:!0})).createSyncAccessHandle(),X.truncate(0),B=X.write(M,{at:0}),B!=W&&w("Expected to write "+W+" bytes but wrote "+B+"."),X.write(new Uint8Array([1,1]),{at:18}),B}catch(p){throw X&&(await X.close(),X=void 0),await K.removeEntry(G).catch(()=>{}),p}finally{X&&await X.close()}},t.oo1){const O=function(...M){const W=t.oo1.DB.dbCtorHelper.normalizeArgs(...M);W.vfs=E.$zName,t.oo1.DB.dbCtorHelper.call(this,W)};O.prototype=Object.create(t.oo1.DB.prototype),t.oo1.OpfsDb=O,O.importDb=H.importDb,t.oo1.DB.dbCtorHelper.setVfsPostOpenCallback(E.pointer,function(M,W){W.capi.sqlite3_busy_timeout(M,1e4)})}const be=function(){const O=F.scopedAllocPush(),M=new A;try{const W=M.pointer,K=x.SQLITE_OPEN_CREATE|x.SQLITE_OPEN_READWRITE|x.SQLITE_OPEN_MAIN_DB,G=F.scopedAlloc(8),X="/sanity/check/file"+oe(8),B=F.scopedAllocCString(X);let p;if(y.s11n.serialize("This is ä string."),p=y.s11n.deserialize(),P("deserialize() says:",p),p[0]!=="This is ä string."&&w("String d13n error."),he.xAccess(E.pointer,B,0,G),p=F.peek(G,"i32"),P("xAccess(",X,") exists ?=",p),p=he.xOpen(E.pointer,B,W,K,G),P("open rc =",p,"state.sabOPView[xOpen] =",y.sabOPView[y.opIds.xOpen]),p!==0){N("open failed with code",p);return}he.xAccess(E.pointer,B,0,G),p=F.peek(G,"i32"),p||w("xAccess() failed to detect file."),p=me.xSync(M.pointer,0),p&&w("sync failed w/ rc",p),p=me.xTruncate(M.pointer,1024),p&&w("truncate failed w/ rc",p),F.poke(G,0,"i64"),p=me.xFileSize(M.pointer,G),p&&w("xFileSize failed w/ rc",p),P("xFileSize says:",F.peek(G,"i64")),p=me.xWrite(M.pointer,B,10,1),p&&w("xWrite() failed!");const f=F.scopedAlloc(16);p=me.xRead(M.pointer,f,6,2),F.poke(f+6,0);let S=F.cstrToJs(f);P("xRead() got:",S),S!=="sanity"&&w("Unexpected xRead() value."),he.xSleep&&(P("xSleep()ing before close()ing..."),he.xSleep(E.pointer,2e3),P("waking up from xSleep()")),p=me.xClose(W),P("xClose rc =",p,"sabOPView =",y.sabOPView),P("Deleting file:",X),he.xDelete(E.pointer,B,4660),he.xAccess(E.pointer,B,0,G),p=F.peek(G,"i32"),p&&w("Expecting 0 from xAccess(",X,") after xDelete()."),I("End of OPFS sanity checks.")}finally{M.dispose(),F.scopedAllocPop(O)}};l.onmessage=function({data:O}){switch(O.type){case"opfs-unavailable":u(new Error(O.payload.join(" ")));break;case"opfs-async-loaded":l.postMessage({type:"opfs-async-init",args:y});break;case"opfs-async-inited":{if(z===!0)break;try{t.vfs.installVfs({io:{struct:g,methods:me},vfs:{struct:E,methods:he}}),y.sabOPView=new Int32Array(y.sabOP),y.sabFileBufView=new Uint8Array(y.sabIO,0,y.fileBufferSize),y.sabS11nView=new Uint8Array(y.sabIO,y.sabS11nOffset,y.sabS11nSize),te(),s.sanityChecks&&(I("Running sanity checks because of opfs-sanity-check URL arg..."),be()),c()?navigator.storage.getDirectory().then(M=>{l.onerror=l._originalOnError,delete l._originalOnError,t.opfs=H,H.rootDirectory=M,P("End of OPFS sqlite3_vfs setup.",E),h()}).catch(u):h()}catch(M){N(M),u(M)}break}
3default:{const M="Unexpected message from the OPFS async worker: "+JSON.stringify(O);N(M),u(new Error(M));break}}}}))};n.defaultProxyUri="sqlite3-opfs-async-proxy.js",globalThis.sqlite3ApiBootstrap.initializersAsync.push(async r=>{try{let s=n.defaultProxyUri;return r.scriptInfo.sqlite3Dir&&(n.defaultProxyUri=r.scriptInfo.sqlite3Dir+s),n().catch(o=>{r.config.warn("Ignoring inability to install OPFS sqlite3_vfs:",o.message)})}catch(s){return r.config.error("installOpfsVfs() exception:",s),Promise.reject(s)}})}),globalThis.sqlite3ApiBootstrap.initializers.push(function(t){var re,ie,ae,ue,me,he,Ee,be,O,M,W,K,ot,X;const n=t.util.toss,r=t.util.toss3,s=Object.create(null),o=t.capi,d=t.util,q=t.wasm,L=4096,C=512,Q=4,V=8,P=C+Q,I=C,N=P,w=L,x=o.SQLITE_OPEN_MAIN_DB|o.SQLITE_OPEN_MAIN_JOURNAL|o.SQLITE_OPEN_SUPER_JOURNAL|o.SQLITE_OPEN_WAL,T=".opaque",F=()=>Math.random().toString(36).slice(2),D=new TextDecoder,A=new TextEncoder,j=Object.assign(Object.create(null),{name:"opfs-sahpool",directory:void 0,initialCapacity:6,clearOnInit:!1,verbosity:2,forceReinitIfPreviouslyFailed:!1}),H=[t.config.error,t.config.warn,t.config.log];t.config.log;const c=t.config.warn;t.config.error;const g=new Map,E=B=>g.get(B),z=(B,p)=>{p?g.set(B,p):g.delete(B)},u=new Map,h=B=>u.get(B),l=(B,p)=>{p?u.set(B,p):u.delete(B)},_={xCheckReservedLock:function(B,p){const f=h(B);return f.log("xCheckReservedLock"),f.storeErr(),q.poke32(p,1),0},xClose:function(B){const p=h(B);p.storeErr();const f=p.getOFileForS3File(B);if(f)try{p.log(`xClose ${f.path}`),p.mapS3FileToOFile(B,!1),f.sah.flush(),f.flags&o.SQLITE_OPEN_DELETEONCLOSE&&p.deletePath(f.path)}catch(S){return p.storeErr(S,o.SQLITE_IOERR)}return 0},xDeviceCharacteristics:function(B){return o.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN},xFileControl:function(B,p,f){return o.SQLITE_NOTFOUND},xFileSize:function(B,p){const f=h(B);f.log("xFileSize");const k=f.getOFileForS3File(B).sah.getSize()-w;return q.poke64(p,BigInt(k)),0},xLock:function(B,p){const f=h(B);f.log(`xLock ${p}`),f.storeErr();const S=f.getOFileForS3File(B);return S.lockType=p,0},xRead:function(B,p,f,S){const k=h(B);k.storeErr();const R=k.getOFileForS3File(B);k.log(`xRead ${R.path} ${f} @ ${S}`);try{const $=R.sah.read(q.heap8u().subarray(p,p+f),{at:w+Number(S)});return $<f?(q.heap8u().fill(0,p+$,p+f),o.SQLITE_IOERR_SHORT_READ):0}catch($){return k.storeErr($,o.SQLITE_IOERR)}},xSectorSize:function(B){return L},xSync:function(B,p){const f=h(B);f.log(`xSync ${p}`),f.storeErr();const S=f.getOFileForS3File(B);try{return S.sah.flush(),0}catch(k){return f.storeErr(k,o.SQLITE_IOERR)}},xTruncate:function(B,p){const f=h(B);f.log(`xTruncate ${p}`),f.storeErr();const S=f.getOFileForS3File(B);try{return S.sah.truncate(w+Number(p)),0}catch(k){return f.storeErr(k,o.SQLITE_IOERR)}},xUnlock:function(B,p){const f=h(B);f.log("xUnlock");const S=f.getOFileForS3File(B);return S.lockType=p,0},xWrite:function(B,p,f,S){const k=h(B);k.storeErr();const R=k.getOFileForS3File(B);k.log(`xWrite ${R.path} ${f} ${S}`);try{const $=R.sah.write(q.heap8u().subarray(p,p+f),{at:w+Number(S)});return f===$?0:n("Unknown write() failure.")}catch($){return k.storeErr($,o.SQLITE_IOERR)}}},b=new o.sqlite3_io_methods;b.$iVersion=1,t.vfs.installVfs({io:{struct:b,methods:_}});const y={xAccess:function(B,p,f,S){const k=E(B);k.storeErr();try{const R=k.getPath(p);q.poke32(S,k.hasFilename(R)?1:0)}catch{q.poke32(S,0)}return 0},xCurrentTime:function(B,p){return q.poke(p,24405875e-1+new Date().getTime()/864e5,"double"),0},xCurrentTimeInt64:function(B,p){return q.poke(p,24405875e-1*864e5+new Date().getTime(),"i64"),0},xDelete:function(B,p,f){const S=E(B);S.log(`xDelete ${q.cstrToJs(p)}`),S.storeErr();try{return S.deletePath(S.getPath(p)),0}catch(k){return S.storeErr(k),o.SQLITE_IOERR_DELETE}},xFullPathname:function(B,p,f,S){return q.cstrncpy(S,p,f)<f?0:o.SQLITE_CANTOPEN},xGetLastError:function(B,p,f){const S=E(B),k=S.popErr();if(S.log(`xGetLastError ${p} e =`,k),k){const R=q.scopedAllocPush();try{const[$,ee]=q.scopedAllocCString(k.message,!0);q.cstrncpy(f,$,p),ee>p&&q.poke8(f+p-1,0)}catch{return o.SQLITE_NOMEM}finally{q.scopedAllocPop(R)}}return k?k.sqlite3Rc||o.SQLITE_IOERR:0},xOpen:function(p,f,S,k,R){const $=E(p);try{$.log(`xOpen ${q.cstrToJs(f)} ${k}`);const ee=f&&q.peek8(f)?$.getPath(f):F();let ce=$.getSAHForPath(ee);!ce&&k&o.SQLITE_OPEN_CREATE&&($.getFileCount()<$.getCapacity()?(ce=$.nextAvailableSAH(),$.setAssociatedPath(ce,ee,k)):n("SAH pool is full. Cannot create file",ee)),ce||n("file not found:",ee);const pe={path:ee,flags:k,sah:ce};$.mapS3FileToOFile(S,pe),pe.lockType=o.SQLITE_LOCK_NONE;const Ie=new o.sqlite3_file(S);return Ie.$pMethods=b.pointer,Ie.dispose(),q.poke32(R,k),0}catch(ee){return $.storeErr(ee),o.SQLITE_CANTOPEN}}},U=function(B){t.capi.sqlite3_vfs_find(B)&&r("VFS name is already registered:",B);const p=new o.sqlite3_vfs,f=o.sqlite3_vfs_find(null),S=f?new o.sqlite3_vfs(f):null;return p.$iVersion=2,p.$szOsFile=o.sqlite3_file.structInfo.sizeof,p.$mxPathname=C,p.addOnDispose(p.$zName=q.allocCString(B),()=>z(p.pointer,0)),S&&(p.$xRandomness=S.$xRandomness,p.$xSleep=S.$xSleep,S.dispose()),!p.$xRandomness&&!y.xRandomness&&(y.xRandomness=function(k,R,$){const ee=q.heap8u();let ce=0;for(;ce<R;++ce)ee[$+ce]=Math.random()*255e3&255;return ce}),!p.$xSleep&&!y.xSleep&&(y.xSleep=(k,R)=>0),t.vfs.installVfs({vfs:{struct:p,methods:y}}),p};class J{constructor(p=Object.create(null)){Ae(this,K);Nt(this,"vfsDir");Ae(this,re);Ae(this,ie);Ae(this,ae);Ae(this,ue,new Map);Ae(this,me,new Map);Ae(this,he,new Set);Ae(this,Ee,new Map);Ae(this,be,new Uint8Array(P));Ae(this,O);Ae(this,M);Ae(this,W);Te(this,W,p.verbosity??j.verbosity),this.vfsName=p.name||j.name,Te(this,M,U(this.vfsName)),z(Y(this,M).pointer,this),this.vfsDir=p.directory||"."+this.vfsName,Te(this,O,new DataView(Y(this,be).buffer,Y(this,be).byteOffset)),this.isReady=this.reset(!!(p.clearOnInit??j.clearOnInit)).then(()=>
3{if(this.$error)throw this.$error;return this.getCapacity()?Promise.resolve(void 0):this.addCapacity(p.initialCapacity||j.initialCapacity)})}log(...p){it(this,K,ot).call(this,2,...p)}warn(...p){it(this,K,ot).call(this,1,...p)}error(...p){it(this,K,ot).call(this,0,...p)}getVfs(){return Y(this,M)}getCapacity(){return Y(this,ue).size}getFileCount(){return Y(this,me).size}getFileNames(){const p=[],f=Y(this,me).keys();for(const S of f)p.push(S);return p}async addCapacity(p){for(let f=0;f<p;++f){const S=F(),R=await(await Y(this,ie).getFileHandle(S,{create:!0})).createSyncAccessHandle();Y(this,ue).set(R,S),this.setAssociatedPath(R,"",0)}return this.getCapacity()}async reduceCapacity(p){let f=0;for(const S of Array.from(Y(this,he))){if(f===p||this.getFileCount()===this.getCapacity())break;const k=Y(this,ue).get(S);S.close(),await Y(this,ie).removeEntry(k),Y(this,ue).delete(S),Y(this,he).delete(S),++f}return f}releaseAccessHandles(){for(const p of Y(this,ue).keys())p.close();Y(this,ue).clear(),Y(this,me).clear(),Y(this,he).clear()}async acquireAccessHandles(p){const f=[];for await(const[S,k]of Y(this,ie))k.kind==="file"&&f.push([S,k]);return Promise.all(f.map(async([S,k])=>{try{const R=await k.createSyncAccessHandle();if(Y(this,ue).set(R,S),p)R.truncate(w),this.setAssociatedPath(R,"",0);else{const $=this.getAssociatedPath(R);$?Y(this,me).set($,R):Y(this,he).add(R)}}catch(R){throw this.storeErr(R),this.releaseAccessHandles(),R}}))}getAssociatedPath(p){p.read(Y(this,be),{at:0});const f=Y(this,O).getUint32(I);if(Y(this,be)[0]&&(f&o.SQLITE_OPEN_DELETEONCLOSE||(f&x)===0))return c(`Removing file with unexpected flags ${f.toString(16)}`,Y(this,be)),this.setAssociatedPath(p,"",0),"";const S=new Uint32Array(V/4);p.read(S,{at:N});const k=this.computeDigest(Y(this,be));if(S.every((R,$)=>R===k[$])){const R=Y(this,be).findIndex($=>$===0);return R===0&&p.truncate(w),R?D.decode(Y(this,be).subarray(0,R)):""}else return c("Disassociating file with bad digest."),this.setAssociatedPath(p,"",0),""}setAssociatedPath(p,f,S){const k=A.encodeInto(f,Y(this,be));C<=k.written+1&&n("Path too long:",f),Y(this,be).fill(0,k.written,C),Y(this,O).setUint32(I,S);const R=this.computeDigest(Y(this,be));p.write(Y(this,be),{at:0}),p.write(R,{at:N}),p.flush(),f?(Y(this,me).set(f,p),Y(this,he).delete(p)):(p.truncate(w),Y(this,he).add(p))}computeDigest(p){let f=3735928559,S=1103547991;for(const k of p)f=31*f+k*307,S=31*S+k*307;return new Uint32Array([f>>>0,S>>>0])}async reset(p){await this.isReady;let f=await navigator.storage.getDirectory(),S;for(const k of this.vfsDir.split("/"))k&&(S=f,f=await f.getDirectoryHandle(k,{create:!0}));return Te(this,re,f),Te(this,ae,S),Te(this,ie,await Y(this,re).getDirectoryHandle(T,{create:!0})),this.releaseAccessHandles(),this.acquireAccessHandles(p)}getPath(p){return q.isPtr(p)&&(p=q.cstrToJs(p)),(p instanceof URL?p:new URL(p,"file://localhost/")).pathname}deletePath(p){const f=Y(this,me).get(p);return f&&(Y(this,me).delete(p),this.setAssociatedPath(f,"",0)),!!f}storeErr(p,f){return p&&(p.sqlite3Rc=f||o.SQLITE_IOERR,this.error(p)),this.$error=p,f}popErr(){const p=this.$error;return this.$error=void 0,p}nextAvailableSAH(){const[p]=Y(this,he).keys();return p}getOFileForS3File(p){return Y(this,Ee).get(p)}mapS3FileToOFile(p,f){f?(Y(this,Ee).set(p,f),l(p,this)):(Y(this,Ee).delete(p),l(p,!1))}hasFilename(p){return Y(this,me).has(p)}getSAHForPath(p){return Y(this,me).get(p)}async removeVfs(){if(!Y(this,M).pointer||!Y(this,ie))return!1;o.sqlite3_vfs_unregister(Y(this,M).pointer),Y(this,M).dispose(),delete s[this.vfsName];try{this.releaseAccessHandles(),await Y(this,re).removeEntry(T,{recursive:!0}),Te(this,ie,void 0),await Y(this,ae).removeEntry(Y(this,re).name,{recursive:!0}),Te(this,re,Te(this,ae,void 0))}catch(p){t.config.error(this.vfsName,"removeVfs() failed:",p)}return!0}exportFile(p){const f=Y(this,me).get(p)||n("File not found:",p),S=f.getSize()-w,k=new Uint8Array(S>0?S:0);if(S>0){const R=f.read(k,{at:w});R!=S&&n("Expected to read "+S+" bytes but read "+R+".")}return k}async importDbChunked(p,f){const S=Y(this,me).get(p)||this.nextAvailableSAH()||n("No available handles to import to.");S.truncate(0);let k=0,R,$=!1;try{for(;(R=await f())!==void 0;)R instanceof ArrayBuffer&&(R=new Uint8Array(R)),k===0&&R.byteLength>
3=15&&(d.affirmDbHeader(R),$=!0),S.write(R,{at:w+k}),k+=R.byteLength;if((k<512||k%512!==0)&&n("Input size",k,"is not correct for an SQLite database."),!$){const ee=new Uint8Array(20);S.read(ee,{at:0}),d.affirmDbHeader(ee)}S.write(new Uint8Array([1,1]),{at:w+18})}catch(ee){throw this.setAssociatedPath(S,"",0),ee}return this.setAssociatedPath(S,p,o.SQLITE_OPEN_MAIN_DB),k}importDb(p,f){if(f instanceof ArrayBuffer)f=new Uint8Array(f);else if(f instanceof Function)return this.importDbChunked(p,f);const S=Y(this,me).get(p)||this.nextAvailableSAH()||n("No available handles to import to."),k=f.byteLength;(k<512||k%512!=0)&&n("Byte array size is invalid for an SQLite db.");const R="SQLite format 3";for(let ee=0;ee<R.length;++ee)R.charCodeAt(ee)!==f[ee]&&n("Input does not contain an SQLite database header.");const $=S.write(f,{at:w});return $!=k?(this.setAssociatedPath(S,"",0),n("Expected to write "+k+" bytes but wrote "+$+".")):(S.write(new Uint8Array([1,1]),{at:w+18}),this.setAssociatedPath(S,p,o.SQLITE_OPEN_MAIN_DB)),$}}re=new WeakMap,ie=new WeakMap,ae=new WeakMap,ue=new WeakMap,me=new WeakMap,he=new WeakMap,Ee=new WeakMap,be=new WeakMap,O=new WeakMap,M=new WeakMap,W=new WeakMap,K=new WeakSet,ot=function(p,...f){Y(this,W)>p&&H[p](this.vfsName+":",...f)};class te{constructor(p){Ae(this,X);Te(this,X,p),this.vfsName=p.vfsName}async addCapacity(p){return Y(this,X).addCapacity(p)}async reduceCapacity(p){return Y(this,X).reduceCapacity(p)}getCapacity(){return Y(this,X).getCapacity(Y(this,X))}getFileCount(){return Y(this,X).getFileCount()}getFileNames(){return Y(this,X).getFileNames()}async reserveMinimumCapacity(p){const f=Y(this,X).getCapacity();return f<p?Y(this,X).addCapacity(p-f):f}exportFile(p){return Y(this,X).exportFile(p)}importDb(p,f){return Y(this,X).importDb(p,f)}async wipeFiles(){return Y(this,X).reset(!0)}unlink(p){return Y(this,X).deletePath(p)}async removeVfs(){return Y(this,X).removeVfs()}}X=new WeakMap;const oe=async()=>{const B=await navigator.storage.getDirectory(),p=".opfs-sahpool-sync-check-"+F(),k=(await(await B.getFileHandle(p,{create:!0})).createSyncAccessHandle()).close();return await k,await B.removeEntry(p),k!=null&&k.then&&n("The local OPFS API is too old for opfs-sahpool:","it has an async FileSystemSyncAccessHandle.close() method."),!0};t.installOpfsSAHPoolVfs=async function(B=Object.create(null)){var f;B=Object.assign(Object.create(null),j,B||{});const p=B.name;if(B.$testThrowPhase1)throw B.$testThrowPhase1;if(s[p])try{return await s[p]}catch(S){if(B.forceReinitIfPreviouslyFailed)delete s[p];else throw S}return!globalThis.FileSystemHandle||!globalThis.FileSystemDirectoryHandle||!globalThis.FileSystemFileHandle||!globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle||!((f=navigator==null?void 0:navigator.storage)!=null&&f.getDirectory)?s[p]=Promise.reject(new Error("Missing required OPFS APIs.")):s[p]=oe().then(async function(){if(B.$testThrowPhase2)throw B.$testThrowPhase2;const S=new J(B);return S.isReady.then(async()=>{const k=new te(S);if(t.oo1){const R=t.oo1,$=S.getVfs(),ee=function(...ce){const pe=R.DB.dbCtorHelper.normalizeArgs(...ce);pe.vfs=$.$zName,R.DB.dbCtorHelper.call(this,pe)};ee.prototype=Object.create(R.DB.prototype),k.OpfsSAHPoolDb=ee}return S.log("VFS initialized."),k}).catch(async k=>{throw await S.removeVfs().catch(()=>{}),k})}).catch(S=>s[p]=Promise.reject(S))}}),typeof i<"u"){const t=Object.assign(Object.create(null),{exports:typeof m>"u"?i.asm:m,memory:i.wasmMemory},globalThis.sqlite3ApiConfig||{});globalThis.sqlite3ApiConfig=t;let n;try{n=globalThis.sqlite3ApiBootstrap()}catch(r){throw console.error("sqlite3ApiBootstrap() error:",r),r}finally{delete globalThis.sqlite3ApiBootstrap,delete globalThis.sqlite3ApiConfig}i.sqlite3=n}else console.warn("This is not running in an Emscripten module context, so","globalThis.sqlite3ApiBootstrap() is _not_ being called due to lack","of config info for the WASM environment.","It must be called manually.")},fe=ke,fe}})();const lr=function(){var fe,i;const se=jt;if(!se)throw new Error("Expecting globalThis.sqlite3InitModule to be defined by the Emscripten build.");const Z=globalThis.sqlite3InitModuleState=Object.assign(Object.create(null),{moduleScript:(fe=globalThis==null?void 0:globalThis.document)==null?void 0:fe.currentScript,isWorker:typeof WorkerGlobalScope<"u",location:globalThis.location,urlParam
3s:(i=globalThis==null?void 0:globalThis.location)!=null&&i.href?new URL(globalThis.location.href).searchParams:new URLSearchParams});if(Z.debugModule=Z.urlParams.has("sqlite3.debugModule")?(...ye)=>console.warn("sqlite3.debugModule:",...ye):()=>{},Z.urlParams.has("sqlite3.dir"))Z.sqlite3Dir=Z.urlParams.get("sqlite3.dir")+"/";else if(Z.moduleScript){const ye=Z.moduleScript.src.split("/");ye.pop(),Z.sqlite3Dir=ye.join("/")+"/"}if(globalThis.sqlite3InitModule=function ye(...ve){return se(...ve).then(ke=>{ke.runSQLite3PostLoadInit(ke);const Ne=ke.sqlite3;Ne.scriptInfo=Z,ye.__isUnderTest&&(Ne.__isUnderTest=!0);const Oe=Ne.asyncPostInit;return delete Ne.asyncPostInit,Oe()}).catch(ke=>{throw console.error("Exception loading sqlite3 module:",ke),ke})},globalThis.sqlite3InitModule.ready=se.ready,globalThis.sqlite3InitModuleState.moduleScript){const ye=globalThis.sqlite3InitModuleState;let ve=ye.moduleScript.src.split("/");ve.pop(),ye.scriptDir=ve.join("/")+"/"}return Z.debugModule("sqlite3InitModuleState =",Z),globalThis.sqlite3InitModule}();jt=lr;globalThis.sqlite3Worker1Promiser=function se(Z=se.defaultConfig){if(arguments.length===1&&typeof arguments[0]=="function"){const ne=Z;Z=Object.assign(Object.create(null),se.defaultConfig),Z.onready=ne}else Z=Object.assign(Object.create(null),se.defaultConfig,Z);const fe=Object.create(null),i=function(){},ye=Z.onerror||i,ve=Z.debug||i,ke=Z.generateMessageId?void 0:Object.create(null),Ne=Z.generateMessageId||function(ne){return ne.type+"#"+(ke[ne.type]=(ke[ne.type]||0)+1)},Oe=(...ne)=>{throw new Error(ne.join(" "))};Z.worker||(Z.worker=se.defaultConfig.worker),typeof Z.worker=="function"&&(Z.worker=Z.worker());let Pe,$e;return Z.worker.onmessage=function(ne){ne=ne.data,ve("worker1.onmessage",ne);let qe=fe[ne.messageId];if(!qe){if(ne&&ne.type==="sqlite3-api"&&ne.result==="worker1-ready"){Z.onready&&Z.onready($e);return}if(qe=fe[ne.type],qe&&qe.onrow){qe.onrow(ne);return}Z.onunhandled?Z.onunhandled(arguments[0]):ye("sqlite3Worker1Promiser() unhandled worker message:",ne);return}switch(delete fe[ne.messageId],ne.type){case"error":qe.reject(ne);return;case"open":Pe||(Pe=ne.dbId);break;case"close":ne.dbId===Pe&&(Pe=void 0);break}try{qe.resolve(ne)}catch(Le){qe.reject(Le)}},$e=function(){let ne;arguments.length===1?ne=arguments[0]:arguments.length===2?(ne=Object.create(null),ne.type=arguments[0],ne.args=arguments[1],ne.dbId=ne.args.dbId):Oe("Invalid arguments for sqlite3Worker1Promiser()-created factory."),!ne.dbId&&ne.type!=="open"&&(ne.dbId=Pe),ne.messageId=Ne(ne),ne.departureTime=performance.now();const qe=Object.create(null);qe.message=ne;let Le;ne.type==="exec"&&ne.args&&(typeof ne.args.callback=="function"?(Le=ne.messageId+":row",qe.onrow=ne.args.callback,ne.args.callback=Le,fe[Le]=qe):typeof ne.args.callback=="string"&&Oe("exec callback may not be a string when using the Promise interface."));let Me=new Promise(function(We,Ke){qe.resolve=We,qe.reject=Ke,fe[ne.messageId]=qe,ve("Posting",ne.type,"message to Worker dbId="+(Pe||"default")+":",ne),Z.worker.postMessage(ne)});return Le&&(Me=Me.finally(()=>delete fe[Le])),Me}};globalThis.sqlite3Worker1Promiser.defaultConfig={worker:function(){return new Worker(new URL(""+new URL("sqlite3-worker1-bundler-friendly-B2XAK-sM.js",import.meta.url).href,import.meta.url),{type:"module"})},onerror:(...se)=>console.error("worker1 promiser error",...se)};sqlite3Worker1Promiser.v2=(function(se){let Z;typeof se=="function"?(Z=se,se={}):typeof(se==null?void 0:se.onready)=="function"&&(Z=se.onready,delete se.onready);const fe=Object.create(null);se=Object.assign(se||Object.create(null),{onready:async function(ye){try{Z&&await Z(ye),fe.resolve(ye)}catch(ve){fe.reject(ve)}}});const i=new Promise(function(ye,ve){fe.resolve=ye,fe.reject=ve});try{this.original(se)}catch(ye){fe.reject(ye)}return i}).bind({original:sqlite3Worker1Promiser});sqlite3Worker1Promiser.v2;const ur=globalThis.sqlite3Worker1Promiser;export{jt as default,ur as sqlite3Worker1Promiser};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.