Files

3 lines
192 KiB
JavaScript
Raw Permalink Normal View History

2026-09-15 10:41:24 +03:00
var ot=(()=>{var Ie=import.meta.url;return function(qe={}){var be,i=qe,ve,Ee,$e=new Promise((e,t)=>{ve=e,Ee=t}),lt=typeof window=="object",Ue=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";const Tt=globalThis.sqlite3InitModuleState||Object.assign(Object.create(null),{debugModule:()=>{}});delete globalThis.sqlite3InitModuleState,Tt.debugModule("globalThis.location =",globalThis.location);var at=Object.assign({},i),ct="./this.program",ye="";function Ft(e){return i.locateFile?i.locateFile(e,ye):ye+e}var Ke,ze;(lt||Ue)&&(Ue?ye=self.location.href:typeof document<"u"&&document.currentScript&&(ye=document.currentScript.src),Ie&&(ye=Ie),ye.startsWith("blob:")?ye="":ye=ye.substr(0,ye.replace(/[?#].*/,"").lastIndexOf("/")+1),Ue&&(ze=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Ke=e=>fetch(e,{credentials:"same-origin"}).then(t=>t.ok?t.arrayBuffer():Promise.reject(new Error(t.status+" : "+t.url))));var Je=i.print||console.log.bind(console),ke=i.printErr||console.error.bind(console);Object.assign(i,at),at=null,i.arguments&&i.arguments,i.thisProgram&&(ct=i.thisProgram);var Qe=i.wasmBinary,Te,_t=!1,ge,Pe,Ne,ce,he,xe;function ut(){var e=Te.buffer;i.HEAP8=ge=new Int8Array(e),i.HEAP16=Ne=new Int16Array(e),i.HEAPU8=Pe=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAP32=ce=new Int32Array(e),i.HEAPU32=he=new Uint32Array(e),i.HEAPF32=new Float32Array(e),i.HEAPF64=new Float64Array(e),i.HEAP64=xe=new BigInt64Array(e),i.HEAPU64=new BigUint64Array(e)}if(i.wasmMemory)Te=i.wasmMemory;else{var Ot=i.INITIAL_MEMORY||16777216;Te=new WebAssembly.Memory({initial:Ot/65536,maximum:32768})}ut();var ft=[],dt=[],pt=[];function Pt(){var e=i.preRun;e&&(typeof e=="function"&&(e=[e]),e.forEach(Dt)),et(ft)}function Lt(){!i.noFSInit&&!a.initialized&&a.init(),a.ignorePermissions=!1,et(dt)}function Ct(){var e=i.postRun;e&&(typeof e=="function"&&(e=[e]),e.forEach(Nt)),et(pt)}function Dt(e){ft.unshift(e)}function Rt(e){dt.unshift(e)}function Nt(e){pt.unshift(e)}var Fe=0,Me=null;function Zn(e){return e}function Xe(e){Fe++,i.monitorRunDependencies?.(Fe)}function We(e){if(Fe--,i.monitorRunDependencies?.(Fe),Fe==0&&Me){var t=Me;Me=null,t()}}function Ye(e){i.onAbort?.(e),e="Aborted("+e+")",ke(e),_t=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw Ee(t),t}var Mt="data:application/octet-stream;base64,",ht=e=>e.startsWith(Mt);function jt(){if(i.locateFile){var e="sqlite3.wasm";return ht(e)?e:Ft(e)}return new URL("/assets/sqlite3-DBpDb1lf.wasm",import.meta.url).href}var Ze;function mt(e){if(e==Ze&&Qe)return new Uint8Array(Qe);if(ze)return ze(e);throw"both async and sync fetching of the wasm failed"}function Bt(e){return Qe?Promise.resolve().then(()=>mt(e)):Ke(e).then(t=>new Uint8Array(t),()=>mt(e))}function gt(e,t,n){return Bt(e).then(r=>WebAssembly.instantiate(r,t)).then(n,r=>{ke(`failed to asynchronously prepare wasm: ${r}`),Ye(r)})}function Ut(e,t,n,r){return!e&&typeof WebAssembly.instantiateStreaming=="function"&&!ht(t)&&typeof fetch=="function"?fetch(t,{credentials:"same-origin"}).then(s=>{var o=WebAssembly.instantiateStreaming(s,n);return o.then(r,function(p){return ke(`wasm streaming compile failed: ${p}`),ke("falling back to ArrayBuffer instantiation"),gt(t,n,r)})}):gt(t,n,r)}function zt(){return{env:xt,wasi_snapshot_preview1:xt}}function Qt(){var e=zt();function t(r,s){return h=r.exports,Rt(h.__wasm_call_ctors),We(),h}Xe();function n(r){t(r.instance)}if(i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(r){ke(`Module.instantiateWasm callback failed with error: ${r}`),Ee(r)}return Ze??=jt(),Ut(Qe,Ze,e,n).catch(Ee),{}}var et=e=>{e.forEach(t=>t(i))};i.noExitRuntime;var _e={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)return null;tt=yt(e)}return tt.shift()},Oe={ttys:[],init(){},shutdown(){},register(e,t){Oe.ttys[e]={input:[],output:[],ops:t},a.registerDevice(e,Oe.stream_ops)},stream_ops:{open(e){var t=Oe.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,p=0;p<r;p++){var g;try{g=e.tty.ops.get_char(e.tty)}catch{throw new a.ErrnoError(29)}if(g===void 0&&o===0)throw new a.ErrnoError(6);if(g==null)break;o++,t[n+p]=g}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 Ht()},put_char(e,t){t===null||t===10?(Je(Le(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(Je(Le(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?(ke(Le(e.output)),e.output=[]):t!=0&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(ke(Le(e.output)),e.output=[])}}},Vt=(e,t)=>{Pe.fill(0,e,e+t)},wt=(e,t)=>Math.ceil(e/t)*t,vt=e=>{e=wt(e,65536);var t=St(65536,e);return t&&Vt(t,e),t},ie={ops_table:null,mount(e){return ie.createNode(null,"/",16895,0)},createNode(e,t,n,r){if(a.isBlkdev(n)||a.isFIFO(n))throw new a.ErrnoError(63);ie.ops_table||={dir:{node:{getattr:ie.node_ops.getattr,setattr:ie.node_ops.setattr,lookup:ie.node_ops.lookup,mknod:ie.node_ops.mknod,rename:ie.node_ops.rename,unlink:ie.node_ops.unlink,rmdir:ie.node_ops.rmdir,readdir:ie.node_ops.readdir,symlink:ie.node_ops.symlink},stream:{llseek:ie.stream_ops.llseek}},file:{node:{getattr:ie.node_ops.getattr,setattr:ie.node_ops.setattr},stream:{llseek:ie.stream_ops.llseek,read:ie.stream_ops.read,write:ie.stream_ops.write,allocate:ie.stream_ops.allocate,mmap:ie.stream_ops.mmap,msync:ie.stream_ops.msync}},link:{node:{getattr:ie.node_ops.getattr,setattr:ie.node_ops.setattr,readlink:ie.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ie.node_ops.getattr,setattr:ie.node_ops.setattr},stream:a.chrdev_stream_ops}};var s=a.createNode(e,t,n,r);return a.isDir(s.mode)?(s.node_ops=ie.ops_table.dir.node,s.stream_ops=ie.ops_table.dir.stream,s.contents={}):a.isFile(s.mode)?(s.node_ops=ie.ops_table.file.node,s.stream_ops=ie.ops_table.file.stream,s.usedBytes=0,s.contents=null):a.isLink(s.mode)?(s.node_ops=ie.ops_table.link.node,s.stream_ops=ie.ops_table.link.stream):a.isChrdev(s.mode)&&(s.node_ops=ie.ops_table.chrdev.node,s.stream_ops=ie.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&&ie.resizeFileStorage(e,t.
Total of`,C,"op(s) for",M,"ms (incl. "+J+" ms of waiting on the async side)"),t.config.log("Serialization metrics:",I.s11n),m.postMessage({type:"opfs-async-metrics"})},reset:function(){let E;const C=J=>J.count=J.time=J.wait=0;for(E in u.opIds)C(I[E]=Object.create(null));let M=I.s11n=Object.create(null);M=M.serialize=Object.create(null),M.count=M.time=0,M=I.s11n.deserialize=Object.create(null),M.count=M.time=0}};const c=new S,d=new N().addOnDispose(()=>c.dispose());let y;const B=E=>(y=!0,d.dispose(),O(E)),f=()=>(y=!1,g(t)),m=new Worker(new URL("/assets/sqlite3-opfs-async-proxy-B_ImRJXp.js",import.meta.url));setTimeout(()=>{y===void 0&&B(new Error("Timeout while waiting for OPFS async proxy worker."))},4e3),m._originalOnError=m.onerror,m.onerror=function(E){A("Error initializing OPFS asyncer:",E),B(new Error("Loading OPFS async Worker failed for unknown reasons."))};const l=q.sqlite3_vfs_find(null),_=l?new N(l):null;c.$iVersion=1,d.$iVersion=2,d.$szOsFile=q.sqlite3_file.structInfo.sizeof,d.$mxPathname=1024,d.$zName=x.allocCString("opfs"),d.$xDlOpen=d.$xDlError=d.$xDlSym=d.$xDlClose=null,d.addOnDispose("$zName",d.$zName,"cleanup default VFS wrapper",()=>_?_.dispose():null);const u=Object.create(null);u.verbose=s.verbose,u.littleEndian=(()=>{const E=new ArrayBuffer(2);return new DataView(E).setInt16(0,256,!0),new Int16Array(E)[0]===256})(),u.asyncIdleWaitTime=150,u.asyncS11nExceptions=1,u.fileBufferSize=1024*64,u.sabS11nOffset=u.fileBufferSize,u.sabS11nSize=d.$mxPathname*2,u.sabIO=new SharedArrayBuffer(u.fileBufferSize+u.sabS11nSize),u.opIds=Object.create(null);const I=Object.create(null);{let E=0;u.opIds.whichOp=E++,u.opIds.rc=E++,u.opIds.xAccess=E++,u.opIds.xClose=E++,u.opIds.xDelete=E++,u.opIds.xDeleteNoWait=E++,u.opIds.xFileSize=E++,u.opIds.xLock=E++,u.opIds.xOpen=E++,u.opIds.xRead=E++,u.opIds.xSleep=E++,u.opIds.xSync=E++,u.opIds.xTruncate=E++,u.opIds.xUnlock=E++,u.opIds.xWrite=E++,u.opIds.mkdir=E++,u.opIds["opfs-async-metrics"]=E++,u.opIds["opfs-async-shutdown"]=E++,u.opIds.retry=E++,u.sabOP=new SharedArrayBuffer(E*4),L.metrics.reset()}u.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(E=>{(u.sq3Codes[E]=q[E])===void 0&&D("Maintenance required: not found:",E)}),u.opfsFlags=Object.assign(Object.create(null),{OPFS_UNLOCK_ASAP:1,OPFS_UNLINK_BEFORE_OPEN:2,defaultUnlockAsap:!1});const U=(E,...C)=>{const M=u.opIds[E]||D("Invalid op ID:",E);u.s11n.serialize(...C),Atomics.store(u.sabOPView,u.opIds.rc,-1),Atomics.store(u.sabOPView,u.opIds.whichOp,M),Atomics.notify(u.sabOPView,u.opIds.whichOp);const J=performance.now();for(;Atomics.wait(u.sabOPView,u.opIds.rc,-1)!=="not-equal";);const G=Atomics.load(u.sabOPView,u.opIds.rc);if(I[E].wait+=performance.now()-J,G&&u.asyncS11nExceptions){const te=u.s11n.deserialize();te&&A(E+"() async error:",...te)}return G};L.debug={asyncShutdown:()=>{T("Shutting down OPFS async listener. The OPFS VFS will no longer work."),U("opfs-async-shutdown")},asyncRestart:()=>{T("Attempting to restart OPFS VFS async listener. Might work, might not."),m.postMessage({type:"opfs-async-restart"})}};const ee=()=>{if(u.s11n)return u.s11n;const E=new TextDecoder,C=new TextEncoder("utf-8"),M=new Uint8Array(u.sabIO,u.sabS11nOffset,u.sabS11nSize),J=new DataView(u.sabIO,u.sabS11nOffset,u.sabS11nSize);u.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};con