primer commit
This commit is contained in:
76
node_modules/sql.js/.devcontainer/Dockerfile
generated
vendored
Normal file
76
node_modules/sql.js/.devcontainer/Dockerfile
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
# We build our DevContainer on MS' Typescript-Node Devcontainer
|
||||
# This gives us lots of standard stuff, and lets us layer a few custom things on top, like the Emscripten compiler
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# BEGIN Standard MS Devcontainer for Typescript-Node
|
||||
|
||||
# See here for image contents: https://github.com/devcontainers/images/tree/main/src/typescript-node
|
||||
# [Choice] Node.js version comes from the base devcontainer variant
|
||||
ARG VARIANT="24-bookworm"
|
||||
FROM mcr.microsoft.com/devcontainers/typescript-node:${VARIANT}
|
||||
|
||||
# [Optional] Uncomment if you want to install an additional version of node using nvm
|
||||
# ARG EXTRA_NODE_VERSION=10
|
||||
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
|
||||
|
||||
# [Optional] Uncomment if you want to install more global node packages
|
||||
# RUN su node -c "npm install -g <your-package-list -here>"
|
||||
|
||||
# END Standard MS Devcontainer for Typescript-Node
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# BEGIN EMSDK
|
||||
# Install EMSDK to /emsdk just like the EMSDK Dockerfile: https://github.com/emscripten-core/emsdk/blob/master/docker/Dockerfile
|
||||
ENV EMSDK /emsdk
|
||||
# We pin the EMSDK version rather than 'latest' so that everyone is using the same compiler version
|
||||
ENV EMSCRIPTEN_VERSION 5.0.0
|
||||
|
||||
RUN git clone https://github.com/emscripten-core/emsdk.git $EMSDK
|
||||
|
||||
RUN echo "## Install Emscripten" \
|
||||
&& cd ${EMSDK} \
|
||||
&& ./emsdk install ${EMSCRIPTEN_VERSION} \
|
||||
&& echo "## Done"
|
||||
|
||||
# Copied directly from https://github.com/emscripten-core/emsdk/blob/master/docker/Dockerfile
|
||||
RUN cd ${EMSDK} \
|
||||
&& echo "## Generate standard configuration" \
|
||||
&& ./emsdk activate ${EMSCRIPTEN_VERSION} \
|
||||
&& chmod 777 ${EMSDK}/upstream/emscripten \
|
||||
&& chmod -R 777 ${EMSDK}/upstream/emscripten/cache \
|
||||
&& echo "int main() { return 0; }" > hello.c \
|
||||
&& ${EMSDK}/upstream/emscripten/emcc -c hello.c \
|
||||
&& cat ${EMSDK}/upstream/emscripten/cache/sanity.txt \
|
||||
&& echo "## Done"
|
||||
|
||||
ENV PATH $EMSDK:$EMSDK/upstream/emscripten/:$PATH
|
||||
|
||||
# Cleanup Emscripten installation and strip some symbols
|
||||
# Copied directly from https://github.com/emscripten-core/emsdk/blob/master/docker/Dockerfile
|
||||
RUN echo "## Aggressive optimization: Remove debug symbols" \
|
||||
&& cd ${EMSDK} && . ./emsdk_env.sh \
|
||||
# Remove debugging symbols from embedded node (extra 7MB)
|
||||
&& strip -s `which node` \
|
||||
# Tests consume ~80MB disc space
|
||||
&& rm -fr ${EMSDK}/upstream/emscripten/tests \
|
||||
# Fastcomp is not supported
|
||||
&& rm -fr ${EMSDK}/upstream/fastcomp \
|
||||
# strip out symbols from clang (~extra 50MB disc space)
|
||||
&& find ${EMSDK}/upstream/bin -type f -exec strip -s {} + || true \
|
||||
&& echo "## Done"
|
||||
|
||||
RUN echo ". /emsdk/emsdk_env.sh" >> /etc/bash.bashrc
|
||||
# We must set the EM_NODE_JS environment variable for a somewhat silly reason
|
||||
# We run our build scripts with `npm run`, which sets the NODE environment variable as it runs.
|
||||
# The EMSDK picks up on that environment variable and gives a deprecation warning: warning: honoring legacy environment variable `NODE`. Please switch to using `EM_NODE_JS` instead`
|
||||
# So, we are going to put this environment variable here explicitly to avoid the deprecation warning.
|
||||
RUN echo 'export EM_NODE_JS="$EMSDK_NODE"' >> /etc/bash.bashrc
|
||||
|
||||
# END EMSDK
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
# Install wget, gnupg, and sha3sum
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y wget gnupg libdigest-sha3-perl default-jre-headless \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
20
node_modules/sql.js/.devcontainer/devcontainer.json
generated
vendored
Normal file
20
node_modules/sql.js/.devcontainer/devcontainer.json
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.155.1/containers/typescript-node
|
||||
{
|
||||
"name": "Node.js & TypeScript",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
// Update 'VARIANT' to pick a Node version
|
||||
"args": {
|
||||
"VARIANT": "24-bookworm"
|
||||
}
|
||||
},
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// We use `npm ci` instead of `npm install` because we want to respect the lockfile and ONLY the lockfile.
|
||||
// That way, our devcontainer is more reproducible. --Taytay
|
||||
"postCreateCommand": "npm ci",
|
||||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "node"
|
||||
}
|
||||
68
node_modules/sql.js/.eslintrc.js
generated
vendored
Normal file
68
node_modules/sql.js/.eslintrc.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
env: {
|
||||
browser: true,
|
||||
es6: true,
|
||||
node: true
|
||||
},
|
||||
extends: [
|
||||
"airbnb-base"
|
||||
],
|
||||
globals: {
|
||||
Atomics: "readonly",
|
||||
SharedArrayBuffer: "readonly"
|
||||
},
|
||||
ignorePatterns: [
|
||||
"/dist/",
|
||||
"/examples/",
|
||||
"/documentation/",
|
||||
"/node_modules/",
|
||||
"/out/",
|
||||
"/src/shell-post.js",
|
||||
"/src/shell-pre.js",
|
||||
"/test/",
|
||||
"!/.eslintrc.js"
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 5,
|
||||
sourceType: "script"
|
||||
},
|
||||
rules: {
|
||||
// reason - sqlite exposes functions with underscore-naming-convention
|
||||
camelcase: "off",
|
||||
// reason - They make it easier to add new elements to arrays
|
||||
// and parameters to functions, and make commit diffs clearer
|
||||
"comma-dangle": "off",
|
||||
// reason - string-notation needed to prevent closure-minifier
|
||||
// from mangling property-name
|
||||
"dot-notation": "off",
|
||||
// reason - enforce 4-space indent
|
||||
indent: ["error", 4, { SwitchCase: 1 }],
|
||||
// reason - enforce 80-column-width limit
|
||||
"max-len": ["error", { code: 80 }],
|
||||
// reason - src/api.js uses bitwise-operators
|
||||
"no-bitwise": "off",
|
||||
"no-cond-assign": ["error", "except-parens"],
|
||||
"no-param-reassign": "off",
|
||||
"no-throw-literal": "off",
|
||||
// reason - parserOptions is set to es5 language-syntax
|
||||
"no-var": "off",
|
||||
// reason - parserOptions is set to es5 language-syntax
|
||||
"object-shorthand": "off",
|
||||
// reason - parserOptions is set to es5 language-syntax
|
||||
"prefer-arrow-callback": "off",
|
||||
// reason - parserOptions is set to es5 language-syntax
|
||||
"prefer-destructuring": "off",
|
||||
// reason - parserOptions is set to es5 language-syntax
|
||||
"prefer-spread": "off",
|
||||
// reason - parserOptions is set to es5 language-syntax
|
||||
"prefer-template": "off",
|
||||
// reason - sql.js frequently use sql-query-strings containing
|
||||
// single-quotes
|
||||
quotes: ["error", "double"],
|
||||
// reason - allow top-level "use-strict" in commonjs-modules
|
||||
strict: ["error", "safe"],
|
||||
"vars-on-top": "off"
|
||||
}
|
||||
};
|
||||
38
node_modules/sql.js/.jsdoc.config.json
generated
vendored
Normal file
38
node_modules/sql.js/.jsdoc.config.json
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"plugins": [
|
||||
"plugins/markdown"
|
||||
],
|
||||
"source": {
|
||||
"include": [
|
||||
"src/api.js"
|
||||
]
|
||||
},
|
||||
"opts": {
|
||||
"encoding": "utf8",
|
||||
"destination": "./documentation/",
|
||||
"readme": "documentation_index.md",
|
||||
"template": "./node_modules/clean-jsdoc-theme",
|
||||
"theme_opts": {
|
||||
"title": "sql.js",
|
||||
"meta": [
|
||||
"<title>sql.js API documentation</title>",
|
||||
"<meta name=\"author\" content=\"Ophir Lojkine\">",
|
||||
"<meta name=\"description\" content=\"Documentation for sql.js: an in-memory SQL database for the browser based on SQLite.\">"
|
||||
],
|
||||
"menu": [
|
||||
{
|
||||
"title": "Website",
|
||||
"link": "https://sql.js.org/"
|
||||
},
|
||||
{
|
||||
"title": "Github",
|
||||
"link": "https://github.com/sql-js/sql.js"
|
||||
},
|
||||
{
|
||||
"title": "Demo",
|
||||
"link": "https://sql.js.org/examples/GUI/"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
0
node_modules/sql.js/.nojekyll
generated
vendored
Normal file
0
node_modules/sql.js/.nojekyll
generated
vendored
Normal file
8
node_modules/sql.js/AUTHORS
generated
vendored
Normal file
8
node_modules/sql.js/AUTHORS
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
Ophir LOJKINE <pere.jobs@gmail.com> (https://github.com/lovasoa)
|
||||
@kripken
|
||||
@hankinsoft
|
||||
@firien
|
||||
@dinedal
|
||||
@taytay
|
||||
@kaizhu256
|
||||
@brodybits
|
||||
66
node_modules/sql.js/CONTRIBUTING.md
generated
vendored
Normal file
66
node_modules/sql.js/CONTRIBUTING.md
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
|
||||
# Compiling and Contributing
|
||||
|
||||
General consumers of this library don't need to read any further. (The compiled files are available via the [release page](https://github.com/sql-js/sql.js/releases).)
|
||||
|
||||
If you want to compile your own version of SQLite for WebAssembly, or want to contribute to this project, read on.
|
||||
|
||||
## Setting up your Development Environment
|
||||
|
||||
### Containerized Development Environment (Recommended)
|
||||
|
||||
This project defines a standardized development environment using Docker (and the .devcontainer spec in particular). This allows for anyone on any platform to get up and running quickly. (VSCode is not technically required to make use of this standardized environment, but it makes containerized development so seamless that the non-VSCode path is not currently documented here.)
|
||||
|
||||
Standardizing our development environment has numerous benefits:
|
||||
- Allows anyone on ANY platform (Linux, Mac, and Windows) to contribute or compile their own build.
|
||||
- It's quicker and easier for any contributor to dive in and fix issues.
|
||||
- (Practically) eliminates configuration bugs that are difficult for maintainers to reproduce. Also known as "works on my machine" issues.
|
||||
- Allows us to write our scripts assuming that they're _always_ running in a single known environment of a single, known platform.
|
||||
- Ensure that all contributors use a known, standardized installation of EMSDK.
|
||||
- Allows for a more clearly documented process for updating the EMSDK to a new version.
|
||||
- End-Users that simply want to compile and install their own version of SQLite don't have to bother with EMSDK installation in their particular environment.
|
||||
|
||||
To get started:
|
||||
|
||||
1. Follow the [Installation Steps for Containerized Development in VSCode](https://code.visualstudio.com/docs/remote/containers#_installation). This includes installing Docker, VSCode, and the [Remote Development extension pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) for VSCode)
|
||||
2. Clone this repository
|
||||
3. Open the repository folder in VSCode. It will detect the presence of a .devcontainer and prompt you: "Folder contains a Dev Container configuration file. Reopen folder to develop in a container." Click "Reopen in container"
|
||||
|
||||
You're now ready to test the dev environment:
|
||||
|
||||
4. Click on Terminal->New Terminal to be dropped into a terminal inside the dev environment.
|
||||
5. Run `$ npm install` to install the required modules
|
||||
6. Run `$ npm test` to ensure all tests pass
|
||||
7. Run `$ npm run rebuild` to re-compile the project from scratch (using the version of EMSDK installed in the container).
|
||||
8. Run `$ npm test` to ensure all tests pass after said rebuild
|
||||
|
||||
You're now ready for development!
|
||||
|
||||
### Host-based configuration (Not recommended)
|
||||
|
||||
If you're on a Mac or Linux-based host machine, you can install and use the EMSDK directly to perform a build.
|
||||
Note that if you run into bugs with this configuration, we highly encourage you to use the containerized development environment instead, as detailed above.
|
||||
|
||||
Instructions:
|
||||
|
||||
1. [Install the EMSDK](https://emscripten.org/docs/getting_started/downloads.html)
|
||||
2. Clone this repository
|
||||
3. Run `$ npm install` to install the required modules
|
||||
4. Run `$ npm test` to ensure all tests pass
|
||||
5. Run `$ npm run rebuild` to re-compile the project from scratch (using the version of EMSDK installed in the container).
|
||||
6. Run `$ npm test` to ensure all tests pass after said rebuild
|
||||
|
||||
## Compiling SQLite with different options
|
||||
|
||||
In order to enable extensions like FTS5, change the CFLAGS in the [Makefile](Makefile) and run `npm run rebuild`:
|
||||
|
||||
``` diff
|
||||
CFLAGS = \
|
||||
-O2 \
|
||||
-DSQLITE_OMIT_LOAD_EXTENSION \
|
||||
-DSQLITE_DISABLE_LFS \
|
||||
-DSQLITE_ENABLE_FTS3 \
|
||||
-DSQLITE_ENABLE_FTS3_PARENTHESIS \
|
||||
+ -DSQLITE_ENABLE_FTS5 \
|
||||
-DSQLITE_THREADSAFE=0
|
||||
```
|
||||
44
node_modules/sql.js/LICENSE
generated
vendored
Normal file
44
node_modules/sql.js/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
MIT license
|
||||
===========
|
||||
|
||||
Copyright (c) 2017 sql.js authors (see AUTHORS)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
|
||||
# Some portions of the Makefile taken from:
|
||||
Copyright 2017 Ryusei Yamaguchi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
357
node_modules/sql.js/README.md
generated
vendored
Normal file
357
node_modules/sql.js/README.md
generated
vendored
Normal file
@@ -0,0 +1,357 @@
|
||||
<img src="https://user-images.githubusercontent.com/552629/76405509-87025300-6388-11ea-86c9-af882abb00bd.png" width="40" height="40" />
|
||||
|
||||
# SQLite compiled to JavaScript
|
||||
|
||||
[](https://github.com/sql-js/sql.js/actions)
|
||||
[](https://www.npmjs.com/package/sql.js)
|
||||
[](https://cdnjs.com/libraries/sql.js)
|
||||
|
||||
*sql.js* is a javascript SQL database. It allows you to create a relational database and query it entirely in the browser. You can try it in [this online demo](https://sql.js.org/examples/GUI/). It uses a [virtual database file stored in memory](https://emscripten.org/docs/porting/files/file_systems_overview.html), and thus **doesn't persist the changes** made to the database. However, it allows you to **import** any existing sqlite file, and to **export** the created database as a [JavaScript typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays).
|
||||
|
||||
*sql.js* uses [emscripten](https://emscripten.org/docs/introducing_emscripten/about_emscripten.html) to compile [SQLite](http://sqlite.org/about.html) to webassembly (or to javascript code for compatibility with older browsers). It includes [contributed math and string extension functions](https://www.sqlite.org/contrib?orderby=date).
|
||||
|
||||
sql.js can be used like any traditional JavaScript library. If you are building a native application in JavaScript (using Electron for instance), or are working in node.js, you will likely prefer to use [a native binding of SQLite to JavaScript](https://www.npmjs.com/package/sqlite3). A native binding will not only be faster because it will run native code, but it will also be able to work on database files directly instead of having to load the entire database in memory, avoiding out of memory errors and further improving performances.
|
||||
|
||||
SQLite is public domain, sql.js is MIT licensed.
|
||||
|
||||
## API documentation
|
||||
A [full API documentation](https://sql.js.org/documentation/) for all the available classes and methods is available.
|
||||
It is generated from comments inside the source code, and is thus always up to date.
|
||||
|
||||
## Usage
|
||||
|
||||
By default, *sql.js* uses [wasm](https://developer.mozilla.org/en-US/docs/WebAssembly), and thus needs to load a `.wasm` file in addition to the javascript library. You can find this file in `./node_modules/sql.js/dist/sql-wasm.wasm` after installing sql.js from npm, and instruct your bundler to add it to your static assets or load it from [a CDN](https://cdnjs.com/libraries/sql.js). Then use the [`locateFile`](https://emscripten.org/docs/api_reference/module.html#Module.locateFile) property of the configuration object passed to `initSqlJs` to indicate where the file is. If you use an asset builder such as webpack, you can automate this. See [this demo of how to integrate sql.js with webpack (and react)](https://github.com/sql-js/react-sqljs-demo).
|
||||
|
||||
```javascript
|
||||
const initSqlJs = require('sql.js');
|
||||
// or if you are in a browser:
|
||||
// const initSqlJs = window.initSqlJs;
|
||||
|
||||
const SQL = await initSqlJs({
|
||||
// Required to load the wasm binary asynchronously. Of course, you can host it wherever you want
|
||||
// You can omit locateFile completely when running in node
|
||||
locateFile: file => `https://sql.js.org/dist/${file}`
|
||||
});
|
||||
|
||||
// Create a database
|
||||
const db = new SQL.Database();
|
||||
// NOTE: You can also use new SQL.Database(data) where
|
||||
// data is an Uint8Array representing an SQLite database file
|
||||
|
||||
|
||||
// Execute a single SQL string that contains multiple statements
|
||||
let sqlstr = "CREATE TABLE hello (a int, b char); \
|
||||
INSERT INTO hello VALUES (0, 'hello'); \
|
||||
INSERT INTO hello VALUES (1, 'world');";
|
||||
db.run(sqlstr); // Run the query without returning anything
|
||||
|
||||
// Prepare an sql statement
|
||||
const stmt = db.prepare("SELECT * FROM hello WHERE a=:aval AND b=:bval");
|
||||
|
||||
// Bind values to the parameters and fetch the results of the query
|
||||
const result = stmt.getAsObject({':aval' : 1, ':bval' : 'world'});
|
||||
console.log(result); // Will print {a:1, b:'world'}
|
||||
|
||||
// Bind other values
|
||||
stmt.bind([0, 'hello']);
|
||||
while (stmt.step()) console.log(stmt.get()); // Will print [0, 'hello']
|
||||
// free the memory used by the statement
|
||||
stmt.free();
|
||||
// You can not use your statement anymore once it has been freed.
|
||||
// But not freeing your statements causes memory leaks. You don't want that.
|
||||
|
||||
const res = db.exec("SELECT * FROM hello");
|
||||
/*
|
||||
[
|
||||
{columns:['a','b'], values:[[0,'hello'],[1,'world']]}
|
||||
]
|
||||
*/
|
||||
|
||||
// You can also use JavaScript functions inside your SQL code
|
||||
// Create the js function you need
|
||||
function add(a, b) {return a+b;}
|
||||
// Specifies the SQL function's name, the number of it's arguments, and the js function to use
|
||||
db.create_function("add_js", add);
|
||||
// Run a query in which the function is used
|
||||
db.run("INSERT INTO hello VALUES (add_js(7, 3), add_js('Hello ', 'world'));"); // Inserts 10 and 'Hello world'
|
||||
|
||||
// You can create custom aggregation functions, by passing a name
|
||||
// and a set of functions to `db.create_aggregate`:
|
||||
//
|
||||
// - an `init` function. This function receives no argument and returns
|
||||
// the initial value for the state of the aggregate function.
|
||||
// - a `step` function. This function takes two arguments
|
||||
// - the current state of the aggregation
|
||||
// - a new value to aggregate to the state
|
||||
// It should return a new value for the state.
|
||||
// - a `finalize` function. This function receives a state object, and
|
||||
// returns the final value of the aggregate. It can be omitted, in which case
|
||||
// the final value of the state will be returned directly by the aggregate function.
|
||||
//
|
||||
// Here is an example aggregation function, `json_agg`, which will collect all
|
||||
// input values and return them as a JSON array:
|
||||
db.create_aggregate(
|
||||
"json_agg",
|
||||
{
|
||||
init: () => [],
|
||||
step: (state, val) => [...state, val],
|
||||
finalize: (state) => JSON.stringify(state),
|
||||
}
|
||||
);
|
||||
|
||||
db.exec("SELECT json_agg(column1) FROM (VALUES ('hello'), ('world'))");
|
||||
// -> The result of the query is the string '["hello","world"]'
|
||||
|
||||
// Export the database to an Uint8Array containing the SQLite database file
|
||||
const binaryArray = db.export();
|
||||
```
|
||||
|
||||
## Demo
|
||||
There are a few examples [available here](https://sql-js.github.io/sql.js/index.html). The most full-featured is the [Sqlite Interpreter](https://sql-js.github.io/sql.js/examples/GUI/index.html).
|
||||
|
||||
## Examples
|
||||
The test files provide up to date example of the use of the api.
|
||||
### Inside the browser
|
||||
#### Example **HTML** file:
|
||||
```html
|
||||
<meta charset="utf8" />
|
||||
<html>
|
||||
<script src='/dist/sql-wasm.js'></script>
|
||||
<script>
|
||||
config = {
|
||||
locateFile: filename => `/dist/${filename}`
|
||||
}
|
||||
// The `initSqlJs` function is globally provided by all of the main dist files if loaded in the browser.
|
||||
// We must specify this locateFile function if we are loading a wasm file from anywhere other than the current html page's folder.
|
||||
initSqlJs(config).then(function(SQL){
|
||||
//Create the database
|
||||
const db = new SQL.Database();
|
||||
// Run a query without reading the results
|
||||
db.run("CREATE TABLE test (col1, col2);");
|
||||
// Insert two rows: (1,111) and (2,222)
|
||||
db.run("INSERT INTO test VALUES (?,?), (?,?)", [1,111,2,222]);
|
||||
|
||||
// Prepare a statement
|
||||
const stmt = db.prepare("SELECT * FROM test WHERE col1 BETWEEN $start AND $end");
|
||||
stmt.getAsObject({$start:1, $end:1}); // {col1:1, col2:111}
|
||||
|
||||
// Bind new values
|
||||
stmt.bind({$start:1, $end:2});
|
||||
while(stmt.step()) { //
|
||||
const row = stmt.getAsObject();
|
||||
console.log('Here is a row: ' + JSON.stringify(row));
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<body>
|
||||
Output is in Javascript console
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
#### Creating a database from a file chosen by the user
|
||||
`SQL.Database` constructor takes an array of integer representing a database file as an optional parameter.
|
||||
The following code uses an HTML input as the source for loading a database:
|
||||
```javascript
|
||||
dbFileElm.onchange = () => {
|
||||
const f = dbFileElm.files[0];
|
||||
const r = new FileReader();
|
||||
r.onload = function() {
|
||||
const Uints = new Uint8Array(r.result);
|
||||
db = new SQL.Database(Uints);
|
||||
}
|
||||
r.readAsArrayBuffer(f);
|
||||
}
|
||||
```
|
||||
See : https://sql-js.github.io/sql.js/examples/GUI/gui.js
|
||||
|
||||
#### Loading a database from a server
|
||||
|
||||
##### using fetch
|
||||
|
||||
```javascript
|
||||
const sqlPromise = initSqlJs({
|
||||
locateFile: file => `https://path/to/your/dist/folder/dist/${file}`
|
||||
});
|
||||
const dataPromise = fetch("/path/to/database.sqlite").then(res => res.arrayBuffer());
|
||||
const [SQL, buf] = await Promise.all([sqlPromise, dataPromise])
|
||||
const db = new SQL.Database(new Uint8Array(buf));
|
||||
```
|
||||
|
||||
##### using XMLHttpRequest
|
||||
|
||||
```javascript
|
||||
const xhr = new XMLHttpRequest();
|
||||
// For example: https://github.com/lerocha/chinook-database/raw/master/ChinookDatabase/DataSources/Chinook_Sqlite.sqlite
|
||||
xhr.open('GET', '/path/to/database.sqlite', true);
|
||||
xhr.responseType = 'arraybuffer';
|
||||
|
||||
xhr.onload = e => {
|
||||
const uInt8Array = new Uint8Array(xhr.response);
|
||||
const db = new SQL.Database(uInt8Array);
|
||||
const contents = db.exec("SELECT * FROM my_table");
|
||||
// contents is now [{columns:['col1','col2',...], values:[[first row], [second row], ...]}]
|
||||
};
|
||||
xhr.send();
|
||||
```
|
||||
See: https://github.com/sql-js/sql.js/wiki/Load-a-database-from-the-server
|
||||
|
||||
|
||||
### Use from node.js
|
||||
|
||||
`sql.js` is [hosted on npm](https://www.npmjs.org/package/sql.js). To install it, you can simply run `npm install sql.js`.
|
||||
Alternatively, you can simply download `sql-wasm.js` and `sql-wasm.wasm`, from the download link below.
|
||||
|
||||
#### read a database from the disk:
|
||||
```javascript
|
||||
const fs = require('fs');
|
||||
const initSqlJs = require('sql-wasm.js');
|
||||
const filebuffer = fs.readFileSync('test.sqlite');
|
||||
|
||||
initSqlJs().then(function(SQL){
|
||||
// Load the db
|
||||
const db = new SQL.Database(filebuffer);
|
||||
});
|
||||
|
||||
```
|
||||
|
||||
#### write a database to the disk
|
||||
You need to convert the result of `db.export` to a buffer
|
||||
```javascript
|
||||
const fs = require("fs");
|
||||
// [...] (create the database)
|
||||
const data = db.export();
|
||||
const buffer = Buffer.from(data);
|
||||
fs.writeFileSync("filename.sqlite", buffer);
|
||||
```
|
||||
|
||||
See : https://github.com/sql-js/sql.js/blob/master/test/test_node_file.js
|
||||
|
||||
### Use as web worker
|
||||
If you don't want to run CPU-intensive SQL queries in your main application thread,
|
||||
you can use the *more limited* WebWorker API.
|
||||
|
||||
You will need to download `worker.sql-wasm.js` and `worker.sql-wasm.wasm` from the [release page](https://github.com/sql-js/sql.js/releases).
|
||||
|
||||
Example:
|
||||
```html
|
||||
<script>
|
||||
const worker = new Worker("/dist/worker.sql-wasm.js");
|
||||
worker.onmessage = () => {
|
||||
console.log("Database opened");
|
||||
worker.onmessage = event => {
|
||||
console.log(event.data); // The result of the query
|
||||
};
|
||||
|
||||
worker.postMessage({
|
||||
id: 2,
|
||||
action: "exec",
|
||||
sql: "SELECT age,name FROM test WHERE id=$id",
|
||||
params: { "$id": 1 }
|
||||
});
|
||||
};
|
||||
|
||||
worker.onerror = e => console.log("Worker error: ", e);
|
||||
worker.postMessage({
|
||||
id:1,
|
||||
action:"open",
|
||||
buffer:buf, /*Optional. An ArrayBuffer representing an SQLite Database file*/
|
||||
});
|
||||
</script>
|
||||
```
|
||||
### Enabling BigInt support
|
||||
If you need ```BigInt``` support, it is partially supported since most browsers now supports it including Safari.Binding ```BigInt``` is still not supported, only getting ```BigInt``` from the database is supported for now.
|
||||
|
||||
```html
|
||||
<script>
|
||||
const stmt = db.prepare("SELECT * FROM test");
|
||||
const config = {useBigInt: true};
|
||||
/*Pass optional config param to the get function*/
|
||||
while (stmt.step()) console.log(stmt.get(null, config));
|
||||
|
||||
/*OR*/
|
||||
const results = db.exec("SELECT * FROM test", config);
|
||||
console.log(results[0].values)
|
||||
</script>
|
||||
```
|
||||
On WebWorker, you can just add ```config``` param before posting a message. With this, you wont have to pass config param on ```get``` function.
|
||||
|
||||
```html
|
||||
<script>
|
||||
worker.postMessage({
|
||||
id:1,
|
||||
action:"exec",
|
||||
sql: "SELECT * FROM test",
|
||||
config: {useBigInt: true}, /*Optional param*/
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
See [examples/GUI/gui.js](examples/GUI/gui.js) for a full working example.
|
||||
|
||||
## Flavors/versions Targets/Downloads
|
||||
|
||||
This library includes both WebAssembly and asm.js versions of Sqlite. (WebAssembly is the newer, preferred way to compile to JavaScript, and has superceded asm.js. It produces smaller, faster code.) Asm.js versions are included for compatibility.
|
||||
|
||||
## Upgrading from 0.x to 1.x
|
||||
|
||||
Version 1.0 of sql.js must be loaded asynchronously, whereas asm.js was able to be loaded synchronously.
|
||||
|
||||
So in the past, you would:
|
||||
```html
|
||||
<script src='js/sql.js'></script>
|
||||
<script>
|
||||
const db = new SQL.Database();
|
||||
//...
|
||||
</script>
|
||||
```
|
||||
or:
|
||||
```javascript
|
||||
const SQL = require('sql.js');
|
||||
const db = new SQL.Database();
|
||||
//...
|
||||
```
|
||||
|
||||
Version 1.x:
|
||||
```html
|
||||
<script src='dist/sql-wasm.js'></script>
|
||||
<script>
|
||||
initSqlJs({ locateFile: filename => `/dist/${filename}` }).then(function(SQL){
|
||||
const db = new SQL.Database();
|
||||
//...
|
||||
});
|
||||
</script>
|
||||
```
|
||||
or:
|
||||
```javascript
|
||||
const initSqlJs = require('sql-wasm.js');
|
||||
initSqlJs().then(function(SQL){
|
||||
const db = new SQL.Database();
|
||||
//...
|
||||
});
|
||||
```
|
||||
|
||||
`NOTHING` is now a reserved word in SQLite, whereas previously it was not. This could cause errors like `Error: near "nothing": syntax error`
|
||||
|
||||
### Downloading/Using: ###
|
||||
Although asm.js files were distributed as a single Javascript file, WebAssembly libraries are most efficiently distributed as a pair of files, the `.js` loader and the `.wasm` file, like `sql-wasm.js` and `sql-wasm.wasm`. The `.js` file is responsible for loading the `.wasm` file. You can find these files on our [release page](https://github.com/sql-js/sql.js/releases)
|
||||
|
||||
|
||||
|
||||
|
||||
## Versions of sql.js included in the distributed artifacts
|
||||
You can always find the latest published artifacts on https://github.com/sql-js/sql.js/releases/latest.
|
||||
|
||||
For each [release](https://github.com/sql-js/sql.js/releases/), you will find a file called `sqljs.zip` in the *release assets*. It will contain:
|
||||
- `sql-wasm.js` : The Web Assembly version of Sql.js. Minified and suitable for production. Use this. If you use this, you will need to include/ship `sql-wasm.wasm` as well.
|
||||
- `sql-wasm-debug.js` : The Web Assembly, Debug version of Sql.js. Larger, with assertions turned on. Useful for local development. You will need to include/ship `sql-wasm-debug.wasm` if you use this.
|
||||
- `sql-asm.js` : The older asm.js version of Sql.js. Slower and larger. Provided for compatibility reasons.
|
||||
- `sql-asm-memory-growth.js` : Asm.js doesn't allow for memory to grow by default, because it is slower and de-optimizes. If you are using sql-asm.js and you see this error (`Cannot enlarge memory arrays`), use this file.
|
||||
- `sql-asm-debug.js` : The _Debug_ asm.js version of Sql.js. Use this for local development.
|
||||
- `worker.*` - Web Worker versions of the above libraries. More limited API. See [examples/GUI/gui.js](examples/GUI/gui.js) for a good example of this.
|
||||
|
||||
## Compiling/Contributing
|
||||
|
||||
General consumers of this library don't need to read any further. (The compiled files are available via the [release page](https://github.com/sql-js/sql.js/releases).)
|
||||
|
||||
If you want to compile your own version of SQLite for WebAssembly, or want to contribute to this project, see [CONTRIBUTING.md](CONTRIBUTING.md).
|
||||
140890
node_modules/sql.js/dist/sql-asm-debug.js
generated
vendored
Normal file
140890
node_modules/sql.js/dist/sql-asm-debug.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
204
node_modules/sql.js/dist/sql-asm-memory-growth.js
generated
vendored
Normal file
204
node_modules/sql.js/dist/sql-asm-memory-growth.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
202
node_modules/sql.js/dist/sql-asm.js
generated
vendored
Normal file
202
node_modules/sql.js/dist/sql-asm.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7157
node_modules/sql.js/dist/sql-wasm-browser-debug.js
generated
vendored
Normal file
7157
node_modules/sql.js/dist/sql-wasm-browser-debug.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
node_modules/sql.js/dist/sql-wasm-browser-debug.wasm
generated
vendored
Executable file
BIN
node_modules/sql.js/dist/sql-wasm-browser-debug.wasm
generated
vendored
Executable file
Binary file not shown.
183
node_modules/sql.js/dist/sql-wasm-browser.js
generated
vendored
Normal file
183
node_modules/sql.js/dist/sql-wasm-browser.js
generated
vendored
Normal file
@@ -0,0 +1,183 @@
|
||||
|
||||
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
||||
// https://github.com/kripken/emscripten/issues/5820
|
||||
// In addition, When you use emcc's modularization, it still expects to export a global object called `Module`,
|
||||
// which is able to be used/called before the WASM is loaded.
|
||||
// The modularization below exports a promise that loads and resolves to the actual sql.js module.
|
||||
// That way, this module can't be used before the WASM is finished loading.
|
||||
|
||||
// We are going to define a function that a user will call to start loading initializing our Sql.js library
|
||||
// However, that function might be called multiple times, and on subsequent calls, we don't actually want it to instantiate a new instance of the Module
|
||||
// Instead, we want to return the previously loaded module
|
||||
|
||||
// TODO: Make this not declare a global if used in the browser
|
||||
var initSqlJsPromise = undefined;
|
||||
|
||||
var initSqlJs = function (moduleConfig) {
|
||||
|
||||
if (initSqlJsPromise){
|
||||
return initSqlJsPromise;
|
||||
}
|
||||
// If we're here, we've never called this function before
|
||||
initSqlJsPromise = new Promise(function (resolveModule, reject) {
|
||||
|
||||
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
||||
// https://github.com/kripken/emscripten/issues/5820
|
||||
|
||||
// The way to affect the loading of emcc compiled modules is to create a variable called `Module` and add
|
||||
// properties to it, like `preRun`, `postRun`, etc
|
||||
// We are using that to get notified when the WASM has finished loading.
|
||||
// Only then will we return our promise
|
||||
|
||||
// If they passed in a moduleConfig object, use that
|
||||
// Otherwise, initialize Module to the empty object
|
||||
var Module = typeof moduleConfig !== 'undefined' ? moduleConfig : {};
|
||||
|
||||
// EMCC only allows for a single onAbort function (not an array of functions)
|
||||
// So if the user defined their own onAbort function, we remember it and call it
|
||||
var originalOnAbortFunction = Module['onAbort'];
|
||||
Module['onAbort'] = function (errorThatCausedAbort) {
|
||||
reject(new Error(errorThatCausedAbort));
|
||||
if (originalOnAbortFunction){
|
||||
originalOnAbortFunction(errorThatCausedAbort);
|
||||
}
|
||||
};
|
||||
|
||||
Module['postRun'] = Module['postRun'] || [];
|
||||
Module['postRun'].push(function () {
|
||||
// When Emscripted calls postRun, this promise resolves with the built Module
|
||||
resolveModule(Module);
|
||||
});
|
||||
|
||||
// There is a section of code in the emcc-generated code below that looks like this:
|
||||
// (Note that this is lowercase `module`)
|
||||
// if (typeof module !== 'undefined') {
|
||||
// module['exports'] = Module;
|
||||
// }
|
||||
// When that runs, it's going to overwrite our own modularization export efforts in shell-post.js!
|
||||
// The only way to tell emcc not to emit it is to pass the MODULARIZE=1 or MODULARIZE_INSTANCE=1 flags,
|
||||
// but that carries with it additional unnecessary baggage/bugs we don't want either.
|
||||
// So, we have three options:
|
||||
// 1) We undefine `module`
|
||||
// 2) We remember what `module['exports']` was at the beginning of this function and we restore it later
|
||||
// 3) We write a script to remove those lines of code as part of the Make process.
|
||||
//
|
||||
// Since those are the only lines of code that care about module, we will undefine it. It's the most straightforward
|
||||
// of the options, and has the side effect of reducing emcc's efforts to modify the module if its output were to change in the future.
|
||||
// That's a nice side effect since we're handling the modularization efforts ourselves
|
||||
module = undefined;
|
||||
|
||||
// The emcc-generated code and shell-post.js code goes below,
|
||||
// meaning that all of it runs inside of this promise. If anything throws an exception, our promise will abort
|
||||
var k;k||=typeof Module != 'undefined' ? Module : {};var aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope;
|
||||
k.onRuntimeInitialized=function(){function a(f,l){switch(typeof l){case "boolean":$b(f,l?1:0);break;case "number":ac(f,l);break;case "string":bc(f,l,-1,-1);break;case "object":if(null===l)eb(f);else if(null!=l.length){var n=ca(l.length);m.set(l,n);cc(f,n,l.length,-1);da(n)}else ra(f,"Wrong API use : tried to return a value of an unknown type ("+l+").",-1);break;default:eb(f)}}function b(f,l){for(var n=[],p=0;p<f;p+=1){var u=r(l+4*p,"i32"),v=dc(u);if(1===v||2===v)u=ec(u);else if(3===v)u=fc(u);else if(4===
|
||||
v){v=u;u=gc(v);v=hc(v);for(var K=new Uint8Array(u),I=0;I<u;I+=1)K[I]=m[v+I];u=K}else u=null;n.push(u)}return n}function c(f,l){this.Qa=f;this.db=l;this.Oa=1;this.yb=[]}function d(f,l){this.db=l;this.ob=ea(f);if(null===this.ob)throw Error("Unable to allocate memory for the SQL string");this.ub=this.ob;this.gb=this.Fb=null}function e(f){this.filename="dbfile_"+(4294967295*Math.random()>>>0);if(null!=f){var l=this.filename,n="/",p=l;n&&(n="string"==typeof n?n:fa(n),p=l?ha(n+"/"+l):n);l=ia(!0,!0);p=ja(p,
|
||||
l);if(f){if("string"==typeof f){n=Array(f.length);for(var u=0,v=f.length;u<v;++u)n[u]=f.charCodeAt(u);f=n}ka(p,l|146);n=la(p,577);ma(n,f,0,f.length,0);na(n);ka(p,l)}}this.handleError(q(this.filename,g));this.db=r(g,"i32");hb(this.db);this.pb={};this.Sa={}}var g=y(4),h=k.cwrap,q=h("sqlite3_open","number",["string","number"]),w=h("sqlite3_close_v2","number",["number"]),t=h("sqlite3_exec","number",["number","string","number","number","number"]),x=h("sqlite3_changes","number",["number"]),D=h("sqlite3_prepare_v2",
|
||||
"number",["number","string","number","number","number"]),ib=h("sqlite3_sql","string",["number"]),jc=h("sqlite3_normalized_sql","string",["number"]),jb=h("sqlite3_prepare_v2","number",["number","number","number","number","number"]),kc=h("sqlite3_bind_text","number",["number","number","number","number","number"]),kb=h("sqlite3_bind_blob","number",["number","number","number","number","number"]),lc=h("sqlite3_bind_double","number",["number","number","number"]),mc=h("sqlite3_bind_int","number",["number",
|
||||
"number","number"]),nc=h("sqlite3_bind_parameter_index","number",["number","string"]),oc=h("sqlite3_step","number",["number"]),pc=h("sqlite3_errmsg","string",["number"]),qc=h("sqlite3_column_count","number",["number"]),rc=h("sqlite3_data_count","number",["number"]),sc=h("sqlite3_column_double","number",["number","number"]),lb=h("sqlite3_column_text","string",["number","number"]),tc=h("sqlite3_column_blob","number",["number","number"]),uc=h("sqlite3_column_bytes","number",["number","number"]),vc=h("sqlite3_column_type",
|
||||
"number",["number","number"]),wc=h("sqlite3_column_name","string",["number","number"]),xc=h("sqlite3_reset","number",["number"]),yc=h("sqlite3_clear_bindings","number",["number"]),zc=h("sqlite3_finalize","number",["number"]),mb=h("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),dc=h("sqlite3_value_type","number",["number"]),gc=h("sqlite3_value_bytes","number",["number"]),fc=h("sqlite3_value_text","string",["number"]),hc=h("sqlite3_value_blob",
|
||||
"number",["number"]),ec=h("sqlite3_value_double","number",["number"]),ac=h("sqlite3_result_double","",["number","number"]),eb=h("sqlite3_result_null","",["number"]),bc=h("sqlite3_result_text","",["number","string","number","number"]),cc=h("sqlite3_result_blob","",["number","number","number","number"]),$b=h("sqlite3_result_int","",["number","number"]),ra=h("sqlite3_result_error","",["number","string","number"]),nb=h("sqlite3_aggregate_context","number",["number","number"]),hb=h("RegisterExtensionFunctions",
|
||||
"number",["number"]),ob=h("sqlite3_update_hook","number",["number","number","number"]);c.prototype.bind=function(f){if(!this.Qa)throw"Statement closed";this.reset();return Array.isArray(f)?this.Wb(f):null!=f&&"object"===typeof f?this.Xb(f):!0};c.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var f=oc(this.Qa);switch(f){case 100:return!0;case 101:return!1;default:throw this.db.handleError(f);}};c.prototype.Pb=function(f){null==f&&(f=this.Oa,this.Oa+=1);return sc(this.Qa,f)};
|
||||
c.prototype.hc=function(f){null==f&&(f=this.Oa,this.Oa+=1);f=lb(this.Qa,f);if("function"!==typeof BigInt)throw Error("BigInt is not supported");return BigInt(f)};c.prototype.mc=function(f){null==f&&(f=this.Oa,this.Oa+=1);return lb(this.Qa,f)};c.prototype.getBlob=function(f){null==f&&(f=this.Oa,this.Oa+=1);var l=uc(this.Qa,f);f=tc(this.Qa,f);for(var n=new Uint8Array(l),p=0;p<l;p+=1)n[p]=m[f+p];return n};c.prototype.get=function(f,l){l=l||{};null!=f&&this.bind(f)&&this.step();f=[];for(var n=rc(this.Qa),
|
||||
p=0;p<n;p+=1)switch(vc(this.Qa,p)){case 1:var u=l.useBigInt?this.hc(p):this.Pb(p);f.push(u);break;case 2:f.push(this.Pb(p));break;case 3:f.push(this.mc(p));break;case 4:f.push(this.getBlob(p));break;default:f.push(null)}return f};c.prototype.Db=function(){for(var f=[],l=qc(this.Qa),n=0;n<l;n+=1)f.push(wc(this.Qa,n));return f};c.prototype.Ob=function(f,l){f=this.get(f,l);l=this.Db();for(var n={},p=0;p<l.length;p+=1)n[l[p]]=f[p];return n};c.prototype.lc=function(){return ib(this.Qa)};c.prototype.ic=
|
||||
function(){return jc(this.Qa)};c.prototype.Jb=function(f){null!=f&&this.bind(f);this.step();return this.reset()};c.prototype.Lb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);f=ea(f);this.yb.push(f);this.db.handleError(kc(this.Qa,l,f,-1,0))};c.prototype.Vb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);var n=ca(f.length);m.set(f,n);this.yb.push(n);this.db.handleError(kb(this.Qa,l,n,f.length,0))};c.prototype.Kb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);this.db.handleError((f===(f|0)?mc:lc)(this.Qa,
|
||||
l,f))};c.prototype.Yb=function(f){null==f&&(f=this.Oa,this.Oa+=1);kb(this.Qa,f,0,0,0)};c.prototype.Mb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);switch(typeof f){case "string":this.Lb(f,l);return;case "number":this.Kb(f,l);return;case "bigint":this.Lb(f.toString(),l);return;case "boolean":this.Kb(f+0,l);return;case "object":if(null===f){this.Yb(l);return}if(null!=f.length){this.Vb(f,l);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+f+").";};c.prototype.Xb=function(f){var l=
|
||||
this;Object.keys(f).forEach(function(n){var p=nc(l.Qa,n);0!==p&&l.Mb(f[n],p)});return!0};c.prototype.Wb=function(f){for(var l=0;l<f.length;l+=1)this.Mb(f[l],l+1);return!0};c.prototype.reset=function(){this.Cb();return 0===yc(this.Qa)&&0===xc(this.Qa)};c.prototype.Cb=function(){for(var f;void 0!==(f=this.yb.pop());)da(f)};c.prototype.cb=function(){this.Cb();var f=0===zc(this.Qa);delete this.db.pb[this.Qa];this.Qa=0;return f};d.prototype.next=function(){if(null===this.ob)return{done:!0};null!==this.gb&&
|
||||
(this.gb.cb(),this.gb=null);if(!this.db.db)throw this.Ab(),Error("Database closed");var f=oa(),l=y(4);pa(g);pa(l);try{this.db.handleError(jb(this.db.db,this.ub,-1,g,l));this.ub=r(l,"i32");var n=r(g,"i32");if(0===n)return this.Ab(),{done:!0};this.gb=new c(n,this.db);this.db.pb[n]=this.gb;return{value:this.gb,done:!1}}catch(p){throw this.Fb=z(this.ub),this.Ab(),p;}finally{qa(f)}};d.prototype.Ab=function(){da(this.ob);this.ob=null};d.prototype.jc=function(){return null!==this.Fb?this.Fb:z(this.ub)};
|
||||
"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator&&(d.prototype[Symbol.iterator]=function(){return this});e.prototype.Jb=function(f,l){if(!this.db)throw"Database closed";if(l){f=this.Gb(f,l);try{f.step()}finally{f.cb()}}else this.handleError(t(this.db,f,0,0,g));return this};e.prototype.exec=function(f,l,n){if(!this.db)throw"Database closed";var p=null,u=null,v=null;try{v=u=ea(f);var K=y(4);for(f=[];0!==r(v,"i8");){pa(g);pa(K);this.handleError(jb(this.db,v,-1,g,K));var I=r(g,"i32");v=r(K,
|
||||
"i32");if(0!==I){var H=null;p=new c(I,this);for(null!=l&&p.bind(l);p.step();)null===H&&(H={columns:p.Db(),values:[]},f.push(H)),H.values.push(p.get(null,n));p.cb()}}return f}catch(L){throw p&&p.cb(),L;}finally{u&&da(u)}};e.prototype.ec=function(f,l,n,p,u){"function"===typeof l&&(p=n,n=l,l=void 0);f=this.Gb(f,l);try{for(;f.step();)n(f.Ob(null,u))}finally{f.cb()}if("function"===typeof p)return p()};e.prototype.Gb=function(f,l){pa(g);this.handleError(D(this.db,f,-1,g,0));f=r(g,"i32");if(0===f)throw"Nothing to prepare";
|
||||
var n=new c(f,this);null!=l&&n.bind(l);return this.pb[f]=n};e.prototype.pc=function(f){return new d(f,this)};e.prototype.fc=function(){Object.values(this.pb).forEach(function(l){l.cb()});Object.values(this.Sa).forEach(A);this.Sa={};this.handleError(w(this.db));var f=sa(this.filename);this.handleError(q(this.filename,g));this.db=r(g,"i32");hb(this.db);return f};e.prototype.close=function(){null!==this.db&&(Object.values(this.pb).forEach(function(f){f.cb()}),Object.values(this.Sa).forEach(A),this.Sa=
|
||||
{},this.fb&&(A(this.fb),this.fb=void 0),this.handleError(w(this.db)),ta("/"+this.filename),this.db=null)};e.prototype.handleError=function(f){if(0===f)return null;f=pc(this.db);throw Error(f);};e.prototype.kc=function(){return x(this.db)};e.prototype.bc=function(f,l){Object.prototype.hasOwnProperty.call(this.Sa,f)&&(A(this.Sa[f]),delete this.Sa[f]);var n=ua(function(p,u,v){u=b(u,v);try{var K=l.apply(null,u)}catch(I){ra(p,I,-1);return}a(p,K)},"viii");this.Sa[f]=n;this.handleError(mb(this.db,f,l.length,
|
||||
1,0,n,0,0,0));return this};e.prototype.ac=function(f,l){var n=l.init||function(){return null},p=l.finalize||function(H){return H},u=l.step;if(!u)throw"An aggregate function must have a step function in "+f;var v={};Object.hasOwnProperty.call(this.Sa,f)&&(A(this.Sa[f]),delete this.Sa[f]);l=f+"__finalize";Object.hasOwnProperty.call(this.Sa,l)&&(A(this.Sa[l]),delete this.Sa[l]);var K=ua(function(H,L,Ka){var V=nb(H,1);Object.hasOwnProperty.call(v,V)||(v[V]=n());L=b(L,Ka);L=[v[V]].concat(L);try{v[V]=u.apply(null,
|
||||
L)}catch(Bc){delete v[V],ra(H,Bc,-1)}},"viii"),I=ua(function(H){var L=nb(H,1);try{var Ka=p(v[L])}catch(V){delete v[L];ra(H,V,-1);return}a(H,Ka);delete v[L]},"vi");this.Sa[f]=K;this.Sa[l]=I;this.handleError(mb(this.db,f,u.length-1,1,0,0,K,I,0));return this};e.prototype.vc=function(f){this.fb&&(ob(this.db,0,0),A(this.fb),this.fb=void 0);if(!f)return this;this.fb=ua(function(l,n,p,u,v){switch(n){case 18:l="insert";break;case 23:l="update";break;case 9:l="delete";break;default:throw"unknown operationCode in updateHook callback: "+
|
||||
n;}p=z(p);u=z(u);if(v>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";f(l,p,u,Number(v))},"viiiij");ob(this.db,this.fb,0);return this};c.prototype.bind=c.prototype.bind;c.prototype.step=c.prototype.step;c.prototype.get=c.prototype.get;c.prototype.getColumnNames=c.prototype.Db;c.prototype.getAsObject=c.prototype.Ob;c.prototype.getSQL=c.prototype.lc;c.prototype.getNormalizedSQL=c.prototype.ic;c.prototype.run=c.prototype.Jb;c.prototype.reset=c.prototype.reset;c.prototype.freemem=
|
||||
c.prototype.Cb;c.prototype.free=c.prototype.cb;d.prototype.next=d.prototype.next;d.prototype.getRemainingSQL=d.prototype.jc;e.prototype.run=e.prototype.Jb;e.prototype.exec=e.prototype.exec;e.prototype.each=e.prototype.ec;e.prototype.prepare=e.prototype.Gb;e.prototype.iterateStatements=e.prototype.pc;e.prototype["export"]=e.prototype.fc;e.prototype.close=e.prototype.close;e.prototype.handleError=e.prototype.handleError;e.prototype.getRowsModified=e.prototype.kc;e.prototype.create_function=e.prototype.bc;
|
||||
e.prototype.create_aggregate=e.prototype.ac;e.prototype.updateHook=e.prototype.vc;k.Database=e};var va="./this.program",wa=globalThis.document?.currentScript?.src;ba&&(wa=self.location.href);var xa="",ya,za;
|
||||
if(aa||ba){try{xa=(new URL(".",wa)).href}catch{}ba&&(za=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)});ya=async a=>{a=await fetch(a,{credentials:"same-origin"});if(a.ok)return a.arrayBuffer();throw Error(a.status+" : "+a.url);}}var Aa=console.log.bind(console),B=console.error.bind(console),Ba,Ca=!1,Da,m,C,Ea,E,F,Fa,Ga,G;
|
||||
function Ha(){var a=Ia.buffer;m=new Int8Array(a);Ea=new Int16Array(a);C=new Uint8Array(a);new Uint16Array(a);E=new Int32Array(a);F=new Uint32Array(a);Fa=new Float32Array(a);Ga=new Float64Array(a);G=new BigInt64Array(a);new BigUint64Array(a)}function Ja(a){k.onAbort?.(a);a="Aborted("+a+")";B(a);Ca=!0;throw new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");}var La;
|
||||
async function Ma(a){if(!Ba)try{var b=await ya(a);return new Uint8Array(b)}catch{}if(a==La&&Ba)a=new Uint8Array(Ba);else if(za)a=za(a);else throw"both async and sync fetching of the wasm failed";return a}async function Na(a,b){try{var c=await Ma(a);return await WebAssembly.instantiate(c,b)}catch(d){B(`failed to asynchronously prepare wasm: ${d}`),Ja(d)}}
|
||||
async function Oa(a){var b=La;if(!Ba)try{var c=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,a)}catch(d){B(`wasm streaming compile failed: ${d}`),B("falling back to ArrayBuffer instantiation")}return Na(b,a)}class Pa{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}var Qa=a=>{for(;0<a.length;)a.shift()(k)},Ra=[],Sa=[],Ta=()=>{var a=k.preRun.shift();Sa.push(a)},J=0,Ua=null;
|
||||
function r(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return m[a];case "i8":return m[a];case "i16":return Ea[a>>1];case "i32":return E[a>>2];case "i64":return G[a>>3];case "float":return Fa[a>>2];case "double":return Ga[a>>3];case "*":return F[a>>2];default:Ja(`invalid type for getValue: ${b}`)}}var Va=!0;
|
||||
function pa(a){var b="i32";b.endsWith("*")&&(b="*");switch(b){case "i1":m[a]=0;break;case "i8":m[a]=0;break;case "i16":Ea[a>>1]=0;break;case "i32":E[a>>2]=0;break;case "i64":G[a>>3]=BigInt(0);break;case "float":Fa[a>>2]=0;break;case "double":Ga[a>>3]=0;break;case "*":F[a>>2]=0;break;default:Ja(`invalid type for setValue: ${b}`)}}
|
||||
var Wa=new TextDecoder,Xa=(a,b,c,d)=>{c=b+c;if(d)return c;for(;a[b]&&!(b>=c);)++b;return b},z=(a,b,c)=>a?Wa.decode(C.subarray(a,Xa(C,a,b,c))):"",Ya=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},ha=a=>{var b="/"===a.charAt(0),c="/"===a.slice(-1);(a=Ya(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},Za=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
|
||||
a=b[0];b=b[1];if(!a&&!b)return".";b&&=b.slice(0,-1);return a+b},$a=a=>a&&a.match(/([^\/]+|\/)\/*$/)[1],ab=()=>a=>crypto.getRandomValues(a),bb=a=>{(bb=ab())(a)},cb=(...a)=>{for(var b="",c=!1,d=a.length-1;-1<=d&&!c;d--){c=0<=d?a[d]:"/";if("string"!=typeof c)throw new TypeError("Arguments to path.resolve must be strings");if(!c)return"";b=c+"/"+b;c="/"===c.charAt(0)}b=Ya(b.split("/").filter(e=>!!e),!c).join("/");return(c?"/":"")+b||"."},db=a=>{var b=Xa(a,0);return Wa.decode(a.buffer?a.subarray(0,b):
|
||||
new Uint8Array(a.slice(0,b)))},fb=[],gb=a=>{for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);127>=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b},M=(a,b,c,d)=>{if(!(0<d))return 0;var e=c;d=c+d-1;for(var g=0;g<a.length;++g){var h=a.codePointAt(g);if(127>=h){if(c>=d)break;b[c++]=h}else if(2047>=h){if(c+1>=d)break;b[c++]=192|h>>6;b[c++]=128|h&63}else if(65535>=h){if(c+2>=d)break;b[c++]=224|h>>12;b[c++]=128|h>>6&63;b[c++]=128|h&63}else{if(c+3>=d)break;b[c++]=240|h>>18;b[c++]=128|
|
||||
h>>12&63;b[c++]=128|h>>6&63;b[c++]=128|h&63;g++}}b[c]=0;return c-e},pb=[];function qb(a,b){pb[a]={input:[],output:[],kb:b};rb(a,sb)}
|
||||
var sb={open(a){var b=pb[a.node.nb];if(!b)throw new N(43);a.Va=b;a.seekable=!1},close(a){a.Va.kb.lb(a.Va)},lb(a){a.Va.kb.lb(a.Va)},read(a,b,c,d){if(!a.Va||!a.Va.kb.Qb)throw new N(60);for(var e=0,g=0;g<d;g++){try{var h=a.Va.kb.Qb(a.Va)}catch(q){throw new N(29);}if(void 0===h&&0===e)throw new N(6);if(null===h||void 0===h)break;e++;b[c+g]=h}e&&(a.node.$a=Date.now());return e},write(a,b,c,d){if(!a.Va||!a.Va.kb.Hb)throw new N(60);try{for(var e=0;e<d;e++)a.Va.kb.Hb(a.Va,b[c+e])}catch(g){throw new N(29);
|
||||
}d&&(a.node.Ua=a.node.Ta=Date.now());return e}},tb={Qb(){a:{if(!fb.length){var a=null;globalThis.window?.prompt&&(a=window.prompt("Input: "),null!==a&&(a+="\n"));if(!a){var b=null;break a}b=Array(gb(a)+1);a=M(a,b,0,b.length);b.length=a;fb=b}b=fb.shift()}return b},Hb(a,b){null===b||10===b?(Aa(db(a.output)),a.output=[]):0!=b&&a.output.push(b)},lb(a){0<a.output?.length&&(Aa(db(a.output)),a.output=[])},Dc(){return{yc:25856,Ac:5,xc:191,zc:35387,wc:[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]}},Ec(){return 0},Fc(){return[24,80]}},ub={Hb(a,b){null===b||10===b?(B(db(a.output)),a.output=[]):0!=b&&a.output.push(b)},lb(a){0<a.output?.length&&(B(db(a.output)),a.output=[])}},O={Za:null,ab(){return O.createNode(null,"/",16895,0)},createNode(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new N(63);O.Za||(O.Za={dir:{node:{Wa:O.La.Wa,Xa:O.La.Xa,mb:O.La.mb,rb:O.La.rb,Tb:O.La.Tb,xb:O.La.xb,vb:O.La.vb,Ib:O.La.Ib,wb:O.La.wb},stream:{Ya:O.Ma.Ya}},file:{node:{Wa:O.La.Wa,Xa:O.La.Xa},
|
||||
stream:{Ya:O.Ma.Ya,read:O.Ma.read,write:O.Ma.write,sb:O.Ma.sb,tb:O.Ma.tb}},link:{node:{Wa:O.La.Wa,Xa:O.La.Xa,eb:O.La.eb},stream:{}},Nb:{node:{Wa:O.La.Wa,Xa:O.La.Xa},stream:vb}});c=wb(a,b,c,d);P(c.mode)?(c.La=O.Za.dir.node,c.Ma=O.Za.dir.stream,c.Na={}):32768===(c.mode&61440)?(c.La=O.Za.file.node,c.Ma=O.Za.file.stream,c.Ra=0,c.Na=null):40960===(c.mode&61440)?(c.La=O.Za.link.node,c.Ma=O.Za.link.stream):8192===(c.mode&61440)&&(c.La=O.Za.Nb.node,c.Ma=O.Za.Nb.stream);c.$a=c.Ua=c.Ta=Date.now();a&&(a.Na[b]=
|
||||
c,a.$a=a.Ua=a.Ta=c.$a);return c},Cc(a){return a.Na?a.Na.subarray?a.Na.subarray(0,a.Ra):new Uint8Array(a.Na):new Uint8Array(0)},La:{Wa(a){var b={};b.cc=8192===(a.mode&61440)?a.id:1;b.oc=a.id;b.mode=a.mode;b.rc=1;b.uid=0;b.nc=0;b.nb=a.nb;P(a.mode)?b.size=4096:32768===(a.mode&61440)?b.size=a.Ra:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.$a=new Date(a.$a);b.Ua=new Date(a.Ua);b.Ta=new Date(a.Ta);b.Zb=4096;b.$b=Math.ceil(b.size/b.Zb);return b},Xa(a,b){for(var c of["mode","atime","mtime","ctime"])null!=
|
||||
b[c]&&(a[c]=b[c]);void 0!==b.size&&(b=b.size,a.Ra!=b&&(0==b?(a.Na=null,a.Ra=0):(c=a.Na,a.Na=new Uint8Array(b),c&&a.Na.set(c.subarray(0,Math.min(b,a.Ra))),a.Ra=b)))},mb(){O.zb||(O.zb=new N(44),O.zb.stack="<generic error, no stack>");throw O.zb;},rb(a,b,c,d){return O.createNode(a,b,c,d)},Tb(a,b,c){try{var d=Q(b,c)}catch(g){}if(d){if(P(a.mode))for(var e in d.Na)throw new N(55);xb(d)}delete a.parent.Na[a.name];b.Na[c]=a;a.name=c;b.Ta=b.Ua=a.parent.Ta=a.parent.Ua=Date.now()},xb(a,b){delete a.Na[b];a.Ta=
|
||||
a.Ua=Date.now()},vb(a,b){var c=Q(a,b),d;for(d in c.Na)throw new N(55);delete a.Na[b];a.Ta=a.Ua=Date.now()},Ib(a){return[".","..",...Object.keys(a.Na)]},wb(a,b,c){a=O.createNode(a,b,41471,0);a.link=c;return a},eb(a){if(40960!==(a.mode&61440))throw new N(28);return a.link}},Ma:{read(a,b,c,d,e){var g=a.node.Na;if(e>=a.node.Ra)return 0;a=Math.min(a.node.Ra-e,d);if(8<a&&g.subarray)b.set(g.subarray(e,e+a),c);else for(d=0;d<a;d++)b[c+d]=g[e+d];return a},write(a,b,c,d,e,g){b.buffer===m.buffer&&(g=!1);if(!d)return 0;
|
||||
a=a.node;a.Ua=a.Ta=Date.now();if(b.subarray&&(!a.Na||a.Na.subarray)){if(g)return a.Na=b.subarray(c,c+d),a.Ra=d;if(0===a.Ra&&0===e)return a.Na=b.slice(c,c+d),a.Ra=d;if(e+d<=a.Ra)return a.Na.set(b.subarray(c,c+d),e),d}g=e+d;var h=a.Na?a.Na.length:0;h>=g||(g=Math.max(g,h*(1048576>h?2:1.125)>>>0),0!=h&&(g=Math.max(g,256)),h=a.Na,a.Na=new Uint8Array(g),0<a.Ra&&a.Na.set(h.subarray(0,a.Ra),0));if(a.Na.subarray&&b.subarray)a.Na.set(b.subarray(c,c+d),e);else for(g=0;g<d;g++)a.Na[e+g]=b[c+g];a.Ra=Math.max(a.Ra,
|
||||
e+d);return d},Ya(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.Ra);if(0>b)throw new N(28);return b},sb(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new N(43);a=a.node.Na;if(e&2||!a||a.buffer!==m.buffer){e=!0;d=65536*Math.ceil(b/65536);var g=yb(65536,d);g&&C.fill(0,g,g+d);d=g;if(!d)throw new N(48);if(a){if(0<c||c+b<a.length)a.subarray?a=a.subarray(c,c+b):a=Array.prototype.slice.call(a,c,c+b);m.set(a,d)}}else e=!1,d=a.byteOffset;return{tc:d,Ub:e}},tb(a,b,c,d){O.Ma.write(a,
|
||||
b,0,d,c,!1);return 0}}},ia=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},zb=null,Ab={},Bb=[],Cb=1,R=null,Db=!1,Eb=!0,N=class{name="ErrnoError";constructor(a){this.Pa=a}},Fb=class{qb={};node=null;get flags(){return this.qb.flags}set flags(a){this.qb.flags=a}get position(){return this.qb.position}set position(a){this.qb.position=a}},Gb=class{La={};Ma={};ib=null;constructor(a,b,c,d){a||=this;this.parent=a;this.ab=a.ab;this.id=Cb++;this.name=b;this.mode=c;this.nb=d;this.$a=this.Ua=this.Ta=Date.now()}get read(){return 365===
|
||||
(this.mode&365)}set read(a){a?this.mode|=365:this.mode&=-366}get write(){return 146===(this.mode&146)}set write(a){a?this.mode|=146:this.mode&=-147}};
|
||||
function S(a,b={}){if(!a)throw new N(44);b.Bb??(b.Bb=!0);"/"===a.charAt(0)||(a="//"+a);var c=0;a:for(;40>c;c++){a=a.split("/").filter(q=>!!q);for(var d=zb,e="/",g=0;g<a.length;g++){var h=g===a.length-1;if(h&&b.parent)break;if("."!==a[g])if(".."===a[g])if(e=Za(e),d===d.parent){a=e+"/"+a.slice(g+1).join("/");c--;continue a}else d=d.parent;else{e=ha(e+"/"+a[g]);try{d=Q(d,a[g])}catch(q){if(44===q?.Pa&&h&&b.sc)return{path:e};throw q;}!d.ib||h&&!b.Bb||(d=d.ib.root);if(40960===(d.mode&61440)&&(!h||b.hb)){if(!d.La.eb)throw new N(52);
|
||||
d=d.La.eb(d);"/"===d.charAt(0)||(d=Za(e)+"/"+d);a=d+"/"+a.slice(g+1).join("/");continue a}}}return{path:e,node:d}}throw new N(32);}function fa(a){for(var b;;){if(a===a.parent)return a=a.ab.Sb,b?"/"!==a[a.length-1]?`${a}/${b}`:a+b:a;b=b?`${a.name}/${b}`:a.name;a=a.parent}}function Hb(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%R.length}function xb(a){var b=Hb(a.parent.id,a.name);if(R[b]===a)R[b]=a.jb;else for(b=R[b];b;){if(b.jb===a){b.jb=a.jb;break}b=b.jb}}
|
||||
function Q(a,b){var c=P(a.mode)?(c=Ib(a,"x"))?c:a.La.mb?0:2:54;if(c)throw new N(c);for(c=R[Hb(a.id,b)];c;c=c.jb){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.La.mb(a,b)}function wb(a,b,c,d){a=new Gb(a,b,c,d);b=Hb(a.parent.id,a.name);a.jb=R[b];return R[b]=a}function P(a){return 16384===(a&61440)}function Ib(a,b){return Eb?0:b.includes("r")&&!(a.mode&292)||b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73)?2:0}
|
||||
function Jb(a,b){if(!P(a.mode))return 54;try{return Q(a,b),20}catch(c){}return Ib(a,"wx")}function Kb(a,b,c){try{var d=Q(a,b)}catch(e){return e.Pa}if(a=Ib(a,"wx"))return a;if(c){if(!P(d.mode))return 54;if(d===d.parent||"/"===fa(d))return 10}else if(P(d.mode))return 31;return 0}function Lb(a){if(!a)throw new N(63);return a}function T(a){a=Bb[a];if(!a)throw new N(8);return a}
|
||||
function Mb(a,b=-1){a=Object.assign(new Fb,a);if(-1==b)a:{for(b=0;4096>=b;b++)if(!Bb[b])break a;throw new N(33);}a.bb=b;return Bb[b]=a}function Nb(a,b=-1){a=Mb(a,b);a.Ma?.Bc?.(a);return a}function Ob(a,b,c){var d=a?.Ma.Xa;a=d?a:b;d??=b.La.Xa;Lb(d);d(a,c)}var vb={open(a){a.Ma=Ab[a.node.nb].Ma;a.Ma.open?.(a)},Ya(){throw new N(70);}};function rb(a,b){Ab[a]={Ma:b}}
|
||||
function Pb(a,b){var c="/"===b;if(c&&zb)throw new N(10);if(!c&&b){var d=S(b,{Bb:!1});b=d.path;d=d.node;if(d.ib)throw new N(10);if(!P(d.mode))throw new N(54);}b={type:a,Gc:{},Sb:b,qc:[]};a=a.ab(b);a.ab=b;b.root=a;c?zb=a:d&&(d.ib=b,d.ab&&d.ab.qc.push(b))}function Qb(a,b,c){var d=S(a,{parent:!0}).node;a=$a(a);if(!a)throw new N(28);if("."===a||".."===a)throw new N(20);var e=Jb(d,a);if(e)throw new N(e);if(!d.La.rb)throw new N(63);return d.La.rb(d,a,b,c)}
|
||||
function ja(a,b=438){return Qb(a,b&4095|32768,0)}function U(a,b=511){return Qb(a,b&1023|16384,0)}function Rb(a,b,c){"undefined"==typeof c&&(c=b,b=438);Qb(a,b|8192,c)}function Sb(a,b){if(!cb(a))throw new N(44);var c=S(b,{parent:!0}).node;if(!c)throw new N(44);b=$a(b);var d=Jb(c,b);if(d)throw new N(d);if(!c.La.wb)throw new N(63);c.La.wb(c,b,a)}
|
||||
function Tb(a){var b=S(a,{parent:!0}).node;a=$a(a);var c=Q(b,a),d=Kb(b,a,!0);if(d)throw new N(d);if(!b.La.vb)throw new N(63);if(c.ib)throw new N(10);b.La.vb(b,a);xb(c)}function ta(a){var b=S(a,{parent:!0}).node;if(!b)throw new N(44);a=$a(a);var c=Q(b,a),d=Kb(b,a,!1);if(d)throw new N(d);if(!b.La.xb)throw new N(63);if(c.ib)throw new N(10);b.La.xb(b,a);xb(c)}function Ub(a,b){a=S(a,{hb:!b}).node;return Lb(a.La.Wa)(a)}function Vb(a,b,c,d){Ob(a,b,{mode:c&4095|b.mode&-4096,Ta:Date.now(),dc:d})}
|
||||
function ka(a,b){a="string"==typeof a?S(a,{hb:!0}).node:a;Vb(null,a,b)}function Wb(a,b,c){if(P(b.mode))throw new N(31);if(32768!==(b.mode&61440))throw new N(28);var d=Ib(b,"w");if(d)throw new N(d);Ob(a,b,{size:c,timestamp:Date.now()})}
|
||||
function la(a,b,c=438){if(""===a)throw new N(44);if("string"==typeof b){var d={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if("undefined"==typeof d)throw Error(`Unknown file open mode: ${b}`);b=d}c=b&64?c&4095|32768:0;if("object"==typeof a)d=a;else{var e=a.endsWith("/");var g=S(a,{hb:!(b&131072),sc:!0});d=g.node;a=g.path}g=!1;if(b&64)if(d){if(b&128)throw new N(20);}else{if(e)throw new N(31);d=Qb(a,c|511,0);g=!0}if(!d)throw new N(44);8192===(d.mode&61440)&&(b&=-513);if(b&65536&&!P(d.mode))throw new N(54);
|
||||
if(!g&&(d?40960===(d.mode&61440)?e=32:(e=["r","w","rw"][b&3],b&512&&(e+="w"),e=P(d.mode)&&("r"!==e||b&576)?31:Ib(d,e)):e=44,e))throw new N(e);b&512&&!g&&(e=d,e="string"==typeof e?S(e,{hb:!0}).node:e,Wb(null,e,0));b=Mb({node:d,path:fa(d),flags:b&-131713,seekable:!0,position:0,Ma:d.Ma,uc:[],error:!1});b.Ma.open&&b.Ma.open(b);g&&ka(d,c&511);return b}function na(a){if(null===a.bb)throw new N(8);a.Eb&&(a.Eb=null);try{a.Ma.close&&a.Ma.close(a)}catch(b){throw b;}finally{Bb[a.bb]=null}a.bb=null}
|
||||
function Xb(a,b,c){if(null===a.bb)throw new N(8);if(!a.seekable||!a.Ma.Ya)throw new N(70);if(0!=c&&1!=c&&2!=c)throw new N(28);a.position=a.Ma.Ya(a,b,c);a.uc=[]}function Yb(a,b,c,d,e){if(0>d||0>e)throw new N(28);if(null===a.bb)throw new N(8);if(1===(a.flags&2097155))throw new N(8);if(P(a.node.mode))throw new N(31);if(!a.Ma.read)throw new N(28);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new N(70);b=a.Ma.read(a,b,c,d,e);g||(a.position+=b);return b}
|
||||
function ma(a,b,c,d,e){if(0>d||0>e)throw new N(28);if(null===a.bb)throw new N(8);if(0===(a.flags&2097155))throw new N(8);if(P(a.node.mode))throw new N(31);if(!a.Ma.write)throw new N(28);a.seekable&&a.flags&1024&&Xb(a,0,2);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new N(70);b=a.Ma.write(a,b,c,d,e,void 0);g||(a.position+=b);return b}
|
||||
function sa(a){var b=b||0;var c="binary";"utf8"!==c&&"binary"!==c&&Ja(`Invalid encoding type "${c}"`);b=la(a,b);a=Ub(a).size;var d=new Uint8Array(a);Yb(b,d,0,a,0);"utf8"===c&&(d=db(d));na(b);return d}
|
||||
function W(a,b,c){a=ha("/dev/"+a);var d=ia(!!b,!!c);W.Rb??(W.Rb=64);var e=W.Rb++<<8|0;rb(e,{open(g){g.seekable=!1},close(){c?.buffer?.length&&c(10)},read(g,h,q,w){for(var t=0,x=0;x<w;x++){try{var D=b()}catch(ib){throw new N(29);}if(void 0===D&&0===t)throw new N(6);if(null===D||void 0===D)break;t++;h[q+x]=D}t&&(g.node.$a=Date.now());return t},write(g,h,q,w){for(var t=0;t<w;t++)try{c(h[q+t])}catch(x){throw new N(29);}w&&(g.node.Ua=g.node.Ta=Date.now());return t}});Rb(a,d,e)}var X={};
|
||||
function Y(a,b,c){if("/"===b.charAt(0))return b;a=-100===a?"/":T(a).path;if(0==b.length){if(!c)throw new N(44);return a}return a+"/"+b}
|
||||
function Zb(a,b){F[a>>2]=b.cc;F[a+4>>2]=b.mode;F[a+8>>2]=b.rc;F[a+12>>2]=b.uid;F[a+16>>2]=b.nc;F[a+20>>2]=b.nb;G[a+24>>3]=BigInt(b.size);E[a+32>>2]=4096;E[a+36>>2]=b.$b;var c=b.$a.getTime(),d=b.Ua.getTime(),e=b.Ta.getTime();G[a+40>>3]=BigInt(Math.floor(c/1E3));F[a+48>>2]=c%1E3*1E6;G[a+56>>3]=BigInt(Math.floor(d/1E3));F[a+64>>2]=d%1E3*1E6;G[a+72>>3]=BigInt(Math.floor(e/1E3));F[a+80>>2]=e%1E3*1E6;G[a+88>>3]=BigInt(b.oc);return 0}
|
||||
var ic=void 0,Ac=()=>{var a=E[+ic>>2];ic+=4;return a},Cc=0,Dc=[0,31,60,91,121,152,182,213,244,274,305,335],Ec=[0,31,59,90,120,151,181,212,243,273,304,334],Fc={},Gc=a=>{if(!(a instanceof Pa||"unwind"==a))throw a;},Hc=a=>{Da=a;Va||0<Cc||(k.onExit?.(a),Ca=!0);throw new Pa(a);},Ic=a=>{if(!Ca)try{a()}catch(b){Gc(b)}finally{if(!(Va||0<Cc))try{Da=a=Da,Hc(a)}catch(b){Gc(b)}}},Jc={},Lc=()=>{if(!Kc){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??
|
||||
"C").replace("-","_")+".UTF-8",_:va||"./this.program"},b;for(b in Jc)void 0===Jc[b]?delete a[b]:a[b]=Jc[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Kc=c}return Kc},Kc,Mc=(a,b,c,d)=>{var e={string:t=>{var x=0;if(null!==t&&void 0!==t&&0!==t){x=gb(t)+1;var D=y(x);M(t,C,D,x);x=D}return x},array:t=>{var x=y(t.length);m.set(t,x);return x}};a=k["_"+a];var g=[],h=0;if(d)for(var q=0;q<d.length;q++){var w=e[c[q]];w?(0===h&&(h=oa()),g[q]=w(d[q])):g[q]=d[q]}c=a(...g);return c=function(t){0!==h&&qa(h);return"string"===
|
||||
b?z(t):"boolean"===b?!!t:t}(c)},ea=a=>{var b=gb(a)+1,c=ca(b);c&&M(a,C,c,b);return c},Nc,Oc=[],A=a=>{Nc.delete(Z.get(a));Z.set(a,null);Oc.push(a)},Pc=a=>{const b=a.length;return[b%128|128,b>>7,...a]},Qc={i:127,p:127,j:126,f:125,d:124,e:111},Rc=a=>Pc(Array.from(a,b=>Qc[b])),ua=(a,b)=>{if(!Nc){Nc=new WeakMap;var c=Z.length;if(Nc)for(var d=0;d<0+c;d++){var e=Z.get(d);e&&Nc.set(e,d)}}if(c=Nc.get(a)||0)return c;c=Oc.length?Oc.pop():Z.grow(1);try{Z.set(c,a)}catch(g){if(!(g instanceof TypeError))throw g;
|
||||
b=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Pc([1,96,...Rc(b.slice(1)),...Rc("v"===b[0]?"":b[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);b=new WebAssembly.Module(b);b=(new WebAssembly.Instance(b,{e:{f:a}})).exports.f;Z.set(c,b)}Nc.set(a,c);return c};R=Array(4096);Pb(O,"/");U("/tmp");U("/home");U("/home/web_user");
|
||||
(function(){U("/dev");rb(259,{read:()=>0,write:(d,e,g,h)=>h,Ya:()=>0});Rb("/dev/null",259);qb(1280,tb);qb(1536,ub);Rb("/dev/tty",1280);Rb("/dev/tty1",1536);var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(bb(a),b=a.byteLength);return a[--b]};W("random",c);W("urandom",c);U("/dev/shm");U("/dev/shm/tmp")})();
|
||||
(function(){U("/proc");var a=U("/proc/self");U("/proc/self/fd");Pb({ab(){var b=wb(a,"fd",16895,73);b.Ma={Ya:O.Ma.Ya};b.La={mb(c,d){c=+d;var e=T(c);c={parent:null,ab:{Sb:"fake"},La:{eb:()=>e.path},id:c+1};return c.parent=c},Ib(){return Array.from(Bb.entries()).filter(([,c])=>c).map(([c])=>c.toString())}};return b}},"/proc/self/fd")})();k.noExitRuntime&&(Va=k.noExitRuntime);k.print&&(Aa=k.print);k.printErr&&(B=k.printErr);k.wasmBinary&&(Ba=k.wasmBinary);k.thisProgram&&(va=k.thisProgram);
|
||||
if(k.preInit)for("function"==typeof k.preInit&&(k.preInit=[k.preInit]);0<k.preInit.length;)k.preInit.shift()();k.stackSave=()=>oa();k.stackRestore=a=>qa(a);k.stackAlloc=a=>y(a);k.cwrap=(a,b,c,d)=>{var e=!c||c.every(g=>"number"===g||"boolean"===g);return"string"!==b&&e&&!d?k["_"+a]:(...g)=>Mc(a,b,c,g)};k.addFunction=ua;k.removeFunction=A;k.UTF8ToString=z;k.stringToNewUTF8=ea;k.writeArrayToMemory=(a,b)=>{m.set(a,b)};
|
||||
var ca,da,yb,Sc,qa,y,oa,Ia,Z,Tc={a:(a,b,c,d)=>Ja(`Assertion failed: ${z(a)}, at: `+[b?z(b):"unknown filename",c,d?z(d):"unknown function"]),i:function(a,b){try{return a=z(a),ka(a,b),0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},L:function(a,b,c){try{b=z(b);b=Y(a,b);if(c&-8)return-28;var d=S(b,{hb:!0}).node;if(!d)return-44;a="";c&4&&(a+="r");c&2&&(a+="w");c&1&&(a+="x");return a&&Ib(d,a)?-2:0}catch(e){if("undefined"==typeof X||"ErrnoError"!==e.name)throw e;return-e.Pa}},
|
||||
j:function(a,b){try{var c=T(a);Vb(c,c.node,b,!1);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},h:function(a){try{var b=T(a);Ob(b,b.node,{timestamp:Date.now(),dc:!1});return 0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},b:function(a,b,c){ic=c;try{var d=T(a);switch(b){case 0:var e=Ac();if(0>e)break;for(;Bb[e];)e++;return Nb(d,e).bb;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=Ac(),d.flags|=e,0;case 12:return e=
|
||||
Ac(),Ea[e+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},g:function(a,b){try{var c=T(a),d=c.node,e=c.Ma.Wa;a=e?c:d;e??=d.La.Wa;Lb(e);var g=e(a);return Zb(b,g)}catch(h){if("undefined"==typeof X||"ErrnoError"!==h.name)throw h;return-h.Pa}},H:function(a,b){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return-61;var c=T(a);if(0>b||0===(c.flags&2097155))throw new N(28);Wb(c,c.node,b);return 0}catch(d){if("undefined"==
|
||||
typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},G:function(a,b){try{if(0===b)return-28;var c=gb("/")+1;if(b<c)return-68;M("/",C,a,b);return c}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},K:function(a,b){try{return a=z(a),Zb(b,Ub(a,!0))}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},C:function(a,b,c){try{return b=z(b),b=Y(a,b),U(b,c),0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},J:function(a,
|
||||
b,c,d){try{b=z(b);var e=d&256;b=Y(a,b,d&4096);return Zb(c,e?Ub(b,!0):Ub(b))}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},x:function(a,b,c,d){ic=d;try{b=z(b);b=Y(a,b);var e=d?Ac():0;return la(b,c,e).bb}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},v:function(a,b,c,d){try{b=z(b);b=Y(a,b);if(0>=d)return-28;var e=S(b).node;if(!e)throw new N(44);if(!e.La.eb)throw new N(28);var g=e.La.eb(e);var h=Math.min(d,gb(g)),q=m[c+h];M(g,C,c,d+1);
|
||||
m[c+h]=q;return h}catch(w){if("undefined"==typeof X||"ErrnoError"!==w.name)throw w;return-w.Pa}},u:function(a){try{return a=z(a),Tb(a),0}catch(b){if("undefined"==typeof X||"ErrnoError"!==b.name)throw b;return-b.Pa}},f:function(a,b){try{return a=z(a),Zb(b,Ub(a))}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},r:function(a,b,c){try{b=z(b);b=Y(a,b);if(c)if(512===c)Tb(b);else return-28;else ta(b);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;
|
||||
return-d.Pa}},q:function(a,b,c){try{b=z(b);b=Y(a,b,!0);var d=Date.now(),e,g;if(c){var h=F[c>>2]+4294967296*E[c+4>>2],q=E[c+8>>2];1073741823==q?e=d:1073741822==q?e=null:e=1E3*h+q/1E6;c+=16;h=F[c>>2]+4294967296*E[c+4>>2];q=E[c+8>>2];1073741823==q?g=d:1073741822==q?g=null:g=1E3*h+q/1E6}else g=e=d;if(null!==(g??e)){a=e;var w=S(b,{hb:!0}).node;Lb(w.La.Xa)(w,{$a:a,Ua:g})}return 0}catch(t){if("undefined"==typeof X||"ErrnoError"!==t.name)throw t;return-t.Pa}},m:()=>Ja(""),l:()=>{Va=!1;Cc=0},A:function(a,
|
||||
b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);E[b>>2]=a.getSeconds();E[b+4>>2]=a.getMinutes();E[b+8>>2]=a.getHours();E[b+12>>2]=a.getDate();E[b+16>>2]=a.getMonth();E[b+20>>2]=a.getFullYear()-1900;E[b+24>>2]=a.getDay();var c=a.getFullYear();E[b+28>>2]=(0!==c%4||0===c%100&&0!==c%400?Ec:Dc)[a.getMonth()]+a.getDate()-1|0;E[b+36>>2]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();
|
||||
E[b+32>>2]=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0},y:function(a,b,c,d,e,g,h){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e);try{var q=T(d);if(0!==(b&2)&&0===(c&2)&&2!==(q.flags&2097155))throw new N(2);if(1===(q.flags&2097155))throw new N(2);if(!q.Ma.sb)throw new N(43);if(!a)throw new N(28);var w=q.Ma.sb(q,a,e,b,c);var t=w.tc;E[g>>2]=w.Ub;F[h>>2]=t;return 0}catch(x){if("undefined"==typeof X||"ErrnoError"!==x.name)throw x;return-x.Pa}},z:function(a,b,c,d,e,g){g=-9007199254740992>g||
|
||||
9007199254740992<g?NaN:Number(g);try{var h=T(e);if(c&2){if(32768!==(h.node.mode&61440))throw new N(43);d&2||h.Ma.tb&&h.Ma.tb(h,C.slice(a,a+b),g,b,d)}}catch(q){if("undefined"==typeof X||"ErrnoError"!==q.name)throw q;return-q.Pa}},n:(a,b)=>{Fc[a]&&(clearTimeout(Fc[a].id),delete Fc[a]);if(!b)return 0;var c=setTimeout(()=>{delete Fc[a];Ic(()=>Sc(a,performance.now()))},b);Fc[a]={id:c,Hc:b};return 0},B:(a,b,c,d)=>{var e=(new Date).getFullYear(),g=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();
|
||||
F[a>>2]=60*Math.max(g,e);E[b>>2]=Number(g!=e);b=h=>{var q=Math.abs(h);return`UTC${0<=h?"-":"+"}${String(Math.floor(q/60)).padStart(2,"0")}${String(q%60).padStart(2,"0")}`};a=b(g);b=b(e);e<g?(M(a,C,c,17),M(b,C,d,17)):(M(a,C,d,17),M(b,C,c,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:a=>{var b=C.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,d)/65536))-Ia.buffer.byteLength+
|
||||
65535)/65536|0;try{Ia.grow(d);Ha();var e=1;break a}catch(g){}e=void 0}if(e)return!0}return!1},E:(a,b)=>{var c=0,d=0,e;for(e of Lc()){var g=b+c;F[a+d>>2]=g;c+=M(e,C,g,Infinity)+1;d+=4}return 0},F:(a,b)=>{var c=Lc();F[a>>2]=c.length;a=0;for(var d of c)a+=gb(d)+1;F[b>>2]=a;return 0},e:function(a){try{var b=T(a);na(b);return 0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return c.Pa}},p:function(a,b){try{var c=T(a);m[b]=c.Va?2:P(c.mode)?3:40960===(c.mode&61440)?7:4;Ea[b+2>>1]=0;G[b+
|
||||
8>>3]=BigInt(0);G[b+16>>3]=BigInt(0);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return d.Pa}},w:function(a,b,c,d){try{a:{var e=T(a);a=b;for(var g,h=b=0;h<c;h++){var q=F[a>>2],w=F[a+4>>2];a+=8;var t=Yb(e,m,q,w,g);if(0>t){var x=-1;break a}b+=t;if(t<w)break;"undefined"!=typeof g&&(g+=t)}x=b}F[d>>2]=x;return 0}catch(D){if("undefined"==typeof X||"ErrnoError"!==D.name)throw D;return D.Pa}},D:function(a,b,c,d){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;
|
||||
var e=T(a);Xb(e,b,c);G[d>>3]=BigInt(e.position);e.Eb&&0===b&&0===c&&(e.Eb=null);return 0}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return g.Pa}},I:function(a){try{var b=T(a);return b.Ma?.lb?.(b)}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return c.Pa}},t:function(a,b,c,d){try{a:{var e=T(a);a=b;for(var g,h=b=0;h<c;h++){var q=F[a>>2],w=F[a+4>>2];a+=8;var t=ma(e,m,q,w,g);if(0>t){var x=-1;break a}b+=t;if(t<w)break;"undefined"!=typeof g&&(g+=t)}x=b}F[d>>2]=x;
|
||||
return 0}catch(D){if("undefined"==typeof X||"ErrnoError"!==D.name)throw D;return D.Pa}},k:Hc};
|
||||
function Uc(){function a(){k.calledRun=!0;if(!Ca){if(!k.noFSInit&&!Db){var b,c;Db=!0;b??=k.stdin;c??=k.stdout;d??=k.stderr;b?W("stdin",b):Sb("/dev/tty","/dev/stdin");c?W("stdout",null,c):Sb("/dev/tty","/dev/stdout");d?W("stderr",null,d):Sb("/dev/tty1","/dev/stderr");la("/dev/stdin",0);la("/dev/stdout",1);la("/dev/stderr",1)}Vc.N();Eb=!1;k.onRuntimeInitialized?.();if(k.postRun)for("function"==typeof k.postRun&&(k.postRun=[k.postRun]);k.postRun.length;){var d=k.postRun.shift();Ra.push(d)}Qa(Ra)}}if(0<
|
||||
J)Ua=Uc;else{if(k.preRun)for("function"==typeof k.preRun&&(k.preRun=[k.preRun]);k.preRun.length;)Ta();Qa(Sa);0<J?Ua=Uc:k.setStatus?(k.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>k.setStatus(""),1);a()},1)):a()}}var Vc;
|
||||
(async function(){function a(c){c=Vc=c.exports;k._sqlite3_free=c.P;k._sqlite3_value_text=c.Q;k._sqlite3_prepare_v2=c.R;k._sqlite3_step=c.S;k._sqlite3_reset=c.T;k._sqlite3_exec=c.U;k._sqlite3_finalize=c.V;k._sqlite3_column_name=c.W;k._sqlite3_column_text=c.X;k._sqlite3_column_type=c.Y;k._sqlite3_errmsg=c.Z;k._sqlite3_clear_bindings=c._;k._sqlite3_value_blob=c.$;k._sqlite3_value_bytes=c.aa;k._sqlite3_value_double=c.ba;k._sqlite3_value_int=c.ca;k._sqlite3_value_type=c.da;k._sqlite3_result_blob=c.ea;
|
||||
k._sqlite3_result_double=c.fa;k._sqlite3_result_error=c.ga;k._sqlite3_result_int=c.ha;k._sqlite3_result_int64=c.ia;k._sqlite3_result_null=c.ja;k._sqlite3_result_text=c.ka;k._sqlite3_aggregate_context=c.la;k._sqlite3_column_count=c.ma;k._sqlite3_data_count=c.na;k._sqlite3_column_blob=c.oa;k._sqlite3_column_bytes=c.pa;k._sqlite3_column_double=c.qa;k._sqlite3_bind_blob=c.ra;k._sqlite3_bind_double=c.sa;k._sqlite3_bind_int=c.ta;k._sqlite3_bind_text=c.ua;k._sqlite3_bind_parameter_index=c.va;k._sqlite3_sql=
|
||||
c.wa;k._sqlite3_normalized_sql=c.xa;k._sqlite3_changes=c.ya;k._sqlite3_close_v2=c.za;k._sqlite3_create_function_v2=c.Aa;k._sqlite3_update_hook=c.Ba;k._sqlite3_open=c.Ca;ca=k._malloc=c.Da;da=k._free=c.Ea;k._RegisterExtensionFunctions=c.Fa;yb=c.Ga;Sc=c.Ha;qa=c.Ia;y=c.Ja;oa=c.Ka;Ia=c.M;Z=c.O;Ha();J--;k.monitorRunDependencies?.(J);0==J&&Ua&&(c=Ua,Ua=null,c());return Vc}J++;k.monitorRunDependencies?.(J);var b={a:Tc};if(k.instantiateWasm)return new Promise(c=>{k.instantiateWasm(b,(d,e)=>{c(a(d,e))})});
|
||||
La??=k.locateFile?k.locateFile("sql-wasm-browser.wasm",xa):xa+"sql-wasm-browser.wasm";return a((await Oa(b)).instance)})();Uc();
|
||||
|
||||
|
||||
// The shell-pre.js and emcc-generated code goes above
|
||||
return Module;
|
||||
}); // The end of the promise being returned
|
||||
|
||||
return initSqlJsPromise;
|
||||
} // The end of our initSqlJs function
|
||||
|
||||
// This bit below is copied almost exactly from what you get when you use the MODULARIZE=1 flag with emcc
|
||||
// However, we don't want to use the emcc modularization. See shell-pre.js
|
||||
if (typeof exports === 'object' && typeof module === 'object'){
|
||||
module.exports = initSqlJs;
|
||||
// This will allow the module to be used in ES6 or CommonJS
|
||||
module.exports.default = initSqlJs;
|
||||
}
|
||||
else if (typeof define === 'function' && define['amd']) {
|
||||
define([], function() { return initSqlJs; });
|
||||
}
|
||||
else if (typeof exports === 'object'){
|
||||
exports["Module"] = initSqlJs;
|
||||
}
|
||||
BIN
node_modules/sql.js/dist/sql-wasm-browser.wasm
generated
vendored
Executable file
BIN
node_modules/sql.js/dist/sql-wasm-browser.wasm
generated
vendored
Executable file
Binary file not shown.
7265
node_modules/sql.js/dist/sql-wasm-debug.js
generated
vendored
Normal file
7265
node_modules/sql.js/dist/sql-wasm-debug.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
node_modules/sql.js/dist/sql-wasm-debug.wasm
generated
vendored
Executable file
BIN
node_modules/sql.js/dist/sql-wasm-debug.wasm
generated
vendored
Executable file
Binary file not shown.
185
node_modules/sql.js/dist/sql-wasm.js
generated
vendored
Normal file
185
node_modules/sql.js/dist/sql-wasm.js
generated
vendored
Normal file
@@ -0,0 +1,185 @@
|
||||
|
||||
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
||||
// https://github.com/kripken/emscripten/issues/5820
|
||||
// In addition, When you use emcc's modularization, it still expects to export a global object called `Module`,
|
||||
// which is able to be used/called before the WASM is loaded.
|
||||
// The modularization below exports a promise that loads and resolves to the actual sql.js module.
|
||||
// That way, this module can't be used before the WASM is finished loading.
|
||||
|
||||
// We are going to define a function that a user will call to start loading initializing our Sql.js library
|
||||
// However, that function might be called multiple times, and on subsequent calls, we don't actually want it to instantiate a new instance of the Module
|
||||
// Instead, we want to return the previously loaded module
|
||||
|
||||
// TODO: Make this not declare a global if used in the browser
|
||||
var initSqlJsPromise = undefined;
|
||||
|
||||
var initSqlJs = function (moduleConfig) {
|
||||
|
||||
if (initSqlJsPromise){
|
||||
return initSqlJsPromise;
|
||||
}
|
||||
// If we're here, we've never called this function before
|
||||
initSqlJsPromise = new Promise(function (resolveModule, reject) {
|
||||
|
||||
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
||||
// https://github.com/kripken/emscripten/issues/5820
|
||||
|
||||
// The way to affect the loading of emcc compiled modules is to create a variable called `Module` and add
|
||||
// properties to it, like `preRun`, `postRun`, etc
|
||||
// We are using that to get notified when the WASM has finished loading.
|
||||
// Only then will we return our promise
|
||||
|
||||
// If they passed in a moduleConfig object, use that
|
||||
// Otherwise, initialize Module to the empty object
|
||||
var Module = typeof moduleConfig !== 'undefined' ? moduleConfig : {};
|
||||
|
||||
// EMCC only allows for a single onAbort function (not an array of functions)
|
||||
// So if the user defined their own onAbort function, we remember it and call it
|
||||
var originalOnAbortFunction = Module['onAbort'];
|
||||
Module['onAbort'] = function (errorThatCausedAbort) {
|
||||
reject(new Error(errorThatCausedAbort));
|
||||
if (originalOnAbortFunction){
|
||||
originalOnAbortFunction(errorThatCausedAbort);
|
||||
}
|
||||
};
|
||||
|
||||
Module['postRun'] = Module['postRun'] || [];
|
||||
Module['postRun'].push(function () {
|
||||
// When Emscripted calls postRun, this promise resolves with the built Module
|
||||
resolveModule(Module);
|
||||
});
|
||||
|
||||
// There is a section of code in the emcc-generated code below that looks like this:
|
||||
// (Note that this is lowercase `module`)
|
||||
// if (typeof module !== 'undefined') {
|
||||
// module['exports'] = Module;
|
||||
// }
|
||||
// When that runs, it's going to overwrite our own modularization export efforts in shell-post.js!
|
||||
// The only way to tell emcc not to emit it is to pass the MODULARIZE=1 or MODULARIZE_INSTANCE=1 flags,
|
||||
// but that carries with it additional unnecessary baggage/bugs we don't want either.
|
||||
// So, we have three options:
|
||||
// 1) We undefine `module`
|
||||
// 2) We remember what `module['exports']` was at the beginning of this function and we restore it later
|
||||
// 3) We write a script to remove those lines of code as part of the Make process.
|
||||
//
|
||||
// Since those are the only lines of code that care about module, we will undefine it. It's the most straightforward
|
||||
// of the options, and has the side effect of reducing emcc's efforts to modify the module if its output were to change in the future.
|
||||
// That's a nice side effect since we're handling the modularization efforts ourselves
|
||||
module = undefined;
|
||||
|
||||
// The emcc-generated code and shell-post.js code goes below,
|
||||
// meaning that all of it runs inside of this promise. If anything throws an exception, our promise will abort
|
||||
var k;k||=typeof Module != 'undefined' ? Module : {};var aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope,ca=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;
|
||||
k.onRuntimeInitialized=function(){function a(f,l){switch(typeof l){case "boolean":bc(f,l?1:0);break;case "number":cc(f,l);break;case "string":dc(f,l,-1,-1);break;case "object":if(null===l)lb(f);else if(null!=l.length){var n=da(l.length);m.set(l,n);ec(f,n,l.length,-1);ea(n)}else sa(f,"Wrong API use : tried to return a value of an unknown type ("+l+").",-1);break;default:lb(f)}}function b(f,l){for(var n=[],p=0;p<f;p+=1){var u=r(l+4*p,"i32"),v=fc(u);if(1===v||2===v)u=gc(u);else if(3===v)u=hc(u);else if(4===
|
||||
v){v=u;u=ic(v);v=jc(v);for(var K=new Uint8Array(u),I=0;I<u;I+=1)K[I]=m[v+I];u=K}else u=null;n.push(u)}return n}function c(f,l){this.Qa=f;this.db=l;this.Oa=1;this.mb=[]}function d(f,l){this.db=l;this.fb=fa(f);if(null===this.fb)throw Error("Unable to allocate memory for the SQL string");this.lb=this.fb;this.$a=this.sb=null}function e(f){this.filename="dbfile_"+(4294967295*Math.random()>>>0);if(null!=f){var l=this.filename,n="/",p=l;n&&(n="string"==typeof n?n:ha(n),p=l?ia(n+"/"+l):n);l=ja(!0,!0);p=ka(p,
|
||||
l);if(f){if("string"==typeof f){n=Array(f.length);for(var u=0,v=f.length;u<v;++u)n[u]=f.charCodeAt(u);f=n}la(p,l|146);n=ma(p,577);na(n,f,0,f.length,0);oa(n);la(p,l)}}this.handleError(q(this.filename,g));this.db=r(g,"i32");ob(this.db);this.gb={};this.Sa={}}var g=y(4),h=k.cwrap,q=h("sqlite3_open","number",["string","number"]),w=h("sqlite3_close_v2","number",["number"]),t=h("sqlite3_exec","number",["number","string","number","number","number"]),x=h("sqlite3_changes","number",["number"]),D=h("sqlite3_prepare_v2",
|
||||
"number",["number","string","number","number","number"]),pb=h("sqlite3_sql","string",["number"]),lc=h("sqlite3_normalized_sql","string",["number"]),qb=h("sqlite3_prepare_v2","number",["number","number","number","number","number"]),mc=h("sqlite3_bind_text","number",["number","number","number","number","number"]),rb=h("sqlite3_bind_blob","number",["number","number","number","number","number"]),nc=h("sqlite3_bind_double","number",["number","number","number"]),oc=h("sqlite3_bind_int","number",["number",
|
||||
"number","number"]),pc=h("sqlite3_bind_parameter_index","number",["number","string"]),qc=h("sqlite3_step","number",["number"]),rc=h("sqlite3_errmsg","string",["number"]),sc=h("sqlite3_column_count","number",["number"]),tc=h("sqlite3_data_count","number",["number"]),uc=h("sqlite3_column_double","number",["number","number"]),sb=h("sqlite3_column_text","string",["number","number"]),vc=h("sqlite3_column_blob","number",["number","number"]),wc=h("sqlite3_column_bytes","number",["number","number"]),xc=h("sqlite3_column_type",
|
||||
"number",["number","number"]),yc=h("sqlite3_column_name","string",["number","number"]),zc=h("sqlite3_reset","number",["number"]),Ac=h("sqlite3_clear_bindings","number",["number"]),Bc=h("sqlite3_finalize","number",["number"]),tb=h("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),fc=h("sqlite3_value_type","number",["number"]),ic=h("sqlite3_value_bytes","number",["number"]),hc=h("sqlite3_value_text","string",["number"]),jc=h("sqlite3_value_blob",
|
||||
"number",["number"]),gc=h("sqlite3_value_double","number",["number"]),cc=h("sqlite3_result_double","",["number","number"]),lb=h("sqlite3_result_null","",["number"]),dc=h("sqlite3_result_text","",["number","string","number","number"]),ec=h("sqlite3_result_blob","",["number","number","number","number"]),bc=h("sqlite3_result_int","",["number","number"]),sa=h("sqlite3_result_error","",["number","string","number"]),ub=h("sqlite3_aggregate_context","number",["number","number"]),ob=h("RegisterExtensionFunctions",
|
||||
"number",["number"]),vb=h("sqlite3_update_hook","number",["number","number","number"]);c.prototype.bind=function(f){if(!this.Qa)throw"Statement closed";this.reset();return Array.isArray(f)?this.Gb(f):null!=f&&"object"===typeof f?this.Hb(f):!0};c.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var f=qc(this.Qa);switch(f){case 100:return!0;case 101:return!1;default:throw this.db.handleError(f);}};c.prototype.Ab=function(f){null==f&&(f=this.Oa,this.Oa+=1);return uc(this.Qa,f)};
|
||||
c.prototype.Ob=function(f){null==f&&(f=this.Oa,this.Oa+=1);f=sb(this.Qa,f);if("function"!==typeof BigInt)throw Error("BigInt is not supported");return BigInt(f)};c.prototype.Tb=function(f){null==f&&(f=this.Oa,this.Oa+=1);return sb(this.Qa,f)};c.prototype.getBlob=function(f){null==f&&(f=this.Oa,this.Oa+=1);var l=wc(this.Qa,f);f=vc(this.Qa,f);for(var n=new Uint8Array(l),p=0;p<l;p+=1)n[p]=m[f+p];return n};c.prototype.get=function(f,l){l=l||{};null!=f&&this.bind(f)&&this.step();f=[];for(var n=tc(this.Qa),
|
||||
p=0;p<n;p+=1)switch(xc(this.Qa,p)){case 1:var u=l.useBigInt?this.Ob(p):this.Ab(p);f.push(u);break;case 2:f.push(this.Ab(p));break;case 3:f.push(this.Tb(p));break;case 4:f.push(this.getBlob(p));break;default:f.push(null)}return f};c.prototype.qb=function(){for(var f=[],l=sc(this.Qa),n=0;n<l;n+=1)f.push(yc(this.Qa,n));return f};c.prototype.zb=function(f,l){f=this.get(f,l);l=this.qb();for(var n={},p=0;p<l.length;p+=1)n[l[p]]=f[p];return n};c.prototype.Sb=function(){return pb(this.Qa)};c.prototype.Pb=
|
||||
function(){return lc(this.Qa)};c.prototype.run=function(f){null!=f&&this.bind(f);this.step();return this.reset()};c.prototype.wb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);f=fa(f);this.mb.push(f);this.db.handleError(mc(this.Qa,l,f,-1,0))};c.prototype.Fb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);var n=da(f.length);m.set(f,n);this.mb.push(n);this.db.handleError(rb(this.Qa,l,n,f.length,0))};c.prototype.vb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);this.db.handleError((f===(f|0)?oc:nc)(this.Qa,
|
||||
l,f))};c.prototype.Ib=function(f){null==f&&(f=this.Oa,this.Oa+=1);rb(this.Qa,f,0,0,0)};c.prototype.xb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);switch(typeof f){case "string":this.wb(f,l);return;case "number":this.vb(f,l);return;case "bigint":this.wb(f.toString(),l);return;case "boolean":this.vb(f+0,l);return;case "object":if(null===f){this.Ib(l);return}if(null!=f.length){this.Fb(f,l);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+f+").";};c.prototype.Hb=function(f){var l=
|
||||
this;Object.keys(f).forEach(function(n){var p=pc(l.Qa,n);0!==p&&l.xb(f[n],p)});return!0};c.prototype.Gb=function(f){for(var l=0;l<f.length;l+=1)this.xb(f[l],l+1);return!0};c.prototype.reset=function(){this.freemem();return 0===Ac(this.Qa)&&0===zc(this.Qa)};c.prototype.freemem=function(){for(var f;void 0!==(f=this.mb.pop());)ea(f)};c.prototype.Ya=function(){this.freemem();var f=0===Bc(this.Qa);delete this.db.gb[this.Qa];this.Qa=0;return f};d.prototype.next=function(){if(null===this.fb)return{done:!0};
|
||||
null!==this.$a&&(this.$a.Ya(),this.$a=null);if(!this.db.db)throw this.ob(),Error("Database closed");var f=pa(),l=y(4);qa(g);qa(l);try{this.db.handleError(qb(this.db.db,this.lb,-1,g,l));this.lb=r(l,"i32");var n=r(g,"i32");if(0===n)return this.ob(),{done:!0};this.$a=new c(n,this.db);this.db.gb[n]=this.$a;return{value:this.$a,done:!1}}catch(p){throw this.sb=z(this.lb),this.ob(),p;}finally{ra(f)}};d.prototype.ob=function(){ea(this.fb);this.fb=null};d.prototype.Qb=function(){return null!==this.sb?this.sb:
|
||||
z(this.lb)};"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator&&(d.prototype[Symbol.iterator]=function(){return this});e.prototype.run=function(f,l){if(!this.db)throw"Database closed";if(l){f=this.tb(f,l);try{f.step()}finally{f.Ya()}}else this.handleError(t(this.db,f,0,0,g));return this};e.prototype.exec=function(f,l,n){if(!this.db)throw"Database closed";var p=null,u=null,v=null;try{v=u=fa(f);var K=y(4);for(f=[];0!==r(v,"i8");){qa(g);qa(K);this.handleError(qb(this.db,v,-1,g,K));var I=r(g,
|
||||
"i32");v=r(K,"i32");if(0!==I){var H=null;p=new c(I,this);for(null!=l&&p.bind(l);p.step();)null===H&&(H={columns:p.qb(),values:[]},f.push(H)),H.values.push(p.get(null,n));p.Ya()}}return f}catch(L){throw p&&p.Ya(),L;}finally{u&&ea(u)}};e.prototype.Mb=function(f,l,n,p,u){"function"===typeof l&&(p=n,n=l,l=void 0);f=this.tb(f,l);try{for(;f.step();)n(f.zb(null,u))}finally{f.Ya()}if("function"===typeof p)return p()};e.prototype.tb=function(f,l){qa(g);this.handleError(D(this.db,f,-1,g,0));f=r(g,"i32");if(0===
|
||||
f)throw"Nothing to prepare";var n=new c(f,this);null!=l&&n.bind(l);return this.gb[f]=n};e.prototype.Ub=function(f){return new d(f,this)};e.prototype.Nb=function(){Object.values(this.gb).forEach(function(l){l.Ya()});Object.values(this.Sa).forEach(A);this.Sa={};this.handleError(w(this.db));var f=ta(this.filename);this.handleError(q(this.filename,g));this.db=r(g,"i32");ob(this.db);return f};e.prototype.close=function(){null!==this.db&&(Object.values(this.gb).forEach(function(f){f.Ya()}),Object.values(this.Sa).forEach(A),
|
||||
this.Sa={},this.Za&&(A(this.Za),this.Za=void 0),this.handleError(w(this.db)),ua("/"+this.filename),this.db=null)};e.prototype.handleError=function(f){if(0===f)return null;f=rc(this.db);throw Error(f);};e.prototype.Rb=function(){return x(this.db)};e.prototype.Kb=function(f,l){Object.prototype.hasOwnProperty.call(this.Sa,f)&&(A(this.Sa[f]),delete this.Sa[f]);var n=va(function(p,u,v){u=b(u,v);try{var K=l.apply(null,u)}catch(I){sa(p,I,-1);return}a(p,K)},"viii");this.Sa[f]=n;this.handleError(tb(this.db,
|
||||
f,l.length,1,0,n,0,0,0));return this};e.prototype.Jb=function(f,l){var n=l.init||function(){return null},p=l.finalize||function(H){return H},u=l.step;if(!u)throw"An aggregate function must have a step function in "+f;var v={};Object.hasOwnProperty.call(this.Sa,f)&&(A(this.Sa[f]),delete this.Sa[f]);l=f+"__finalize";Object.hasOwnProperty.call(this.Sa,l)&&(A(this.Sa[l]),delete this.Sa[l]);var K=va(function(H,L,Pa){var V=ub(H,1);Object.hasOwnProperty.call(v,V)||(v[V]=n());L=b(L,Pa);L=[v[V]].concat(L);
|
||||
try{v[V]=u.apply(null,L)}catch(Dc){delete v[V],sa(H,Dc,-1)}},"viii"),I=va(function(H){var L=ub(H,1);try{var Pa=p(v[L])}catch(V){delete v[L];sa(H,V,-1);return}a(H,Pa);delete v[L]},"vi");this.Sa[f]=K;this.Sa[l]=I;this.handleError(tb(this.db,f,u.length-1,1,0,0,K,I,0));return this};e.prototype.Zb=function(f){this.Za&&(vb(this.db,0,0),A(this.Za),this.Za=void 0);if(!f)return this;this.Za=va(function(l,n,p,u,v){switch(n){case 18:l="insert";break;case 23:l="update";break;case 9:l="delete";break;default:throw"unknown operationCode in updateHook callback: "+
|
||||
n;}p=z(p);u=z(u);if(v>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";f(l,p,u,Number(v))},"viiiij");vb(this.db,this.Za,0);return this};c.prototype.bind=c.prototype.bind;c.prototype.step=c.prototype.step;c.prototype.get=c.prototype.get;c.prototype.getColumnNames=c.prototype.qb;c.prototype.getAsObject=c.prototype.zb;c.prototype.getSQL=c.prototype.Sb;c.prototype.getNormalizedSQL=c.prototype.Pb;c.prototype.run=c.prototype.run;c.prototype.reset=c.prototype.reset;c.prototype.freemem=
|
||||
c.prototype.freemem;c.prototype.free=c.prototype.Ya;d.prototype.next=d.prototype.next;d.prototype.getRemainingSQL=d.prototype.Qb;e.prototype.run=e.prototype.run;e.prototype.exec=e.prototype.exec;e.prototype.each=e.prototype.Mb;e.prototype.prepare=e.prototype.tb;e.prototype.iterateStatements=e.prototype.Ub;e.prototype["export"]=e.prototype.Nb;e.prototype.close=e.prototype.close;e.prototype.handleError=e.prototype.handleError;e.prototype.getRowsModified=e.prototype.Rb;e.prototype.create_function=e.prototype.Kb;
|
||||
e.prototype.create_aggregate=e.prototype.Jb;e.prototype.updateHook=e.prototype.Zb;k.Database=e};var wa="./this.program",xa=(a,b)=>{throw b;},ya=globalThis.document?.currentScript?.src;"undefined"!=typeof __filename?ya=__filename:ba&&(ya=self.location.href);var za="",Aa,Ba;
|
||||
if(ca){var fs=require("node:fs");za=__dirname+"/";Ba=a=>{a=Ca(a)?new URL(a):a;return fs.readFileSync(a)};Aa=async a=>{a=Ca(a)?new URL(a):a;return fs.readFileSync(a,void 0)};1<process.argv.length&&(wa=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);"undefined"!=typeof module&&(module.exports=k);xa=(a,b)=>{process.exitCode=a;throw b;}}else if(aa||ba){try{za=(new URL(".",ya)).href}catch{}ba&&(Ba=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)});
|
||||
Aa=async a=>{if(Ca(a))return new Promise((c,d)=>{var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?c(e.response):d(e.status)};e.onerror=d;e.send(null)});var b=await fetch(a,{credentials:"same-origin"});if(b.ok)return b.arrayBuffer();throw Error(b.status+" : "+b.url);}}var Da=console.log.bind(console),B=console.error.bind(console),Ea,Fa=!1,Ga,Ca=a=>a.startsWith("file://"),m,C,Ha,E,F,Ia,Ja,G;
|
||||
function Ka(){var a=La.buffer;m=new Int8Array(a);Ha=new Int16Array(a);C=new Uint8Array(a);new Uint16Array(a);E=new Int32Array(a);F=new Uint32Array(a);Ia=new Float32Array(a);Ja=new Float64Array(a);G=new BigInt64Array(a);new BigUint64Array(a)}function Ma(a){k.onAbort?.(a);a="Aborted("+a+")";B(a);Fa=!0;throw new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");}var Na;
|
||||
async function Oa(a){if(!Ea)try{var b=await Aa(a);return new Uint8Array(b)}catch{}if(a==Na&&Ea)a=new Uint8Array(Ea);else if(Ba)a=Ba(a);else throw"both async and sync fetching of the wasm failed";return a}async function Qa(a,b){try{var c=await Oa(a);return await WebAssembly.instantiate(c,b)}catch(d){B(`failed to asynchronously prepare wasm: ${d}`),Ma(d)}}
|
||||
async function Ra(a){var b=Na;if(!Ea&&!Ca(b)&&!ca)try{var c=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,a)}catch(d){B(`wasm streaming compile failed: ${d}`),B("falling back to ArrayBuffer instantiation")}return Qa(b,a)}class Sa{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}var Ta=a=>{for(;0<a.length;)a.shift()(k)},Ua=[],Va=[],Wa=()=>{var a=k.preRun.shift();Va.push(a)},J=0,Xa=null;
|
||||
function r(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return m[a];case "i8":return m[a];case "i16":return Ha[a>>1];case "i32":return E[a>>2];case "i64":return G[a>>3];case "float":return Ia[a>>2];case "double":return Ja[a>>3];case "*":return F[a>>2];default:Ma(`invalid type for getValue: ${b}`)}}var Ya=!0;
|
||||
function qa(a){var b="i32";b.endsWith("*")&&(b="*");switch(b){case "i1":m[a]=0;break;case "i8":m[a]=0;break;case "i16":Ha[a>>1]=0;break;case "i32":E[a>>2]=0;break;case "i64":G[a>>3]=BigInt(0);break;case "float":Ia[a>>2]=0;break;case "double":Ja[a>>3]=0;break;case "*":F[a>>2]=0;break;default:Ma(`invalid type for setValue: ${b}`)}}
|
||||
var Za=new TextDecoder,$a=(a,b,c,d)=>{c=b+c;if(d)return c;for(;a[b]&&!(b>=c);)++b;return b},z=(a,b,c)=>a?Za.decode(C.subarray(a,$a(C,a,b,c))):"",ab=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},ia=a=>{var b="/"===a.charAt(0),c="/"===a.slice(-1);(a=ab(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},bb=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
|
||||
a=b[0];b=b[1];if(!a&&!b)return".";b&&=b.slice(0,-1);return a+b},cb=a=>a&&a.match(/([^\/]+|\/)\/*$/)[1],db=()=>{if(ca){var a=require("node:crypto");return b=>a.randomFillSync(b)}return b=>crypto.getRandomValues(b)},eb=a=>{(eb=db())(a)},fb=(...a)=>{for(var b="",c=!1,d=a.length-1;-1<=d&&!c;d--){c=0<=d?a[d]:"/";if("string"!=typeof c)throw new TypeError("Arguments to path.resolve must be strings");if(!c)return"";b=c+"/"+b;c="/"===c.charAt(0)}b=ab(b.split("/").filter(e=>!!e),!c).join("/");return(c?"/":
|
||||
"")+b||"."},gb=a=>{var b=$a(a,0);return Za.decode(a.buffer?a.subarray(0,b):new Uint8Array(a.slice(0,b)))},hb=[],ib=a=>{for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);127>=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b},M=(a,b,c,d)=>{if(!(0<d))return 0;var e=c;d=c+d-1;for(var g=0;g<a.length;++g){var h=a.codePointAt(g);if(127>=h){if(c>=d)break;b[c++]=h}else if(2047>=h){if(c+1>=d)break;b[c++]=192|h>>6;b[c++]=128|h&63}else if(65535>=h){if(c+2>=d)break;b[c++]=224|h>>12;b[c++]=128|
|
||||
h>>6&63;b[c++]=128|h&63}else{if(c+3>=d)break;b[c++]=240|h>>18;b[c++]=128|h>>12&63;b[c++]=128|h>>6&63;b[c++]=128|h&63;g++}}b[c]=0;return c-e},jb=[];function kb(a,b){jb[a]={input:[],output:[],eb:b};mb(a,nb)}
|
||||
var nb={open(a){var b=jb[a.node.rdev];if(!b)throw new N(43);a.tty=b;a.seekable=!1},close(a){a.tty.eb.fsync(a.tty)},fsync(a){a.tty.eb.fsync(a.tty)},read(a,b,c,d){if(!a.tty||!a.tty.eb.Bb)throw new N(60);for(var e=0,g=0;g<d;g++){try{var h=a.tty.eb.Bb(a.tty)}catch(q){throw new N(29);}if(void 0===h&&0===e)throw new N(6);if(null===h||void 0===h)break;e++;b[c+g]=h}e&&(a.node.atime=Date.now());return e},write(a,b,c,d){if(!a.tty||!a.tty.eb.ub)throw new N(60);try{for(var e=0;e<d;e++)a.tty.eb.ub(a.tty,b[c+e])}catch(g){throw new N(29);
|
||||
}d&&(a.node.mtime=a.node.ctime=Date.now());return e}},wb={Bb(){a:{if(!hb.length){var a=null;if(ca){var b=Buffer.alloc(256),c=0,d=process.stdin.fd;try{c=fs.readSync(d,b,0,256)}catch(e){if(e.toString().includes("EOF"))c=0;else throw e;}0<c&&(a=b.slice(0,c).toString("utf-8"))}else globalThis.window?.prompt&&(a=window.prompt("Input: "),null!==a&&(a+="\n"));if(!a){a=null;break a}b=Array(ib(a)+1);a=M(a,b,0,b.length);b.length=a;hb=b}a=hb.shift()}return a},ub(a,b){null===b||10===b?(Da(gb(a.output)),a.output=
|
||||
[]):0!=b&&a.output.push(b)},fsync(a){0<a.output?.length&&(Da(gb(a.output)),a.output=[])},hc(){return{bc:25856,dc:5,ac:191,cc:35387,$b:[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]}},ic(){return 0},jc(){return[24,80]}},xb={ub(a,b){null===b||10===b?(B(gb(a.output)),a.output=[]):0!=b&&a.output.push(b)},fsync(a){0<a.output?.length&&(B(gb(a.output)),a.output=[])}},O={Wa:null,Xa(){return O.createNode(null,"/",16895,0)},createNode(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new N(63);
|
||||
O.Wa||(O.Wa={dir:{node:{Ta:O.La.Ta,Ua:O.La.Ua,lookup:O.La.lookup,ib:O.La.ib,rename:O.La.rename,unlink:O.La.unlink,rmdir:O.La.rmdir,readdir:O.La.readdir,symlink:O.La.symlink},stream:{Va:O.Ma.Va}},file:{node:{Ta:O.La.Ta,Ua:O.La.Ua},stream:{Va:O.Ma.Va,read:O.Ma.read,write:O.Ma.write,jb:O.Ma.jb,kb:O.Ma.kb}},link:{node:{Ta:O.La.Ta,Ua:O.La.Ua,readlink:O.La.readlink},stream:{}},yb:{node:{Ta:O.La.Ta,Ua:O.La.Ua},stream:yb}});c=zb(a,b,c,d);P(c.mode)?(c.La=O.Wa.dir.node,c.Ma=O.Wa.dir.stream,c.Na={}):32768===
|
||||
(c.mode&61440)?(c.La=O.Wa.file.node,c.Ma=O.Wa.file.stream,c.Ra=0,c.Na=null):40960===(c.mode&61440)?(c.La=O.Wa.link.node,c.Ma=O.Wa.link.stream):8192===(c.mode&61440)&&(c.La=O.Wa.yb.node,c.Ma=O.Wa.yb.stream);c.atime=c.mtime=c.ctime=Date.now();a&&(a.Na[b]=c,a.atime=a.mtime=a.ctime=c.atime);return c},fc(a){return a.Na?a.Na.subarray?a.Na.subarray(0,a.Ra):new Uint8Array(a.Na):new Uint8Array(0)},La:{Ta(a){var b={};b.dev=8192===(a.mode&61440)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=1;b.uid=0;b.gid=0;b.rdev=
|
||||
a.rdev;P(a.mode)?b.size=4096:32768===(a.mode&61440)?b.size=a.Ra:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.atime=new Date(a.atime);b.mtime=new Date(a.mtime);b.ctime=new Date(a.ctime);b.blksize=4096;b.blocks=Math.ceil(b.size/b.blksize);return b},Ua(a,b){for(var c of["mode","atime","mtime","ctime"])null!=b[c]&&(a[c]=b[c]);void 0!==b.size&&(b=b.size,a.Ra!=b&&(0==b?(a.Na=null,a.Ra=0):(c=a.Na,a.Na=new Uint8Array(b),c&&a.Na.set(c.subarray(0,Math.min(b,a.Ra))),a.Ra=b)))},lookup(){O.nb||(O.nb=
|
||||
new N(44),O.nb.stack="<generic error, no stack>");throw O.nb;},ib(a,b,c,d){return O.createNode(a,b,c,d)},rename(a,b,c){try{var d=Q(b,c)}catch(g){}if(d){if(P(a.mode))for(var e in d.Na)throw new N(55);Ab(d)}delete a.parent.Na[a.name];b.Na[c]=a;a.name=c;b.ctime=b.mtime=a.parent.ctime=a.parent.mtime=Date.now()},unlink(a,b){delete a.Na[b];a.ctime=a.mtime=Date.now()},rmdir(a,b){var c=Q(a,b),d;for(d in c.Na)throw new N(55);delete a.Na[b];a.ctime=a.mtime=Date.now()},readdir(a){return[".","..",...Object.keys(a.Na)]},
|
||||
symlink(a,b,c){a=O.createNode(a,b,41471,0);a.link=c;return a},readlink(a){if(40960!==(a.mode&61440))throw new N(28);return a.link}},Ma:{read(a,b,c,d,e){var g=a.node.Na;if(e>=a.node.Ra)return 0;a=Math.min(a.node.Ra-e,d);if(8<a&&g.subarray)b.set(g.subarray(e,e+a),c);else for(d=0;d<a;d++)b[c+d]=g[e+d];return a},write(a,b,c,d,e,g){b.buffer===m.buffer&&(g=!1);if(!d)return 0;a=a.node;a.mtime=a.ctime=Date.now();if(b.subarray&&(!a.Na||a.Na.subarray)){if(g)return a.Na=b.subarray(c,c+d),a.Ra=d;if(0===a.Ra&&
|
||||
0===e)return a.Na=b.slice(c,c+d),a.Ra=d;if(e+d<=a.Ra)return a.Na.set(b.subarray(c,c+d),e),d}g=e+d;var h=a.Na?a.Na.length:0;h>=g||(g=Math.max(g,h*(1048576>h?2:1.125)>>>0),0!=h&&(g=Math.max(g,256)),h=a.Na,a.Na=new Uint8Array(g),0<a.Ra&&a.Na.set(h.subarray(0,a.Ra),0));if(a.Na.subarray&&b.subarray)a.Na.set(b.subarray(c,c+d),e);else for(g=0;g<d;g++)a.Na[e+g]=b[c+g];a.Ra=Math.max(a.Ra,e+d);return d},Va(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.Ra);if(0>b)throw new N(28);
|
||||
return b},jb(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new N(43);a=a.node.Na;if(e&2||!a||a.buffer!==m.buffer){e=!0;d=65536*Math.ceil(b/65536);var g=Bb(65536,d);g&&C.fill(0,g,g+d);d=g;if(!d)throw new N(48);if(a){if(0<c||c+b<a.length)a.subarray?a=a.subarray(c,c+b):a=Array.prototype.slice.call(a,c,c+b);m.set(a,d)}}else e=!1,d=a.byteOffset;return{Xb:d,Eb:e}},kb(a,b,c,d){O.Ma.write(a,b,0,d,c,!1);return 0}}},ja=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},Cb=null,Db={},Eb=[],Fb=1,R=null,Gb=!1,
|
||||
Hb=!0,N=class{name="ErrnoError";constructor(a){this.Pa=a}},Ib=class{hb={};node=null;get flags(){return this.hb.flags}set flags(a){this.hb.flags=a}get position(){return this.hb.position}set position(a){this.hb.position=a}},Jb=class{La={};Ma={};bb=null;constructor(a,b,c,d){a||=this;this.parent=a;this.Xa=a.Xa;this.id=Fb++;this.name=b;this.mode=c;this.rdev=d;this.atime=this.mtime=this.ctime=Date.now()}get read(){return 365===(this.mode&365)}set read(a){a?this.mode|=365:this.mode&=-366}get write(){return 146===
|
||||
(this.mode&146)}set write(a){a?this.mode|=146:this.mode&=-147}};
|
||||
function S(a,b={}){if(!a)throw new N(44);b.pb??(b.pb=!0);"/"===a.charAt(0)||(a="//"+a);var c=0;a:for(;40>c;c++){a=a.split("/").filter(q=>!!q);for(var d=Cb,e="/",g=0;g<a.length;g++){var h=g===a.length-1;if(h&&b.parent)break;if("."!==a[g])if(".."===a[g])if(e=bb(e),d===d.parent){a=e+"/"+a.slice(g+1).join("/");c--;continue a}else d=d.parent;else{e=ia(e+"/"+a[g]);try{d=Q(d,a[g])}catch(q){if(44===q?.Pa&&h&&b.Wb)return{path:e};throw q;}!d.bb||h&&!b.pb||(d=d.bb.root);if(40960===(d.mode&61440)&&(!h||b.ab)){if(!d.La.readlink)throw new N(52);
|
||||
d=d.La.readlink(d);"/"===d.charAt(0)||(d=bb(e)+"/"+d);a=d+"/"+a.slice(g+1).join("/");continue a}}}return{path:e,node:d}}throw new N(32);}function ha(a){for(var b;;){if(a===a.parent)return a=a.Xa.Db,b?"/"!==a[a.length-1]?`${a}/${b}`:a+b:a;b=b?`${a.name}/${b}`:a.name;a=a.parent}}function Kb(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%R.length}
|
||||
function Ab(a){var b=Kb(a.parent.id,a.name);if(R[b]===a)R[b]=a.cb;else for(b=R[b];b;){if(b.cb===a){b.cb=a.cb;break}b=b.cb}}function Q(a,b){var c=P(a.mode)?(c=Lb(a,"x"))?c:a.La.lookup?0:2:54;if(c)throw new N(c);for(c=R[Kb(a.id,b)];c;c=c.cb){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.La.lookup(a,b)}function zb(a,b,c,d){a=new Jb(a,b,c,d);b=Kb(a.parent.id,a.name);a.cb=R[b];return R[b]=a}function P(a){return 16384===(a&61440)}
|
||||
function Lb(a,b){return Hb?0:b.includes("r")&&!(a.mode&292)||b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73)?2:0}function Mb(a,b){if(!P(a.mode))return 54;try{return Q(a,b),20}catch(c){}return Lb(a,"wx")}function Nb(a,b,c){try{var d=Q(a,b)}catch(e){return e.Pa}if(a=Lb(a,"wx"))return a;if(c){if(!P(d.mode))return 54;if(d===d.parent||"/"===ha(d))return 10}else if(P(d.mode))return 31;return 0}function Ob(a){if(!a)throw new N(63);return a}
|
||||
function T(a){a=Eb[a];if(!a)throw new N(8);return a}function Pb(a,b=-1){a=Object.assign(new Ib,a);if(-1==b)a:{for(b=0;4096>=b;b++)if(!Eb[b])break a;throw new N(33);}a.fd=b;return Eb[b]=a}function Qb(a,b=-1){a=Pb(a,b);a.Ma?.ec?.(a);return a}function Rb(a,b,c){var d=a?.Ma.Ua;a=d?a:b;d??=b.La.Ua;Ob(d);d(a,c)}var yb={open(a){a.Ma=Db[a.node.rdev].Ma;a.Ma.open?.(a)},Va(){throw new N(70);}};function mb(a,b){Db[a]={Ma:b}}
|
||||
function Sb(a,b){var c="/"===b;if(c&&Cb)throw new N(10);if(!c&&b){var d=S(b,{pb:!1});b=d.path;d=d.node;if(d.bb)throw new N(10);if(!P(d.mode))throw new N(54);}b={type:a,kc:{},Db:b,Vb:[]};a=a.Xa(b);a.Xa=b;b.root=a;c?Cb=a:d&&(d.bb=b,d.Xa&&d.Xa.Vb.push(b))}function Tb(a,b,c){var d=S(a,{parent:!0}).node;a=cb(a);if(!a)throw new N(28);if("."===a||".."===a)throw new N(20);var e=Mb(d,a);if(e)throw new N(e);if(!d.La.ib)throw new N(63);return d.La.ib(d,a,b,c)}
|
||||
function ka(a,b=438){return Tb(a,b&4095|32768,0)}function U(a,b=511){return Tb(a,b&1023|16384,0)}function Ub(a,b,c){"undefined"==typeof c&&(c=b,b=438);Tb(a,b|8192,c)}function Vb(a,b){if(!fb(a))throw new N(44);var c=S(b,{parent:!0}).node;if(!c)throw new N(44);b=cb(b);var d=Mb(c,b);if(d)throw new N(d);if(!c.La.symlink)throw new N(63);c.La.symlink(c,b,a)}
|
||||
function Wb(a){var b=S(a,{parent:!0}).node;a=cb(a);var c=Q(b,a),d=Nb(b,a,!0);if(d)throw new N(d);if(!b.La.rmdir)throw new N(63);if(c.bb)throw new N(10);b.La.rmdir(b,a);Ab(c)}function ua(a){var b=S(a,{parent:!0}).node;if(!b)throw new N(44);a=cb(a);var c=Q(b,a),d=Nb(b,a,!1);if(d)throw new N(d);if(!b.La.unlink)throw new N(63);if(c.bb)throw new N(10);b.La.unlink(b,a);Ab(c)}function Xb(a,b){a=S(a,{ab:!b}).node;return Ob(a.La.Ta)(a)}
|
||||
function Yb(a,b,c,d){Rb(a,b,{mode:c&4095|b.mode&-4096,ctime:Date.now(),Lb:d})}function la(a,b){a="string"==typeof a?S(a,{ab:!0}).node:a;Yb(null,a,b)}function Zb(a,b,c){if(P(b.mode))throw new N(31);if(32768!==(b.mode&61440))throw new N(28);var d=Lb(b,"w");if(d)throw new N(d);Rb(a,b,{size:c,timestamp:Date.now()})}
|
||||
function ma(a,b,c=438){if(""===a)throw new N(44);if("string"==typeof b){var d={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if("undefined"==typeof d)throw Error(`Unknown file open mode: ${b}`);b=d}c=b&64?c&4095|32768:0;if("object"==typeof a)d=a;else{var e=a.endsWith("/");var g=S(a,{ab:!(b&131072),Wb:!0});d=g.node;a=g.path}g=!1;if(b&64)if(d){if(b&128)throw new N(20);}else{if(e)throw new N(31);d=Tb(a,c|511,0);g=!0}if(!d)throw new N(44);8192===(d.mode&61440)&&(b&=-513);if(b&65536&&!P(d.mode))throw new N(54);
|
||||
if(!g&&(d?40960===(d.mode&61440)?e=32:(e=["r","w","rw"][b&3],b&512&&(e+="w"),e=P(d.mode)&&("r"!==e||b&576)?31:Lb(d,e)):e=44,e))throw new N(e);b&512&&!g&&(e=d,e="string"==typeof e?S(e,{ab:!0}).node:e,Zb(null,e,0));b=Pb({node:d,path:ha(d),flags:b&-131713,seekable:!0,position:0,Ma:d.Ma,Yb:[],error:!1});b.Ma.open&&b.Ma.open(b);g&&la(d,c&511);return b}function oa(a){if(null===a.fd)throw new N(8);a.rb&&(a.rb=null);try{a.Ma.close&&a.Ma.close(a)}catch(b){throw b;}finally{Eb[a.fd]=null}a.fd=null}
|
||||
function $b(a,b,c){if(null===a.fd)throw new N(8);if(!a.seekable||!a.Ma.Va)throw new N(70);if(0!=c&&1!=c&&2!=c)throw new N(28);a.position=a.Ma.Va(a,b,c);a.Yb=[]}function ac(a,b,c,d,e){if(0>d||0>e)throw new N(28);if(null===a.fd)throw new N(8);if(1===(a.flags&2097155))throw new N(8);if(P(a.node.mode))throw new N(31);if(!a.Ma.read)throw new N(28);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new N(70);b=a.Ma.read(a,b,c,d,e);g||(a.position+=b);return b}
|
||||
function na(a,b,c,d,e){if(0>d||0>e)throw new N(28);if(null===a.fd)throw new N(8);if(0===(a.flags&2097155))throw new N(8);if(P(a.node.mode))throw new N(31);if(!a.Ma.write)throw new N(28);a.seekable&&a.flags&1024&&$b(a,0,2);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new N(70);b=a.Ma.write(a,b,c,d,e,void 0);g||(a.position+=b);return b}
|
||||
function ta(a){var b=b||0;var c="binary";"utf8"!==c&&"binary"!==c&&Ma(`Invalid encoding type "${c}"`);b=ma(a,b);a=Xb(a).size;var d=new Uint8Array(a);ac(b,d,0,a,0);"utf8"===c&&(d=gb(d));oa(b);return d}
|
||||
function W(a,b,c){a=ia("/dev/"+a);var d=ja(!!b,!!c);W.Cb??(W.Cb=64);var e=W.Cb++<<8|0;mb(e,{open(g){g.seekable=!1},close(){c?.buffer?.length&&c(10)},read(g,h,q,w){for(var t=0,x=0;x<w;x++){try{var D=b()}catch(pb){throw new N(29);}if(void 0===D&&0===t)throw new N(6);if(null===D||void 0===D)break;t++;h[q+x]=D}t&&(g.node.atime=Date.now());return t},write(g,h,q,w){for(var t=0;t<w;t++)try{c(h[q+t])}catch(x){throw new N(29);}w&&(g.node.mtime=g.node.ctime=Date.now());return t}});Ub(a,d,e)}var X={};
|
||||
function Y(a,b,c){if("/"===b.charAt(0))return b;a=-100===a?"/":T(a).path;if(0==b.length){if(!c)throw new N(44);return a}return a+"/"+b}
|
||||
function kc(a,b){F[a>>2]=b.dev;F[a+4>>2]=b.mode;F[a+8>>2]=b.nlink;F[a+12>>2]=b.uid;F[a+16>>2]=b.gid;F[a+20>>2]=b.rdev;G[a+24>>3]=BigInt(b.size);E[a+32>>2]=4096;E[a+36>>2]=b.blocks;var c=b.atime.getTime(),d=b.mtime.getTime(),e=b.ctime.getTime();G[a+40>>3]=BigInt(Math.floor(c/1E3));F[a+48>>2]=c%1E3*1E6;G[a+56>>3]=BigInt(Math.floor(d/1E3));F[a+64>>2]=d%1E3*1E6;G[a+72>>3]=BigInt(Math.floor(e/1E3));F[a+80>>2]=e%1E3*1E6;G[a+88>>3]=BigInt(b.ino);return 0}
|
||||
var Cc=void 0,Ec=()=>{var a=E[+Cc>>2];Cc+=4;return a},Fc=0,Gc=[0,31,60,91,121,152,182,213,244,274,305,335],Hc=[0,31,59,90,120,151,181,212,243,273,304,334],Ic={},Jc=a=>{Ga=a;Ya||0<Fc||(k.onExit?.(a),Fa=!0);xa(a,new Sa(a))},Kc=a=>{if(!Fa)try{a()}catch(b){b instanceof Sa||"unwind"==b||xa(1,b)}finally{if(!(Ya||0<Fc))try{Ga=a=Ga,Jc(a)}catch(b){b instanceof Sa||"unwind"==b||xa(1,b)}}},Lc={},Nc=()=>{if(!Mc){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??
|
||||
"C").replace("-","_")+".UTF-8",_:wa||"./this.program"},b;for(b in Lc)void 0===Lc[b]?delete a[b]:a[b]=Lc[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Mc=c}return Mc},Mc,Oc=(a,b,c,d)=>{var e={string:t=>{var x=0;if(null!==t&&void 0!==t&&0!==t){x=ib(t)+1;var D=y(x);M(t,C,D,x);x=D}return x},array:t=>{var x=y(t.length);m.set(t,x);return x}};a=k["_"+a];var g=[],h=0;if(d)for(var q=0;q<d.length;q++){var w=e[c[q]];w?(0===h&&(h=pa()),g[q]=w(d[q])):g[q]=d[q]}c=a(...g);return c=function(t){0!==h&&ra(h);return"string"===
|
||||
b?z(t):"boolean"===b?!!t:t}(c)},fa=a=>{var b=ib(a)+1,c=da(b);c&&M(a,C,c,b);return c},Pc,Qc=[],A=a=>{Pc.delete(Z.get(a));Z.set(a,null);Qc.push(a)},Rc=a=>{const b=a.length;return[b%128|128,b>>7,...a]},Sc={i:127,p:127,j:126,f:125,d:124,e:111},Tc=a=>Rc(Array.from(a,b=>Sc[b])),va=(a,b)=>{if(!Pc){Pc=new WeakMap;var c=Z.length;if(Pc)for(var d=0;d<0+c;d++){var e=Z.get(d);e&&Pc.set(e,d)}}if(c=Pc.get(a)||0)return c;c=Qc.length?Qc.pop():Z.grow(1);try{Z.set(c,a)}catch(g){if(!(g instanceof TypeError))throw g;
|
||||
b=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Rc([1,96,...Tc(b.slice(1)),...Tc("v"===b[0]?"":b[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);b=new WebAssembly.Module(b);b=(new WebAssembly.Instance(b,{e:{f:a}})).exports.f;Z.set(c,b)}Pc.set(a,c);return c};R=Array(4096);Sb(O,"/");U("/tmp");U("/home");U("/home/web_user");
|
||||
(function(){U("/dev");mb(259,{read:()=>0,write:(d,e,g,h)=>h,Va:()=>0});Ub("/dev/null",259);kb(1280,wb);kb(1536,xb);Ub("/dev/tty",1280);Ub("/dev/tty1",1536);var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(eb(a),b=a.byteLength);return a[--b]};W("random",c);W("urandom",c);U("/dev/shm");U("/dev/shm/tmp")})();
|
||||
(function(){U("/proc");var a=U("/proc/self");U("/proc/self/fd");Sb({Xa(){var b=zb(a,"fd",16895,73);b.Ma={Va:O.Ma.Va};b.La={lookup(c,d){c=+d;var e=T(c);c={parent:null,Xa:{Db:"fake"},La:{readlink:()=>e.path},id:c+1};return c.parent=c},readdir(){return Array.from(Eb.entries()).filter(([,c])=>c).map(([c])=>c.toString())}};return b}},"/proc/self/fd")})();k.noExitRuntime&&(Ya=k.noExitRuntime);k.print&&(Da=k.print);k.printErr&&(B=k.printErr);k.wasmBinary&&(Ea=k.wasmBinary);k.thisProgram&&(wa=k.thisProgram);
|
||||
if(k.preInit)for("function"==typeof k.preInit&&(k.preInit=[k.preInit]);0<k.preInit.length;)k.preInit.shift()();k.stackSave=()=>pa();k.stackRestore=a=>ra(a);k.stackAlloc=a=>y(a);k.cwrap=(a,b,c,d)=>{var e=!c||c.every(g=>"number"===g||"boolean"===g);return"string"!==b&&e&&!d?k["_"+a]:(...g)=>Oc(a,b,c,g)};k.addFunction=va;k.removeFunction=A;k.UTF8ToString=z;k.stringToNewUTF8=fa;k.writeArrayToMemory=(a,b)=>{m.set(a,b)};
|
||||
var da,ea,Bb,Uc,ra,y,pa,La,Z,Vc={a:(a,b,c,d)=>Ma(`Assertion failed: ${z(a)}, at: `+[b?z(b):"unknown filename",c,d?z(d):"unknown function"]),i:function(a,b){try{return a=z(a),la(a,b),0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},L:function(a,b,c){try{b=z(b);b=Y(a,b);if(c&-8)return-28;var d=S(b,{ab:!0}).node;if(!d)return-44;a="";c&4&&(a+="r");c&2&&(a+="w");c&1&&(a+="x");return a&&Lb(d,a)?-2:0}catch(e){if("undefined"==typeof X||"ErrnoError"!==e.name)throw e;return-e.Pa}},
|
||||
j:function(a,b){try{var c=T(a);Yb(c,c.node,b,!1);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},h:function(a){try{var b=T(a);Rb(b,b.node,{timestamp:Date.now(),Lb:!1});return 0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},b:function(a,b,c){Cc=c;try{var d=T(a);switch(b){case 0:var e=Ec();if(0>e)break;for(;Eb[e];)e++;return Qb(d,e).fd;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=Ec(),d.flags|=e,0;case 12:return e=
|
||||
Ec(),Ha[e+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},g:function(a,b){try{var c=T(a),d=c.node,e=c.Ma.Ta;a=e?c:d;e??=d.La.Ta;Ob(e);var g=e(a);return kc(b,g)}catch(h){if("undefined"==typeof X||"ErrnoError"!==h.name)throw h;return-h.Pa}},H:function(a,b){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return-61;var c=T(a);if(0>b||0===(c.flags&2097155))throw new N(28);Zb(c,c.node,b);return 0}catch(d){if("undefined"==
|
||||
typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},G:function(a,b){try{if(0===b)return-28;var c=ib("/")+1;if(b<c)return-68;M("/",C,a,b);return c}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},K:function(a,b){try{return a=z(a),kc(b,Xb(a,!0))}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},C:function(a,b,c){try{return b=z(b),b=Y(a,b),U(b,c),0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},J:function(a,
|
||||
b,c,d){try{b=z(b);var e=d&256;b=Y(a,b,d&4096);return kc(c,e?Xb(b,!0):Xb(b))}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},x:function(a,b,c,d){Cc=d;try{b=z(b);b=Y(a,b);var e=d?Ec():0;return ma(b,c,e).fd}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},v:function(a,b,c,d){try{b=z(b);b=Y(a,b);if(0>=d)return-28;var e=S(b).node;if(!e)throw new N(44);if(!e.La.readlink)throw new N(28);var g=e.La.readlink(e);var h=Math.min(d,ib(g)),q=m[c+h];M(g,
|
||||
C,c,d+1);m[c+h]=q;return h}catch(w){if("undefined"==typeof X||"ErrnoError"!==w.name)throw w;return-w.Pa}},u:function(a){try{return a=z(a),Wb(a),0}catch(b){if("undefined"==typeof X||"ErrnoError"!==b.name)throw b;return-b.Pa}},f:function(a,b){try{return a=z(a),kc(b,Xb(a))}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},r:function(a,b,c){try{b=z(b);b=Y(a,b);if(c)if(512===c)Wb(b);else return-28;else ua(b);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;
|
||||
return-d.Pa}},q:function(a,b,c){try{b=z(b);b=Y(a,b,!0);var d=Date.now(),e,g;if(c){var h=F[c>>2]+4294967296*E[c+4>>2],q=E[c+8>>2];1073741823==q?e=d:1073741822==q?e=null:e=1E3*h+q/1E6;c+=16;h=F[c>>2]+4294967296*E[c+4>>2];q=E[c+8>>2];1073741823==q?g=d:1073741822==q?g=null:g=1E3*h+q/1E6}else g=e=d;if(null!==(g??e)){a=e;var w=S(b,{ab:!0}).node;Ob(w.La.Ua)(w,{atime:a,mtime:g})}return 0}catch(t){if("undefined"==typeof X||"ErrnoError"!==t.name)throw t;return-t.Pa}},m:()=>Ma(""),l:()=>{Ya=!1;Fc=0},A:function(a,
|
||||
b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);E[b>>2]=a.getSeconds();E[b+4>>2]=a.getMinutes();E[b+8>>2]=a.getHours();E[b+12>>2]=a.getDate();E[b+16>>2]=a.getMonth();E[b+20>>2]=a.getFullYear()-1900;E[b+24>>2]=a.getDay();var c=a.getFullYear();E[b+28>>2]=(0!==c%4||0===c%100&&0!==c%400?Hc:Gc)[a.getMonth()]+a.getDate()-1|0;E[b+36>>2]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();
|
||||
E[b+32>>2]=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0},y:function(a,b,c,d,e,g,h){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e);try{var q=T(d);if(0!==(b&2)&&0===(c&2)&&2!==(q.flags&2097155))throw new N(2);if(1===(q.flags&2097155))throw new N(2);if(!q.Ma.jb)throw new N(43);if(!a)throw new N(28);var w=q.Ma.jb(q,a,e,b,c);var t=w.Xb;E[g>>2]=w.Eb;F[h>>2]=t;return 0}catch(x){if("undefined"==typeof X||"ErrnoError"!==x.name)throw x;return-x.Pa}},z:function(a,b,c,d,e,g){g=-9007199254740992>g||
|
||||
9007199254740992<g?NaN:Number(g);try{var h=T(e);if(c&2){c=g;if(32768!==(h.node.mode&61440))throw new N(43);if(!(d&2)){var q=C.slice(a,a+b);h.Ma.kb&&h.Ma.kb(h,q,c,b,d)}}}catch(w){if("undefined"==typeof X||"ErrnoError"!==w.name)throw w;return-w.Pa}},n:(a,b)=>{Ic[a]&&(clearTimeout(Ic[a].id),delete Ic[a]);if(!b)return 0;var c=setTimeout(()=>{delete Ic[a];Kc(()=>Uc(a,performance.now()))},b);Ic[a]={id:c,lc:b};return 0},B:(a,b,c,d)=>{var e=(new Date).getFullYear(),g=(new Date(e,0,1)).getTimezoneOffset();
|
||||
e=(new Date(e,6,1)).getTimezoneOffset();F[a>>2]=60*Math.max(g,e);E[b>>2]=Number(g!=e);b=h=>{var q=Math.abs(h);return`UTC${0<=h?"-":"+"}${String(Math.floor(q/60)).padStart(2,"0")}${String(q%60).padStart(2,"0")}`};a=b(g);b=b(e);e<g?(M(a,C,c,17),M(b,C,d,17)):(M(a,C,d,17),M(b,C,c,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:a=>{var b=C.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,
|
||||
d)/65536))-La.buffer.byteLength+65535)/65536|0;try{La.grow(d);Ka();var e=1;break a}catch(g){}e=void 0}if(e)return!0}return!1},E:(a,b)=>{var c=0,d=0,e;for(e of Nc()){var g=b+c;F[a+d>>2]=g;c+=M(e,C,g,Infinity)+1;d+=4}return 0},F:(a,b)=>{var c=Nc();F[a>>2]=c.length;a=0;for(var d of c)a+=ib(d)+1;F[b>>2]=a;return 0},e:function(a){try{var b=T(a);oa(b);return 0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return c.Pa}},p:function(a,b){try{var c=T(a);m[b]=c.tty?2:P(c.mode)?3:40960===(c.mode&
|
||||
61440)?7:4;Ha[b+2>>1]=0;G[b+8>>3]=BigInt(0);G[b+16>>3]=BigInt(0);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return d.Pa}},w:function(a,b,c,d){try{a:{var e=T(a);a=b;for(var g,h=b=0;h<c;h++){var q=F[a>>2],w=F[a+4>>2];a+=8;var t=ac(e,m,q,w,g);if(0>t){var x=-1;break a}b+=t;if(t<w)break;"undefined"!=typeof g&&(g+=t)}x=b}F[d>>2]=x;return 0}catch(D){if("undefined"==typeof X||"ErrnoError"!==D.name)throw D;return D.Pa}},D:function(a,b,c,d){b=-9007199254740992>b||9007199254740992<
|
||||
b?NaN:Number(b);try{if(isNaN(b))return 61;var e=T(a);$b(e,b,c);G[d>>3]=BigInt(e.position);e.rb&&0===b&&0===c&&(e.rb=null);return 0}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return g.Pa}},I:function(a){try{var b=T(a);return b.Ma?.fsync?.(b)}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return c.Pa}},t:function(a,b,c,d){try{a:{var e=T(a);a=b;for(var g,h=b=0;h<c;h++){var q=F[a>>2],w=F[a+4>>2];a+=8;var t=na(e,m,q,w,g);if(0>t){var x=-1;break a}b+=t;if(t<w)break;
|
||||
"undefined"!=typeof g&&(g+=t)}x=b}F[d>>2]=x;return 0}catch(D){if("undefined"==typeof X||"ErrnoError"!==D.name)throw D;return D.Pa}},k:Jc};
|
||||
function Wc(){function a(){k.calledRun=!0;if(!Fa){if(!k.noFSInit&&!Gb){var b,c;Gb=!0;b??=k.stdin;c??=k.stdout;d??=k.stderr;b?W("stdin",b):Vb("/dev/tty","/dev/stdin");c?W("stdout",null,c):Vb("/dev/tty","/dev/stdout");d?W("stderr",null,d):Vb("/dev/tty1","/dev/stderr");ma("/dev/stdin",0);ma("/dev/stdout",1);ma("/dev/stderr",1)}Xc.N();Hb=!1;k.onRuntimeInitialized?.();if(k.postRun)for("function"==typeof k.postRun&&(k.postRun=[k.postRun]);k.postRun.length;){var d=k.postRun.shift();Ua.push(d)}Ta(Ua)}}if(0<
|
||||
J)Xa=Wc;else{if(k.preRun)for("function"==typeof k.preRun&&(k.preRun=[k.preRun]);k.preRun.length;)Wa();Ta(Va);0<J?Xa=Wc:k.setStatus?(k.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>k.setStatus(""),1);a()},1)):a()}}var Xc;
|
||||
(async function(){function a(c){c=Xc=c.exports;k._sqlite3_free=c.P;k._sqlite3_value_text=c.Q;k._sqlite3_prepare_v2=c.R;k._sqlite3_step=c.S;k._sqlite3_reset=c.T;k._sqlite3_exec=c.U;k._sqlite3_finalize=c.V;k._sqlite3_column_name=c.W;k._sqlite3_column_text=c.X;k._sqlite3_column_type=c.Y;k._sqlite3_errmsg=c.Z;k._sqlite3_clear_bindings=c._;k._sqlite3_value_blob=c.$;k._sqlite3_value_bytes=c.aa;k._sqlite3_value_double=c.ba;k._sqlite3_value_int=c.ca;k._sqlite3_value_type=c.da;k._sqlite3_result_blob=c.ea;
|
||||
k._sqlite3_result_double=c.fa;k._sqlite3_result_error=c.ga;k._sqlite3_result_int=c.ha;k._sqlite3_result_int64=c.ia;k._sqlite3_result_null=c.ja;k._sqlite3_result_text=c.ka;k._sqlite3_aggregate_context=c.la;k._sqlite3_column_count=c.ma;k._sqlite3_data_count=c.na;k._sqlite3_column_blob=c.oa;k._sqlite3_column_bytes=c.pa;k._sqlite3_column_double=c.qa;k._sqlite3_bind_blob=c.ra;k._sqlite3_bind_double=c.sa;k._sqlite3_bind_int=c.ta;k._sqlite3_bind_text=c.ua;k._sqlite3_bind_parameter_index=c.va;k._sqlite3_sql=
|
||||
c.wa;k._sqlite3_normalized_sql=c.xa;k._sqlite3_changes=c.ya;k._sqlite3_close_v2=c.za;k._sqlite3_create_function_v2=c.Aa;k._sqlite3_update_hook=c.Ba;k._sqlite3_open=c.Ca;da=k._malloc=c.Da;ea=k._free=c.Ea;k._RegisterExtensionFunctions=c.Fa;Bb=c.Ga;Uc=c.Ha;ra=c.Ia;y=c.Ja;pa=c.Ka;La=c.M;Z=c.O;Ka();J--;k.monitorRunDependencies?.(J);0==J&&Xa&&(c=Xa,Xa=null,c());return Xc}J++;k.monitorRunDependencies?.(J);var b={a:Vc};if(k.instantiateWasm)return new Promise(c=>{k.instantiateWasm(b,(d,e)=>{c(a(d,e))})});
|
||||
Na??=k.locateFile?k.locateFile("sql-wasm.wasm",za):za+"sql-wasm.wasm";return a((await Ra(b)).instance)})();Wc();
|
||||
|
||||
|
||||
// The shell-pre.js and emcc-generated code goes above
|
||||
return Module;
|
||||
}); // The end of the promise being returned
|
||||
|
||||
return initSqlJsPromise;
|
||||
} // The end of our initSqlJs function
|
||||
|
||||
// This bit below is copied almost exactly from what you get when you use the MODULARIZE=1 flag with emcc
|
||||
// However, we don't want to use the emcc modularization. See shell-pre.js
|
||||
if (typeof exports === 'object' && typeof module === 'object'){
|
||||
module.exports = initSqlJs;
|
||||
// This will allow the module to be used in ES6 or CommonJS
|
||||
module.exports.default = initSqlJs;
|
||||
}
|
||||
else if (typeof define === 'function' && define['amd']) {
|
||||
define([], function() { return initSqlJs; });
|
||||
}
|
||||
else if (typeof exports === 'object'){
|
||||
exports["Module"] = initSqlJs;
|
||||
}
|
||||
BIN
node_modules/sql.js/dist/sql-wasm.wasm
generated
vendored
Executable file
BIN
node_modules/sql.js/dist/sql-wasm.wasm
generated
vendored
Executable file
Binary file not shown.
141011
node_modules/sql.js/dist/worker.sql-asm-debug.js
generated
vendored
Normal file
141011
node_modules/sql.js/dist/worker.sql-asm-debug.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
323
node_modules/sql.js/dist/worker.sql-asm.js
generated
vendored
Normal file
323
node_modules/sql.js/dist/worker.sql-asm.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7386
node_modules/sql.js/dist/worker.sql-wasm-debug.js
generated
vendored
Normal file
7386
node_modules/sql.js/dist/worker.sql-wasm-debug.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
306
node_modules/sql.js/dist/worker.sql-wasm.js
generated
vendored
Normal file
306
node_modules/sql.js/dist/worker.sql-wasm.js
generated
vendored
Normal file
@@ -0,0 +1,306 @@
|
||||
|
||||
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
||||
// https://github.com/kripken/emscripten/issues/5820
|
||||
// In addition, When you use emcc's modularization, it still expects to export a global object called `Module`,
|
||||
// which is able to be used/called before the WASM is loaded.
|
||||
// The modularization below exports a promise that loads and resolves to the actual sql.js module.
|
||||
// That way, this module can't be used before the WASM is finished loading.
|
||||
|
||||
// We are going to define a function that a user will call to start loading initializing our Sql.js library
|
||||
// However, that function might be called multiple times, and on subsequent calls, we don't actually want it to instantiate a new instance of the Module
|
||||
// Instead, we want to return the previously loaded module
|
||||
|
||||
// TODO: Make this not declare a global if used in the browser
|
||||
var initSqlJsPromise = undefined;
|
||||
|
||||
var initSqlJs = function (moduleConfig) {
|
||||
|
||||
if (initSqlJsPromise){
|
||||
return initSqlJsPromise;
|
||||
}
|
||||
// If we're here, we've never called this function before
|
||||
initSqlJsPromise = new Promise(function (resolveModule, reject) {
|
||||
|
||||
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
||||
// https://github.com/kripken/emscripten/issues/5820
|
||||
|
||||
// The way to affect the loading of emcc compiled modules is to create a variable called `Module` and add
|
||||
// properties to it, like `preRun`, `postRun`, etc
|
||||
// We are using that to get notified when the WASM has finished loading.
|
||||
// Only then will we return our promise
|
||||
|
||||
// If they passed in a moduleConfig object, use that
|
||||
// Otherwise, initialize Module to the empty object
|
||||
var Module = typeof moduleConfig !== 'undefined' ? moduleConfig : {};
|
||||
|
||||
// EMCC only allows for a single onAbort function (not an array of functions)
|
||||
// So if the user defined their own onAbort function, we remember it and call it
|
||||
var originalOnAbortFunction = Module['onAbort'];
|
||||
Module['onAbort'] = function (errorThatCausedAbort) {
|
||||
reject(new Error(errorThatCausedAbort));
|
||||
if (originalOnAbortFunction){
|
||||
originalOnAbortFunction(errorThatCausedAbort);
|
||||
}
|
||||
};
|
||||
|
||||
Module['postRun'] = Module['postRun'] || [];
|
||||
Module['postRun'].push(function () {
|
||||
// When Emscripted calls postRun, this promise resolves with the built Module
|
||||
resolveModule(Module);
|
||||
});
|
||||
|
||||
// There is a section of code in the emcc-generated code below that looks like this:
|
||||
// (Note that this is lowercase `module`)
|
||||
// if (typeof module !== 'undefined') {
|
||||
// module['exports'] = Module;
|
||||
// }
|
||||
// When that runs, it's going to overwrite our own modularization export efforts in shell-post.js!
|
||||
// The only way to tell emcc not to emit it is to pass the MODULARIZE=1 or MODULARIZE_INSTANCE=1 flags,
|
||||
// but that carries with it additional unnecessary baggage/bugs we don't want either.
|
||||
// So, we have three options:
|
||||
// 1) We undefine `module`
|
||||
// 2) We remember what `module['exports']` was at the beginning of this function and we restore it later
|
||||
// 3) We write a script to remove those lines of code as part of the Make process.
|
||||
//
|
||||
// Since those are the only lines of code that care about module, we will undefine it. It's the most straightforward
|
||||
// of the options, and has the side effect of reducing emcc's efforts to modify the module if its output were to change in the future.
|
||||
// That's a nice side effect since we're handling the modularization efforts ourselves
|
||||
module = undefined;
|
||||
|
||||
// The emcc-generated code and shell-post.js code goes below,
|
||||
// meaning that all of it runs inside of this promise. If anything throws an exception, our promise will abort
|
||||
var k;k||=typeof Module != 'undefined' ? Module : {};var aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope,ca=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type;
|
||||
k.onRuntimeInitialized=function(){function a(f,l){switch(typeof l){case "boolean":bc(f,l?1:0);break;case "number":cc(f,l);break;case "string":dc(f,l,-1,-1);break;case "object":if(null===l)lb(f);else if(null!=l.length){var n=da(l.length);m.set(l,n);ec(f,n,l.length,-1);ea(n)}else sa(f,"Wrong API use : tried to return a value of an unknown type ("+l+").",-1);break;default:lb(f)}}function b(f,l){for(var n=[],p=0;p<f;p+=1){var u=r(l+4*p,"i32"),v=fc(u);if(1===v||2===v)u=gc(u);else if(3===v)u=hc(u);else if(4===
|
||||
v){v=u;u=ic(v);v=jc(v);for(var K=new Uint8Array(u),I=0;I<u;I+=1)K[I]=m[v+I];u=K}else u=null;n.push(u)}return n}function c(f,l){this.Qa=f;this.db=l;this.Oa=1;this.mb=[]}function d(f,l){this.db=l;this.fb=fa(f);if(null===this.fb)throw Error("Unable to allocate memory for the SQL string");this.lb=this.fb;this.$a=this.sb=null}function e(f){this.filename="dbfile_"+(4294967295*Math.random()>>>0);if(null!=f){var l=this.filename,n="/",p=l;n&&(n="string"==typeof n?n:ha(n),p=l?ia(n+"/"+l):n);l=ja(!0,!0);p=ka(p,
|
||||
l);if(f){if("string"==typeof f){n=Array(f.length);for(var u=0,v=f.length;u<v;++u)n[u]=f.charCodeAt(u);f=n}la(p,l|146);n=ma(p,577);na(n,f,0,f.length,0);oa(n);la(p,l)}}this.handleError(q(this.filename,g));this.db=r(g,"i32");ob(this.db);this.gb={};this.Sa={}}var g=y(4),h=k.cwrap,q=h("sqlite3_open","number",["string","number"]),w=h("sqlite3_close_v2","number",["number"]),t=h("sqlite3_exec","number",["number","string","number","number","number"]),x=h("sqlite3_changes","number",["number"]),D=h("sqlite3_prepare_v2",
|
||||
"number",["number","string","number","number","number"]),pb=h("sqlite3_sql","string",["number"]),lc=h("sqlite3_normalized_sql","string",["number"]),qb=h("sqlite3_prepare_v2","number",["number","number","number","number","number"]),mc=h("sqlite3_bind_text","number",["number","number","number","number","number"]),rb=h("sqlite3_bind_blob","number",["number","number","number","number","number"]),nc=h("sqlite3_bind_double","number",["number","number","number"]),oc=h("sqlite3_bind_int","number",["number",
|
||||
"number","number"]),pc=h("sqlite3_bind_parameter_index","number",["number","string"]),qc=h("sqlite3_step","number",["number"]),rc=h("sqlite3_errmsg","string",["number"]),sc=h("sqlite3_column_count","number",["number"]),tc=h("sqlite3_data_count","number",["number"]),uc=h("sqlite3_column_double","number",["number","number"]),sb=h("sqlite3_column_text","string",["number","number"]),vc=h("sqlite3_column_blob","number",["number","number"]),wc=h("sqlite3_column_bytes","number",["number","number"]),xc=h("sqlite3_column_type",
|
||||
"number",["number","number"]),yc=h("sqlite3_column_name","string",["number","number"]),zc=h("sqlite3_reset","number",["number"]),Ac=h("sqlite3_clear_bindings","number",["number"]),Bc=h("sqlite3_finalize","number",["number"]),tb=h("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),fc=h("sqlite3_value_type","number",["number"]),ic=h("sqlite3_value_bytes","number",["number"]),hc=h("sqlite3_value_text","string",["number"]),jc=h("sqlite3_value_blob",
|
||||
"number",["number"]),gc=h("sqlite3_value_double","number",["number"]),cc=h("sqlite3_result_double","",["number","number"]),lb=h("sqlite3_result_null","",["number"]),dc=h("sqlite3_result_text","",["number","string","number","number"]),ec=h("sqlite3_result_blob","",["number","number","number","number"]),bc=h("sqlite3_result_int","",["number","number"]),sa=h("sqlite3_result_error","",["number","string","number"]),ub=h("sqlite3_aggregate_context","number",["number","number"]),ob=h("RegisterExtensionFunctions",
|
||||
"number",["number"]),vb=h("sqlite3_update_hook","number",["number","number","number"]);c.prototype.bind=function(f){if(!this.Qa)throw"Statement closed";this.reset();return Array.isArray(f)?this.Gb(f):null!=f&&"object"===typeof f?this.Hb(f):!0};c.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var f=qc(this.Qa);switch(f){case 100:return!0;case 101:return!1;default:throw this.db.handleError(f);}};c.prototype.Ab=function(f){null==f&&(f=this.Oa,this.Oa+=1);return uc(this.Qa,f)};
|
||||
c.prototype.Ob=function(f){null==f&&(f=this.Oa,this.Oa+=1);f=sb(this.Qa,f);if("function"!==typeof BigInt)throw Error("BigInt is not supported");return BigInt(f)};c.prototype.Tb=function(f){null==f&&(f=this.Oa,this.Oa+=1);return sb(this.Qa,f)};c.prototype.getBlob=function(f){null==f&&(f=this.Oa,this.Oa+=1);var l=wc(this.Qa,f);f=vc(this.Qa,f);for(var n=new Uint8Array(l),p=0;p<l;p+=1)n[p]=m[f+p];return n};c.prototype.get=function(f,l){l=l||{};null!=f&&this.bind(f)&&this.step();f=[];for(var n=tc(this.Qa),
|
||||
p=0;p<n;p+=1)switch(xc(this.Qa,p)){case 1:var u=l.useBigInt?this.Ob(p):this.Ab(p);f.push(u);break;case 2:f.push(this.Ab(p));break;case 3:f.push(this.Tb(p));break;case 4:f.push(this.getBlob(p));break;default:f.push(null)}return f};c.prototype.qb=function(){for(var f=[],l=sc(this.Qa),n=0;n<l;n+=1)f.push(yc(this.Qa,n));return f};c.prototype.zb=function(f,l){f=this.get(f,l);l=this.qb();for(var n={},p=0;p<l.length;p+=1)n[l[p]]=f[p];return n};c.prototype.Sb=function(){return pb(this.Qa)};c.prototype.Pb=
|
||||
function(){return lc(this.Qa)};c.prototype.run=function(f){null!=f&&this.bind(f);this.step();return this.reset()};c.prototype.wb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);f=fa(f);this.mb.push(f);this.db.handleError(mc(this.Qa,l,f,-1,0))};c.prototype.Fb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);var n=da(f.length);m.set(f,n);this.mb.push(n);this.db.handleError(rb(this.Qa,l,n,f.length,0))};c.prototype.vb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);this.db.handleError((f===(f|0)?oc:nc)(this.Qa,
|
||||
l,f))};c.prototype.Ib=function(f){null==f&&(f=this.Oa,this.Oa+=1);rb(this.Qa,f,0,0,0)};c.prototype.xb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);switch(typeof f){case "string":this.wb(f,l);return;case "number":this.vb(f,l);return;case "bigint":this.wb(f.toString(),l);return;case "boolean":this.vb(f+0,l);return;case "object":if(null===f){this.Ib(l);return}if(null!=f.length){this.Fb(f,l);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+f+").";};c.prototype.Hb=function(f){var l=
|
||||
this;Object.keys(f).forEach(function(n){var p=pc(l.Qa,n);0!==p&&l.xb(f[n],p)});return!0};c.prototype.Gb=function(f){for(var l=0;l<f.length;l+=1)this.xb(f[l],l+1);return!0};c.prototype.reset=function(){this.freemem();return 0===Ac(this.Qa)&&0===zc(this.Qa)};c.prototype.freemem=function(){for(var f;void 0!==(f=this.mb.pop());)ea(f)};c.prototype.Ya=function(){this.freemem();var f=0===Bc(this.Qa);delete this.db.gb[this.Qa];this.Qa=0;return f};d.prototype.next=function(){if(null===this.fb)return{done:!0};
|
||||
null!==this.$a&&(this.$a.Ya(),this.$a=null);if(!this.db.db)throw this.ob(),Error("Database closed");var f=pa(),l=y(4);qa(g);qa(l);try{this.db.handleError(qb(this.db.db,this.lb,-1,g,l));this.lb=r(l,"i32");var n=r(g,"i32");if(0===n)return this.ob(),{done:!0};this.$a=new c(n,this.db);this.db.gb[n]=this.$a;return{value:this.$a,done:!1}}catch(p){throw this.sb=z(this.lb),this.ob(),p;}finally{ra(f)}};d.prototype.ob=function(){ea(this.fb);this.fb=null};d.prototype.Qb=function(){return null!==this.sb?this.sb:
|
||||
z(this.lb)};"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator&&(d.prototype[Symbol.iterator]=function(){return this});e.prototype.run=function(f,l){if(!this.db)throw"Database closed";if(l){f=this.tb(f,l);try{f.step()}finally{f.Ya()}}else this.handleError(t(this.db,f,0,0,g));return this};e.prototype.exec=function(f,l,n){if(!this.db)throw"Database closed";var p=null,u=null,v=null;try{v=u=fa(f);var K=y(4);for(f=[];0!==r(v,"i8");){qa(g);qa(K);this.handleError(qb(this.db,v,-1,g,K));var I=r(g,
|
||||
"i32");v=r(K,"i32");if(0!==I){var H=null;p=new c(I,this);for(null!=l&&p.bind(l);p.step();)null===H&&(H={columns:p.qb(),values:[]},f.push(H)),H.values.push(p.get(null,n));p.Ya()}}return f}catch(L){throw p&&p.Ya(),L;}finally{u&&ea(u)}};e.prototype.Mb=function(f,l,n,p,u){"function"===typeof l&&(p=n,n=l,l=void 0);f=this.tb(f,l);try{for(;f.step();)n(f.zb(null,u))}finally{f.Ya()}if("function"===typeof p)return p()};e.prototype.tb=function(f,l){qa(g);this.handleError(D(this.db,f,-1,g,0));f=r(g,"i32");if(0===
|
||||
f)throw"Nothing to prepare";var n=new c(f,this);null!=l&&n.bind(l);return this.gb[f]=n};e.prototype.Ub=function(f){return new d(f,this)};e.prototype.Nb=function(){Object.values(this.gb).forEach(function(l){l.Ya()});Object.values(this.Sa).forEach(A);this.Sa={};this.handleError(w(this.db));var f=ta(this.filename);this.handleError(q(this.filename,g));this.db=r(g,"i32");ob(this.db);return f};e.prototype.close=function(){null!==this.db&&(Object.values(this.gb).forEach(function(f){f.Ya()}),Object.values(this.Sa).forEach(A),
|
||||
this.Sa={},this.Za&&(A(this.Za),this.Za=void 0),this.handleError(w(this.db)),ua("/"+this.filename),this.db=null)};e.prototype.handleError=function(f){if(0===f)return null;f=rc(this.db);throw Error(f);};e.prototype.Rb=function(){return x(this.db)};e.prototype.Kb=function(f,l){Object.prototype.hasOwnProperty.call(this.Sa,f)&&(A(this.Sa[f]),delete this.Sa[f]);var n=va(function(p,u,v){u=b(u,v);try{var K=l.apply(null,u)}catch(I){sa(p,I,-1);return}a(p,K)},"viii");this.Sa[f]=n;this.handleError(tb(this.db,
|
||||
f,l.length,1,0,n,0,0,0));return this};e.prototype.Jb=function(f,l){var n=l.init||function(){return null},p=l.finalize||function(H){return H},u=l.step;if(!u)throw"An aggregate function must have a step function in "+f;var v={};Object.hasOwnProperty.call(this.Sa,f)&&(A(this.Sa[f]),delete this.Sa[f]);l=f+"__finalize";Object.hasOwnProperty.call(this.Sa,l)&&(A(this.Sa[l]),delete this.Sa[l]);var K=va(function(H,L,Pa){var V=ub(H,1);Object.hasOwnProperty.call(v,V)||(v[V]=n());L=b(L,Pa);L=[v[V]].concat(L);
|
||||
try{v[V]=u.apply(null,L)}catch(Dc){delete v[V],sa(H,Dc,-1)}},"viii"),I=va(function(H){var L=ub(H,1);try{var Pa=p(v[L])}catch(V){delete v[L];sa(H,V,-1);return}a(H,Pa);delete v[L]},"vi");this.Sa[f]=K;this.Sa[l]=I;this.handleError(tb(this.db,f,u.length-1,1,0,0,K,I,0));return this};e.prototype.Zb=function(f){this.Za&&(vb(this.db,0,0),A(this.Za),this.Za=void 0);if(!f)return this;this.Za=va(function(l,n,p,u,v){switch(n){case 18:l="insert";break;case 23:l="update";break;case 9:l="delete";break;default:throw"unknown operationCode in updateHook callback: "+
|
||||
n;}p=z(p);u=z(u);if(v>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";f(l,p,u,Number(v))},"viiiij");vb(this.db,this.Za,0);return this};c.prototype.bind=c.prototype.bind;c.prototype.step=c.prototype.step;c.prototype.get=c.prototype.get;c.prototype.getColumnNames=c.prototype.qb;c.prototype.getAsObject=c.prototype.zb;c.prototype.getSQL=c.prototype.Sb;c.prototype.getNormalizedSQL=c.prototype.Pb;c.prototype.run=c.prototype.run;c.prototype.reset=c.prototype.reset;c.prototype.freemem=
|
||||
c.prototype.freemem;c.prototype.free=c.prototype.Ya;d.prototype.next=d.prototype.next;d.prototype.getRemainingSQL=d.prototype.Qb;e.prototype.run=e.prototype.run;e.prototype.exec=e.prototype.exec;e.prototype.each=e.prototype.Mb;e.prototype.prepare=e.prototype.tb;e.prototype.iterateStatements=e.prototype.Ub;e.prototype["export"]=e.prototype.Nb;e.prototype.close=e.prototype.close;e.prototype.handleError=e.prototype.handleError;e.prototype.getRowsModified=e.prototype.Rb;e.prototype.create_function=e.prototype.Kb;
|
||||
e.prototype.create_aggregate=e.prototype.Jb;e.prototype.updateHook=e.prototype.Zb;k.Database=e};var wa="./this.program",xa=(a,b)=>{throw b;},ya=globalThis.document?.currentScript?.src;"undefined"!=typeof __filename?ya=__filename:ba&&(ya=self.location.href);var za="",Aa,Ba;
|
||||
if(ca){var fs=require("node:fs");za=__dirname+"/";Ba=a=>{a=Ca(a)?new URL(a):a;return fs.readFileSync(a)};Aa=async a=>{a=Ca(a)?new URL(a):a;return fs.readFileSync(a,void 0)};1<process.argv.length&&(wa=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);"undefined"!=typeof module&&(module.exports=k);xa=(a,b)=>{process.exitCode=a;throw b;}}else if(aa||ba){try{za=(new URL(".",ya)).href}catch{}ba&&(Ba=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)});
|
||||
Aa=async a=>{if(Ca(a))return new Promise((c,d)=>{var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?c(e.response):d(e.status)};e.onerror=d;e.send(null)});var b=await fetch(a,{credentials:"same-origin"});if(b.ok)return b.arrayBuffer();throw Error(b.status+" : "+b.url);}}var Da=console.log.bind(console),B=console.error.bind(console),Ea,Fa=!1,Ga,Ca=a=>a.startsWith("file://"),m,C,Ha,E,F,Ia,Ja,G;
|
||||
function Ka(){var a=La.buffer;m=new Int8Array(a);Ha=new Int16Array(a);C=new Uint8Array(a);new Uint16Array(a);E=new Int32Array(a);F=new Uint32Array(a);Ia=new Float32Array(a);Ja=new Float64Array(a);G=new BigInt64Array(a);new BigUint64Array(a)}function Ma(a){k.onAbort?.(a);a="Aborted("+a+")";B(a);Fa=!0;throw new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");}var Na;
|
||||
async function Oa(a){if(!Ea)try{var b=await Aa(a);return new Uint8Array(b)}catch{}if(a==Na&&Ea)a=new Uint8Array(Ea);else if(Ba)a=Ba(a);else throw"both async and sync fetching of the wasm failed";return a}async function Qa(a,b){try{var c=await Oa(a);return await WebAssembly.instantiate(c,b)}catch(d){B(`failed to asynchronously prepare wasm: ${d}`),Ma(d)}}
|
||||
async function Ra(a){var b=Na;if(!Ea&&!Ca(b)&&!ca)try{var c=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,a)}catch(d){B(`wasm streaming compile failed: ${d}`),B("falling back to ArrayBuffer instantiation")}return Qa(b,a)}class Sa{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}var Ta=a=>{for(;0<a.length;)a.shift()(k)},Ua=[],Va=[],Wa=()=>{var a=k.preRun.shift();Va.push(a)},J=0,Xa=null;
|
||||
function r(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return m[a];case "i8":return m[a];case "i16":return Ha[a>>1];case "i32":return E[a>>2];case "i64":return G[a>>3];case "float":return Ia[a>>2];case "double":return Ja[a>>3];case "*":return F[a>>2];default:Ma(`invalid type for getValue: ${b}`)}}var Ya=!0;
|
||||
function qa(a){var b="i32";b.endsWith("*")&&(b="*");switch(b){case "i1":m[a]=0;break;case "i8":m[a]=0;break;case "i16":Ha[a>>1]=0;break;case "i32":E[a>>2]=0;break;case "i64":G[a>>3]=BigInt(0);break;case "float":Ia[a>>2]=0;break;case "double":Ja[a>>3]=0;break;case "*":F[a>>2]=0;break;default:Ma(`invalid type for setValue: ${b}`)}}
|
||||
var Za=new TextDecoder,$a=(a,b,c,d)=>{c=b+c;if(d)return c;for(;a[b]&&!(b>=c);)++b;return b},z=(a,b,c)=>a?Za.decode(C.subarray(a,$a(C,a,b,c))):"",ab=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},ia=a=>{var b="/"===a.charAt(0),c="/"===a.slice(-1);(a=ab(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},bb=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
|
||||
a=b[0];b=b[1];if(!a&&!b)return".";b&&=b.slice(0,-1);return a+b},cb=a=>a&&a.match(/([^\/]+|\/)\/*$/)[1],db=()=>{if(ca){var a=require("node:crypto");return b=>a.randomFillSync(b)}return b=>crypto.getRandomValues(b)},eb=a=>{(eb=db())(a)},fb=(...a)=>{for(var b="",c=!1,d=a.length-1;-1<=d&&!c;d--){c=0<=d?a[d]:"/";if("string"!=typeof c)throw new TypeError("Arguments to path.resolve must be strings");if(!c)return"";b=c+"/"+b;c="/"===c.charAt(0)}b=ab(b.split("/").filter(e=>!!e),!c).join("/");return(c?"/":
|
||||
"")+b||"."},gb=a=>{var b=$a(a,0);return Za.decode(a.buffer?a.subarray(0,b):new Uint8Array(a.slice(0,b)))},hb=[],ib=a=>{for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);127>=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b},M=(a,b,c,d)=>{if(!(0<d))return 0;var e=c;d=c+d-1;for(var g=0;g<a.length;++g){var h=a.codePointAt(g);if(127>=h){if(c>=d)break;b[c++]=h}else if(2047>=h){if(c+1>=d)break;b[c++]=192|h>>6;b[c++]=128|h&63}else if(65535>=h){if(c+2>=d)break;b[c++]=224|h>>12;b[c++]=128|
|
||||
h>>6&63;b[c++]=128|h&63}else{if(c+3>=d)break;b[c++]=240|h>>18;b[c++]=128|h>>12&63;b[c++]=128|h>>6&63;b[c++]=128|h&63;g++}}b[c]=0;return c-e},jb=[];function kb(a,b){jb[a]={input:[],output:[],eb:b};mb(a,nb)}
|
||||
var nb={open(a){var b=jb[a.node.rdev];if(!b)throw new N(43);a.tty=b;a.seekable=!1},close(a){a.tty.eb.fsync(a.tty)},fsync(a){a.tty.eb.fsync(a.tty)},read(a,b,c,d){if(!a.tty||!a.tty.eb.Bb)throw new N(60);for(var e=0,g=0;g<d;g++){try{var h=a.tty.eb.Bb(a.tty)}catch(q){throw new N(29);}if(void 0===h&&0===e)throw new N(6);if(null===h||void 0===h)break;e++;b[c+g]=h}e&&(a.node.atime=Date.now());return e},write(a,b,c,d){if(!a.tty||!a.tty.eb.ub)throw new N(60);try{for(var e=0;e<d;e++)a.tty.eb.ub(a.tty,b[c+e])}catch(g){throw new N(29);
|
||||
}d&&(a.node.mtime=a.node.ctime=Date.now());return e}},wb={Bb(){a:{if(!hb.length){var a=null;if(ca){var b=Buffer.alloc(256),c=0,d=process.stdin.fd;try{c=fs.readSync(d,b,0,256)}catch(e){if(e.toString().includes("EOF"))c=0;else throw e;}0<c&&(a=b.slice(0,c).toString("utf-8"))}else globalThis.window?.prompt&&(a=window.prompt("Input: "),null!==a&&(a+="\n"));if(!a){a=null;break a}b=Array(ib(a)+1);a=M(a,b,0,b.length);b.length=a;hb=b}a=hb.shift()}return a},ub(a,b){null===b||10===b?(Da(gb(a.output)),a.output=
|
||||
[]):0!=b&&a.output.push(b)},fsync(a){0<a.output?.length&&(Da(gb(a.output)),a.output=[])},hc(){return{bc:25856,dc:5,ac:191,cc:35387,$b:[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]}},ic(){return 0},jc(){return[24,80]}},xb={ub(a,b){null===b||10===b?(B(gb(a.output)),a.output=[]):0!=b&&a.output.push(b)},fsync(a){0<a.output?.length&&(B(gb(a.output)),a.output=[])}},O={Wa:null,Xa(){return O.createNode(null,"/",16895,0)},createNode(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new N(63);
|
||||
O.Wa||(O.Wa={dir:{node:{Ta:O.La.Ta,Ua:O.La.Ua,lookup:O.La.lookup,ib:O.La.ib,rename:O.La.rename,unlink:O.La.unlink,rmdir:O.La.rmdir,readdir:O.La.readdir,symlink:O.La.symlink},stream:{Va:O.Ma.Va}},file:{node:{Ta:O.La.Ta,Ua:O.La.Ua},stream:{Va:O.Ma.Va,read:O.Ma.read,write:O.Ma.write,jb:O.Ma.jb,kb:O.Ma.kb}},link:{node:{Ta:O.La.Ta,Ua:O.La.Ua,readlink:O.La.readlink},stream:{}},yb:{node:{Ta:O.La.Ta,Ua:O.La.Ua},stream:yb}});c=zb(a,b,c,d);P(c.mode)?(c.La=O.Wa.dir.node,c.Ma=O.Wa.dir.stream,c.Na={}):32768===
|
||||
(c.mode&61440)?(c.La=O.Wa.file.node,c.Ma=O.Wa.file.stream,c.Ra=0,c.Na=null):40960===(c.mode&61440)?(c.La=O.Wa.link.node,c.Ma=O.Wa.link.stream):8192===(c.mode&61440)&&(c.La=O.Wa.yb.node,c.Ma=O.Wa.yb.stream);c.atime=c.mtime=c.ctime=Date.now();a&&(a.Na[b]=c,a.atime=a.mtime=a.ctime=c.atime);return c},fc(a){return a.Na?a.Na.subarray?a.Na.subarray(0,a.Ra):new Uint8Array(a.Na):new Uint8Array(0)},La:{Ta(a){var b={};b.dev=8192===(a.mode&61440)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=1;b.uid=0;b.gid=0;b.rdev=
|
||||
a.rdev;P(a.mode)?b.size=4096:32768===(a.mode&61440)?b.size=a.Ra:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.atime=new Date(a.atime);b.mtime=new Date(a.mtime);b.ctime=new Date(a.ctime);b.blksize=4096;b.blocks=Math.ceil(b.size/b.blksize);return b},Ua(a,b){for(var c of["mode","atime","mtime","ctime"])null!=b[c]&&(a[c]=b[c]);void 0!==b.size&&(b=b.size,a.Ra!=b&&(0==b?(a.Na=null,a.Ra=0):(c=a.Na,a.Na=new Uint8Array(b),c&&a.Na.set(c.subarray(0,Math.min(b,a.Ra))),a.Ra=b)))},lookup(){O.nb||(O.nb=
|
||||
new N(44),O.nb.stack="<generic error, no stack>");throw O.nb;},ib(a,b,c,d){return O.createNode(a,b,c,d)},rename(a,b,c){try{var d=Q(b,c)}catch(g){}if(d){if(P(a.mode))for(var e in d.Na)throw new N(55);Ab(d)}delete a.parent.Na[a.name];b.Na[c]=a;a.name=c;b.ctime=b.mtime=a.parent.ctime=a.parent.mtime=Date.now()},unlink(a,b){delete a.Na[b];a.ctime=a.mtime=Date.now()},rmdir(a,b){var c=Q(a,b),d;for(d in c.Na)throw new N(55);delete a.Na[b];a.ctime=a.mtime=Date.now()},readdir(a){return[".","..",...Object.keys(a.Na)]},
|
||||
symlink(a,b,c){a=O.createNode(a,b,41471,0);a.link=c;return a},readlink(a){if(40960!==(a.mode&61440))throw new N(28);return a.link}},Ma:{read(a,b,c,d,e){var g=a.node.Na;if(e>=a.node.Ra)return 0;a=Math.min(a.node.Ra-e,d);if(8<a&&g.subarray)b.set(g.subarray(e,e+a),c);else for(d=0;d<a;d++)b[c+d]=g[e+d];return a},write(a,b,c,d,e,g){b.buffer===m.buffer&&(g=!1);if(!d)return 0;a=a.node;a.mtime=a.ctime=Date.now();if(b.subarray&&(!a.Na||a.Na.subarray)){if(g)return a.Na=b.subarray(c,c+d),a.Ra=d;if(0===a.Ra&&
|
||||
0===e)return a.Na=b.slice(c,c+d),a.Ra=d;if(e+d<=a.Ra)return a.Na.set(b.subarray(c,c+d),e),d}g=e+d;var h=a.Na?a.Na.length:0;h>=g||(g=Math.max(g,h*(1048576>h?2:1.125)>>>0),0!=h&&(g=Math.max(g,256)),h=a.Na,a.Na=new Uint8Array(g),0<a.Ra&&a.Na.set(h.subarray(0,a.Ra),0));if(a.Na.subarray&&b.subarray)a.Na.set(b.subarray(c,c+d),e);else for(g=0;g<d;g++)a.Na[e+g]=b[c+g];a.Ra=Math.max(a.Ra,e+d);return d},Va(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.Ra);if(0>b)throw new N(28);
|
||||
return b},jb(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new N(43);a=a.node.Na;if(e&2||!a||a.buffer!==m.buffer){e=!0;d=65536*Math.ceil(b/65536);var g=Bb(65536,d);g&&C.fill(0,g,g+d);d=g;if(!d)throw new N(48);if(a){if(0<c||c+b<a.length)a.subarray?a=a.subarray(c,c+b):a=Array.prototype.slice.call(a,c,c+b);m.set(a,d)}}else e=!1,d=a.byteOffset;return{Xb:d,Eb:e}},kb(a,b,c,d){O.Ma.write(a,b,0,d,c,!1);return 0}}},ja=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},Cb=null,Db={},Eb=[],Fb=1,R=null,Gb=!1,
|
||||
Hb=!0,N=class{name="ErrnoError";constructor(a){this.Pa=a}},Ib=class{hb={};node=null;get flags(){return this.hb.flags}set flags(a){this.hb.flags=a}get position(){return this.hb.position}set position(a){this.hb.position=a}},Jb=class{La={};Ma={};bb=null;constructor(a,b,c,d){a||=this;this.parent=a;this.Xa=a.Xa;this.id=Fb++;this.name=b;this.mode=c;this.rdev=d;this.atime=this.mtime=this.ctime=Date.now()}get read(){return 365===(this.mode&365)}set read(a){a?this.mode|=365:this.mode&=-366}get write(){return 146===
|
||||
(this.mode&146)}set write(a){a?this.mode|=146:this.mode&=-147}};
|
||||
function S(a,b={}){if(!a)throw new N(44);b.pb??(b.pb=!0);"/"===a.charAt(0)||(a="//"+a);var c=0;a:for(;40>c;c++){a=a.split("/").filter(q=>!!q);for(var d=Cb,e="/",g=0;g<a.length;g++){var h=g===a.length-1;if(h&&b.parent)break;if("."!==a[g])if(".."===a[g])if(e=bb(e),d===d.parent){a=e+"/"+a.slice(g+1).join("/");c--;continue a}else d=d.parent;else{e=ia(e+"/"+a[g]);try{d=Q(d,a[g])}catch(q){if(44===q?.Pa&&h&&b.Wb)return{path:e};throw q;}!d.bb||h&&!b.pb||(d=d.bb.root);if(40960===(d.mode&61440)&&(!h||b.ab)){if(!d.La.readlink)throw new N(52);
|
||||
d=d.La.readlink(d);"/"===d.charAt(0)||(d=bb(e)+"/"+d);a=d+"/"+a.slice(g+1).join("/");continue a}}}return{path:e,node:d}}throw new N(32);}function ha(a){for(var b;;){if(a===a.parent)return a=a.Xa.Db,b?"/"!==a[a.length-1]?`${a}/${b}`:a+b:a;b=b?`${a.name}/${b}`:a.name;a=a.parent}}function Kb(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%R.length}
|
||||
function Ab(a){var b=Kb(a.parent.id,a.name);if(R[b]===a)R[b]=a.cb;else for(b=R[b];b;){if(b.cb===a){b.cb=a.cb;break}b=b.cb}}function Q(a,b){var c=P(a.mode)?(c=Lb(a,"x"))?c:a.La.lookup?0:2:54;if(c)throw new N(c);for(c=R[Kb(a.id,b)];c;c=c.cb){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.La.lookup(a,b)}function zb(a,b,c,d){a=new Jb(a,b,c,d);b=Kb(a.parent.id,a.name);a.cb=R[b];return R[b]=a}function P(a){return 16384===(a&61440)}
|
||||
function Lb(a,b){return Hb?0:b.includes("r")&&!(a.mode&292)||b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73)?2:0}function Mb(a,b){if(!P(a.mode))return 54;try{return Q(a,b),20}catch(c){}return Lb(a,"wx")}function Nb(a,b,c){try{var d=Q(a,b)}catch(e){return e.Pa}if(a=Lb(a,"wx"))return a;if(c){if(!P(d.mode))return 54;if(d===d.parent||"/"===ha(d))return 10}else if(P(d.mode))return 31;return 0}function Ob(a){if(!a)throw new N(63);return a}
|
||||
function T(a){a=Eb[a];if(!a)throw new N(8);return a}function Pb(a,b=-1){a=Object.assign(new Ib,a);if(-1==b)a:{for(b=0;4096>=b;b++)if(!Eb[b])break a;throw new N(33);}a.fd=b;return Eb[b]=a}function Qb(a,b=-1){a=Pb(a,b);a.Ma?.ec?.(a);return a}function Rb(a,b,c){var d=a?.Ma.Ua;a=d?a:b;d??=b.La.Ua;Ob(d);d(a,c)}var yb={open(a){a.Ma=Db[a.node.rdev].Ma;a.Ma.open?.(a)},Va(){throw new N(70);}};function mb(a,b){Db[a]={Ma:b}}
|
||||
function Sb(a,b){var c="/"===b;if(c&&Cb)throw new N(10);if(!c&&b){var d=S(b,{pb:!1});b=d.path;d=d.node;if(d.bb)throw new N(10);if(!P(d.mode))throw new N(54);}b={type:a,kc:{},Db:b,Vb:[]};a=a.Xa(b);a.Xa=b;b.root=a;c?Cb=a:d&&(d.bb=b,d.Xa&&d.Xa.Vb.push(b))}function Tb(a,b,c){var d=S(a,{parent:!0}).node;a=cb(a);if(!a)throw new N(28);if("."===a||".."===a)throw new N(20);var e=Mb(d,a);if(e)throw new N(e);if(!d.La.ib)throw new N(63);return d.La.ib(d,a,b,c)}
|
||||
function ka(a,b=438){return Tb(a,b&4095|32768,0)}function U(a,b=511){return Tb(a,b&1023|16384,0)}function Ub(a,b,c){"undefined"==typeof c&&(c=b,b=438);Tb(a,b|8192,c)}function Vb(a,b){if(!fb(a))throw new N(44);var c=S(b,{parent:!0}).node;if(!c)throw new N(44);b=cb(b);var d=Mb(c,b);if(d)throw new N(d);if(!c.La.symlink)throw new N(63);c.La.symlink(c,b,a)}
|
||||
function Wb(a){var b=S(a,{parent:!0}).node;a=cb(a);var c=Q(b,a),d=Nb(b,a,!0);if(d)throw new N(d);if(!b.La.rmdir)throw new N(63);if(c.bb)throw new N(10);b.La.rmdir(b,a);Ab(c)}function ua(a){var b=S(a,{parent:!0}).node;if(!b)throw new N(44);a=cb(a);var c=Q(b,a),d=Nb(b,a,!1);if(d)throw new N(d);if(!b.La.unlink)throw new N(63);if(c.bb)throw new N(10);b.La.unlink(b,a);Ab(c)}function Xb(a,b){a=S(a,{ab:!b}).node;return Ob(a.La.Ta)(a)}
|
||||
function Yb(a,b,c,d){Rb(a,b,{mode:c&4095|b.mode&-4096,ctime:Date.now(),Lb:d})}function la(a,b){a="string"==typeof a?S(a,{ab:!0}).node:a;Yb(null,a,b)}function Zb(a,b,c){if(P(b.mode))throw new N(31);if(32768!==(b.mode&61440))throw new N(28);var d=Lb(b,"w");if(d)throw new N(d);Rb(a,b,{size:c,timestamp:Date.now()})}
|
||||
function ma(a,b,c=438){if(""===a)throw new N(44);if("string"==typeof b){var d={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if("undefined"==typeof d)throw Error(`Unknown file open mode: ${b}`);b=d}c=b&64?c&4095|32768:0;if("object"==typeof a)d=a;else{var e=a.endsWith("/");var g=S(a,{ab:!(b&131072),Wb:!0});d=g.node;a=g.path}g=!1;if(b&64)if(d){if(b&128)throw new N(20);}else{if(e)throw new N(31);d=Tb(a,c|511,0);g=!0}if(!d)throw new N(44);8192===(d.mode&61440)&&(b&=-513);if(b&65536&&!P(d.mode))throw new N(54);
|
||||
if(!g&&(d?40960===(d.mode&61440)?e=32:(e=["r","w","rw"][b&3],b&512&&(e+="w"),e=P(d.mode)&&("r"!==e||b&576)?31:Lb(d,e)):e=44,e))throw new N(e);b&512&&!g&&(e=d,e="string"==typeof e?S(e,{ab:!0}).node:e,Zb(null,e,0));b=Pb({node:d,path:ha(d),flags:b&-131713,seekable:!0,position:0,Ma:d.Ma,Yb:[],error:!1});b.Ma.open&&b.Ma.open(b);g&&la(d,c&511);return b}function oa(a){if(null===a.fd)throw new N(8);a.rb&&(a.rb=null);try{a.Ma.close&&a.Ma.close(a)}catch(b){throw b;}finally{Eb[a.fd]=null}a.fd=null}
|
||||
function $b(a,b,c){if(null===a.fd)throw new N(8);if(!a.seekable||!a.Ma.Va)throw new N(70);if(0!=c&&1!=c&&2!=c)throw new N(28);a.position=a.Ma.Va(a,b,c);a.Yb=[]}function ac(a,b,c,d,e){if(0>d||0>e)throw new N(28);if(null===a.fd)throw new N(8);if(1===(a.flags&2097155))throw new N(8);if(P(a.node.mode))throw new N(31);if(!a.Ma.read)throw new N(28);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new N(70);b=a.Ma.read(a,b,c,d,e);g||(a.position+=b);return b}
|
||||
function na(a,b,c,d,e){if(0>d||0>e)throw new N(28);if(null===a.fd)throw new N(8);if(0===(a.flags&2097155))throw new N(8);if(P(a.node.mode))throw new N(31);if(!a.Ma.write)throw new N(28);a.seekable&&a.flags&1024&&$b(a,0,2);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new N(70);b=a.Ma.write(a,b,c,d,e,void 0);g||(a.position+=b);return b}
|
||||
function ta(a){var b=b||0;var c="binary";"utf8"!==c&&"binary"!==c&&Ma(`Invalid encoding type "${c}"`);b=ma(a,b);a=Xb(a).size;var d=new Uint8Array(a);ac(b,d,0,a,0);"utf8"===c&&(d=gb(d));oa(b);return d}
|
||||
function W(a,b,c){a=ia("/dev/"+a);var d=ja(!!b,!!c);W.Cb??(W.Cb=64);var e=W.Cb++<<8|0;mb(e,{open(g){g.seekable=!1},close(){c?.buffer?.length&&c(10)},read(g,h,q,w){for(var t=0,x=0;x<w;x++){try{var D=b()}catch(pb){throw new N(29);}if(void 0===D&&0===t)throw new N(6);if(null===D||void 0===D)break;t++;h[q+x]=D}t&&(g.node.atime=Date.now());return t},write(g,h,q,w){for(var t=0;t<w;t++)try{c(h[q+t])}catch(x){throw new N(29);}w&&(g.node.mtime=g.node.ctime=Date.now());return t}});Ub(a,d,e)}var X={};
|
||||
function Y(a,b,c){if("/"===b.charAt(0))return b;a=-100===a?"/":T(a).path;if(0==b.length){if(!c)throw new N(44);return a}return a+"/"+b}
|
||||
function kc(a,b){F[a>>2]=b.dev;F[a+4>>2]=b.mode;F[a+8>>2]=b.nlink;F[a+12>>2]=b.uid;F[a+16>>2]=b.gid;F[a+20>>2]=b.rdev;G[a+24>>3]=BigInt(b.size);E[a+32>>2]=4096;E[a+36>>2]=b.blocks;var c=b.atime.getTime(),d=b.mtime.getTime(),e=b.ctime.getTime();G[a+40>>3]=BigInt(Math.floor(c/1E3));F[a+48>>2]=c%1E3*1E6;G[a+56>>3]=BigInt(Math.floor(d/1E3));F[a+64>>2]=d%1E3*1E6;G[a+72>>3]=BigInt(Math.floor(e/1E3));F[a+80>>2]=e%1E3*1E6;G[a+88>>3]=BigInt(b.ino);return 0}
|
||||
var Cc=void 0,Ec=()=>{var a=E[+Cc>>2];Cc+=4;return a},Fc=0,Gc=[0,31,60,91,121,152,182,213,244,274,305,335],Hc=[0,31,59,90,120,151,181,212,243,273,304,334],Ic={},Jc=a=>{Ga=a;Ya||0<Fc||(k.onExit?.(a),Fa=!0);xa(a,new Sa(a))},Kc=a=>{if(!Fa)try{a()}catch(b){b instanceof Sa||"unwind"==b||xa(1,b)}finally{if(!(Ya||0<Fc))try{Ga=a=Ga,Jc(a)}catch(b){b instanceof Sa||"unwind"==b||xa(1,b)}}},Lc={},Nc=()=>{if(!Mc){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??
|
||||
"C").replace("-","_")+".UTF-8",_:wa||"./this.program"},b;for(b in Lc)void 0===Lc[b]?delete a[b]:a[b]=Lc[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Mc=c}return Mc},Mc,Oc=(a,b,c,d)=>{var e={string:t=>{var x=0;if(null!==t&&void 0!==t&&0!==t){x=ib(t)+1;var D=y(x);M(t,C,D,x);x=D}return x},array:t=>{var x=y(t.length);m.set(t,x);return x}};a=k["_"+a];var g=[],h=0;if(d)for(var q=0;q<d.length;q++){var w=e[c[q]];w?(0===h&&(h=pa()),g[q]=w(d[q])):g[q]=d[q]}c=a(...g);return c=function(t){0!==h&&ra(h);return"string"===
|
||||
b?z(t):"boolean"===b?!!t:t}(c)},fa=a=>{var b=ib(a)+1,c=da(b);c&&M(a,C,c,b);return c},Pc,Qc=[],A=a=>{Pc.delete(Z.get(a));Z.set(a,null);Qc.push(a)},Rc=a=>{const b=a.length;return[b%128|128,b>>7,...a]},Sc={i:127,p:127,j:126,f:125,d:124,e:111},Tc=a=>Rc(Array.from(a,b=>Sc[b])),va=(a,b)=>{if(!Pc){Pc=new WeakMap;var c=Z.length;if(Pc)for(var d=0;d<0+c;d++){var e=Z.get(d);e&&Pc.set(e,d)}}if(c=Pc.get(a)||0)return c;c=Qc.length?Qc.pop():Z.grow(1);try{Z.set(c,a)}catch(g){if(!(g instanceof TypeError))throw g;
|
||||
b=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Rc([1,96,...Tc(b.slice(1)),...Tc("v"===b[0]?"":b[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);b=new WebAssembly.Module(b);b=(new WebAssembly.Instance(b,{e:{f:a}})).exports.f;Z.set(c,b)}Pc.set(a,c);return c};R=Array(4096);Sb(O,"/");U("/tmp");U("/home");U("/home/web_user");
|
||||
(function(){U("/dev");mb(259,{read:()=>0,write:(d,e,g,h)=>h,Va:()=>0});Ub("/dev/null",259);kb(1280,wb);kb(1536,xb);Ub("/dev/tty",1280);Ub("/dev/tty1",1536);var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(eb(a),b=a.byteLength);return a[--b]};W("random",c);W("urandom",c);U("/dev/shm");U("/dev/shm/tmp")})();
|
||||
(function(){U("/proc");var a=U("/proc/self");U("/proc/self/fd");Sb({Xa(){var b=zb(a,"fd",16895,73);b.Ma={Va:O.Ma.Va};b.La={lookup(c,d){c=+d;var e=T(c);c={parent:null,Xa:{Db:"fake"},La:{readlink:()=>e.path},id:c+1};return c.parent=c},readdir(){return Array.from(Eb.entries()).filter(([,c])=>c).map(([c])=>c.toString())}};return b}},"/proc/self/fd")})();k.noExitRuntime&&(Ya=k.noExitRuntime);k.print&&(Da=k.print);k.printErr&&(B=k.printErr);k.wasmBinary&&(Ea=k.wasmBinary);k.thisProgram&&(wa=k.thisProgram);
|
||||
if(k.preInit)for("function"==typeof k.preInit&&(k.preInit=[k.preInit]);0<k.preInit.length;)k.preInit.shift()();k.stackSave=()=>pa();k.stackRestore=a=>ra(a);k.stackAlloc=a=>y(a);k.cwrap=(a,b,c,d)=>{var e=!c||c.every(g=>"number"===g||"boolean"===g);return"string"!==b&&e&&!d?k["_"+a]:(...g)=>Oc(a,b,c,g)};k.addFunction=va;k.removeFunction=A;k.UTF8ToString=z;k.stringToNewUTF8=fa;k.writeArrayToMemory=(a,b)=>{m.set(a,b)};
|
||||
var da,ea,Bb,Uc,ra,y,pa,La,Z,Vc={a:(a,b,c,d)=>Ma(`Assertion failed: ${z(a)}, at: `+[b?z(b):"unknown filename",c,d?z(d):"unknown function"]),i:function(a,b){try{return a=z(a),la(a,b),0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},L:function(a,b,c){try{b=z(b);b=Y(a,b);if(c&-8)return-28;var d=S(b,{ab:!0}).node;if(!d)return-44;a="";c&4&&(a+="r");c&2&&(a+="w");c&1&&(a+="x");return a&&Lb(d,a)?-2:0}catch(e){if("undefined"==typeof X||"ErrnoError"!==e.name)throw e;return-e.Pa}},
|
||||
j:function(a,b){try{var c=T(a);Yb(c,c.node,b,!1);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},h:function(a){try{var b=T(a);Rb(b,b.node,{timestamp:Date.now(),Lb:!1});return 0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},b:function(a,b,c){Cc=c;try{var d=T(a);switch(b){case 0:var e=Ec();if(0>e)break;for(;Eb[e];)e++;return Qb(d,e).fd;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=Ec(),d.flags|=e,0;case 12:return e=
|
||||
Ec(),Ha[e+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},g:function(a,b){try{var c=T(a),d=c.node,e=c.Ma.Ta;a=e?c:d;e??=d.La.Ta;Ob(e);var g=e(a);return kc(b,g)}catch(h){if("undefined"==typeof X||"ErrnoError"!==h.name)throw h;return-h.Pa}},H:function(a,b){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return-61;var c=T(a);if(0>b||0===(c.flags&2097155))throw new N(28);Zb(c,c.node,b);return 0}catch(d){if("undefined"==
|
||||
typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},G:function(a,b){try{if(0===b)return-28;var c=ib("/")+1;if(b<c)return-68;M("/",C,a,b);return c}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},K:function(a,b){try{return a=z(a),kc(b,Xb(a,!0))}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},C:function(a,b,c){try{return b=z(b),b=Y(a,b),U(b,c),0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},J:function(a,
|
||||
b,c,d){try{b=z(b);var e=d&256;b=Y(a,b,d&4096);return kc(c,e?Xb(b,!0):Xb(b))}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},x:function(a,b,c,d){Cc=d;try{b=z(b);b=Y(a,b);var e=d?Ec():0;return ma(b,c,e).fd}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},v:function(a,b,c,d){try{b=z(b);b=Y(a,b);if(0>=d)return-28;var e=S(b).node;if(!e)throw new N(44);if(!e.La.readlink)throw new N(28);var g=e.La.readlink(e);var h=Math.min(d,ib(g)),q=m[c+h];M(g,
|
||||
C,c,d+1);m[c+h]=q;return h}catch(w){if("undefined"==typeof X||"ErrnoError"!==w.name)throw w;return-w.Pa}},u:function(a){try{return a=z(a),Wb(a),0}catch(b){if("undefined"==typeof X||"ErrnoError"!==b.name)throw b;return-b.Pa}},f:function(a,b){try{return a=z(a),kc(b,Xb(a))}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},r:function(a,b,c){try{b=z(b);b=Y(a,b);if(c)if(512===c)Wb(b);else return-28;else ua(b);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;
|
||||
return-d.Pa}},q:function(a,b,c){try{b=z(b);b=Y(a,b,!0);var d=Date.now(),e,g;if(c){var h=F[c>>2]+4294967296*E[c+4>>2],q=E[c+8>>2];1073741823==q?e=d:1073741822==q?e=null:e=1E3*h+q/1E6;c+=16;h=F[c>>2]+4294967296*E[c+4>>2];q=E[c+8>>2];1073741823==q?g=d:1073741822==q?g=null:g=1E3*h+q/1E6}else g=e=d;if(null!==(g??e)){a=e;var w=S(b,{ab:!0}).node;Ob(w.La.Ua)(w,{atime:a,mtime:g})}return 0}catch(t){if("undefined"==typeof X||"ErrnoError"!==t.name)throw t;return-t.Pa}},m:()=>Ma(""),l:()=>{Ya=!1;Fc=0},A:function(a,
|
||||
b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);E[b>>2]=a.getSeconds();E[b+4>>2]=a.getMinutes();E[b+8>>2]=a.getHours();E[b+12>>2]=a.getDate();E[b+16>>2]=a.getMonth();E[b+20>>2]=a.getFullYear()-1900;E[b+24>>2]=a.getDay();var c=a.getFullYear();E[b+28>>2]=(0!==c%4||0===c%100&&0!==c%400?Hc:Gc)[a.getMonth()]+a.getDate()-1|0;E[b+36>>2]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();
|
||||
E[b+32>>2]=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0},y:function(a,b,c,d,e,g,h){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e);try{var q=T(d);if(0!==(b&2)&&0===(c&2)&&2!==(q.flags&2097155))throw new N(2);if(1===(q.flags&2097155))throw new N(2);if(!q.Ma.jb)throw new N(43);if(!a)throw new N(28);var w=q.Ma.jb(q,a,e,b,c);var t=w.Xb;E[g>>2]=w.Eb;F[h>>2]=t;return 0}catch(x){if("undefined"==typeof X||"ErrnoError"!==x.name)throw x;return-x.Pa}},z:function(a,b,c,d,e,g){g=-9007199254740992>g||
|
||||
9007199254740992<g?NaN:Number(g);try{var h=T(e);if(c&2){c=g;if(32768!==(h.node.mode&61440))throw new N(43);if(!(d&2)){var q=C.slice(a,a+b);h.Ma.kb&&h.Ma.kb(h,q,c,b,d)}}}catch(w){if("undefined"==typeof X||"ErrnoError"!==w.name)throw w;return-w.Pa}},n:(a,b)=>{Ic[a]&&(clearTimeout(Ic[a].id),delete Ic[a]);if(!b)return 0;var c=setTimeout(()=>{delete Ic[a];Kc(()=>Uc(a,performance.now()))},b);Ic[a]={id:c,lc:b};return 0},B:(a,b,c,d)=>{var e=(new Date).getFullYear(),g=(new Date(e,0,1)).getTimezoneOffset();
|
||||
e=(new Date(e,6,1)).getTimezoneOffset();F[a>>2]=60*Math.max(g,e);E[b>>2]=Number(g!=e);b=h=>{var q=Math.abs(h);return`UTC${0<=h?"-":"+"}${String(Math.floor(q/60)).padStart(2,"0")}${String(q%60).padStart(2,"0")}`};a=b(g);b=b(e);e<g?(M(a,C,c,17),M(b,C,d,17)):(M(a,C,d,17),M(b,C,c,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:a=>{var b=C.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,
|
||||
d)/65536))-La.buffer.byteLength+65535)/65536|0;try{La.grow(d);Ka();var e=1;break a}catch(g){}e=void 0}if(e)return!0}return!1},E:(a,b)=>{var c=0,d=0,e;for(e of Nc()){var g=b+c;F[a+d>>2]=g;c+=M(e,C,g,Infinity)+1;d+=4}return 0},F:(a,b)=>{var c=Nc();F[a>>2]=c.length;a=0;for(var d of c)a+=ib(d)+1;F[b>>2]=a;return 0},e:function(a){try{var b=T(a);oa(b);return 0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return c.Pa}},p:function(a,b){try{var c=T(a);m[b]=c.tty?2:P(c.mode)?3:40960===(c.mode&
|
||||
61440)?7:4;Ha[b+2>>1]=0;G[b+8>>3]=BigInt(0);G[b+16>>3]=BigInt(0);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return d.Pa}},w:function(a,b,c,d){try{a:{var e=T(a);a=b;for(var g,h=b=0;h<c;h++){var q=F[a>>2],w=F[a+4>>2];a+=8;var t=ac(e,m,q,w,g);if(0>t){var x=-1;break a}b+=t;if(t<w)break;"undefined"!=typeof g&&(g+=t)}x=b}F[d>>2]=x;return 0}catch(D){if("undefined"==typeof X||"ErrnoError"!==D.name)throw D;return D.Pa}},D:function(a,b,c,d){b=-9007199254740992>b||9007199254740992<
|
||||
b?NaN:Number(b);try{if(isNaN(b))return 61;var e=T(a);$b(e,b,c);G[d>>3]=BigInt(e.position);e.rb&&0===b&&0===c&&(e.rb=null);return 0}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return g.Pa}},I:function(a){try{var b=T(a);return b.Ma?.fsync?.(b)}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return c.Pa}},t:function(a,b,c,d){try{a:{var e=T(a);a=b;for(var g,h=b=0;h<c;h++){var q=F[a>>2],w=F[a+4>>2];a+=8;var t=na(e,m,q,w,g);if(0>t){var x=-1;break a}b+=t;if(t<w)break;
|
||||
"undefined"!=typeof g&&(g+=t)}x=b}F[d>>2]=x;return 0}catch(D){if("undefined"==typeof X||"ErrnoError"!==D.name)throw D;return D.Pa}},k:Jc};
|
||||
function Wc(){function a(){k.calledRun=!0;if(!Fa){if(!k.noFSInit&&!Gb){var b,c;Gb=!0;b??=k.stdin;c??=k.stdout;d??=k.stderr;b?W("stdin",b):Vb("/dev/tty","/dev/stdin");c?W("stdout",null,c):Vb("/dev/tty","/dev/stdout");d?W("stderr",null,d):Vb("/dev/tty1","/dev/stderr");ma("/dev/stdin",0);ma("/dev/stdout",1);ma("/dev/stderr",1)}Xc.N();Hb=!1;k.onRuntimeInitialized?.();if(k.postRun)for("function"==typeof k.postRun&&(k.postRun=[k.postRun]);k.postRun.length;){var d=k.postRun.shift();Ua.push(d)}Ta(Ua)}}if(0<
|
||||
J)Xa=Wc;else{if(k.preRun)for("function"==typeof k.preRun&&(k.preRun=[k.preRun]);k.preRun.length;)Wa();Ta(Va);0<J?Xa=Wc:k.setStatus?(k.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>k.setStatus(""),1);a()},1)):a()}}var Xc;
|
||||
(async function(){function a(c){c=Xc=c.exports;k._sqlite3_free=c.P;k._sqlite3_value_text=c.Q;k._sqlite3_prepare_v2=c.R;k._sqlite3_step=c.S;k._sqlite3_reset=c.T;k._sqlite3_exec=c.U;k._sqlite3_finalize=c.V;k._sqlite3_column_name=c.W;k._sqlite3_column_text=c.X;k._sqlite3_column_type=c.Y;k._sqlite3_errmsg=c.Z;k._sqlite3_clear_bindings=c._;k._sqlite3_value_blob=c.$;k._sqlite3_value_bytes=c.aa;k._sqlite3_value_double=c.ba;k._sqlite3_value_int=c.ca;k._sqlite3_value_type=c.da;k._sqlite3_result_blob=c.ea;
|
||||
k._sqlite3_result_double=c.fa;k._sqlite3_result_error=c.ga;k._sqlite3_result_int=c.ha;k._sqlite3_result_int64=c.ia;k._sqlite3_result_null=c.ja;k._sqlite3_result_text=c.ka;k._sqlite3_aggregate_context=c.la;k._sqlite3_column_count=c.ma;k._sqlite3_data_count=c.na;k._sqlite3_column_blob=c.oa;k._sqlite3_column_bytes=c.pa;k._sqlite3_column_double=c.qa;k._sqlite3_bind_blob=c.ra;k._sqlite3_bind_double=c.sa;k._sqlite3_bind_int=c.ta;k._sqlite3_bind_text=c.ua;k._sqlite3_bind_parameter_index=c.va;k._sqlite3_sql=
|
||||
c.wa;k._sqlite3_normalized_sql=c.xa;k._sqlite3_changes=c.ya;k._sqlite3_close_v2=c.za;k._sqlite3_create_function_v2=c.Aa;k._sqlite3_update_hook=c.Ba;k._sqlite3_open=c.Ca;da=k._malloc=c.Da;ea=k._free=c.Ea;k._RegisterExtensionFunctions=c.Fa;Bb=c.Ga;Uc=c.Ha;ra=c.Ia;y=c.Ja;pa=c.Ka;La=c.M;Z=c.O;Ka();J--;k.monitorRunDependencies?.(J);0==J&&Xa&&(c=Xa,Xa=null,c());return Xc}J++;k.monitorRunDependencies?.(J);var b={a:Vc};if(k.instantiateWasm)return new Promise(c=>{k.instantiateWasm(b,(d,e)=>{c(a(d,e))})});
|
||||
Na??=k.locateFile?k.locateFile("sql-wasm.wasm",za):za+"sql-wasm.wasm";return a((await Ra(b)).instance)})();Wc();
|
||||
|
||||
|
||||
// The shell-pre.js and emcc-generated code goes above
|
||||
return Module;
|
||||
}); // The end of the promise being returned
|
||||
|
||||
return initSqlJsPromise;
|
||||
} // The end of our initSqlJs function
|
||||
|
||||
// This bit below is copied almost exactly from what you get when you use the MODULARIZE=1 flag with emcc
|
||||
// However, we don't want to use the emcc modularization. See shell-pre.js
|
||||
if (typeof exports === 'object' && typeof module === 'object'){
|
||||
module.exports = initSqlJs;
|
||||
// This will allow the module to be used in ES6 or CommonJS
|
||||
module.exports.default = initSqlJs;
|
||||
}
|
||||
else if (typeof define === 'function' && define['amd']) {
|
||||
define([], function() { return initSqlJs; });
|
||||
}
|
||||
else if (typeof exports === 'object'){
|
||||
exports["Module"] = initSqlJs;
|
||||
}
|
||||
/* global initSqlJs */
|
||||
/* eslint no-restricted-globals: ["error"] */
|
||||
|
||||
"use strict";
|
||||
|
||||
var db;
|
||||
|
||||
function onModuleReady(SQL) {
|
||||
function createDb(data) {
|
||||
if (db != null) db.close();
|
||||
db = new SQL.Database(data);
|
||||
return db;
|
||||
}
|
||||
|
||||
var buff; var data; var result;
|
||||
data = this["data"];
|
||||
var config = data["config"] ? data["config"] : {};
|
||||
switch (data && data["action"]) {
|
||||
case "open":
|
||||
buff = data["buffer"];
|
||||
createDb(buff && new Uint8Array(buff));
|
||||
return postMessage({
|
||||
id: data["id"],
|
||||
ready: true
|
||||
});
|
||||
case "exec":
|
||||
if (db === null) {
|
||||
createDb();
|
||||
}
|
||||
if (!data["sql"]) {
|
||||
throw "exec: Missing query string";
|
||||
}
|
||||
return postMessage({
|
||||
id: data["id"],
|
||||
results: db.exec(data["sql"], data["params"], config)
|
||||
});
|
||||
case "getRowsModified":
|
||||
return postMessage({
|
||||
id: data["id"],
|
||||
rowsModified: db.getRowsModified()
|
||||
});
|
||||
case "each":
|
||||
if (db === null) {
|
||||
createDb();
|
||||
}
|
||||
var callback = function callback(row) {
|
||||
return postMessage({
|
||||
id: data["id"],
|
||||
row: row,
|
||||
finished: false
|
||||
});
|
||||
};
|
||||
var done = function done() {
|
||||
return postMessage({
|
||||
id: data["id"],
|
||||
finished: true
|
||||
});
|
||||
};
|
||||
return db.each(data["sql"], data["params"], callback, done, config);
|
||||
case "export":
|
||||
buff = db["export"]();
|
||||
result = {
|
||||
id: data["id"],
|
||||
buffer: buff
|
||||
};
|
||||
try {
|
||||
return postMessage(result, [result]);
|
||||
} catch (error) {
|
||||
return postMessage(result);
|
||||
}
|
||||
case "close":
|
||||
if (db) {
|
||||
db.close();
|
||||
}
|
||||
return postMessage({
|
||||
id: data["id"]
|
||||
});
|
||||
default:
|
||||
throw new Error("Invalid action : " + (data && data["action"]));
|
||||
}
|
||||
}
|
||||
|
||||
function onError(err) {
|
||||
return postMessage({
|
||||
id: this["data"]["id"],
|
||||
error: err["message"]
|
||||
});
|
||||
}
|
||||
|
||||
db = null;
|
||||
var sqlModuleReady = initSqlJs();
|
||||
|
||||
function global_sqljs_message_handler(event) {
|
||||
return sqlModuleReady
|
||||
.then(onModuleReady.bind(event))
|
||||
.catch(onError.bind(event));
|
||||
}
|
||||
|
||||
if (typeof importScripts === "function") {
|
||||
self.onmessage = global_sqljs_message_handler;
|
||||
}
|
||||
|
||||
if (typeof require === "function") {
|
||||
var worker_threads = require("worker_threads");
|
||||
var parentPort = worker_threads.parentPort;
|
||||
// eslint-disable-next-line no-undef
|
||||
globalThis.postMessage = parentPort.postMessage.bind(parentPort);
|
||||
parentPort.on("message", function onmessage(data) {
|
||||
var event = { data: data };
|
||||
global_sqljs_message_handler(event);
|
||||
});
|
||||
|
||||
if (typeof process !== "undefined") {
|
||||
process.on("uncaughtException", function uncaughtException(err) {
|
||||
postMessage({ error: err.message });
|
||||
});
|
||||
process.on("unhandledRejection", function unhandledRejection(err) {
|
||||
postMessage({ error: err.message });
|
||||
});
|
||||
}
|
||||
}
|
||||
26
node_modules/sql.js/documentation_index.md
generated
vendored
Normal file
26
node_modules/sql.js/documentation_index.md
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
# sql.js API documentation
|
||||
|
||||
## Introduction
|
||||
|
||||
If you need a quick intoduction with code samples that you can copy-and-paste,
|
||||
head over to [sql.js.org](https://sql.js.org/)
|
||||
|
||||
## API
|
||||
|
||||
### The initSqlJs function
|
||||
|
||||
The root object in the API is the [`initSqlJs`](./global.html#initSqlJs) function,
|
||||
that takes an [`SqlJsConfig`](./global.html#SqlJsConfig) parameter,
|
||||
and returns an [SqlJs](./global.html#SqlJs) object
|
||||
|
||||
### The SqlJs object
|
||||
|
||||
`initSqlJs` returns the main sql.js object, the [**`SqlJs`**](./module-SqlJs.html) module, which contains :
|
||||
|
||||
#### Database
|
||||
|
||||
[**Database**](./Database.html) is the main class, that represents an SQLite database.
|
||||
|
||||
#### Statement
|
||||
|
||||
The [**Statement**](./Statement.html) class is used for prepared statements.
|
||||
57
node_modules/sql.js/eslint.config.cjs
generated
vendored
Normal file
57
node_modules/sql.js/eslint.config.cjs
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
|
||||
const js = require("@eslint/js");
|
||||
const globals = require("globals");
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
ignores: [
|
||||
".eslintrc.js",
|
||||
"dist/**",
|
||||
"examples/**",
|
||||
"documentation/**",
|
||||
"node_modules/**",
|
||||
"out/**",
|
||||
"src/shell-post.js",
|
||||
"src/shell-pre.js",
|
||||
"test/**"
|
||||
]
|
||||
},
|
||||
js.configs.recommended,
|
||||
{
|
||||
files: ["**/*.js"],
|
||||
languageOptions: {
|
||||
ecmaVersion: 5,
|
||||
sourceType: "script",
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
...globals.es2015,
|
||||
Atomics: "readonly",
|
||||
SharedArrayBuffer: "readonly"
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
camelcase: "off",
|
||||
"comma-dangle": "off",
|
||||
"dot-notation": "off",
|
||||
indent: ["error", 4, { SwitchCase: 1 }],
|
||||
"max-len": ["error", { code: 80 }],
|
||||
"no-bitwise": "off",
|
||||
"no-cond-assign": ["error", "except-parens"],
|
||||
"no-param-reassign": "off",
|
||||
"no-throw-literal": "off",
|
||||
"no-useless-assignment": "off",
|
||||
"no-var": "off",
|
||||
"no-unused-vars": ["error", { caughtErrors: "none" }],
|
||||
"object-shorthand": "off",
|
||||
"prefer-arrow-callback": "off",
|
||||
"prefer-destructuring": "off",
|
||||
"prefer-spread": "off",
|
||||
"prefer-template": "off",
|
||||
quotes: ["error", "double"],
|
||||
strict: "off",
|
||||
"vars-on-top": "off"
|
||||
}
|
||||
}
|
||||
];
|
||||
13
node_modules/sql.js/logo.svg
generated
vendored
Normal file
13
node_modules/sql.js/logo.svg
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="400" width="400">
|
||||
<defs/>
|
||||
<defs>
|
||||
<path id="a" d="M6 10h139v93H6z"/>
|
||||
</defs>
|
||||
<rect ry="0" y="0" x="0" height="400" width="400" fill="#ffe70b" stroke="#000"/>
|
||||
<text y="170" x="29" style="line-height:1.25;-inkscape-font-specification:'Source Sans Pro Semi-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal" font-weight="600" font-size="200" font-family="Source Sans Pro">
|
||||
<tspan y="170" x="29">SQL</tspan>
|
||||
</text>
|
||||
<text style="line-height:1.25;-inkscape-font-specification:'Source Sans Pro Semi-Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal" x="109" y="359" font-weight="600" font-size="200" font-family="Source Sans Pro">
|
||||
<tspan x="109" y="359">.JS</tspan>
|
||||
</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 890 B |
58
node_modules/sql.js/package.json
generated
vendored
Normal file
58
node_modules/sql.js/package.json
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"name": "sql.js",
|
||||
"version": "1.14.1",
|
||||
"description": "SQLite library with support for opening and writing databases, prepared statements, and more. This SQLite library is in pure javascript (compiled with emscripten).",
|
||||
"keywords": [
|
||||
"sql",
|
||||
"sqlite",
|
||||
"stand-alone",
|
||||
"relational",
|
||||
"database",
|
||||
"RDBMS",
|
||||
"data",
|
||||
"query",
|
||||
"statement",
|
||||
"emscripten",
|
||||
"asm",
|
||||
"asm.js"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./dist/sql-wasm.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"browser": "./dist/sql-wasm-browser.js",
|
||||
"default": "./dist/sql-wasm.js"
|
||||
},
|
||||
"./dist/*": "./dist/*"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "make",
|
||||
"rebuild": "npm run clean && npm run build",
|
||||
"clean": "make clean",
|
||||
"test": "npm run lint && npm run test-asm && npm run test-asm-debug && npm run test-wasm && npm run test-wasm-debug && npm run test-wasm-browser && npm run test-asm-memory-growth",
|
||||
"lint": "eslint .",
|
||||
"prettify": "eslint . --fix",
|
||||
"test-asm": "node --unhandled-rejections=strict test/all.js asm",
|
||||
"test-asm-debug": "node --unhandled-rejections=strict test/all.js asm-debug",
|
||||
"test-asm-memory-growth": "node --unhandled-rejections=strict test/all.js asm-memory-growth",
|
||||
"test-wasm": "node --unhandled-rejections=strict test/all.js wasm",
|
||||
"test-wasm-debug": "node --unhandled-rejections=strict test/all.js wasm-debug",
|
||||
"test-wasm-browser": "node --unhandled-rejections=strict test/all.js wasm-browser",
|
||||
"doc": "jsdoc -c .jsdoc.config.json"
|
||||
},
|
||||
"homepage": "http://github.com/sql-js/sql.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/sql-js/sql.js.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sql-js/sql.js/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.0",
|
||||
"clean-jsdoc-theme": "^4.2.0",
|
||||
"eslint": "^10.0.0",
|
||||
"globals": "^16.4.0",
|
||||
"jsdoc": "^4.0.2"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user