From fb3c5fc81b0fb4a45478009255527d897efced74 Mon Sep 17 00:00:00 2001 From: Valery Antopol Date: Fri, 18 Feb 2022 19:48:33 +0300 Subject: [PATCH] Switch to marine version of AquaVM (#3) --- .github/workflows/test_node.yml | 2 +- .github/workflows/test_node_negative.yml | 2 +- avm-runner-background/build_runner.sh | 2 + avm-runner-background/package-lock.json | 3 + avm-runner-background/src/index.ts | 27 +- avm-runner-background/src/types.ts | 9 +- runner-script/package-lock.json | 345 ++++++- runner-script/package.json | 4 +- runner-script/src/index.ts | 268 +++++- runner-script/src/types.ts | 9 +- runner-script/webpack.config.js | 4 +- tests/node-negative/src/__test__/test.spec.ts | 2 +- tests/node/package-lock.json | 65 +- tests/node/package.json | 3 +- tests/node/src/__test__/test.spec.ts | 5 +- tests/web/build_test_project.sh | 2 + tests/web/package.json | 3 +- tests/web/src/__test__/test.spec.ts | 4 +- tests/web/test-project/package-lock.json | 30 +- tests/web/test-project/package.json | 5 +- .../test-project/public/runnerScript.web.js | 872 +++++++++++++++++- 21 files changed, 1544 insertions(+), 122 deletions(-) diff --git a/.github/workflows/test_node.yml b/.github/workflows/test_node.yml index f251f33..c820930 100644 --- a/.github/workflows/test_node.yml +++ b/.github/workflows/test_node.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - node-version: [15.x, 16.x] + node-version: [16.x] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/test_node_negative.yml b/.github/workflows/test_node_negative.yml index 145405c..fde077c 100644 --- a/.github/workflows/test_node_negative.yml +++ b/.github/workflows/test_node_negative.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: - node-version: [15.x, 16.x] + node-version: [16.x] steps: - uses: actions/checkout@v2 diff --git a/avm-runner-background/build_runner.sh b/avm-runner-background/build_runner.sh index 4cd4e17..29b5aee 100755 --- a/avm-runner-background/build_runner.sh +++ b/avm-runner-background/build_runner.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + # set current working directory to script directory to run script from everywhere cd "$(dirname "$0")" diff --git a/avm-runner-background/package-lock.json b/avm-runner-background/package-lock.json index 91973c6..5a39ef4 100644 --- a/avm-runner-background/package-lock.json +++ b/avm-runner-background/package-lock.json @@ -13,6 +13,9 @@ "browser-or-node": "^2.0.0", "threads": "^1.7.0" }, + "bin": { + "copy-avm-runner": "dist/copyRunnerScript.js" + }, "devDependencies": { "@types/node": "^16.11.10", "typescript": "^4.0.0" diff --git a/avm-runner-background/src/index.ts b/avm-runner-background/src/index.ts index 3b71e5b..3f9499f 100644 --- a/avm-runner-background/src/index.ts +++ b/avm-runner-background/src/index.ts @@ -21,7 +21,9 @@ import { RunnerScriptInterface, wasmLoadingMethod } from './types'; export { wasmLoadingMethod } from './types'; const defaultAvmFileName = 'avm.wasm'; +const defaultMarineFileName = 'marine-js.wasm'; const avmPackageName = '@fluencelabs/avm'; +const marinePackageName = '@fluencelabs/marine-js'; const runnerScriptNodePath = './runnerScript.node.js'; const runnerScriptWebPath = './runnerScript.web.js'; @@ -41,7 +43,10 @@ export class AvmRunnerBackground implements AvmRunner { method = this._loadingMethod || { method: 'fetch-from-url', baseUrl: window.location.origin, - filePath: defaultAvmFileName, + filePaths: { + avm: defaultAvmFileName, + marine: defaultMarineFileName, + }, }; workerPath = runnerScriptWebPath; } @@ -54,19 +59,23 @@ export class AvmRunnerBackground implements AvmRunner { try { // webpack will complain about missing dependencies for web target // to fix this we have to use eval('require') - const path = eval('require')('path'); - const fluencePath = eval('require').resolve(avmPackageName); - const filePath = path.join(path.dirname(fluencePath), defaultAvmFileName); + const require = eval('require'); + const path = require('path'); + const avmPackagePath = require.resolve(avmPackageName); + const avmFilePath = path.join(path.dirname(avmPackagePath), defaultAvmFileName); + + const marinePackagePath = require.resolve(marinePackageName); + const marineFilePath = path.join(path.dirname(marinePackagePath), defaultMarineFileName); method = { method: 'read-from-fs', - filePath: filePath, + filePaths: { + avm: avmFilePath, + marine: marineFilePath, + }, }; } catch (e: any) { - throw new Error( - 'Failed to load avm.wasm. Did you forget to install @fluencelabs/avm? Original error: ' + - e.toString(), - ); + throw new Error('Failed to load wasm file(s). Original error: ' + e.toString()); } } } else { diff --git a/avm-runner-background/src/types.ts b/avm-runner-background/src/types.ts index c4e5641..3c1920f 100644 --- a/avm-runner-background/src/types.ts +++ b/avm-runner-background/src/types.ts @@ -16,15 +16,20 @@ import { CallResultsArray, InterpreterResult, LogLevel } from '@fluencelabs/avm-runner-interface'; +interface FilePaths { + avm: string; + marine: string; +} + export type wasmLoadingMethod = | { method: 'fetch-from-url'; baseUrl: string; - filePath: string; + filePaths: FilePaths; } | { method: 'read-from-fs'; - filePath: string; + filePaths: FilePaths; }; export type RunnerScriptInterface = { diff --git a/runner-script/package-lock.json b/runner-script/package-lock.json index f07bc54..f58ee78 100644 --- a/runner-script/package-lock.json +++ b/runner-script/package-lock.json @@ -8,8 +8,10 @@ "name": "runner-script", "version": "1.0.0", "dependencies": { - "@fluencelabs/avm": "0.19.6", "@fluencelabs/avm-runner-interface": "^0.2.0", + "@fluencelabs/marine-js": "^0.1.0-web-runtime-experiments.0", + "@wasmer/wasi": "^0.12.0", + "@wasmer/wasmfs": "^0.12.0", "browser-or-node": "^2.0.0", "threads": "^1.7.0" }, @@ -22,6 +24,24 @@ "webpack-cli": "^4.9.1" } }, + "../../marine/web-runtime/npm-package": { + "name": "@fluencelabs/marine-js", + "version": "0.0.3", + "extraneous": true, + "license": "Apache 2.0", + "bin": { + "copy-marine": "dist/copyMarine.js" + }, + "devDependencies": { + "@fluencelabs/avm": "0.20.0-marine-web-adapted.1", + "@types/jest": "^27.4.0", + "@types/node": "^14.0.0", + "@wasmer/wasi": "^0.12.0", + "@wasmer/wasmfs": "^0.12.0", + "jest": "^27.2.4", + "typescript": "^4.0.0" + } + }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz", @@ -31,25 +51,51 @@ "node": ">=10.0.0" } }, - "node_modules/@fluencelabs/avm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.19.6.tgz", - "integrity": "sha512-T6UQsIuGVltf13Wc3bFmuCYmQzu/00Y4lPS7atBauQ2R4+BqhRg1dc5reSZ+MbAW3Vy+NmJY1EEYOFRpLCGBwg==", - "bin": { - "copy-avm": "dist/copyAvm.js" - } - }, "node_modules/@fluencelabs/avm-runner-interface": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@fluencelabs/avm-runner-interface/-/avm-runner-interface-0.2.0.tgz", "integrity": "sha512-Y41pL+UwZZVdormxju8cJQsNRp6tdER0VqJ9Kg9gH2wd1KJAaYTJkyVbn8NB7fEFRUbqfbb1BXHi9wWBYOgGYQ==" }, + "node_modules/@fluencelabs/marine-js": { + "version": "0.1.0-web-runtime-experiments.0", + "resolved": "https://registry.npmjs.org/@fluencelabs/marine-js/-/marine-js-0.1.0-web-runtime-experiments.0.tgz", + "integrity": "sha512-UQxTtACJLNJcTaD10LQ2hIA1x5/yN6S4XT0Kn8wCYVz/QbD/itb47x8+wA582HNKEbJpHuj0A098UYrt6+WpQA==", + "bin": { + "copy-marine": "dist/copyMarine.js" + } + }, "node_modules/@types/node": { "version": "17.0.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.0.tgz", "integrity": "sha512-eMhwJXc931Ihh4tkU+Y7GiLzT/y/DBNpNtr4yU9O2w3SYBsr9NaOPhQlLKRmoWtI54uNwuo0IOUFQjVOTZYRvw==", "dev": true }, + "node_modules/@wasmer/wasi": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@wasmer/wasi/-/wasi-0.12.0.tgz", + "integrity": "sha512-FJhLZKAfLWm/yjQI7eCRHNbA8ezmb7LSpUYFkHruZXs2mXk2+DaQtSElEtOoNrVQ4vApTyVaAd5/b7uEu8w6wQ==", + "dependencies": { + "browser-process-hrtime": "^1.0.0", + "buffer-es6": "^4.9.3", + "path-browserify": "^1.0.0", + "randomfill": "^1.0.4" + } + }, + "node_modules/@wasmer/wasi/node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + }, + "node_modules/@wasmer/wasmfs": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@wasmer/wasmfs/-/wasmfs-0.12.0.tgz", + "integrity": "sha512-m1ftchyQ1DfSenm5XbbdGIpb6KJHH5z0gODo3IZr6lATkj4WXfX/UeBTZ0aG9YVShBp+kHLdUHvOkqjy6p/GWw==", + "dependencies": { + "memfs": "3.0.4", + "pako": "^1.0.11", + "tar-stream": "^2.1.0" + } + }, "node_modules/@webassemblyjs/ast": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", @@ -551,7 +597,6 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, "funding": [ { "type": "github", @@ -596,6 +641,52 @@ "file-uri-to-path": "1.0.0" } }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -641,6 +732,11 @@ "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-2.0.0.tgz", "integrity": "sha512-3Lrks/Okgof+/cRguUNG+qRXSeq79SO3hY4QrXJayJofwJwHiGC0qi99uDjsfTwULUFSr1OGVsBkdIkygKjTUA==" }, + "node_modules/browser-process-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==" + }, "node_modules/browserify-aes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", @@ -739,6 +835,11 @@ "isarray": "^1.0.0" } }, + "node_modules/buffer-es6": { + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/buffer-es6/-/buffer-es6-4.9.3.tgz", + "integrity": "sha1-8mNHuC33b9N+GLy1KIxJcM/VxAQ=" + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -1274,7 +1375,6 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, "dependencies": { "once": "^1.4.0" } @@ -1595,6 +1695,11 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-extend": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fast-extend/-/fast-extend-1.0.2.tgz", + "integrity": "sha512-XXA9RmlPatkFKUzqVZAFth18R4Wo+Xug/S+C7YlYA3xrXwfPlW3dqNwOb4hvQo7wZJ2cNDYhrYuPzVOfHy5/uQ==" + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -1764,6 +1869,16 @@ "readable-stream": "^2.0.0" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "node_modules/fs-monkey": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-0.3.3.tgz", + "integrity": "sha512-FNUvuTAJ3CqCQb5ELn+qCbGR/Zllhf2HtwsdAtBi59s1WeCjKMT81fHcSu7dwIskqGVK+MmOrb7VOBlq3/SItw==" + }, "node_modules/fs-write-stream-atomic": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", @@ -2080,7 +2195,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, "funding": [ { "type": "github", @@ -2146,8 +2260,7 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/internal-slot": { "version": "1.0.3", @@ -2722,6 +2835,15 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/memfs": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.0.4.tgz", + "integrity": "sha512-OcZEzwX9E5AoY8SXjuAvw0DbIAYwUzV/I236I8Pqvrlv7sL/Y0E9aRCon05DhaV8pg1b32uxj76RgW0s5xjHBA==", + "dependencies": { + "fast-extend": "1.0.2", + "fs-monkey": "0.3.3" + } + }, "node_modules/memory-fs": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", @@ -3169,7 +3291,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "dependencies": { "wrappy": "1" } @@ -3234,8 +3355,7 @@ "node_modules/pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" }, "node_modules/parallel-transform": { "version": "1.2.0", @@ -3481,7 +3601,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, "dependencies": { "safe-buffer": "^5.1.0" } @@ -3490,7 +3609,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, "dependencies": { "randombytes": "^2.0.5", "safe-buffer": "^5.1.0" @@ -3699,7 +3817,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -4132,7 +4249,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -4181,6 +4297,34 @@ "node": ">=6" } }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar-stream/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/terser": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", @@ -4650,8 +4794,7 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "node_modules/vm-browserify": { "version": "1.1.2", @@ -5363,8 +5506,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "node_modules/xtend": { "version": "4.0.2", @@ -5395,22 +5537,50 @@ "integrity": "sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA==", "dev": true }, - "@fluencelabs/avm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.19.6.tgz", - "integrity": "sha512-T6UQsIuGVltf13Wc3bFmuCYmQzu/00Y4lPS7atBauQ2R4+BqhRg1dc5reSZ+MbAW3Vy+NmJY1EEYOFRpLCGBwg==" - }, "@fluencelabs/avm-runner-interface": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@fluencelabs/avm-runner-interface/-/avm-runner-interface-0.2.0.tgz", "integrity": "sha512-Y41pL+UwZZVdormxju8cJQsNRp6tdER0VqJ9Kg9gH2wd1KJAaYTJkyVbn8NB7fEFRUbqfbb1BXHi9wWBYOgGYQ==" }, + "@fluencelabs/marine-js": { + "version": "0.1.0-web-runtime-experiments.0", + "resolved": "https://registry.npmjs.org/@fluencelabs/marine-js/-/marine-js-0.1.0-web-runtime-experiments.0.tgz", + "integrity": "sha512-UQxTtACJLNJcTaD10LQ2hIA1x5/yN6S4XT0Kn8wCYVz/QbD/itb47x8+wA582HNKEbJpHuj0A098UYrt6+WpQA==" + }, "@types/node": { "version": "17.0.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.0.tgz", "integrity": "sha512-eMhwJXc931Ihh4tkU+Y7GiLzT/y/DBNpNtr4yU9O2w3SYBsr9NaOPhQlLKRmoWtI54uNwuo0IOUFQjVOTZYRvw==", "dev": true }, + "@wasmer/wasi": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@wasmer/wasi/-/wasi-0.12.0.tgz", + "integrity": "sha512-FJhLZKAfLWm/yjQI7eCRHNbA8ezmb7LSpUYFkHruZXs2mXk2+DaQtSElEtOoNrVQ4vApTyVaAd5/b7uEu8w6wQ==", + "requires": { + "browser-process-hrtime": "^1.0.0", + "buffer-es6": "^4.9.3", + "path-browserify": "^1.0.0", + "randomfill": "^1.0.4" + }, + "dependencies": { + "path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" + } + } + }, + "@wasmer/wasmfs": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@wasmer/wasmfs/-/wasmfs-0.12.0.tgz", + "integrity": "sha512-m1ftchyQ1DfSenm5XbbdGIpb6KJHH5z0gODo3IZr6lATkj4WXfX/UeBTZ0aG9YVShBp+kHLdUHvOkqjy6p/GWw==", + "requires": { + "memfs": "3.0.4", + "pako": "^1.0.11", + "tar-stream": "^2.1.0" + } + }, "@webassemblyjs/ast": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", @@ -5839,8 +6009,7 @@ "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, "big.js": { "version": "5.2.2", @@ -5865,6 +6034,37 @@ "file-uri-to-path": "1.0.0" } }, + "bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + }, + "dependencies": { + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "bluebird": { "version": "3.7.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", @@ -5907,6 +6107,11 @@ "resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-2.0.0.tgz", "integrity": "sha512-3Lrks/Okgof+/cRguUNG+qRXSeq79SO3hY4QrXJayJofwJwHiGC0qi99uDjsfTwULUFSr1OGVsBkdIkygKjTUA==" }, + "browser-process-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==" + }, "browserify-aes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", @@ -6004,6 +6209,11 @@ "isarray": "^1.0.0" } }, + "buffer-es6": { + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/buffer-es6/-/buffer-es6-4.9.3.tgz", + "integrity": "sha1-8mNHuC33b9N+GLy1KIxJcM/VxAQ=" + }, "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -6475,7 +6685,6 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, "requires": { "once": "^1.4.0" } @@ -6732,6 +6941,11 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "fast-extend": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fast-extend/-/fast-extend-1.0.2.tgz", + "integrity": "sha512-XXA9RmlPatkFKUzqVZAFth18R4Wo+Xug/S+C7YlYA3xrXwfPlW3dqNwOb4hvQo7wZJ2cNDYhrYuPzVOfHy5/uQ==" + }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -6873,6 +7087,16 @@ "readable-stream": "^2.0.0" } }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "fs-monkey": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-0.3.3.tgz", + "integrity": "sha512-FNUvuTAJ3CqCQb5ELn+qCbGR/Zllhf2HtwsdAtBi59s1WeCjKMT81fHcSu7dwIskqGVK+MmOrb7VOBlq3/SItw==" + }, "fs-write-stream-atomic": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", @@ -7115,8 +7339,7 @@ "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, "iferr": { "version": "0.1.5", @@ -7159,8 +7382,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "internal-slot": { "version": "1.0.3", @@ -7572,6 +7794,15 @@ "safe-buffer": "^5.1.2" } }, + "memfs": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.0.4.tgz", + "integrity": "sha512-OcZEzwX9E5AoY8SXjuAvw0DbIAYwUzV/I236I8Pqvrlv7sL/Y0E9aRCon05DhaV8pg1b32uxj76RgW0s5xjHBA==", + "requires": { + "fast-extend": "1.0.2", + "fs-monkey": "0.3.3" + } + }, "memory-fs": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", @@ -7951,7 +8182,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -7998,8 +8228,7 @@ "pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" }, "parallel-transform": { "version": "1.2.0", @@ -8209,7 +8438,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, "requires": { "safe-buffer": "^5.1.0" } @@ -8218,7 +8446,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, "requires": { "randombytes": "^2.0.5", "safe-buffer": "^5.1.0" @@ -8393,8 +8620,7 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "safe-regex": { "version": "1.1.0", @@ -8752,7 +8978,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, "requires": { "safe-buffer": "~5.2.0" } @@ -8789,6 +9014,30 @@ "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", "dev": true }, + "tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "requires": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "terser": { "version": "4.8.0", "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", @@ -9170,8 +9419,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "vm-browserify": { "version": "1.1.2", @@ -9739,8 +9987,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "xtend": { "version": "4.0.2", diff --git a/runner-script/package.json b/runner-script/package.json index 302d360..acbd83c 100644 --- a/runner-script/package.json +++ b/runner-script/package.json @@ -14,8 +14,10 @@ "webpack-cli": "^4.9.1" }, "dependencies": { - "@fluencelabs/avm": "0.19.6", "@fluencelabs/avm-runner-interface": "^0.2.0", + "@fluencelabs/marine-js": "0.1.0", + "@wasmer/wasi": "^0.12.0", + "@wasmer/wasmfs": "^0.12.0", "browser-or-node": "^2.0.0", "threads": "^1.7.0" } diff --git a/runner-script/src/index.ts b/runner-script/src/index.ts index 2ef2778..f1c2091 100644 --- a/runner-script/src/index.ts +++ b/runner-script/src/index.ts @@ -1,8 +1,23 @@ -import { LogLevel, CallResultsArray, InterpreterResult } from '@fluencelabs/avm-runner-interface'; -import { AirInterpreter } from '@fluencelabs/avm'; +import { WASI } from '@wasmer/wasi'; +import { WasmFs } from '@wasmer/wasmfs'; +import bindings from '@wasmer/wasi/lib/bindings/browser'; +import { LogLevel, CallResultsArray, InterpreterResult, CallRequest } from '@fluencelabs/avm-runner-interface'; import { isBrowser, isNode, isWebWorker } from 'browser-or-node'; import { expose } from 'threads'; import { wasmLoadingMethod, RunnerScriptInterface } from './types'; +import { init } from '@fluencelabs/marine-js'; + +type LogImport = { + log_utf8_string: (level: any, target: any, offset: any, size: any) => void; +}; + +type ImportObject = { + host: LogImport; +}; + +type HostImportsConfig = { + exports: any; +}; const logFunction = (level: LogLevel, message: string) => { switch (level) { @@ -22,51 +37,148 @@ const logFunction = (level: LogLevel, message: string) => { } }; -let airInterpreter: AirInterpreter | 'not-set' | 'terminated' = 'not-set'; +let cachegetUint8Memory0 = null; + +function getUint8Memory0(wasm) { + if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { + cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); + } + return cachegetUint8Memory0; +} + +function getStringFromWasm0(wasm, ptr, len) { + return decoder.decode(getUint8Memory0(wasm).subarray(ptr, ptr + len)); +} + +/// Returns import object that describes host functions called by AIR interpreter +function newImportObject(cfg: HostImportsConfig): ImportObject { + return { + host: log_import(cfg), + }; +} + +function log_import(cfg: HostImportsConfig): LogImport { + return { + log_utf8_string: (level: any, target: any, offset: any, size: any) => { + let wasm = cfg.exports; + + try { + let str = getStringFromWasm0(wasm, offset, size); + let levelStr: LogLevel; + switch (level) { + case 1: + levelStr = 'error'; + break; + case 2: + levelStr = 'warn'; + break; + case 3: + levelStr = 'info'; + break; + case 4: + levelStr = 'debug'; + break; + case 6: + levelStr = 'trace'; + break; + default: + return; + } + logFunction(levelStr, str); + } finally { + } + }, + }; +} + +type Awaited = T extends PromiseLike ? U : T; + +let marineInstance: Awaited> | 'not-set' | 'terminated' = 'not-set'; + +const tryLoadFromUrl = async (baseUrl: string, url: string): Promise => { + const fullUrl = baseUrl + '/' + url; + try { + return await WebAssembly.compileStreaming(fetch(fullUrl)); + } catch (e) { + throw new Error( + `Failed to load ${fullUrl}. This usually means that the web server is not serving wasm files correctly. Original error: ${e.toString()}`, + ); + } +}; + +const tryLoadFromFs = async (path: string): Promise => { + try { + // webpack will complain about missing dependencies for web target + // to fix this we have to use eval('require') + const fs = eval('require')('fs'); + const file = fs.readFileSync(path); + return await WebAssembly.compile(file); + } catch (e) { + throw new Error(`Failed to load ${path}. ${e.toString()}`); + } +}; + +const decoder = new TextDecoder(); const toExpose: RunnerScriptInterface = { init: async (logLevel: LogLevel, loadMethod: wasmLoadingMethod) => { - let module: WebAssembly.Module; + let avmModule: WebAssembly.Module; + let marineModule: WebAssembly.Module; if (isBrowser || isWebWorker) { if (loadMethod.method !== 'fetch-from-url') { throw new Error("Only 'fetch-from-url' is supported for browsers"); } - - const url = loadMethod.baseUrl + '/' + loadMethod.filePath; - - try { - module = await WebAssembly.compileStreaming(fetch(url)); - } catch (e) { - throw new Error( - `Failed to load ${url}. This usually means that the web server is not serving avm file correctly. Original error: ${e.toString()}`, - ); - } + avmModule = await tryLoadFromUrl(loadMethod.baseUrl, loadMethod.filePaths.avm); + marineModule = await tryLoadFromUrl(loadMethod.baseUrl, loadMethod.filePaths.marine); } else if (isNode) { if (loadMethod.method !== 'read-from-fs') { throw new Error("Only 'read-from-fs' is supported for nodejs"); } - try { - // webpack will complain about missing dependencies for web target - // to fix this we have to use eval('require') - const fs = eval('require')('fs'); - const file = fs.readFileSync(loadMethod.filePath); - module = await WebAssembly.compile(file); - } catch (e) { - throw new Error( - `Failed to load ${ - loadMethod.filePath - }. Did you forget to install @fluencelabs/avm? Original error: ${e.toString()}`, - ); - } + avmModule = await tryLoadFromFs(loadMethod.filePaths.avm); + marineModule = await tryLoadFromFs(loadMethod.filePaths.marine); } else { throw new Error('Environment not supported'); } - airInterpreter = await AirInterpreter.create(module, logLevel, logFunction); + + // wasi is needed to run AVM with marine-js + const wasmFs = new WasmFs(); + const wasi = new WASI({ + args: [], + env: {}, + bindings: { + ...bindings, + fs: wasmFs.fs, + }, + }); + + const cfg = { + exports: undefined, + }; + + const avmInstance = await WebAssembly.instantiate(avmModule, { + ...wasi.getImports(avmModule), + ...newImportObject(cfg) + }); + wasi.start(avmInstance); + cfg.exports = avmInstance.exports; + + marineInstance = await init(marineModule); + + const customSections = WebAssembly.Module.customSections(avmModule, 'interface-types'); + const itCustomSections = new Uint8Array(customSections[0]); + let rawResult = marineInstance.register_module('avm', itCustomSections, avmInstance); + + let result: any; + try { + result = JSON.parse(rawResult); + } catch (ex) { + throw "register_module result parsing error: " + ex + ", original text: " + rawResult; + } }, terminate: async () => { - airInterpreter = 'not-set'; + marineInstance = 'not-set'; }, run: async ( @@ -79,15 +191,107 @@ const toExpose: RunnerScriptInterface = { }, callResults: CallResultsArray, ): Promise => { - if (airInterpreter === 'not-set') { + if (marineInstance === 'not-set') { throw new Error('Interpreter is not initialized'); } - if (airInterpreter === 'terminated') { + if (marineInstance === 'terminated') { throw new Error('Interpreter is terminated'); } - return airInterpreter.invoke(air, prevData, data, params, callResults); + try { + const callResultsToPass: any = {}; + for (let [k, v] of callResults) { + callResultsToPass[k] = { + ret_code: v.retCode, + result: v.result, + }; + } + + const paramsToPass = { + init_peer_id: params.initPeerId, + current_peer_id: params.currentPeerId, + }; + + const avmArg = JSON.stringify([ + air, + Array.from(prevData), + Array.from(data), + paramsToPass, + Array.from(Buffer.from(JSON.stringify(callResultsToPass))), + ]); + + const rawResult = marineInstance.call_module('avm', 'invoke', avmArg); + + let result: any; + try { + result = JSON.parse(rawResult); + } catch (ex) { + throw "call_module result parsing error: " + ex + ", original text: " + rawResult; + } + + if (result.error !== "") { + throw "call_module returned error: " + result.error; + } + + result = result.result; + + const callRequestsStr = decoder.decode(new Uint8Array(result.call_requests)); + let parsedCallRequests; + try { + if (callRequestsStr.length === 0) { + parsedCallRequests = {}; + } else { + parsedCallRequests = JSON.parse(callRequestsStr); + } + } catch (e) { + throw "Couldn't parse call requests: " + e + '. Original string is: ' + callRequestsStr; + } + + let resultCallRequests: Array<[key: number, callRequest: CallRequest]> = []; + for (const k in parsedCallRequests) { + const v = parsedCallRequests[k]; + + let arguments_; + let tetraplets; + try { + arguments_ = JSON.parse(v.arguments); + } catch (e) { + throw "Couldn't parse arguments: " + e + '. Original string is: ' + arguments_; + } + + try { + tetraplets = JSON.parse(v.tetraplets); + } catch (e) { + throw "Couldn't parse tetraplets: " + e + '. Original string is: ' + tetraplets; + } + + resultCallRequests.push([ + k as any, + { + serviceId: v.service_id, + functionName: v.function_name, + arguments: arguments_, + tetraplets: tetraplets, + }, + ]); + } + return { + retCode: result.ret_code, + errorMessage: result.error_message, + data: result.data, + nextPeerPks: result.next_peer_pks, + callRequests: resultCallRequests, + }; + } catch (e) { + return { + retCode: -1, + errorMessage: 'marine-js call failed, ' + e, + data: undefined, + nextPeerPks: undefined, + callRequests: undefined, + }; + } }, }; diff --git a/runner-script/src/types.ts b/runner-script/src/types.ts index c4e5641..3c1920f 100644 --- a/runner-script/src/types.ts +++ b/runner-script/src/types.ts @@ -16,15 +16,20 @@ import { CallResultsArray, InterpreterResult, LogLevel } from '@fluencelabs/avm-runner-interface'; +interface FilePaths { + avm: string; + marine: string; +} + export type wasmLoadingMethod = | { method: 'fetch-from-url'; baseUrl: string; - filePath: string; + filePaths: FilePaths; } | { method: 'read-from-fs'; - filePath: string; + filePaths: FilePaths; }; export type RunnerScriptInterface = { diff --git a/runner-script/webpack.config.js b/runner-script/webpack.config.js index 0771475..b5afcc7 100644 --- a/runner-script/webpack.config.js +++ b/runner-script/webpack.config.js @@ -2,9 +2,9 @@ const path = require('path'); -const isProduction = true; +// const isProduction = true; // uncomment to debug -// const isProduction = false; +const isProduction = false; const config = { entry: './src/index.ts', diff --git a/tests/node-negative/src/__test__/test.spec.ts b/tests/node-negative/src/__test__/test.spec.ts index 6f1a954..c677f54 100644 --- a/tests/node-negative/src/__test__/test.spec.ts +++ b/tests/node-negative/src/__test__/test.spec.ts @@ -15,6 +15,6 @@ describe('NodeJS negative tests', () => { const res = await testRunner.init('off').catch((e) => e.message); // assert - expect(res).toMatch('Failed to load avm.wasm. Did you forget to install @fluencelabs/avm?'); + expect(res).toMatch('Failed to load wasm file(s).'); }); }); diff --git a/tests/node/package-lock.json b/tests/node/package-lock.json index 6ab409f..96af638 100644 --- a/tests/node/package-lock.json +++ b/tests/node/package-lock.json @@ -6,7 +6,8 @@ "packages": { "": { "dependencies": { - "@fluencelabs/avm": "0.19.6" + "@fluencelabs/avm": "0.20.0-marine-web.3", + "@fluencelabs/marine-js": "0.1.0-web-runtime-experiments.0" }, "devDependencies": { "@types/jest": "^27.0.3", @@ -17,6 +18,43 @@ "typescript": "^4.0.0" } }, + "../../../aquavm/avm/client": { + "name": "@fluencelabs/avm", + "version": "0.0.0", + "extraneous": true, + "license": "Apache 2.0", + "bin": { + "copy-avm": "dist/copyAvm.js" + }, + "devDependencies": { + "@types/node": "^14.0.0", + "typescript": "^4.0.0" + } + }, + "../../../marine/web-runtime/npm-package": { + "name": "@fluencelabs/marine-js", + "version": "0.0.3", + "extraneous": true, + "license": "Apache 2.0", + "bin": { + "copy-marine": "dist/copyMarine.js" + }, + "devDependencies": { + "@fluencelabs/avm": "0.20.0-marine-web-adapted.1", + "@types/jest": "^27.4.0", + "@types/node": "^14.0.0", + "@wasmer/wasi": "^0.12.0", + "@wasmer/wasmfs": "^0.12.0", + "jest": "^27.2.4", + "typescript": "^4.0.0" + } + }, + "../../aquavm/avm/client": { + "extraneous": true + }, + "../../marine/web-runtime/npm-package": { + "extraneous": true + }, "node_modules/@babel/code-frame": { "version": "7.16.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", @@ -578,13 +616,21 @@ "dev": true }, "node_modules/@fluencelabs/avm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.19.6.tgz", - "integrity": "sha512-T6UQsIuGVltf13Wc3bFmuCYmQzu/00Y4lPS7atBauQ2R4+BqhRg1dc5reSZ+MbAW3Vy+NmJY1EEYOFRpLCGBwg==", + "version": "0.20.0-marine-web.3", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.20.0-marine-web.3.tgz", + "integrity": "sha512-sYh3CEGPaa3feI1nNbrhNVhqvX+LBoadufRIqL2MUgYD0htoteJZ8l+MsSodieCZeISfIgBQCYXKCVKB7qwyOA==", "bin": { "copy-avm": "dist/copyAvm.js" } }, + "node_modules/@fluencelabs/marine-js": { + "version": "0.1.0-web-runtime-experiments.0", + "resolved": "https://registry.npmjs.org/@fluencelabs/marine-js/-/marine-js-0.1.0-web-runtime-experiments.0.tgz", + "integrity": "sha512-UQxTtACJLNJcTaD10LQ2hIA1x5/yN6S4XT0Kn8wCYVz/QbD/itb47x8+wA582HNKEbJpHuj0A098UYrt6+WpQA==", + "bin": { + "copy-marine": "dist/copyMarine.js" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -4651,9 +4697,14 @@ "dev": true }, "@fluencelabs/avm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.19.6.tgz", - "integrity": "sha512-T6UQsIuGVltf13Wc3bFmuCYmQzu/00Y4lPS7atBauQ2R4+BqhRg1dc5reSZ+MbAW3Vy+NmJY1EEYOFRpLCGBwg==" + "version": "0.20.0-marine-web.3", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.20.0-marine-web.3.tgz", + "integrity": "sha512-sYh3CEGPaa3feI1nNbrhNVhqvX+LBoadufRIqL2MUgYD0htoteJZ8l+MsSodieCZeISfIgBQCYXKCVKB7qwyOA==" + }, + "@fluencelabs/marine-js": { + "version": "0.1.0-web-runtime-experiments.0", + "resolved": "https://registry.npmjs.org/@fluencelabs/marine-js/-/marine-js-0.1.0-web-runtime-experiments.0.tgz", + "integrity": "sha512-UQxTtACJLNJcTaD10LQ2hIA1x5/yN6S4XT0Kn8wCYVz/QbD/itb47x8+wA582HNKEbJpHuj0A098UYrt6+WpQA==" }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", diff --git a/tests/node/package.json b/tests/node/package.json index 5555276..30c674e 100644 --- a/tests/node/package.json +++ b/tests/node/package.json @@ -13,6 +13,7 @@ "typescript": "^4.0.0" }, "dependencies": { - "@fluencelabs/avm": "0.19.6" + "@fluencelabs/avm": "0.20.8", + "@fluencelabs/marine-js": "0.1.0" } } diff --git a/tests/node/src/__test__/test.spec.ts b/tests/node/src/__test__/test.spec.ts index 1fefccd..c69f209 100644 --- a/tests/node/src/__test__/test.spec.ts +++ b/tests/node/src/__test__/test.spec.ts @@ -26,6 +26,9 @@ describe('Nodejs integration tests', () => { await testRunner.terminate(); // assert - expect(res).not.toBeUndefined(); + expect(res).toMatchObject({ + retCode: 0, + errorMessage: '', + }); }); }); diff --git a/tests/web/build_test_project.sh b/tests/web/build_test_project.sh index 9953266..8a4c648 100755 --- a/tests/web/build_test_project.sh +++ b/tests/web/build_test_project.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + # set current working directory to script directory to run script from everywhere cd "$(dirname "$0")" diff --git a/tests/web/package.json b/tests/web/package.json index 420a309..8a7fa5b 100644 --- a/tests/web/package.json +++ b/tests/web/package.json @@ -1,6 +1,7 @@ { "scripts": { - "test": "jest --runInBand" + "test": "jest --runInBand", + "test:verbose": "jest --runInBand --verbose" }, "devDependencies": { "@types/jest": "^27.0.3", diff --git a/tests/web/src/__test__/test.spec.ts b/tests/web/src/__test__/test.spec.ts index 7558c7b..c1c938e 100644 --- a/tests/web/src/__test__/test.spec.ts +++ b/tests/web/src/__test__/test.spec.ts @@ -13,11 +13,11 @@ let server; jest.setTimeout(10000); const startServer = async (modifyConfig?) => { - const loadInBrowserToDebug = true; // set to true to debug + const loadInBrowserToDebug = false; // set to true to debug modifyConfig = modifyConfig || ((_) => {}); - const cfg = webpackConfig(); + const cfg: any = webpackConfig(); modifyConfig(cfg); const compiler = Webpack(cfg); const devServerOptions = { ...cfg.devServer, open: loadInBrowserToDebug }; diff --git a/tests/web/test-project/package-lock.json b/tests/web/test-project/package-lock.json index a1f86a2..35b79e7 100644 --- a/tests/web/test-project/package-lock.json +++ b/tests/web/test-project/package-lock.json @@ -9,7 +9,8 @@ "js-base64": "^3.7.2" }, "devDependencies": { - "@fluencelabs/avm": "0.19.6", + "@fluencelabs/avm": "0.20.0-marine-web.3", + "@fluencelabs/marine-js": "^0.1.0-web-runtime-experiments.0", "@webpack-cli/generators": "^2.4.1", "css-loader": "^6.5.1", "html-webpack-plugin": "^5.5.0", @@ -130,14 +131,23 @@ } }, "node_modules/@fluencelabs/avm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.19.6.tgz", - "integrity": "sha512-T6UQsIuGVltf13Wc3bFmuCYmQzu/00Y4lPS7atBauQ2R4+BqhRg1dc5reSZ+MbAW3Vy+NmJY1EEYOFRpLCGBwg==", + "version": "0.20.0-marine-web.3", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.20.0-marine-web.3.tgz", + "integrity": "sha512-sYh3CEGPaa3feI1nNbrhNVhqvX+LBoadufRIqL2MUgYD0htoteJZ8l+MsSodieCZeISfIgBQCYXKCVKB7qwyOA==", "dev": true, "bin": { "copy-avm": "dist/copyAvm.js" } }, + "node_modules/@fluencelabs/marine-js": { + "version": "0.1.0-web-runtime-experiments.0", + "resolved": "https://registry.npmjs.org/@fluencelabs/marine-js/-/marine-js-0.1.0-web-runtime-experiments.0.tgz", + "integrity": "sha512-UQxTtACJLNJcTaD10LQ2hIA1x5/yN6S4XT0Kn8wCYVz/QbD/itb47x8+wA582HNKEbJpHuj0A098UYrt6+WpQA==", + "dev": true, + "bin": { + "copy-marine": "dist/copyMarine.js" + } + }, "node_modules/@mrmlnc/readdir-enhanced": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", @@ -9277,9 +9287,15 @@ "dev": true }, "@fluencelabs/avm": { - "version": "0.19.6", - "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.19.6.tgz", - "integrity": "sha512-T6UQsIuGVltf13Wc3bFmuCYmQzu/00Y4lPS7atBauQ2R4+BqhRg1dc5reSZ+MbAW3Vy+NmJY1EEYOFRpLCGBwg==", + "version": "0.20.0-marine-web.3", + "resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.20.0-marine-web.3.tgz", + "integrity": "sha512-sYh3CEGPaa3feI1nNbrhNVhqvX+LBoadufRIqL2MUgYD0htoteJZ8l+MsSodieCZeISfIgBQCYXKCVKB7qwyOA==", + "dev": true + }, + "@fluencelabs/marine-js": { + "version": "0.1.0-web-runtime-experiments.0", + "resolved": "https://registry.npmjs.org/@fluencelabs/marine-js/-/marine-js-0.1.0-web-runtime-experiments.0.tgz", + "integrity": "sha512-UQxTtACJLNJcTaD10LQ2hIA1x5/yN6S4XT0Kn8wCYVz/QbD/itb47x8+wA582HNKEbJpHuj0A098UYrt6+WpQA==", "dev": true }, "@mrmlnc/readdir-enhanced": { diff --git a/tests/web/test-project/package.json b/tests/web/test-project/package.json index acb5b7b..7ef1448 100644 --- a/tests/web/test-project/package.json +++ b/tests/web/test-project/package.json @@ -1,7 +1,7 @@ { "scripts": { "start": "webpack serve", - "copy-public": "copy-avm public && copy-avm-runner public", + "copy-public": "copy-avm public && copy-marine public && copy-avm-runner public", "install:local": "install-local ../../../avm-runner-background", "build": "webpack --mode=production --node-env=production", "build:dev": "webpack --mode=development", @@ -21,7 +21,8 @@ "webpack": "^5.65.0", "webpack-cli": "^4.9.1", "webpack-dev-server": "^4.6.0", - "@fluencelabs/avm": "0.19.6" + "@fluencelabs/avm": "0.20.8", + "@fluencelabs/marine-js": "0.1.0" }, "dependencies": { "js-base64": "^3.7.2" diff --git a/tests/web/test-project/public/runnerScript.web.js b/tests/web/test-project/public/runnerScript.web.js index 6a88913..ef823b5 100644 --- a/tests/web/test-project/public/runnerScript.web.js +++ b/tests/web/test-project/public/runnerScript.web.js @@ -1 +1,871 @@ -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=9)}([function(e,t,r){"use strict";t.a={isWorkerRuntime:function(){const e="undefined"!=typeof self&&"undefined"!=typeof Window&&self instanceof Window;return!("undefined"==typeof self||!self.postMessage||e)},postMessageToMaster:function(e,t){self.postMessage(e,t)},subscribeToMasterMessages:function(e){const t=t=>{e(t.data)};return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u}));const n={deserialize:e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}),serialize:e=>({__error_marker:"$$error",message:e.message,name:e.name,stack:e.stack})};let o={deserialize(e){return(t=e)&&"object"==typeof t&&"__error_marker"in t&&"$$error"===t.__error_marker?n.deserialize(e):e;var t},serialize:e=>e instanceof Error?n.serialize(e):e};function i(e){return o.deserialize(e)}function u(e){return o.serialize(e)}},function(e,t,r){"use strict";var n,o;r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o})),function(e){e.cancel="cancel",e.run="run"}(n||(n={})),function(e){e.error="error",e.init="init",e.result="result",e.running="running",e.uncaughtError="uncaughtError"}(o||(o={}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));Symbol("thread.errors"),Symbol("thread.events"),Symbol("thread.terminate");const n=Symbol("thread.transferable");Symbol("thread.worker");function o(e){return e&&"object"==typeof e&&e[n]}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n="undefined"!=typeof window&&void 0!==window.document,o=void 0!==e&&null!=e.versions&&null!=e.versions.node,i="object"===("undefined"==typeof self?"undefined":r(self))&&self.constructor&&"DedicatedWorkerGlobalScope"===self.constructor.name,u="undefined"!=typeof window&&"nodejs"===window.name||"undefined"!=typeof navigator&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),s="undefined"!=typeof Deno&&void 0!==Deno.core;t.isBrowser=n,t.isWebWorker=i,t.isNode=o,t.isJsDom=u,t.isDeno=s}).call(this,r(5))},function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:u}catch(e){n=u}}();var a,c=[],l=!1,f=-1;function p(){l&&a&&(l=!1,a.length?c=a.concat(c):f=-1,c.length&&d())}function d(){if(!l){var e=s(p);l=!0;for(var t=c.length;t;){for(a=c,c=[];++f1)for(var r=1;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&t._extend(n,r),g(n.showHidden)&&(n.showHidden=!1),g(n.depth)&&(n.depth=2),g(n.colors)&&(n.colors=!1),g(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),l(n,e,n.depth)}function a(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function c(e,t){return e}function l(e,r,n){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return h(o)||(o=l(e,o,n)),o}var i=function(e,t){if(g(t))return e.stylize("undefined","undefined");if(h(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(_(t))return e.stylize(""+t,"number");if(y(t))return e.stylize(""+t,"boolean");if(b(t))return e.stylize("null","null")}(e,r);if(i)return i;var u=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(r)),O(r)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return f(r);if(0===u.length){if(E(r)){var a=r.name?": "+r.name:"";return e.stylize("[Function"+a+"]","special")}if(m(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(O(r))return f(r)}var c,v="",j=!1,M=["{","}"];(d(r)&&(j=!0,M=["[","]"]),E(r))&&(v=" [Function"+(r.name?": "+r.name:"")+"]");return m(r)&&(v=" "+RegExp.prototype.toString.call(r)),w(r)&&(v=" "+Date.prototype.toUTCString.call(r)),O(r)&&(v=" "+f(r)),0!==u.length||j&&0!=r.length?n<0?m(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=j?function(e,t,r,n,o){for(var i=[],u=0,s=t.length;u=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,v,M)):M[0]+v+M[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,o,i){var u,s,a;if((a=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=a.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):a.set&&(s=e.stylize("[Setter]","special")),P(n,o)||(u="["+o+"]"),s||(e.seen.indexOf(a.value)<0?(s=b(r)?l(e,a.value,null):l(e,a.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),g(u)){if(i&&o.match(/^\d+$/))return s;(u=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+s}function d(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function b(e){return null===e}function _(e){return"number"==typeof e}function h(e){return"string"==typeof e}function g(e){return void 0===e}function m(e){return v(e)&&"[object RegExp]"===j(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===j(e)}function O(e){return v(e)&&("[object Error]"===j(e)||e instanceof Error)}function E(e){return"function"==typeof e}function j(e){return Object.prototype.toString.call(e)}function M(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(g(i)&&(i=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!u[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var n=e.pid;u[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else u[r]=function(){};return u[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=y,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=_,t.isString=h,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=g,t.isRegExp=m,t.isObject=v,t.isDate=w,t.isError=O,t.isFunction=E,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(11);var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(){var e=new Date,t=[M(e.getHours()),M(e.getMinutes()),M(e.getSeconds())].join(":");return[e.getDate(),T[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",x(),t.format.apply(t,arguments))},t.inherits=r(12),t._extend=function(e,t){if(!t||!v(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var S="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function k(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(S&&e[S]){var t;if("function"!=typeof(t=e[S]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,S,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),o=[],i=0;i0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]!!e&&("symbol"==typeof Symbol.observable&&"function"==typeof e[Symbol.observable]?e===e[Symbol.observable]():"function"==typeof e["@@observable"]&&e===e["@@observable"]())},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);var _fluencelabs_avm__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(7),_fluencelabs_avm__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_fluencelabs_avm__WEBPACK_IMPORTED_MODULE_0__),browser_or_node__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(4),browser_or_node__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(browser_or_node__WEBPACK_IMPORTED_MODULE_1__),threads__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(13);const logFunction=(e,t)=>{switch(e){case"error":console.error(t);break;case"warn":console.warn(t);break;case"info":console.info(t);break;case"debug":case"trace":console.log(t)}};let airInterpreter=null;const toExpose={init:async(logLevel,loadMethod)=>{let module;if(browser_or_node__WEBPACK_IMPORTED_MODULE_1__.isBrowser||browser_or_node__WEBPACK_IMPORTED_MODULE_1__.isWebWorker){if("fetch-from-url"!==loadMethod.method)throw new Error("Only 'fetch-from-url' is supported for browsers");const e=loadMethod.baseUrl+loadMethod.filePath;try{module=await WebAssembly.compileStreaming(fetch(e))}catch(e){throw new Error(`Failed to load ${loadMethod.filePath}. This usually means that the web server is not serving avm file correctly. Original error: ${e.toString()}`)}}else{if(!browser_or_node__WEBPACK_IMPORTED_MODULE_1__.isNode)throw new Error("Environment not supported");if("read-from-fs"!==loadMethod.method)throw new Error("Only 'read-from-fs' is supported for nodejs");try{const fs=eval("require")("fs"),file=fs.readFileSync(loadMethod.filePath);module=await WebAssembly.compile(file)}catch(e){throw new Error(`Failed to load ${loadMethod.filePath}. Did you forget to install @fluencelabs/avm? Original error: ${e.toString()}`)}}airInterpreter=await _fluencelabs_avm__WEBPACK_IMPORTED_MODULE_0__.AirInterpreter.create(module,logLevel,logFunction)},terminate:async()=>{airInterpreter=null},run:async(e,t,r,n,o)=>{if(null===airInterpreter)throw new Error("Interpreter is not initialized");return airInterpreter.invoke(e,t,r,n,o)}};Object(threads__WEBPACK_IMPORTED_MODULE_2__.a)(toExpose)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invoke=t.getStringFromWasm0=t.main=void 0,t.main=function(e){e.main()};var n=0,o=null;function i(e){return null!==o&&o.buffer===e.memory.buffer||(o=new Uint8Array(e.memory.buffer)),o}var u=new("undefined"==typeof TextEncoder?r(6).TextEncoder:TextEncoder)("utf-8"),s="function"==typeof u.encodeInto?function(e,t){return u.encodeInto(e,t)}:function(e,t){var r=u.encode(e);return t.set(r),{read:e.length,written:r.length}};function a(e,t,r,o){if(void 0===o){var a=u.encode(t),c=r(a.length);return i(e).subarray(c,c+a.length).set(a),n=a.length,c}for(var l=t.length,f=r(l),p=i(e),d=0;d127)break;p[f+d]=y}if(d!==l){0!==d&&(t=t.slice(d)),f=o(f,l,l=d+3*t.length);var b=i(e).subarray(f+d,f+l);d+=s(t,b).written}return n=d,f}function c(e,t,r){var o=r(1*t.length);return i(e).set(t,o/1),n=t.length,o}var l=null;function f(e){return null!==l&&l.buffer===e.memory.buffer||(l=new Int32Array(e.memory.buffer)),l}var p=new("undefined"==typeof TextDecoder?r(6).TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});function d(e,t,r){return p.decode(i(e).subarray(t,t+r))}p.decode(),t.getStringFromWasm0=d,t.invoke=function(e,t,r,o,i,u,s){try{var l=a(e,t,e.__wbindgen_malloc,e.__wbindgen_realloc),p=n,y=c(e,r,e.__wbindgen_malloc),b=n,_=c(e,o,e.__wbindgen_malloc),h=n,g=c(e,i,e.__wbindgen_malloc),m=n,v=c(e,u,e.__wbindgen_malloc),w=n,O=a(e,s,e.__wbindgen_malloc,e.__wbindgen_realloc),E=n;e.invoke(8,l,p,y,b,_,h,g,m,v,w,O,E);var j=f(e)[2],M=f(e)[3];return d(e,j,M)}finally{e.__wbindgen_free(j,M)}}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return m}));var n=r(8),o=r.n(n),i=r(1),u=r(3),s=r(2),a=r(0),c=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function u(e){try{a(n.next(e))}catch(e){i(e)}}function s(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,s)}a((n=n.apply(e,t||[])).next())}))};a.a.isWorkerRuntime;let l=!1;const f=new Map,p=e=>e&&e.type===s.a.run,d=e=>o()(e)||function(e){return e&&"object"==typeof e&&"function"==typeof e.subscribe}(e);function y(e){return Object(u.a)(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function b(e,t){const{payload:r,transferables:n}=y(t),o={type:s.b.error,uid:e,error:Object(i.b)(r)};a.a.postMessageToMaster(o,n)}function _(e,t,r){const{payload:n,transferables:o}=y(r),i={type:s.b.result,uid:e,complete:!!t||void 0,payload:n};a.a.postMessageToMaster(i,o)}function h(e){try{const t={type:s.b.uncaughtError,error:Object(i.b)(e)};a.a.postMessageToMaster(t)}catch(t){console.error("Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.\nLatest error:",t,"\nOriginal error:",e)}}function g(e,t,r){return c(this,void 0,void 0,(function*(){let n;try{n=t(...r)}catch(t){return b(e,t)}const o=d(n)?"observable":"promise";if(function(e,t){const r={type:s.b.running,uid:e,resultType:t};a.a.postMessageToMaster(r)}(e,o),d(n)){const t=n.subscribe(t=>_(e,!1,Object(i.b)(t)),t=>{b(e,Object(i.b)(t)),f.delete(e)},()=>{_(e,!0),f.delete(e)});f.set(e,t)}else try{const t=yield n;_(e,!0,Object(i.b)(t))}catch(t){b(e,Object(i.b)(t))}}))}function m(e){if(!a.a.isWorkerRuntime())throw Error("expose() called in the master thread.");if(l)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(l=!0,"function"==typeof e)a.a.subscribeToMasterMessages(t=>{p(t)&&!t.method&&g(t.uid,e,t.args.map(i.a))}),function(){const e={type:s.b.init,exposed:{type:"function"}};a.a.postMessageToMaster(e)}();else{if("object"!=typeof e||!e)throw Error("Invalid argument passed to expose(). Expected a function or an object, got: "+e);a.a.subscribeToMasterMessages(t=>{p(t)&&t.method&&g(t.uid,e[t.method],t.args.map(i.a))});!function(e){const t={type:s.b.init,exposed:{type:"module",methods:e}};a.a.postMessageToMaster(t)}(Object.keys(e).filter(t=>"function"==typeof e[t]))}a.a.subscribeToMasterMessages(e=>{if((t=e)&&t.type===s.a.cancel){const t=e.uid,r=f.get(t);r&&(r.unsubscribe(),f.delete(t))}var t})}"undefined"!=typeof self&&"function"==typeof self.addEventListener&&a.a.isWorkerRuntime()&&(self.addEventListener("error",e=>{setTimeout(()=>h(e.error||e),250)}),self.addEventListener("unhandledrejection",e=>{const t=e.reason;t&&"string"==typeof t.message&&setTimeout(()=>h(t),250)})),void 0!==e&&"function"==typeof e.on&&a.a.isWorkerRuntime()&&(e.on("uncaughtException",e=>{setTimeout(()=>h(e),250)}),e.on("unhandledRejection",e=>{e&&"string"==typeof e.message&&setTimeout(()=>h(e),250)}))}).call(this,r(5))}]); \ No newline at end of file +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./node_modules/@fluencelabs/marine-js/dist/index.js": +/*!***********************************************************!*\ + !*** ./node_modules/@fluencelabs/marine-js/dist/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.init = void 0;\nvar marine_web_runtime_1 = __webpack_require__(/*! ./marine_web_runtime */ \"./node_modules/@fluencelabs/marine-js/dist/marine_web_runtime.js\");\nObject.defineProperty(exports, \"init\", { enumerable: true, get: function () { return marine_web_runtime_1.init; } });\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@fluencelabs/marine-js/dist/index.js?"); + +/***/ }), + +/***/ "./node_modules/@fluencelabs/marine-js/dist/marine_web_runtime.js": +/*!************************************************************************!*\ + !*** ./node_modules/@fluencelabs/marine-js/dist/marine_web_runtime.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.init = void 0;\nvar marine_js_js_1 = __webpack_require__(/*! ./snippets/marine-web-runtime-6faa67b8af9cc173/marine-js.js */ \"./node_modules/@fluencelabs/marine-js/dist/snippets/marine-web-runtime-6faa67b8af9cc173/marine-js.js\");\nfunction init(module) {\n return __awaiter(this, void 0, void 0, function () {\n function getObject(idx) {\n return heap[idx];\n }\n function dropObject(idx) {\n if (idx < 36)\n return;\n heap[idx] = heap_next;\n heap_next = idx;\n }\n function takeObject(idx) {\n var ret = getObject(idx);\n dropObject(idx);\n return ret;\n }\n function getUint8Memory0() {\n if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {\n cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachegetUint8Memory0;\n }\n function getStringFromWasm0(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));\n }\n function getArrayU8FromWasm0(ptr, len) {\n return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);\n }\n function addHeapObject(obj) {\n if (heap_next === heap.length)\n heap.push(heap.length + 1);\n var idx = heap_next;\n heap_next = heap[idx];\n heap[idx] = obj;\n return idx;\n }\n function passStringToWasm0(arg, malloc, realloc) {\n if (realloc === undefined) {\n var buf = cachedTextEncoder.encode(arg);\n var ptr_1 = malloc(buf.length);\n getUint8Memory0()\n .subarray(ptr_1, ptr_1 + buf.length)\n .set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr_1;\n }\n var len = arg.length;\n var ptr = malloc(len);\n var mem = getUint8Memory0();\n var offset = 0;\n for (; offset < len; offset++) {\n var code = arg.charCodeAt(offset);\n if (code > 0x7f)\n break;\n mem[ptr + offset] = code;\n }\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, (len = offset + arg.length * 3));\n var view = getUint8Memory0().subarray(ptr + offset, ptr + len);\n var ret = encodeString(arg, view);\n offset += ret.written;\n }\n WASM_VECTOR_LEN = offset;\n return ptr;\n }\n function getInt32Memory0() {\n if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {\n cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);\n }\n return cachegetInt32Memory0;\n }\n function passArray8ToWasm0(arg, malloc) {\n var ptr = malloc(arg.length * 1);\n getUint8Memory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n }\n /**\n * @param {string} name\n * @param {Uint8Array} wit_section_bytes\n * @param {any} wasm_instance\n * @returns {string}\n */\n function register_module(name, wit_section_bytes, wasm_instance) {\n try {\n var retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n var ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ptr1 = passArray8ToWasm0(wit_section_bytes, wasm.__wbindgen_malloc);\n var len1 = WASM_VECTOR_LEN;\n wasm.register_module(retptr, ptr0, len0, ptr1, len1, addHeapObject(wasm_instance));\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n return getStringFromWasm0(r0, r1);\n }\n finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_free(r0, r1);\n }\n }\n /**\n * @param {string} module_name\n * @param {string} function_name\n * @param {string} args\n * @returns {string}\n */\n function call_module(module_name, function_name, args) {\n try {\n var retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n var ptr0 = passStringToWasm0(module_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n var ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len1 = WASM_VECTOR_LEN;\n var ptr2 = passStringToWasm0(args, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len2 = WASM_VECTOR_LEN;\n wasm.call_module(retptr, ptr0, len0, ptr1, len1, ptr2, len2);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n return getStringFromWasm0(r0, r1);\n }\n finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_free(r0, r1);\n }\n }\n function init(wasmModule) {\n return __awaiter(this, void 0, void 0, function () {\n var imports, instance;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n imports = {};\n imports.wbg = {};\n imports.wbg.__wbg_new_693216e109162396 = function () {\n var ret = new Error();\n return addHeapObject(ret);\n };\n imports.wbg.__wbg_stack_0ddaca5d1abfb52f = function (arg0, arg1) {\n var ret = getObject(arg1).stack;\n var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len0;\n getInt32Memory0()[arg0 / 4 + 0] = ptr0;\n };\n imports.wbg.__wbg_error_09919627ac0992f5 = function (arg0, arg1) {\n try {\n console.error(getStringFromWasm0(arg0, arg1));\n }\n finally {\n wasm.__wbindgen_free(arg0, arg1);\n }\n };\n imports.wbg.__wbindgen_object_drop_ref = function (arg0) {\n takeObject(arg0);\n };\n imports.wbg.__wbg_writebyterange_313d990e0a3436b6 = function (arg0, arg1, arg2, arg3) {\n (0, marine_js_js_1.write_byte_range)(getObject(arg0), arg1 >>> 0, getArrayU8FromWasm0(arg2, arg3));\n };\n imports.wbg.__wbg_callexport_cb1a6ee1197892bd = function (arg0, arg1, arg2, arg3, arg4, arg5) {\n var ret = (0, marine_js_js_1.call_export)(getObject(arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5));\n var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len0;\n getInt32Memory0()[arg0 / 4 + 0] = ptr0;\n };\n imports.wbg.__wbg_readbyterange_ebea9d02dea05828 = function (arg0, arg1, arg2, arg3) {\n (0, marine_js_js_1.read_byte_range)(getObject(arg0), arg1 >>> 0, getArrayU8FromWasm0(arg2, arg3));\n };\n imports.wbg.__wbg_getmemorysize_385fa0bd4e2d9ff6 = function (arg0) {\n var ret = (0, marine_js_js_1.get_memory_size)(getObject(arg0));\n return ret;\n };\n imports.wbg.__wbg_writebyte_81064940ca9059c1 = function (arg0, arg1, arg2) {\n (0, marine_js_js_1.write_byte)(getObject(arg0), arg1 >>> 0, arg2);\n };\n imports.wbg.__wbg_readbyte_63aea980ce35d833 = function (arg0, arg1) {\n var ret = (0, marine_js_js_1.read_byte)(getObject(arg0), arg1 >>> 0);\n return ret;\n };\n return [4 /*yield*/, WebAssembly.instantiate(wasmModule, imports)];\n case 1:\n instance = _a.sent();\n wasm = instance.exports;\n // strange line from autogenerated code. No idea why it's needed\n init.__wbindgen_wasm_module = module;\n return [2 /*return*/, wasm];\n }\n });\n });\n }\n var wasm, heap, heap_next, cachedTextDecoder, cachegetUint8Memory0, WASM_VECTOR_LEN, cachedTextEncoder, encodeString, cachegetInt32Memory0;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n heap = new Array(32).fill(undefined);\n heap.push(undefined, null, true, false);\n heap_next = heap.length;\n cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n cachedTextDecoder.decode();\n cachegetUint8Memory0 = null;\n WASM_VECTOR_LEN = 0;\n cachedTextEncoder = new TextEncoder('utf-8');\n encodeString = typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n }\n : function (arg, view) {\n var buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length,\n };\n };\n cachegetInt32Memory0 = null;\n return [4 /*yield*/, init(module)];\n case 1:\n _a.sent();\n return [2 /*return*/, {\n wasm: wasm,\n register_module: register_module,\n call_module: call_module,\n }];\n }\n });\n });\n}\nexports.init = init;\n//# sourceMappingURL=marine_web_runtime.js.map\n\n//# sourceURL=webpack:///./node_modules/@fluencelabs/marine-js/dist/marine_web_runtime.js?"); + +/***/ }), + +/***/ "./node_modules/@fluencelabs/marine-js/dist/snippets/marine-web-runtime-6faa67b8af9cc173/marine-js.js": +/*!************************************************************************************************************!*\ + !*** ./node_modules/@fluencelabs/marine-js/dist/snippets/marine-web-runtime-6faa67b8af9cc173/marine-js.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.read_byte_range = exports.write_byte_range = exports.read_byte = exports.write_byte = exports.get_memory_size = exports.call_export = void 0;\nfunction call_export(instance, export_name, args) {\n var _a;\n //console.log(\"JS: call_export called with: \", instance, export_name, args)\n var parsed_args = JSON.parse(args);\n //console.log(\"parsed args: \", args);\n var prepared_args = [];\n for (var i = 0; i < parsed_args.length; i++) {\n var arg = parsed_args[i];\n // console.log(arg)\n prepared_args.push(arg[\"I32\"]);\n }\n //console.log(\"prepared args: \", prepared_args);\n var result = (_a = instance.exports)[export_name].apply(_a, prepared_args);\n //console.log(\"got result: \", result)\n var json_string = \"[]\";\n if (result !== undefined) {\n json_string = \"[\" + JSON.stringify(result) + \"]\";\n }\n //console.log(\"got result_string: \", json_string)\n return json_string;\n}\nexports.call_export = call_export;\nfunction get_memory_size(instance) {\n //console.log(\"called get_memory_size with name=\", module_name);\n var buf = new Uint8Array(instance.exports.memory.buffer);\n //console.log(\"result=\", buf.byteLength);\n return buf.byteLength;\n}\nexports.get_memory_size = get_memory_size;\nfunction write_byte(instance, offset, value) {\n //console.log(\"write_byte called with args: module_name={}, offset={}, value={}\", module_name, offset, value)\n var buf = new Uint8Array(instance.exports.memory.buffer);\n //console.log(buf)\n buf[offset] = value;\n}\nexports.write_byte = write_byte;\nfunction read_byte(instance, offset) {\n //console.log(\"read_byte called with args: module_name={}, offset={}\", module_name, offset)\n var buf = new Uint8Array(instance.exports.memory.buffer);\n //console.log(buf)\n //console.log(\"read_byte returns {}\", buf[offset])\n return buf[offset];\n}\nexports.read_byte = read_byte;\nfunction write_byte_range(instance, offset, slice) {\n var buf = new Uint8Array(instance.exports.memory.buffer);\n for (var i = 0; i < slice.length; i++) {\n buf[offset + i] = slice[i];\n }\n}\nexports.write_byte_range = write_byte_range;\nfunction read_byte_range(instance, offset, slice) {\n var buf = new Uint8Array(instance.exports.memory.buffer);\n for (var i = 0; i < slice.length; i++) {\n slice[i] = buf[offset + i];\n }\n}\nexports.read_byte_range = read_byte_range;\n//# sourceMappingURL=marine-js.js.map\n\n//# sourceURL=webpack:///./node_modules/@fluencelabs/marine-js/dist/snippets/marine-web-runtime-6faa67b8af9cc173/marine-js.js?"); + +/***/ }), + +/***/ "./node_modules/@wasmer/wasi/lib/bindings/browser.js": +/*!***********************************************************!*\ + !*** ./node_modules/@wasmer/wasi/lib/bindings/browser.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// @ts-ignore\nconst randomfill = __webpack_require__(/*! randomfill */ \"./node_modules/randomfill/browser.js\");\nconst browser_hrtime_1 = __webpack_require__(/*! ../polyfills/browser-hrtime */ \"./node_modules/@wasmer/wasi/lib/polyfills/browser-hrtime.js\");\n// @ts-ignore\nconst path = __webpack_require__(/*! path-browserify */ \"./node_modules/@wasmer/wasi/node_modules/path-browserify/index.js\");\nconst index_1 = __webpack_require__(/*! ../index */ \"./node_modules/@wasmer/wasi/lib/index.js\");\nconst hrtime_bigint_1 = __webpack_require__(/*! ../polyfills/hrtime.bigint */ \"./node_modules/@wasmer/wasi/lib/polyfills/hrtime.bigint.js\");\nconst bindings = {\n hrtime: hrtime_bigint_1.default(browser_hrtime_1.default),\n exit: (code) => {\n throw new index_1.WASIExitError(code);\n },\n kill: (signal) => {\n throw new index_1.WASIKillError(signal);\n },\n // @ts-ignore\n randomFillSync: randomfill.randomFillSync,\n isTTY: () => true,\n path: path,\n // Let the user attach the fs at runtime\n fs: null\n};\nexports.default = bindings;\n\n\n//# sourceURL=webpack:///./node_modules/@wasmer/wasi/lib/bindings/browser.js?"); + +/***/ }), + +/***/ "./node_modules/@wasmer/wasi/lib/constants.js": +/*!****************************************************!*\ + !*** ./node_modules/@wasmer/wasi/lib/constants.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n/*\n\nThis project is based from the Node implementation made by Gus Caplan\nhttps://github.com/devsnek/node-wasi\nHowever, JavaScript WASI is focused on:\n * Bringing WASI to the Browsers\n * Make easy to plug different filesystems\n * Provide a type-safe api using Typescript\n\n\nCopyright 2019 Gus Caplan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to\ndeal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or\nsell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst bigint_1 = __webpack_require__(/*! ./polyfills/bigint */ \"./node_modules/@wasmer/wasi/lib/polyfills/bigint.js\");\nexports.WASI_ESUCCESS = 0;\nexports.WASI_E2BIG = 1;\nexports.WASI_EACCES = 2;\nexports.WASI_EADDRINUSE = 3;\nexports.WASI_EADDRNOTAVAIL = 4;\nexports.WASI_EAFNOSUPPORT = 5;\nexports.WASI_EAGAIN = 6;\nexports.WASI_EALREADY = 7;\nexports.WASI_EBADF = 8;\nexports.WASI_EBADMSG = 9;\nexports.WASI_EBUSY = 10;\nexports.WASI_ECANCELED = 11;\nexports.WASI_ECHILD = 12;\nexports.WASI_ECONNABORTED = 13;\nexports.WASI_ECONNREFUSED = 14;\nexports.WASI_ECONNRESET = 15;\nexports.WASI_EDEADLK = 16;\nexports.WASI_EDESTADDRREQ = 17;\nexports.WASI_EDOM = 18;\nexports.WASI_EDQUOT = 19;\nexports.WASI_EEXIST = 20;\nexports.WASI_EFAULT = 21;\nexports.WASI_EFBIG = 22;\nexports.WASI_EHOSTUNREACH = 23;\nexports.WASI_EIDRM = 24;\nexports.WASI_EILSEQ = 25;\nexports.WASI_EINPROGRESS = 26;\nexports.WASI_EINTR = 27;\nexports.WASI_EINVAL = 28;\nexports.WASI_EIO = 29;\nexports.WASI_EISCONN = 30;\nexports.WASI_EISDIR = 31;\nexports.WASI_ELOOP = 32;\nexports.WASI_EMFILE = 33;\nexports.WASI_EMLINK = 34;\nexports.WASI_EMSGSIZE = 35;\nexports.WASI_EMULTIHOP = 36;\nexports.WASI_ENAMETOOLONG = 37;\nexports.WASI_ENETDOWN = 38;\nexports.WASI_ENETRESET = 39;\nexports.WASI_ENETUNREACH = 40;\nexports.WASI_ENFILE = 41;\nexports.WASI_ENOBUFS = 42;\nexports.WASI_ENODEV = 43;\nexports.WASI_ENOENT = 44;\nexports.WASI_ENOEXEC = 45;\nexports.WASI_ENOLCK = 46;\nexports.WASI_ENOLINK = 47;\nexports.WASI_ENOMEM = 48;\nexports.WASI_ENOMSG = 49;\nexports.WASI_ENOPROTOOPT = 50;\nexports.WASI_ENOSPC = 51;\nexports.WASI_ENOSYS = 52;\nexports.WASI_ENOTCONN = 53;\nexports.WASI_ENOTDIR = 54;\nexports.WASI_ENOTEMPTY = 55;\nexports.WASI_ENOTRECOVERABLE = 56;\nexports.WASI_ENOTSOCK = 57;\nexports.WASI_ENOTSUP = 58;\nexports.WASI_ENOTTY = 59;\nexports.WASI_ENXIO = 60;\nexports.WASI_EOVERFLOW = 61;\nexports.WASI_EOWNERDEAD = 62;\nexports.WASI_EPERM = 63;\nexports.WASI_EPIPE = 64;\nexports.WASI_EPROTO = 65;\nexports.WASI_EPROTONOSUPPORT = 66;\nexports.WASI_EPROTOTYPE = 67;\nexports.WASI_ERANGE = 68;\nexports.WASI_EROFS = 69;\nexports.WASI_ESPIPE = 70;\nexports.WASI_ESRCH = 71;\nexports.WASI_ESTALE = 72;\nexports.WASI_ETIMEDOUT = 73;\nexports.WASI_ETXTBSY = 74;\nexports.WASI_EXDEV = 75;\nexports.WASI_ENOTCAPABLE = 76;\nexports.WASI_SIGABRT = 0;\nexports.WASI_SIGALRM = 1;\nexports.WASI_SIGBUS = 2;\nexports.WASI_SIGCHLD = 3;\nexports.WASI_SIGCONT = 4;\nexports.WASI_SIGFPE = 5;\nexports.WASI_SIGHUP = 6;\nexports.WASI_SIGILL = 7;\nexports.WASI_SIGINT = 8;\nexports.WASI_SIGKILL = 9;\nexports.WASI_SIGPIPE = 10;\nexports.WASI_SIGQUIT = 11;\nexports.WASI_SIGSEGV = 12;\nexports.WASI_SIGSTOP = 13;\nexports.WASI_SIGTERM = 14;\nexports.WASI_SIGTRAP = 15;\nexports.WASI_SIGTSTP = 16;\nexports.WASI_SIGTTIN = 17;\nexports.WASI_SIGTTOU = 18;\nexports.WASI_SIGURG = 19;\nexports.WASI_SIGUSR1 = 20;\nexports.WASI_SIGUSR2 = 21;\nexports.WASI_SIGVTALRM = 22;\nexports.WASI_SIGXCPU = 23;\nexports.WASI_SIGXFSZ = 24;\nexports.WASI_FILETYPE_UNKNOWN = 0;\nexports.WASI_FILETYPE_BLOCK_DEVICE = 1;\nexports.WASI_FILETYPE_CHARACTER_DEVICE = 2;\nexports.WASI_FILETYPE_DIRECTORY = 3;\nexports.WASI_FILETYPE_REGULAR_FILE = 4;\nexports.WASI_FILETYPE_SOCKET_DGRAM = 5;\nexports.WASI_FILETYPE_SOCKET_STREAM = 6;\nexports.WASI_FILETYPE_SYMBOLIC_LINK = 7;\nexports.WASI_FDFLAG_APPEND = 0x0001;\nexports.WASI_FDFLAG_DSYNC = 0x0002;\nexports.WASI_FDFLAG_NONBLOCK = 0x0004;\nexports.WASI_FDFLAG_RSYNC = 0x0008;\nexports.WASI_FDFLAG_SYNC = 0x0010;\nexports.WASI_RIGHT_FD_DATASYNC = bigint_1.BigIntPolyfill(0x0000000000000001);\nexports.WASI_RIGHT_FD_READ = bigint_1.BigIntPolyfill(0x0000000000000002);\nexports.WASI_RIGHT_FD_SEEK = bigint_1.BigIntPolyfill(0x0000000000000004);\nexports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS = bigint_1.BigIntPolyfill(0x0000000000000008);\nexports.WASI_RIGHT_FD_SYNC = bigint_1.BigIntPolyfill(0x0000000000000010);\nexports.WASI_RIGHT_FD_TELL = bigint_1.BigIntPolyfill(0x0000000000000020);\nexports.WASI_RIGHT_FD_WRITE = bigint_1.BigIntPolyfill(0x0000000000000040);\nexports.WASI_RIGHT_FD_ADVISE = bigint_1.BigIntPolyfill(0x0000000000000080);\nexports.WASI_RIGHT_FD_ALLOCATE = bigint_1.BigIntPolyfill(0x0000000000000100);\nexports.WASI_RIGHT_PATH_CREATE_DIRECTORY = bigint_1.BigIntPolyfill(0x0000000000000200);\nexports.WASI_RIGHT_PATH_CREATE_FILE = bigint_1.BigIntPolyfill(0x0000000000000400);\nexports.WASI_RIGHT_PATH_LINK_SOURCE = bigint_1.BigIntPolyfill(0x0000000000000800);\nexports.WASI_RIGHT_PATH_LINK_TARGET = bigint_1.BigIntPolyfill(0x0000000000001000);\nexports.WASI_RIGHT_PATH_OPEN = bigint_1.BigIntPolyfill(0x0000000000002000);\nexports.WASI_RIGHT_FD_READDIR = bigint_1.BigIntPolyfill(0x0000000000004000);\nexports.WASI_RIGHT_PATH_READLINK = bigint_1.BigIntPolyfill(0x0000000000008000);\nexports.WASI_RIGHT_PATH_RENAME_SOURCE = bigint_1.BigIntPolyfill(0x0000000000010000);\nexports.WASI_RIGHT_PATH_RENAME_TARGET = bigint_1.BigIntPolyfill(0x0000000000020000);\nexports.WASI_RIGHT_PATH_FILESTAT_GET = bigint_1.BigIntPolyfill(0x0000000000040000);\nexports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE = bigint_1.BigIntPolyfill(0x0000000000080000);\nexports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES = bigint_1.BigIntPolyfill(0x0000000000100000);\nexports.WASI_RIGHT_FD_FILESTAT_GET = bigint_1.BigIntPolyfill(0x0000000000200000);\nexports.WASI_RIGHT_FD_FILESTAT_SET_SIZE = bigint_1.BigIntPolyfill(0x0000000000400000);\nexports.WASI_RIGHT_FD_FILESTAT_SET_TIMES = bigint_1.BigIntPolyfill(0x0000000000800000);\nexports.WASI_RIGHT_PATH_SYMLINK = bigint_1.BigIntPolyfill(0x0000000001000000);\nexports.WASI_RIGHT_PATH_REMOVE_DIRECTORY = bigint_1.BigIntPolyfill(0x0000000002000000);\nexports.WASI_RIGHT_PATH_UNLINK_FILE = bigint_1.BigIntPolyfill(0x0000000004000000);\nexports.WASI_RIGHT_POLL_FD_READWRITE = bigint_1.BigIntPolyfill(0x0000000008000000);\nexports.WASI_RIGHT_SOCK_SHUTDOWN = bigint_1.BigIntPolyfill(0x0000000010000000);\nexports.RIGHTS_ALL = exports.WASI_RIGHT_FD_DATASYNC |\n exports.WASI_RIGHT_FD_READ |\n exports.WASI_RIGHT_FD_SEEK |\n exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS |\n exports.WASI_RIGHT_FD_SYNC |\n exports.WASI_RIGHT_FD_TELL |\n exports.WASI_RIGHT_FD_WRITE |\n exports.WASI_RIGHT_FD_ADVISE |\n exports.WASI_RIGHT_FD_ALLOCATE |\n exports.WASI_RIGHT_PATH_CREATE_DIRECTORY |\n exports.WASI_RIGHT_PATH_CREATE_FILE |\n exports.WASI_RIGHT_PATH_LINK_SOURCE |\n exports.WASI_RIGHT_PATH_LINK_TARGET |\n exports.WASI_RIGHT_PATH_OPEN |\n exports.WASI_RIGHT_FD_READDIR |\n exports.WASI_RIGHT_PATH_READLINK |\n exports.WASI_RIGHT_PATH_RENAME_SOURCE |\n exports.WASI_RIGHT_PATH_RENAME_TARGET |\n exports.WASI_RIGHT_PATH_FILESTAT_GET |\n exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE |\n exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES |\n exports.WASI_RIGHT_FD_FILESTAT_GET |\n exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES |\n exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE |\n exports.WASI_RIGHT_PATH_SYMLINK |\n exports.WASI_RIGHT_PATH_UNLINK_FILE |\n exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY |\n exports.WASI_RIGHT_POLL_FD_READWRITE |\n exports.WASI_RIGHT_SOCK_SHUTDOWN;\nexports.RIGHTS_BLOCK_DEVICE_BASE = exports.RIGHTS_ALL;\nexports.RIGHTS_BLOCK_DEVICE_INHERITING = exports.RIGHTS_ALL;\nexports.RIGHTS_CHARACTER_DEVICE_BASE = exports.RIGHTS_ALL;\nexports.RIGHTS_CHARACTER_DEVICE_INHERITING = exports.RIGHTS_ALL;\nexports.RIGHTS_REGULAR_FILE_BASE = exports.WASI_RIGHT_FD_DATASYNC |\n exports.WASI_RIGHT_FD_READ |\n exports.WASI_RIGHT_FD_SEEK |\n exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS |\n exports.WASI_RIGHT_FD_SYNC |\n exports.WASI_RIGHT_FD_TELL |\n exports.WASI_RIGHT_FD_WRITE |\n exports.WASI_RIGHT_FD_ADVISE |\n exports.WASI_RIGHT_FD_ALLOCATE |\n exports.WASI_RIGHT_FD_FILESTAT_GET |\n exports.WASI_RIGHT_FD_FILESTAT_SET_SIZE |\n exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES |\n exports.WASI_RIGHT_POLL_FD_READWRITE;\nexports.RIGHTS_REGULAR_FILE_INHERITING = bigint_1.BigIntPolyfill(0);\nexports.RIGHTS_DIRECTORY_BASE = exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS |\n exports.WASI_RIGHT_FD_SYNC |\n exports.WASI_RIGHT_FD_ADVISE |\n exports.WASI_RIGHT_PATH_CREATE_DIRECTORY |\n exports.WASI_RIGHT_PATH_CREATE_FILE |\n exports.WASI_RIGHT_PATH_LINK_SOURCE |\n exports.WASI_RIGHT_PATH_LINK_TARGET |\n exports.WASI_RIGHT_PATH_OPEN |\n exports.WASI_RIGHT_FD_READDIR |\n exports.WASI_RIGHT_PATH_READLINK |\n exports.WASI_RIGHT_PATH_RENAME_SOURCE |\n exports.WASI_RIGHT_PATH_RENAME_TARGET |\n exports.WASI_RIGHT_PATH_FILESTAT_GET |\n exports.WASI_RIGHT_PATH_FILESTAT_SET_SIZE |\n exports.WASI_RIGHT_PATH_FILESTAT_SET_TIMES |\n exports.WASI_RIGHT_FD_FILESTAT_GET |\n exports.WASI_RIGHT_FD_FILESTAT_SET_TIMES |\n exports.WASI_RIGHT_PATH_SYMLINK |\n exports.WASI_RIGHT_PATH_UNLINK_FILE |\n exports.WASI_RIGHT_PATH_REMOVE_DIRECTORY |\n exports.WASI_RIGHT_POLL_FD_READWRITE;\nexports.RIGHTS_DIRECTORY_INHERITING = exports.RIGHTS_DIRECTORY_BASE | exports.RIGHTS_REGULAR_FILE_BASE;\nexports.RIGHTS_SOCKET_BASE = exports.WASI_RIGHT_FD_READ |\n exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS |\n exports.WASI_RIGHT_FD_WRITE |\n exports.WASI_RIGHT_FD_FILESTAT_GET |\n exports.WASI_RIGHT_POLL_FD_READWRITE |\n exports.WASI_RIGHT_SOCK_SHUTDOWN;\nexports.RIGHTS_SOCKET_INHERITING = exports.RIGHTS_ALL;\nexports.RIGHTS_TTY_BASE = exports.WASI_RIGHT_FD_READ |\n exports.WASI_RIGHT_FD_FDSTAT_SET_FLAGS |\n exports.WASI_RIGHT_FD_WRITE |\n exports.WASI_RIGHT_FD_FILESTAT_GET |\n exports.WASI_RIGHT_POLL_FD_READWRITE;\nexports.RIGHTS_TTY_INHERITING = bigint_1.BigIntPolyfill(0);\nexports.WASI_CLOCK_REALTIME = 0;\nexports.WASI_CLOCK_MONOTONIC = 1;\nexports.WASI_CLOCK_PROCESS_CPUTIME_ID = 2;\nexports.WASI_CLOCK_THREAD_CPUTIME_ID = 3;\nexports.WASI_EVENTTYPE_CLOCK = 0;\nexports.WASI_EVENTTYPE_FD_READ = 1;\nexports.WASI_EVENTTYPE_FD_WRITE = 2;\nexports.WASI_FILESTAT_SET_ATIM = 1 << 0;\nexports.WASI_FILESTAT_SET_ATIM_NOW = 1 << 1;\nexports.WASI_FILESTAT_SET_MTIM = 1 << 2;\nexports.WASI_FILESTAT_SET_MTIM_NOW = 1 << 3;\nexports.WASI_O_CREAT = 1 << 0;\nexports.WASI_O_DIRECTORY = 1 << 1;\nexports.WASI_O_EXCL = 1 << 2;\nexports.WASI_O_TRUNC = 1 << 3;\nexports.WASI_PREOPENTYPE_DIR = 0;\nexports.WASI_DIRCOOKIE_START = 0;\nexports.WASI_STDIN_FILENO = 0;\nexports.WASI_STDOUT_FILENO = 1;\nexports.WASI_STDERR_FILENO = 2;\nexports.WASI_WHENCE_SET = 0;\nexports.WASI_WHENCE_CUR = 1;\nexports.WASI_WHENCE_END = 2;\n// http://man7.org/linux/man-pages/man3/errno.3.html\nexports.ERROR_MAP = {\n E2BIG: exports.WASI_E2BIG,\n EACCES: exports.WASI_EACCES,\n EADDRINUSE: exports.WASI_EADDRINUSE,\n EADDRNOTAVAIL: exports.WASI_EADDRNOTAVAIL,\n EAFNOSUPPORT: exports.WASI_EAFNOSUPPORT,\n EALREADY: exports.WASI_EALREADY,\n EAGAIN: exports.WASI_EAGAIN,\n // EBADE: WASI_EBADE,\n EBADF: exports.WASI_EBADF,\n // EBADFD: WASI_EBADFD,\n EBADMSG: exports.WASI_EBADMSG,\n // EBADR: WASI_EBADR,\n // EBADRQC: WASI_EBADRQC,\n // EBADSLT: WASI_EBADSLT,\n EBUSY: exports.WASI_EBUSY,\n ECANCELED: exports.WASI_ECANCELED,\n ECHILD: exports.WASI_ECHILD,\n // ECHRNG: WASI_ECHRNG,\n // ECOMM: WASI_ECOMM,\n ECONNABORTED: exports.WASI_ECONNABORTED,\n ECONNREFUSED: exports.WASI_ECONNREFUSED,\n ECONNRESET: exports.WASI_ECONNRESET,\n EDEADLOCK: exports.WASI_EDEADLK,\n EDESTADDRREQ: exports.WASI_EDESTADDRREQ,\n EDOM: exports.WASI_EDOM,\n EDQUOT: exports.WASI_EDQUOT,\n EEXIST: exports.WASI_EEXIST,\n EFAULT: exports.WASI_EFAULT,\n EFBIG: exports.WASI_EFBIG,\n EHOSTDOWN: exports.WASI_EHOSTUNREACH,\n EHOSTUNREACH: exports.WASI_EHOSTUNREACH,\n // EHWPOISON: WASI_EHWPOISON,\n EIDRM: exports.WASI_EIDRM,\n EILSEQ: exports.WASI_EILSEQ,\n EINPROGRESS: exports.WASI_EINPROGRESS,\n EINTR: exports.WASI_EINTR,\n EINVAL: exports.WASI_EINVAL,\n EIO: exports.WASI_EIO,\n EISCONN: exports.WASI_EISCONN,\n EISDIR: exports.WASI_EISDIR,\n ELOOP: exports.WASI_ELOOP,\n EMFILE: exports.WASI_EMFILE,\n EMLINK: exports.WASI_EMLINK,\n EMSGSIZE: exports.WASI_EMSGSIZE,\n EMULTIHOP: exports.WASI_EMULTIHOP,\n ENAMETOOLONG: exports.WASI_ENAMETOOLONG,\n ENETDOWN: exports.WASI_ENETDOWN,\n ENETRESET: exports.WASI_ENETRESET,\n ENETUNREACH: exports.WASI_ENETUNREACH,\n ENFILE: exports.WASI_ENFILE,\n ENOBUFS: exports.WASI_ENOBUFS,\n ENODEV: exports.WASI_ENODEV,\n ENOENT: exports.WASI_ENOENT,\n ENOEXEC: exports.WASI_ENOEXEC,\n ENOLCK: exports.WASI_ENOLCK,\n ENOLINK: exports.WASI_ENOLINK,\n ENOMEM: exports.WASI_ENOMEM,\n ENOMSG: exports.WASI_ENOMSG,\n ENOPROTOOPT: exports.WASI_ENOPROTOOPT,\n ENOSPC: exports.WASI_ENOSPC,\n ENOSYS: exports.WASI_ENOSYS,\n ENOTCONN: exports.WASI_ENOTCONN,\n ENOTDIR: exports.WASI_ENOTDIR,\n ENOTEMPTY: exports.WASI_ENOTEMPTY,\n ENOTRECOVERABLE: exports.WASI_ENOTRECOVERABLE,\n ENOTSOCK: exports.WASI_ENOTSOCK,\n ENOTTY: exports.WASI_ENOTTY,\n ENXIO: exports.WASI_ENXIO,\n EOVERFLOW: exports.WASI_EOVERFLOW,\n EOWNERDEAD: exports.WASI_EOWNERDEAD,\n EPERM: exports.WASI_EPERM,\n EPIPE: exports.WASI_EPIPE,\n EPROTO: exports.WASI_EPROTO,\n EPROTONOSUPPORT: exports.WASI_EPROTONOSUPPORT,\n EPROTOTYPE: exports.WASI_EPROTOTYPE,\n ERANGE: exports.WASI_ERANGE,\n EROFS: exports.WASI_EROFS,\n ESPIPE: exports.WASI_ESPIPE,\n ESRCH: exports.WASI_ESRCH,\n ESTALE: exports.WASI_ESTALE,\n ETIMEDOUT: exports.WASI_ETIMEDOUT,\n ETXTBSY: exports.WASI_ETXTBSY,\n EXDEV: exports.WASI_EXDEV\n};\nexports.SIGNAL_MAP = {\n [exports.WASI_SIGHUP]: \"SIGHUP\",\n [exports.WASI_SIGINT]: \"SIGINT\",\n [exports.WASI_SIGQUIT]: \"SIGQUIT\",\n [exports.WASI_SIGILL]: \"SIGILL\",\n [exports.WASI_SIGTRAP]: \"SIGTRAP\",\n [exports.WASI_SIGABRT]: \"SIGABRT\",\n [exports.WASI_SIGBUS]: \"SIGBUS\",\n [exports.WASI_SIGFPE]: \"SIGFPE\",\n [exports.WASI_SIGKILL]: \"SIGKILL\",\n [exports.WASI_SIGUSR1]: \"SIGUSR1\",\n [exports.WASI_SIGSEGV]: \"SIGSEGV\",\n [exports.WASI_SIGUSR2]: \"SIGUSR2\",\n [exports.WASI_SIGPIPE]: \"SIGPIPE\",\n [exports.WASI_SIGALRM]: \"SIGALRM\",\n [exports.WASI_SIGTERM]: \"SIGTERM\",\n [exports.WASI_SIGCHLD]: \"SIGCHLD\",\n [exports.WASI_SIGCONT]: \"SIGCONT\",\n [exports.WASI_SIGSTOP]: \"SIGSTOP\",\n [exports.WASI_SIGTSTP]: \"SIGTSTP\",\n [exports.WASI_SIGTTIN]: \"SIGTTIN\",\n [exports.WASI_SIGTTOU]: \"SIGTTOU\",\n [exports.WASI_SIGURG]: \"SIGURG\",\n [exports.WASI_SIGXCPU]: \"SIGXCPU\",\n [exports.WASI_SIGXFSZ]: \"SIGXFSZ\",\n [exports.WASI_SIGVTALRM]: \"SIGVTALRM\"\n};\n\n\n//# sourceURL=webpack:///./node_modules/@wasmer/wasi/lib/constants.js?"); + +/***/ }), + +/***/ "./node_modules/@wasmer/wasi/lib/index.esm.js": +/*!****************************************************!*\ + !*** ./node_modules/@wasmer/wasi/lib/index.esm.js ***! + \****************************************************/ +/*! exports provided: default, WASI, WASIError, WASIExitError, WASIKillError */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WASI\", function() { return dc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WASIError\", function() { return ac; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WASIExitError\", function() { return nb; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WASIKillError\", function() { return ob; });\n/*\n *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n*****************************************************************************/\nfunction aa(a, b) {\n aa = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (a, b) {\n a.__proto__ = b\n } || function (a, b) {\n for (var c in b) b.hasOwnProperty(c) && (a[c] = b[c])\n };\n return aa(a, b)\n}\n\nfunction ba(a, b) {\n function c() {\n this.constructor = a\n }\n\n aa(a, b);\n a.prototype = null === b ? Object.create(b) : (c.prototype = b.prototype, new c)\n}\n\nfunction ca(a) {\n var b = \"function\" === typeof Symbol && a[Symbol.iterator], c = 0;\n return b ? b.call(a) : {\n next: function () {\n a && c >= a.length && (a = void 0);\n return {value: a && a[c++], done: !a}\n }\n }\n}\n\nfunction da(a, b) {\n var c = \"function\" === typeof Symbol && a[Symbol.iterator];\n if (!c) return a;\n a = c.call(a);\n var d, e = [];\n try {\n for (; (void 0 === b || 0 < b--) && !(d = a.next()).done;) e.push(d.value)\n } catch (g) {\n var f = {error: g}\n } finally {\n try {\n d && !d.done && (c = a[\"return\"]) && c.call(a)\n } finally {\n if (f) throw f.error;\n }\n }\n return e\n}\n\nfunction fa() {\n for (var a = [], b = 0; b < arguments.length; b++) a = a.concat(da(arguments[b]));\n return a\n}\n\nvar ha = \"undefined\" !== typeof globalThis ? globalThis : \"undefined\" !== typeof global ? global : {},\n k = \"undefined\" !== typeof BigInt ? BigInt : ha.BigInt || Number, ia = DataView;\nia.prototype.setBigUint64 || (ia.prototype.setBigUint64 = function (a, b, c) {\n if (b < Math.pow(2, 32)) {\n b = Number(b);\n var d = 0\n } else {\n d = b.toString(2);\n b = \"\";\n for (var e = 0; e < 64 - d.length; e++) b += \"0\";\n b += d;\n d = parseInt(b.substring(0, 32), 2);\n b = parseInt(b.substring(32), 2)\n }\n this.setUint32(a + (c ? 0 : 4), b, c);\n this.setUint32(a + (c ? 4 : 0), d, c)\n}, ia.prototype.getBigUint64 = function (a, b) {\n var c = this.getUint32(a + (b ? 0 : 4), b);\n a = this.getUint32(a + (b ? 4 : 0), b);\n c = c.toString(2);\n a = a.toString(2);\n b = \"\";\n for (var d = 0; d < 32 - c.length; d++) b += \"0\";\n return k(\"0b\" + a + (b + c))\n});\nvar ja = \"undefined\" !== typeof global ? global : \"undefined\" !== typeof self ? self : \"undefined\" !== typeof window ? window : {},\n m = [], u = [], ka = \"undefined\" !== typeof Uint8Array ? Uint8Array : Array, la = !1;\n\nfunction ma() {\n la = !0;\n for (var a = 0; 64 > a; ++a) m[a] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"[a], u[\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".charCodeAt(a)] = a;\n u[45] = 62;\n u[95] = 63\n}\n\nfunction na(a, b, c) {\n for (var d = [], e = b; e < c; e += 3) b = (a[e] << 16) + (a[e + 1] << 8) + a[e + 2], d.push(m[b >> 18 & 63] + m[b >> 12 & 63] + m[b >> 6 & 63] + m[b & 63]);\n return d.join(\"\")\n}\n\nfunction oa(a) {\n la || ma();\n for (var b = a.length, c = b % 3, d = \"\", e = [], f = 0, g = b - c; f < g; f += 16383) e.push(na(a, f, f + 16383 > g ? g : f + 16383));\n 1 === c ? (a = a[b - 1], d += m[a >> 2], d += m[a << 4 & 63], d += \"==\") : 2 === c && (a = (a[b - 2] << 8) + a[b - 1], d += m[a >> 10], d += m[a >> 4 & 63], d += m[a << 2 & 63], d += \"=\");\n e.push(d);\n return e.join(\"\")\n}\n\nfunction pa(a, b, c, d, e) {\n var f = 8 * e - d - 1;\n var g = (1 << f) - 1, h = g >> 1, l = -7;\n e = c ? e - 1 : 0;\n var n = c ? -1 : 1, r = a[b + e];\n e += n;\n c = r & (1 << -l) - 1;\n r >>= -l;\n for (l += f; 0 < l; c = 256 * c + a[b + e], e += n, l -= 8) ;\n f = c & (1 << -l) - 1;\n c >>= -l;\n for (l += d; 0 < l; f = 256 * f + a[b + e], e += n, l -= 8) ;\n if (0 === c) c = 1 - h; else {\n if (c === g) return f ? NaN : Infinity * (r ? -1 : 1);\n f += Math.pow(2, d);\n c -= h\n }\n return (r ? -1 : 1) * f * Math.pow(2, c - d)\n}\n\nfunction qa(a, b, c, d, e, f) {\n var g, h = 8 * f - e - 1, l = (1 << h) - 1, n = l >> 1, r = 23 === e ? Math.pow(2, -24) - Math.pow(2, -77) : 0;\n f = d ? 0 : f - 1;\n var p = d ? 1 : -1, y = 0 > b || 0 === b && 0 > 1 / b ? 1 : 0;\n b = Math.abs(b);\n isNaN(b) || Infinity === b ? (b = isNaN(b) ? 1 : 0, d = l) : (d = Math.floor(Math.log(b) / Math.LN2), 1 > b * (g = Math.pow(2, -d)) && (d--, g *= 2), b = 1 <= d + n ? b + r / g : b + r * Math.pow(2, 1 - n), 2 <= b * g && (d++, g /= 2), d + n >= l ? (b = 0, d = l) : 1 <= d + n ? (b = (b * g - 1) * Math.pow(2, e), d += n) : (b = b * Math.pow(2, n - 1) * Math.pow(2, e), d = 0));\n for (; 8 <= e; a[c + f] = b & 255, f += p, b /= 256, e -= 8) ;\n d = d << e | b;\n for (h += e; 0 < h; a[c + f] = d & 255,\n f += p, d /= 256, h -= 8) ;\n a[c + f - p] |= 128 * y\n}\n\nvar ra = {}.toString, sa = Array.isArray || function (a) {\n return \"[object Array]\" == ra.call(a)\n};\nv.TYPED_ARRAY_SUPPORT = void 0 !== ja.TYPED_ARRAY_SUPPORT ? ja.TYPED_ARRAY_SUPPORT : !0;\nvar ta = v.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;\n\nfunction w(a, b) {\n if ((v.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823) < b) throw new RangeError(\"Invalid typed array length\");\n v.TYPED_ARRAY_SUPPORT ? (a = new Uint8Array(b), a.__proto__ = v.prototype) : (null === a && (a = new v(b)), a.length = b);\n return a\n}\n\nfunction v(a, b, c) {\n if (!(v.TYPED_ARRAY_SUPPORT || this instanceof v)) return new v(a, b, c);\n if (\"number\" === typeof a) {\n if (\"string\" === typeof b) throw Error(\"If encoding is specified then the first argument must be a string\");\n return va(this, a)\n }\n return wa(this, a, b, c)\n}\n\nv.poolSize = 8192;\nv._augment = function (a) {\n a.__proto__ = v.prototype;\n return a\n};\n\nfunction wa(a, b, c, d) {\n if (\"number\" === typeof b) throw new TypeError('\"value\" argument must not be a number');\n if (\"undefined\" !== typeof ArrayBuffer && b instanceof ArrayBuffer) {\n b.byteLength;\n if (0 > c || b.byteLength < c) throw new RangeError(\"'offset' is out of bounds\");\n if (b.byteLength < c + (d || 0)) throw new RangeError(\"'length' is out of bounds\");\n b = void 0 === c && void 0 === d ? new Uint8Array(b) : void 0 === d ? new Uint8Array(b, c) : new Uint8Array(b, c, d);\n v.TYPED_ARRAY_SUPPORT ? (a = b, a.__proto__ = v.prototype) : a = xa(a, b);\n return a\n }\n if (\"string\" ===\n typeof b) {\n d = a;\n a = c;\n if (\"string\" !== typeof a || \"\" === a) a = \"utf8\";\n if (!v.isEncoding(a)) throw new TypeError('\"encoding\" must be a valid string encoding');\n c = ya(b, a) | 0;\n d = w(d, c);\n b = d.write(b, a);\n b !== c && (d = d.slice(0, b));\n return d\n }\n return za(a, b)\n}\n\nv.from = function (a, b, c) {\n return wa(null, a, b, c)\n};\nv.TYPED_ARRAY_SUPPORT && (v.prototype.__proto__ = Uint8Array.prototype, v.__proto__ = Uint8Array);\n\nfunction Aa(a) {\n if (\"number\" !== typeof a) throw new TypeError('\"size\" argument must be a number');\n if (0 > a) throw new RangeError('\"size\" argument must not be negative');\n}\n\nv.alloc = function (a, b, c) {\n Aa(a);\n a = 0 >= a ? w(null, a) : void 0 !== b ? \"string\" === typeof c ? w(null, a).fill(b, c) : w(null, a).fill(b) : w(null, a);\n return a\n};\n\nfunction va(a, b) {\n Aa(b);\n a = w(a, 0 > b ? 0 : Ba(b) | 0);\n if (!v.TYPED_ARRAY_SUPPORT) for (var c = 0; c < b; ++c) a[c] = 0;\n return a\n}\n\nv.allocUnsafe = function (a) {\n return va(null, a)\n};\nv.allocUnsafeSlow = function (a) {\n return va(null, a)\n};\n\nfunction xa(a, b) {\n var c = 0 > b.length ? 0 : Ba(b.length) | 0;\n a = w(a, c);\n for (var d = 0; d < c; d += 1) a[d] = b[d] & 255;\n return a\n}\n\nfunction za(a, b) {\n if (z(b)) {\n var c = Ba(b.length) | 0;\n a = w(a, c);\n if (0 === a.length) return a;\n b.copy(a, 0, 0, c);\n return a\n }\n if (b) {\n if (\"undefined\" !== typeof ArrayBuffer && b.buffer instanceof ArrayBuffer || \"length\" in b) return (c = \"number\" !== typeof b.length) || (c = b.length, c = c !== c), c ? w(a, 0) : xa(a, b);\n if (\"Buffer\" === b.type && sa(b.data)) return xa(a, b.data)\n }\n throw new TypeError(\"First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.\");\n}\n\nfunction Ba(a) {\n if (a >= (v.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823)) throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\" + (v.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823).toString(16) + \" bytes\");\n return a | 0\n}\n\nv.isBuffer = Ca;\n\nfunction z(a) {\n return !(null == a || !a._isBuffer)\n}\n\nv.compare = function (a, b) {\n if (!z(a) || !z(b)) throw new TypeError(\"Arguments must be Buffers\");\n if (a === b) return 0;\n for (var c = a.length, d = b.length, e = 0, f = Math.min(c, d); e < f; ++e) if (a[e] !== b[e]) {\n c = a[e];\n d = b[e];\n break\n }\n return c < d ? -1 : d < c ? 1 : 0\n};\nv.isEncoding = function (a) {\n switch (String(a).toLowerCase()) {\n case \"hex\":\n case \"utf8\":\n case \"utf-8\":\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n case \"base64\":\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return !0;\n default:\n return !1\n }\n};\nv.concat = function (a, b) {\n if (!sa(a)) throw new TypeError('\"list\" argument must be an Array of Buffers');\n if (0 === a.length) return v.alloc(0);\n var c;\n if (void 0 === b) for (c = b = 0; c < a.length; ++c) b += a[c].length;\n b = v.allocUnsafe(b);\n var d = 0;\n for (c = 0; c < a.length; ++c) {\n var e = a[c];\n if (!z(e)) throw new TypeError('\"list\" argument must be an Array of Buffers');\n e.copy(b, d);\n d += e.length\n }\n return b\n};\n\nfunction ya(a, b) {\n if (z(a)) return a.length;\n if (\"undefined\" !== typeof ArrayBuffer && \"function\" === typeof ArrayBuffer.isView && (ArrayBuffer.isView(a) || a instanceof ArrayBuffer)) return a.byteLength;\n \"string\" !== typeof a && (a = \"\" + a);\n var c = a.length;\n if (0 === c) return 0;\n for (var d = !1; ;) switch (b) {\n case \"ascii\":\n case \"latin1\":\n case \"binary\":\n return c;\n case \"utf8\":\n case \"utf-8\":\n case void 0:\n return Da(a).length;\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n return 2 * c;\n case \"hex\":\n return c >>> 1;\n case \"base64\":\n return Ea(a).length;\n default:\n if (d) return Da(a).length;\n b = (\"\" + b).toLowerCase();\n d = !0\n }\n}\n\nv.byteLength = ya;\n\nfunction Fa(a, b, c) {\n var d = !1;\n if (void 0 === b || 0 > b) b = 0;\n if (b > this.length) return \"\";\n if (void 0 === c || c > this.length) c = this.length;\n if (0 >= c) return \"\";\n c >>>= 0;\n b >>>= 0;\n if (c <= b) return \"\";\n for (a || (a = \"utf8\"); ;) switch (a) {\n case \"hex\":\n a = b;\n b = c;\n c = this.length;\n if (!a || 0 > a) a = 0;\n if (!b || 0 > b || b > c) b = c;\n d = \"\";\n for (c = a; c < b; ++c) a = d, d = this[c], d = 16 > d ? \"0\" + d.toString(16) : d.toString(16), d = a + d;\n return d;\n case \"utf8\":\n case \"utf-8\":\n return Ga(this, b, c);\n case \"ascii\":\n a = \"\";\n for (c = Math.min(this.length, c); b < c; ++b) a += String.fromCharCode(this[b] & 127);\n return a;\n case \"latin1\":\n case \"binary\":\n a = \"\";\n for (c = Math.min(this.length, c); b < c; ++b) a += String.fromCharCode(this[b]);\n return a;\n case \"base64\":\n return b = 0 === b && c === this.length ? oa(this) : oa(this.slice(b, c)), b;\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n b = this.slice(b, c);\n c = \"\";\n for (a = 0; a < b.length; a += 2) c += String.fromCharCode(b[a] + 256 * b[a + 1]);\n return c;\n default:\n if (d) throw new TypeError(\"Unknown encoding: \" + a);\n a = (a + \"\").toLowerCase();\n d = !0\n }\n}\n\nv.prototype._isBuffer = !0;\n\nfunction A(a, b, c) {\n var d = a[b];\n a[b] = a[c];\n a[c] = d\n}\n\nv.prototype.swap16 = function () {\n var a = this.length;\n if (0 !== a % 2) throw new RangeError(\"Buffer size must be a multiple of 16-bits\");\n for (var b = 0; b < a; b += 2) A(this, b, b + 1);\n return this\n};\nv.prototype.swap32 = function () {\n var a = this.length;\n if (0 !== a % 4) throw new RangeError(\"Buffer size must be a multiple of 32-bits\");\n for (var b = 0; b < a; b += 4) A(this, b, b + 3), A(this, b + 1, b + 2);\n return this\n};\nv.prototype.swap64 = function () {\n var a = this.length;\n if (0 !== a % 8) throw new RangeError(\"Buffer size must be a multiple of 64-bits\");\n for (var b = 0; b < a; b += 8) A(this, b, b + 7), A(this, b + 1, b + 6), A(this, b + 2, b + 5), A(this, b + 3, b + 4);\n return this\n};\nv.prototype.toString = function () {\n var a = this.length | 0;\n return 0 === a ? \"\" : 0 === arguments.length ? Ga(this, 0, a) : Fa.apply(this, arguments)\n};\nv.prototype.equals = function (a) {\n if (!z(a)) throw new TypeError(\"Argument must be a Buffer\");\n return this === a ? !0 : 0 === v.compare(this, a)\n};\nv.prototype.inspect = function () {\n var a = \"\";\n 0 < this.length && (a = this.toString(\"hex\", 0, 50).match(/.{2}/g).join(\" \"), 50 < this.length && (a += \" ... \"));\n return \"\"\n};\nv.prototype.compare = function (a, b, c, d, e) {\n if (!z(a)) throw new TypeError(\"Argument must be a Buffer\");\n void 0 === b && (b = 0);\n void 0 === c && (c = a ? a.length : 0);\n void 0 === d && (d = 0);\n void 0 === e && (e = this.length);\n if (0 > b || c > a.length || 0 > d || e > this.length) throw new RangeError(\"out of range index\");\n if (d >= e && b >= c) return 0;\n if (d >= e) return -1;\n if (b >= c) return 1;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n e >>>= 0;\n if (this === a) return 0;\n var f = e - d, g = c - b, h = Math.min(f, g);\n d = this.slice(d, e);\n a = a.slice(b, c);\n for (b = 0; b < h; ++b) if (d[b] !== a[b]) {\n f = d[b];\n g = a[b];\n break\n }\n return f <\n g ? -1 : g < f ? 1 : 0\n};\n\nfunction Ha(a, b, c, d, e) {\n if (0 === a.length) return -1;\n \"string\" === typeof c ? (d = c, c = 0) : 2147483647 < c ? c = 2147483647 : -2147483648 > c && (c = -2147483648);\n c = +c;\n isNaN(c) && (c = e ? 0 : a.length - 1);\n 0 > c && (c = a.length + c);\n if (c >= a.length) {\n if (e) return -1;\n c = a.length - 1\n } else if (0 > c) if (e) c = 0; else return -1;\n \"string\" === typeof b && (b = v.from(b, d));\n if (z(b)) return 0 === b.length ? -1 : Ia(a, b, c, d, e);\n if (\"number\" === typeof b) return b &= 255, v.TYPED_ARRAY_SUPPORT && \"function\" === typeof Uint8Array.prototype.indexOf ? e ? Uint8Array.prototype.indexOf.call(a, b, c) :\n Uint8Array.prototype.lastIndexOf.call(a, b, c) : Ia(a, [b], c, d, e);\n throw new TypeError(\"val must be string, number or Buffer\");\n}\n\nfunction Ia(a, b, c, d, e) {\n function f(a, b) {\n return 1 === g ? a[b] : a.readUInt16BE(b * g)\n }\n\n var g = 1, h = a.length, l = b.length;\n if (void 0 !== d && (d = String(d).toLowerCase(), \"ucs2\" === d || \"ucs-2\" === d || \"utf16le\" === d || \"utf-16le\" === d)) {\n if (2 > a.length || 2 > b.length) return -1;\n g = 2;\n h /= 2;\n l /= 2;\n c /= 2\n }\n if (e) for (d = -1; c < h; c++) if (f(a, c) === f(b, -1 === d ? 0 : c - d)) {\n if (-1 === d && (d = c), c - d + 1 === l) return d * g\n } else -1 !== d && (c -= c - d), d = -1; else for (c + l > h && (c = h - l); 0 <= c; c--) {\n h = !0;\n for (d = 0; d < l; d++) if (f(a, c + d) !== f(b, d)) {\n h = !1;\n break\n }\n if (h) return c\n }\n return -1\n}\n\nv.prototype.includes = function (a, b, c) {\n return -1 !== this.indexOf(a, b, c)\n};\nv.prototype.indexOf = function (a, b, c) {\n return Ha(this, a, b, c, !0)\n};\nv.prototype.lastIndexOf = function (a, b, c) {\n return Ha(this, a, b, c, !1)\n};\nv.prototype.write = function (a, b, c, d) {\n if (void 0 === b) d = \"utf8\", c = this.length, b = 0; else if (void 0 === c && \"string\" === typeof b) d = b, c = this.length, b = 0; else if (isFinite(b)) b |= 0, isFinite(c) ? (c |= 0, void 0 === d && (d = \"utf8\")) : (d = c, c = void 0); else throw Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");\n var e = this.length - b;\n if (void 0 === c || c > e) c = e;\n if (0 < a.length && (0 > c || 0 > b) || b > this.length) throw new RangeError(\"Attempt to write outside buffer bounds\");\n d || (d = \"utf8\");\n for (e = !1; ;) switch (d) {\n case \"hex\":\n a:{\n b =\n Number(b) || 0;\n d = this.length - b;\n c ? (c = Number(c), c > d && (c = d)) : c = d;\n d = a.length;\n if (0 !== d % 2) throw new TypeError(\"Invalid hex string\");\n c > d / 2 && (c = d / 2);\n for (d = 0; d < c; ++d) {\n e = parseInt(a.substr(2 * d, 2), 16);\n if (isNaN(e)) {\n a = d;\n break a\n }\n this[b + d] = e\n }\n a = d\n }\n return a;\n case \"utf8\":\n case \"utf-8\":\n return Ja(Da(a, this.length - b), this, b, c);\n case \"ascii\":\n return Ja(Ka(a), this, b, c);\n case \"latin1\":\n case \"binary\":\n return Ja(Ka(a), this, b, c);\n case \"base64\":\n return Ja(Ea(a), this, b, c);\n case \"ucs2\":\n case \"ucs-2\":\n case \"utf16le\":\n case \"utf-16le\":\n d = a;\n e = this.length -\n b;\n for (var f = [], g = 0; g < d.length && !(0 > (e -= 2)); ++g) {\n var h = d.charCodeAt(g);\n a = h >> 8;\n h %= 256;\n f.push(h);\n f.push(a)\n }\n return Ja(f, this, b, c);\n default:\n if (e) throw new TypeError(\"Unknown encoding: \" + d);\n d = (\"\" + d).toLowerCase();\n e = !0\n }\n};\nv.prototype.toJSON = function () {\n return {type: \"Buffer\", data: Array.prototype.slice.call(this._arr || this, 0)}\n};\n\nfunction Ga(a, b, c) {\n c = Math.min(a.length, c);\n for (var d = []; b < c;) {\n var e = a[b], f = null, g = 239 < e ? 4 : 223 < e ? 3 : 191 < e ? 2 : 1;\n if (b + g <= c) switch (g) {\n case 1:\n 128 > e && (f = e);\n break;\n case 2:\n var h = a[b + 1];\n 128 === (h & 192) && (e = (e & 31) << 6 | h & 63, 127 < e && (f = e));\n break;\n case 3:\n h = a[b + 1];\n var l = a[b + 2];\n 128 === (h & 192) && 128 === (l & 192) && (e = (e & 15) << 12 | (h & 63) << 6 | l & 63, 2047 < e && (55296 > e || 57343 < e) && (f = e));\n break;\n case 4:\n h = a[b + 1];\n l = a[b + 2];\n var n = a[b + 3];\n 128 === (h & 192) && 128 === (l & 192) && 128 === (n & 192) && (e = (e & 15) << 18 | (h & 63) << 12 | (l & 63) << 6 | n & 63, 65535 < e && 1114112 > e && (f =\n e))\n }\n null === f ? (f = 65533, g = 1) : 65535 < f && (f -= 65536, d.push(f >>> 10 & 1023 | 55296), f = 56320 | f & 1023);\n d.push(f);\n b += g\n }\n a = d.length;\n if (a <= La) d = String.fromCharCode.apply(String, d); else {\n c = \"\";\n for (b = 0; b < a;) c += String.fromCharCode.apply(String, d.slice(b, b += La));\n d = c\n }\n return d\n}\n\nvar La = 4096;\nv.prototype.slice = function (a, b) {\n var c = this.length;\n a = ~~a;\n b = void 0 === b ? c : ~~b;\n 0 > a ? (a += c, 0 > a && (a = 0)) : a > c && (a = c);\n 0 > b ? (b += c, 0 > b && (b = 0)) : b > c && (b = c);\n b < a && (b = a);\n if (v.TYPED_ARRAY_SUPPORT) b = this.subarray(a, b), b.__proto__ = v.prototype; else {\n c = b - a;\n b = new v(c, void 0);\n for (var d = 0; d < c; ++d) b[d] = this[d + a]\n }\n return b\n};\n\nfunction C(a, b, c) {\n if (0 !== a % 1 || 0 > a) throw new RangeError(\"offset is not uint\");\n if (a + b > c) throw new RangeError(\"Trying to access beyond buffer length\");\n}\n\nv.prototype.readUIntLE = function (a, b, c) {\n a |= 0;\n b |= 0;\n c || C(a, b, this.length);\n c = this[a];\n for (var d = 1, e = 0; ++e < b && (d *= 256);) c += this[a + e] * d;\n return c\n};\nv.prototype.readUIntBE = function (a, b, c) {\n a |= 0;\n b |= 0;\n c || C(a, b, this.length);\n c = this[a + --b];\n for (var d = 1; 0 < b && (d *= 256);) c += this[a + --b] * d;\n return c\n};\nv.prototype.readUInt8 = function (a, b) {\n b || C(a, 1, this.length);\n return this[a]\n};\nv.prototype.readUInt16LE = function (a, b) {\n b || C(a, 2, this.length);\n return this[a] | this[a + 1] << 8\n};\nv.prototype.readUInt16BE = function (a, b) {\n b || C(a, 2, this.length);\n return this[a] << 8 | this[a + 1]\n};\nv.prototype.readUInt32LE = function (a, b) {\n b || C(a, 4, this.length);\n return (this[a] | this[a + 1] << 8 | this[a + 2] << 16) + 16777216 * this[a + 3]\n};\nv.prototype.readUInt32BE = function (a, b) {\n b || C(a, 4, this.length);\n return 16777216 * this[a] + (this[a + 1] << 16 | this[a + 2] << 8 | this[a + 3])\n};\nv.prototype.readIntLE = function (a, b, c) {\n a |= 0;\n b |= 0;\n c || C(a, b, this.length);\n c = this[a];\n for (var d = 1, e = 0; ++e < b && (d *= 256);) c += this[a + e] * d;\n c >= 128 * d && (c -= Math.pow(2, 8 * b));\n return c\n};\nv.prototype.readIntBE = function (a, b, c) {\n a |= 0;\n b |= 0;\n c || C(a, b, this.length);\n c = b;\n for (var d = 1, e = this[a + --c]; 0 < c && (d *= 256);) e += this[a + --c] * d;\n e >= 128 * d && (e -= Math.pow(2, 8 * b));\n return e\n};\nv.prototype.readInt8 = function (a, b) {\n b || C(a, 1, this.length);\n return this[a] & 128 ? -1 * (255 - this[a] + 1) : this[a]\n};\nv.prototype.readInt16LE = function (a, b) {\n b || C(a, 2, this.length);\n a = this[a] | this[a + 1] << 8;\n return a & 32768 ? a | 4294901760 : a\n};\nv.prototype.readInt16BE = function (a, b) {\n b || C(a, 2, this.length);\n a = this[a + 1] | this[a] << 8;\n return a & 32768 ? a | 4294901760 : a\n};\nv.prototype.readInt32LE = function (a, b) {\n b || C(a, 4, this.length);\n return this[a] | this[a + 1] << 8 | this[a + 2] << 16 | this[a + 3] << 24\n};\nv.prototype.readInt32BE = function (a, b) {\n b || C(a, 4, this.length);\n return this[a] << 24 | this[a + 1] << 16 | this[a + 2] << 8 | this[a + 3]\n};\nv.prototype.readFloatLE = function (a, b) {\n b || C(a, 4, this.length);\n return pa(this, a, !0, 23, 4)\n};\nv.prototype.readFloatBE = function (a, b) {\n b || C(a, 4, this.length);\n return pa(this, a, !1, 23, 4)\n};\nv.prototype.readDoubleLE = function (a, b) {\n b || C(a, 8, this.length);\n return pa(this, a, !0, 52, 8)\n};\nv.prototype.readDoubleBE = function (a, b) {\n b || C(a, 8, this.length);\n return pa(this, a, !1, 52, 8)\n};\n\nfunction D(a, b, c, d, e, f) {\n if (!z(a)) throw new TypeError('\"buffer\" argument must be a Buffer instance');\n if (b > e || b < f) throw new RangeError('\"value\" argument is out of bounds');\n if (c + d > a.length) throw new RangeError(\"Index out of range\");\n}\n\nv.prototype.writeUIntLE = function (a, b, c, d) {\n a = +a;\n b |= 0;\n c |= 0;\n d || D(this, a, b, c, Math.pow(2, 8 * c) - 1, 0);\n d = 1;\n var e = 0;\n for (this[b] = a & 255; ++e < c && (d *= 256);) this[b + e] = a / d & 255;\n return b + c\n};\nv.prototype.writeUIntBE = function (a, b, c, d) {\n a = +a;\n b |= 0;\n c |= 0;\n d || D(this, a, b, c, Math.pow(2, 8 * c) - 1, 0);\n d = c - 1;\n var e = 1;\n for (this[b + d] = a & 255; 0 <= --d && (e *= 256);) this[b + d] = a / e & 255;\n return b + c\n};\nv.prototype.writeUInt8 = function (a, b, c) {\n a = +a;\n b |= 0;\n c || D(this, a, b, 1, 255, 0);\n v.TYPED_ARRAY_SUPPORT || (a = Math.floor(a));\n this[b] = a & 255;\n return b + 1\n};\n\nfunction Ma(a, b, c, d) {\n 0 > b && (b = 65535 + b + 1);\n for (var e = 0, f = Math.min(a.length - c, 2); e < f; ++e) a[c + e] = (b & 255 << 8 * (d ? e : 1 - e)) >>> 8 * (d ? e : 1 - e)\n}\n\nv.prototype.writeUInt16LE = function (a, b, c) {\n a = +a;\n b |= 0;\n c || D(this, a, b, 2, 65535, 0);\n v.TYPED_ARRAY_SUPPORT ? (this[b] = a & 255, this[b + 1] = a >>> 8) : Ma(this, a, b, !0);\n return b + 2\n};\nv.prototype.writeUInt16BE = function (a, b, c) {\n a = +a;\n b |= 0;\n c || D(this, a, b, 2, 65535, 0);\n v.TYPED_ARRAY_SUPPORT ? (this[b] = a >>> 8, this[b + 1] = a & 255) : Ma(this, a, b, !1);\n return b + 2\n};\n\nfunction Na(a, b, c, d) {\n 0 > b && (b = 4294967295 + b + 1);\n for (var e = 0, f = Math.min(a.length - c, 4); e < f; ++e) a[c + e] = b >>> 8 * (d ? e : 3 - e) & 255\n}\n\nv.prototype.writeUInt32LE = function (a, b, c) {\n a = +a;\n b |= 0;\n c || D(this, a, b, 4, 4294967295, 0);\n v.TYPED_ARRAY_SUPPORT ? (this[b + 3] = a >>> 24, this[b + 2] = a >>> 16, this[b + 1] = a >>> 8, this[b] = a & 255) : Na(this, a, b, !0);\n return b + 4\n};\nv.prototype.writeUInt32BE = function (a, b, c) {\n a = +a;\n b |= 0;\n c || D(this, a, b, 4, 4294967295, 0);\n v.TYPED_ARRAY_SUPPORT ? (this[b] = a >>> 24, this[b + 1] = a >>> 16, this[b + 2] = a >>> 8, this[b + 3] = a & 255) : Na(this, a, b, !1);\n return b + 4\n};\nv.prototype.writeIntLE = function (a, b, c, d) {\n a = +a;\n b |= 0;\n d || (d = Math.pow(2, 8 * c - 1), D(this, a, b, c, d - 1, -d));\n d = 0;\n var e = 1, f = 0;\n for (this[b] = a & 255; ++d < c && (e *= 256);) 0 > a && 0 === f && 0 !== this[b + d - 1] && (f = 1), this[b + d] = (a / e >> 0) - f & 255;\n return b + c\n};\nv.prototype.writeIntBE = function (a, b, c, d) {\n a = +a;\n b |= 0;\n d || (d = Math.pow(2, 8 * c - 1), D(this, a, b, c, d - 1, -d));\n d = c - 1;\n var e = 1, f = 0;\n for (this[b + d] = a & 255; 0 <= --d && (e *= 256);) 0 > a && 0 === f && 0 !== this[b + d + 1] && (f = 1), this[b + d] = (a / e >> 0) - f & 255;\n return b + c\n};\nv.prototype.writeInt8 = function (a, b, c) {\n a = +a;\n b |= 0;\n c || D(this, a, b, 1, 127, -128);\n v.TYPED_ARRAY_SUPPORT || (a = Math.floor(a));\n 0 > a && (a = 255 + a + 1);\n this[b] = a & 255;\n return b + 1\n};\nv.prototype.writeInt16LE = function (a, b, c) {\n a = +a;\n b |= 0;\n c || D(this, a, b, 2, 32767, -32768);\n v.TYPED_ARRAY_SUPPORT ? (this[b] = a & 255, this[b + 1] = a >>> 8) : Ma(this, a, b, !0);\n return b + 2\n};\nv.prototype.writeInt16BE = function (a, b, c) {\n a = +a;\n b |= 0;\n c || D(this, a, b, 2, 32767, -32768);\n v.TYPED_ARRAY_SUPPORT ? (this[b] = a >>> 8, this[b + 1] = a & 255) : Ma(this, a, b, !1);\n return b + 2\n};\nv.prototype.writeInt32LE = function (a, b, c) {\n a = +a;\n b |= 0;\n c || D(this, a, b, 4, 2147483647, -2147483648);\n v.TYPED_ARRAY_SUPPORT ? (this[b] = a & 255, this[b + 1] = a >>> 8, this[b + 2] = a >>> 16, this[b + 3] = a >>> 24) : Na(this, a, b, !0);\n return b + 4\n};\nv.prototype.writeInt32BE = function (a, b, c) {\n a = +a;\n b |= 0;\n c || D(this, a, b, 4, 2147483647, -2147483648);\n 0 > a && (a = 4294967295 + a + 1);\n v.TYPED_ARRAY_SUPPORT ? (this[b] = a >>> 24, this[b + 1] = a >>> 16, this[b + 2] = a >>> 8, this[b + 3] = a & 255) : Na(this, a, b, !1);\n return b + 4\n};\n\nfunction Oa(a, b, c, d) {\n if (c + d > a.length) throw new RangeError(\"Index out of range\");\n if (0 > c) throw new RangeError(\"Index out of range\");\n}\n\nv.prototype.writeFloatLE = function (a, b, c) {\n c || Oa(this, a, b, 4);\n qa(this, a, b, !0, 23, 4);\n return b + 4\n};\nv.prototype.writeFloatBE = function (a, b, c) {\n c || Oa(this, a, b, 4);\n qa(this, a, b, !1, 23, 4);\n return b + 4\n};\nv.prototype.writeDoubleLE = function (a, b, c) {\n c || Oa(this, a, b, 8);\n qa(this, a, b, !0, 52, 8);\n return b + 8\n};\nv.prototype.writeDoubleBE = function (a, b, c) {\n c || Oa(this, a, b, 8);\n qa(this, a, b, !1, 52, 8);\n return b + 8\n};\nv.prototype.copy = function (a, b, c, d) {\n c || (c = 0);\n d || 0 === d || (d = this.length);\n b >= a.length && (b = a.length);\n b || (b = 0);\n 0 < d && d < c && (d = c);\n if (d === c || 0 === a.length || 0 === this.length) return 0;\n if (0 > b) throw new RangeError(\"targetStart out of bounds\");\n if (0 > c || c >= this.length) throw new RangeError(\"sourceStart out of bounds\");\n if (0 > d) throw new RangeError(\"sourceEnd out of bounds\");\n d > this.length && (d = this.length);\n a.length - b < d - c && (d = a.length - b + c);\n var e = d - c;\n if (this === a && c < b && b < d) for (d = e - 1; 0 <= d; --d) a[d + b] = this[d + c]; else if (1E3 > e ||\n !v.TYPED_ARRAY_SUPPORT) for (d = 0; d < e; ++d) a[d + b] = this[d + c]; else Uint8Array.prototype.set.call(a, this.subarray(c, c + e), b);\n return e\n};\nv.prototype.fill = function (a, b, c, d) {\n if (\"string\" === typeof a) {\n \"string\" === typeof b ? (d = b, b = 0, c = this.length) : \"string\" === typeof c && (d = c, c = this.length);\n if (1 === a.length) {\n var e = a.charCodeAt(0);\n 256 > e && (a = e)\n }\n if (void 0 !== d && \"string\" !== typeof d) throw new TypeError(\"encoding must be a string\");\n if (\"string\" === typeof d && !v.isEncoding(d)) throw new TypeError(\"Unknown encoding: \" + d);\n } else \"number\" === typeof a && (a &= 255);\n if (0 > b || this.length < b || this.length < c) throw new RangeError(\"Out of range index\");\n if (c <= b) return this;\n b >>>=\n 0;\n c = void 0 === c ? this.length : c >>> 0;\n a || (a = 0);\n if (\"number\" === typeof a) for (d = b; d < c; ++d) this[d] = a; else for (a = z(a) ? a : Da((new v(a, d)).toString()), e = a.length, d = 0; d < c - b; ++d) this[d + b] = a[d % e];\n return this\n};\nvar Pa = /[^+\\/0-9A-Za-z-_]/g;\n\nfunction Da(a, b) {\n b = b || Infinity;\n for (var c, d = a.length, e = null, f = [], g = 0; g < d; ++g) {\n c = a.charCodeAt(g);\n if (55295 < c && 57344 > c) {\n if (!e) {\n if (56319 < c) {\n -1 < (b -= 3) && f.push(239, 191, 189);\n continue\n } else if (g + 1 === d) {\n -1 < (b -= 3) && f.push(239, 191, 189);\n continue\n }\n e = c;\n continue\n }\n if (56320 > c) {\n -1 < (b -= 3) && f.push(239, 191, 189);\n e = c;\n continue\n }\n c = (e - 55296 << 10 | c - 56320) + 65536\n } else e && -1 < (b -= 3) && f.push(239, 191, 189);\n e = null;\n if (128 > c) {\n if (0 > --b) break;\n f.push(c)\n } else if (2048 > c) {\n if (0 > (b -= 2)) break;\n f.push(c >> 6 | 192, c & 63 | 128)\n } else if (65536 > c) {\n if (0 > (b -= 3)) break;\n f.push(c >> 12 | 224, c >> 6 & 63 | 128, c & 63 | 128)\n } else if (1114112 > c) {\n if (0 > (b -= 4)) break;\n f.push(c >> 18 | 240, c >> 12 & 63 | 128, c >> 6 & 63 | 128, c & 63 | 128)\n } else throw Error(\"Invalid code point\");\n }\n return f\n}\n\nfunction Ka(a) {\n for (var b = [], c = 0; c < a.length; ++c) b.push(a.charCodeAt(c) & 255);\n return b\n}\n\nfunction Ea(a) {\n a = (a.trim ? a.trim() : a.replace(/^\\s+|\\s+$/g, \"\")).replace(Pa, \"\");\n if (2 > a.length) a = \"\"; else for (; 0 !== a.length % 4;) a += \"=\";\n la || ma();\n var b = a.length;\n if (0 < b % 4) throw Error(\"Invalid string. Length must be a multiple of 4\");\n var c = \"=\" === a[b - 2] ? 2 : \"=\" === a[b - 1] ? 1 : 0;\n var d = new ka(3 * b / 4 - c);\n var e = 0 < c ? b - 4 : b;\n var f = 0;\n for (b = 0; b < e; b += 4) {\n var g = u[a.charCodeAt(b)] << 18 | u[a.charCodeAt(b + 1)] << 12 | u[a.charCodeAt(b + 2)] << 6 | u[a.charCodeAt(b + 3)];\n d[f++] = g >> 16 & 255;\n d[f++] = g >> 8 & 255;\n d[f++] = g & 255\n }\n 2 === c ? (g = u[a.charCodeAt(b)] << 2 |\n u[a.charCodeAt(b + 1)] >> 4, d[f++] = g & 255) : 1 === c && (g = u[a.charCodeAt(b)] << 10 | u[a.charCodeAt(b + 1)] << 4 | u[a.charCodeAt(b + 2)] >> 2, d[f++] = g >> 8 & 255, d[f++] = g & 255);\n return d\n}\n\nfunction Ja(a, b, c, d) {\n for (var e = 0; e < d && !(e + c >= b.length || e >= a.length); ++e) b[e + c] = a[e];\n return e\n}\n\nfunction Ca(a) {\n return null != a && (!!a._isBuffer || Qa(a) || \"function\" === typeof a.readFloatLE && \"function\" === typeof a.slice && Qa(a.slice(0, 0)))\n}\n\nfunction Qa(a) {\n return !!a.constructor && \"function\" === typeof a.constructor.isBuffer && a.constructor.isBuffer(a)\n}\n\nvar Ra = Object.freeze({\n __proto__: null, INSPECT_MAX_BYTES: 50, kMaxLength: ta, Buffer: v, SlowBuffer: function (a) {\n +a != a && (a = 0);\n return v.alloc(+a)\n }, isBuffer: Ca\n }), E = v,\n Sa = \"undefined\" !== typeof globalThis ? globalThis : \"undefined\" !== typeof window ? window : \"undefined\" !== typeof global ? global : \"undefined\" !== typeof self ? self : {};\n\nfunction Ta(a, b) {\n return b = {exports: {}}, a(b, b.exports), b.exports\n}\n\nfunction Ua() {\n throw Error(\"setTimeout has not been defined\");\n}\n\nfunction Va() {\n throw Error(\"clearTimeout has not been defined\");\n}\n\nvar F = Ua, G = Va;\n\"function\" === typeof ja.setTimeout && (F = setTimeout);\n\"function\" === typeof ja.clearTimeout && (G = clearTimeout);\n\nfunction Wa(a) {\n if (F === setTimeout) return setTimeout(a, 0);\n if ((F === Ua || !F) && setTimeout) return F = setTimeout, setTimeout(a, 0);\n try {\n return F(a, 0)\n } catch (b) {\n try {\n return F.call(null, a, 0)\n } catch (c) {\n return F.call(this, a, 0)\n }\n }\n}\n\nfunction Xa(a) {\n if (G === clearTimeout) return clearTimeout(a);\n if ((G === Va || !G) && clearTimeout) return G = clearTimeout, clearTimeout(a);\n try {\n return G(a)\n } catch (b) {\n try {\n return G.call(null, a)\n } catch (c) {\n return G.call(this, a)\n }\n }\n}\n\nvar H = [], I = !1, J, Ya = -1;\n\nfunction Za() {\n I && J && (I = !1, J.length ? H = J.concat(H) : Ya = -1, H.length && $a())\n}\n\nfunction $a() {\n if (!I) {\n var a = Wa(Za);\n I = !0;\n for (var b = H.length; b;) {\n J = H;\n for (H = []; ++Ya < b;) J && J[Ya].run();\n Ya = -1;\n b = H.length\n }\n J = null;\n I = !1;\n Xa(a)\n }\n}\n\nfunction ab(a) {\n var b = Array(arguments.length - 1);\n if (1 < arguments.length) for (var c = 1; c < arguments.length; c++) b[c - 1] = arguments[c];\n H.push(new bb(a, b));\n 1 !== H.length || I || Wa($a)\n}\n\nfunction bb(a, b) {\n this.fun = a;\n this.array = b\n}\n\nbb.prototype.run = function () {\n this.fun.apply(null, this.array)\n};\n\nfunction K() {\n}\n\nvar L = ja.performance || {}, cb = L.now || L.mozNow || L.msNow || L.oNow || L.webkitNow || function () {\n return (new Date).getTime()\n}, db = new Date, eb = {\n nextTick: ab,\n title: \"browser\",\n browser: !0,\n env: {},\n argv: [],\n version: \"\",\n versions: {},\n on: K,\n addListener: K,\n once: K,\n off: K,\n removeListener: K,\n removeAllListeners: K,\n emit: K,\n binding: function () {\n throw Error(\"process.binding is not supported\");\n },\n cwd: function () {\n return \"/\"\n },\n chdir: function () {\n throw Error(\"process.chdir is not supported\");\n },\n umask: function () {\n return 0\n },\n hrtime: function (a) {\n var b = .001 *\n cb.call(L), c = Math.floor(b);\n b = Math.floor(b % 1 * 1E9);\n a && (c -= a[0], b -= a[1], 0 > b && (c--, b += 1E9));\n return [c, b]\n },\n platform: \"browser\",\n release: {},\n config: {},\n uptime: function () {\n return (new Date - db) / 1E3\n }\n}, fb = Ta(function (a, b) {\n function c(a, b) {\n for (var c in a) b[c] = a[c]\n }\n\n function d(a, b, c) {\n return e(a, b, c)\n }\n\n var e = Ra.Buffer;\n e.from && e.alloc && e.allocUnsafe && e.allocUnsafeSlow ? a.exports = Ra : (c(Ra, b), b.Buffer = d);\n d.prototype = Object.create(e.prototype);\n c(e, d);\n d.from = function (a, b, c) {\n if (\"number\" === typeof a) throw new TypeError(\"Argument must not be a number\");\n return e(a, b, c)\n };\n d.alloc = function (a, b, c) {\n if (\"number\" !== typeof a) throw new TypeError(\"Argument must be a number\");\n a = e(a);\n void 0 !== b ? \"string\" === typeof c ? a.fill(b, c) : a.fill(b) : a.fill(0);\n return a\n };\n d.allocUnsafe = function (a) {\n if (\"number\" !== typeof a) throw new TypeError(\"Argument must be a number\");\n return e(a)\n };\n d.allocUnsafeSlow = function (a) {\n if (\"number\" !== typeof a) throw new TypeError(\"Argument must be a number\");\n return Ra.SlowBuffer(a)\n }\n}), gb = Ta(function (a, b) {\n function c() {\n throw Error(\"secure random number generation not supported by this browser\\nuse chrome, FireFox or Internet Explorer 11\");\n }\n\n function d(a, b) {\n if (\"number\" !== typeof a || a !== a) throw new TypeError(\"offset must be a number\");\n if (a > p || 0 > a) throw new TypeError(\"offset must be a uint32\");\n if (a > n || a > b) throw new RangeError(\"offset out of range\");\n }\n\n function e(a, b, c) {\n if (\"number\" !== typeof a || a !== a) throw new TypeError(\"size must be a number\");\n if (a > p || 0 > a) throw new TypeError(\"size must be a uint32\");\n if (a + b > c || a > n) throw new RangeError(\"buffer too small\");\n }\n\n function f(a, b, c, f) {\n if (!(l.isBuffer(a) || a instanceof Sa.Uint8Array)) throw new TypeError('\"buf\" argument must be a Buffer or Uint8Array');\n if (\"function\" === typeof b) f = b, b = 0, c = a.length; else if (\"function\" === typeof c) f = c, c = a.length - b; else if (\"function\" !== typeof f) throw new TypeError('\"cb\" argument must be a function');\n d(b, a.length);\n e(c, b, a.length);\n return g(a, b, c, f)\n }\n\n function g(a, b, c, d) {\n b = new Uint8Array(a.buffer, b, c);\n r.getRandomValues(b);\n if (d) ab(function () {\n d(null, a)\n }); else return a\n }\n\n function h(a, b, c) {\n \"undefined\" === typeof b && (b = 0);\n if (!(l.isBuffer(a) || a instanceof Sa.Uint8Array)) throw new TypeError('\"buf\" argument must be a Buffer or Uint8Array');\n d(b, a.length);\n void 0 === c && (c = a.length - b);\n e(c, b, a.length);\n return g(a, b, c)\n }\n\n var l = fb.Buffer, n = fb.kMaxLength, r = Sa.crypto || Sa.msCrypto, p = Math.pow(2, 32) - 1;\n r && r.getRandomValues ? (b.randomFill = f, b.randomFillSync = h) : (b.randomFill = c, b.randomFillSync = c)\n}), hb = Ta(function (a) {\n a.exports = gb\n}).randomFillSync, ib = Math.floor(.001 * (Date.now() - performance.now()));\n\nfunction M(a) {\n if (\"string\" !== typeof a) throw new TypeError(\"Path must be a string. Received \" + JSON.stringify(a));\n}\n\nfunction jb(a, b) {\n for (var c = \"\", d = 0, e = -1, f = 0, g, h = 0; h <= a.length; ++h) {\n if (h < a.length) g = a.charCodeAt(h); else if (47 === g) break; else g = 47;\n if (47 === g) {\n if (e !== h - 1 && 1 !== f) if (e !== h - 1 && 2 === f) {\n if (2 > c.length || 2 !== d || 46 !== c.charCodeAt(c.length - 1) || 46 !== c.charCodeAt(c.length - 2)) if (2 < c.length) {\n if (e = c.lastIndexOf(\"/\"), e !== c.length - 1) {\n -1 === e ? (c = \"\", d = 0) : (c = c.slice(0, e), d = c.length - 1 - c.lastIndexOf(\"/\"));\n e = h;\n f = 0;\n continue\n }\n } else if (2 === c.length || 1 === c.length) {\n c = \"\";\n d = 0;\n e = h;\n f = 0;\n continue\n }\n b && (c = 0 < c.length ? c + \"/..\" : \"..\", d = 2)\n } else c =\n 0 < c.length ? c + (\"/\" + a.slice(e + 1, h)) : a.slice(e + 1, h), d = h - e - 1;\n e = h;\n f = 0\n } else 46 === g && -1 !== f ? ++f : f = -1\n }\n return c\n}\n\nvar kb = {\n resolve: function () {\n for (var a = \"\", b = !1, c, d = arguments.length - 1; -1 <= d && !b; d--) {\n if (0 <= d) var e = arguments[d]; else void 0 === c && (c = eb.cwd()), e = c;\n M(e);\n 0 !== e.length && (a = e + \"/\" + a, b = 47 === e.charCodeAt(0))\n }\n a = jb(a, !b);\n return b ? 0 < a.length ? \"/\" + a : \"/\" : 0 < a.length ? a : \".\"\n }, normalize: function (a) {\n M(a);\n if (0 === a.length) return \".\";\n var b = 47 === a.charCodeAt(0), c = 47 === a.charCodeAt(a.length - 1);\n a = jb(a, !b);\n 0 !== a.length || b || (a = \".\");\n 0 < a.length && c && (a += \"/\");\n return b ? \"/\" + a : a\n }, isAbsolute: function (a) {\n M(a);\n return 0 < a.length && 47 === a.charCodeAt(0)\n },\n join: function () {\n if (0 === arguments.length) return \".\";\n for (var a, b = 0; b < arguments.length; ++b) {\n var c = arguments[b];\n M(c);\n 0 < c.length && (a = void 0 === a ? c : a + (\"/\" + c))\n }\n return void 0 === a ? \".\" : kb.normalize(a)\n }, relative: function (a, b) {\n M(a);\n M(b);\n if (a === b) return \"\";\n a = kb.resolve(a);\n b = kb.resolve(b);\n if (a === b) return \"\";\n for (var c = 1; c < a.length && 47 === a.charCodeAt(c); ++c) ;\n for (var d = a.length, e = d - c, f = 1; f < b.length && 47 === b.charCodeAt(f); ++f) ;\n for (var g = b.length - f, h = e < g ? e : g, l = -1, n = 0; n <= h; ++n) {\n if (n === h) {\n if (g > h) {\n if (47 === b.charCodeAt(f + n)) return b.slice(f +\n n + 1);\n if (0 === n) return b.slice(f + n)\n } else e > h && (47 === a.charCodeAt(c + n) ? l = n : 0 === n && (l = 0));\n break\n }\n var r = a.charCodeAt(c + n), p = b.charCodeAt(f + n);\n if (r !== p) break; else 47 === r && (l = n)\n }\n e = \"\";\n for (n = c + l + 1; n <= d; ++n) if (n === d || 47 === a.charCodeAt(n)) e = 0 === e.length ? e + \"..\" : e + \"/..\";\n if (0 < e.length) return e + b.slice(f + l);\n f += l;\n 47 === b.charCodeAt(f) && ++f;\n return b.slice(f)\n }, _makeLong: function (a) {\n return a\n }, dirname: function (a) {\n M(a);\n if (0 === a.length) return \".\";\n for (var b = a.charCodeAt(0), c = 47 === b, d = -1, e = !0, f = a.length - 1; 1 <= f; --f) if (b = a.charCodeAt(f),\n 47 === b) {\n if (!e) {\n d = f;\n break\n }\n } else e = !1;\n return -1 === d ? c ? \"/\" : \".\" : c && 1 === d ? \"//\" : a.slice(0, d)\n }, basename: function (a, b) {\n if (void 0 !== b && \"string\" !== typeof b) throw new TypeError('\"ext\" argument must be a string');\n M(a);\n var c = 0, d = -1, e = !0, f;\n if (void 0 !== b && 0 < b.length && b.length <= a.length) {\n if (b.length === a.length && b === a) return \"\";\n var g = b.length - 1, h = -1;\n for (f = a.length - 1; 0 <= f; --f) {\n var l = a.charCodeAt(f);\n if (47 === l) {\n if (!e) {\n c = f + 1;\n break\n }\n } else -1 === h && (e = !1, h = f + 1), 0 <= g && (l === b.charCodeAt(g) ? -1 === --g && (d = f) : (g = -1, d = h))\n }\n c === d ? d =\n h : -1 === d && (d = a.length);\n return a.slice(c, d)\n }\n for (f = a.length - 1; 0 <= f; --f) if (47 === a.charCodeAt(f)) {\n if (!e) {\n c = f + 1;\n break\n }\n } else -1 === d && (e = !1, d = f + 1);\n return -1 === d ? \"\" : a.slice(c, d)\n }, extname: function (a) {\n M(a);\n for (var b = -1, c = 0, d = -1, e = !0, f = 0, g = a.length - 1; 0 <= g; --g) {\n var h = a.charCodeAt(g);\n if (47 === h) {\n if (!e) {\n c = g + 1;\n break\n }\n } else -1 === d && (e = !1, d = g + 1), 46 === h ? -1 === b ? b = g : 1 !== f && (f = 1) : -1 !== b && (f = -1)\n }\n return -1 === b || -1 === d || 0 === f || 1 === f && b === d - 1 && b === c + 1 ? \"\" : a.slice(b, d)\n }, format: function (a) {\n if (null === a || \"object\" !== typeof a) throw new TypeError('The \"pathObject\" argument must be of type Object. Received type ' +\n typeof a);\n var b = a.dir || a.root, c = a.base || (a.name || \"\") + (a.ext || \"\");\n a = b ? b === a.root ? b + c : b + \"/\" + c : c;\n return a\n }, parse: function (a) {\n M(a);\n var b = {root: \"\", dir: \"\", base: \"\", ext: \"\", name: \"\"};\n if (0 === a.length) return b;\n var c = a.charCodeAt(0), d = 47 === c;\n if (d) {\n b.root = \"/\";\n var e = 1\n } else e = 0;\n for (var f = -1, g = 0, h = -1, l = !0, n = a.length - 1, r = 0; n >= e; --n) if (c = a.charCodeAt(n), 47 === c) {\n if (!l) {\n g = n + 1;\n break\n }\n } else -1 === h && (l = !1, h = n + 1), 46 === c ? -1 === f ? f = n : 1 !== r && (r = 1) : -1 !== f && (r = -1);\n -1 === f || -1 === h || 0 === r || 1 === r && f === h - 1 && f === g + 1 ? -1 !== h && (b.base = 0 ===\n g && d ? b.name = a.slice(1, h) : b.name = a.slice(g, h)) : (0 === g && d ? (b.name = a.slice(1, f), b.base = a.slice(1, h)) : (b.name = a.slice(g, f), b.base = a.slice(g, h)), b.ext = a.slice(f, h));\n 0 < g ? b.dir = a.slice(0, g - 1) : d && (b.dir = \"/\");\n return b\n }, sep: \"/\", delimiter: \":\", win32: null, posix: null\n }, lb = kb.posix = kb, mb = Object.freeze({__proto__: null, \"default\": lb, __moduleExports: lb}), pb = {\n hrtime: function (a) {\n return function (b) {\n b = a(b);\n return 1E9 * b[0] + b[1]\n }\n }(function (a) {\n var b = .001 * performance.now(), c = Math.floor(b) + ib;\n b = Math.floor(b % 1 * 1E9);\n a && (c -= a[0],\n b -= a[1], 0 > b && (c--, b += 1E9));\n return [c, b]\n }), exit: function (a) {\n throw new nb(a);\n }, kill: function (a) {\n throw new ob(a);\n }, randomFillSync: hb, isTTY: function () {\n return !0\n }, path: mb, fs: null\n }, N, O = k(1), P = k(2), Q = k(4), R = k(8), S = k(16), qb = k(32), T = k(64), V = k(128), sb = k(256), tb = k(512),\n ub = k(1024), vb = k(2048), wb = k(4096), xb = k(8192), yb = k(16384), zb = k(32768), Ab = k(65536), Bb = k(131072),\n Cb = k(262144), Db = k(524288), Eb = k(1048576), W = k(2097152), Ib = k(4194304), Jb = k(8388608), Kb = k(16777216),\n Lb = k(33554432), Mb = k(67108864), X = k(134217728), Nb = k(268435456),\n Ob = O | P | Q | R | S | qb | T | V | sb | tb | ub | vb | wb | xb | yb | zb | Ab | Bb | Cb | Db | Eb | W | Jb | Ib | Kb | Mb | Lb | X | Nb,\n Pb = O | P | Q | R | S | qb | T | V | sb | W | Ib | Jb | X, Qb = k(0),\n Rb = R | S | V | tb | ub | vb | wb | xb | yb | zb | Ab | Bb | Cb | Db | Eb | W | Jb | Kb | Mb | Lb | X,\n Sb = Rb | Pb, Tb = P | R | T | W | X | Nb, Ub = P | R | T | W | X, Vb = k(0), Wb = {\n E2BIG: 1,\n EACCES: 2,\n EADDRINUSE: 3,\n EADDRNOTAVAIL: 4,\n EAFNOSUPPORT: 5,\n EALREADY: 7,\n EAGAIN: 6,\n EBADF: 8,\n EBADMSG: 9,\n EBUSY: 10,\n ECANCELED: 11,\n ECHILD: 12,\n ECONNABORTED: 13,\n ECONNREFUSED: 14,\n ECONNRESET: 15,\n EDEADLOCK: 16,\n EDESTADDRREQ: 17,\n EDOM: 18,\n EDQUOT: 19,\n EEXIST: 20,\n EFAULT: 21,\n EFBIG: 22,\n EHOSTDOWN: 23,\n EHOSTUNREACH: 23,\n EIDRM: 24,\n EILSEQ: 25,\n EINPROGRESS: 26,\n EINTR: 27,\n EINVAL: 28,\n EIO: 29,\n EISCONN: 30,\n EISDIR: 31,\n ELOOP: 32,\n EMFILE: 33,\n EMLINK: 34,\n EMSGSIZE: 35,\n EMULTIHOP: 36,\n ENAMETOOLONG: 37,\n ENETDOWN: 38,\n ENETRESET: 39,\n ENETUNREACH: 40,\n ENFILE: 41,\n ENOBUFS: 42,\n ENODEV: 43,\n ENOENT: 44,\n ENOEXEC: 45,\n ENOLCK: 46,\n ENOLINK: 47,\n ENOMEM: 48,\n ENOMSG: 49,\n ENOPROTOOPT: 50,\n ENOSPC: 51,\n ENOSYS: 52,\n ENOTCONN: 53,\n ENOTDIR: 54,\n ENOTEMPTY: 55,\n ENOTRECOVERABLE: 56,\n ENOTSOCK: 57,\n ENOTTY: 59,\n ENXIO: 60,\n EOVERFLOW: 61,\n EOWNERDEAD: 62,\n EPERM: 63,\n EPIPE: 64,\n EPROTO: 65,\n EPROTONOSUPPORT: 66,\n EPROTOTYPE: 67,\n ERANGE: 68,\n EROFS: 69,\n ESPIPE: 70,\n ESRCH: 71,\n ESTALE: 72,\n ETIMEDOUT: 73,\n ETXTBSY: 74,\n EXDEV: 75\n },\n Xb = (N = {}, N[6] = \"SIGHUP\", N[8] = \"SIGINT\", N[11] = \"SIGQUIT\", N[7] = \"SIGILL\", N[15] = \"SIGTRAP\", N[0] = \"SIGABRT\", N[2] = \"SIGBUS\", N[5] = \"SIGFPE\", N[9] = \"SIGKILL\", N[20] = \"SIGUSR1\", N[12] = \"SIGSEGV\", N[21] = \"SIGUSR2\", N[10] = \"SIGPIPE\", N[1] = \"SIGALRM\", N[14] = \"SIGTERM\", N[3] = \"SIGCHLD\", N[4] = \"SIGCONT\", N[13] = \"SIGSTOP\", N[16] = \"SIGTSTP\", N[17] = \"SIGTTIN\", N[18] = \"SIGTTOU\", N[19] = \"SIGURG\", N[23] = \"SIGXCPU\", N[24] = \"SIGXFSZ\", N[22] = \"SIGVTALRM\", N),\n Yb = O | P | S | V | W | X, Zb = O | T | S | V | W | X;\n\nfunction Y(a) {\n var b = Math.trunc(a);\n a = k(Math.round(1E6 * (a - b)));\n return k(b) * k(1E6) + a\n}\n\nfunction $b(a) {\n \"number\" === typeof a && (a = Math.trunc(a));\n a = k(a);\n return Number(a / k(1E6))\n}\n\nfunction Z(a) {\n return function () {\n for (var b = [], c = 0; c < arguments.length; c++) b[c] = arguments[c];\n try {\n return a.apply(void 0, fa(b))\n } catch (d) {\n if (d && d.code && \"string\" === typeof d.code) return Wb[d.code] || 28;\n if (d instanceof ac) return d.errno;\n throw d;\n }\n }\n}\n\nfunction bc(a, b) {\n var c = a.FD_MAP.get(b);\n if (!c) throw new ac(8);\n if (void 0 === c.filetype) {\n var d = a.bindings.fs.fstatSync(c.real);\n a = cc(a, b, d);\n b = a.rightsBase;\n d = a.rightsInheriting;\n c.filetype = a.filetype;\n c.rights || (c.rights = {base: b, inheriting: d})\n }\n return c\n}\n\nfunction cc(a, b, c) {\n switch (!0) {\n case c.isBlockDevice():\n return {filetype: 1, rightsBase: Ob, rightsInheriting: Ob};\n case c.isCharacterDevice():\n return void 0 !== b && a.bindings.isTTY(b) ? {\n filetype: 2,\n rightsBase: Ub,\n rightsInheriting: Vb\n } : {filetype: 2, rightsBase: Ob, rightsInheriting: Ob};\n case c.isDirectory():\n return {filetype: 3, rightsBase: Rb, rightsInheriting: Sb};\n case c.isFIFO():\n return {filetype: 6, rightsBase: Tb, rightsInheriting: Ob};\n case c.isFile():\n return {filetype: 4, rightsBase: Pb, rightsInheriting: Qb};\n case c.isSocket():\n return {\n filetype: 6,\n rightsBase: Tb, rightsInheriting: Ob\n };\n case c.isSymbolicLink():\n return {filetype: 7, rightsBase: k(0), rightsInheriting: k(0)};\n default:\n return {filetype: 0, rightsBase: k(0), rightsInheriting: k(0)}\n }\n}\n\nvar ac = function (a) {\n function b(c) {\n var d = a.call(this) || this;\n d.errno = c;\n Object.setPrototypeOf(d, b.prototype);\n return d\n }\n\n ba(b, a);\n return b\n}(Error), nb = function (a) {\n function b(c) {\n var d = a.call(this, \"WASI Exit error: \" + c) || this;\n d.code = c;\n Object.setPrototypeOf(d, b.prototype);\n return d\n }\n\n ba(b, a);\n return b\n}(Error), ob = function (a) {\n function b(c) {\n var d = a.call(this, \"WASI Kill signal: \" + c) || this;\n d.signal = c;\n Object.setPrototypeOf(d, b.prototype);\n return d\n }\n\n ba(b, a);\n return b\n}(Error), dc = function () {\n function a(a) {\n function b(a) {\n switch (a) {\n case 1:\n return r.hrtime();\n case 0:\n return Y(Date.now());\n case 2:\n case 3:\n return r.hrtime() - ec;\n default:\n return null\n }\n }\n\n function d(a, b) {\n a = bc(g, a);\n if (b !== k(0) && (a.rights.base & b) === k(0)) throw new ac(63);\n return a\n }\n\n function e(a, b) {\n g.refreshMemory();\n return Array.from({length: b}, function (b, c) {\n c = a + 8 * c;\n b = g.view.getUint32(c, !0);\n c = g.view.getUint32(c + 4, !0);\n return new Uint8Array(g.memory.buffer, b, c)\n })\n }\n\n var f, g = this, h = {};\n a && a.preopens ? h = a.preopens : a && a.preopenDirectories && (h = a.preopenDirectories);\n var l = {};\n a && a.env && (l = a.env);\n var n = [];\n a && a.args && (n =\n a.args);\n var r = pb;\n a && a.bindings && (r = a.bindings);\n this.view = this.memory = void 0;\n this.bindings = r;\n this.FD_MAP = new Map([[0, {\n real: 0,\n filetype: 2,\n rights: {base: Yb, inheriting: k(0)},\n path: void 0\n }], [1, {real: 1, filetype: 2, rights: {base: Zb, inheriting: k(0)}, path: void 0}], [2, {\n real: 2,\n filetype: 2,\n rights: {base: Zb, inheriting: k(0)},\n path: void 0\n }]]);\n var p = this.bindings.fs, y = this.bindings.path;\n try {\n for (var ua = ca(Object.entries(h)), ea = ua.next(); !ea.done; ea = ua.next()) {\n var rb = da(ea.value, 2), fc = rb[0], Fb = rb[1], gc = p.openSync(Fb, p.constants.O_RDONLY),\n hc = fa(this.FD_MAP.keys()).reverse()[0] + 1;\n this.FD_MAP.set(hc, {real: gc, filetype: 3, rights: {base: Rb, inheriting: Sb}, fakePath: fc, path: Fb})\n }\n } catch (t) {\n var Gb = {error: t}\n } finally {\n try {\n ea && !ea.done && (f = ua.return) && f.call(ua)\n } finally {\n if (Gb) throw Gb.error;\n }\n }\n var ec = r.hrtime();\n this.wasiImport = {\n args_get: function (a, b) {\n g.refreshMemory();\n var c = a, d = b;\n n.forEach(function (a) {\n g.view.setUint32(c, d, !0);\n c += 4;\n d += E.from(g.memory.buffer).write(a + \"\\x00\", d)\n });\n return 0\n }, args_sizes_get: function (a, b) {\n g.refreshMemory();\n g.view.setUint32(a,\n n.length, !0);\n a = n.reduce(function (a, b) {\n return a + E.byteLength(b) + 1\n }, 0);\n g.view.setUint32(b, a, !0);\n return 0\n }, environ_get: function (a, b) {\n g.refreshMemory();\n var c = a, d = b;\n Object.entries(l).forEach(function (a) {\n var b = da(a, 2);\n a = b[0];\n b = b[1];\n g.view.setUint32(c, d, !0);\n c += 4;\n d += E.from(g.memory.buffer).write(a + \"=\" + b + \"\\x00\", d)\n });\n return 0\n }, environ_sizes_get: function (a, b) {\n g.refreshMemory();\n var c = Object.entries(l).map(function (a) {\n a = da(a, 2);\n return a[0] + \"=\" + a[1] + \"\\x00\"\n }), d = c.reduce(function (a, b) {\n return a + E.byteLength(b)\n }, 0);\n g.view.setUint32(a, c.length, !0);\n g.view.setUint32(b, d, !0);\n return 0\n }, clock_res_get: function (a, b) {\n switch (a) {\n case 1:\n case 2:\n case 3:\n var c = k(1);\n break;\n case 0:\n c = k(1E3)\n }\n g.view.setBigUint64(b, c);\n return 0\n }, clock_time_get: function (a, c, d) {\n g.refreshMemory();\n a = b(a);\n if (null === a) return 28;\n g.view.setBigUint64(d, k(a), !0);\n return 0\n }, fd_advise: Z(function (a) {\n d(a, V);\n return 52\n }), fd_allocate: Z(function (a) {\n d(a, sb);\n return 52\n }), fd_close: Z(function (a) {\n var b = d(a, k(0));\n p.closeSync(b.real);\n g.FD_MAP.delete(a);\n return 0\n }), fd_datasync: Z(function (a) {\n a =\n d(a, O);\n p.fdatasyncSync(a.real);\n return 0\n }), fd_fdstat_get: Z(function (a, b) {\n a = d(a, k(0));\n g.refreshMemory();\n g.view.setUint8(b, a.filetype);\n g.view.setUint16(b + 2, 0, !0);\n g.view.setUint16(b + 4, 0, !0);\n g.view.setBigUint64(b + 8, k(a.rights.base), !0);\n g.view.setBigUint64(b + 8 + 8, k(a.rights.inheriting), !0);\n return 0\n }), fd_fdstat_set_flags: Z(function (a) {\n d(a, R);\n return 52\n }), fd_fdstat_set_rights: Z(function (a, b, c) {\n a = d(a, k(0));\n if ((a.rights.base | b) > a.rights.base || (a.rights.inheriting | c) > a.rights.inheriting) return 63;\n a.rights.base =\n b;\n a.rights.inheriting = c;\n return 0\n }), fd_filestat_get: Z(function (a, b) {\n a = d(a, W);\n var c = p.fstatSync(a.real);\n g.refreshMemory();\n g.view.setBigUint64(b, k(c.dev), !0);\n b += 8;\n g.view.setBigUint64(b, k(c.ino), !0);\n b += 8;\n g.view.setUint8(b, a.filetype);\n b += 8;\n g.view.setBigUint64(b, k(c.nlink), !0);\n b += 8;\n g.view.setBigUint64(b, k(c.size), !0);\n b += 8;\n g.view.setBigUint64(b, Y(c.atimeMs), !0);\n b += 8;\n g.view.setBigUint64(b, Y(c.mtimeMs), !0);\n g.view.setBigUint64(b + 8, Y(c.ctimeMs), !0);\n return 0\n }), fd_filestat_set_size: Z(function (a, b) {\n a = d(a, Ib);\n p.ftruncateSync(a.real,\n Number(b));\n return 0\n }), fd_filestat_set_times: Z(function (a, c, e, g) {\n a = d(a, Jb);\n var f = p.fstatSync(a.real), t = f.atime;\n f = f.mtime;\n var q = $b(b(0));\n if (3 === (g & 3) || 12 === (g & 12)) return 28;\n 1 === (g & 1) ? t = $b(c) : 2 === (g & 2) && (t = q);\n 4 === (g & 4) ? f = $b(e) : 8 === (g & 8) && (f = q);\n p.futimesSync(a.real, new Date(t), new Date(f));\n return 0\n }), fd_prestat_get: Z(function (a, b) {\n a = d(a, k(0));\n if (!a.path) return 28;\n g.refreshMemory();\n g.view.setUint8(b, 0);\n g.view.setUint32(b + 4, E.byteLength(a.fakePath), !0);\n return 0\n }), fd_prestat_dir_name: Z(function (a, b, c) {\n a =\n d(a, k(0));\n if (!a.path) return 28;\n g.refreshMemory();\n E.from(g.memory.buffer).write(a.fakePath, b, c, \"utf8\");\n return 0\n }), fd_pwrite: Z(function (a, b, c, f, h) {\n var t = d(a, T | Q), q = 0;\n e(b, c).forEach(function (a) {\n for (var b = 0; b < a.byteLength;) b += p.writeSync(t.real, a, b, a.byteLength - b, Number(f) + q + b);\n q += b\n });\n g.view.setUint32(h, q, !0);\n return 0\n }), fd_write: Z(function (a, b, c, f) {\n var t = d(a, T), q = 0;\n e(b, c).forEach(function (a) {\n for (var b = 0; b < a.byteLength;) {\n var c = p.writeSync(t.real, a, b, a.byteLength - b, t.offset ? Number(t.offset) : null);\n t.offset &&\n (t.offset += k(c));\n b += c\n }\n q += b\n });\n g.view.setUint32(f, q, !0);\n return 0\n }), fd_pread: Z(function (a, b, c, f, h) {\n var t;\n a = d(a, P | Q);\n var q = 0;\n try {\n var x = ca(e(b, c)), l = x.next();\n a:for (; !l.done; l = x.next()) {\n var n = l.value;\n for (b = 0; b < n.byteLength;) {\n var ic = n.byteLength - b,\n B = p.readSync(a.real, n, b, n.byteLength - b, Number(f) + q + b);\n b += B;\n q += B;\n if (0 === B || B < ic) break a\n }\n q += b\n }\n } catch (U) {\n var r = {error: U}\n } finally {\n try {\n l && !l.done && (t = x.return) && t.call(x)\n } finally {\n if (r) throw r.error;\n }\n }\n g.view.setUint32(h, q, !0);\n return 0\n }), fd_read: Z(function (a, b, c, f) {\n var t;\n a = d(a, P);\n var q = 0 === a.real, h = 0;\n try {\n var x = ca(e(b, c)), l = x.next();\n a:for (; !l.done; l = x.next()) {\n var n = l.value;\n for (b = 0; b < n.byteLength;) {\n var B = n.byteLength - b,\n r = p.readSync(a.real, n, b, B, q || void 0 === a.offset ? null : Number(a.offset));\n q || (a.offset = (a.offset ? a.offset : k(0)) + k(r));\n b += r;\n h += r;\n if (0 === r || r < B) break a\n }\n }\n } catch (U) {\n var y = {error: U}\n } finally {\n try {\n l && !l.done && (t = x.return) && t.call(x)\n } finally {\n if (y) throw y.error;\n }\n }\n g.view.setUint32(f, h, !0);\n return 0\n }), fd_readdir: Z(function (a, b, c, e, f) {\n a = d(a, yb);\n g.refreshMemory();\n var t =\n p.readdirSync(a.path, {withFileTypes: !0}), q = b;\n for (e = Number(e); e < t.length; e += 1) {\n var h = t[e], x = E.byteLength(h.name);\n if (b - q > c) break;\n g.view.setBigUint64(b, k(e + 1), !0);\n b += 8;\n if (b - q > c) break;\n var l = p.statSync(y.resolve(a.path, h.name));\n g.view.setBigUint64(b, k(l.ino), !0);\n b += 8;\n if (b - q > c) break;\n g.view.setUint32(b, x, !0);\n b += 4;\n if (b - q > c) break;\n switch (!0) {\n case l.isBlockDevice():\n l = 1;\n break;\n case l.isCharacterDevice():\n l = 2;\n break;\n case l.isDirectory():\n l = 3;\n break;\n case l.isFIFO():\n l = 6;\n break;\n case l.isFile():\n l = 4;\n break;\n case l.isSocket():\n l =\n 6;\n break;\n case l.isSymbolicLink():\n l = 7;\n break;\n default:\n l = 0\n }\n g.view.setUint8(b, l);\n b += 1;\n b += 3;\n if (b + x >= q + c) break;\n E.from(g.memory.buffer).write(h.name, b);\n b += x\n }\n g.view.setUint32(f, Math.min(b - q, c), !0);\n return 0\n }), fd_renumber: Z(function (a, b) {\n d(a, k(0));\n d(b, k(0));\n p.closeSync(g.FD_MAP.get(a).real);\n g.FD_MAP.set(a, g.FD_MAP.get(b));\n g.FD_MAP.delete(b);\n return 0\n }), fd_seek: Z(function (a, b, c, e) {\n a = d(a, Q);\n g.refreshMemory();\n switch (c) {\n case 1:\n a.offset = (a.offset ? a.offset : k(0)) + k(b);\n break;\n case 2:\n c = p.fstatSync(a.real).size;\n a.offset =\n k(c) + k(b);\n break;\n case 0:\n a.offset = k(b)\n }\n g.view.setBigUint64(e, a.offset, !0);\n return 0\n }), fd_tell: Z(function (a, b) {\n a = d(a, qb);\n g.refreshMemory();\n a.offset || (a.offset = k(0));\n g.view.setBigUint64(b, a.offset, !0);\n return 0\n }), fd_sync: Z(function (a) {\n a = d(a, S);\n p.fsyncSync(a.real);\n return 0\n }), path_create_directory: Z(function (a, b, c) {\n a = d(a, tb);\n if (!a.path) return 28;\n g.refreshMemory();\n b = E.from(g.memory.buffer, b, c).toString();\n p.mkdirSync(y.resolve(a.path, b));\n return 0\n }), path_filestat_get: Z(function (a, b, c, e, f) {\n a = d(a, Cb);\n if (!a.path) return 28;\n g.refreshMemory();\n c = E.from(g.memory.buffer, c, e).toString();\n c = p.statSync(y.resolve(a.path, c));\n g.view.setBigUint64(f, k(c.dev), !0);\n f += 8;\n g.view.setBigUint64(f, k(c.ino), !0);\n f += 8;\n g.view.setUint8(f, cc(g, void 0, c).filetype);\n f += 8;\n g.view.setBigUint64(f, k(c.nlink), !0);\n f += 8;\n g.view.setBigUint64(f, k(c.size), !0);\n f += 8;\n g.view.setBigUint64(f, Y(c.atimeMs), !0);\n f += 8;\n g.view.setBigUint64(f, Y(c.mtimeMs), !0);\n g.view.setBigUint64(f + 8, Y(c.ctimeMs), !0);\n return 0\n }), path_filestat_set_times: Z(function (a, c, e, f, h, l, n) {\n a = d(a, Eb);\n if (!a.path) return 28;\n g.refreshMemory();\n var t = p.fstatSync(a.real);\n c = t.atime;\n t = t.mtime;\n var q = $b(b(0));\n if (3 === (n & 3) || 12 === (n & 12)) return 28;\n 1 === (n & 1) ? c = $b(h) : 2 === (n & 2) && (c = q);\n 4 === (n & 4) ? t = $b(l) : 8 === (n & 8) && (t = q);\n e = E.from(g.memory.buffer, e, f).toString();\n p.utimesSync(y.resolve(a.path, e), new Date(c), new Date(t));\n return 0\n }), path_link: Z(function (a, b, c, e, f, h, l) {\n a = d(a, vb);\n f = d(f, wb);\n if (!a.path || !f.path) return 28;\n g.refreshMemory();\n c = E.from(g.memory.buffer, c, e).toString();\n h = E.from(g.memory.buffer, h, l).toString();\n p.linkSync(y.resolve(a.path,\n c), y.resolve(f.path, h));\n return 0\n }), path_open: Z(function (a, b, c, e, f, h, l, n, r) {\n b = d(a, xb);\n h = k(h);\n l = k(l);\n a = (h & (P | yb)) !== k(0);\n var t = (h & (O | T | sb | Ib)) !== k(0);\n if (t && a) var q = p.constants.O_RDWR; else a ? q = p.constants.O_RDONLY : t && (q = p.constants.O_WRONLY);\n a = h | xb;\n h |= l;\n 0 !== (f & 1) && (q |= p.constants.O_CREAT, a |= ub);\n 0 !== (f & 2) && (q |= p.constants.O_DIRECTORY);\n 0 !== (f & 4) && (q |= p.constants.O_EXCL);\n 0 !== (f & 8) && (q |= p.constants.O_TRUNC, a |= Db);\n 0 !== (n & 1) && (q |= p.constants.O_APPEND);\n 0 !== (n & 2) && (q = p.constants.O_DSYNC ? q | p.constants.O_DSYNC :\n q | p.constants.O_SYNC, h |= O);\n 0 !== (n & 4) && (q |= p.constants.O_NONBLOCK);\n 0 !== (n & 8) && (q = p.constants.O_RSYNC ? q | p.constants.O_RSYNC : q | p.constants.O_SYNC, h |= S);\n 0 !== (n & 16) && (q |= p.constants.O_SYNC, h |= S);\n t && 0 === (q & (p.constants.O_APPEND | p.constants.O_TRUNC)) && (h |= Q);\n g.refreshMemory();\n c = E.from(g.memory.buffer, c, e).toString();\n c = y.resolve(b.path, c);\n if (y.relative(b.path, c).startsWith(\"..\")) return 76;\n try {\n var x = p.realpathSync(c);\n if (y.relative(b.path, x).startsWith(\"..\")) return 76\n } catch (U) {\n if (\"ENOENT\" === U.code) x = c; else throw U;\n }\n try {\n var B = p.statSync(x).isDirectory()\n } catch (U) {\n }\n q = !t && B ? p.openSync(x, p.constants.O_RDONLY) : p.openSync(x, q);\n B = fa(g.FD_MAP.keys()).reverse()[0] + 1;\n g.FD_MAP.set(B, {real: q, filetype: void 0, rights: {base: a, inheriting: h}, path: x});\n bc(g, B);\n g.view.setUint32(r, B, !0);\n return 0\n }), path_readlink: Z(function (a, b, c, e, f, h) {\n a = d(a, zb);\n if (!a.path) return 28;\n g.refreshMemory();\n b = E.from(g.memory.buffer, b, c).toString();\n b = y.resolve(a.path, b);\n b = p.readlinkSync(b);\n e = E.from(g.memory.buffer).write(b, e, f);\n g.view.setUint32(h, e, !0);\n return 0\n }),\n path_remove_directory: Z(function (a, b, c) {\n a = d(a, Lb);\n if (!a.path) return 28;\n g.refreshMemory();\n b = E.from(g.memory.buffer, b, c).toString();\n p.rmdirSync(y.resolve(a.path, b));\n return 0\n }), path_rename: Z(function (a, b, c, e, f, h) {/**/\n a = d(a, Ab);\n e = d(e, Bb);\n if (!a.path || !e.path) return 28;\n g.refreshMemory();\n b = E.from(g.memory.buffer, b, c).toString();\n f = E.from(g.memory.buffer, f, h).toString();\n p.renameSync(y.resolve(a.path, b), y.resolve(e.path, f));\n return 0\n }), path_symlink: Z(function (a, b, c, e, f) {\n c = d(c, Kb);\n if (!c.path) return 28;\n g.refreshMemory();\n a = E.from(g.memory.buffer, a, b).toString();\n e = E.from(g.memory.buffer, e, f).toString();\n p.symlinkSync(a, y.resolve(c.path, e));\n return 0\n }), path_unlink_file: Z(function (a, b, c) {\n a = d(a, Mb);\n if (!a.path) return 28;\n g.refreshMemory();\n b = E.from(g.memory.buffer, b, c).toString();\n p.unlinkSync(y.resolve(a.path, b));\n return 0\n }), poll_oneoff: function (a, c, d, e) {\n var f = 0, h = 0;\n g.refreshMemory();\n for (var l = 0; l < d; l += 1) {\n var n = g.view.getBigUint64(a, !0);\n a += 8;\n var p = g.view.getUint8(a);\n a += 1;\n switch (p) {\n case 0:\n a += 7;\n g.view.getBigUint64(a, !0);\n a += 8;\n var q = g.view.getUint32(a, !0);\n a += 4;\n a += 4;\n p = g.view.getBigUint64(a, !0);\n a += 8;\n g.view.getBigUint64(a, !0);\n a += 8;\n var t = g.view.getUint16(a, !0);\n a += 2;\n a += 6;\n var x = 1 === t;\n t = 0;\n q = k(b(q));\n null === q ? t = 28 : (p = x ? p : q + p, h = p > h ? p : h);\n g.view.setBigUint64(c, n, !0);\n c += 8;\n g.view.setUint16(c, t, !0);\n c += 2;\n g.view.setUint8(c, 0);\n c += 1;\n c += 5;\n f += 1;\n break;\n case 1:\n case 2:\n a += 3;\n g.view.getUint32(a, !0);\n a += 4;\n g.view.setBigUint64(c, n, !0);\n c += 8;\n g.view.setUint16(c, 52, !0);\n c += 2;\n g.view.setUint8(c, p);\n c += 1;\n c += 5;\n f += 1;\n break;\n default:\n return 28\n }\n }\n for (g.view.setUint32(e,\n f, !0); r.hrtime() < h;) ;\n return 0\n }, proc_exit: function (a) {\n r.exit(a);\n return 0\n }, proc_raise: function (a) {\n if (!(a in Xb)) return 28;\n r.kill(Xb[a]);\n return 0\n }, random_get: function (a, b) {\n g.refreshMemory();\n r.randomFillSync(new Uint8Array(g.memory.buffer), a, b);\n return 0\n }, sched_yield: function () {\n return 0\n }, sock_recv: function () {\n return 52\n }, sock_send: function () {\n return 52\n }, sock_shutdown: function () {\n return 52\n }\n };\n a.traceSyscalls && Object.keys(this.wasiImport).forEach(function (a) {\n var b = g.wasiImport[a];\n g.wasiImport[a] = function () {\n for (var c =\n [], d = 0; d < arguments.length; d++) c[d] = arguments[d];\n console.log(\"WASI: wasiImport called: \" + a + \" (\" + c + \")\");\n try {\n var e = b.apply(void 0, fa(c));\n console.log(\"WASI: => \" + e);\n return e\n } catch (Hb) {\n throw console.log(\"Catched error: \" + Hb), Hb;\n }\n }\n })\n }\n\n a.prototype.refreshMemory = function () {\n this.view && 0 !== this.view.buffer.byteLength || (this.view = new ia(this.memory.buffer))\n };\n a.prototype.setMemory = function (a) {\n this.memory = a\n };\n a.prototype.start = function (a) {\n a = a.exports;\n if (null === a || \"object\" !== typeof a) throw Error(\"instance.exports must be an Object. Received \" +\n a + \".\");\n var b = a.memory;\n if (!(b instanceof WebAssembly.Memory)) throw Error(\"instance.exports.memory must be a WebAssembly.Memory. Recceived \" + b + \".\");\n this.setMemory(b);\n a._start && a._start()\n };\n a.prototype.getImportNamespace = function (a) {\n var b, d = null;\n try {\n for (var e = ca(WebAssembly.Module.imports(a)), f = e.next(); !f.done; f = e.next()) {\n var g = f.value;\n if (\"function\" === g.kind && g.module.startsWith(\"wasi_\")) if (!d) d = g.module; else if (d !== g.module) throw Error(\"Multiple namespaces detected.\");\n }\n } catch (l) {\n var h = {error: l}\n } finally {\n try {\n f &&\n !f.done && (b = e.return) && b.call(e)\n } finally {\n if (h) throw h.error;\n }\n }\n return d\n };\n a.prototype.getImports = function (a) {\n switch (this.getImportNamespace(a)) {\n case \"wasi_unstable\":\n return {wasi_unstable: this.wasiImport};\n case \"wasi_snapshot_preview1\":\n return {wasi_snapshot_preview1: this.wasiImport};\n default:\n throw Error(\"Can't detect a WASI namespace for the WebAssembly Module\");\n }\n };\n a.defaultBindings = pb;\n return a\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (dc);\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/@wasmer/wasi/lib/index.esm.js?"); + +/***/ }), + +/***/ "./node_modules/@wasmer/wasi/lib/index.js": +/*!************************************************!*\ + !*** ./node_modules/@wasmer/wasi/lib/index.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n/* eslint-disable no-unused-vars */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst bigint_1 = __webpack_require__(/*! ./polyfills/bigint */ \"./node_modules/@wasmer/wasi/lib/polyfills/bigint.js\");\nconst dataview_1 = __webpack_require__(/*! ./polyfills/dataview */ \"./node_modules/@wasmer/wasi/lib/polyfills/dataview.js\");\nconst buffer_1 = __webpack_require__(/*! ./polyfills/buffer */ \"./node_modules/@wasmer/wasi/lib/polyfills/buffer.js\");\n// Import our default bindings depending on the environment\nlet defaultBindings;\n/*ROLLUP_REPLACE_NODE\nimport nodeBindings from \"./bindings/node\";\ndefaultBindings = nodeBindings;\nROLLUP_REPLACE_NODE*/\n/*ROLLUP_REPLACE_BROWSER\nimport browserBindings from \"./bindings/browser\";\ndefaultBindings = browserBindings;\nROLLUP_REPLACE_BROWSER*/\n/*\n\nThis project is based from the Node implementation made by Gus Caplan\nhttps://github.com/devsnek/node-wasi\nHowever, JavaScript WASI is focused on:\n * Bringing WASI to the Browsers\n * Make easy to plug different filesystems\n * Provide a type-safe api using Typescript\n * Providing multiple output targets to support both browsers and node\n * The API is adapted to the Node-WASI API: https://github.com/nodejs/wasi/blob/wasi/lib/wasi.js\n\nCopyright 2019 Gus Caplan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to\ndeal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or\nsell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n\n */\nconst constants_1 = __webpack_require__(/*! ./constants */ \"./node_modules/@wasmer/wasi/lib/constants.js\");\nconst STDIN_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC |\n constants_1.WASI_RIGHT_FD_READ |\n constants_1.WASI_RIGHT_FD_SYNC |\n constants_1.WASI_RIGHT_FD_ADVISE |\n constants_1.WASI_RIGHT_FD_FILESTAT_GET |\n constants_1.WASI_RIGHT_POLL_FD_READWRITE;\nconst STDOUT_DEFAULT_RIGHTS = constants_1.WASI_RIGHT_FD_DATASYNC |\n constants_1.WASI_RIGHT_FD_WRITE |\n constants_1.WASI_RIGHT_FD_SYNC |\n constants_1.WASI_RIGHT_FD_ADVISE |\n constants_1.WASI_RIGHT_FD_FILESTAT_GET |\n constants_1.WASI_RIGHT_POLL_FD_READWRITE;\nconst STDERR_DEFAULT_RIGHTS = STDOUT_DEFAULT_RIGHTS;\nconst msToNs = (ms) => {\n const msInt = Math.trunc(ms);\n const decimal = bigint_1.BigIntPolyfill(Math.round((ms - msInt) * 1000000));\n const ns = bigint_1.BigIntPolyfill(msInt) * bigint_1.BigIntPolyfill(1000000);\n return ns + decimal;\n};\nconst nsToMs = (ns) => {\n if (typeof ns === 'number') {\n ns = Math.trunc(ns);\n }\n const nsInt = bigint_1.BigIntPolyfill(ns);\n return Number(nsInt / bigint_1.BigIntPolyfill(1000000));\n};\nconst wrap = (f) => (...args) => {\n try {\n return f(...args);\n }\n catch (e) {\n // If it's an error from the fs\n if (e && e.code && typeof e.code === \"string\") {\n return constants_1.ERROR_MAP[e.code] || constants_1.WASI_EINVAL;\n }\n // If it's a WASI error, we return it directly\n if (e instanceof WASIError) {\n return e.errno;\n }\n // Otherwise we let the error bubble up\n throw e;\n }\n};\nconst stat = (wasi, fd) => {\n const entry = wasi.FD_MAP.get(fd);\n if (!entry) {\n throw new WASIError(constants_1.WASI_EBADF);\n }\n if (entry.filetype === undefined) {\n const stats = wasi.bindings.fs.fstatSync(entry.real);\n const { filetype, rightsBase, rightsInheriting } = translateFileAttributes(wasi, fd, stats);\n entry.filetype = filetype;\n if (!entry.rights) {\n entry.rights = {\n base: rightsBase,\n inheriting: rightsInheriting\n };\n }\n }\n return entry;\n};\nconst translateFileAttributes = (wasi, fd, stats) => {\n switch (true) {\n case stats.isBlockDevice():\n return {\n filetype: constants_1.WASI_FILETYPE_BLOCK_DEVICE,\n rightsBase: constants_1.RIGHTS_BLOCK_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_BLOCK_DEVICE_INHERITING\n };\n case stats.isCharacterDevice(): {\n const filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n if (fd !== undefined && wasi.bindings.isTTY(fd)) {\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_TTY_BASE,\n rightsInheriting: constants_1.RIGHTS_TTY_INHERITING\n };\n }\n return {\n filetype,\n rightsBase: constants_1.RIGHTS_CHARACTER_DEVICE_BASE,\n rightsInheriting: constants_1.RIGHTS_CHARACTER_DEVICE_INHERITING\n };\n }\n case stats.isDirectory():\n return {\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n rightsBase: constants_1.RIGHTS_DIRECTORY_BASE,\n rightsInheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n };\n case stats.isFIFO():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isFile():\n return {\n filetype: constants_1.WASI_FILETYPE_REGULAR_FILE,\n rightsBase: constants_1.RIGHTS_REGULAR_FILE_BASE,\n rightsInheriting: constants_1.RIGHTS_REGULAR_FILE_INHERITING\n };\n case stats.isSocket():\n return {\n filetype: constants_1.WASI_FILETYPE_SOCKET_STREAM,\n rightsBase: constants_1.RIGHTS_SOCKET_BASE,\n rightsInheriting: constants_1.RIGHTS_SOCKET_INHERITING\n };\n case stats.isSymbolicLink():\n return {\n filetype: constants_1.WASI_FILETYPE_SYMBOLIC_LINK,\n rightsBase: bigint_1.BigIntPolyfill(0),\n rightsInheriting: bigint_1.BigIntPolyfill(0)\n };\n default:\n return {\n filetype: constants_1.WASI_FILETYPE_UNKNOWN,\n rightsBase: bigint_1.BigIntPolyfill(0),\n rightsInheriting: bigint_1.BigIntPolyfill(0)\n };\n }\n};\nclass WASIError extends Error {\n constructor(errno) {\n super();\n this.errno = errno;\n Object.setPrototypeOf(this, WASIError.prototype);\n }\n}\nexports.WASIError = WASIError;\nclass WASIExitError extends Error {\n constructor(code) {\n super(`WASI Exit error: ${code}`);\n this.code = code;\n Object.setPrototypeOf(this, WASIExitError.prototype);\n }\n}\nexports.WASIExitError = WASIExitError;\nclass WASIKillError extends Error {\n constructor(signal) {\n super(`WASI Kill signal: ${signal}`);\n this.signal = signal;\n Object.setPrototypeOf(this, WASIKillError.prototype);\n }\n}\nexports.WASIKillError = WASIKillError;\nclass WASIDefault {\n constructor(wasiConfig) {\n // Destructure our wasiConfig\n let preopens = {};\n if (wasiConfig && wasiConfig.preopens) {\n preopens = wasiConfig.preopens;\n }\n else if (wasiConfig && wasiConfig.preopenDirectories) {\n preopens = wasiConfig\n .preopenDirectories;\n }\n let env = {};\n if (wasiConfig && wasiConfig.env) {\n env = wasiConfig.env;\n }\n let args = [];\n if (wasiConfig && wasiConfig.args) {\n args = wasiConfig.args;\n }\n let bindings = defaultBindings;\n if (wasiConfig && wasiConfig.bindings) {\n bindings = wasiConfig.bindings;\n }\n // @ts-ignore\n this.memory = undefined;\n // @ts-ignore\n this.view = undefined;\n this.bindings = bindings;\n this.FD_MAP = new Map([\n [\n constants_1.WASI_STDIN_FILENO,\n {\n real: 0,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n // offset: BigInt(0),\n rights: {\n base: STDIN_DEFAULT_RIGHTS,\n inheriting: bigint_1.BigIntPolyfill(0)\n },\n path: undefined\n }\n ],\n [\n constants_1.WASI_STDOUT_FILENO,\n {\n real: 1,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n // offset: BigInt(0),\n rights: {\n base: STDOUT_DEFAULT_RIGHTS,\n inheriting: bigint_1.BigIntPolyfill(0)\n },\n path: undefined\n }\n ],\n [\n constants_1.WASI_STDERR_FILENO,\n {\n real: 2,\n filetype: constants_1.WASI_FILETYPE_CHARACTER_DEVICE,\n // offset: BigInt(0),\n rights: {\n base: STDERR_DEFAULT_RIGHTS,\n inheriting: bigint_1.BigIntPolyfill(0)\n },\n path: undefined\n }\n ]\n ]);\n let fs = this.bindings.fs;\n let path = this.bindings.path;\n for (const [k, v] of Object.entries(preopens)) {\n const real = fs.openSync(v, fs.constants.O_RDONLY);\n const newfd = [...this.FD_MAP.keys()].reverse()[0] + 1;\n this.FD_MAP.set(newfd, {\n real,\n filetype: constants_1.WASI_FILETYPE_DIRECTORY,\n // offset: BigInt(0),\n rights: {\n base: constants_1.RIGHTS_DIRECTORY_BASE,\n inheriting: constants_1.RIGHTS_DIRECTORY_INHERITING\n },\n fakePath: k,\n path: v\n });\n }\n const getiovs = (iovs, iovsLen) => {\n // iovs* -> [iov, iov, ...]\n // __wasi_ciovec_t {\n // void* buf,\n // size_t buf_len,\n // }\n this.refreshMemory();\n const buffers = Array.from({ length: iovsLen }, (_, i) => {\n const ptr = iovs + i * 8;\n const buf = this.view.getUint32(ptr, true);\n const bufLen = this.view.getUint32(ptr + 4, true);\n return new Uint8Array(this.memory.buffer, buf, bufLen);\n });\n return buffers;\n };\n const CHECK_FD = (fd, rights) => {\n const stats = stat(this, fd);\n // console.log(`CHECK_FD: stats.real: ${stats.real}, stats.path:`, stats.path);\n if (rights !== bigint_1.BigIntPolyfill(0) && (stats.rights.base & rights) === bigint_1.BigIntPolyfill(0)) {\n throw new WASIError(constants_1.WASI_EPERM);\n }\n return stats;\n };\n const CPUTIME_START = bindings.hrtime();\n const now = (clockId) => {\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n return bindings.hrtime();\n case constants_1.WASI_CLOCK_REALTIME:\n return msToNs(Date.now());\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID:\n // return bindings.hrtime(CPUTIME_START)\n return bindings.hrtime() - CPUTIME_START;\n default:\n return null;\n }\n };\n this.wasiImport = {\n args_get: (argv, argvBuf) => {\n this.refreshMemory();\n let coffset = argv;\n let offset = argvBuf;\n args.forEach(a => {\n this.view.setUint32(coffset, offset, true);\n coffset += 4;\n offset += buffer_1.default.from(this.memory.buffer).write(`${a}\\0`, offset);\n });\n return constants_1.WASI_ESUCCESS;\n },\n args_sizes_get: (argc, argvBufSize) => {\n this.refreshMemory();\n this.view.setUint32(argc, args.length, true);\n const size = args.reduce((acc, a) => acc + buffer_1.default.byteLength(a) + 1, 0);\n this.view.setUint32(argvBufSize, size, true);\n return constants_1.WASI_ESUCCESS;\n },\n environ_get: (environ, environBuf) => {\n this.refreshMemory();\n let coffset = environ;\n let offset = environBuf;\n Object.entries(env).forEach(([key, value]) => {\n this.view.setUint32(coffset, offset, true);\n coffset += 4;\n offset += buffer_1.default.from(this.memory.buffer).write(`${key}=${value}\\0`, offset);\n });\n return constants_1.WASI_ESUCCESS;\n },\n environ_sizes_get: (environCount, environBufSize) => {\n this.refreshMemory();\n const envProcessed = Object.entries(env).map(([key, value]) => `${key}=${value}\\0`);\n const size = envProcessed.reduce((acc, e) => acc + buffer_1.default.byteLength(e), 0);\n this.view.setUint32(environCount, envProcessed.length, true);\n this.view.setUint32(environBufSize, size, true);\n return constants_1.WASI_ESUCCESS;\n },\n clock_res_get: (clockId, resolution) => {\n let res;\n switch (clockId) {\n case constants_1.WASI_CLOCK_MONOTONIC:\n case constants_1.WASI_CLOCK_PROCESS_CPUTIME_ID:\n case constants_1.WASI_CLOCK_THREAD_CPUTIME_ID: {\n res = bigint_1.BigIntPolyfill(1);\n break;\n }\n case constants_1.WASI_CLOCK_REALTIME: {\n res = bigint_1.BigIntPolyfill(1000);\n break;\n }\n }\n this.view.setBigUint64(resolution, res);\n return constants_1.WASI_ESUCCESS;\n },\n clock_time_get: (clockId, precision, time) => {\n this.refreshMemory();\n const n = now(clockId);\n if (n === null) {\n return constants_1.WASI_EINVAL;\n }\n this.view.setBigUint64(time, bigint_1.BigIntPolyfill(n), true);\n return constants_1.WASI_ESUCCESS;\n },\n fd_advise: wrap((fd, offset, len, advice) => {\n CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ADVISE);\n return constants_1.WASI_ENOSYS;\n }),\n fd_allocate: wrap((fd, offset, len) => {\n CHECK_FD(fd, constants_1.WASI_RIGHT_FD_ALLOCATE);\n return constants_1.WASI_ENOSYS;\n }),\n fd_close: wrap((fd) => {\n const stats = CHECK_FD(fd, bigint_1.BigIntPolyfill(0));\n fs.closeSync(stats.real);\n this.FD_MAP.delete(fd);\n return constants_1.WASI_ESUCCESS;\n }),\n fd_datasync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_DATASYNC);\n fs.fdatasyncSync(stats.real);\n return constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, bigint_1.BigIntPolyfill(0));\n this.refreshMemory();\n this.view.setUint8(bufPtr, stats.filetype); // FILETYPE u8\n this.view.setUint16(bufPtr + 2, 0, true); // FDFLAG u16\n this.view.setUint16(bufPtr + 4, 0, true); // FDFLAG u16\n this.view.setBigUint64(bufPtr + 8, bigint_1.BigIntPolyfill(stats.rights.base), true); // u64\n this.view.setBigUint64(bufPtr + 8 + 8, bigint_1.BigIntPolyfill(stats.rights.inheriting), true); // u64\n return constants_1.WASI_ESUCCESS;\n }),\n fd_fdstat_set_flags: wrap((fd, flags) => {\n CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FDSTAT_SET_FLAGS);\n return constants_1.WASI_ENOSYS;\n }),\n fd_fdstat_set_rights: wrap((fd, fsRightsBase, fsRightsInheriting) => {\n const stats = CHECK_FD(fd, bigint_1.BigIntPolyfill(0));\n const nrb = stats.rights.base | fsRightsBase;\n if (nrb > stats.rights.base) {\n return constants_1.WASI_EPERM;\n }\n const nri = stats.rights.inheriting | fsRightsInheriting;\n if (nri > stats.rights.inheriting) {\n return constants_1.WASI_EPERM;\n }\n stats.rights.base = fsRightsBase;\n stats.rights.inheriting = fsRightsInheriting;\n return constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_GET);\n const rstats = fs.fstatSync(stats.real);\n this.refreshMemory();\n this.view.setBigUint64(bufPtr, bigint_1.BigIntPolyfill(rstats.dev), true);\n bufPtr += 8;\n this.view.setBigUint64(bufPtr, bigint_1.BigIntPolyfill(rstats.ino), true);\n bufPtr += 8;\n this.view.setUint8(bufPtr, stats.filetype);\n bufPtr += 8;\n this.view.setBigUint64(bufPtr, bigint_1.BigIntPolyfill(rstats.nlink), true);\n bufPtr += 8;\n this.view.setBigUint64(bufPtr, bigint_1.BigIntPolyfill(rstats.size), true);\n bufPtr += 8;\n this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), true);\n bufPtr += 8;\n this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), true);\n bufPtr += 8;\n this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), true);\n return constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_size: wrap((fd, stSize) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE);\n fs.ftruncateSync(stats.real, Number(stSize));\n return constants_1.WASI_ESUCCESS;\n }),\n fd_filestat_set_times: wrap((fd, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_FILESTAT_SET_TIMES);\n const rstats = fs.fstatSync(stats.real);\n let atim = rstats.atime;\n let mtim = rstats.mtime;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME));\n const atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags) {\n return constants_1.WASI_EINVAL;\n }\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags) {\n return constants_1.WASI_EINVAL;\n }\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM) {\n atim = nsToMs(stAtim);\n }\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW) {\n atim = n;\n }\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM) {\n mtim = nsToMs(stMtim);\n }\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW) {\n mtim = n;\n }\n fs.futimesSync(stats.real, new Date(atim), new Date(mtim));\n return constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_get: wrap((fd, bufPtr) => {\n const stats = CHECK_FD(fd, bigint_1.BigIntPolyfill(0));\n if (!stats.path) {\n return constants_1.WASI_EINVAL;\n }\n this.refreshMemory();\n this.view.setUint8(bufPtr, constants_1.WASI_PREOPENTYPE_DIR);\n this.view.setUint32(bufPtr + 4, buffer_1.default.byteLength(stats.fakePath), true);\n return constants_1.WASI_ESUCCESS;\n }),\n fd_prestat_dir_name: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, bigint_1.BigIntPolyfill(0));\n if (!stats.path) {\n return constants_1.WASI_EINVAL;\n }\n this.refreshMemory();\n buffer_1.default.from(this.memory.buffer).write(stats.fakePath, pathPtr, pathLen, \"utf8\");\n return constants_1.WASI_ESUCCESS;\n }),\n fd_pwrite: wrap((fd, iovs, iovsLen, offset, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE | constants_1.WASI_RIGHT_FD_SEEK);\n let written = 0;\n getiovs(iovs, iovsLen).forEach(iov => {\n let w = 0;\n while (w < iov.byteLength) {\n w += fs.writeSync(stats.real, iov, w, iov.byteLength - w, Number(offset) + written + w);\n }\n written += w;\n });\n this.view.setUint32(nwritten, written, true);\n return constants_1.WASI_ESUCCESS;\n }),\n fd_write: wrap((fd, iovs, iovsLen, nwritten) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_WRITE);\n let written = 0;\n getiovs(iovs, iovsLen).forEach(iov => {\n let w = 0;\n while (w < iov.byteLength) {\n const i = fs.writeSync(stats.real, iov, w, iov.byteLength - w, stats.offset ? Number(stats.offset) : null);\n if (stats.offset)\n stats.offset += bigint_1.BigIntPolyfill(i);\n w += i;\n }\n written += w;\n });\n this.view.setUint32(nwritten, written, true);\n return constants_1.WASI_ESUCCESS;\n }),\n fd_pread: wrap((fd, iovs, iovsLen, offset, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_SEEK);\n let read = 0;\n outer: for (const iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n const length = iov.byteLength - r;\n const rr = fs.readSync(stats.real, iov, r, iov.byteLength - r, Number(offset) + read + r);\n r += rr;\n read += rr;\n // If we don't read anything, or we receive less than requested\n if (rr === 0 || rr < length) {\n break outer;\n }\n }\n read += r;\n }\n ;\n this.view.setUint32(nread, read, true);\n return constants_1.WASI_ESUCCESS;\n }),\n fd_read: wrap((fd, iovs, iovsLen, nread) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READ);\n const IS_STDIN = stats.real === 0;\n let read = 0;\n outer: for (const iov of getiovs(iovs, iovsLen)) {\n let r = 0;\n while (r < iov.byteLength) {\n let length = iov.byteLength - r;\n let position = IS_STDIN || stats.offset === undefined\n ? null\n : Number(stats.offset);\n let rr = fs.readSync(stats.real, // fd\n iov, // buffer\n r, // offset\n length, // length\n position // position\n );\n if (!IS_STDIN) {\n stats.offset =\n (stats.offset ? stats.offset : bigint_1.BigIntPolyfill(0)) + bigint_1.BigIntPolyfill(rr);\n }\n r += rr;\n read += rr;\n // If we don't read anything, or we receive less than requested\n if (rr === 0 || rr < length) {\n break outer;\n }\n }\n }\n // We should not modify the offset of stdin\n this.view.setUint32(nread, read, true);\n return constants_1.WASI_ESUCCESS;\n }),\n fd_readdir: wrap((fd, bufPtr, bufLen, cookie, bufusedPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_READDIR);\n this.refreshMemory();\n const entries = fs.readdirSync(stats.path, { withFileTypes: true });\n const startPtr = bufPtr;\n for (let i = Number(cookie); i < entries.length; i += 1) {\n const entry = entries[i];\n let nameLength = buffer_1.default.byteLength(entry.name);\n if (bufPtr - startPtr > bufLen) {\n break;\n }\n this.view.setBigUint64(bufPtr, bigint_1.BigIntPolyfill(i + 1), true);\n bufPtr += 8;\n if (bufPtr - startPtr > bufLen) {\n break;\n }\n const rstats = fs.statSync(path.resolve(stats.path, entry.name));\n this.view.setBigUint64(bufPtr, bigint_1.BigIntPolyfill(rstats.ino), true);\n bufPtr += 8;\n if (bufPtr - startPtr > bufLen) {\n break;\n }\n this.view.setUint32(bufPtr, nameLength, true);\n bufPtr += 4;\n if (bufPtr - startPtr > bufLen) {\n break;\n }\n let filetype;\n switch (true) {\n case rstats.isBlockDevice():\n filetype = constants_1.WASI_FILETYPE_BLOCK_DEVICE;\n break;\n case rstats.isCharacterDevice():\n filetype = constants_1.WASI_FILETYPE_CHARACTER_DEVICE;\n break;\n case rstats.isDirectory():\n filetype = constants_1.WASI_FILETYPE_DIRECTORY;\n break;\n case rstats.isFIFO():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isFile():\n filetype = constants_1.WASI_FILETYPE_REGULAR_FILE;\n break;\n case rstats.isSocket():\n filetype = constants_1.WASI_FILETYPE_SOCKET_STREAM;\n break;\n case rstats.isSymbolicLink():\n filetype = constants_1.WASI_FILETYPE_SYMBOLIC_LINK;\n break;\n default:\n filetype = constants_1.WASI_FILETYPE_UNKNOWN;\n break;\n }\n this.view.setUint8(bufPtr, filetype);\n bufPtr += 1;\n bufPtr += 3; // padding\n if (bufPtr + nameLength >= startPtr + bufLen) {\n // It doesn't fit in the buffer\n break;\n }\n let memory_buffer = buffer_1.default.from(this.memory.buffer);\n memory_buffer.write(entry.name, bufPtr);\n bufPtr += nameLength;\n }\n const bufused = bufPtr - startPtr;\n this.view.setUint32(bufusedPtr, Math.min(bufused, bufLen), true);\n return constants_1.WASI_ESUCCESS;\n }),\n fd_renumber: wrap((from, to) => {\n CHECK_FD(from, bigint_1.BigIntPolyfill(0));\n CHECK_FD(to, bigint_1.BigIntPolyfill(0));\n fs.closeSync(this.FD_MAP.get(from).real);\n this.FD_MAP.set(from, this.FD_MAP.get(to));\n this.FD_MAP.delete(to);\n return constants_1.WASI_ESUCCESS;\n }),\n fd_seek: wrap((fd, offset, whence, newOffsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SEEK);\n this.refreshMemory();\n switch (whence) {\n case constants_1.WASI_WHENCE_CUR:\n stats.offset =\n (stats.offset ? stats.offset : bigint_1.BigIntPolyfill(0)) + bigint_1.BigIntPolyfill(offset);\n break;\n case constants_1.WASI_WHENCE_END:\n const { size } = fs.fstatSync(stats.real);\n stats.offset = bigint_1.BigIntPolyfill(size) + bigint_1.BigIntPolyfill(offset);\n break;\n case constants_1.WASI_WHENCE_SET:\n stats.offset = bigint_1.BigIntPolyfill(offset);\n break;\n }\n this.view.setBigUint64(newOffsetPtr, stats.offset, true);\n return constants_1.WASI_ESUCCESS;\n }),\n fd_tell: wrap((fd, offsetPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_TELL);\n this.refreshMemory();\n if (!stats.offset) {\n stats.offset = bigint_1.BigIntPolyfill(0);\n }\n this.view.setBigUint64(offsetPtr, stats.offset, true);\n return constants_1.WASI_ESUCCESS;\n }),\n fd_sync: wrap((fd) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_FD_SYNC);\n fs.fsyncSync(stats.real);\n return constants_1.WASI_ESUCCESS;\n }),\n path_create_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_CREATE_DIRECTORY);\n if (!stats.path) {\n return constants_1.WASI_EINVAL;\n }\n this.refreshMemory();\n const p = buffer_1.default.from(this.memory.buffer, pathPtr, pathLen).toString();\n fs.mkdirSync(path.resolve(stats.path, p));\n return constants_1.WASI_ESUCCESS;\n }),\n path_filestat_get: wrap((fd, flags, pathPtr, pathLen, bufPtr) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_GET);\n if (!stats.path) {\n return constants_1.WASI_EINVAL;\n }\n this.refreshMemory();\n const p = buffer_1.default.from(this.memory.buffer, pathPtr, pathLen).toString();\n const rstats = fs.statSync(path.resolve(stats.path, p));\n this.view.setBigUint64(bufPtr, bigint_1.BigIntPolyfill(rstats.dev), true);\n bufPtr += 8;\n this.view.setBigUint64(bufPtr, bigint_1.BigIntPolyfill(rstats.ino), true);\n bufPtr += 8;\n this.view.setUint8(bufPtr, translateFileAttributes(this, undefined, rstats).filetype);\n bufPtr += 8;\n this.view.setBigUint64(bufPtr, bigint_1.BigIntPolyfill(rstats.nlink), true);\n bufPtr += 8;\n this.view.setBigUint64(bufPtr, bigint_1.BigIntPolyfill(rstats.size), true);\n bufPtr += 8;\n this.view.setBigUint64(bufPtr, msToNs(rstats.atimeMs), true);\n bufPtr += 8;\n this.view.setBigUint64(bufPtr, msToNs(rstats.mtimeMs), true);\n bufPtr += 8;\n this.view.setBigUint64(bufPtr, msToNs(rstats.ctimeMs), true);\n return constants_1.WASI_ESUCCESS;\n }),\n path_filestat_set_times: wrap((fd, dirflags, pathPtr, pathLen, stAtim, stMtim, fstflags) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_FILESTAT_SET_TIMES);\n if (!stats.path) {\n return constants_1.WASI_EINVAL;\n }\n this.refreshMemory();\n const rstats = fs.fstatSync(stats.real);\n let atim = rstats.atime;\n let mtim = rstats.mtime;\n const n = nsToMs(now(constants_1.WASI_CLOCK_REALTIME));\n const atimflags = constants_1.WASI_FILESTAT_SET_ATIM | constants_1.WASI_FILESTAT_SET_ATIM_NOW;\n if ((fstflags & atimflags) === atimflags) {\n return constants_1.WASI_EINVAL;\n }\n const mtimflags = constants_1.WASI_FILESTAT_SET_MTIM | constants_1.WASI_FILESTAT_SET_MTIM_NOW;\n if ((fstflags & mtimflags) === mtimflags) {\n return constants_1.WASI_EINVAL;\n }\n if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM) === constants_1.WASI_FILESTAT_SET_ATIM) {\n atim = nsToMs(stAtim);\n }\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_ATIM_NOW) === constants_1.WASI_FILESTAT_SET_ATIM_NOW) {\n atim = n;\n }\n if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM) === constants_1.WASI_FILESTAT_SET_MTIM) {\n mtim = nsToMs(stMtim);\n }\n else if ((fstflags & constants_1.WASI_FILESTAT_SET_MTIM_NOW) === constants_1.WASI_FILESTAT_SET_MTIM_NOW) {\n mtim = n;\n }\n const p = buffer_1.default.from(this.memory.buffer, pathPtr, pathLen).toString();\n fs.utimesSync(path.resolve(stats.path, p), new Date(atim), new Date(mtim));\n return constants_1.WASI_ESUCCESS;\n }),\n path_link: wrap((oldFd, oldFlags, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_LINK_SOURCE);\n const nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_LINK_TARGET);\n if (!ostats.path || !nstats.path) {\n return constants_1.WASI_EINVAL;\n }\n this.refreshMemory();\n const op = buffer_1.default.from(this.memory.buffer, oldPath, oldPathLen).toString();\n const np = buffer_1.default.from(this.memory.buffer, newPath, newPathLen).toString();\n fs.linkSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np));\n return constants_1.WASI_ESUCCESS;\n }),\n path_open: wrap((dirfd, dirflags, pathPtr, pathLen, oflags, fsRightsBase, fsRightsInheriting, fsFlags, fd) => {\n const stats = CHECK_FD(dirfd, constants_1.WASI_RIGHT_PATH_OPEN);\n fsRightsBase = bigint_1.BigIntPolyfill(fsRightsBase);\n fsRightsInheriting = bigint_1.BigIntPolyfill(fsRightsInheriting);\n const read = (fsRightsBase & (constants_1.WASI_RIGHT_FD_READ | constants_1.WASI_RIGHT_FD_READDIR)) !==\n bigint_1.BigIntPolyfill(0);\n const write = (fsRightsBase &\n (constants_1.WASI_RIGHT_FD_DATASYNC |\n constants_1.WASI_RIGHT_FD_WRITE |\n constants_1.WASI_RIGHT_FD_ALLOCATE |\n constants_1.WASI_RIGHT_FD_FILESTAT_SET_SIZE)) !==\n bigint_1.BigIntPolyfill(0);\n let noflags;\n if (write && read) {\n noflags = fs.constants.O_RDWR;\n }\n else if (read) {\n noflags = fs.constants.O_RDONLY;\n }\n else if (write) {\n noflags = fs.constants.O_WRONLY;\n }\n // fsRightsBase is needed here but perhaps we should do it in neededInheriting\n let neededBase = fsRightsBase | constants_1.WASI_RIGHT_PATH_OPEN;\n let neededInheriting = fsRightsBase | fsRightsInheriting;\n if ((oflags & constants_1.WASI_O_CREAT) !== 0) {\n noflags |= fs.constants.O_CREAT;\n neededBase |= constants_1.WASI_RIGHT_PATH_CREATE_FILE;\n }\n if ((oflags & constants_1.WASI_O_DIRECTORY) !== 0) {\n noflags |= fs.constants.O_DIRECTORY;\n }\n if ((oflags & constants_1.WASI_O_EXCL) !== 0) {\n noflags |= fs.constants.O_EXCL;\n }\n if ((oflags & constants_1.WASI_O_TRUNC) !== 0) {\n noflags |= fs.constants.O_TRUNC;\n neededBase |= constants_1.WASI_RIGHT_PATH_FILESTAT_SET_SIZE;\n }\n // Convert file descriptor flags.\n if ((fsFlags & constants_1.WASI_FDFLAG_APPEND) !== 0) {\n noflags |= fs.constants.O_APPEND;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_DSYNC) !== 0) {\n if (fs.constants.O_DSYNC) {\n noflags |= fs.constants.O_DSYNC;\n }\n else {\n noflags |= fs.constants.O_SYNC;\n }\n neededInheriting |= constants_1.WASI_RIGHT_FD_DATASYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_NONBLOCK) !== 0) {\n noflags |= fs.constants.O_NONBLOCK;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_RSYNC) !== 0) {\n if (fs.constants.O_RSYNC) {\n noflags |= fs.constants.O_RSYNC;\n }\n else {\n noflags |= fs.constants.O_SYNC;\n }\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if ((fsFlags & constants_1.WASI_FDFLAG_SYNC) !== 0) {\n noflags |= fs.constants.O_SYNC;\n neededInheriting |= constants_1.WASI_RIGHT_FD_SYNC;\n }\n if (write &&\n (noflags & (fs.constants.O_APPEND | fs.constants.O_TRUNC)) === 0) {\n neededInheriting |= constants_1.WASI_RIGHT_FD_SEEK;\n }\n this.refreshMemory();\n const p = buffer_1.default.from(this.memory.buffer, pathPtr, pathLen).toString();\n const fullUnresolved = path.resolve(stats.path, p);\n if (path.relative(stats.path, fullUnresolved).startsWith(\"..\")) {\n return constants_1.WASI_ENOTCAPABLE;\n }\n let full;\n try {\n full = fs.realpathSync(fullUnresolved);\n if (path.relative(stats.path, full).startsWith(\"..\")) {\n return constants_1.WASI_ENOTCAPABLE;\n }\n }\n catch (e) {\n if (e.code === \"ENOENT\") {\n full = fullUnresolved;\n }\n else {\n throw e;\n }\n }\n /* check if the file is a directory (unless opening for write,\n * in which case the file may not exist and should be created) */\n let isDirectory;\n try {\n isDirectory = fs.statSync(full).isDirectory();\n }\n catch (e) { }\n let realfd;\n if (!write && isDirectory) {\n realfd = fs.openSync(full, fs.constants.O_RDONLY);\n }\n else {\n realfd = fs.openSync(full, noflags);\n }\n const newfd = [...this.FD_MAP.keys()].reverse()[0] + 1;\n this.FD_MAP.set(newfd, {\n real: realfd,\n filetype: undefined,\n // offset: BigInt(0),\n rights: {\n base: neededBase,\n inheriting: neededInheriting\n },\n path: full\n });\n stat(this, newfd);\n this.view.setUint32(fd, newfd, true);\n return constants_1.WASI_ESUCCESS;\n }),\n path_readlink: wrap((fd, pathPtr, pathLen, buf, bufLen, bufused) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_READLINK);\n if (!stats.path) {\n return constants_1.WASI_EINVAL;\n }\n this.refreshMemory();\n const p = buffer_1.default.from(this.memory.buffer, pathPtr, pathLen).toString();\n const full = path.resolve(stats.path, p);\n const r = fs.readlinkSync(full);\n const used = buffer_1.default.from(this.memory.buffer).write(r, buf, bufLen);\n this.view.setUint32(bufused, used, true);\n return constants_1.WASI_ESUCCESS;\n }),\n path_remove_directory: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_REMOVE_DIRECTORY);\n if (!stats.path) {\n return constants_1.WASI_EINVAL;\n }\n this.refreshMemory();\n const p = buffer_1.default.from(this.memory.buffer, pathPtr, pathLen).toString();\n fs.rmdirSync(path.resolve(stats.path, p));\n return constants_1.WASI_ESUCCESS;\n }),\n path_rename: wrap((oldFd, oldPath, oldPathLen, newFd, newPath, newPathLen) => {\n const ostats = CHECK_FD(oldFd, constants_1.WASI_RIGHT_PATH_RENAME_SOURCE);\n const nstats = CHECK_FD(newFd, constants_1.WASI_RIGHT_PATH_RENAME_TARGET);\n if (!ostats.path || !nstats.path) {\n return constants_1.WASI_EINVAL;\n }\n this.refreshMemory();\n const op = buffer_1.default.from(this.memory.buffer, oldPath, oldPathLen).toString();\n const np = buffer_1.default.from(this.memory.buffer, newPath, newPathLen).toString();\n fs.renameSync(path.resolve(ostats.path, op), path.resolve(nstats.path, np));\n return constants_1.WASI_ESUCCESS;\n }),\n path_symlink: wrap((oldPath, oldPathLen, fd, newPath, newPathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_SYMLINK);\n if (!stats.path) {\n return constants_1.WASI_EINVAL;\n }\n this.refreshMemory();\n const op = buffer_1.default.from(this.memory.buffer, oldPath, oldPathLen).toString();\n const np = buffer_1.default.from(this.memory.buffer, newPath, newPathLen).toString();\n fs.symlinkSync(op, path.resolve(stats.path, np));\n return constants_1.WASI_ESUCCESS;\n }),\n path_unlink_file: wrap((fd, pathPtr, pathLen) => {\n const stats = CHECK_FD(fd, constants_1.WASI_RIGHT_PATH_UNLINK_FILE);\n if (!stats.path) {\n return constants_1.WASI_EINVAL;\n }\n this.refreshMemory();\n const p = buffer_1.default.from(this.memory.buffer, pathPtr, pathLen).toString();\n fs.unlinkSync(path.resolve(stats.path, p));\n return constants_1.WASI_ESUCCESS;\n }),\n poll_oneoff: (sin, sout, nsubscriptions, nevents) => {\n let eventc = 0;\n let waitEnd = 0;\n this.refreshMemory();\n for (let i = 0; i < nsubscriptions; i += 1) {\n const userdata = this.view.getBigUint64(sin, true);\n sin += 8;\n const type = this.view.getUint8(sin);\n sin += 1;\n switch (type) {\n case constants_1.WASI_EVENTTYPE_CLOCK: {\n sin += 7; // padding\n const identifier = this.view.getBigUint64(sin, true);\n sin += 8;\n const clockid = this.view.getUint32(sin, true);\n sin += 4;\n sin += 4; // padding\n const timestamp = this.view.getBigUint64(sin, true);\n sin += 8;\n const precision = this.view.getBigUint64(sin, true);\n sin += 8;\n const subclockflags = this.view.getUint16(sin, true);\n sin += 2;\n sin += 6; // padding\n const absolute = subclockflags === 1;\n let e = constants_1.WASI_ESUCCESS;\n const n = bigint_1.BigIntPolyfill(now(clockid));\n if (n === null) {\n e = constants_1.WASI_EINVAL;\n }\n else {\n const end = absolute ? timestamp : n + timestamp;\n waitEnd =\n end > waitEnd ? end : waitEnd;\n }\n this.view.setBigUint64(sout, userdata, true);\n sout += 8;\n this.view.setUint16(sout, e, true); // error\n sout += 2; // pad offset 2\n this.view.setUint8(sout, constants_1.WASI_EVENTTYPE_CLOCK);\n sout += 1; // pad offset 3\n sout += 5; // padding to 8\n eventc += 1;\n break;\n }\n case constants_1.WASI_EVENTTYPE_FD_READ:\n case constants_1.WASI_EVENTTYPE_FD_WRITE: {\n sin += 3; // padding\n const fd = this.view.getUint32(sin, true);\n sin += 4;\n this.view.setBigUint64(sout, userdata, true);\n sout += 8;\n this.view.setUint16(sout, constants_1.WASI_ENOSYS, true); // error\n sout += 2; // pad offset 2\n this.view.setUint8(sout, type);\n sout += 1; // pad offset 3\n sout += 5; // padding to 8\n eventc += 1;\n break;\n }\n default:\n return constants_1.WASI_EINVAL;\n }\n }\n this.view.setUint32(nevents, eventc, true);\n while (bindings.hrtime() < waitEnd) {\n // nothing\n }\n return constants_1.WASI_ESUCCESS;\n },\n proc_exit: (rval) => {\n bindings.exit(rval);\n return constants_1.WASI_ESUCCESS;\n },\n proc_raise: (sig) => {\n if (!(sig in constants_1.SIGNAL_MAP)) {\n return constants_1.WASI_EINVAL;\n }\n bindings.kill(constants_1.SIGNAL_MAP[sig]);\n return constants_1.WASI_ESUCCESS;\n },\n random_get: (bufPtr, bufLen) => {\n this.refreshMemory();\n bindings.randomFillSync(new Uint8Array(this.memory.buffer), bufPtr, bufLen);\n return constants_1.WASI_ESUCCESS;\n },\n sched_yield() {\n // Single threaded environment\n // This is a no-op in JS\n return constants_1.WASI_ESUCCESS;\n },\n sock_recv() {\n return constants_1.WASI_ENOSYS;\n },\n sock_send() {\n return constants_1.WASI_ENOSYS;\n },\n sock_shutdown() {\n return constants_1.WASI_ENOSYS;\n }\n };\n // Wrap each of the imports to show the calls in the console\n if (wasiConfig.traceSyscalls) {\n Object.keys(this.wasiImport).forEach((key) => {\n const prevImport = this.wasiImport[key];\n this.wasiImport[key] = function (...args) {\n console.log(`WASI: wasiImport called: ${key} (${args})`);\n try {\n let result = prevImport(...args);\n console.log(`WASI: => ${result}`);\n return result;\n }\n catch (e) {\n console.log(`Catched error: ${e}`);\n throw e;\n }\n };\n });\n }\n }\n refreshMemory() {\n // @ts-ignore\n if (!this.view || this.view.buffer.byteLength === 0) {\n this.view = new dataview_1.DataViewPolyfill(this.memory.buffer);\n }\n }\n setMemory(memory) {\n this.memory = memory;\n }\n start(instance) {\n const exports = instance.exports;\n if (exports === null || typeof exports !== \"object\") {\n throw new Error(`instance.exports must be an Object. Received ${exports}.`);\n }\n const { memory } = exports;\n if (!(memory instanceof WebAssembly.Memory)) {\n throw new Error(`instance.exports.memory must be a WebAssembly.Memory. Recceived ${memory}.`);\n }\n this.setMemory(memory);\n if (exports._start) {\n exports._start();\n }\n }\n getImportNamespace(module) {\n let namespace = null;\n for (let imp of WebAssembly.Module.imports(module)) {\n // We only check for the functions\n if (imp.kind !== \"function\") {\n continue;\n }\n // We allow functions in other namespaces other than wasi\n if (!imp.module.startsWith(\"wasi_\")) {\n continue;\n }\n if (!namespace) {\n namespace = imp.module;\n }\n else {\n if (namespace !== imp.module) {\n throw new Error(\"Multiple namespaces detected.\");\n }\n }\n }\n return namespace;\n }\n getImports(module) {\n let namespace = this.getImportNamespace(module);\n switch (namespace) {\n case \"wasi_unstable\":\n return {\n wasi_unstable: this.wasiImport\n };\n case \"wasi_snapshot_preview1\":\n return {\n wasi_snapshot_preview1: this.wasiImport\n };\n default:\n throw new Error(\"Can't detect a WASI namespace for the WebAssembly Module\");\n }\n }\n}\nexports.default = WASIDefault;\nWASIDefault.defaultBindings = defaultBindings;\n// Also export it as a field in the export object\nexports.WASI = WASIDefault;\n\n\n//# sourceURL=webpack:///./node_modules/@wasmer/wasi/lib/index.js?"); + +/***/ }), + +/***/ "./node_modules/@wasmer/wasi/lib/polyfills/bigint.js": +/*!***********************************************************!*\ + !*** ./node_modules/@wasmer/wasi/lib/polyfills/bigint.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/* WEBPACK VAR INJECTION */(function(global) {\n// A very simple workaround for Big int. Works in conjunction with our custom\n// Dataview workaround at ./dataview.ts\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst globalObj = typeof globalThis !== \"undefined\"\n ? globalThis\n : typeof global !== \"undefined\"\n ? global\n : {};\nexports.BigIntPolyfill = typeof BigInt !== \"undefined\" ? BigInt : globalObj.BigInt || Number;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/@wasmer/wasi/lib/polyfills/bigint.js?"); + +/***/ }), + +/***/ "./node_modules/@wasmer/wasi/lib/polyfills/browser-hrtime.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@wasmer/wasi/lib/polyfills/browser-hrtime.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n// hrtime polyfill for the browser\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst baseNow = Math.floor((Date.now() - performance.now()) * 1e-3);\nfunction hrtime(previousTimestamp) {\n // initilaize our variables\n let clocktime = performance.now() * 1e-3;\n let seconds = Math.floor(clocktime) + baseNow;\n let nanoseconds = Math.floor((clocktime % 1) * 1e9);\n // Compare to the prvious timestamp if we have one\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0];\n nanoseconds = nanoseconds - previousTimestamp[1];\n if (nanoseconds < 0) {\n seconds--;\n nanoseconds += 1e9;\n }\n }\n // Return our seconds tuple\n return [seconds, nanoseconds];\n}\nexports.default = hrtime;\n\n\n//# sourceURL=webpack:///./node_modules/@wasmer/wasi/lib/polyfills/browser-hrtime.js?"); + +/***/ }), + +/***/ "./node_modules/@wasmer/wasi/lib/polyfills/buffer.js": +/*!***********************************************************!*\ + !*** ./node_modules/@wasmer/wasi/lib/polyfills/buffer.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n// Return our buffer depending on browser or node\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*ROLLUP_REPLACE_BROWSER\n// @ts-ignore\nimport { Buffer } from \"buffer-es6\";\nROLLUP_REPLACE_BROWSER*/\nconst isomorphicBuffer = Buffer;\nexports.default = isomorphicBuffer;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../buffer/index.js */ \"./node_modules/buffer/index.js\").Buffer))\n\n//# sourceURL=webpack:///./node_modules/@wasmer/wasi/lib/polyfills/buffer.js?"); + +/***/ }), + +/***/ "./node_modules/@wasmer/wasi/lib/polyfills/dataview.js": +/*!*************************************************************!*\ + !*** ./node_modules/@wasmer/wasi/lib/polyfills/dataview.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n// A very simple workaround for Big int. Works in conjunction with our custom\n// BigInt workaround at ./bigint.ts\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst bigint_1 = __webpack_require__(/*! ./bigint */ \"./node_modules/@wasmer/wasi/lib/polyfills/bigint.js\");\nlet exportedDataView = DataView;\nif (!exportedDataView.prototype.setBigUint64) {\n // Taken from https://gist.github.com/graup/815c9ac65c2bac8a56391f0ca23636fc\n exportedDataView.prototype.setBigUint64 = function (byteOffset, value, littleEndian) {\n let lowWord;\n let highWord;\n if (value < 2 ** 32) {\n lowWord = Number(value);\n highWord = 0;\n }\n else {\n var bigNumberAsBinaryStr = value.toString(2);\n // Convert the above binary str to 64 bit (actually 52 bit will work) by padding zeros in the left\n var bigNumberAsBinaryStr2 = \"\";\n for (var i = 0; i < 64 - bigNumberAsBinaryStr.length; i++) {\n bigNumberAsBinaryStr2 += \"0\";\n }\n bigNumberAsBinaryStr2 += bigNumberAsBinaryStr;\n highWord = parseInt(bigNumberAsBinaryStr2.substring(0, 32), 2);\n lowWord = parseInt(bigNumberAsBinaryStr2.substring(32), 2);\n }\n this.setUint32(byteOffset + (littleEndian ? 0 : 4), lowWord, littleEndian);\n this.setUint32(byteOffset + (littleEndian ? 4 : 0), highWord, littleEndian);\n };\n exportedDataView.prototype.getBigUint64 = function (byteOffset, littleEndian) {\n let lowWord = this.getUint32(byteOffset + (littleEndian ? 0 : 4), littleEndian);\n let highWord = this.getUint32(byteOffset + (littleEndian ? 4 : 0), littleEndian);\n var lowWordAsBinaryStr = lowWord.toString(2);\n var highWordAsBinaryStr = highWord.toString(2);\n // Convert the above binary str to 64 bit (actually 52 bit will work) by padding zeros in the left\n var lowWordAsBinaryStrPadded = \"\";\n for (var i = 0; i < 32 - lowWordAsBinaryStr.length; i++) {\n lowWordAsBinaryStrPadded += \"0\";\n }\n lowWordAsBinaryStrPadded += lowWordAsBinaryStr;\n return bigint_1.BigIntPolyfill(\"0b\" + highWordAsBinaryStr + lowWordAsBinaryStrPadded);\n };\n}\nexports.DataViewPolyfill = exportedDataView;\n\n\n//# sourceURL=webpack:///./node_modules/@wasmer/wasi/lib/polyfills/dataview.js?"); + +/***/ }), + +/***/ "./node_modules/@wasmer/wasi/lib/polyfills/hrtime.bigint.js": +/*!******************************************************************!*\ + !*** ./node_modules/@wasmer/wasi/lib/polyfills/hrtime.bigint.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n// Simply polyfill for hrtime\n// https://nodejs.org/api/process.html#process_process_hrtime_time\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst NS_PER_SEC = 1e9;\nconst getBigIntHrtime = (nativeHrtime) => {\n return (time) => {\n const diff = nativeHrtime(time);\n // Return the time\n return (diff[0] * NS_PER_SEC + diff[1]);\n };\n};\nexports.default = getBigIntHrtime;\n\n\n//# sourceURL=webpack:///./node_modules/@wasmer/wasi/lib/polyfills/hrtime.bigint.js?"); + +/***/ }), + +/***/ "./node_modules/@wasmer/wasi/node_modules/path-browserify/index.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@wasmer/wasi/node_modules/path-browserify/index.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/* WEBPACK VAR INJECTION */(function(process) {// 'path' module extracted from Node.js v8.11.1 (only the posix part)\n// transplited with Babel\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nfunction assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));\n }\n}\n\n// Resolves . and .. elements in a path with directory names\nfunction normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length)\n code = path.charCodeAt(i);\n else if (code === 47 /*/*/)\n break;\n else\n code = 47 /*/*/;\n if (code === 47 /*/*/) {\n if (lastSlash === i - 1 || dots === 1) {\n // NOOP\n } else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 /*.*/ || res.charCodeAt(res.length - 2) !== 46 /*.*/) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n } else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n } else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0)\n res += '/..';\n else\n res = '..';\n lastSegmentLength = 2;\n }\n } else {\n if (res.length > 0)\n res += '/' + path.slice(lastSlash + 1, i);\n else\n res = path.slice(lastSlash + 1, i);\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n } else if (code === 46 /*.*/ && dots !== -1) {\n ++dots;\n } else {\n dots = -1;\n }\n }\n return res;\n}\n\nfunction _format(sep, pathObject) {\n var dir = pathObject.dir || pathObject.root;\n var base = pathObject.base || (pathObject.name || '') + (pathObject.ext || '');\n if (!dir) {\n return base;\n }\n if (dir === pathObject.root) {\n return dir + base;\n }\n return dir + sep + base;\n}\n\nvar posix = {\n // path.resolve([from ...], to)\n resolve: function resolve() {\n var resolvedPath = '';\n var resolvedAbsolute = false;\n var cwd;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path;\n if (i >= 0)\n path = arguments[i];\n else {\n if (cwd === undefined)\n cwd = process.cwd();\n path = cwd;\n }\n\n assertPath(path);\n\n // Skip empty entries\n if (path.length === 0) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);\n\n if (resolvedAbsolute) {\n if (resolvedPath.length > 0)\n return '/' + resolvedPath;\n else\n return '/';\n } else if (resolvedPath.length > 0) {\n return resolvedPath;\n } else {\n return '.';\n }\n },\n\n normalize: function normalize(path) {\n assertPath(path);\n\n if (path.length === 0) return '.';\n\n var isAbsolute = path.charCodeAt(0) === 47 /*/*/;\n var trailingSeparator = path.charCodeAt(path.length - 1) === 47 /*/*/;\n\n // Normalize the path\n path = normalizeStringPosix(path, !isAbsolute);\n\n if (path.length === 0 && !isAbsolute) path = '.';\n if (path.length > 0 && trailingSeparator) path += '/';\n\n if (isAbsolute) return '/' + path;\n return path;\n },\n\n isAbsolute: function isAbsolute(path) {\n assertPath(path);\n return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;\n },\n\n join: function join() {\n if (arguments.length === 0)\n return '.';\n var joined;\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n assertPath(arg);\n if (arg.length > 0) {\n if (joined === undefined)\n joined = arg;\n else\n joined += '/' + arg;\n }\n }\n if (joined === undefined)\n return '.';\n return posix.normalize(joined);\n },\n\n relative: function relative(from, to) {\n assertPath(from);\n assertPath(to);\n\n if (from === to) return '';\n\n from = posix.resolve(from);\n to = posix.resolve(to);\n\n if (from === to) return '';\n\n // Trim any leading backslashes\n var fromStart = 1;\n for (; fromStart < from.length; ++fromStart) {\n if (from.charCodeAt(fromStart) !== 47 /*/*/)\n break;\n }\n var fromEnd = from.length;\n var fromLen = fromEnd - fromStart;\n\n // Trim any leading backslashes\n var toStart = 1;\n for (; toStart < to.length; ++toStart) {\n if (to.charCodeAt(toStart) !== 47 /*/*/)\n break;\n }\n var toEnd = to.length;\n var toLen = toEnd - toStart;\n\n // Compare paths to find the longest common path from root\n var length = fromLen < toLen ? fromLen : toLen;\n var lastCommonSep = -1;\n var i = 0;\n for (; i <= length; ++i) {\n if (i === length) {\n if (toLen > length) {\n if (to.charCodeAt(toStart + i) === 47 /*/*/) {\n // We get here if `from` is the exact base path for `to`.\n // For example: from='/foo/bar'; to='/foo/bar/baz'\n return to.slice(toStart + i + 1);\n } else if (i === 0) {\n // We get here if `from` is the root\n // For example: from='/'; to='/foo'\n return to.slice(toStart + i);\n }\n } else if (fromLen > length) {\n if (from.charCodeAt(fromStart + i) === 47 /*/*/) {\n // We get here if `to` is the exact base path for `from`.\n // For example: from='/foo/bar/baz'; to='/foo/bar'\n lastCommonSep = i;\n } else if (i === 0) {\n // We get here if `to` is the root.\n // For example: from='/foo'; to='/'\n lastCommonSep = 0;\n }\n }\n break;\n }\n var fromCode = from.charCodeAt(fromStart + i);\n var toCode = to.charCodeAt(toStart + i);\n if (fromCode !== toCode)\n break;\n else if (fromCode === 47 /*/*/)\n lastCommonSep = i;\n }\n\n var out = '';\n // Generate the relative path based on the path difference between `to`\n // and `from`\n for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {\n if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {\n if (out.length === 0)\n out += '..';\n else\n out += '/..';\n }\n }\n\n // Lastly, append the rest of the destination (`to`) path that comes after\n // the common path parts\n if (out.length > 0)\n return out + to.slice(toStart + lastCommonSep);\n else {\n toStart += lastCommonSep;\n if (to.charCodeAt(toStart) === 47 /*/*/)\n ++toStart;\n return to.slice(toStart);\n }\n },\n\n _makeLong: function _makeLong(path) {\n return path;\n },\n\n dirname: function dirname(path) {\n assertPath(path);\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) return '//';\n return path.slice(0, end);\n },\n\n basename: function basename(path, ext) {\n if (ext !== undefined && typeof ext !== 'string') throw new TypeError('\"ext\" argument must be a string');\n assertPath(path);\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext.length === path.length && ext === path) return '';\n var extIdx = ext.length - 1;\n var firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n } else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n\n if (start === end) end = firstNonSlashEnd;else if (end === -1) end = path.length;\n return path.slice(start, end);\n } else {\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n }\n },\n\n extname: function extname(path) {\n assertPath(path);\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n },\n\n format: function format(pathObject) {\n if (pathObject === null || typeof pathObject !== 'object') {\n throw new TypeError('The \"pathObject\" argument must be of type Object. Received type ' + typeof pathObject);\n }\n return _format('/', pathObject);\n },\n\n parse: function parse(path) {\n assertPath(path);\n\n var ret = { root: '', dir: '', base: '', ext: '', name: '' };\n if (path.length === 0) return ret;\n var code = path.charCodeAt(0);\n var isAbsolute = code === 47 /*/*/;\n var start;\n if (isAbsolute) {\n ret.root = '/';\n start = 1;\n } else {\n start = 0;\n }\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n var i = path.length - 1;\n\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n\n // Get non-dir info\n for (; i >= start; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1) startDot = i;else if (preDotState !== 1) preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n if (end !== -1) {\n if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);else ret.base = ret.name = path.slice(startPart, end);\n }\n } else {\n if (startPart === 0 && isAbsolute) {\n ret.name = path.slice(1, startDot);\n ret.base = path.slice(1, end);\n } else {\n ret.name = path.slice(startPart, startDot);\n ret.base = path.slice(startPart, end);\n }\n ret.ext = path.slice(startDot, end);\n }\n\n if (startPart > 0) ret.dir = path.slice(0, startPart - 1);else if (isAbsolute) ret.dir = '/';\n\n return ret;\n },\n\n sep: '/',\n delimiter: ':',\n win32: null,\n posix: null\n};\n\nposix.posix = posix;\n\nmodule.exports = posix;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/@wasmer/wasi/node_modules/path-browserify/index.js?"); + +/***/ }), + +/***/ "./node_modules/@wasmer/wasmfs/lib/index.esm.js": +/*!******************************************************!*\ + !*** ./node_modules/@wasmer/wasmfs/lib/index.esm.js ***! + \******************************************************/ +/*! exports provided: default, WasmFs */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global, setImmediate) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WasmFs\", function() { return sf; });\n/*\n *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n**************************************************************************** https://mths.be/punycode v1.4.1 by @mathias */\nfunction ba(a,b,c,d){return new (c||(c=Promise))(function(e,f){function g(a){try{k(d.next(a))}catch(n){f(n)}}function h(a){try{k(d[\"throw\"](a))}catch(n){f(n)}}function k(a){a.done?e(a.value):(new c(function(b){b(a.value)})).then(g,h)}k((d=d.apply(a,b||[])).next())})}\nfunction ca(a,b){function c(a){return function(b){return d([a,b])}}function d(c){if(f)throw new TypeError(\"Generator is already executing.\");for(;e;)try{if(f=1,g&&(h=c[0]&2?g[\"return\"]:c[0]?g[\"throw\"]||((h=g[\"return\"])&&h.call(g),0):g.next)&&!(h=h.call(g,c[1])).done)return h;if(g=0,h)c=[c[0]&2,h.value];switch(c[0]){case 0:case 1:h=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++;g=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(h=e.trys,h=0h[0]&&c[1]=a.length&&(a=void 0);return{value:a&&a[c++],done:!a}}}}\nfunction ea(a,b){var c=\"function\"===typeof Symbol&&a[Symbol.iterator];if(!c)return a;a=c.call(a);var d,e=[];try{for(;(void 0===b||0a;++a)x[a]=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"[a],y[\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".charCodeAt(a)]=a;y[45]=62;y[95]=63}\nfunction qa(a,b,c){for(var d=[],e=b;e>18&63]+x[b>>12&63]+x[b>>6&63]+x[b&63]);return d.join(\"\")}function ra(a){oa||pa();for(var b=a.length,c=b%3,d=\"\",e=[],f=0,g=b-c;fg?g:f+16383));1===c?(a=a[b-1],d+=x[a>>2],d+=x[a<<4&63],d+=\"==\"):2===c&&(a=(a[b-2]<<8)+a[b-1],d+=x[a>>10],d+=x[a>>4&63],d+=x[a<<2&63],d+=\"=\");e.push(d);return e.join(\"\")}\nfunction sa(a,b,c,d,e){var f=8*e-d-1;var g=(1<>1,k=-7;e=c?e-1:0;var p=c?-1:1,n=a[b+e];e+=p;c=n&(1<<-k)-1;n>>=-k;for(k+=f;0>=-k;for(k+=d;0>1,n=23===e?Math.pow(2,-24)-Math.pow(2,-77):0;f=d?0:f-1;var q=d?1:-1,B=0>b||0===b&&0>1/b?1:0;b=Math.abs(b);isNaN(b)||Infinity===b?(b=isNaN(b)?1:0,d=k):(d=Math.floor(Math.log(b)/Math.LN2),1>b*(g=Math.pow(2,-d))&&(d--,g*=2),b=1<=d+p?b+n/g:b+n*Math.pow(2,1-p),2<=b*g&&(d++,g/=2),d+p>=k?(b=0,d=k):1<=d+p?(b=(b*g-1)*Math.pow(2,e),d+=p):(b=b*Math.pow(2,p-1)*Math.pow(2,e),d=0));for(;8<=e;a[c+f]=b&255,f+=q,b/=256,e-=8);d=d<c||b.byteLengtha)throw new RangeError('\"size\" argument must not be negative');}z.alloc=function(a,b,c){Ga(a);a=0>=a?Aa(null,a):void 0!==b?\"string\"===typeof c?Aa(null,a).fill(b,c):Aa(null,a).fill(b):Aa(null,a);return a};function Ba(a,b){Ga(b);a=Aa(a,0>b?0:Ma(b)|0);if(!z.TYPED_ARRAY_SUPPORT)for(var c=0;cb.length?0:Ma(b.length)|0;a=Aa(a,c);for(var d=0;d=(z.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+(z.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+\" bytes\");return a|0}z.isBuffer=Na;function A(a){return!(null==a||!a._isBuffer)}\nz.compare=function(a,b){if(!A(a)||!A(b))throw new TypeError(\"Arguments must be Buffers\");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,f=Math.min(c,d);e>>1;case \"base64\":return Pa(a).length;\ndefault:if(d)return Oa(a).length;b=(\"\"+b).toLowerCase();d=!0}}z.byteLength=Ea;\nfunction Qa(a,b,c){var d=!1;if(void 0===b||0>b)b=0;if(b>this.length)return\"\";if(void 0===c||c>this.length)c=this.length;if(0>=c)return\"\";c>>>=0;b>>>=0;if(c<=b)return\"\";for(a||(a=\"utf8\");;)switch(a){case \"hex\":a=b;b=c;c=this.length;if(!a||0>a)a=0;if(!b||0>b||b>c)b=c;d=\"\";for(c=a;cd?\"0\"+d.toString(16):d.toString(16),d=a+d;return d;case \"utf8\":case \"utf-8\":return Ra(this,b,c);case \"ascii\":a=\"\";for(c=Math.min(this.length,c);b\"};\nz.prototype.compare=function(a,b,c,d,e){if(!A(a))throw new TypeError(\"Argument must be a Buffer\");void 0===b&&(b=0);void 0===c&&(c=a?a.length:0);void 0===d&&(d=0);void 0===e&&(e=this.length);if(0>b||c>a.length||0>d||e>this.length)throw new RangeError(\"out of range index\");if(d>=e&&b>=c)return 0;if(d>=e)return-1;if(b>=c)return 1;b>>>=0;c>>>=0;d>>>=0;e>>>=0;if(this===a)return 0;var f=e-d,g=c-b,h=Math.min(f,g);d=this.slice(d,e);a=a.slice(b,c);for(b=0;bc&&(c=-2147483648);c=+c;isNaN(c)&&(c=e?0:a.length-1);0>c&&(c=a.length+c);if(c>=a.length){if(e)return-1;c=a.length-1}else if(0>c)if(e)c=0;else return-1;\"string\"===typeof b&&(b=z.from(b,d));if(A(b))return 0===b.length?-1:Ua(a,b,c,d,e);if(\"number\"===typeof b)return b&=255,z.TYPED_ARRAY_SUPPORT&&\"function\"===typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(a,b,c):\nUint8Array.prototype.lastIndexOf.call(a,b,c):Ua(a,[b],c,d,e);throw new TypeError(\"val must be string, number or Buffer\");}\nfunction Ua(a,b,c,d,e){function f(a,b){return 1===g?a[b]:a.readUInt16BE(b*g)}var g=1,h=a.length,k=b.length;if(void 0!==d&&(d=String(d).toLowerCase(),\"ucs2\"===d||\"ucs-2\"===d||\"utf16le\"===d||\"utf-16le\"===d)){if(2>a.length||2>b.length)return-1;g=2;h/=2;k/=2;c/=2}if(e)for(d=-1;ch&&(c=h-k);0<=c;c--){h=!0;for(d=0;de)c=e;if(0c||0>b)||b>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");d||(d=\"utf8\");for(e=!1;;)switch(d){case \"hex\":a:{b=\nNumber(b)||0;d=this.length-b;c?(c=Number(c),c>d&&(c=d)):c=d;d=a.length;if(0!==d%2)throw new TypeError(\"Invalid hex string\");c>d/2&&(c=d/2);for(d=0;d(e-=2));++g){var h=d.charCodeAt(g);a=h>>8;h%=256;f.push(h);f.push(a)}return Va(f,this,b,c);default:if(e)throw new TypeError(\"Unknown encoding: \"+d);d=(\"\"+d).toLowerCase();e=!0}};z.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};\nfunction Ra(a,b,c){c=Math.min(a.length,c);for(var d=[];be&&(f=e);break;case 2:var h=a[b+1];128===(h&192)&&(e=(e&31)<<6|h&63,127e||57343e&&(f=\ne))}null===f?(f=65533,g=1):65535>>10&1023|55296),f=56320|f&1023);d.push(f);b+=g}a=d.length;if(a<=ab)d=String.fromCharCode.apply(String,d);else{c=\"\";for(b=0;ba?(a+=c,0>a&&(a=0)):a>c&&(a=c);0>b?(b+=c,0>b&&(b=0)):b>c&&(b=c);ba)throw new RangeError(\"offset is not uint\");if(a+b>c)throw new RangeError(\"Trying to access beyond buffer length\");}\nz.prototype.readUIntLE=function(a,b,c){a|=0;b|=0;c||C(a,b,this.length);c=this[a];for(var d=1,e=0;++e=128*d&&(c-=Math.pow(2,8*b));return c};\nz.prototype.readIntBE=function(a,b,c){a|=0;b|=0;c||C(a,b,this.length);c=b;for(var d=1,e=this[a+--c];0=128*d&&(e-=Math.pow(2,8*b));return e};z.prototype.readInt8=function(a,b){b||C(a,1,this.length);return this[a]&128?-1*(255-this[a]+1):this[a]};z.prototype.readInt16LE=function(a,b){b||C(a,2,this.length);a=this[a]|this[a+1]<<8;return a&32768?a|4294901760:a};\nz.prototype.readInt16BE=function(a,b){b||C(a,2,this.length);a=this[a+1]|this[a]<<8;return a&32768?a|4294901760:a};z.prototype.readInt32LE=function(a,b){b||C(a,4,this.length);return this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24};z.prototype.readInt32BE=function(a,b){b||C(a,4,this.length);return this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]};z.prototype.readFloatLE=function(a,b){b||C(a,4,this.length);return sa(this,a,!0,23,4)};\nz.prototype.readFloatBE=function(a,b){b||C(a,4,this.length);return sa(this,a,!1,23,4)};z.prototype.readDoubleLE=function(a,b){b||C(a,8,this.length);return sa(this,a,!0,52,8)};z.prototype.readDoubleBE=function(a,b){b||C(a,8,this.length);return sa(this,a,!1,52,8)};function E(a,b,c,d,e,f){if(!A(a))throw new TypeError('\"buffer\" argument must be a Buffer instance');if(b>e||ba.length)throw new RangeError(\"Index out of range\");}\nz.prototype.writeUIntLE=function(a,b,c,d){a=+a;b|=0;c|=0;d||E(this,a,b,c,Math.pow(2,8*c)-1,0);d=1;var e=0;for(this[b]=a&255;++eb&&(b=65535+b+1);for(var e=0,f=Math.min(a.length-c,2);e>>8*(d?e:1-e)}z.prototype.writeUInt16LE=function(a,b,c){a=+a;b|=0;c||E(this,a,b,2,65535,0);z.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):bb(this,a,b,!0);return b+2};z.prototype.writeUInt16BE=function(a,b,c){a=+a;b|=0;c||E(this,a,b,2,65535,0);z.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&255):bb(this,a,b,!1);return b+2};\nfunction cb(a,b,c,d){0>b&&(b=4294967295+b+1);for(var e=0,f=Math.min(a.length-c,4);e>>8*(d?e:3-e)&255}z.prototype.writeUInt32LE=function(a,b,c){a=+a;b|=0;c||E(this,a,b,4,4294967295,0);z.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=a&255):cb(this,a,b,!0);return b+4};\nz.prototype.writeUInt32BE=function(a,b,c){a=+a;b|=0;c||E(this,a,b,4,4294967295,0);z.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a&255):cb(this,a,b,!1);return b+4};z.prototype.writeIntLE=function(a,b,c,d){a=+a;b|=0;d||(d=Math.pow(2,8*c-1),E(this,a,b,c,d-1,-d));d=0;var e=1,f=0;for(this[b]=a&255;++da&&0===f&&0!==this[b+d-1]&&(f=1),this[b+d]=(a/e>>0)-f&255;return b+c};\nz.prototype.writeIntBE=function(a,b,c,d){a=+a;b|=0;d||(d=Math.pow(2,8*c-1),E(this,a,b,c,d-1,-d));d=c-1;var e=1,f=0;for(this[b+d]=a&255;0<=--d&&(e*=256);)0>a&&0===f&&0!==this[b+d+1]&&(f=1),this[b+d]=(a/e>>0)-f&255;return b+c};z.prototype.writeInt8=function(a,b,c){a=+a;b|=0;c||E(this,a,b,1,127,-128);z.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));0>a&&(a=255+a+1);this[b]=a&255;return b+1};\nz.prototype.writeInt16LE=function(a,b,c){a=+a;b|=0;c||E(this,a,b,2,32767,-32768);z.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):bb(this,a,b,!0);return b+2};z.prototype.writeInt16BE=function(a,b,c){a=+a;b|=0;c||E(this,a,b,2,32767,-32768);z.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&255):bb(this,a,b,!1);return b+2};\nz.prototype.writeInt32LE=function(a,b,c){a=+a;b|=0;c||E(this,a,b,4,2147483647,-2147483648);z.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):cb(this,a,b,!0);return b+4};z.prototype.writeInt32BE=function(a,b,c){a=+a;b|=0;c||E(this,a,b,4,2147483647,-2147483648);0>a&&(a=4294967295+a+1);z.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a&255):cb(this,a,b,!1);return b+4};\nfunction db(a,b,c,d){if(c+d>a.length)throw new RangeError(\"Index out of range\");if(0>c)throw new RangeError(\"Index out of range\");}z.prototype.writeFloatLE=function(a,b,c){c||db(this,a,b,4);ta(this,a,b,!0,23,4);return b+4};z.prototype.writeFloatBE=function(a,b,c){c||db(this,a,b,4);ta(this,a,b,!1,23,4);return b+4};z.prototype.writeDoubleLE=function(a,b,c){c||db(this,a,b,8);ta(this,a,b,!0,52,8);return b+8};z.prototype.writeDoubleBE=function(a,b,c){c||db(this,a,b,8);ta(this,a,b,!1,52,8);return b+8};\nz.prototype.copy=function(a,b,c,d){c||(c=0);d||0===d||(d=this.length);b>=a.length&&(b=a.length);b||(b=0);0b)throw new RangeError(\"targetStart out of bounds\");if(0>c||c>=this.length)throw new RangeError(\"sourceStart out of bounds\");if(0>d)throw new RangeError(\"sourceEnd out of bounds\");d>this.length&&(d=this.length);a.length-be||\n!z.TYPED_ARRAY_SUPPORT)for(d=0;de&&(a=e)}if(void 0!==d&&\"string\"!==typeof d)throw new TypeError(\"encoding must be a string\");if(\"string\"===typeof d&&!z.isEncoding(d))throw new TypeError(\"Unknown encoding: \"+d);}else\"number\"===typeof a&&(a&=255);if(0>b||this.length>>=\n0;c=void 0===c?this.length:c>>>0;a||(a=0);if(\"number\"===typeof a)for(d=b;dc){if(!e){if(56319c){-1<(b-=3)&&f.push(239,191,189);e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&-1<(b-=3)&&f.push(239,191,189);e=null;if(128>c){if(0>--b)break;f.push(c)}else if(2048>c){if(0>(b-=2))break;f.push(c>>6|192,c&63|128)}else if(65536>c){if(0>(b-=3))break;\nf.push(c>>12|224,c>>6&63|128,c&63|128)}else if(1114112>c){if(0>(b-=4))break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw Error(\"Invalid code point\");}return f}function Wa(a){for(var b=[],c=0;ca.length)a=\"\";else for(;0!==a.length%4;)a+=\"=\";oa||pa();var b=a.length;if(0>16&255;d[f++]=g>>8&255;d[f++]=g&255}2===c?(g=y[a.charCodeAt(b)]<<2|\ny[a.charCodeAt(b+1)]>>4,d[f++]=g&255):1===c&&(g=y[a.charCodeAt(b)]<<10|y[a.charCodeAt(b+1)]<<4|y[a.charCodeAt(b+2)]>>2,d[f++]=g>>8&255,d[f++]=g&255);return d}function Va(a,b,c,d){for(var e=0;e=b.length||e>=a.length);++e)b[e+c]=a[e];return e}function Na(a){return null!=a&&(!!a._isBuffer||fb(a)||\"function\"===typeof a.readFloatLE&&\"function\"===typeof a.slice&&fb(a.slice(0,0)))}function fb(a){return!!a.constructor&&\"function\"===typeof a.constructor.isBuffer&&a.constructor.isBuffer(a)}\nvar gb=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:za,Buffer:z,SlowBuffer:function(a){+a!=a&&(a=0);return z.alloc(+a)},isBuffer:Na}),F=u(function(a,b){function c(a){for(var b=[],c=1;cb&&(c--,b+=1E9));return[c,b]},platform:\"browser\",release:{},config:{},uptime:function(){return(new Date-Bb)/1E3}},Db=\"function\"===typeof Object.create?function(a,b){a.super_=b;a.prototype=Object.create(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})}:function(a,b){function c(){}a.super_=b;c.prototype=b.prototype;a.prototype=new c;\na.prototype.constructor=a},Eb=/%[sdj%]/g;function Fb(a){if(!Gb(a)){for(var b=[],c=0;c=e)return a;switch(a){case \"%s\":return String(d[c++]);case \"%d\":return Number(d[c++]);case \"%j\":try{return JSON.stringify(d[c++])}catch(h){return\"[Circular]\"}default:return a}});for(var f=d[c];cc)return ac(b)?a.stylize(RegExp.prototype.toString.call(b),\"regexp\"):a.stylize(\"[Object]\",\"special\");a.seen.push(b);e=g?\ndc(a,b,c,f,e):e.map(function(d){return ec(a,b,c,f,d,g)});a.seen.pop();return fc(e,d,h)}function Ub(a,b){if(Jb(b))return a.stylize(\"undefined\",\"undefined\");if(Gb(b))return b=\"'\"+JSON.stringify(b).replace(/^\"|\"$/g,\"\").replace(/'/g,\"\\\\'\").replace(/\\\\\"/g,'\"')+\"'\",a.stylize(b,\"string\");if(gc(b))return a.stylize(\"\"+b,\"number\");if(Ob(b))return a.stylize(\"\"+b,\"boolean\");if(null===b)return a.stylize(\"null\",\"null\")}function Zb(a){return\"[\"+Error.prototype.toString.call(a)+\"]\"}\nfunction dc(a,b,c,d,e){for(var f=[],g=0,h=b.length;ga.seen.indexOf(b.value)?(h=null===c?Rb(a,b.value,null):Rb(a,b.value,c-1),-1a?\"0\"+a.toString(10):a.toString(10)}var jc=\"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec\".split(\" \");\nfunction kc(){var a=new Date,b=[ic(a.getHours()),ic(a.getMinutes()),ic(a.getSeconds())].join(\":\");return[a.getDate(),jc[a.getMonth()],b].join(\" \")}function Pb(a,b){if(!b||!Hb(b))return a;for(var c=Object.keys(b),d=c.length;d--;)a[c[d]]=b[c[d]];return a}\nvar lc={inherits:Db,_extend:Pb,log:function(){console.log(\"%s - %s\",kc(),Fb.apply(null,arguments))},isBuffer:function(a){return Na(a)},isPrimitive:hc,isFunction:Tb,isError:Vb,isDate:bc,isObject:Hb,isRegExp:ac,isUndefined:Jb,isSymbol:function(a){return\"symbol\"===typeof a},isString:Gb,isNumber:gc,isNullOrUndefined:function(a){return null==a},isNull:function(a){return null===a},isBoolean:Ob,isArray:cc,inspect:H,deprecate:Ib,format:Fb,debuglog:Mb};\nfunction mc(a,b){if(a===b)return 0;for(var c=a.length,d=b.length,e=0,f=Math.min(c,d);e 0 and < 65536\");e(\"ERR_SOCKET_BAD_TYPE\",\"Bad socket type specified. Valid types are: udp4, udp6\");\ne(\"ERR_SOCKET_CANNOT_SEND\",\"Unable to send data\");e(\"ERR_SOCKET_CLOSED\",\"Socket is closed\");e(\"ERR_SOCKET_DGRAM_NOT_RUNNING\",\"Not running\");e(\"ERR_STDERR_CLOSE\",\"process.stderr cannot be closed\");e(\"ERR_STDOUT_CLOSE\",\"process.stdout cannot be closed\");e(\"ERR_STREAM_WRAP\",\"Stream has StringDecoder set or is in objectMode\");e(\"ERR_TLS_CERT_ALTNAME_INVALID\",\"Hostname/IP does not match certificate's altnames: %s\");e(\"ERR_TLS_DH_PARAM_SIZE\",function(a){return\"DH parameter size \"+a+\" is less than 2048\"});\ne(\"ERR_TLS_HANDSHAKE_TIMEOUT\",\"TLS handshake timeout\");e(\"ERR_TLS_RENEGOTIATION_FAILED\",\"Failed to renegotiate\");e(\"ERR_TLS_REQUIRED_SERVER_NAME\",'\"servername\" is required parameter for Server.addContext');e(\"ERR_TLS_SESSION_ATTACK\",\"TSL session renegotiation attack detected\");e(\"ERR_TRANSFORM_ALREADY_TRANSFORMING\",\"Calling transform done when still transforming\");e(\"ERR_TRANSFORM_WITH_LENGTH_0\",\"Calling transform done when writableState.length != 0\");e(\"ERR_UNKNOWN_ENCODING\",\"Unknown encoding: %s\");\ne(\"ERR_UNKNOWN_SIGNAL\",\"Unknown signal: %s\");e(\"ERR_UNKNOWN_STDIN_TYPE\",\"Unknown stdin file type\");e(\"ERR_UNKNOWN_STREAM_TYPE\",\"Unknown stream file type\");e(\"ERR_V8BREAKITERATOR\",\"Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl\")});t(Pc);\nvar K=u(function(a,b){Object.defineProperty(b,\"__esModule\",{value:!0});b.ENCODING_UTF8=\"utf8\";b.assertEncoding=function(a){if(a&&!F.Buffer.isEncoding(a))throw new Pc.TypeError(\"ERR_INVALID_OPT_VALUE_ENCODING\",a);};b.strToEncoding=function(a,d){return d&&d!==b.ENCODING_UTF8?\"buffer\"===d?new F.Buffer(a):(new F.Buffer(a)).toString(d):a}});t(K);\nvar Qc=u(function(a,b){Object.defineProperty(b,\"__esModule\",{value:!0});var c=w.constants.S_IFMT,d=w.constants.S_IFDIR,e=w.constants.S_IFREG,f=w.constants.S_IFBLK,g=w.constants.S_IFCHR,h=w.constants.S_IFLNK,k=w.constants.S_IFIFO,p=w.constants.S_IFSOCK;a=function(){function a(){this.name=\"\";this.mode=0}a.build=function(b,c){var d=new a,e=b.getNode().mode;d.name=K.strToEncoding(b.getName(),c);d.mode=e;return d};a.prototype._checkModeProperty=function(a){return(this.mode&c)===a};a.prototype.isDirectory=\nfunction(){return this._checkModeProperty(d)};a.prototype.isFile=function(){return this._checkModeProperty(e)};a.prototype.isBlockDevice=function(){return this._checkModeProperty(f)};a.prototype.isCharacterDevice=function(){return this._checkModeProperty(g)};a.prototype.isSymbolicLink=function(){return this._checkModeProperty(h)};a.prototype.isFIFO=function(){return this._checkModeProperty(k)};a.prototype.isSocket=function(){return this._checkModeProperty(p)};return a}();b.Dirent=a;b.default=a});\nt(Qc);function Rc(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}var Sc=/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nfunction Tc(){for(var a=\"\",b=!1,c=arguments.length-1;-1<=c&&!b;c--){var d=0<=c?arguments[c]:\"/\";if(\"string\"!==typeof d)throw new TypeError(\"Arguments to path.resolve must be strings\");d&&(a=d+\"/\"+a,b=\"/\"===d.charAt(0))}a=Rc(Uc(a.split(\"/\"),function(a){return!!a}),!b).join(\"/\");return(b?\"/\":\"\")+a||\".\"}function Vc(a){var b=Wc(a),c=\"/\"===Xc(a,-1);(a=Rc(Uc(a.split(\"/\"),function(a){return!!a}),!b).join(\"/\"))||b||(a=\".\");a&&c&&(a+=\"/\");return(b?\"/\":\"\")+a}function Wc(a){return\"/\"===a.charAt(0)}\nfunction Yc(a,b){function c(a){for(var b=0;bc?[]:a.slice(b,c-b+1)}a=Tc(a).substr(1);b=Tc(b).substr(1);a=c(a.split(\"/\"));b=c(b.split(\"/\"));for(var d=Math.min(a.length,b.length),e=d,f=0;fb&&(b=a.length+b);return a.substr(b,c)},$c=u(function(a,b){Object.defineProperty(b,\"__esModule\",{value:!0});a=\"function\"===typeof setImmediate?setImmediate.bind(l):setTimeout.bind(l);b.default=a});t($c);\nvar L=u(function(a,b){function c(){var a=Cb||{};a.getuid||(a.getuid=function(){return 0});a.getgid||(a.getgid=function(){return 0});a.cwd||(a.cwd=function(){return\"/\"});a.nextTick||(a.nextTick=$c.default);a.emitWarning||(a.emitWarning=function(a,b){console.warn(\"\"+b+(b?\": \":\"\")+a)});a.env||(a.env={});return a}Object.defineProperty(b,\"__esModule\",{value:!0});b.createProcess=c;b.default=c()});t(L);function ad(){}ad.prototype=Object.create(null);function O(){O.init.call(this)}O.EventEmitter=O;\nO.usingDomains=!1;O.prototype.domain=void 0;O.prototype._events=void 0;O.prototype._maxListeners=void 0;O.defaultMaxListeners=10;O.init=function(){this.domain=null;this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new ad,this._eventsCount=0);this._maxListeners=this._maxListeners||void 0};O.prototype.setMaxListeners=function(a){if(\"number\"!==typeof a||0>a||isNaN(a))throw new TypeError('\"n\" argument must be a positive number');this._maxListeners=a;return this};\nO.prototype.getMaxListeners=function(){return void 0===this._maxListeners?O.defaultMaxListeners:this._maxListeners};\nO.prototype.emit=function(a){var b,c;var d=\"error\"===a;if(b=this._events)d=d&&null==b.error;else if(!d)return!1;var e=this.domain;if(d){b=arguments[1];if(e)b||(b=Error('Uncaught, unspecified \"error\" event')),b.domainEmitter=this,b.domain=e,b.domainThrown=!1,e.emit(\"error\",b);else{if(b instanceof Error)throw b;e=Error('Uncaught, unspecified \"error\" event. ('+b+\")\");e.context=b;throw e;}return!1}e=b[a];if(!e)return!1;b=\"function\"===typeof e;var f=arguments.length;switch(f){case 1:if(b)e.call(this);\nelse for(b=e.length,e=bd(e,b),d=0;dc&&(f.warned=!0,c=Error(\"Possible EventEmitter memory leak detected. \"+f.length+\n\" \"+b+\" listeners added. Use emitter.setMaxListeners() to increase limit\"),c.name=\"MaxListenersExceededWarning\",c.emitter=a,c.type=b,c.count=f.length,\"function\"===typeof console.warn?console.warn(c):console.log(c))):(e[b]=c,++a._eventsCount);return a}O.prototype.addListener=function(a,b){return cd(this,a,b,!1)};O.prototype.on=O.prototype.addListener;O.prototype.prependListener=function(a,b){return cd(this,a,b,!0)};\nfunction dd(a,b,c){function d(){a.removeListener(b,d);e||(e=!0,c.apply(a,arguments))}var e=!1;d.listener=c;return d}O.prototype.once=function(a,b){if(\"function\"!==typeof b)throw new TypeError('\"listener\" argument must be a function');this.on(a,dd(this,a,b));return this};O.prototype.prependOnceListener=function(a,b){if(\"function\"!==typeof b)throw new TypeError('\"listener\" argument must be a function');this.prependListener(a,dd(this,a,b));return this};\nO.prototype.removeListener=function(a,b){var c;if(\"function\"!==typeof b)throw new TypeError('\"listener\" argument must be a function');var d=this._events;if(!d)return this;var e=d[a];if(!e)return this;if(e===b||e.listener&&e.listener===b)0===--this._eventsCount?this._events=new ad:(delete d[a],d.removeListener&&this.emit(\"removeListener\",a,e.listener||b));else if(\"function\"!==typeof e){var f=-1;for(c=e.length;0\nf)return this;if(1===e.length){e[0]=void 0;if(0===--this._eventsCount)return this._events=new ad,this;delete d[a]}else{c=f+1;for(var h=e.length;cthis.buf.length){var e=F.bufferAllocUnsafe(d+c);this.buf.copy(e,0,0,this.buf.length);this.buf=e}a.copy(this.buf,d,b,b+c);this.touch();return c};b.prototype.read=function(a,b,c,d){void 0===b&&(b=0);void 0===c&&(c=a.byteLength);\nvoid 0===d&&(d=0);this.buf||(this.buf=F.bufferAllocUnsafe(0));c>a.byteLength&&(c=a.byteLength);c+d>this.buf.length&&(c=this.buf.length-d);this.buf.copy(a,b,d,d+c);return c};b.prototype.truncate=function(a){void 0===a&&(a=0);if(a)if(this.buf||(this.buf=F.bufferAllocUnsafe(0)),a<=this.buf.length)this.buf=this.buf.slice(0,a);else{var b=F.bufferAllocUnsafe(0);this.buf.copy(b);b.fill(0,a)}else this.buf=F.bufferAllocUnsafe(0);this.touch()};b.prototype.chmod=function(a){this.perm=a;this.mode=this.mode&-512|\na;this.touch()};b.prototype.chown=function(a,b){this.uid=a;this.gid=b;this.touch()};b.prototype.touch=function(){this.mtime=new Date;this.emit(\"change\",this)};b.prototype.canRead=function(a,b){void 0===a&&(a=L.default.getuid());void 0===b&&(b=L.default.getgid());return this.perm&4||b===this.gid&&this.perm&32||a===this.uid&&this.perm&256?!0:!1};b.prototype.canWrite=function(a,b){void 0===a&&(a=L.default.getuid());void 0===b&&(b=L.default.getgid());return this.perm&2||b===this.gid&&this.perm&16||a===\nthis.uid&&this.perm&128?!0:!1};b.prototype.del=function(){this.emit(\"delete\",this)};b.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}};return b}(O.EventEmitter);b.Node=a;a=function(a){function d(b,c,d){var e=a.call(this)||this;e.children={};e.steps=[];e.ino=0;e.length=0;e.vol=b;e.parent=c;e.steps=c?c.steps.concat([d]):\n[d];return e}c(d,a);d.prototype.setNode=function(a){this.node=a;this.ino=a.ino};d.prototype.getNode=function(){return this.node};d.prototype.createChild=function(a,b){void 0===b&&(b=this.vol.createNode());var c=new d(this.vol,this,a);c.setNode(b);b.isDirectory();this.setChild(a,c);return c};d.prototype.setChild=function(a,b){void 0===b&&(b=new d(this.vol,this,a));this.children[a]=b;b.parent=this;this.length++;this.emit(\"child:add\",b,this);return b};d.prototype.deleteChild=function(a){delete this.children[a.getName()];\nthis.length--;this.emit(\"child:delete\",a,this)};d.prototype.getChild=function(a){if(Object.hasOwnProperty.call(this.children,a))return this.children[a]};d.prototype.getPath=function(){return this.steps.join(b.SEP)};d.prototype.getName=function(){return this.steps[this.steps.length-1]};d.prototype.walk=function(a,b,c){void 0===b&&(b=a.length);void 0===c&&(c=0);if(c>=a.length||c>=b)return this;var d=this.getChild(a[c]);return d?d.walk(a,b,c+1):null};d.prototype.toJSON=function(){return{steps:this.steps,\nino:this.ino,children:Object.keys(this.children)}};return d}(O.EventEmitter);b.Link=a;a=function(){function a(a,b,c,d){this.position=0;this.link=a;this.node=b;this.flags=c;this.fd=d}a.prototype.getString=function(){return this.node.getString()};a.prototype.setString=function(a){this.node.setString(a)};a.prototype.getBuffer=function(){return this.node.getBuffer()};a.prototype.setBuffer=function(a){this.node.setBuffer(a)};a.prototype.getSize=function(){return this.node.getSize()};a.prototype.truncate=\nfunction(a){this.node.truncate(a)};a.prototype.seekTo=function(a){this.position=a};a.prototype.stats=function(){return ka.default.build(this.node)};a.prototype.write=function(a,b,c,d){void 0===b&&(b=0);void 0===c&&(c=a.length);\"number\"!==typeof d&&(d=this.position);this.flags&h&&(d=this.getSize());a=this.node.write(a,b,c,d);this.position=d+a;return a};a.prototype.read=function(a,b,c,d){void 0===b&&(b=0);void 0===c&&(c=a.byteLength);\"number\"!==typeof d&&(d=this.position);a=this.node.read(a,b,c,d);\nthis.position=d+a;return a};a.prototype.chmod=function(a){this.node.chmod(a)};a.prototype.chown=function(a,b){this.node.chown(a,b)};return a}();b.File=a});t(fd);var gd=fd.Node,hd=u(function(a,b){Object.defineProperty(b,\"__esModule\",{value:!0});b.default=function(a,b,e){var c=setTimeout.apply(null,arguments);c&&\"object\"===typeof c&&\"function\"===typeof c.unref&&c.unref();return c}});t(hd);function id(){this.tail=this.head=null;this.length=0}\nid.prototype.push=function(a){a={data:a,next:null};0>>0);for(var b=this.head,c=0;b;)b.data.copy(a,c),c+=b.data.length,b=b.next;return a};\nvar jd=z.isEncoding||function(a){switch(a&&a.toLowerCase()){case \"hex\":case \"utf8\":case \"utf-8\":case \"ascii\":case \"binary\":case \"base64\":case \"ucs2\":case \"ucs-2\":case \"utf16le\":case \"utf-16le\":case \"raw\":return!0;default:return!1}};\nfunction kd(a){this.encoding=(a||\"utf8\").toLowerCase().replace(/[-_]/,\"\");if(a&&!jd(a))throw Error(\"Unknown encoding: \"+a);switch(this.encoding){case \"utf8\":this.surrogateSize=3;break;case \"ucs2\":case \"utf16le\":this.surrogateSize=2;this.detectIncompleteChar=ld;break;case \"base64\":this.surrogateSize=3;this.detectIncompleteChar=md;break;default:this.write=nd;return}this.charBuffer=new z(6);this.charLength=this.charReceived=0}\nkd.prototype.write=function(a){for(var b=\"\";this.charLength;){b=a.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:a.length;a.copy(this.charBuffer,this.charReceived,0,b);this.charReceived+=b;if(this.charReceived=c)this.charLength+=this.surrogateSize,b=\"\";else{this.charReceived=this.charLength=0;if(0===a.length)return b;\nbreak}}this.detectIncompleteChar(a);var d=a.length;this.charLength&&(a.copy(this.charBuffer,0,a.length-this.charReceived,d),d-=this.charReceived);b+=a.toString(this.encoding,0,d);d=b.length-1;c=b.charCodeAt(d);return 55296<=c&&56319>=c?(c=this.surrogateSize,this.charLength+=c,this.charReceived+=c,this.charBuffer.copy(this.charBuffer,c,0,c),a.copy(this.charBuffer,0,0,c),b.substring(0,d)):b};\nkd.prototype.detectIncompleteChar=function(a){for(var b=3<=a.length?3:a.length;0>5){this.charLength=2;break}if(2>=b&&14==c>>4){this.charLength=3;break}if(3>=b&&30==c>>3){this.charLength=4;break}}this.charReceived=b};kd.prototype.end=function(a){var b=\"\";a&&a.length&&(b=this.write(a));this.charReceived&&(a=this.encoding,b+=this.charBuffer.slice(0,this.charReceived).toString(a));return b};function nd(a){return a.toString(this.encoding)}\nfunction ld(a){this.charLength=(this.charReceived=a.length%2)?2:0}function md(a){this.charLength=(this.charReceived=a.length%3)?3:0}P.ReadableState=od;var Q=Mb(\"stream\");Db(P,O);function pd(a,b,c){if(\"function\"===typeof a.prependListener)return a.prependListener(b,c);if(a._events&&a._events[b])Array.isArray(a._events[b])?a._events[b].unshift(c):a._events[b]=[c,a._events[b]];else a.on(b,c)}\nfunction od(a,b){a=a||{};this.objectMode=!!a.objectMode;b instanceof V&&(this.objectMode=this.objectMode||!!a.readableObjectMode);b=a.highWaterMark;var c=this.objectMode?16:16384;this.highWaterMark=b||0===b?b:c;this.highWaterMark=~~this.highWaterMark;this.buffer=new id;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.reading=this.endEmitted=this.ended=!1;this.sync=!0;this.resumeScheduled=this.readableListening=this.emittedReadable=this.needReadable=!1;this.defaultEncoding=a.defaultEncoding||\n\"utf8\";this.ranOut=!1;this.awaitDrain=0;this.readingMore=!1;this.encoding=this.decoder=null;a.encoding&&(this.decoder=new kd(a.encoding),this.encoding=a.encoding)}function P(a){if(!(this instanceof P))return new P(a);this._readableState=new od(a,this);this.readable=!0;a&&\"function\"===typeof a.read&&(this._read=a.read);O.call(this)}\nP.prototype.push=function(a,b){var c=this._readableState;c.objectMode||\"string\"!==typeof a||(b=b||c.defaultEncoding,b!==c.encoding&&(a=z.from(a,b),b=\"\"));return qd(this,c,a,b,!1)};P.prototype.unshift=function(a){return qd(this,this._readableState,a,\"\",!0)};P.prototype.isPaused=function(){return!1===this._readableState.flowing};\nfunction qd(a,b,c,d,e){var f=c;var g=null;Na(f)||\"string\"===typeof f||null===f||void 0===f||b.objectMode||(g=new TypeError(\"Invalid non-string/buffer chunk\"));if(f=g)a.emit(\"error\",f);else if(null===c)b.reading=!1,b.ended||(b.decoder&&(c=b.decoder.end())&&c.length&&(b.buffer.push(c),b.length+=b.objectMode?1:c.length),b.ended=!0,rd(a));else if(b.objectMode||c&&0=a||0===b.length&&b.ended)return 0;if(b.objectMode)return 1;if(a!==a)return b.flowing&&b.length?b.buffer.head.data.length:b.length;if(a>b.highWaterMark){var c=a;8388608<=c?c=8388608:(c--,c|=c>>>1,c|=c>>>2,c|=c>>>4,c|=c>>>8,c|=c>>>16,c++);b.highWaterMark=c}return a<=b.length?a:b.ended?b.length:(b.needReadable=!0,0)}\nP.prototype.read=function(a){Q(\"read\",a);a=parseInt(a,10);var b=this._readableState,c=a;0!==a&&(b.emittedReadable=!1);if(0===a&&b.needReadable&&(b.length>=b.highWaterMark||b.ended))return Q(\"read: emitReadable\",b.length,b.ended),0===b.length&&b.ended?Jd(this):rd(this),null;a=td(a,b);if(0===a&&b.ended)return 0===b.length&&Jd(this),null;var d=b.needReadable;Q(\"need readable\",d);if(0===b.length||b.length-a=b.length)c=b.decoder?b.buffer.join(\"\"):1===b.buffer.length?b.buffer.head.data:b.buffer.concat(b.length),b.buffer.clear();else{c=b.buffer;b=b.decoder;if(af.length?f.length:a;e=g===f.length?e+f:e+f.slice(0,\na);a-=g;if(0===a){g===f.length?(++d,c.head=b.next?b.next:c.tail=null):(c.head=b,b.data=f.slice(g));break}++d}c.length-=d;c=e}else{b=z.allocUnsafe(a);d=c.head;e=1;d.data.copy(b);for(a-=d.data.length;d=d.next;){f=d.data;g=a>f.length?f.length:a;f.copy(b,b.length-a,0,g);a-=g;if(0===a){g===f.length?(++e,c.head=d.next?d.next:c.tail=null):(c.head=d,d.data=f.slice(g));break}++e}c.length-=e;c=b}b=c}c=b}return c}\nfunction Jd(a){var b=a._readableState;if(0arguments.length?a:ke.apply(null,[a].concat(je.call(arguments,2)))}},me=u(function(a,b){function c(a,b,c){void 0===c&&(c=function(a){return a});return function(){for(var e=[],f=0;f= 0x80 (not a basic code point)\",\"invalid-input\":\"Invalid input\"},qe=Math.floor,re=String.fromCharCode;\nfunction se(a,b){var c=a.split(\"@\"),d=\"\";1a)-((0!=b)<<5)}\nfunction ue(a){return se(a,function(a){if(ne.test(a)){var b;var d=[];var e=[];var f=0;for(b=a.length;f=g&&fn&&d.push(re(n))}for((f=b=d.length)&&d.push(\"-\");f=e&&nqe((2147483647-k)/B))throw new RangeError(pe.overflow);\nk+=(q-e)*B;e=q;for(g=0;g=p+26?26:q-p;if(m>1;for(k+=qe(k/p);455b&&(d=b);for(b=0;b\"` \\r\\n\\t'.split(\"\")),Ke=[\"'\"].concat(Je),Le=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(Ke),Me=[\"/\",\"?\",\"#\"],Ne=255,Oe=/^[+a-z0-9A-Z_-]{0,63}$/,Pe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Qe={javascript:!0,\"javascript:\":!0},Re={javascript:!0,\"javascript:\":!0},Se={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0};\nfunction Be(a,b,c){if(a&&Hb(a)&&a instanceof Z)return a;var d=new Z;d.parse(a,b,c);return d}Z.prototype.parse=function(a,b,c){return Te(this,a,b,c)};\nfunction Te(a,b,c,d){if(!Gb(b))throw new TypeError(\"Parameter 'url' must be a string, not \"+typeof b);var e=b.indexOf(\"?\");e=-1!==e&&eNe?\"\":a.hostname.toLowerCase();g||(a.hostname=ue(a.hostname));d=a.port?\":\"+a.port:\"\";a.host=(a.hostname||\"\")+d;\na.href+=a.host;g&&(a.hostname=a.hostname.substr(1,a.hostname.length-2),\"/\"!==e[0]&&(e=\"/\"+e))}if(!Qe[f])for(d=0,b=Ke.length;df.length&&f.unshift(\"\");b.pathname=f.join(\"/\")}b.search=a.search;b.query=a.query;b.host=a.host||\"\";b.auth=a.auth;b.hostname=a.hostname||a.host;b.port=a.port;if(b.pathname||b.search)b.path=(b.pathname||\"\")+(b.search||\"\");b.slashes=\nb.slashes||a.slashes;b.href=b.format();return b}c=b.pathname&&\"/\"===b.pathname.charAt(0);var g=a.host||a.pathname&&\"/\"===a.pathname.charAt(0),h=c=g||c||b.host&&a.pathname;d=b.pathname&&b.pathname.split(\"/\")||[];e=b.protocol&&!Se[b.protocol];f=a.pathname&&a.pathname.split(\"/\")||[];e&&(b.hostname=\"\",b.port=null,b.host&&(\"\"===d[0]?d[0]=b.host:d.unshift(b.host)),b.host=\"\",a.protocol&&(a.hostname=null,a.port=null,a.host&&(\"\"===f[0]?f[0]=a.host:f.unshift(a.host)),a.host=null),c=c&&(\"\"===f[0]||\"\"===d[0]));\nif(g)b.host=a.host||\"\"===a.host?a.host:b.host,b.hostname=a.hostname||\"\"===a.hostname?a.hostname:b.hostname,b.search=a.search,b.query=a.query,d=f;else if(f.length)d||(d=[]),d.pop(),d=d.concat(f),b.search=a.search,b.query=a.query;else if(null!=a.search){e&&(b.hostname=b.host=d.shift(),e=b.host&&0d)d=b;else{for(;c(b,d);)d--;d=b.substr(0,d+1)}return d.replace(/^([a-zA-Z]+:|\\.\\/)/,\"\")}return a}Object.defineProperty(b,\"__esModule\",{value:!0});b.unixify=d;b.correctPath=function(a){return d(a.replace(/^\\\\\\\\\\?\\\\.:\\\\/,\n\"\\\\\"))};var e=\"win32\"===Cb.platform});t(We);\nvar Xe=u(function(a,b){function c(a,b){void 0===b&&(b=L.default.cwd());return cf(b,a)}function d(a,b){return\"function\"===typeof a?[e(),a]:[e(a),q(b)]}function e(a){void 0===a&&(a={});return aa({},df,a)}function f(a){return\"number\"===typeof a?aa({},ud,{mode:a}):aa({},ud,a)}function g(a,b,c,d){void 0===b&&(b=\"\");void 0===c&&(c=\"\");void 0===d&&(d=\"\");var e=\"\";c&&(e=\" '\"+c+\"'\");d&&(e+=\" -> '\"+d+\"'\");switch(a){case \"ENOENT\":return\"ENOENT: no such file or directory, \"+b+e;case \"EBADF\":return\"EBADF: bad file descriptor, \"+\nb+e;case \"EINVAL\":return\"EINVAL: invalid argument, \"+b+e;case \"EPERM\":return\"EPERM: operation not permitted, \"+b+e;case \"EPROTO\":return\"EPROTO: protocol error, \"+b+e;case \"EEXIST\":return\"EEXIST: file already exists, \"+b+e;case \"ENOTDIR\":return\"ENOTDIR: not a directory, \"+b+e;case \"EISDIR\":return\"EISDIR: illegal operation on a directory, \"+b+e;case \"EACCES\":return\"EACCES: permission denied, \"+b+e;case \"ENOTEMPTY\":return\"ENOTEMPTY: directory not empty, \"+b+e;case \"EMFILE\":return\"EMFILE: too many open files, \"+\nb+e;case \"ENOSYS\":return\"ENOSYS: function not implemented, \"+b+e;default:return a+\": error occurred, \"+b+e}}function h(a,b,c,d,e){void 0===b&&(b=\"\");void 0===c&&(c=\"\");void 0===d&&(d=\"\");void 0===e&&(e=Error);b=new e(g(a,b,c,d));b.code=a;return b}function k(a){if(\"number\"===typeof a)return a;if(\"string\"===typeof a){var b=ua[a];if(\"undefined\"!==typeof b)return b}throw new Pc.TypeError(\"ERR_INVALID_OPT_VALUE\",\"flags\",a);}function p(a,b){if(b){var c=typeof b;switch(c){case \"string\":a=aa({},a,{encoding:b});\nbreak;case \"object\":a=aa({},a,b);break;default:throw TypeError(\"Expected options to be either an object or a string, but got \"+c+\" instead\");}}else return a;\"buffer\"!==a.encoding&&K.assertEncoding(a.encoding);return a}function n(a){return function(b){return p(a,b)}}function q(a){if(\"function\"!==typeof a)throw TypeError(fa.CB);return a}function B(a){return function(b,c){return\"function\"===typeof b?[a(),b]:[a(b),q(c)]}}function m(a){if(\"string\"!==typeof a&&!F.Buffer.isBuffer(a)){try{if(!(a instanceof\nFe.URL))throw new TypeError(fa.PATH_STR);}catch(Xa){throw new TypeError(fa.PATH_STR);}if(\"\"!==a.hostname)throw new Pc.TypeError(\"ERR_INVALID_FILE_URL_HOST\",L.default.platform);a=a.pathname;for(var b=0;b>>0!==a)throw TypeError(fa.FD);}function ha(a){if(\"string\"===typeof a&&+a==a)return+a;if(a instanceof Date)return a.getTime()/1E3;if(isFinite(a))return 0>a?Date.now()/1E3:a;throw Error(\"Cannot parse time: \"+a);}function Ha(a){if(\"number\"!==typeof a)throw TypeError(fa.UID);}function Ia(a){if(\"number\"!==typeof a)throw TypeError(fa.GID);}function ef(a){a.emit(\"stop\")}function T(a,b,c){if(!(this instanceof T))return new T(a,b,c);this._vol=\na;c=aa({},p(c,{}));void 0===c.highWaterMark&&(c.highWaterMark=65536);Y.Readable.call(this,c);this.path=m(b);this.fd=void 0===c.fd?null:c.fd;this.flags=void 0===c.flags?\"r\":c.flags;this.mode=void 0===c.mode?438:c.mode;this.start=c.start;this.end=c.end;this.autoClose=void 0===c.autoClose?!0:c.autoClose;this.pos=void 0;this.bytesRead=0;if(void 0!==this.start){if(\"number\"!==typeof this.start)throw new TypeError('\"start\" option must be a Number');if(void 0===this.end)this.end=Infinity;else if(\"number\"!==\ntypeof this.end)throw new TypeError('\"end\" option must be a Number');if(this.start>this.end)throw Error('\"start\" option must be <= \"end\" option');this.pos=this.start}\"number\"!==typeof this.fd&&this.open();this.on(\"end\",function(){this.autoClose&&this.destroy&&this.destroy()})}function ff(){this.close()}function R(a,b,c){if(!(this instanceof R))return new R(a,b,c);this._vol=a;c=aa({},p(c,{}));Y.Writable.call(this,c);this.path=m(b);this.fd=void 0===c.fd?null:c.fd;this.flags=void 0===c.flags?\"w\":c.flags;\nthis.mode=void 0===c.mode?438:c.mode;this.start=c.start;this.autoClose=void 0===c.autoClose?!0:!!c.autoClose;this.pos=void 0;this.bytesWritten=0;if(void 0!==this.start){if(\"number\"!==typeof this.start)throw new TypeError('\"start\" option must be a Number');if(0>this.start)throw Error('\"start\" must be >= zero');this.pos=this.start}c.encoding&&this.setDefaultEncoding(c.encoding);\"number\"!==typeof this.fd&&this.open();this.once(\"finish\",function(){this.autoClose&&this.close()})}var Ja=l&&l.__extends||\nfunction(){function a(b,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return a(b,c)}return function(b,c){function d(){this.constructor=b}a(b,c);b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}(),Xb=l&&l.__spreadArrays||function(){for(var a=0,b=0,c=arguments.length;b>>0!==a)throw TypeError(fa.FD);a=this.getFileByFd(a);if(!a)throw h(\"EBADF\",b);return a};a.prototype.getNodeByIdOrCreate=function(a,b,c){if(\"number\"===typeof a){a=this.getFileByFd(a);if(!a)throw Error(\"File nto found\");return a.node}var d=xa(a),e=this.getLink(d);if(e)return e.getNode();if(b&U&&(b=this.getLinkParent(d)))return e=\nthis.createLink(b,d[d.length-1],!1,c),e.getNode();throw h(\"ENOENT\",\"getNodeByIdOrCreate\",m(a));};a.prototype.wrapAsync=function(a,b,c){var d=this;q(c);$c.default(function(){try{c(null,a.apply(d,b))}catch(va){c(va)}})};a.prototype._toJSON=function(a,b,c){var d;void 0===a&&(a=this.root);void 0===b&&(b={});var e=!0,r=a.children;a.getNode().isFile()&&(r=(d={},d[a.getName()]=a.parent.getChild(a.getName()),d),a=a.parent);for(var D in r){e=!1;r=a.getChild(D);if(!r)throw Error(\"_toJSON: unexpected undefined\");\nd=r.getNode();d.isFile()?(r=r.getPath(),c&&(r=xd(c,r)),b[r]=d.getString()):d.isDirectory()&&this._toJSON(r,b,c)}a=a.getPath();c&&(a=xd(c,a));a&&e&&(b[a]=null);return b};a.prototype.toJSON=function(a,b,c){void 0===b&&(b={});void 0===c&&(c=!1);var d=[];if(a){a instanceof Array||(a=[a]);for(var e=0;e=this.maxFiles)throw h(\"EMFILE\",\"open\",a.getPath());var d=a;c&&(d=this.resolveSymlinks(a));if(!d)throw h(\"ENOENT\",\"open\",a.getPath());c=d.getNode();if(c.isDirectory()){if((b&(mb|na|Ka))!==mb)throw h(\"EISDIR\",\"open\",a.getPath());}else if(b&gf)throw h(\"ENOTDIR\",\"open\",a.getPath());if(!(b&Ka||c.canRead()))throw h(\"EACCES\",\"open\",a.getPath());a=new this.props.File(a,c,b,this.newFdNumber());this.fds[a.fd]=a;this.openFiles++;b&Za&&a.truncate();return a};\na.prototype.openFile=function(a,b,c,d){void 0===d&&(d=!0);var e=v(a),r=d?this.getResolvedLink(e):this.getLink(e);if(!r&&b&U){var D=this.getResolvedLink(e.slice(0,e.length-1));if(!D)throw h(\"ENOENT\",\"open\",S+e.join(S));b&U&&\"number\"===typeof c&&(r=this.createLink(D,e[e.length-1],!1,c))}if(r)return this.openLink(r,b,d);throw h(\"ENOENT\",\"open\",a);};a.prototype.openBase=function(a,b,c,d){void 0===d&&(d=!0);b=this.openFile(a,b,c,d);if(!b)throw h(\"ENOENT\",\"open\",a);return b.fd};a.prototype.openSync=function(a,\nb,c){void 0===c&&(c=438);c=M(c);a=m(a);b=k(b);return this.openBase(a,b,c)};a.prototype.open=function(a,b,c,d){var e=c;\"function\"===typeof c&&(e=438,d=c);c=M(e||438);a=m(a);b=k(b);this.wrapAsync(this.openBase,[a,b,c],d)};a.prototype.closeFile=function(a){this.fds[a.fd]&&(this.openFiles--,delete this.fds[a.fd],this.releasedFds.push(a.fd))};a.prototype.closeSync=function(a){Ya(a);a=this.getFileByFdOrThrow(a,\"close\");this.closeFile(a)};a.prototype.close=function(a,b){Ya(a);this.wrapAsync(this.closeSync,\n[a],b)};a.prototype.openFileOrGetById=function(a,b,c){if(\"number\"===typeof a){a=this.fds[a];if(!a)throw h(\"ENOENT\");return a}return this.openFile(m(a),b,c)};a.prototype.readBase=function(a,b,c,d,e){return this.getFileByFdOrThrow(a).read(b,Number(c),Number(d),e)};a.prototype.readSync=function(a,b,c,d,e){Ya(a);return this.readBase(a,b,c,d,e)};a.prototype.read=function(a,b,c,d,e,f){var r=this;q(f);if(0===d)return L.default.nextTick(function(){f&&f(null,0,b)});$c.default(function(){try{var D=r.readBase(a,\nb,c,d,e);f(null,D,b)}catch(pf){f(pf)}})};a.prototype.readFileBase=function(a,b,c){var d=\"number\"===typeof a&&a>>>0===a;if(!d){var e=m(a);e=v(e);if((e=this.getResolvedLink(e))&&e.getNode().isDirectory())throw h(\"EISDIR\",\"open\",e.getPath());a=this.openSync(a,b)}try{var r=$b(this.getFileByFdOrThrow(a).getBuffer(),c)}finally{d||this.closeSync(a)}return r};a.prototype.readFileSync=function(a,b){b=zd(b);var c=k(b.flag);return this.readFileBase(a,c,b.encoding)};a.prototype.readFile=function(a,b,c){c=B(zd)(b,\nc);b=c[0];c=c[1];var d=k(b.flag);this.wrapAsync(this.readFileBase,[a,d,b.encoding],c)};a.prototype.writeBase=function(a,b,c,d,e){return this.getFileByFdOrThrow(a,\"write\").write(b,c,d,e)};a.prototype.writeSync=function(a,b,c,d,e){Ya(a);var r=\"string\"!==typeof b;if(r){var D=(c||0)|0;var f=d;c=e}else var Xa=d;b=La(b,Xa);r?\"undefined\"===typeof f&&(f=b.length):(D=0,f=b.length);return this.writeBase(a,b,D,f,c)};a.prototype.write=function(a,b,c,d,e,f){var r=this;Ya(a);var D=typeof b,Xa=typeof c,g=typeof d,\nh=typeof e;if(\"string\"!==D)if(\"function\"===Xa)var k=c;else if(\"function\"===g){var lb=c|0;k=d}else if(\"function\"===h){lb=c|0;var m=d;k=e}else{lb=c|0;m=d;var n=e;k=f}else if(\"function\"===Xa)k=c;else if(\"function\"===g)n=c,k=d;else if(\"function\"===h){n=c;var va=d;k=e}var p=La(b,va);\"string\"!==D?\"undefined\"===typeof m&&(m=p.length):(lb=0,m=p.length);var v=q(k);$c.default(function(){try{var c=r.writeBase(a,p,lb,m,n);\"string\"!==D?v(null,c,p):v(null,c,b)}catch(qf){v(qf)}})};a.prototype.writeFileBase=function(a,\nb,c,d){var e=\"number\"===typeof a;a=e?a:this.openBase(m(a),c,d);d=0;var r=b.length;c=c&$a?void 0:0;try{for(;0=a.nlink&&this.deleteNode(a)};a.prototype.unlinkSync=function(a){a=m(a);this.unlinkBase(a)};a.prototype.unlink=function(a,b){a=m(a);this.wrapAsync(this.unlinkBase,[a],b)};a.prototype.symlinkBase=function(a,b){var c=v(b),d=this.getLinkParent(c);if(!d)throw h(\"ENOENT\",\"symlink\",a,b);c=c[c.length-1];if(d.getChild(c))throw h(\"EEXIST\",\"symlink\",a,b);b=d.createChild(c);b.getNode().makeSymlink(v(a));return b};a.prototype.symlinkSync=function(a,b){a=m(a);b=m(b);\nthis.symlinkBase(a,b)};a.prototype.symlink=function(a,b,c,d){c=q(\"function\"===typeof c?c:d);a=m(a);b=m(b);this.wrapAsync(this.symlinkBase,[a,b],c)};a.prototype.realpathBase=function(a,b){var c=v(a);c=this.getResolvedLink(c);if(!c)throw h(\"ENOENT\",\"realpath\",a);return K.strToEncoding(c.getPath(),b)};a.prototype.realpathSync=function(a,b){return this.realpathBase(m(a),Ed(b).encoding)};a.prototype.realpath=function(a,b,c){c=lf(b,c);b=c[0];c=c[1];a=m(a);this.wrapAsync(this.realpathBase,[a,b.encoding],\nc)};a.prototype.lstatBase=function(a,b){void 0===b&&(b=!1);var c=this.getLink(v(a));if(!c)throw h(\"ENOENT\",\"lstat\",a);return ka.default.build(c.getNode(),b)};a.prototype.lstatSync=function(a,b){return this.lstatBase(m(a),e(b).bigint)};a.prototype.lstat=function(a,b,c){c=d(b,c);b=c[0];c=c[1];this.wrapAsync(this.lstatBase,[m(a),b.bigint],c)};a.prototype.statBase=function(a,b){void 0===b&&(b=!1);var c=this.getResolvedLink(v(a));if(!c)throw h(\"ENOENT\",\"stat\",a);return ka.default.build(c.getNode(),b)};\na.prototype.statSync=function(a,b){return this.statBase(m(a),e(b).bigint)};a.prototype.stat=function(a,b,c){c=d(b,c);b=c[0];c=c[1];this.wrapAsync(this.statBase,[m(a),b.bigint],c)};a.prototype.fstatBase=function(a,b){void 0===b&&(b=!1);a=this.getFileByFd(a);if(!a)throw h(\"EBADF\",\"fstat\");return ka.default.build(a.node,b)};a.prototype.fstatSync=function(a,b){return this.fstatBase(a,e(b).bigint)};a.prototype.fstat=function(a,b,c){b=d(b,c);this.wrapAsync(this.fstatBase,[a,b[0].bigint],b[1])};a.prototype.renameBase=\nfunction(a,b){var c=this.getLink(v(a));if(!c)throw h(\"ENOENT\",\"rename\",a,b);var d=v(b),e=this.getLinkParent(d);if(!e)throw h(\"ENOENT\",\"rename\",a,b);(a=c.parent)&&a.deleteChild(c);c.steps=Xb(e.steps,[d[d.length-1]]);e.setChild(c.getName(),c)};a.prototype.renameSync=function(a,b){a=m(a);b=m(b);this.renameBase(a,b)};a.prototype.rename=function(a,b,c){a=m(a);b=m(b);this.wrapAsync(this.renameBase,[a,b],c)};a.prototype.existsBase=function(a){return!!this.statBase(a)};a.prototype.existsSync=function(a){try{return this.existsBase(m(a))}catch(D){return!1}};\na.prototype.exists=function(a,b){var c=this,d=m(a);if(\"function\"!==typeof b)throw Error(fa.CB);$c.default(function(){try{b(c.existsBase(d))}catch(va){b(!1)}})};a.prototype.accessBase=function(a){this.getLinkOrThrow(a,\"access\")};a.prototype.accessSync=function(a,b){void 0===b&&(b=wd);a=m(a);this.accessBase(a,b|0)};a.prototype.access=function(a,b,c){var d=wd;\"function\"!==typeof b&&(d=b|0,b=q(c));a=m(a);this.wrapAsync(this.accessBase,[a,d],b)};a.prototype.appendFileSync=function(a,b,c){void 0===c&&(c=\nCd);c=Dd(c);c.flag&&a>>>0!==a||(c.flag=\"a\");this.writeFileSync(a,b,c)};a.prototype.appendFile=function(a,b,c,d){d=kf(c,d);c=d[0];d=d[1];c.flag&&a>>>0!==a||(c.flag=\"a\");this.writeFile(a,b,c,d)};a.prototype.readdirBase=function(a,b){var c=v(a);c=this.getResolvedLink(c);if(!c)throw h(\"ENOENT\",\"readdir\",a);if(!c.getNode().isDirectory())throw h(\"ENOTDIR\",\"scandir\",a);if(b.withFileTypes){var d=[];for(e in c.children)(a=c.getChild(e))&&d.push(Qc.default.build(a,b.encoding));Yb||\"buffer\"===b.encoding||d.sort(function(a,\nb){return a.nameb.name?1:0});return d}var e=[];for(d in c.children)e.push(K.strToEncoding(d,b.encoding));Yb||\"buffer\"===b.encoding||e.sort();return e};a.prototype.readdirSync=function(a,b){b=Gd(b);a=m(a);return this.readdirBase(a,b)};a.prototype.readdir=function(a,b,c){c=mf(b,c);b=c[0];c=c[1];a=m(a);this.wrapAsync(this.readdirBase,[a,b],c)};a.prototype.readlinkBase=function(a,b){var c=this.getLinkOrThrow(a,\"readlink\").getNode();if(!c.isSymlink())throw h(\"EINVAL\",\"readlink\",a);a=\nS+c.symlink.join(S);return K.strToEncoding(a,b)};a.prototype.readlinkSync=function(a,b){b=ob(b);a=m(a);return this.readlinkBase(a,b.encoding)};a.prototype.readlink=function(a,b,c){c=yd(b,c);b=c[0];c=c[1];a=m(a);this.wrapAsync(this.readlinkBase,[a,b.encoding],c)};a.prototype.fsyncBase=function(a){this.getFileByFdOrThrow(a,\"fsync\")};a.prototype.fsyncSync=function(a){this.fsyncBase(a)};a.prototype.fsync=function(a,b){this.wrapAsync(this.fsyncBase,[a],b)};a.prototype.fdatasyncBase=function(a){this.getFileByFdOrThrow(a,\n\"fdatasync\")};a.prototype.fdatasyncSync=function(a){this.fdatasyncBase(a)};a.prototype.fdatasync=function(a,b){this.wrapAsync(this.fdatasyncBase,[a],b)};a.prototype.ftruncateBase=function(a,b){this.getFileByFdOrThrow(a,\"ftruncate\").truncate(b)};a.prototype.ftruncateSync=function(a,b){this.ftruncateBase(a,b)};a.prototype.ftruncate=function(a,b,c){var d=\"number\"===typeof b?b:0;b=q(\"number\"===typeof b?c:b);this.wrapAsync(this.ftruncateBase,[a,d],b)};a.prototype.truncateBase=function(a,b){a=this.openSync(a,\n\"r+\");try{this.ftruncateSync(a,b)}finally{this.closeSync(a)}};a.prototype.truncateSync=function(a,b){if(a>>>0===a)return this.ftruncateSync(a,b);this.truncateBase(a,b)};a.prototype.truncate=function(a,b,c){var d=\"number\"===typeof b?b:0;b=q(\"number\"===typeof b?c:b);if(a>>>0===a)return this.ftruncate(a,d,b);this.wrapAsync(this.truncateBase,[a,d],b)};a.prototype.futimesBase=function(a,b,c){a=this.getFileByFdOrThrow(a,\"futimes\").node;a.atime=new Date(1E3*b);a.mtime=new Date(1E3*c)};a.prototype.futimesSync=\nfunction(a,b,c){this.futimesBase(a,ha(b),ha(c))};a.prototype.futimes=function(a,b,c,d){this.wrapAsync(this.futimesBase,[a,ha(b),ha(c)],d)};a.prototype.utimesBase=function(a,b,c){a=this.openSync(a,\"r+\");try{this.futimesBase(a,b,c)}finally{this.closeSync(a)}};a.prototype.utimesSync=function(a,b,c){this.utimesBase(m(a),ha(b),ha(c))};a.prototype.utimes=function(a,b,c,d){this.wrapAsync(this.utimesBase,[m(a),ha(b),ha(c)],d)};a.prototype.mkdirBase=function(a,b){var c=v(a);if(!c.length)throw h(\"EISDIR\",\"mkdir\",\na);var d=this.getLinkParentAsDirOrThrow(a,\"mkdir\");c=c[c.length-1];if(d.getChild(c))throw h(\"EEXIST\",\"mkdir\",a);d.createChild(c,this.createNode(!0,b))};a.prototype.mkdirpBase=function(a,b){a=v(a);for(var c=this.root,d=0;dthis.prev.mtimeMs||a.nlink!==this.prev.nlink?!0:!1};b.prototype.start=function(a,b,c){void 0===b&&(b=!0);void 0===c&&(c=5007);this.filename=\nm(a);this.setTimeout=b?setTimeout:hd.default;this.interval=c;this.prev=this.vol.statSync(this.filename);this.loop()};b.prototype.stop=function(){clearTimeout(this.timeoutRef);L.default.nextTick(ef,this)};return b}(O.EventEmitter);b.StatWatcher=Hd;var N;lc.inherits(T,Y.Readable);b.ReadStream=T;T.prototype.open=function(){var a=this;this._vol.open(this.path,this.flags,this.mode,function(b,c){b?(a.autoClose&&a.destroy&&a.destroy(),a.emit(\"error\",b)):(a.fd=c,a.emit(\"open\",c),a.read())})};T.prototype._read=\nfunction(a){if(\"number\"!==typeof this.fd)return this.once(\"open\",function(){this._read(a)});if(!this.destroyed){if(!N||128>N.length-N.used)N=F.bufferAllocUnsafe(this._readableState.highWaterMark),N.used=0;var b=N,c=Math.min(N.length-N.used,a),d=N.used;void 0!==this.pos&&(c=Math.min(this.end-this.pos+1,c));if(0>=c)return this.push(null);var e=this;this._vol.read(this.fd,N,N.used,c,this.pos,function(a,c){a?(e.autoClose&&e.destroy&&e.destroy(),e.emit(\"error\",a)):(a=null,0 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n\n\n//# sourceURL=webpack:///./node_modules/base64-js/index.js?"); + +/***/ }), + +/***/ "./node_modules/browser-or-node/lib/index.js": +/*!***************************************************!*\ + !*** ./node_modules/browser-or-node/lib/index.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n\nvar isNode = typeof process !== \"undefined\" && process.versions != null && process.versions.node != null;\n\nvar isWebWorker = (typeof self === \"undefined\" ? \"undefined\" : _typeof(self)) === \"object\" && self.constructor && self.constructor.name === \"DedicatedWorkerGlobalScope\";\n\n/**\n * @see https://github.com/jsdom/jsdom/releases/tag/12.0.0\n * @see https://github.com/jsdom/jsdom/issues/1537\n */\nvar isJsDom = typeof window !== \"undefined\" && window.name === \"nodejs\" || typeof navigator !== \"undefined\" && (navigator.userAgent.includes(\"Node.js\") || navigator.userAgent.includes(\"jsdom\"));\n\nvar isDeno = typeof Deno !== \"undefined\" && typeof Deno.core !== \"undefined\";\n\nexports.isBrowser = isBrowser;\nexports.isWebWorker = isWebWorker;\nexports.isNode = isNode;\nexports.isJsDom = isJsDom;\nexports.isDeno = isDeno;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/browser-or-node/lib/index.js?"); + +/***/ }), + +/***/ "./node_modules/buffer/index.js": +/*!**************************************!*\ + !*** ./node_modules/buffer/index.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(/*! base64-js */ \"./node_modules/base64-js/index.js\")\nvar ieee754 = __webpack_require__(/*! ieee754 */ \"./node_modules/ieee754/index.js\")\nvar isArray = __webpack_require__(/*! isarray */ \"./node_modules/isarray/index.js\")\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/buffer/index.js?"); + +/***/ }), + +/***/ "./node_modules/debug/src/browser.js": +/*!*******************************************!*\ + !*** ./node_modules/debug/src/browser.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(process) {/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"./node_modules/debug/src/common.js\")(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/debug/src/browser.js?"); + +/***/ }), + +/***/ "./node_modules/debug/src/common.js": +/*!******************************************!*\ + !*** ./node_modules/debug/src/common.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n\n\n//# sourceURL=webpack:///./node_modules/debug/src/common.js?"); + +/***/ }), + +/***/ "./node_modules/ieee754/index.js": +/*!***************************************!*\ + !*** ./node_modules/ieee754/index.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n//# sourceURL=webpack:///./node_modules/ieee754/index.js?"); + +/***/ }), + +/***/ "./node_modules/is-observable/index.js": +/*!*********************************************!*\ + !*** ./node_modules/is-observable/index.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nmodule.exports = value => {\n\tif (!value) {\n\t\treturn false;\n\t}\n\n\t// eslint-disable-next-line no-use-extend-native/no-use-extend-native\n\tif (typeof Symbol.observable === 'symbol' && typeof value[Symbol.observable] === 'function') {\n\t\t// eslint-disable-next-line no-use-extend-native/no-use-extend-native\n\t\treturn value === value[Symbol.observable]();\n\t}\n\n\tif (typeof value['@@observable'] === 'function') {\n\t\treturn value === value['@@observable']();\n\t}\n\n\treturn false;\n};\n\n\n//# sourceURL=webpack:///./node_modules/is-observable/index.js?"); + +/***/ }), + +/***/ "./node_modules/isarray/index.js": +/*!***************************************!*\ + !*** ./node_modules/isarray/index.js ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n\n\n//# sourceURL=webpack:///./node_modules/isarray/index.js?"); + +/***/ }), + +/***/ "./node_modules/ms/index.js": +/*!**********************************!*\ + !*** ./node_modules/ms/index.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n\n\n//# sourceURL=webpack:///./node_modules/ms/index.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/_scheduler.js": +/*!************************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/_scheduler.js ***! + \************************************************************/ +/*! exports provided: AsyncSerialScheduler */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AsyncSerialScheduler\", function() { return AsyncSerialScheduler; });\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nclass AsyncSerialScheduler {\n constructor(observer) {\n this._baseObserver = observer;\n this._pendingPromises = new Set();\n }\n complete() {\n Promise.all(this._pendingPromises)\n .then(() => this._baseObserver.complete())\n .catch(error => this._baseObserver.error(error));\n }\n error(error) {\n this._baseObserver.error(error);\n }\n schedule(task) {\n const prevPromisesCompletion = Promise.all(this._pendingPromises);\n const values = [];\n const next = (value) => values.push(value);\n const promise = Promise.resolve()\n .then(() => __awaiter(this, void 0, void 0, function* () {\n yield prevPromisesCompletion;\n yield task(next);\n this._pendingPromises.delete(promise);\n for (const value of values) {\n this._baseObserver.next(value);\n }\n }))\n .catch(error => {\n this._pendingPromises.delete(promise);\n this._baseObserver.error(error);\n });\n this._pendingPromises.add(promise);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/_scheduler.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/_symbols.js": +/*!**********************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/_symbols.js ***! + \**********************************************************/ +/*! exports provided: hasSymbols, hasSymbol, getSymbol, registerObservableSymbol */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hasSymbols\", function() { return hasSymbols; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hasSymbol\", function() { return hasSymbol; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSymbol\", function() { return getSymbol; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerObservableSymbol\", function() { return registerObservableSymbol; });\nconst hasSymbols = () => typeof Symbol === \"function\";\nconst hasSymbol = (name) => hasSymbols() && Boolean(Symbol[name]);\nconst getSymbol = (name) => hasSymbol(name) ? Symbol[name] : \"@@\" + name;\nfunction registerObservableSymbol() {\n if (hasSymbols() && !hasSymbol(\"observable\")) {\n Symbol.observable = Symbol(\"observable\");\n }\n}\nif (!hasSymbol(\"asyncIterator\")) {\n Symbol.asyncIterator = Symbol.asyncIterator || Symbol.for(\"Symbol.asyncIterator\");\n}\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/_symbols.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/_util.js": +/*!*******************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/_util.js ***! + \*******************************************************/ +/*! exports provided: isAsyncIterator, isIterator */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAsyncIterator\", function() { return isAsyncIterator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isIterator\", function() { return isIterator; });\n/* harmony import */ var _symbols__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_symbols */ \"./node_modules/observable-fns/dist.esm/_symbols.js\");\n/// \n\nfunction isAsyncIterator(thing) {\n return thing && Object(_symbols__WEBPACK_IMPORTED_MODULE_0__[\"hasSymbol\"])(\"asyncIterator\") && thing[Symbol.asyncIterator];\n}\nfunction isIterator(thing) {\n return thing && Object(_symbols__WEBPACK_IMPORTED_MODULE_0__[\"hasSymbol\"])(\"iterator\") && thing[Symbol.iterator];\n}\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/_util.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/filter.js": +/*!********************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/filter.js ***! + \********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _scheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_scheduler */ \"./node_modules/observable-fns/dist.esm/_scheduler.js\");\n/* harmony import */ var _observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./observable */ \"./node_modules/observable-fns/dist.esm/observable.js\");\n/* harmony import */ var _unsubscribe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsubscribe */ \"./node_modules/observable-fns/dist.esm/unsubscribe.js\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n/**\n * Filters the values emitted by another observable.\n * To be applied to an input observable using `pipe()`.\n */\nfunction filter(test) {\n return (observable) => {\n return new _observable__WEBPACK_IMPORTED_MODULE_1__[\"default\"](observer => {\n const scheduler = new _scheduler__WEBPACK_IMPORTED_MODULE_0__[\"AsyncSerialScheduler\"](observer);\n const subscription = observable.subscribe({\n complete() {\n scheduler.complete();\n },\n error(error) {\n scheduler.error(error);\n },\n next(input) {\n scheduler.schedule((next) => __awaiter(this, void 0, void 0, function* () {\n if (yield test(input)) {\n next(input);\n }\n }));\n }\n });\n return () => Object(_unsubscribe__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(subscription);\n });\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (filter);\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/filter.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/flatMap.js": +/*!*********************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/flatMap.js ***! + \*********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _scheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_scheduler */ \"./node_modules/observable-fns/dist.esm/_scheduler.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_util */ \"./node_modules/observable-fns/dist.esm/_util.js\");\n/* harmony import */ var _observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./observable */ \"./node_modules/observable-fns/dist.esm/observable.js\");\n/* harmony import */ var _unsubscribe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./unsubscribe */ \"./node_modules/observable-fns/dist.esm/unsubscribe.js\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __asyncValues = (undefined && undefined.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\n\n\n\n\n/**\n * Maps the values emitted by another observable. In contrast to `map()`\n * the `mapper` function returns an array of values that will be emitted\n * separately.\n * Use `flatMap()` to map input values to zero, one or multiple output\n * values. To be applied to an input observable using `pipe()`.\n */\nfunction flatMap(mapper) {\n return (observable) => {\n return new _observable__WEBPACK_IMPORTED_MODULE_2__[\"default\"](observer => {\n const scheduler = new _scheduler__WEBPACK_IMPORTED_MODULE_0__[\"AsyncSerialScheduler\"](observer);\n const subscription = observable.subscribe({\n complete() {\n scheduler.complete();\n },\n error(error) {\n scheduler.error(error);\n },\n next(input) {\n scheduler.schedule((next) => __awaiter(this, void 0, void 0, function* () {\n var e_1, _a;\n const mapped = yield mapper(input);\n if (Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isIterator\"])(mapped) || Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"isAsyncIterator\"])(mapped)) {\n try {\n for (var mapped_1 = __asyncValues(mapped), mapped_1_1; mapped_1_1 = yield mapped_1.next(), !mapped_1_1.done;) {\n const element = mapped_1_1.value;\n next(element);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (mapped_1_1 && !mapped_1_1.done && (_a = mapped_1.return)) yield _a.call(mapped_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n mapped.map(output => next(output));\n }\n }));\n }\n });\n return () => Object(_unsubscribe__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(subscription);\n });\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (flatMap);\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/flatMap.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/index.js ***! + \*******************************************************/ +/*! exports provided: filter, flatMap, interval, map, merge, multicast, Observable, scan, Subject, unsubscribe */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filter */ \"./node_modules/observable-fns/dist.esm/filter.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"filter\", function() { return _filter__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _flatMap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./flatMap */ \"./node_modules/observable-fns/dist.esm/flatMap.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"flatMap\", function() { return _flatMap__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _interval__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interval */ \"./node_modules/observable-fns/dist.esm/interval.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interval\", function() { return _interval__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./map */ \"./node_modules/observable-fns/dist.esm/map.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"map\", function() { return _map__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _merge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./merge */ \"./node_modules/observable-fns/dist.esm/merge.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"merge\", function() { return _merge__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./multicast */ \"./node_modules/observable-fns/dist.esm/multicast.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"multicast\", function() { return _multicast__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _observable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./observable */ \"./node_modules/observable-fns/dist.esm/observable.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Observable\", function() { return _observable__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./scan */ \"./node_modules/observable-fns/dist.esm/scan.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"scan\", function() { return _scan__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _subject__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./subject */ \"./node_modules/observable-fns/dist.esm/subject.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Subject\", function() { return _subject__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _unsubscribe__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./unsubscribe */ \"./node_modules/observable-fns/dist.esm/unsubscribe.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"unsubscribe\", function() { return _unsubscribe__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/index.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/interval.js": +/*!**********************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/interval.js ***! + \**********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return interval; });\n/* harmony import */ var _observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observable */ \"./node_modules/observable-fns/dist.esm/observable.js\");\n\n/**\n * Creates an observable that yields a new value every `period` milliseconds.\n * The first value emitted is 0, then 1, 2, etc. The first value is not emitted\n * immediately, but after the first interval.\n */\nfunction interval(period) {\n return new _observable__WEBPACK_IMPORTED_MODULE_0__[\"Observable\"](observer => {\n let counter = 0;\n const handle = setInterval(() => {\n observer.next(counter++);\n }, period);\n return () => clearInterval(handle);\n });\n}\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/interval.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/map.js": +/*!*****************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/map.js ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _scheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_scheduler */ \"./node_modules/observable-fns/dist.esm/_scheduler.js\");\n/* harmony import */ var _observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./observable */ \"./node_modules/observable-fns/dist.esm/observable.js\");\n/* harmony import */ var _unsubscribe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsubscribe */ \"./node_modules/observable-fns/dist.esm/unsubscribe.js\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n/**\n * Maps the values emitted by another observable to different values.\n * To be applied to an input observable using `pipe()`.\n */\nfunction map(mapper) {\n return (observable) => {\n return new _observable__WEBPACK_IMPORTED_MODULE_1__[\"default\"](observer => {\n const scheduler = new _scheduler__WEBPACK_IMPORTED_MODULE_0__[\"AsyncSerialScheduler\"](observer);\n const subscription = observable.subscribe({\n complete() {\n scheduler.complete();\n },\n error(error) {\n scheduler.error(error);\n },\n next(input) {\n scheduler.schedule((next) => __awaiter(this, void 0, void 0, function* () {\n const mapped = yield mapper(input);\n next(mapped);\n }));\n }\n });\n return () => Object(_unsubscribe__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(subscription);\n });\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (map);\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/map.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/merge.js": +/*!*******************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/merge.js ***! + \*******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observable */ \"./node_modules/observable-fns/dist.esm/observable.js\");\n/* harmony import */ var _unsubscribe__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unsubscribe */ \"./node_modules/observable-fns/dist.esm/unsubscribe.js\");\n\n\nfunction merge(...observables) {\n if (observables.length === 0) {\n return _observable__WEBPACK_IMPORTED_MODULE_0__[\"Observable\"].from([]);\n }\n return new _observable__WEBPACK_IMPORTED_MODULE_0__[\"Observable\"](observer => {\n let completed = 0;\n const subscriptions = observables.map(input => {\n return input.subscribe({\n error(error) {\n observer.error(error);\n unsubscribeAll();\n },\n next(value) {\n observer.next(value);\n },\n complete() {\n if (++completed === observables.length) {\n observer.complete();\n unsubscribeAll();\n }\n }\n });\n });\n const unsubscribeAll = () => {\n subscriptions.forEach(subscription => Object(_unsubscribe__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(subscription));\n };\n return unsubscribeAll;\n });\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (merge);\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/merge.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/multicast.js": +/*!***********************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/multicast.js ***! + \***********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observable */ \"./node_modules/observable-fns/dist.esm/observable.js\");\n/* harmony import */ var _subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subject */ \"./node_modules/observable-fns/dist.esm/subject.js\");\n/* harmony import */ var _unsubscribe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsubscribe */ \"./node_modules/observable-fns/dist.esm/unsubscribe.js\");\n\n\n\n// TODO: Subject already creates additional observables \"under the hood\",\n// now we introduce even more. A true native MulticastObservable\n// would be preferable.\n/**\n * Takes a \"cold\" observable and returns a wrapping \"hot\" observable that\n * proxies the input observable's values and errors.\n *\n * An observable is called \"cold\" when its initialization function is run\n * for each new subscriber. This is how observable-fns's `Observable`\n * implementation works.\n *\n * A hot observable is an observable where new subscribers subscribe to\n * the upcoming values of an already-initialiazed observable.\n *\n * The multicast observable will lazily subscribe to the source observable\n * once it has its first own subscriber and will unsubscribe from the\n * source observable when its last own subscriber unsubscribed.\n */\nfunction multicast(coldObservable) {\n const subject = new _subject__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n let sourceSubscription;\n let subscriberCount = 0;\n return new _observable__WEBPACK_IMPORTED_MODULE_0__[\"default\"](observer => {\n // Init source subscription lazily\n if (!sourceSubscription) {\n sourceSubscription = coldObservable.subscribe(subject);\n }\n // Pipe all events from `subject` into this observable\n const subscription = subject.subscribe(observer);\n subscriberCount++;\n return () => {\n subscriberCount--;\n subscription.unsubscribe();\n // Close source subscription once last subscriber has unsubscribed\n if (subscriberCount === 0) {\n Object(_unsubscribe__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(sourceSubscription);\n sourceSubscription = undefined;\n }\n };\n });\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (multicast);\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/multicast.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/observable.js": +/*!************************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/observable.js ***! + \************************************************************/ +/*! exports provided: Subscription, SubscriptionObserver, Observable, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Subscription\", function() { return Subscription; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SubscriptionObserver\", function() { return SubscriptionObserver; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Observable\", function() { return Observable; });\n/* harmony import */ var _symbols__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./symbols */ \"./node_modules/observable-fns/dist.esm/symbols.js\");\n/* harmony import */ var _symbols__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_symbols */ \"./node_modules/observable-fns/dist.esm/_symbols.js\");\n/**\n * Based on \n * At commit: f63849a8c60af5d514efc8e9d6138d8273c49ad6\n */\n\n\nconst SymbolIterator = Object(_symbols__WEBPACK_IMPORTED_MODULE_1__[\"getSymbol\"])(\"iterator\");\nconst SymbolObservable = Object(_symbols__WEBPACK_IMPORTED_MODULE_1__[\"getSymbol\"])(\"observable\");\nconst SymbolSpecies = Object(_symbols__WEBPACK_IMPORTED_MODULE_1__[\"getSymbol\"])(\"species\");\n// === Abstract Operations ===\nfunction getMethod(obj, key) {\n const value = obj[key];\n if (value == null) {\n return undefined;\n }\n if (typeof value !== \"function\") {\n throw new TypeError(value + \" is not a function\");\n }\n return value;\n}\nfunction getSpecies(obj) {\n let ctor = obj.constructor;\n if (ctor !== undefined) {\n ctor = ctor[SymbolSpecies];\n if (ctor === null) {\n ctor = undefined;\n }\n }\n return ctor !== undefined ? ctor : Observable;\n}\nfunction isObservable(x) {\n return x instanceof Observable; // SPEC: Brand check\n}\nfunction hostReportError(error) {\n if (hostReportError.log) {\n hostReportError.log(error);\n }\n else {\n setTimeout(() => { throw error; }, 0);\n }\n}\nfunction enqueue(fn) {\n Promise.resolve().then(() => {\n try {\n fn();\n }\n catch (e) {\n hostReportError(e);\n }\n });\n}\nfunction cleanupSubscription(subscription) {\n const cleanup = subscription._cleanup;\n if (cleanup === undefined) {\n return;\n }\n subscription._cleanup = undefined;\n if (!cleanup) {\n return;\n }\n try {\n if (typeof cleanup === \"function\") {\n cleanup();\n }\n else {\n const unsubscribe = getMethod(cleanup, \"unsubscribe\");\n if (unsubscribe) {\n unsubscribe.call(cleanup);\n }\n }\n }\n catch (e) {\n hostReportError(e);\n }\n}\nfunction closeSubscription(subscription) {\n subscription._observer = undefined;\n subscription._queue = undefined;\n subscription._state = \"closed\";\n}\nfunction flushSubscription(subscription) {\n const queue = subscription._queue;\n if (!queue) {\n return;\n }\n subscription._queue = undefined;\n subscription._state = \"ready\";\n for (const item of queue) {\n notifySubscription(subscription, item.type, item.value);\n if (subscription._state === \"closed\") {\n break;\n }\n }\n}\nfunction notifySubscription(subscription, type, value) {\n subscription._state = \"running\";\n const observer = subscription._observer;\n try {\n const m = observer ? getMethod(observer, type) : undefined;\n switch (type) {\n case \"next\":\n if (m)\n m.call(observer, value);\n break;\n case \"error\":\n closeSubscription(subscription);\n if (m)\n m.call(observer, value);\n else\n throw value;\n break;\n case \"complete\":\n closeSubscription(subscription);\n if (m)\n m.call(observer);\n break;\n }\n }\n catch (e) {\n hostReportError(e);\n }\n if (subscription._state === \"closed\") {\n cleanupSubscription(subscription);\n }\n else if (subscription._state === \"running\") {\n subscription._state = \"ready\";\n }\n}\nfunction onNotify(subscription, type, value) {\n if (subscription._state === \"closed\") {\n return;\n }\n if (subscription._state === \"buffering\") {\n subscription._queue = subscription._queue || [];\n subscription._queue.push({ type, value });\n return;\n }\n if (subscription._state !== \"ready\") {\n subscription._state = \"buffering\";\n subscription._queue = [{ type, value }];\n enqueue(() => flushSubscription(subscription));\n return;\n }\n notifySubscription(subscription, type, value);\n}\nclass Subscription {\n constructor(observer, subscriber) {\n // ASSERT: observer is an object\n // ASSERT: subscriber is callable\n this._cleanup = undefined;\n this._observer = observer;\n this._queue = undefined;\n this._state = \"initializing\";\n const subscriptionObserver = new SubscriptionObserver(this);\n try {\n this._cleanup = subscriber.call(undefined, subscriptionObserver);\n }\n catch (e) {\n subscriptionObserver.error(e);\n }\n if (this._state === \"initializing\") {\n this._state = \"ready\";\n }\n }\n get closed() {\n return this._state === \"closed\";\n }\n unsubscribe() {\n if (this._state !== \"closed\") {\n closeSubscription(this);\n cleanupSubscription(this);\n }\n }\n}\nclass SubscriptionObserver {\n constructor(subscription) { this._subscription = subscription; }\n get closed() { return this._subscription._state === \"closed\"; }\n next(value) { onNotify(this._subscription, \"next\", value); }\n error(value) { onNotify(this._subscription, \"error\", value); }\n complete() { onNotify(this._subscription, \"complete\"); }\n}\n/**\n * The basic Observable class. This primitive is used to wrap asynchronous\n * data streams in a common standardized data type that is interoperable\n * between libraries and can be composed to represent more complex processes.\n */\nclass Observable {\n constructor(subscriber) {\n if (!(this instanceof Observable)) {\n throw new TypeError(\"Observable cannot be called as a function\");\n }\n if (typeof subscriber !== \"function\") {\n throw new TypeError(\"Observable initializer must be a function\");\n }\n this._subscriber = subscriber;\n }\n subscribe(nextOrObserver, onError, onComplete) {\n if (typeof nextOrObserver !== \"object\" || nextOrObserver === null) {\n nextOrObserver = {\n next: nextOrObserver,\n error: onError,\n complete: onComplete\n };\n }\n return new Subscription(nextOrObserver, this._subscriber);\n }\n pipe(first, ...mappers) {\n // tslint:disable-next-line no-this-assignment\n let intermediate = this;\n for (const mapper of [first, ...mappers]) {\n intermediate = mapper(intermediate);\n }\n return intermediate;\n }\n tap(nextOrObserver, onError, onComplete) {\n const tapObserver = typeof nextOrObserver !== \"object\" || nextOrObserver === null\n ? {\n next: nextOrObserver,\n error: onError,\n complete: onComplete\n }\n : nextOrObserver;\n return new Observable(observer => {\n return this.subscribe({\n next(value) {\n tapObserver.next && tapObserver.next(value);\n observer.next(value);\n },\n error(error) {\n tapObserver.error && tapObserver.error(error);\n observer.error(error);\n },\n complete() {\n tapObserver.complete && tapObserver.complete();\n observer.complete();\n },\n start(subscription) {\n tapObserver.start && tapObserver.start(subscription);\n }\n });\n });\n }\n forEach(fn) {\n return new Promise((resolve, reject) => {\n if (typeof fn !== \"function\") {\n reject(new TypeError(fn + \" is not a function\"));\n return;\n }\n function done() {\n subscription.unsubscribe();\n resolve(undefined);\n }\n const subscription = this.subscribe({\n next(value) {\n try {\n fn(value, done);\n }\n catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n error(error) {\n reject(error);\n },\n complete() {\n resolve(undefined);\n }\n });\n });\n }\n map(fn) {\n if (typeof fn !== \"function\") {\n throw new TypeError(fn + \" is not a function\");\n }\n const C = getSpecies(this);\n return new C(observer => this.subscribe({\n next(value) {\n let propagatedValue = value;\n try {\n propagatedValue = fn(value);\n }\n catch (e) {\n return observer.error(e);\n }\n observer.next(propagatedValue);\n },\n error(e) { observer.error(e); },\n complete() { observer.complete(); },\n }));\n }\n filter(fn) {\n if (typeof fn !== \"function\") {\n throw new TypeError(fn + \" is not a function\");\n }\n const C = getSpecies(this);\n return new C(observer => this.subscribe({\n next(value) {\n try {\n if (!fn(value))\n return;\n }\n catch (e) {\n return observer.error(e);\n }\n observer.next(value);\n },\n error(e) { observer.error(e); },\n complete() { observer.complete(); },\n }));\n }\n reduce(fn, seed) {\n if (typeof fn !== \"function\") {\n throw new TypeError(fn + \" is not a function\");\n }\n const C = getSpecies(this);\n const hasSeed = arguments.length > 1;\n let hasValue = false;\n let acc = seed;\n return new C(observer => this.subscribe({\n next(value) {\n const first = !hasValue;\n hasValue = true;\n if (!first || hasSeed) {\n try {\n acc = fn(acc, value);\n }\n catch (e) {\n return observer.error(e);\n }\n }\n else {\n acc = value;\n }\n },\n error(e) { observer.error(e); },\n complete() {\n if (!hasValue && !hasSeed) {\n return observer.error(new TypeError(\"Cannot reduce an empty sequence\"));\n }\n observer.next(acc);\n observer.complete();\n },\n }));\n }\n concat(...sources) {\n const C = getSpecies(this);\n return new C(observer => {\n let subscription;\n let index = 0;\n function startNext(next) {\n subscription = next.subscribe({\n next(v) { observer.next(v); },\n error(e) { observer.error(e); },\n complete() {\n if (index === sources.length) {\n subscription = undefined;\n observer.complete();\n }\n else {\n startNext(C.from(sources[index++]));\n }\n },\n });\n }\n startNext(this);\n return () => {\n if (subscription) {\n subscription.unsubscribe();\n subscription = undefined;\n }\n };\n });\n }\n flatMap(fn) {\n if (typeof fn !== \"function\") {\n throw new TypeError(fn + \" is not a function\");\n }\n const C = getSpecies(this);\n return new C(observer => {\n const subscriptions = [];\n const outer = this.subscribe({\n next(value) {\n let normalizedValue;\n if (fn) {\n try {\n normalizedValue = fn(value);\n }\n catch (e) {\n return observer.error(e);\n }\n }\n else {\n normalizedValue = value;\n }\n const inner = C.from(normalizedValue).subscribe({\n next(innerValue) { observer.next(innerValue); },\n error(e) { observer.error(e); },\n complete() {\n const i = subscriptions.indexOf(inner);\n if (i >= 0)\n subscriptions.splice(i, 1);\n completeIfDone();\n },\n });\n subscriptions.push(inner);\n },\n error(e) { observer.error(e); },\n complete() { completeIfDone(); },\n });\n function completeIfDone() {\n if (outer.closed && subscriptions.length === 0) {\n observer.complete();\n }\n }\n return () => {\n subscriptions.forEach(s => s.unsubscribe());\n outer.unsubscribe();\n };\n });\n }\n [(Symbol.observable, SymbolObservable)]() { return this; }\n static from(x) {\n const C = (typeof this === \"function\" ? this : Observable);\n if (x == null) {\n throw new TypeError(x + \" is not an object\");\n }\n const observableMethod = getMethod(x, SymbolObservable);\n if (observableMethod) {\n const observable = observableMethod.call(x);\n if (Object(observable) !== observable) {\n throw new TypeError(observable + \" is not an object\");\n }\n if (isObservable(observable) && observable.constructor === C) {\n return observable;\n }\n return new C(observer => observable.subscribe(observer));\n }\n if (Object(_symbols__WEBPACK_IMPORTED_MODULE_1__[\"hasSymbol\"])(\"iterator\")) {\n const iteratorMethod = getMethod(x, SymbolIterator);\n if (iteratorMethod) {\n return new C(observer => {\n enqueue(() => {\n if (observer.closed)\n return;\n for (const item of iteratorMethod.call(x)) {\n observer.next(item);\n if (observer.closed)\n return;\n }\n observer.complete();\n });\n });\n }\n }\n if (Array.isArray(x)) {\n return new C(observer => {\n enqueue(() => {\n if (observer.closed)\n return;\n for (const item of x) {\n observer.next(item);\n if (observer.closed)\n return;\n }\n observer.complete();\n });\n });\n }\n throw new TypeError(x + \" is not observable\");\n }\n static of(...items) {\n const C = (typeof this === \"function\" ? this : Observable);\n return new C(observer => {\n enqueue(() => {\n if (observer.closed)\n return;\n for (const item of items) {\n observer.next(item);\n if (observer.closed)\n return;\n }\n observer.complete();\n });\n });\n }\n static get [SymbolSpecies]() { return this; }\n}\nif (Object(_symbols__WEBPACK_IMPORTED_MODULE_1__[\"hasSymbols\"])()) {\n Object.defineProperty(Observable, Symbol(\"extensions\"), {\n value: {\n symbol: SymbolObservable,\n hostReportError,\n },\n configurable: true,\n });\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Observable);\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/observable.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/scan.js": +/*!******************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/scan.js ***! + \******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _scheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_scheduler */ \"./node_modules/observable-fns/dist.esm/_scheduler.js\");\n/* harmony import */ var _observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./observable */ \"./node_modules/observable-fns/dist.esm/observable.js\");\n/* harmony import */ var _unsubscribe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsubscribe */ \"./node_modules/observable-fns/dist.esm/unsubscribe.js\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\nfunction scan(accumulator, seed) {\n return (observable) => {\n return new _observable__WEBPACK_IMPORTED_MODULE_1__[\"default\"](observer => {\n let accumulated;\n let index = 0;\n const scheduler = new _scheduler__WEBPACK_IMPORTED_MODULE_0__[\"AsyncSerialScheduler\"](observer);\n const subscription = observable.subscribe({\n complete() {\n scheduler.complete();\n },\n error(error) {\n scheduler.error(error);\n },\n next(value) {\n scheduler.schedule((next) => __awaiter(this, void 0, void 0, function* () {\n const prevAcc = index === 0\n ? (typeof seed === \"undefined\" ? value : seed)\n : accumulated;\n accumulated = yield accumulator(prevAcc, value, index++);\n next(accumulated);\n }));\n }\n });\n return () => Object(_unsubscribe__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(subscription);\n });\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (scan);\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/scan.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/subject.js": +/*!*********************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/subject.js ***! + \*********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./observable */ \"./node_modules/observable-fns/dist.esm/observable.js\");\n\n// TODO: This observer iteration approach looks inelegant and expensive\n// Idea: Come up with super class for Subscription that contains the\n// notify*, ... methods and use it here\n/**\n * A subject is a \"hot\" observable (see `multicast`) that has its observer\n * methods (`.next(value)`, `.error(error)`, `.complete()`) exposed.\n *\n * Be careful, though! With great power comes great responsibility. Only use\n * the `Subject` when you really need to trigger updates \"from the outside\" and\n * try to keep the code that can access it to a minimum. Return\n * `Observable.from(mySubject)` to not allow other code to mutate.\n */\nclass MulticastSubject extends _observable__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor() {\n super(observer => {\n this._observers.add(observer);\n return () => this._observers.delete(observer);\n });\n this._observers = new Set();\n }\n next(value) {\n for (const observer of this._observers) {\n observer.next(value);\n }\n }\n error(error) {\n for (const observer of this._observers) {\n observer.error(error);\n }\n }\n complete() {\n for (const observer of this._observers) {\n observer.complete();\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (MulticastSubject);\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/subject.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/symbols.js": +/*!*********************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/symbols.js ***! + \*********************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/symbols.js?"); + +/***/ }), + +/***/ "./node_modules/observable-fns/dist.esm/unsubscribe.js": +/*!*************************************************************!*\ + !*** ./node_modules/observable-fns/dist.esm/unsubscribe.js ***! + \*************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * Unsubscribe from a subscription returned by something that looks like an observable,\n * but is not necessarily our observable implementation.\n */\nfunction unsubscribe(subscription) {\n if (typeof subscription === \"function\") {\n subscription();\n }\n else if (subscription && typeof subscription.unsubscribe === \"function\") {\n subscription.unsubscribe();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (unsubscribe);\n\n\n//# sourceURL=webpack:///./node_modules/observable-fns/dist.esm/unsubscribe.js?"); + +/***/ }), + +/***/ "./node_modules/process/browser.js": +/*!*****************************************!*\ + !*** ./node_modules/process/browser.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack:///./node_modules/process/browser.js?"); + +/***/ }), + +/***/ "./node_modules/randombytes/browser.js": +/*!*********************************************!*\ + !*** ./node_modules/randombytes/browser.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/* WEBPACK VAR INJECTION */(function(global, process) {\n\n// limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\nvar MAX_BYTES = 65536\n\n// Node supports requesting up to this number of bytes\n// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48\nvar MAX_UINT32 = 4294967295\n\nfunction oldBrowser () {\n throw new Error('Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11')\n}\n\nvar Buffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\").Buffer\nvar crypto = global.crypto || global.msCrypto\n\nif (crypto && crypto.getRandomValues) {\n module.exports = randomBytes\n} else {\n module.exports = oldBrowser\n}\n\nfunction randomBytes (size, cb) {\n // phantomjs needs to throw\n if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')\n\n var bytes = Buffer.allocUnsafe(size)\n\n if (size > 0) { // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues\n // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n for (var generated = 0; generated < size; generated += MAX_BYTES) {\n // buffer.slice automatically checks if the end is past the end of\n // the buffer so we don't have to here\n crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))\n }\n } else {\n crypto.getRandomValues(bytes)\n }\n }\n\n if (typeof cb === 'function') {\n return process.nextTick(function () {\n cb(null, bytes)\n })\n }\n\n return bytes\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/randombytes/browser.js?"); + +/***/ }), + +/***/ "./node_modules/randomfill/browser.js": +/*!********************************************!*\ + !*** ./node_modules/randomfill/browser.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/* WEBPACK VAR INJECTION */(function(global, process) {\n\nfunction oldBrowser () {\n throw new Error('secure random number generation not supported by this browser\\nuse chrome, FireFox or Internet Explorer 11')\n}\nvar safeBuffer = __webpack_require__(/*! safe-buffer */ \"./node_modules/safe-buffer/index.js\")\nvar randombytes = __webpack_require__(/*! randombytes */ \"./node_modules/randombytes/browser.js\")\nvar Buffer = safeBuffer.Buffer\nvar kBufferMaxLength = safeBuffer.kMaxLength\nvar crypto = global.crypto || global.msCrypto\nvar kMaxUint32 = Math.pow(2, 32) - 1\nfunction assertOffset (offset, length) {\n if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare\n throw new TypeError('offset must be a number')\n }\n\n if (offset > kMaxUint32 || offset < 0) {\n throw new TypeError('offset must be a uint32')\n }\n\n if (offset > kBufferMaxLength || offset > length) {\n throw new RangeError('offset out of range')\n }\n}\n\nfunction assertSize (size, offset, length) {\n if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare\n throw new TypeError('size must be a number')\n }\n\n if (size > kMaxUint32 || size < 0) {\n throw new TypeError('size must be a uint32')\n }\n\n if (size + offset > length || size > kBufferMaxLength) {\n throw new RangeError('buffer too small')\n }\n}\nif ((crypto && crypto.getRandomValues) || !process.browser) {\n exports.randomFill = randomFill\n exports.randomFillSync = randomFillSync\n} else {\n exports.randomFill = oldBrowser\n exports.randomFillSync = oldBrowser\n}\nfunction randomFill (buf, offset, size, cb) {\n if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {\n throw new TypeError('\"buf\" argument must be a Buffer or Uint8Array')\n }\n\n if (typeof offset === 'function') {\n cb = offset\n offset = 0\n size = buf.length\n } else if (typeof size === 'function') {\n cb = size\n size = buf.length - offset\n } else if (typeof cb !== 'function') {\n throw new TypeError('\"cb\" argument must be a function')\n }\n assertOffset(offset, buf.length)\n assertSize(size, offset, buf.length)\n return actualFill(buf, offset, size, cb)\n}\n\nfunction actualFill (buf, offset, size, cb) {\n if (process.browser) {\n var ourBuf = buf.buffer\n var uint = new Uint8Array(ourBuf, offset, size)\n crypto.getRandomValues(uint)\n if (cb) {\n process.nextTick(function () {\n cb(null, buf)\n })\n return\n }\n return buf\n }\n if (cb) {\n randombytes(size, function (err, bytes) {\n if (err) {\n return cb(err)\n }\n bytes.copy(buf, offset)\n cb(null, buf)\n })\n return\n }\n var bytes = randombytes(size)\n bytes.copy(buf, offset)\n return buf\n}\nfunction randomFillSync (buf, offset, size) {\n if (typeof offset === 'undefined') {\n offset = 0\n }\n if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {\n throw new TypeError('\"buf\" argument must be a Buffer or Uint8Array')\n }\n\n assertOffset(offset, buf.length)\n\n if (size === undefined) size = buf.length - offset\n\n assertSize(size, offset, buf.length)\n\n return actualFill(buf, offset, size)\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\"), __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/randomfill/browser.js?"); + +/***/ }), + +/***/ "./node_modules/safe-buffer/index.js": +/*!*******************************************!*\ + !*** ./node_modules/safe-buffer/index.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/*! safe-buffer. MIT License. Feross Aboukhadijeh */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = __webpack_require__(/*! buffer */ \"./node_modules/buffer/index.js\")\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n\n\n//# sourceURL=webpack:///./node_modules/safe-buffer/index.js?"); + +/***/ }), + +/***/ "./node_modules/setimmediate/setImmediate.js": +/*!***************************************************!*\ + !*** ./node_modules/setimmediate/setImmediate.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {\n \"use strict\";\n\n if (global.setImmediate) {\n return;\n }\n\n var nextHandle = 1; // Spec says greater than zero\n var tasksByHandle = {};\n var currentlyRunningATask = false;\n var doc = global.document;\n var registerImmediate;\n\n function setImmediate(callback) {\n // Callback can either be a function or a string\n if (typeof callback !== \"function\") {\n callback = new Function(\"\" + callback);\n }\n // Copy function arguments\n var args = new Array(arguments.length - 1);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i + 1];\n }\n // Store and register the task\n var task = { callback: callback, args: args };\n tasksByHandle[nextHandle] = task;\n registerImmediate(nextHandle);\n return nextHandle++;\n }\n\n function clearImmediate(handle) {\n delete tasksByHandle[handle];\n }\n\n function run(task) {\n var callback = task.callback;\n var args = task.args;\n switch (args.length) {\n case 0:\n callback();\n break;\n case 1:\n callback(args[0]);\n break;\n case 2:\n callback(args[0], args[1]);\n break;\n case 3:\n callback(args[0], args[1], args[2]);\n break;\n default:\n callback.apply(undefined, args);\n break;\n }\n }\n\n function runIfPresent(handle) {\n // From the spec: \"Wait until any invocations of this algorithm started before this one have completed.\"\n // So if we're currently running a task, we'll need to delay this invocation.\n if (currentlyRunningATask) {\n // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n // \"too much recursion\" error.\n setTimeout(runIfPresent, 0, handle);\n } else {\n var task = tasksByHandle[handle];\n if (task) {\n currentlyRunningATask = true;\n try {\n run(task);\n } finally {\n clearImmediate(handle);\n currentlyRunningATask = false;\n }\n }\n }\n }\n\n function installNextTickImplementation() {\n registerImmediate = function(handle) {\n process.nextTick(function () { runIfPresent(handle); });\n };\n }\n\n function canUsePostMessage() {\n // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n // where `global.postMessage` means something completely different and can't be used for this purpose.\n if (global.postMessage && !global.importScripts) {\n var postMessageIsAsynchronous = true;\n var oldOnMessage = global.onmessage;\n global.onmessage = function() {\n postMessageIsAsynchronous = false;\n };\n global.postMessage(\"\", \"*\");\n global.onmessage = oldOnMessage;\n return postMessageIsAsynchronous;\n }\n }\n\n function installPostMessageImplementation() {\n // Installs an event handler on `global` for the `message` event: see\n // * https://developer.mozilla.org/en/DOM/window.postMessage\n // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n var messagePrefix = \"setImmediate$\" + Math.random() + \"$\";\n var onGlobalMessage = function(event) {\n if (event.source === global &&\n typeof event.data === \"string\" &&\n event.data.indexOf(messagePrefix) === 0) {\n runIfPresent(+event.data.slice(messagePrefix.length));\n }\n };\n\n if (global.addEventListener) {\n global.addEventListener(\"message\", onGlobalMessage, false);\n } else {\n global.attachEvent(\"onmessage\", onGlobalMessage);\n }\n\n registerImmediate = function(handle) {\n global.postMessage(messagePrefix + handle, \"*\");\n };\n }\n\n function installMessageChannelImplementation() {\n var channel = new MessageChannel();\n channel.port1.onmessage = function(event) {\n var handle = event.data;\n runIfPresent(handle);\n };\n\n registerImmediate = function(handle) {\n channel.port2.postMessage(handle);\n };\n }\n\n function installReadyStateChangeImplementation() {\n var html = doc.documentElement;\n registerImmediate = function(handle) {\n // Create a